Analysis I, Section 6.4: Limsup, liminf, and limit points

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:

  • Lim sup and lim inf of sequences

  • Limit points of sequences

  • Comparison and squeeze tests

  • Completeness of the reals

abbrev Real.Adherent (ε:) (a:Chapter6.Sequence) (x:) := n a.m, ε.Close (a n) xabbrev Real.ContinuallyAdherent (ε:) (a:Chapter6.Sequence) (x:) := N a.m, ε.Adherent (a.from N) xnamespace Chapter6open ERealabbrev Sequence.LimitPoint (a:Sequence) (x:) : Prop := ε > (0:), ε.ContinuallyAdherent a xtheorem declaration uses `sorry`Sequence.limit_point_def (a:Sequence) (x:) : a.LimitPoint x ε > 0, N a.m, n N, |a n - x| ε := a:Sequencex:a.LimitPoint x ε > 0, N a.m, n N, |a.seq n - x| ε a:Sequencex:(∀ ε > 0, N a.m, n (a.from N).m, ε.Close ((a.from N).seq n) x) ε > 0, N a.m, n N, |a.seq n - x| ε All goals completed! 🐙noncomputable abbrev Example_6_4_3 : Sequence := (fun (n:) 1 - (10:)^(-(n:)-1))

Example 6.4.3

declaration uses `sorry`example : (0.1:).Adherent Example_6_4_3 0.8 := Real.Adherent 0.1 Example_6_4_3 0.8 All goals completed! 🐙

Example 6.4.3

declaration uses `sorry`example : ¬ (0.1:).ContinuallyAdherent Example_6_4_3 0.8 := ¬Real.ContinuallyAdherent 0.1 Example_6_4_3 0.8 All goals completed! 🐙

Example 6.4.3

declaration uses `sorry`example : (0.1:).ContinuallyAdherent Example_6_4_3 1 := Real.ContinuallyAdherent 0.1 Example_6_4_3 1 All goals completed! 🐙

Example 6.4.3

declaration uses `sorry`example : Example_6_4_3.LimitPoint 1 := Example_6_4_3.LimitPoint 1 All goals completed! 🐙
noncomputable abbrev Example_6_4_4 : Sequence := (fun (n:) (-1:)^n * (1 + (10:)^(-(n:)-1)))

Example 6.4.4

declaration uses `sorry`example : (0.1:).Adherent Example_6_4_4 1 := Real.Adherent 0.1 Example_6_4_4 1 All goals completed! 🐙

Example 6.4.4

declaration uses `sorry`example : (0.1:).ContinuallyAdherent Example_6_4_4 1 := Real.ContinuallyAdherent 0.1 Example_6_4_4 1 All goals completed! 🐙

Example 6.4.4

declaration uses `sorry`example : Example_6_4_4.LimitPoint 1 := Example_6_4_4.LimitPoint 1 All goals completed! 🐙

Example 6.4.4

declaration uses `sorry`example : Example_6_4_4.LimitPoint (-1) := Example_6_4_4.LimitPoint (-1) All goals completed! 🐙

Example 6.4.4

declaration uses `sorry`example : ¬ Example_6_4_4.LimitPoint 0 := ¬Example_6_4_4.LimitPoint 0 All goals completed! 🐙

Proposition 6.4.5 / Exercise 6.4.1

theorem declaration uses `sorry`Sequence.limit_point_of_limit {a:Sequence} {x:} (h: a.TendsTo x) : a.LimitPoint x := a:Sequencex:h:a.TendsTo xa.LimitPoint x All goals completed! 🐙

A technical issue uncovered by the formalization: the upper and lower sequences of a real sequence take values in the extended reals rather than the reals, so the definitions need to be adjusted accordingly.

