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:

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, (∃ N, a.m N a_1 = a.upperseq N) a_1 < x N a.m, n N, (a.seq n) < x a:Sequencex:ERealN:hN:a.m Nha:a.upperseq N < x N a.m, n N, (a.seq n) < x; a:Sequencex:ERealN:hN:a.m Nha:a.upperseq N < xN a.m n N, (a.seq n) < x a:Sequencex:ERealN:hN:a.m Nha:(a.from N).sup < x (n : ), N n (a.seq n) < x; a:Sequencex:ERealN:hN:a.m Nha:(a.from N).sup < xn: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:ERealN:hN:a.m Nha:(a.from N).sup < xn:a✝:N nhn':_fvar.53533 (Chapter6.Sequence.from _fvar.9041 _fvar.45956).m := ?_mvar.53547(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:_fvar.57731 < Chapter6.Sequence.upperseq _fvar.57730 _fvar.57733 := ?_mvar.57763n: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: b.TendsTo L) : c.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:b.TendsTo Lc.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 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:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807 n a.m, (a.seq n) -M a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807n:hN:n a.m(a.seq n) -M; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807n:hN:n a.m-M a.seq n; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807n:hN:n a.m-a.seq n M All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734 L_plus, a.limsup = L_plusa:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734 L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734 L_plus, a.limsup = L_plus a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.limsup = a.limsup.toReal a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.limsup.toReal = a.limsup; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734hlimsup_bound:a.limsup = M < a.limsup; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:?_mvar.121956 := LE.le.trans _fvar.102735 (Chapter6.Sequence.liminf_le_limsup _fvar.100622)a.limsup a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:a.limsup = a.limsup < -M; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.liminf = a.liminf.toReal; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.liminf.toReal = a.liminf; a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734a.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734hlimsup_bound:a.liminf Ma.liminf a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhliminf_bound:-_fvar.100626 Chapter6.Sequence.liminf _fvar.100622 := ?_mvar.102734hlimsup_bound:a.liminf = M < a.liminf; All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound:a.BoundedBy Mhlimsup_bound:Chapter6.Sequence.limsup _fvar.100622 _fvar.100626 := ?_mvar.100807hliminf_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:?_mvar.208155 := Chapter6.Sequence.liminf_le_limsup _fvar.1743940 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0h:ε.EventuallySteady aL_plus - L_minus 2 * ε; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329 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 a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083(a.from N).inf sSup {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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083(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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178 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 a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178h3:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.294570sInf {x | N a.m, x = (a.from N).sup} (a.from N).sup; a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178h3:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.294570(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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.254083h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178h3:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.294570 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178h3:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.294570h4:_fvar.174481 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).sup := ?_mvar.300668h1:?_mvar.335983 := LE.le.trans _fvar.254084 _fvar.259179L_plus - L_minus 2 * ε a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 _fvar.174481 - _fvar.174483 := ?_mvar.208149ε::ε > 0N:hN:N a.mhsteady:ε.Steady (a.from N)hN0:_fvar.245474 (Chapter6.Sequence.from _fvar.174394 _fvar.245474).m := ?_mvar.245502hN1:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.249329h2:(Chapter6.Sequence.from _fvar.174394 _fvar.245474).inf _fvar.174483 := ?_mvar.259178h3:failed to pretty print expression (use 'set_option pp.rawOnError true' for raw representation) := ?_mvar.294570h1:?_mvar.335983 := LE.le.trans _fvar.254084 _fvar.259179h4:?_mvar.336027 := LE.le.trans _fvar.300669 _fvar.294571L_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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hup: ε > 0, _fvar.174481 - _fvar.174483 2 * ε := fun ε => @?_mvar.245455 ε 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hup: ε > 0, _fvar.174481 - _fvar.174483 2 * ε := fun ε => @?_mvar.245455 ε 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hup: ε > 0, _fvar.174481 - _fvar.174483 2 * ε := fun ε => @?_mvar.245455 ε 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hup: ε > 0, _fvar.174481 - _fvar.174483 2 * ε := fun ε => @?_mvar.245455 ε 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hlow: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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hup: ε > 0, _fvar.174481 - _fvar.174483 2 * ε := fun ε => @?_mvar.245455 ε 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 _fvar.174481 - _fvar.174483 := ?_mvar.208149hlow: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