Аналіз I, Глава 5.4
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:
-
Ordering on the real line
namespace Chapter5
Визначення 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.
abbrev bounded_away_pos (a:ℕ → ℚ) : Prop :=
∃ (c:ℚ), c > 0 ∧ ∀ n, a n ≥ c
Визначення 5.4.1 (sequences bounded away from zero with sign).
abbrev bounded_away_neg (a:ℕ → ℚ) : Prop :=
∃ (c:ℚ), c > 0 ∧ ∀ n, a n ≤ -c
Визначення 5.4.1 (sequences bounded away from zero with sign).
theorem bounded_away_pos_def (a:ℕ → ℚ) : bounded_away_pos a ↔ ∃ (c:ℚ), c > 0 ∧ ∀ n, a n ≥ c := a:ℕ → ℚ⊢ bounded_away_pos a ↔ ∃ c > 0, ∀ (n : ℕ), a n ≥ c
All goals completed! 🐙
Визначення 5.4.1 (sequences bounded away from zero with sign).
theorem bounded_away_neg_def (a:ℕ → ℚ) : bounded_away_neg a ↔ ∃ (c:ℚ), c > 0 ∧ ∀ n, a n ≤ -c := a:ℕ → ℚ⊢ bounded_away_neg a ↔ ∃ c > 0, ∀ (n : ℕ), a n ≤ -c
All goals completed! 🐙
Приклади 5.4.2
example : bounded_away_pos (fun n ↦ 1 + 10^(-(n:ℤ)-1)) := ⊢ bounded_away_pos fun n => 1 + 10 ^ (-↑n - 1) All goals completed! 🐙
Приклади 5.4.2
example : bounded_away_neg (fun n ↦ - - 10^(-(n:ℤ)-1)) := ⊢ bounded_away_neg fun n => - -10 ^ (-↑n - 1) All goals completed! 🐙
Приклади 5.4.2
example : ¬ bounded_away_pos (fun n ↦ (-1)^n) := ⊢ ¬bounded_away_pos fun n => (-1) ^ n All goals completed! 🐙
example : ¬ bounded_away_neg (fun n ↦ (-1)^n) := ⊢ ¬bounded_away_neg fun n => (-1) ^ n All goals completed! 🐙
example : bounded_away_zero (fun n ↦ (-1)^n) := ⊢ bounded_away_zero fun n => (-1) ^ n All goals completed! 🐙
theorem bounded_away_zero_of_pos {a:ℕ → ℚ} (ha: bounded_away_pos a) : bounded_away_zero a := a:ℕ → ℚha:bounded_away_pos a⊢ bounded_away_zero a
All goals completed! 🐙
theorem bounded_away_zero_of_neg {a:ℕ → ℚ} (ha: bounded_away_neg a) : bounded_away_zero a := a:ℕ → ℚha:bounded_away_neg a⊢ bounded_away_zero a
All goals completed! 🐙
theorem not_bounded_away_pos_neg {a:ℕ → ℚ} : ¬ (bounded_away_pos a ∧ bounded_away_neg a) := a:ℕ → ℚ⊢ ¬(bounded_away_pos a ∧ bounded_away_neg a)
All goals completed! 🐙
abbrev Real.isPos (x:Real) : Prop :=
∃ a:ℕ → ℚ, bounded_away_pos a ∧ (a:Sequence).isCauchy ∧ x = LIM a
abbrev Real.isNeg (x:Real) : Prop :=
∃ a:ℕ → ℚ, bounded_away_neg a ∧ (a:Sequence).isCauchy ∧ x = LIM a
theorem Real.isPos_def (x:Real) :
Real.isPos x ↔ ∃ a:ℕ → ℚ, bounded_away_pos a ∧ (a:Sequence).isCauchy ∧ x = LIM a := x:Real⊢ x.isPos ↔
∃ a,
bounded_away_pos a ∧ { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy ∧ x = LIM a All goals completed! 🐙
theorem Real.isNeg_def (x:Real) :
Real.isNeg x ↔ ∃ a:ℕ → ℚ, bounded_away_neg a ∧ (a:Sequence).isCauchy ∧ x = LIM a := x:Real⊢ x.isNeg ↔
∃ a,
bounded_away_neg a ∧ { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy ∧ x = LIM a All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.trichotomous (x:Real) : x = 0 ∨ x.isPos ∨ x.isNeg := x:Real⊢ x = 0 ∨ x.isPos ∨ x.isNeg All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.not_zero_pos (x:Real) : ¬ (x = 0 ∧ x.isPos) := x:Real⊢ ¬(x = 0 ∧ x.isPos) All goals completed! 🐙
theorem Real.nonzero_of_pos {x:Real} (hx: x.isPos) : x ≠ 0 := x:Realhx:x.isPos⊢ x ≠ 0
x:Realhx:x.isPosthis:¬(x = 0 ∧ x.isPos)⊢ x ≠ 0
x:Realhx:x.isPosthis:¬x = 0⊢ ¬x = 0
All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.not_zero_neg (x:Real) : ¬ (x = 0 ∧ x.isNeg) := x:Real⊢ ¬(x = 0 ∧ x.isNeg) All goals completed! 🐙
theorem Real.nonzero_of_neg {x:Real} (hx: x.isNeg) : x ≠ 0 := x:Realhx:x.isNeg⊢ x ≠ 0
x:Realhx:x.isNegthis:¬(x = 0 ∧ x.isNeg)⊢ x ≠ 0
x:Realhx:x.isNegthis:¬x = 0⊢ ¬x = 0
All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.not_pos_neg (x:Real) : ¬ (x.isPos ∧ x.isNeg) := x:Real⊢ ¬(x.isPos ∧ x.isNeg) All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
@[simp]
theorem Real.neg_iff_pos_of_neg (x:Real) : x.isNeg ↔ (-x).isPos := x:Real⊢ x.isNeg ↔ (-x).isPos All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.pos_add {x y:Real} (hx: x.isPos) (hy: y.isPos) : (x+y).isPos := x:Realy:Realhx:x.isPoshy:y.isPos⊢ (x + y).isPos All goals completed! 🐙
Твердження 5.4.4 (basic properties of positive reals) / Вправа 5.4.1
theorem Real.pos_mul {x y:Real} (hx: x.isPos) (hy: y.isPos) : (x*y).isPos := x:Realy:Realhx:x.isPoshy:y.isPos⊢ (x * y).isPos All goals completed! 🐙
theorem Real.pos_of_coe (q:ℚ) : (q:Real).isPos ↔ q > 0 := q:ℚ⊢ (↑q).isPos ↔ q > 0 All goals completed! 🐙
theorem Real.neg_of_coe (q:ℚ) : (q:Real).isNeg ↔ q < 0 := q:ℚ⊢ (↑q).isNeg ↔ q < 0 All goals completed! 🐙
open Classical in
/-- Need to use classical logic here because isPos and isNeg are not decidable -/
noncomputable abbrev Real.abs (x:Real) : Real := if x.isPos then x else (if x.isNeg then -x else 0)
Визначення 5.4.5 (absolute value)
@[simp]
theorem Real.abs_of_pos (x:Real) (hx: x.isPos) : Real.abs x = x := x:Realhx:x.isPos⊢ x.abs = x
All goals completed! 🐙
Визначення 5.4.5 (absolute value)
@[simp]
theorem Real.abs_of_neg (x:Real) (hx: x.isNeg) : Real.abs x = -x := x:Realhx:x.isNeg⊢ x.abs = -x
have : ¬ x.isPos := x:Realhx:x.isNeg⊢ x.abs = -x x:Realhx:x.isNegthis:¬(x.isPos ∧ x.isNeg)⊢ ¬x.isPos; x:Realhx:x.isNegthis:¬x.isPos⊢ ¬x.isPos; All goals completed! 🐙
All goals completed! 🐙
Визначення 5.4.5 (absolute value)
@[simp]
theorem Real.abs_of_zero : Real.abs 0 = 0 := ⊢ abs 0 = 0
have hpos: ¬ (0:Real).isPos := ⊢ abs 0 = 0
this:¬(0 = 0 ∧ isPos 0)⊢ ¬isPos 0
this:¬isPos 0⊢ ¬isPos 0; All goals completed! 🐙
have hneg: ¬ (0:Real).isNeg := ⊢ abs 0 = 0
hpos:¬isPos 0this:¬(0 = 0 ∧ isNeg 0)⊢ ¬isNeg 0
hpos:¬isPos 0this:¬isNeg 0⊢ ¬isNeg 0; All goals completed! 🐙
All goals completed! 🐙
Визначення 5.4.6 (Ordering of the reals)
instance Real.instLE : LE Real where
le x y := (x < y) ∨ (x = y)
theorem Real.lt_iff (x y:Real) : x < y ↔ (x-y).isNeg := x:Realy:Real⊢ x < y ↔ (x - y).isNeg All goals completed! 🐙
theorem Real.le_iff (x y:Real) : x ≤ y ↔ (x < y) ∨ (x = y) := x:Realy:Real⊢ x ≤ y ↔ x < y ∨ x = y All goals completed! 🐙
theorem Real.gt_iff (x y:Real) : x > y ↔ (x-y).isPos := x:Realy:Real⊢ x > y ↔ (x - y).isPos All goals completed! 🐙
theorem Real.ge_iff (x y:Real) : x ≥ y ↔ (x > y) ∨ (x = y) := x:Realy:Real⊢ x ≥ y ↔ x > y ∨ x = y All goals completed! 🐙
theorem Real.lt_of_coe (q q':ℚ): q < q' ↔ (q:Real) < (q':Real) := q:ℚq':ℚ⊢ q < q' ↔ ↑q < ↑q' All goals completed! 🐙
theorem Real.gt_of_coe (q q':ℚ): q > q' ↔ (q:Real) > (q':Real) := Real.lt_of_coe _ _
theorem Real.isPos_iff (x:Real) : x.isPos ↔ x > 0 := x:Real⊢ x.isPos ↔ x > 0 All goals completed! 🐙
theorem Real.isNeg_iff (x:Real) : x.isNeg ↔ x < 0 := x:Real⊢ x.isNeg ↔ x < 0 All goals completed! 🐙
Твердження 5.4.7(a) (order trichotomy) / Вправа 5.4.2
theorem Real.trichotomous' (x y:Real) : x > y ∨ x < y ∨ x = y := x:Realy:Real⊢ x > y ∨ x < y ∨ x = y All goals completed! 🐙
Твердження 5.4.7(a) (order trichotomy) / Вправа 5.4.2
theorem Real.not_gt_and_lt (x y:Real) : ¬ (x > y ∧ x < y):= x:Realy:Real⊢ ¬(x > y ∧ x < y) All goals completed! 🐙
Твердження 5.4.7(a) (order trichotomy) / Вправа 5.4.2
theorem Real.not_gt_and_eq (x y:Real) : ¬ (x > y ∧ x = y):= x:Realy:Real⊢ ¬(x > y ∧ x = y) All goals completed! 🐙
Твердження 5.4.7(a) (order trichotomy) / Вправа 5.4.2
theorem Real.not_lt_and_eq (x y:Real) : ¬ (x < y ∧ x = y):= x:Realy:Real⊢ ¬(x < y ∧ x = y) All goals completed! 🐙
Твердження 5.4.7(b) (order is anti-symmetric) / Вправа 5.4.2
theorem Real.antisymm (x y:Real) : x < y ↔ (y - x).isPos := x:Realy:Real⊢ x < y ↔ (y - x).isPos All goals completed! 🐙
Твердження 5.4.7(c) (order is transitive) / Вправа 5.4.2
theorem Real.lt_trans {x y z:Real} (hxy: x < y) (hyz: y < z) : x < z := x:Realy:Realz:Realhxy:x < yhyz:y < z⊢ x < z All goals completed! 🐙
Твердження 5.4.7(d) (addition preserves order) / Вправа 5.4.2
theorem Real.add_lt_add_right {x y:Real} (z:Real) (hxy: x < y) : x + z < y + z := x:Realy:Realz:Realhxy:x < y⊢ x + z < y + z All goals completed! 🐙
Твердження 5.4.7(e) (positive multiplication preserves order) / Вправа 5.4.2
theorem Real.mul_lt_mul_right {x y z:Real} (hxy: x < y) (hz: z.isPos) : x * z < y * z := x:Realy:Realz:Realhxy:x < yhz:z.isPos⊢ x * z < y * z
x:Realy:Realz:Realhxy:(y - x).isPoshz:z.isPos⊢ (y * z - x * z).isPos
x:Realy:Realz:Realhxy:(y - x).isPoshz:z.isPos⊢ y * z - x * z = (y - x) * z
All goals completed! 🐙
Твердження 5.4.7(e) (positive multiplication preserves order) / Вправа 5.4.2
theorem Real.mul_le_mul_left {x y z:Real} (hxy: x ≤ y) (hz: z.isPos) : z * x ≤ z * y := x:Realy:Realz:Realhxy:x ≤ yhz:z.isPos⊢ z * x ≤ z * y All goals completed! 🐙
theorem Real.mul_pos_neg {x y:Real} (hx: x.isPos) (hy: y.isNeg) : (x * y).isNeg := x:Realy:Realhx:x.isPoshy:y.isNeg⊢ (x * y).isNeg
All goals completed! 🐙
(Не із книги) Real has the structure of a linear ordering. The order is not computable, and so classical logic is required to impose decidability.
noncomputable instance Real.instLinearOrder : LinearOrder Real where
le_refl := sorry
le_trans := sorry
lt_iff_le_not_le := sorry
le_antisymm := sorry
le_total := sorry
toDecidableLE := ⊢ DecidableLE Real
classical
All goals completed! 🐙
Твердження 5.4.8
theorem Real.inv_of_pos {x:Real} (hx: x.isPos) : x⁻¹.isPos := x:Realhx:x.isPos⊢ x⁻¹.isPos
x:Realhx:x.isPoshnon:x ≠ 0⊢ x⁻¹.isPos
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1⊢ x⁻¹.isPos
have hinv_non: x⁻¹ ≠ 0 := x:Realhx:x.isPos⊢ x⁻¹.isPos x:Realhx:x.isPoshnon:x ≠ 0hident:x⁻¹ = 0⊢ x * x⁻¹ ≠ 1; All goals completed! 🐙
have hnonneg : ¬ x⁻¹.isNeg := x:Realhx:x.isPos⊢ x⁻¹.isPos
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1hinv_non:x⁻¹ ≠ 0h:x⁻¹.isNeg⊢ False
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1hinv_non:x⁻¹ ≠ 0h:x⁻¹.isNegthis:(x * x⁻¹).isNeg⊢ False
have id : -(1:Real) = (-1:ℚ) := x:Realhx:x.isPos⊢ x⁻¹.isPos All goals completed! 🐙
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1hinv_non:x⁻¹ ≠ 0h:x⁻¹.isNegid:-1 = ↑(-1)this:-1 > 0⊢ False
All goals completed! 🐙
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1hinv_non:x⁻¹ ≠ 0hnonneg:¬x⁻¹.isNegtrich:x⁻¹ = 0 ∨ x⁻¹.isPos ∨ x⁻¹.isNeg⊢ x⁻¹.isPos
x:Realhx:x.isPoshnon:x ≠ 0hident:x * x⁻¹ = 1hinv_non:x⁻¹ ≠ 0hnonneg:¬x⁻¹.isNegtrich:x⁻¹.isPos⊢ x⁻¹.isPos
All goals completed! 🐙
theorem Real.div_of_pos {x y:Real} (hx: x.isPos) (hy: y.isPos) : (x/y).isPos := x:Realy:Realhx:x.isPoshy:y.isPos⊢ (x / y).isPos All goals completed! 🐙
theorem Real.inv_of_gt {x y:Real} (hx: x.isPos) (hy: y.isPos) (hxy: x > y) : x⁻¹ < y⁻¹ := x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > y⊢ x⁻¹ < y⁻¹
x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > yhxnon:x ≠ 0⊢ x⁻¹ < y⁻¹
x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > yhxnon:x ≠ 0hynon:y ≠ 0⊢ x⁻¹ < y⁻¹
x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > yhxnon:x ≠ 0hynon:y ≠ 0hxinv:x⁻¹.isPos⊢ x⁻¹ < y⁻¹
x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > yhxnon:x ≠ 0hynon:y ≠ 0hxinv:x⁻¹.isPosthis:y⁻¹ ≤ x⁻¹⊢ False
x:Realy:Realhx:x.isPoshy:y.isPoshxy:x > yhxnon:x ≠ 0hynon:y ≠ 0hxinv:x⁻¹.isPosthis✝:y⁻¹ ≤ x⁻¹this:1 > 1⊢ False
All goals completed! 🐙
(Не із книги) Real has the structure of a strict ordered ring.
instance Real.instIsStrictOrderedRing : IsStrictOrderedRing Real where
add_le_add_left := ⊢ ∀ (a b : Real), a ≤ b → ∀ (c : Real), c + a ≤ c + b All goals completed! 🐙
add_le_add_right := ⊢ ∀ (a b : Real), a ≤ b → ∀ (c : Real), a + c ≤ b + c All goals completed! 🐙
mul_lt_mul_of_pos_left := ⊢ ∀ (a b c : Real), a < b → 0 < c → c * a < c * b All goals completed! 🐙
mul_lt_mul_of_pos_right := ⊢ ∀ (a b c : Real), a < b → 0 < c → a * c < b * c All goals completed! 🐙
le_of_add_le_add_left := ⊢ ∀ (a b c : Real), a + b ≤ a + c → b ≤ c All goals completed! 🐙
zero_le_one := ⊢ 0 ≤ 1 All goals completed! 🐙
Твердження 5.4.9 (The non-negative reals are closed)
theorem Real.LIM_of_nonneg {a: ℕ → ℚ} (ha: ∀ n, a n ≥ 0) (hcauchy: (a:Sequence).isCauchy) :
LIM a ≥ 0 := a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy⊢ LIM a ≥ 0
-- цей доказ написан так, щоб співпадати із структурою орігінального тексту.
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyhlim:LIM a < 0⊢ False
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ahlim:x < 0⊢ False
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ahlim:∃ a, bounded_away_neg a ∧ { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy ∧ x = LIM a⊢ False
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb:bounded_away_neg bhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM b⊢ False
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb:∃ c > 0, ∀ (n : ℕ), b n ≤ -chb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM b⊢ False
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -c⊢ False
have claim1 : ∀ n, ¬ (c/2).close (a n) (b n) := a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy⊢ LIM a ≥ 0
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cn:ℕ⊢ ¬(c / 2).close (a n) (b n)
a:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cn:ℕha:a n ≥ 0⊢ ¬(c / 2).close (a n) (b n)
a:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0n:ℕha:a n ≥ 0hb:b n ≤ -c⊢ ¬(c / 2).close (a n) (b n)
a:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0n:ℕha:a n ≥ 0hb:b n ≤ -c⊢ c / 2 < |a n - b n|
calc
_ < c := a:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0n:ℕha:a n ≥ 0hb:b n ≤ -c⊢ c / 2 < c All goals completed! 🐙
_ ≤ a n - b n := a:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0n:ℕha:a n ≥ 0hb:b n ≤ -c⊢ c ≤ a n - b n All goals completed! 🐙
_ ≤ _ := le_abs_self _
have claim2 : ¬ (c/2).eventually_close (a:Sequence) (b:Sequence) := a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy⊢ LIM a ≥ 0
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cclaim1:(c / 2).eventually_close { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }⊢ ∃ n, (c / 2).close (a n) (b n)
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cclaim1:∃ N, ∀ n ≥ N, |a n - b n| ≤ c / 2⊢ ∃ n, (c / 2).close (a n) (b n)
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cN:ℕclaim1:∀ n ≥ N, |a n - b n| ≤ c / 2⊢ ∃ n, (c / 2).close (a n) (b n)
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cN:ℕclaim1:|a N - b N| ≤ c / 2⊢ ∃ n, (c / 2).close (a n) (b n)
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cN:ℕclaim1:|a N - b N| ≤ c / 2⊢ (c / 2).close (a N) (b N)
rwa [Section_4_3.close_iffa:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cN:ℕclaim1:|a N - b N| ≤ c / 2⊢ |a N - b N| ≤ c / 2
have claim3 : ¬ Sequence.equiv a b := a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy⊢ LIM a ≥ 0
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cclaim1:∀ (n : ℕ), ¬(c / 2).close (a n) (b n)claim2:Sequence.equiv a b⊢ (c / 2).eventually_close { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhlim:x = LIM bc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cclaim1:∀ (n : ℕ), ¬(c / 2).close (a n) (b n)claim2:∀ ε > 0,
ε.eventually_close { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }⊢ (c / 2).eventually_close { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }
All goals completed! 🐙
a:ℕ → ℚha:∀ (n : ℕ), a n ≥ 0hcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyx:Real := LIM ab:ℕ → ℚhb_cauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyc:ℚcpos:c > 0hb:∀ (n : ℕ), b n ≤ -cclaim1:∀ (n : ℕ), ¬(c / 2).close (a n) (b n)claim2:¬(c / 2).eventually_close { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }claim3:¬Sequence.equiv a bhlim:Sequence.equiv a b⊢ False
All goals completed! 🐙
Наслідок 5.4.10
theorem Real.LIM_mono {a b:ℕ → ℚ} (ha: (a:Sequence).isCauchy) (hb: (b:Sequence).isCauchy)
(hmono: ∀ n, a n ≤ b n) :
LIM a ≤ LIM b := a:ℕ → ℚb:ℕ → ℚha:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyhb:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhmono:∀ (n : ℕ), a n ≤ b n⊢ LIM a ≤ LIM b
-- цей доказ написан так, щоб співпадати із структурою орігінального тексту.
have := LIM_of_nonneg (a := b - a) (a:ℕ → ℚb:ℕ → ℚha:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyhb:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhmono:∀ (n : ℕ), a n ≤ b n⊢ ∀ (n : ℕ), (b - a) n ≥ 0 a:ℕ → ℚb:ℕ → ℚha:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyhb:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhmono:∀ (n : ℕ), a n ≤ b nn:ℕ⊢ (b - a) n ≥ 0; All goals completed! 🐙) (sub_of_cauchy hb ha)
a:ℕ → ℚb:ℕ → ℚha:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyhb:{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchyhmono:∀ (n : ℕ), a n ≤ b nthis:LIM b - LIM a ≥ 0⊢ LIM a ≤ LIM b
All goals completed! 🐙
Ремарка 5.4.11 -
theorem Real.LIM_mono_fail :
∃ (a b:ℕ → ℚ), (a:Sequence).isCauchy
∧ (b:Sequence).isCauchy
∧ ¬ (∀ n, a n > b n)
∧ ¬ LIM a > LIM b := ⊢ ∃ a b,
{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy ∧
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchy ∧
(¬∀ (n : ℕ), a n > b n) ∧ ¬LIM a > LIM b
⊢ ∃ b,
{ n₀ := 0, seq := fun n => if n ≥ 0 then (fun n => 1 + 1 / ↑n) n.toNat else 0, vanish := ⋯ }.isCauchy ∧
{ n₀ := 0, seq := fun n => if n ≥ 0 then b n.toNat else 0, vanish := ⋯ }.isCauchy ∧
(¬∀ (n : ℕ), (fun n => 1 + 1 / ↑n) n > b n) ∧ ¬(LIM fun n => 1 + 1 / ↑n) > LIM b
⊢ { n₀ := 0, seq := fun n => if n ≥ 0 then 1 + 1 / ↑n.toNat else 0, vanish := ⋯ }.isCauchy ∧
{ n₀ := 0, seq := fun n => if n ≥ 0 then (fun n => 1 - 1 / ↑n) n.toNat else 0, vanish := ⋯ }.isCauchy ∧
(¬∀ (n : ℕ), 1 + 1 / ↑n > (fun n => 1 - 1 / ↑n) n) ∧ ¬(LIM fun n => 1 + 1 / ↑n) > LIM fun n => 1 - 1 / ↑n
All goals completed! 🐙
Твердження 5.4.12 (Bounding reals by rationals)
theorem Real.exists_rat_le_and_nat_ge {x:Real} (hx: x.isPos) :
(∃ q:ℚ, q > 0 ∧ (q:Real) ≤ x) ∧ ∃ N:ℕ, x < (N:Real) := x:Realhx:x.isPos⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
-- цей доказ написан так, щоб співпадати із структурою орігінального тексту.
x:Realhx:∃ a, bounded_away_pos a ∧ { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchy ∧ x = LIM a⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhbound:bounded_away_pos ahcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM a⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhbound:bounded_away_pos ahcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM athis:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isBounded⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhbound:∃ c > 0, ∀ (n : ℕ), a n ≥ chcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM athis:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isBounded⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhbound:∃ c > 0, ∀ (n : ℕ), a n ≥ chcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM athis:∃ M ≥ 0, { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.BoundedBy M⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM athis:∃ M ≥ 0, { n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.BoundedBy Mq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ q⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.BoundedBy r⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ (∃ q > 0, ↑q ≤ x) ∧ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ∃ q > 0, ↑q ≤ xx:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ∃ q > 0, ↑q ≤ x x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ↑q ≤ x
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ↑q = LIM fun n => qx:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ { n₀ := 0, seq := fun n => if n ≥ 0 then q else 0, vanish := ⋯ }.isCauchy
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ r⊢ ↑q = LIM fun n => q All goals completed! 🐙
All goals completed! 🐙
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ ∃ N, x < ↑N
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ x < ↑N
calc
x ≤ r := x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ x ≤ ↑r
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ x ≤ LIM fun x => r
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ { n₀ := 0, seq := fun n => if n ≥ 0 then r else 0, vanish := ⋯ }.isCauchyx:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ ∀ (n : ℕ), a n ≤ r
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ { n₀ := 0, seq := fun n => if n ≥ 0 then r else 0, vanish := ⋯ }.isCauchy All goals completed! 🐙
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑Nn:ℕ⊢ a n ≤ r
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0N:ℕhN:r < ↑Nn:ℕthis:|if 0 ≤ ↑n then a (↑n).toNat else 0| ≤ r⊢ a n ≤ r
x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0N:ℕhN:r < ↑Nn:ℕthis:|a n| ≤ r⊢ a n ≤ r
All goals completed! 🐙
_ < ((N:ℚ):Real) := x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ ↑r < ↑↑N All goals completed! 🐙
_ = N := x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyheq:x = LIM aq:ℚhq:q > 0hbound:∀ (n : ℕ), a n ≥ qr:ℚhr:r ≥ 0this:∀ (n : ℤ), |if 0 ≤ n then a n.toNat else 0| ≤ rN:ℕhN:r < ↑N⊢ ↑↑N = ↑N All goals completed! 🐙
Наслідок 5.4.13 (Archimedean property )
theorem Real.le_mul {ε:Real} (hε: ε.isPos) (x:Real) : ∃ M:ℕ, M > 0 ∧ M * ε > x := ε:Realhε:ε.isPosx:Real⊢ ∃ M > 0, ↑M * ε > x
-- цей доказ написан так, щоб співпадати із структурою орігінального тексту.
ε:Realhε:ε.isPosx:Realhx:x = 0⊢ ∃ M > 0, ↑M * ε > xε:Realhε:ε.isPosx:Realhx:x.isPos⊢ ∃ M > 0, ↑M * ε > xε:Realhε:ε.isPosx:Realhx:x.isNeg⊢ ∃ M > 0, ↑M * ε > x
ε:Realhε:ε.isPosx:Realhx:x = 0⊢ ∃ M > 0, ↑M * ε > x ε:Realhε:ε.isPosx:Realhx:x = 0⊢ 1 > 0 ∧ ↑1 * ε > x; ε:Realhε:ε > 0x:Realhx:x = 0⊢ 1 > 0 ∧ ↑1 * ε > x; All goals completed! 🐙
ε:Realhε:ε.isPosx:Realhx:x.isPos⊢ ∃ M > 0, ↑M * ε > x ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕhN:x / ε < ↑N⊢ ∃ M > 0, ↑M * ε > x
ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕhN:x / ε < ↑NM:ℕ := N + 1⊢ ∃ M > 0, ↑M * ε > x
refine ⟨ M, ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕhN:x / ε < ↑NM:ℕ := N + 1⊢ M > 0 All goals completed! 🐙, ?_ ⟩
replace hN : x/ε < M := hN.trans (ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕhN:x / ε < ↑NM:ℕ := N + 1⊢ ↑N < ↑M All goals completed! 🐙)
ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕM:ℕ := N + 1hN:x / ε * ε < ↑M * ε⊢ ↑M * ε > x
ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕM:ℕ := N + 1hN:x / ε * ε < ↑M * ε⊢ x < ↑M * ε
ε:Realhε:ε.isPosx:Realhx:x.isPosN:ℕM:ℕ := N + 1hN:x / ε * ε < ↑M * ε⊢ x = x / ε * ε
ε:Realhε:ε > 0x:Realhx:x.isPosN:ℕM:ℕ := N + 1hN:x / ε * ε < ↑M * ε⊢ x = x / ε * ε
All goals completed! 🐙
ε:Realhε:ε.isPosx:Realhx:x.isNeg⊢ 1 > 0 ∧ ↑1 * ε > x
ε:Realhε:ε > 0x:Realhx:x.isNeg⊢ 1 > 0 ∧ ↑1 * ε > x
ε:Realhε:ε > 0x:Realhx:x < 0⊢ 1 > 0 ∧ ↑1 * ε > x
ε:Realhε:ε > 0x:Realhx:x < 0⊢ x < ε
All goals completed! 🐙
Твердження 5.4.14 / Вправа 5.4.5
theorem Real.rat_between {x y:Real} (hxy: x < y) : ∃ q:ℚ, x < (q:Real) ∧ (q:Real) < y := x:Realy:Realhxy:x < y⊢ ∃ q, x < ↑q ∧ ↑q < y All goals completed! 🐙
Вправа 5.4.3
theorem Real.floor_exist (x:Real) : ∃ n:ℤ, (n:Real) ≤ x ∧ x < (n:Real)+1 := x:Real⊢ ∃ n, ↑n ≤ x ∧ x < ↑n + 1 All goals completed! 🐙
Вправа 5.4.4
theorem Real.exist_inv_nat_le {x:Real} (hx: x.isPos) : ∃ N, N>0 ∧ (N:Real)⁻¹ < x := x:Realhx:x.isPos⊢ ∃ N > 0, N⁻¹ < x All goals completed! 🐙
Вправа 5.4.6
theorem Real.dist_lt_iff (ε x y:Real) : |x-y| < ε ↔ y-ε < x ∧ x < y+ε := ε:Realx:Realy:Real⊢ |x - y| < ε ↔ y - ε < x ∧ x < y + ε All goals completed! 🐙
Вправа 5.4.6
theorem Real.dist_le_iff (ε x y:Real) : |x-y| ≤ ε ↔ y-ε ≤ x ∧ x ≤ y+ε := ε:Realx:Realy:Real⊢ |x - y| ≤ ε ↔ y - ε ≤ x ∧ x ≤ y + ε All goals completed! 🐙
Вправа 5.4.7
theorem Real.le_add_eps_iff (x y:Real) : ∀ ε > 0, x ≤ y+ε ↔ x ≤ y := x:Realy:Real⊢ ∀ ε > 0, x ≤ y + ε ↔ x ≤ y All goals completed! 🐙
Вправа 5.4.7
theorem Real.dist_le_eps_iff (x y:Real) : ∀ ε > 0, |x-y| ≤ ε ↔ x = y := x:Realy:Real⊢ ∀ ε > 0, |x - y| ≤ ε ↔ x = y All goals completed! 🐙
Вправа 5.4.8
theorem Real.LIM_of_le {x:Real} {a:ℕ → ℚ} (hcauchy: (a:Sequence).isCauchy) (h: ∀ n, a n ≤ x) :
LIM a ≤ x := x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyh:∀ (n : ℕ), ↑(a n) ≤ x⊢ LIM a ≤ x All goals completed! 🐙
Вправа 5.4.8
theorem Real.LIM_of_ge {x:Real} {a:ℕ → ℚ} (hcauchy: (a:Sequence).isCauchy) (h: ∀ n, a n ≥ x) :
LIM a ≥ x := x:Reala:ℕ → ℚhcauchy:{ n₀ := 0, seq := fun n => if n ≥ 0 then a n.toNat else 0, vanish := ⋯ }.isCauchyh:∀ (n : ℕ), ↑(a n) ≥ x⊢ LIM a ≥ x All goals completed! 🐙
theorem Real.max_eq (x y:Real) : max x y = (if x ≥ y then x else y) := max_def' x y
theorem Real.min_eq (x y:Real) : min x y = (if x ≤ y then x else y) := rfl
Вправа 5.4.9
theorem Real.neg_max (x y:Real) : max x y = - min (-x) (-y) := x:Realy:Real⊢ max x y = -min (-x) (-y) All goals completed! 🐙
Вправа 5.4.9
theorem Real.neg_min (x y:Real) : min x y = - max (-x) (-y) := x:Realy:Real⊢ min x y = -max (-x) (-y) All goals completed! 🐙
Вправа 5.4.9
theorem Real.max_comm (x y:Real) : max x y = max y x := x:Realy:Real⊢ max x y = max y x All goals completed! 🐙
Вправа 5.4.9
theorem Real.max_self (x:Real) : max x x = x := x:Real⊢ max x x = x All goals completed! 🐙
Вправа 5.4.9
theorem Real.max_add (x y z:Real) : max (x + z) (y + z) = max x y + z := x:Realy:Realz:Real⊢ max (x + z) (y + z) = max x y + z All goals completed! 🐙
Вправа 5.4.9
theorem Real.max_mul (x y :Real) {z:Real} (hz: z.isPos) : max (x * z) (y * z) = max x y * z := x:Realy:Realz:Realhz:z.isPos⊢ max (x * z) (y * z) = max x y * z
All goals completed! 🐙
/- Additional exercise: What happens if z is negative? -/
Вправа 5.4.9
theorem Real.min_comm (x y:Real) : min x y = min y x := x:Realy:Real⊢ min x y = min y x All goals completed! 🐙
Вправа 5.4.9
theorem Real.min_self (x:Real) : min x x = x := x:Real⊢ min x x = x All goals completed! 🐙
Вправа 5.4.9
theorem Real.min_add (x y z:Real) : min (x + z) (y + z) = min x y + z := x:Realy:Realz:Real⊢ min (x + z) (y + z) = min x y + z All goals completed! 🐙
Вправа 5.4.9
theorem Real.min_mul (x y :Real) {z:Real} (hz: z.isPos) : min (x * z) (y * z) = min x y * z := x:Realy:Realz:Realhz:z.isPos⊢ min (x * z) (y * z) = min x y * z
All goals completed! 🐙
Вправа 5.4.9
theorem Real.inv_max {x y :Real} (hx:x.isPos) (hy:y.isPos) : (max x y)⁻¹ = min x⁻¹ y⁻¹ := x:Realy:Realhx:x.isPoshy:y.isPos⊢ (max x y)⁻¹ = min x⁻¹ y⁻¹ All goals completed! 🐙
Вправа 5.4.9
theorem Real.inv_min {x y :Real} (hx:x.isPos) (hy:y.isPos) : (min x y)⁻¹ = max x⁻¹ y⁻¹ := x:Realy:Realhx:x.isPoshy:y.isPos⊢ (min x y)⁻¹ = max x⁻¹ y⁻¹ All goals completed! 🐙
Not from textbook: the rationals map as an ordered ring homomorphism into the reals.
abbrev Real.ratCast_ordered_hom : ℚ →+*o Real where
toRingHom := ratCast_hom
monotone' := ⊢ Monotone (↑↑ratCast_hom).toFun All goals completed! 🐙
end Chapter5