noncomputable abbrev Sequence.upperseq (a:Sequence) : EReal := fun N (a.from N).sup
noncomputable abbrev Sequence.limsup (a:Sequence) : EReal := sInf { x | N a.m, x = a.upperseq N }noncomputable abbrev Sequence.lowerseq (a:Sequence) : EReal := fun N (a.from N).infnoncomputable abbrev Sequence.liminf (a:Sequence) : EReal := sSup { x | N a.m, x = a.lowerseq N }noncomputable abbrev Example_6_4_7 : Sequence := (fun (n:) (-1:)^n * (1 + (10:)^(-(n:)-1)))declaration uses `sorry`example (n:) : Example_6_4_7.upperseq n = if Even n then 1 + (10:)^(-(n:)-1) else 1 + (10:)^(-(n:)-2) := n:Example_6_4_7.upperseq n = (if Even n then 1 + 10 ^ (-n - 1) else 1 + 10 ^ (-n - 2)) All goals completed! 🐙declaration uses `sorry`example : Example_6_4_7.limsup = 1 := Example_6_4_7.limsup = 1 All goals completed! 🐙declaration uses `sorry`example (n:) : Example_6_4_7.lowerseq n = if Even n then -(1 + (10:)^(-(n:)-2)) else -(1 + (10:)^(-(n:)-1)) := n:Example_6_4_7.lowerseq n = (if Even n then -(1 + 10 ^ (-n - 2)) else -(1 + 10 ^ (-n - 1))) All goals completed! 🐙declaration uses `sorry`example : Example_6_4_7.liminf = -1 := Example_6_4_7.liminf = -1 All goals completed! 🐙declaration uses `sorry`example : Example_6_4_7.sup = (1.1:) := Example_6_4_7.sup = 1.1 All goals completed! 🐙declaration uses `sorry`example : Example_6_4_7.inf = (-1.01:) := Example_6_4_7.inf = (-1.01) All goals completed! 🐙noncomputable abbrev Example_6_4_8 : Sequence := (fun (n:) if Even n then (n+1:) else -(n:)-1)declaration uses `sorry`example (n:) : Example_6_4_8.upperseq n = := n:Example_6_4_8.upperseq n = All goals completed! 🐙declaration uses `sorry`example : Example_6_4_8.limsup = := Example_6_4_8.limsup = All goals completed! 🐙declaration uses `sorry`example (n:) : Example_6_4_8.lowerseq n = := n:Example_6_4_8.lowerseq n = All goals completed! 🐙declaration uses `sorry`example : Example_6_4_8.liminf = := Example_6_4_8.liminf = All goals completed! 🐙noncomputable abbrev Example_6_4_9 : Sequence := (fun (n:) if Even n then (n+1:)⁻¹ else -(n+1:)⁻¹)declaration uses `sorry`example (n:) : Example_6_4_9.upperseq n = if Even n then (n+1:)⁻¹ else -(n+2:)⁻¹ := n:Example_6_4_9.upperseq n = (if Even n then (n + 1)⁻¹ else -(n + 2)⁻¹) All goals completed! 🐙declaration uses `sorry`example : Example_6_4_9.limsup = 0 := Example_6_4_9.limsup = 0 All goals completed! 🐙declaration uses `sorry`example (n:) : Example_6_4_9.lowerseq n = if Even n then -(n+2:)⁻¹ else -(n+1:)⁻¹ := n:Example_6_4_9.lowerseq n = (if Even n then -(n + 2)⁻¹ else -(n + 1)⁻¹) All goals completed! 🐙declaration uses `sorry`example : Example_6_4_9.liminf = 0 := Example_6_4_9.liminf = 0 All goals completed! 🐙noncomputable abbrev Example_6_4_10 : Sequence := (fun (n:) (n+1:))declaration uses `sorry`example (n:) : Example_6_4_10.upperseq n = := n:Example_6_4_10.upperseq n = All goals completed! 🐙declaration uses `sorry`example : Example_6_4_9.limsup = := Example_6_4_9.limsup = All goals completed! 🐙declaration uses `sorry`example (n:) : Example_6_4_9.lowerseq n = n+1 := n:Example_6_4_9.lowerseq n = n + 1 All goals completed! 🐙declaration uses `sorry`example : Example_6_4_9.liminf = := Example_6_4_9.liminf = All goals completed! 🐙

