Documentation

Analysis.Section_5_3

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:

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.

A class of Cauchy sequences that start at zero

Instances
    theorem Chapter5.CauchySequence.ext {x y : CauchySequence} (n₀ : x.n₀ = y.n₀) (seq : x.seq = y.seq) :
    x = y
    @[reducible, inline]

    A sequence starting at zero that is Cauchy, can be viewed as a Cauchy sequence.

    Equations
    Instances For
      @[simp]
      theorem Chapter5.CauchySequence.coe_eq {a : } (ha : (↑a).IsCauchy) :
      (mk' ha).toSequence = a
      @[simp]
      theorem Chapter5.CauchySequence.coe_to_sequence (a : CauchySequence) :
      (↑fun (n : ) => a.seq n) = a.toSequence
      @[simp]
      theorem Chapter5.CauchySequence.coe_coe {a : } (ha : (↑a).IsCauchy) :
      (fun (n : ) => (mk' ha).seq n) = a
      theorem Chapter5.Sequence.equiv_trans {a b c : } (hab : Equiv a b) (hbc : Equiv b c) :
      Equiv a c

      Proposition 5.3.3 / Exercise 5.3.1

      Proposition 5.3.3 / Exercise 5.3.1

      Equations
      • One or more equations did not get rendered due to their size.
      theorem Chapter5.CauchySequence.equiv_iff (a b : CauchySequence) :
      a b Sequence.Equiv (fun (n : ) => a.seq n) fun (n : ) => b.seq n
      theorem Chapter5.Sequence.IsCauchy.const (a : ) :
      (↑fun (x : ) => a).IsCauchy

      Every constant sequence is Cauchy

      @[reducible, inline]
      Equations
      Instances For
        @[reducible, inline]
        noncomputable abbrev Chapter5.LIM (a : ) :

        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
        Instances For
          theorem Chapter5.LIM_def {a : } (ha : (↑a).IsCauchy) :
          theorem Chapter5.Real.eq_lim (x : Real) :
          ∃ (a : ), (↑a).IsCauchy x = LIM a

          Definition 5.3.1 (Real numbers)

          theorem Chapter5.Real.LIM_eq_LIM {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :

          Definition 5.3.1 (Real numbers)

          theorem Chapter5.Sequence.IsCauchy.add {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          (↑(a + b)).IsCauchy

          Lemma 5.3.6 (Sum of Cauchy sequences is Cauchy)

          theorem Chapter5.Sequence.add_equiv_left {a a' : } (b : ) (haa' : Equiv a a') :
          Equiv (a + b) (a' + b)

          Lemma 5.3.7 (Sum of equivalent sequences is equivalent)

          theorem Chapter5.Sequence.add_equiv_right {b b' : } (a : ) (hbb' : Equiv b b') :
          Equiv (a + b) (a + b')

          Lemma 5.3.7 (Sum of equivalent sequences is equivalent)

          theorem Chapter5.Sequence.add_equiv {a b a' b' : } (haa' : Equiv a a') (hbb' : Equiv b b') :
          Equiv (a + b) (a' + b')

          Lemma 5.3.7 (Sum of equivalent sequences is equivalent)

          noncomputable instance Chapter5.Real.add_inst :

          Definition 5.3.4 (Addition of reals)

          Equations
          • One or more equations did not get rendered due to their size.
          theorem Chapter5.Real.LIM_add {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          LIM a + LIM b = LIM (a + b)

          Definition 5.3.4 (Addition of reals)

          theorem Chapter5.Sequence.IsCauchy.mul {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          (↑(a * b)).IsCauchy

          Proposition 5.3.10 (Product of Cauchy sequences is Cauchy)

          theorem Chapter5.Sequence.mul_equiv_left {a a' : } (b : ) (hb : (↑b).IsCauchy) (haa' : Equiv a a') :
          Equiv (a * b) (a' * b)

          Proposition 5.3.10 (Product of equivalent sequences is equivalent) / Exercise 5.3.2

          theorem Chapter5.Sequence.mul_equiv_right {b b' : } (a : ) (ha : (↑a).IsCauchy) (hbb' : Equiv b b') :
          Equiv (a * b) (a * b')

          Proposition 5.3.10 (Product of equivalent sequences is equivalent) / Exercise 5.3.2

          theorem Chapter5.Sequence.mul_equiv {a b a' b' : } (ha : (↑a).IsCauchy) (hb' : (↑b').IsCauchy) (haa' : Equiv a a') (hbb' : Equiv b b') :
          Equiv (a * b) (a' * b')

          Proposition 5.3.10 (Product of equivalent sequences is equivalent) / Exercise 5.3.2

          noncomputable instance Chapter5.Real.mul_inst :

          Definition 5.3.9 (Product of reals)

          Equations
          • One or more equations did not get rendered due to their size.
          theorem Chapter5.Real.LIM_mul {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          LIM a * LIM b = LIM (a * b)
          theorem Chapter5.Real.ratCast_def (q : ) :
          q = LIM fun (x : ) => q
          @[simp]
          theorem Chapter5.Real.ratCast_inj (q r : ) :
          q = r q = r

          Exercise 5.3.3

          Equations
          Equations
          @[simp]
          theorem Chapter5.Real.LIM.zero :
          (LIM fun (x : ) => 0) = 0
          Equations
          theorem Chapter5.Real.ratCast_add (a b : ) :
          a + b = ↑(a + b)

          ratCast distributes over addition

          theorem Chapter5.Real.ratCast_mul (a b : ) :
          a * b = ↑(a * b)

          ratCast distributes over multiplication

          noncomputable instance Chapter5.Real.instNeg :
          Equations
          theorem Chapter5.Real.neg_ratCast (a : ) :
          -a = ↑(-a)

          ratCast commutes with negation

          theorem Chapter5.Real.neg_LIM (a : ) (ha : (↑a).IsCauchy) :
          -LIM a = LIM (-a)

          It may be possible to omit the Cauchy sequence hypothesis here.

          theorem Chapter5.Real.IsCauchy.neg (a : ) (ha : (↑a).IsCauchy) :
          (↑(-a)).IsCauchy
          theorem Chapter5.Real.sub_eq_add_neg (x y : Real) :
          x - y = x + -y
          theorem Chapter5.Sequence.IsCauchy.sub {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          (↑(a - b)).IsCauchy
          theorem Chapter5.Real.LIM_sub {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) :
          LIM a - LIM b = LIM (a - b)

          LIM distributes over subtraction

          theorem Chapter5.Real.ratCast_sub (a b : ) :
          a - b = ↑(a - b)

          ratCast distributes over subtraction

          Proposition 5.3.11 (laws of algebra)

          Equations

          Proposition 5.3.11 (laws of algebra)

          Equations
          • One or more equations did not get rendered due to their size.
          noncomputable instance Chapter5.Real.instCommRing :

          Proposition 5.3.11 (laws of algebra)

          Equations
          • One or more equations did not get rendered due to their size.
          @[reducible, inline]
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[reducible, inline]

            Definition 5.3.12 (sequences bounded away from zero). Sequences are indexed to start from zero as this is more convenient for Mathlib purposes.

            Equations
            Instances For
              theorem Chapter5.bounded_away_zero_def (a : ) :
              BoundedAwayZero a c > 0, ∀ (n : ), |a n| c
              theorem Chapter5.Real.boundedAwayZero_of_nonzero {x : Real} (hx : x 0) :
              ∃ (a : ), (↑a).IsCauchy BoundedAwayZero a x = LIM a

              Lemma 5.3.14

              theorem Chapter5.Real.lim_of_boundedAwayZero {a : } (ha : BoundedAwayZero a) (ha_cauchy : (↑a).IsCauchy) :
              LIM a 0

              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.

              theorem Chapter5.Real.inv_isCauchy_of_boundedAwayZero {a : } (ha : BoundedAwayZero a) (ha_cauchy : (↑a).IsCauchy) :

              Lemma 5.3.15

              theorem Chapter5.Real.inv_of_equiv {a b : } (ha : BoundedAwayZero a) (ha_cauchy : (↑a).IsCauchy) (hb : BoundedAwayZero b) (hb_cauchy : (↑b).IsCauchy) (hlim : LIM a = LIM b) :

              Lemma 5.3.17 (Reciprocation is well-defined)

              noncomputable instance Chapter5.Real.instInv :

              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
              theorem Chapter5.Real.inv_def {a : } (h : BoundedAwayZero a) (hc : (↑a).IsCauchy) :
              theorem Chapter5.Real.self_mul_inv {x : Real} (hx : x 0) :
              x * x⁻¹ = 1
              theorem Chapter5.Real.inv_mul_self {x : Real} (hx : x 0) :
              x⁻¹ * x = 1
              theorem Chapter5.BoundedAwayZero.const {q : } (hq : q 0) :
              BoundedAwayZero fun (x : ) => q

              Default definition of division

              Equations
              • One or more equations did not get rendered due to their size.
              theorem Chapter5.Real.div_eq (x y : Real) :
              x / y = x * y⁻¹
              noncomputable instance Chapter5.Real.instField :
              Equations
              • One or more equations did not get rendered due to their size.
              theorem Chapter5.Real.mul_right_cancel₀ {x y z : Real} (hz : z 0) (h : x * z = y * z) :
              x = y
              theorem Chapter5.Real.mul_right_nocancel :
              ¬∀ (x y z : Real), z = 0x * z = y * zx = y
              theorem Chapter5.Real.IsBounded.equiv {a b : } (ha : (↑a).IsBounded) (hab : Sequence.Equiv a b) :
              (↑b).IsBounded

              Exercise 5.3.4

              theorem Chapter5.Sequence.IsCauchy.harmonic' :
              (↑fun (n : ) => 1 / (n + 1)).IsCauchy

              Same as Sequence.IsCauchy.harmonic but reindexing the sequence as a₀ = 1, a₁ = 1/2, ... This form is more convenient for the upcoming proof of Theorem 5.5.9.

              theorem Chapter5.Real.LIM.harmonic :
              (LIM fun (n : ) => 1 / (n + 1)) = 0

              Exercise 5.3.5