Documentation

Analysis.Section_5_1

Analysis I, Section 5.1: Cauchy sequences #

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.

Definition 5.1.1 (Sequence). To avoid some technicalities involving dependent types, we extend sequences by zero to the left of the starting point n₀.

Instances For
    theorem Chapter5.Sequence.ext {x y : Sequence} (n₀ : x.n₀ = y.n₀) (seq : x.seq = y.seq) :
    x = y

    Sequences can be thought of as functions from ℤ to ℚ.

    Equations

    Functions from ℕ to ℚ can be thought of as sequences starting from 0; ofNatFun performs this conversion.

    The coe attribute allows the delaborator to print Sequence.ofNatFun f as ↑f, which is more concise; you may safely remove this if you prefer the more explicit notation.

    Equations
    Instances For

      If a : ℕ → ℚ is used in a context where a Sequence is expected, automatically coerce a to Sequence.ofNatFun a (which will be pretty-printed as ↑a)

      Equations
      @[reducible, inline]
      abbrev Chapter5.Sequence.mk' (n₀ : ) (a : { n : // n n₀ }) :
      Equations
      Instances For
        theorem Chapter5.Sequence.eval_mk {n n₀ : } (a : { n : // n n₀ }) (h : n n₀) :
        (mk' n₀ a).seq n = a n, h
        @[simp]
        theorem Chapter5.Sequence.eval_coe (n : ) (a : ) :
        (↑a).seq n = a n
        @[simp]
        theorem Chapter5.Sequence.eval_coe_at_int (n : ) (a : ) :
        (↑a).seq n = if n 0 then a n.toNat else 0
        @[simp]
        theorem Chapter5.Sequence.n0_coe (a : ) :
        (↑a).n₀ = 0
        @[reducible, inline]

        Example 5.1.2

        Equations
        Instances For
          @[reducible, inline]

          Example 5.1.2

          Equations
          Instances For
            @[reducible, inline]

            Example 5.1.2

            Equations
            Instances For
              @[reducible, inline]
              abbrev Rat.Steady (ε : ) (a : Chapter5.Sequence) :

              A slight generalization of Definition 5.1.3 - definition of ε-steadiness for a sequence with an arbitrary starting point n₀

              Equations
              Instances For
                theorem Rat.steady_def (ε : ) (a : Chapter5.Sequence) :
                ε.Steady a na.n₀, ma.n₀, ε.Close (a.seq n) (a.seq m)
                theorem Chapter5.Rat.Steady.coe (ε : ) (a : ) :
                ε.Steady a ∀ (n m : ), ε.Close (a n) (a m)

                Definition 5.1.3 - definition of ε-steadiness for a sequence starting at 0

                @[reducible, inline]

                a.from n₁ starts a:Sequence from n₁. It is intended for use when n₁ ≥ n₀, but returns the "junk" value of the original sequence a otherwise.

                Equations
                Instances For
                  theorem Chapter5.Sequence.from_eval (a : Sequence) {n₁ n : } (hn : n n₁) :
                  (a.from n₁).seq n = a.seq n
                  @[reducible, inline]

                  Definition 5.1.6 (Eventually ε-steady)

                  Equations
                  Instances For
                    theorem Rat.eventuallySteady_def (ε : ) (a : Chapter5.Sequence) :
                    ε.EventuallySteady a Na.n₀, ε.Steady (a.from N)
                    theorem Chapter5.Sequence.ex_5_1_7_a :
                    ¬Rat.Steady 0.1 fun (n : ) => (n + 1)⁻¹

                    Example 5.1.7: The sequence 1, 1/2, 1/3, ... is not 0.1-steady

                    theorem Chapter5.Sequence.ex_5_1_7_b :
                    Rat.Steady 0.1 ((↑fun (n : ) => (n + 1)⁻¹).from 10)

                    Example 5.1.7: The sequence a_10, a_11, a_12, ... is 0.1-steady

                    theorem Chapter5.Sequence.ex_5_1_7_c :
                    Rat.EventuallySteady 0.1 fun (n : ) => (n + 1)⁻¹

                    Example 5.1.7: The sequence 1, 1/2, 1/3, ... is eventually 0.1-steady

                    theorem Chapter5.Sequence.ex_5_1_7_d {ε : } ( : ε > 0) :
                    ε.EventuallySteady fun (n : ) => if n = 0 then 10 else 0

                    Example 5.1.7

                    The sequence 10, 0, 0, ... is eventually ε-steady for every ε > 0. Left as an exercise.

                    @[reducible, inline]
                    Equations
                    Instances For
                      theorem Chapter5.Sequence.IsCauchy.coe (a : ) :
                      (↑a).IsCauchy ε > 0, ∃ (N : ), jN, kN, Section_4_3.dist (a j) (a k) ε

                      Definition of Cauchy sequences, for a sequence starting at 0

                      theorem Chapter5.Sequence.IsCauchy.mk {n₀ : } (a : { n : // n n₀ }) :
                      (mk' n₀ a).IsCauchy ε > 0, Nn₀, jN, kN, Section_4_3.dist ((mk' n₀ a).seq j) ((mk' n₀ a).seq k) ε
                      Equations
                      Instances For

                        Example 5.1.10. (This requires extensive familiarity with Mathlib's API for the real numbers.)

                        Example 5.1.10. (This requires extensive familiarity with Mathlib's API for the real numbers.)

                        theorem Chapter5.Sequence.IsCauchy.harmonic :
                        (mk' 1 fun (n : { n : // n 1 }) => 1 / n).IsCauchy

                        Proposition 5.1.11. The harmonic sequence, defined as a₁ = 1, a₂ = 1/2, ... is a Cauchy sequence.

                        @[reducible, inline]
                        abbrev Chapter5.BoundedBy {n : } (a : Fin n) (M : ) :
                        Equations
                        Instances For
                          theorem Chapter5.boundedBy_def {n : } (a : Fin n) (M : ) :
                          BoundedBy a M ∀ (i : Fin n), |a i| M

                          Definition 5.1.12 (bounded sequences). Here we start sequences from 0 rather than 1 to align better with Mathlib conventions.

                          @[reducible, inline]
                          Equations
                          Instances For
                            theorem Chapter5.Sequence.boundedBy_def (a : Sequence) (M : ) :
                            a.BoundedBy M ∀ (n : ), |a.seq n| M

                            Definition 5.1.12 (bounded sequences)

                            @[reducible, inline]
                            Equations
                            Instances For

                              Definition 5.1.12 (bounded sequences)

                              theorem Chapter5.IsBounded.finite {n : } (a : Fin n) :
                              M0, BoundedBy a M

                              Lemma 5.1.14

                              Lemma 5.1.15 (Cauchy sequences are bounded) / Exercise 5.1.1

                              theorem Chapter5.Sequence.isBounded_add {a b : } (ha : (↑a).IsBounded) (hb : (↑b).IsBounded) :
                              (↑(a + b)).IsBounded

                              Exercise 5.1.2

                              theorem Chapter5.Sequence.isBounded_sub {a b : } (ha : (↑a).IsBounded) (hb : (↑b).IsBounded) :
                              (↑(a - b)).IsBounded
                              theorem Chapter5.Sequence.isBounded_mul {a b : } (ha : (↑a).IsBounded) (hb : (↑b).IsBounded) :
                              (↑(a * b)).IsBounded