Proposition 6.4.12(a)

theorem Sequence.gt_limsup_bounds {a:Sequence} {x:EReal} (h: x > a.limsup) : N a.m, n N, a n < x := a:Sequencex:ERealh:x > a.limsup N a.m, n N, (a.seq n) < x -- This proof is written to follow the structure of the original text. a:Sequencex:ERealh: a_1 {x | N a.m, x = a.upperseq N}, a_1 < x N a.m, n N, (a.seq n) < x a:Sequencex:ERealy:ERealhy:y {x | N a.m, x = a.upperseq N}ha:y < x N a.m, n N, (a.seq n) < x a:Sequencex:ERealy:ERealha:y < xN:hN:N a.mhNy:y = a.upperseq N N a.m, n N, (a.seq n) < x a:Sequencex:ERealy:ERealN:ha:a.upperseq N < xhN:N a.mhNy:y = a.upperseq N N a.m, n N, (a.seq n) < x; a:Sequencex:ERealy:ERealN:ha:a.upperseq N < xhN:N a.mhNy:y = a.upperseq NN a.m n N, (a.seq n) < x a:Sequencex:ERealy:ERealN:ha:(a.from N).sup < xhN:N a.mhNy:y = a.upperseq N (n : ), N n (a.seq n) < x; intro n a:Sequencex:ERealy:ERealN:ha:(a.from N).sup < xhN:N a.mhNy:y = a.upperseq Nn:a✝:N n(a.seq n) < x have hn' : n (a.from N).m := a:Sequencex:ERealh:x > a.limsup N a.m, n N, (a.seq n) < x All goals completed! 🐙 a:Sequencex:ERealy:ERealN:ha:(a.from N).sup < xhN:N a.mhNy:y = a.upperseq Nn:a✝:N nhn':n (a.from N).m := gt_limsup_bounds._proof_1 N hN n a✝(a.seq n) = ((a.from N).seq n) All goals completed! 🐙

Proposition 6.4.12(a)

theorem declaration uses `sorry`Sequence.lt_liminf_bounds {a:Sequence} {y:EReal} (h: y < a.liminf) : N a.m, n N, a n > y := a:Sequencey:ERealh:y < a.liminf N a.m, n N, (a.seq n) > y All goals completed! 🐙

Proposition 6.4.12(b)

theorem Sequence.lt_limsup_bounds {a:Sequence} {x:EReal} (h: x < a.limsup) {N:} (hN: N a.m) : n N, a n > x := a:Sequencex:ERealh:x < a.limsupN:hN:N a.m n N, (a.seq n) > x -- This proof is written to follow the structure of the original text. have hx : x < a.upperseq N := a:Sequencex:ERealh:x < a.limsupN:hN:N a.m n N, (a.seq n) > x a:Sequencex:ERealh:x < a.limsupN:hN:N a.ma.upperseq N {x | N a.m, x = a.upperseq N}; a:Sequencex:ERealh:x < a.limsupN:hN:N a.m N_1, a.m N_1 a.upperseq N = a.upperseq N_1; All goals completed! 🐙 a:Sequencex:ERealh:x < a.limsupN:hN:N a.mhx:x < a.upperseq N := lt_of_lt_of_le h (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = a.upperseq N))))) (a.upperseq N))) (Exists.intro N hN, Eq.refl (a.upperseq N))))n:hn:n (a.from N).mhxn:x < ((a.from N).seq n)a✝:((a.from N).seq n) (a.from N).sup n N, (a.seq n) > x All goals completed! 🐙

Proposition 6.4.12(b)

theorem declaration uses `sorry`Sequence.gt_liminf_bounds {a:Sequence} {x:EReal} (h: x > a.liminf) {N:} (hN: N a.m) : n N, a n < x := a:Sequencex:ERealh:x > a.liminfN:hN:N a.m n N, (a.seq n) < x All goals completed! 🐙

Proposition 6.4.12(c) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.inf_le_liminf (a:Sequence) : a.inf a.liminf := a:Sequencea.inf a.liminf All goals completed! 🐙

