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 ℚ
.
- ofCauchy :: (
- cauchy : CauSeq.Completion.Cauchy abs
The underlying Cauchy completion
- )
The type ℝ
of real numbers constructed as equivalence classes of Cauchy sequences of rational
numbers.
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.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
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 (_ : ∀ (a b : ℝ), a * b = b * a)
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
- One or more equations did not get rendered due to their size.
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 }
Equations
- Real.instSupSetReal = { sSup := fun S => if h : Set.Nonempty S ∧ BddAbove S then Classical.choose (_ : ∃ x, IsLUB S x) else 0 }
Equations
- Real.instInfSetReal = { sInf := fun S => -sSup (-S) }
Equations
- One or more equations did not get rendered due to their size.
As 0
is the default value for Real.sSup
of the empty set or sets which are not bounded above, it
suffices to show that all elements of S
are bounded by a nonnegative number to show that sSup S
is bounded by this number.
Equations
- One or more equations did not get rendered due to their size.