Real numbers from Cauchy sequences #
This file defines ℝ as the type of equivalence classes of Cauchy sequences of rational numbers.
This choice is motivated by how easy it is to prove that ℝ is a commutative ring, by simply
lifting everything to ℚ.
The facts that the real numbers are an Archimedean floor ring,
and a conditionally complete linear order,
have been deferred to the file Mathlib/Data/Real/Archimedean.lean,
in order to keep the imports here simple.
The type ℝ of real numbers constructed as equivalence classes of Cauchy sequences of rational
numbers.
- ofCauchy :: (
- cauchy : CauSeq.Completion.Cauchy abs
The underlying Cauchy completion
- )
Instances For
The type ℝ of real numbers constructed as equivalence classes of Cauchy sequences of rational
numbers.
Equations
- termℝ = Lean.ParserDescr.node `termℝ 1024 (Lean.ParserDescr.symbol "ℝ")
Instances For
The real numbers are isomorphic to the quotient of Cauchy sequences on the rationals.
Equations
- Real.equivCauchy = { toFun := Real.cauchy, invFun := Real.ofCauchy, left_inv := Real.equivCauchy.proof_1, right_inv := Real.equivCauchy.proof_2 }
Instances For
Equations
- Real.instSubReal = { sub := fun (a b : ℝ) => a + -b }
Equations
- Real.instInvReal = { inv := Real.inv' }
Equations
- Real.natCast = { natCast := fun (n : ℕ) => { cauchy := ↑n } }
Equations
- Real.intCast = { intCast := fun (z : ℤ) => { cauchy := ↑z } }
Equations
- Real.ratCast = { ratCast := fun (q : ℚ) => { cauchy := ↑q } }
Real.equivCauchy as a ring equivalence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extra instances to short-circuit type class resolution.
These short-circuits have an additional property of ensuring that a computable path is found; if
Field ℝ is found first, then decaying it to these typeclasses would result in a noncomputable
version of them.
Equations
- Real.instCommSemiringReal = inferInstance
Equations
- Real.instCommMonoidWithZeroReal = inferInstance
Equations
- Real.instMonoidWithZeroReal = inferInstance
Equations
- Real.instAddCommGroupReal = inferInstance
Equations
- Real.instAddCommMonoidReal = inferInstance
Equations
- Real.instAddLeftCancelSemigroupReal = inferInstance
Equations
- Real.instAddRightCancelSemigroupReal = inferInstance
Equations
- Real.instAddCommSemigroupReal = inferInstance
Equations
- Real.instAddSemigroupReal = inferInstance
Equations
- Real.instCommMonoidReal = inferInstance
Equations
- Real.instCommSemigroupReal = inferInstance
Equations
- Real.instInhabitedReal = { default := 0 }
The real numbers are a *-ring, with the trivial *-structure.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Real.instStrictOrderedCommRingReal = let __src := Real.commRing; let __src_1 := Real.partialOrder; let __src_2 := Real.semiring; StrictOrderedCommRing.mk ⋯
Equations
- Real.strictOrderedRing = inferInstance
Equations
- Real.strictOrderedCommSemiring = inferInstance
Equations
- Real.strictOrderedSemiring = inferInstance
Equations
- Real.orderedAddCommGroup = inferInstance
Equations
- Real.orderedCancelAddCommMonoid = inferInstance
Equations
- Real.orderedAddCommMonoid = inferInstance
Equations
Equations
- Real.instSemilatticeInfReal = inferInstance
Equations
- Real.instSemilatticeSupReal = inferInstance
Equations
Equations
Equations
- Real.linearOrderedCommRing = let __src := Real.nontrivial; let __src_1 := Real.strictOrderedRing; let __src_2 := Real.commRing; let __src_3 := Real.linearOrder; LinearOrderedCommRing.mk ⋯
Equations
- Real.instLinearOrderedRingReal = inferInstance
Equations
- Real.instLinearOrderedSemiringReal = inferInstance
Equations
- One or more equations did not get rendered due to their size.
Equations
- Real.instLinearOrderedAddCommGroupReal = inferInstance
Equations
- Real.instDivisionRingReal = inferInstance
Equations
- Real.decidableLT a b = inferInstance
Equations
- Real.decidableLE a b = inferInstance
Equations
- Real.decidableEq a b = inferInstance
Show an underlying cauchy sequence for real numbers.
The representative chosen is the one passed in the VM to Quot.mk, so two cauchy sequences
converging to the same number may be printed differently.
Equations
- Real.instReprReal = { reprPrec := fun (r : ℝ) (x : ℕ) => Std.Format.text "Real.ofCauchy " ++ repr r.cauchy }