Proposition 6.4.12(c) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.liminf_le_limsup (a:Sequence) : a.liminf a.limsup := a:Sequencea.liminf a.limsup All goals completed! 🐙

Proposition 6.4.12(c) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.limsup_le_sup (a:Sequence) : a.limsup a.sup := a:Sequencea.limsup a.sup All goals completed! 🐙

Proposition 6.4.12(d) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.limit_point_between_liminf_limsup {a:Sequence} {c:} (h: a.LimitPoint c) : a.liminf c c a.limsup := a:Sequencec:h:a.LimitPoint ca.liminf c c a.limsup All goals completed! 🐙

Proposition 6.4.12(e) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.limit_point_of_limsup {a:Sequence} {L_plus:} (h: a.limsup = L_plus) : a.LimitPoint L_plus := a:SequenceL_plus:h:a.limsup = L_plusa.LimitPoint L_plus All goals completed! 🐙

Proposition 6.4.12(e) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.limit_point_of_liminf {a:Sequence} {L_minus:} (h: a.liminf = L_minus) : a.LimitPoint L_minus := a:SequenceL_minus:h:a.liminf = L_minusa.LimitPoint L_minus All goals completed! 🐙

Proposition 6.4.12(f) / Exercise 6.4.3

theorem declaration uses `sorry`Sequence.tendsTo_iff_eq_limsup_liminf {a:Sequence} (c:) : a.TendsTo c a.liminf = c a.limsup = c := a:Sequencec:a.TendsTo c a.liminf = c a.limsup = c All goals completed! 🐙

Lemma 6.4.13 (Comparison principle) / Exercise 6.4.4

theorem declaration uses `sorry`Sequence.sup_mono {a b:Sequence} (hm: a.m = b.m) (hab: n a.m, a n b n) : a.sup b.sup := a:Sequenceb:Sequencehm:a.m = b.mhab: n a.m, a.seq n b.seq na.sup b.sup All goals completed! 🐙

Lemma 6.4.13 (Comparison principle) / Exercise 6.4.4

theorem declaration uses `sorry`Sequence.inf_mono {a b:Sequence} (hm: a.m = b.m) (hab: n a.m, a n b n) : a.inf b.inf := a:Sequenceb:Sequencehm:a.m = b.mhab: n a.m, a.seq n b.seq na.inf b.inf All goals completed! 🐙

Lemma 6.4.13 (Comparison principle) / Exercise 6.4.4

theorem declaration uses `sorry`Sequence.limsup_mono {a b:Sequence} (hm: a.m = b.m) (hab: n a.m, a n b n) : a.limsup b.limsup := a:Sequenceb:Sequencehm:a.m = b.mhab: n a.m, a.seq n b.seq na.limsup b.limsup All goals completed! 🐙

Lemma 6.4.13 (Comparison principle) / Exercise 6.4.4

theorem declaration uses `sorry`Sequence.liminf_mono {a b:Sequence} (hm: a.m = b.m) (hab: n a.m, a n b n) : a.liminf b.liminf := a:Sequenceb:Sequencehm:a.m = b.mhab: n a.m, a.seq n b.seq na.liminf b.liminf All goals completed! 🐙

Corollary 6.4.14 (Squeeze test) / Exercise 6.4.5

theorem declaration uses `sorry`Sequence.lim_of_between {a b c:Sequence} {L:} (hm: b.m = a.m c.m = a.m) (hab: n a.m, a n b n b n c n) (ha: a.TendsTo L) (hb: c.TendsTo L) : b.TendsTo L := a:Sequenceb:Sequencec:SequenceL:hm:b.m = a.m c.m = a.mhab: n a.m, a.seq n b.seq n b.seq n c.seq nha:a.TendsTo Lhb:c.TendsTo Lb.TendsTo L All goals completed! 🐙

Example 6.4.15

declaration uses `sorry`example : ((fun (n:) 2/(n+1:)):Sequence).TendsTo 0 := (↑fun n => 2 / (n + 1)).TendsTo 0 All goals completed! 🐙

