Documentation

Analysis.Section_5_4

Analysis I, Section 5.4: Ordering the reals #

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.

@[reducible, inline]

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

Equations
Instances For
    @[reducible, inline]

    Definition 5.4.1 (sequences bounded away from zero with sign).

    Equations
    Instances For
      theorem Chapter5.boundedAwayPos_def (a : ) :
      BoundedAwayPos a c > 0, ∀ (n : ), a n c

      Definition 5.4.1 (sequences bounded away from zero with sign).

      theorem Chapter5.boundedAwayNeg_def (a : ) :
      BoundedAwayNeg a c > 0, ∀ (n : ), a n -c

      Definition 5.4.1 (sequences bounded away from zero with sign).

      @[reducible, inline]
      Equations
      Instances For
        @[reducible, inline]
        Equations
        Instances For
          theorem Chapter5.Real.isPos_def (x : Real) :
          x.IsPos ∃ (a : ), BoundedAwayPos a (↑a).IsCauchy x = LIM a
          theorem Chapter5.Real.isNeg_def (x : Real) :
          x.IsNeg ∃ (a : ), BoundedAwayNeg a (↑a).IsCauchy x = LIM a

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          theorem Chapter5.Real.nonzero_of_pos {x : Real} (hx : x.IsPos) :
          x 0

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          theorem Chapter5.Real.nonzero_of_neg {x : Real} (hx : x.IsNeg) :
          x 0

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          @[simp]

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          theorem Chapter5.Real.pos_add {x y : Real} (hx : x.IsPos) (hy : y.IsPos) :
          (x + y).IsPos

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          theorem Chapter5.Real.pos_mul {x y : Real} (hx : x.IsPos) (hy : y.IsPos) :
          (x * y).IsPos

          Proposition 5.4.4 (basic properties of positive reals) / Exercise 5.4.1

          theorem Chapter5.Real.pos_of_coe (q : ) :
          (↑q).IsPos q > 0
          theorem Chapter5.Real.neg_of_coe (q : ) :
          (↑q).IsNeg q < 0
          @[reducible, inline]
          noncomputable abbrev Chapter5.Real.abs (x : Real) :

          Need to use classical logic here because isPos and isNeg are not decidable

          Equations
          Instances For
            @[simp]
            theorem Chapter5.Real.abs_of_pos (x : Real) (hx : x.IsPos) :
            x.abs = x

            Definition 5.4.5 (absolute value)

            @[simp]
            theorem Chapter5.Real.abs_of_neg (x : Real) (hx : x.IsNeg) :
            x.abs = -x

            Definition 5.4.5 (absolute value)

            @[simp]

            Definition 5.4.5 (absolute value)

            Definition 5.4.6 (Ordering of the reals)

            Equations

            Definition 5.4.6 (Ordering of the reals)

            Equations
            theorem Chapter5.Real.lt_iff (x y : Real) :
            x < y (x - y).IsNeg
            theorem Chapter5.Real.le_iff (x y : Real) :
            x y x < y x = y
            theorem Chapter5.Real.gt_iff (x y : Real) :
            x > y (x - y).IsPos
            theorem Chapter5.Real.ge_iff (x y : Real) :
            x y x > y x = y
            theorem Chapter5.Real.lt_of_coe (q q' : ) :
            q < q' q < q'
            theorem Chapter5.Real.gt_of_coe (q q' : ) :
            q > q' q > q'
            theorem Chapter5.Real.trichotomous' (x y : Real) :
            x > y x < y x = y

            Proposition 5.4.7(a) (order trichotomy) / Exercise 5.4.2

            theorem Chapter5.Real.not_gt_and_lt (x y : Real) :
            ¬(x > y x < y)

            Proposition 5.4.7(a) (order trichotomy) / Exercise 5.4.2

            theorem Chapter5.Real.not_gt_and_eq (x y : Real) :
            ¬(x > y x = y)

            Proposition 5.4.7(a) (order trichotomy) / Exercise 5.4.2

            theorem Chapter5.Real.not_lt_and_eq (x y : Real) :
            ¬(x < y x = y)

            Proposition 5.4.7(a) (order trichotomy) / Exercise 5.4.2

            theorem Chapter5.Real.antisymm (x y : Real) :
            x < y (y - x).IsPos

            Proposition 5.4.7(b) (order is anti-symmetric) / Exercise 5.4.2

            theorem Chapter5.Real.lt_trans {x y z : Real} (hxy : x < y) (hyz : y < z) :
            x < z

            Proposition 5.4.7(c) (order is transitive) / Exercise 5.4.2

            theorem Chapter5.Real.add_lt_add_right {x y : Real} (z : Real) (hxy : x < y) :
            x + z < y + z

            Proposition 5.4.7(d) (addition preserves order) / Exercise 5.4.2

            theorem Chapter5.Real.mul_lt_mul_right {x y z : Real} (hxy : x < y) (hz : z.IsPos) :
            x * z < y * z

            Proposition 5.4.7(e) (positive multiplication preserves order) / Exercise 5.4.2

            theorem Chapter5.Real.mul_le_mul_left {x y z : Real} (hxy : x y) (hz : z.IsPos) :
            z * x z * y

            Proposition 5.4.7(e) (positive multiplication preserves order) / Exercise 5.4.2

            theorem Chapter5.Real.mul_pos_neg {x y : Real} (hx : x.IsPos) (hy : y.IsNeg) :
            (x * y).IsNeg

            (Not from textbook) Real has the structure of a linear ordering. The order is not computable, and so classical logic is required to impose decidability.

            Equations
            • One or more equations did not get rendered due to their size.

            (Not from textbook) Linear Orders come with a definition of absolute value |.| Show that it agrees with our earlier definition.

            theorem Chapter5.Real.inv_of_pos {x : Real} (hx : x.IsPos) :

            Proposition 5.4.8

            theorem Chapter5.Real.div_of_pos {x y : Real} (hx : x.IsPos) (hy : y.IsPos) :
            (x / y).IsPos
            theorem Chapter5.Real.inv_of_gt {x y : Real} (hx : x.IsPos) (hy : y.IsPos) (hxy : x > y) :

            (Not from textbook) Real has the structure of a strict ordered ring.

            theorem Chapter5.Real.LIM_of_nonneg {a : } (ha : ∀ (n : ), a n 0) (hcauchy : (↑a).IsCauchy) :
            LIM a 0

            Proposition 5.4.9 (The non-negative reals are closed)

            theorem Chapter5.Real.LIM_mono {a b : } (ha : (↑a).IsCauchy) (hb : (↑b).IsCauchy) (hmono : ∀ (n : ), a n b n) :
            LIM a LIM b

            Corollary 5.4.10

            theorem Chapter5.Real.LIM_mono_fail :
            ∃ (a : ) (b : ), (↑a).IsCauchy (↑b).IsCauchy (∀ (n : ), a n > b n) ¬LIM a > LIM b

            Remark 5.4.11 -

            theorem Chapter5.Real.exists_rat_le_and_nat_ge {x : Real} (hx : x.IsPos) :
            (∃ q > 0, q x) ∃ (N : ), x < N

            Proposition 5.4.12 (Bounding reals by rationals)

            theorem Chapter5.Real.le_mul {ε : Real} ( : ε.IsPos) (x : Real) :
            M > 0, M * ε > x

            Corollary 5.4.13 (Archimedean property )

            theorem Chapter5.Real.rat_between {x y : Real} (hxy : x < y) :
            ∃ (q : ), x < q q < y

            Proposition 5.4.14 / Exercise 5.4.5

            theorem Chapter5.Real.floor_exist (x : Real) :
            ∃! n : , n x x < n + 1

            Exercise 5.4.3

            theorem Chapter5.Real.exist_inv_nat_le {x : Real} (hx : x.IsPos) :
            N > 0, (↑N)⁻¹ < x

            Exercise 5.4.4

            theorem Chapter5.Real.dist_lt_iff (ε x y : Real) :
            |x - y| < ε y - ε < x x < y + ε

            Exercise 5.4.6

            theorem Chapter5.Real.dist_le_iff (ε x y : Real) :
            |x - y| ε y - ε x x y + ε

            Exercise 5.4.6

            theorem Chapter5.Real.le_add_eps_iff (x y : Real) :
            (∀ ε > 0, x y + ε) x y

            Exercise 5.4.7

            theorem Chapter5.Real.dist_le_eps_iff (x y : Real) :
            (∀ ε > 0, |x - y| ε) x = y

            Exercise 5.4.7

            theorem Chapter5.Real.LIM_of_le {x : Real} {a : } (hcauchy : (↑a).IsCauchy) (h : ∀ (n : ), (a n) x) :
            LIM a x

            Exercise 5.4.8

            theorem Chapter5.Real.LIM_of_ge {x : Real} {a : } (hcauchy : (↑a).IsCauchy) (h : ∀ (n : ), (a n) x) :
            LIM a x

            Exercise 5.4.8

            theorem Chapter5.Real.max_eq (x y : Real) :
            max x y = if x y then x else y
            theorem Chapter5.Real.min_eq (x y : Real) :
            min x y = if x y then x else y
            theorem Chapter5.Real.neg_max (x y : Real) :
            max x y = -min (-x) (-y)

            Exercise 5.4.9

            theorem Chapter5.Real.neg_min (x y : Real) :
            min x y = -max (-x) (-y)

            Exercise 5.4.9

            theorem Chapter5.Real.max_comm (x y : Real) :
            max x y = max y x

            Exercise 5.4.9

            theorem Chapter5.Real.max_self (x : Real) :
            max x x = x

            Exercise 5.4.9

            theorem Chapter5.Real.max_add (x y z : Real) :
            max (x + z) (y + z) = max x y + z

            Exercise 5.4.9

            theorem Chapter5.Real.max_mul (x y : Real) {z : Real} (hz : z.IsPos) :
            max (x * z) (y * z) = max x y * z

            Exercise 5.4.9

            theorem Chapter5.Real.min_comm (x y : Real) :
            min x y = min y x

            Exercise 5.4.9

            theorem Chapter5.Real.min_self (x : Real) :
            min x x = x

            Exercise 5.4.9

            theorem Chapter5.Real.min_add (x y z : Real) :
            min (x + z) (y + z) = min x y + z

            Exercise 5.4.9

            theorem Chapter5.Real.min_mul (x y : Real) {z : Real} (hz : z.IsPos) :
            min (x * z) (y * z) = min x y * z

            Exercise 5.4.9

            theorem Chapter5.Real.inv_max {x y : Real} (hx : x.IsPos) (hy : y.IsPos) :

            Exercise 5.4.9

            theorem Chapter5.Real.inv_min {x y : Real} (hx : x.IsPos) (hy : y.IsPos) :

            Exercise 5.4.9

            @[reducible, inline]

            Not from textbook: the rationals map as an ordered ring homomorphism into the reals.

            Equations
            Instances For