Analysis I, Section 5.3: The construction of the real numbers #
I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.
Main constructions and results of this section:
- Notion of a formal limit of a Cauchy sequence.
- Construction of a real number type
Chapter5.Real. - Basic arithmetic operations and properties.
Tips from past users #
Users of the companion who have completed the exercises in this section are welcome to send their tips for future users in this section as PRs.
- (Add tip here)
A sequence starting at zero that is Cauchy, can be viewed as a Cauchy sequence.
Equations
- Chapter5.CauchySequence.mk' ha = { n₀ := 0, seq := (↑a).seq, vanish := ⋯, zero := Chapter5.CauchySequence.mk'._proof_2, cauchy := ha }
Instances For
Equations
- Chapter5.CauchySequence.instCoeFun = { coe := fun (a : Chapter5.CauchySequence) (n : ℕ) => a.seq ↑n }
Proposition 5.3.3 / Exercise 5.3.1
Equations
- One or more equations did not get rendered due to their size.
Every constant sequence is Cauchy
Instances For
It is convenient in Lean to assign the "dummy" value of 0 to LIM a when a is not Cauchy.
This requires Classical logic, because the property of being Cauchy is not computable or
decidable.
Equations
- Chapter5.LIM a = ⟦if h : (↑a).IsCauchy then Chapter5.CauchySequence.mk' h else 0⟧
Instances For
Definition 5.3.4 (Addition of reals)
Equations
- One or more equations did not get rendered due to their size.
Definition 5.3.9 (Product of reals)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Chapter5.Real.instRatCast = { ratCast := fun (q : ℚ) => ⟦Chapter5.CauchySequence.mk' ⋯⟧ }
Equations
- Chapter5.Real.instOfNat = { ofNat := ↑↑n }
Equations
- Chapter5.Real.instNatCast = { natCast := fun (n : ℕ) => ↑↑n }
Equations
- Chapter5.Real.instIntCast = { intCast := fun (n : ℤ) => ↑↑n }
Equations
- Chapter5.Real.instNeg = { neg := fun (x : Chapter5.Real) => ↑(-1) * x }
Proposition 5.3.11 (laws of algebra)
Proposition 5.3.11 (laws of algebra)
Equations
- Chapter5.Real.instAddCommGroup = { toAddGroup := Chapter5.Real.addGroup_inst, add_comm := Chapter5.Real.instAddCommGroup._proof_1 }
Proposition 5.3.11 (laws of algebra)
Equations
- One or more equations did not get rendered due to their size.
Proposition 5.3.11 (laws of algebra)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This result was not explicitly stated in the text, but is needed in the theory. It's a good exercise, so I'm setting it as such.
Lemma 5.3.15
Definition 5.3.16 (Reciprocation of real numbers). Requires classical logic because we need to assign a "junk" value to the inverse of 0.
Equations
- Chapter5.Real.instInv = { inv := fun (x : Chapter5.Real) => if h : x ≠ 0 then Chapter5.LIM ⋯.choose⁻¹ else 0 }
Default definition of division
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Exercise 5.3.4