Example 6.4.15

declaration uses `sorry`example : ((fun (n:) -2/(n+1:)):Sequence).TendsTo 0 := (↑fun n => -2 / (n + 1)).TendsTo 0 All goals completed! 🐙

Example 6.4.15

declaration uses `sorry`example : ((fun (n:) (-1)^n/(n+1:) + 1 / (n+1)^2):Sequence).TendsTo 0 := (↑fun n => (-1) ^ n / (n + 1) + 1 / (n + 1) ^ 2).TendsTo 0 All goals completed! 🐙

Example 6.4.15

declaration uses `sorry`example : ((fun (n:) (2:)^(-(n:))):Sequence).TendsTo 0 := (↑fun n => 2 ^ (-n)).TendsTo 0 All goals completed! 🐙
abbrev Sequence.abs (a:Sequence) : Sequence where m := a.m seq n := |a n| vanish n hn := a:Sequencen:hn:n < a.m|a.seq n| = 0 All goals completed! 🐙

Corollary 6.4.17 (Zero test for sequences) / Exercise 6.4.7

theorem declaration uses `sorry`Sequence.tendsTo_zero_iff (a:Sequence) : a.TendsTo (0:) a.abs.TendsTo (0:) := a:Sequencea.TendsTo 0 a.abs.TendsTo 0 All goals completed! 🐙

This helper lemma, implicit in the textbook proofs of Theorem 6.4.18 and Theorem 6.6.8, is made explicit here.

theorem Sequence.finite_limsup_liminf_of_bounded {a:Sequence} (hbound: a.IsBounded) : ( L_plus:, a.limsup = L_plus) ( L_minus:, a.liminf = L_minus) := a:Sequencehbound:a.IsBounded(∃ L_plus, a.limsup = L_plus) L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound:a.BoundedBy M(∃ L_plus, a.limsup = L_plus) L_minus, a.liminf = L_minus have hlimsup_bound : a.limsup M := a:Sequencehbound:a.IsBounded(∃ L_plus, a.limsup = L_plus) L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound:a.BoundedBy M n a.m, (a.seq n) M intro n a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mn:hN:n a.m(a.seq n) M; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mn:hN:n a.ma.seq n M All goals completed! 🐙 have hliminf_bound : -M a.liminf := a:Sequencehbound:a.IsBounded(∃ L_plus, a.limsup = L_plus) L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n))) n a.m, (a.seq n) -M intro n a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))n:hN:n a.m(a.seq n) -M; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))n:hN:n a.m-M a.seq n; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))n:hN:n a.m-a.seq n M All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a) L_plus, a.limsup = L_plusa:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a) L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a) L_plus, a.limsup = L_plus a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.limsup = a.limsup.toReal a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.limsup.toReal = a.limsup; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)hlimsup_bound:a.limsup = M < a.limsup; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.limsup := LE.le.trans _fvar.107677 (liminf_le_limsup a)a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:a.limsup = a.limsup < -M; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.liminf = a.liminf.toReal; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.liminf.toReal = a.liminf; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)hlimsup_bound:a.liminf Ma.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-M a.liminf := LE.le.trans (inf_ge_lower fun n hN => Eq.mpr (id (Eq.trans ge_iff_le._simp_1 coe_le_coe_iff._simp_1)) (Eq.mpr (id (congrArg (fun _a => _a) (propext neg_le))) (LE.le.trans (neg_le_abs (a.seq n)) (hbound n)))) (inf_le_liminf a)hlimsup_bound:a.liminf = M < a.liminf; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:a.limsup M := LE.le.trans (limsup_le_sup a) (sup_le_upper fun n hN => Eq.mpr (id coe_le_coe_iff._simp_1) (LE.le.trans (le_abs_self (a.seq n)) (hbound n)))hliminf_bound:a.liminf = a.liminf < -M; All goals completed! 🐙

Theorem 6.4.18 (Completeness of the reals)

