Аналіз I, Глава 6.3
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:
-
Suprema and infima of sequences
namespace Chapter6
Визначення 6.3.1
noncomputable abbrev Sequence.sup (a:Sequence) : EReal := sSup { x | ∃ n ≥ a.m, x = a n }
Визначення 6.3.1
noncomputable abbrev Sequence.inf (a:Sequence) : EReal := sInf { x | ∃ n ≥ a.m, x = a n }
Приклад 6.3.3
example : ((fun (n:ℕ) ↦ (-1:ℝ)^(n+1)):Sequence).sup = 1 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => (-1) ^ (n + 1)) n.toNat else 0, vanish := ⋯ }.sup = 1 All goals completed! 🐙
Приклад 6.3.3
example : ((fun (n:ℕ) ↦ (-1:ℝ)^(n+1)):Sequence).inf = -1 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => (-1) ^ (n + 1)) n.toNat else 0, vanish := ⋯ }.inf = -1 All goals completed! 🐙
Приклад 6.3.4 / Вправа 6.3.1
example : ((fun (n:ℕ) ↦ 1/((n:ℝ)+1)):Sequence).sup = 1 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => 1 / (↑n + 1)) n.toNat else 0, vanish := ⋯ }.sup = 1 All goals completed! 🐙
Приклад 6.3.4 / Вправа 6.3.1
example : ((fun (n:ℕ) ↦ 1/((n:ℝ)+1)):Sequence).inf = 0 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => 1 / (↑n + 1)) n.toNat else 0, vanish := ⋯ }.inf = 0 All goals completed! 🐙
Приклад 6.3.5
example : ((fun (n:ℕ) ↦ (n+1:ℝ)):Sequence).sup = ⊤ := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => ↑n + 1) n.toNat else 0, vanish := ⋯ }.sup = ⊤ All goals completed! 🐙
Приклад 6.3.5
example : ((fun (n:ℕ) ↦ (n+1:ℝ)):Sequence).inf = 1 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => ↑n + 1) n.toNat else 0, vanish := ⋯ }.inf = 1 All goals completed! 🐙
abbrev Sequence.bddAboveBy (a:Sequence) (M:ℝ) : Prop := ∀ n ≥ a.m, a n ≤ M
abbrev Sequence.bddAbove (a:Sequence) : Prop := ∃ M, a.bddAboveBy M
abbrev Sequence.bddBelowBy (a:Sequence) (M:ℝ) : Prop := ∀ n ≥ a.m, a n ≥ M
abbrev Sequence.bddBelow (a:Sequence) : Prop := ∃ M, a.bddBelowBy M
theorem Sequence.bounded_iff (a:Sequence) : a.isBounded ↔ a.bddAbove ∧ a.bddBelow := a:Sequence⊢ a.isBounded ↔ a.bddAbove ∧ a.bddBelow All goals completed! 🐙
theorem Sequence.sup_of_bounded {a:Sequence} (h: a.isBounded) : a.sup.isFinite := a:Sequenceh:a.isBounded⊢ a.sup.isFinite All goals completed! 🐙
theorem Sequence.inf_of_bounded {a:Sequence} (h: a.isBounded) : a.inf.isFinite := a:Sequenceh:a.isBounded⊢ a.inf.isFinite All goals completed! 🐙
Твердження 6.3.6 (Least upper bound property) / Вправа 6.3.2
theorem Sequence.le_sup {a:Sequence} {n:ℤ} (hn: n ≥ a.m) : a n ≤ a.sup := a:Sequencen:ℤhn:n ≥ a.m⊢ ↑(a.seq n) ≤ a.sup All goals completed! 🐙
Твердження 6.3.6 (Least upper bound property) / Вправа 6.3.2
theorem Sequence.sup_le_upper {a:Sequence} {M:EReal} (h: ∀ n ≥ a.m, a n ≤ M) : a.sup ≤ M := a:SequenceM:ERealh:∀ n ≥ a.m, ↑(a.seq n) ≤ M⊢ a.sup ≤ M All goals completed! 🐙
Твердження 6.3.6 (Least upper bound property) / Вправа 6.3.2
theorem Sequence.exists_between_lt_sup {a:Sequence} {y:EReal} (h: y < a.sup ) :
∃ n ≥ a.m, y < a n ∧ a n ≤ a.sup := a:Sequencey:ERealh:y < a.sup⊢ ∃ n ≥ a.m, y < ↑(a.seq n) ∧ ↑(a.seq n) ≤ a.sup All goals completed! 🐙
Ремарка 6.3.7
theorem Sequence.ge_inf {a:Sequence} {n:ℤ} (hn: n ≥ a.m) : a n ≥ a.inf := a:Sequencen:ℤhn:n ≥ a.m⊢ ↑(a.seq n) ≥ a.inf All goals completed! 🐙
Ремарка 6.3.7
theorem Sequence.inf_ge_lower {a:Sequence} {M:EReal} (h: ∀ n ≥ a.m, a n ≥ M) : a.inf ≥ M := a:SequenceM:ERealh:∀ n ≥ a.m, ↑(a.seq n) ≥ M⊢ a.inf ≥ M All goals completed! 🐙
Ремарка 6.3.7
theorem Sequence.exists_between_gt_inf {a:Sequence} {y:EReal} (h: y > a.inf ) :
∃ n ≥ a.m, y > a n ∧ a n ≥ a.inf := a:Sequencey:ERealh:y > a.inf⊢ ∃ n ≥ a.m, y > ↑(a.seq n) ∧ ↑(a.seq n) ≥ a.inf All goals completed! 🐙
abbrev Sequence.isMonotone (a:Sequence) : Prop := ∀ n ≥ a.m, a (n+1) ≥ a n
abbrev Sequence.isAntitone (a:Sequence) : Prop := ∀ n ≥ a.m, a (n+1) ≤ a n
Твердження 6.3.8 / Вправа 6.3.3
theorem Sequence.convergent_of_monotone {a:Sequence} (hbound: a.bddAbove) (hmono: a.isMonotone) :
a.convergent := a:Sequencehbound:a.bddAbovehmono:a.isMonotone⊢ a.convergent All goals completed! 🐙
Твердження 6.3.8 / Вправа 6.3.3
theorem Sequence.lim_of_monotone {a:Sequence} (hbound: a.bddAbove) (hmono: a.isMonotone) :
lim a = a.sup := a:Sequencehbound:a.bddAbovehmono:a.isMonotone⊢ ↑(lim a) = a.sup All goals completed! 🐙
theorem Sequence.convergent_of_antitone {a:Sequence} (hbound: a.bddBelow) (hmono: a.isAntitone) :
a.convergent := a:Sequencehbound:a.bddBelowhmono:a.isAntitone⊢ a.convergent All goals completed! 🐙
theorem Sequence.lim_of_antitone {a:Sequence} (hbound: a.bddBelow) (hmono: a.isAntitone) :
lim a = a.inf := a:Sequencehbound:a.bddBelowhmono:a.isAntitone⊢ ↑(lim a) = a.inf All goals completed! 🐙
theorem Sequence.convergent_iff_bounded_of_monotone {a:Sequence} (ha: a.isMonotone) :
a.convergent ↔ a.isBounded := a:Sequenceha:a.isMonotone⊢ a.convergent ↔ a.isBounded All goals completed! 🐙
theorem Sequence.bounded_iff_convergent_of_antitone {a:Sequence} (ha: a.isAntitone) :
a.convergent ↔ a.isBounded := a:Sequenceha:a.isAntitone⊢ a.convergent ↔ a.isBounded All goals completed! 🐙
Приклад 6.3.9
example : (Example_6_3_9:Sequence).isMonotone := ⊢ { m := 0, seq := fun n => if n ≥ 0 then Example_6_3_9 n.toNat else 0, vanish := ⋯ }.isMonotone All goals completed! 🐙
Приклад 6.3.9
example : (Example_6_3_9:Sequence).bddAboveBy 4 := ⊢ { m := 0, seq := fun n => if n ≥ 0 then Example_6_3_9 n.toNat else 0, vanish := ⋯ }.bddAboveBy 4 All goals completed! 🐙
Приклад 6.3.9
example : (Example_6_3_9:Sequence).convergent := ⊢ { m := 0, seq := fun n => if n ≥ 0 then Example_6_3_9 n.toNat else 0, vanish := ⋯ }.convergent All goals completed! 🐙
Приклад 6.3.9
example : lim (Example_6_3_9:Sequence) ≤ 4 := ⊢ lim { m := 0, seq := fun n => if n ≥ 0 then Example_6_3_9 n.toNat else 0, vanish := ⋯ } ≤ 4 All goals completed! 🐙
Твердження 6.3.1
theorem lim_of_exp {x:ℝ} (hpos: 0 < x) (hbound: x < 1) :
((fun (n:ℕ) ↦ x^n):Sequence).convergent ∧ lim ((fun (n:ℕ) ↦ x^n):Sequence) = 0 := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0
-- цей доказ написан так, щоб співпадати із структурою орігінального тексту.
x:ℝhpos:0 < xhbound:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }⊢ a.convergent ∧ lim a = 0
x:ℝhpos:0 < xhbound:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitone⊢ a.convergent ∧ lim a = 0
have hbound : a.bddBelowBy 0 := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0
x:ℝhpos:0 < xhbound:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonen:ℤhn:n ≥ a.m⊢ a.seq n ≥ 0; All goals completed! 🐙
have hbound' : a.bddBelow := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0 All goals completed! 🐙
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergent⊢ a.convergent ∧ lim a = 0
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim a⊢ a.convergent ∧ L = 0
have : lim ((fun (n:ℕ) ↦ x^(n+1)):Sequence) = x * L := calc
_ = lim (x • ((fun (n:ℕ) ↦ x^n):Sequence)) := x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim a⊢ lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0, vanish := ⋯ } =
lim (x • { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ })
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim a⊢ (fun n => if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0) = fun n =>
x * { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.seq n; x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim an:ℤ⊢ (if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0) =
x * { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.seq n
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim an:ℤh:n ≥ 0⊢ (if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0) =
x * { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.seq nx:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim an:ℤh:¬n ≥ 0⊢ (if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0) =
x * { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.seq n
all_goals All goals completed! 🐙
_ = x * lim ((fun (n:ℕ) ↦ x^n):Sequence) := x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim a⊢ lim (x • { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }) =
x * lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }
All goals completed! 🐙
_ = _ := rfl
have why2 :lim ((fun (n:ℕ) ↦ x^(n+1)):Sequence) = lim ((fun (n:ℕ) ↦ x^n):Sequence) := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0 All goals completed! 🐙
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim athis:lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0, vanish := ⋯ } = x * Lwhy2:x * L = lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }⊢ a.convergent ∧ L = 0
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim athis:lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0, vanish := ⋯ } = x * Lwhy2:x * L = L⊢ a.convergent ∧ L = 0
replace why2 : x * L = 1 * L := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0 All goals completed! 🐙
have hx : x ≠ 1 := x:ℝhpos:0 < xhbound:x < 1⊢ { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent ∧
lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ } = 0 All goals completed! 🐙
x:ℝhpos:0 < xhbound✝:x < 1a:Sequence := { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }why:a.isAntitonehbound:a.bddBelowBy 0hbound':a.bddBelowhconv:a.convergentL:ℝ := lim athis:lim { m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ (n + 1)) n.toNat else 0, vanish := ⋯ } = x * Lhx:x ≠ 1why2:L = 0⊢ a.convergent ∧ L = 0
All goals completed! 🐙
Вправа 6.3.4
theorem lim_of_exp' {x:ℝ} (hbound: x > 1) : ¬((fun (n:ℕ) ↦ x^n):Sequence).convergent := x:ℝhbound:x > 1⊢ ¬{ m := 0, seq := fun n => if n ≥ 0 then (fun n => x ^ n) n.toNat else 0, vanish := ⋯ }.convergent All goals completed! 🐙
end Chapter6