theorem Sequence.Cauchy_iff_convergent (a:Sequence) : a.IsCauchy a.Convergent := a:Sequencea.IsCauchy a.Convergent -- This proof is written to follow the structure of the original text. a:Sequencea.IsCauchy a.Convergent; a:Sequenceh:a.IsCauchya.Convergent a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minusa.Convergent a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minusa.TendsTo L_minus; a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minusL_plus = L_minus have hlow : 0 L_plus - L_minus := a:Sequencea.IsCauchy a.Convergent a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minusthis:a.liminf a.limsup := liminf_le_limsup a0 L_plus - L_minus; a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minusthis:L_minus L_plus0 L_plus - L_minus; All goals completed! 🐙 have hup (ε:) (: ε>0) : L_plus - L_minus 2*ε := a:Sequencea.IsCauchy a.Convergent a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0h:ε.EventuallySteady aL_plus - L_minus 2 * ε; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)L_plus - L_minus 2 * ε have hN0 : N (a.from N).m := a:Sequencea.IsCauchy a.Convergent All goals completed! 🐙 have hN1 : (a.from N).seq N = a.seq N := a:Sequencea.IsCauchy a.Convergent All goals completed! 🐙 have h1 : (a N - ε:) (a.from N).inf := a:Sequencea.IsCauchy a.Convergent a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0 n (a.from N).m, ((a.from N).seq n) (a.seq N - ε); All goals completed! 🐙 have h2 : (a.from N).inf L_minus := a:Sequencea.IsCauchy a.Convergent simp_rw a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)(a.from N).inf L_minushL_minus, liminf, lowerseq]; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)(a.from N).inf {x | N a.m, x = (a.from N).inf}; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1) N_1, a.m N_1 (a.from N).inf = (a.from N_1).inf; All goals completed! 🐙 have h3 : (a.from N).sup (a N + ε:) := a:Sequencea.IsCauchy a.Convergent a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf))))) n (a.from N).m, ((a.from N).seq n) (a.seq N + ε); All goals completed! 🐙 have h4 : L_plus (a.from N).sup := a:Sequencea.IsCauchy a.Convergent simp_rw a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf)))))h3:(a.from N).sup (a.seq N + ε) := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N hsteady hN0 hN1)L_plus (a.from N).suphL_plus, limsup, upperseq]; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf)))))h3:(a.from N).sup (a.seq N + ε) := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N hsteady hN0 hN1)(a.from N).sup {x | N a.m, x = (a.from N).sup}; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h1:(a.seq N - ε) (a.from N).inf := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N hsteady hN0 hN1)h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf)))))h3:(a.from N).sup (a.seq N + ε) := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N hsteady hN0 hN1) N_1, a.m N_1 (a.from N).sup = (a.from N_1).sup; All goals completed! 🐙 a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf)))))h3:(a.from N).sup (a.seq N + ε) := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N hsteady hN0 hN1)h4:L_plus (a.from N).sup := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N hN, Eq.refl (a.from N).sup)))))h1:(a.seq N - ε) L_minus := LE.le.trans _fvar.291008 h2L_plus - L_minus 2 * ε a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:N (a.from N).m := Cauchy_iff_convergent._proof_2 a N hNhN1:(a.from N).seq N = a.seq N := Cauchy_iff_convergent._proof_3 a N hN0h2:(a.from N).inf L_minus := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N hN, Eq.refl (a.from N).inf)))))h3:(a.from N).sup (a.seq N + ε) := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N hsteady hN0 hN1)h1:(a.seq N - ε) L_minus := LE.le.trans _fvar.291008 h2h4:L_plus (a.seq N + ε) := LE.le.trans _fvar.367957 h3L_plus - L_minus 2 * ε All goals completed! 🐙 a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hup: ε > 0, L_plus - L_minus 2 * ε := fun ε => (fun N x => have hN0 := Cauchy_iff_convergent._proof_2 a N x.left; have hN1 := Cauchy_iff_convergent._proof_3 a N hN0; have h1 := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N x.right hN0 hN1); have h2 := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N x.left, Eq.refl (a.from N).inf))))); have h3 := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N x.right hN0 hN1); have h4 := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N x.left, Eq.refl (a.from N).sup))))); have h1 := LE.le.trans h1 h2; have h4 := LE.le.trans h4 h3; Cauchy_iff_convergent._proof_7 a L_plus L_minus ε N h1 h4) (Classical.choose (h ε )) (Classical.choose_spec (h ε ))hlow:0 < L_plus - L_minusL_plus = L_minusa:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hup: ε > 0, L_plus - L_minus 2 * ε := fun ε => (fun N x => have hN0 := Cauchy_iff_convergent._proof_2 a N x.left; have hN1 := Cauchy_iff_convergent._proof_3 a N hN0; have h1 := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N x.right hN0 hN1); have h2 := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N x.left, Eq.refl (a.from N).inf))))); have h3 := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N x.right hN0 hN1); have h4 := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N x.left, Eq.refl (a.from N).sup))))); have h1 := LE.le.trans h1 h2; have h4 := LE.le.trans h4 h3; Cauchy_iff_convergent._proof_7 a L_plus L_minus ε N h1 h4) (Classical.choose (h ε )) (Classical.choose_spec (h ε ))hlow:0 = L_plus - L_minusL_plus = L_minus a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hup: ε > 0, L_plus - L_minus 2 * ε := fun ε => (fun N x => have hN0 := Cauchy_iff_convergent._proof_2 a N x.left; have hN1 := Cauchy_iff_convergent._proof_3 a N hN0; have h1 := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N x.right hN0 hN1); have h2 := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N x.left, Eq.refl (a.from N).inf))))); have h3 := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N x.right hN0 hN1); have h4 := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N x.left, Eq.refl (a.from N).sup))))); have h1 := LE.le.trans h1 h2; have h4 := LE.le.trans h4 h3; Cauchy_iff_convergent._proof_7 a L_plus L_minus ε N h1 h4) (Classical.choose (h ε )) (Classical.choose_spec (h ε ))hlow:0 < L_plus - L_minusL_plus = L_minus a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hup: ε > 0, L_plus - L_minus 2 * ε := fun ε => (fun N x => have hN0 := Cauchy_iff_convergent._proof_2 a N x.left; have hN1 := Cauchy_iff_convergent._proof_3 a N hN0; have h1 := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N x.right hN0 hN1); have h2 := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N x.left, Eq.refl (a.from N).inf))))); have h3 := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N x.right hN0 hN1); have h4 := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N x.left, Eq.refl (a.from N).sup))))); have h1 := LE.le.trans h1 h2; have h4 := LE.le.trans h4 h3; Cauchy_iff_convergent._proof_7 a L_plus L_minus ε N h1 h4) (Classical.choose (h ε )) (Classical.choose_spec (h ε ))hlow:0 < L_plus - L_minus(L_plus - L_minus) / 3 > 0a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hlow:0 < L_plus - L_minushup:L_plus - L_minus 2 * ((L_plus - L_minus) / 3)L_plus = L_minus a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hup: ε > 0, L_plus - L_minus 2 * ε := fun ε => (fun N x => have hN0 := Cauchy_iff_convergent._proof_2 a N x.left; have hN1 := Cauchy_iff_convergent._proof_3 a N hN0; have h1 := inf_ge_lower (Cauchy_iff_convergent._proof_4 a ε N x.right hN0 hN1); have h2 := Eq.mpr (id (congrArg (LE.le (a.from N).inf) (Eq.symm hL_minus))) (id (id (le_sSup (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).inf))))) (a.from N).inf)) (Exists.intro N x.left, Eq.refl (a.from N).inf))))); have h3 := sup_le_upper (Cauchy_iff_convergent._proof_5 a ε N x.right hN0 hN1); have h4 := Eq.mpr (id (congrFun' (congrArg LE.le (Eq.symm hL_plus)) (a.from N).sup)) (id (id (sInf_le (Eq.mpr (id (congrFun' (congrArg Membership.mem (congrArg setOf (funext fun x => congrArg Exists (funext fun N => congrFun' (congrArg And ge_iff_le._simp_1) (x = (a.from N).sup))))) (a.from N).sup)) (Exists.intro N x.left, Eq.refl (a.from N).sup))))); have h1 := LE.le.trans h1 h2; have h4 := LE.le.trans h4 h3; Cauchy_iff_convergent._proof_7 a L_plus L_minus ε N h1 h4) (Classical.choose (h ε )) (Classical.choose_spec (h ε ))hlow:0 < L_plus - L_minus(L_plus - L_minus) / 3 > 0a:Sequenceh:a.IsCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minus := have this := liminf_le_limsup a; Cauchy_iff_convergent._proof_1 L_plus L_minus (Eq.mp (Eq.trans (congr (congrArg LE.le hL_minus) hL_plus) coe_le_coe_iff._simp_1) this)hlow:0 < L_plus - L_minushup:L_plus - L_minus 2 * ((L_plus - L_minus) / 3)L_plus = L_minus All goals completed! 🐙 All goals completed! 🐙

Exercise 6.4.6

theorem declaration uses `sorry`Sequence.sup_not_strict_mono : (a b: ), ( n, a n < b n) ¬ (a:Sequence).sup < (b:Sequence).sup := a b, (∀ (n : ), a n < b n) ¬(↑a).sup < (↑b).sup All goals completed! 🐙
/- Exercise 6.4.7 -/ def declaration uses `sorry`Sequence.tendsTo_real_iff : Decidable ( (a:Sequence) (x:), a.TendsTo x a.abs.TendsTo x) := Decidable (∀ (a : Sequence) (x : ), a.TendsTo x a.abs.TendsTo x) -- The first line of this construction should be `apply isTrue` or `apply isFalse`. All goals completed! 🐙

This definition is needed for Exercises 6.4.8 and 6.4.9.

abbrev Sequence.ExtendedLimitPoint (a:Sequence) (x:EReal) : Prop := if x = then ¬ a.BddAbove else if x = then ¬ a.BddBelow else a.LimitPoint x.toReal

Exercise 6.4.8

theorem declaration uses `sorry`Sequence.extended_limit_point_of_limsup (a:Sequence) : a.ExtendedLimitPoint a.limsup := a:Sequencea.ExtendedLimitPoint a.limsup All goals completed! 🐙

Exercise 6.4.8

theorem declaration uses `sorry`Sequence.extended_limit_point_of_liminf (a:Sequence) : a.ExtendedLimitPoint a.liminf := a:Sequencea.ExtendedLimitPoint a.liminf All goals completed! 🐙
theorem declaration uses `sorry`Sequence.extended_limit_point_le_limsup {a:Sequence} {L:EReal} (h:a.ExtendedLimitPoint L): L a.limsup := a:SequenceL:ERealh:a.ExtendedLimitPoint LL a.limsup All goals completed! 🐙theorem declaration uses `sorry`Sequence.extended_limit_point_ge_liminf {a:Sequence} {L:EReal} (h:a.ExtendedLimitPoint L): L a.liminf := a:SequenceL:ERealh:a.ExtendedLimitPoint LL a.liminf All goals completed! 🐙

Exercise 6.4.9

theorem declaration uses `sorry`Sequence.exists_three_limit_points : a:Sequence, L:EReal, a.ExtendedLimitPoint L L = L = 0 L = := a, (L : EReal), a.ExtendedLimitPoint L L = L = 0 L = All goals completed! 🐙

Exercise 6.4.10

theorem declaration uses `sorry`Sequence.limit_points_of_limit_points {a b:Sequence} {c:} (hab: n b.m, a.LimitPoint (b n)) (hbc: b.LimitPoint c) : a.LimitPoint c := a:Sequenceb:Sequencec:hab: n b.m, a.LimitPoint (b.seq n)hbc:b.LimitPoint ca.LimitPoint c All goals completed! 🐙
end Chapter6