Аналіз I, Глава 6.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:

abbrev Real.adherent (ε:) (a:Chapter6.Sequence) (x:) := n a.m, ε.close (a n) xabbrev Real.continually_adherent (ε:) (a:Chapter6.Sequence) (x:) := N a.m, ε.adherent (a.from N) xnamespace Chapter6abbrev Sequence.limit_point (a:Sequence) (x:) : Prop := ε > (0:), ε.continually_adherent a xtheorem declaration uses 'sorry'Sequence.limit_point_def (a:Sequence) (x:) : a.limit_point x ε > 0, N a.m, n N, |a n - x| ε := a:Sequencex:a.limit_point 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))

Приклад 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! 🐙

Приклад 6.4.3

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

Приклад 6.4.3

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

Приклад 6.4.3

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

Приклад 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! 🐙

Приклад 6.4.4

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

Приклад 6.4.4

declaration uses 'sorry'example : Example_6_4_4.limit_point 1 := Example_6_4_4.limit_point 1 All goals completed! 🐙

Приклад 6.4.4

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

Приклад 6.4.4

declaration uses 'sorry'example : ¬ Example_6_4_4.limit_point 0 := ¬Example_6_4_4.limit_point 0 All goals completed! 🐙

Твердження 6.4.5 / Вправа 6.4.1

theorem declaration uses 'sorry'Sequence.limit_point_of_limit {a:Sequence} {x:} (h: a.tendsTo x) : a.limit_point x := a:Sequencex:h:a.tendsTo xa.limit_point 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! 🐙

Твердження 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 -- цей доказ написан так, щоб співпадати із структурою орігінального тексту. a:Sequencex:ERealh:x > sInf {x | N a.m, x = a.upperseq N} N a.m, n N, (a.seq n) < x 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:ERealaN:ERealha:aN < xN:hN:a.m NhaN:aN = a.upperseq N N a.m, n N, (a.seq n) < x a:Sequencex:ERealaN:ERealha:aN < xN:hN:a.m NhaN:aN = a.upperseq NN a.m n N, (a.seq n) < x a:Sequencex:ERealaN:ERealha:aN < xN:hN:a.m NhaN:aN = a.upperseq N (n : ), N n (a.seq n) < x a:Sequencex:ERealaN:ERealN:hN:a.m NhaN:aN = a.upperseq Nha:(a.from N).sup < x (n : ), N n (a.seq n) < x a:Sequencex:ERealaN:ERealN:hN:a.m NhaN:aN = a.upperseq Nha:(a.from N).sup < xn:hn: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:ERealaN:ERealN:hN:a.m NhaN:aN = a.upperseq Nha:(a.from N).sup < xn:hn:N nhn':n (a.from N).m(a.seq n) = ((a.from N).seq n) All goals completed! 🐙

Твердження 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! 🐙

Твердження 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 -- цей доказ написан так, щоб співпадати із структурою орігінального тексту. a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.m n N, (a.seq n) > x 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 < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.ma.upperseq N {x | N a.m, x = a.upperseq N} a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.m N_1, a.m N_1 a.upperseq N = a.upperseq N_1; All goals completed! 🐙 a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mhx:x < (a.from N).sup n N, (a.seq n) > x a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mhx: n (a.from N).m, x < ((a.from N).seq n) ((a.from N).seq n) (a.from N).sup n N, (a.seq n) > x a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mn:hn:n (a.from N).mhxn:x < ((a.from N).seq n)right✝:((a.from N).seq n) (a.from N).sup n N, (a.seq n) > x a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mn:hxn:x < ((a.from N).seq n)right✝:((a.from N).seq n) (a.from N).suphn:N n n N, (a.seq n) > x a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mn:hxn:x < ((a.from N).seq n)right✝:((a.from N).seq n) (a.from N).suphn:N n(a.seq n) > x a:Sequencex:ERealh:x < sInf {x | N a.m, x = a.upperseq N}N:hN:N a.mn:hxn:x < ((a.from N).seq n)right✝:((a.from N).seq n) (a.from N).suphn:N n(a.seq n) = ((a.from N).seq n) All goals completed! 🐙

Твердження 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! 🐙

Твердження 6.4.12(c) / Вправа 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! 🐙

Твердження 6.4.12(c) / Вправа 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! 🐙

Твердження 6.4.12(c) / Вправа 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! 🐙

Твердження 6.4.12(d) / Вправа 6.4.3

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

Твердження 6.4.12(e) / Вправа 6.4.3

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

Твердження 6.4.12(e) / Вправа 6.4.3

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

Твердження 6.4.12(f) / Вправа 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! 🐙

Лема 6.4.13 (Comparison principle) / Вправа 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! 🐙

Лема 6.4.13 (Comparison principle) / Вправа 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! 🐙

Лема 6.4.13 (Comparison principle) / Вправа 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! 🐙

Лема 6.4.13 (Comparison principle) / Вправа 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! 🐙

Наслідок 6.4.14 (Squeeze test) / Вправа 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! 🐙

Приклад 6.4.15

declaration uses 'sorry'example : ((fun (n:) 2/(n+1:)):Sequence).tendsTo 0 := { m := 0, seq := fun n => if n 0 then (fun n => 2 / (n + 1)) n.toNat else 0, vanish := }.tendsTo 0 All goals completed! 🐙

Приклад 6.4.15

declaration uses 'sorry'example : ((fun (n:) -2/(n+1:)):Sequence).tendsTo 0 := { m := 0, seq := fun n => if n 0 then (fun n => -2 / (n + 1)) n.toNat else 0, vanish := }.tendsTo 0 All goals completed! 🐙

Приклад 6.4.15

declaration uses 'sorry'example : ((fun (n:) (-1)^n/(n+1:) + 1 / (n+1)^2):Sequence).tendsTo 0 := { m := 0, seq := fun n => if n 0 then (fun n => (-1) ^ n / (n + 1) + 1 / (n + 1) ^ 2) n.toNat else 0, vanish := }.tendsTo 0 All goals completed! 🐙

Приклад 6.4.15

declaration uses 'sorry'example : ((fun (n:) (2:)^(-(n:))):Sequence).tendsTo 0 := { m := 0, seq := fun n => if n 0 then (fun n => 2 ^ (-n)) n.toNat else 0, vanish := }.tendsTo 0 All goals completed! 🐙
abbrev Sequence.abs (a:Sequence) : Sequence where m := a.m seq := fun n |a n| vanish := a:Sequence n < a.m, |a.seq n| = 0 a:Sequencen:hn:n < a.m|a.seq n| = 0 All goals completed! 🐙

Наслідок 6.4.17 (Zero test for sequences) / Вправа 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 a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| 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: (n : ), |a.seq n| Ma.sup M a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| M n a.m, (a.seq n) M a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mn:hN:n a.m(a.seq n) M a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| 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: (n : ), |a.seq n| Mhlimsup_bound:a.limsup M-M a.inf a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup M n a.m, (a.seq n) -M a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mn:hN:n a.m(a.seq n) -M a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mn:hN:n a.m-M a.seq n a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mn:hN:n a.m-a.seq n M All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminf L_plus, a.limsup = L_plusa:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminf L_minus, a.liminf = L_minus a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminf L_plus, a.limsup = L_plus a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.limsup = a.limsup.toReal a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.limsup a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.limsup a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.limsup a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhliminf_bound:-M a.liminfhlimsup_bound:a.limsup = M < a.limsup All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.limsupa.limsup a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:a.limsup = a.limsup < -M All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.liminf = a.liminf.toReal a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.liminf a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.liminf a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:-M a.liminfa.liminf a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhliminf_bound:-M a.liminfhlimsup_bound:a.liminf Ma.liminf a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhliminf_bound:-M a.liminfhlimsup_bound:a.liminf = M < a.liminf All goals completed! 🐙 a:SequenceM:hMpos:M 0hbound: (n : ), |a.seq n| Mhlimsup_bound:a.limsup Mhliminf_bound:a.liminf = a.liminf < -M All goals completed! 🐙

Теорема 6.4.18 (Completeness of the reals)

theorem Sequence.Cauchy_iff_convergent (a:Sequence) : a.isCauchy a.convergent := a:Sequencea.isCauchy a.convergent -- цей доказ написан так, щоб співпадати із структурою орігінального тексту. 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_minusa.liminf = L_minus a.limsup = 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.limsup0 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ε::ε > 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ε::ε > 0N:hN:N a.mhsteady:ε.steady (a.from N)L_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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) ε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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq N n (a.from N).m, ((a.from N).seq n) (a.seq N - ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nn:hn:n (a.from N).m((a.from N).seq n) (a.seq N - ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nn:hn:n (a.from N).mhsteady:dist ((a.from N).seq n) ((a.from N).seq N) ε((a.from N).seq n) (a.seq N - ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nn:hn:n (a.from N).mhsteady:dist ((a.from N).seq n) ((a.from N).seq N) εa.seq N - ε (a.from N).seq n a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nn:hn:n (a.from N).mhsteady:(a.from N).seq n - a.seq N ε -((a.from N).seq n - a.seq N) εa.seq N - ε (a.from N).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 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).inf(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 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).inf(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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).inf 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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minus n (a.from N).m, ((a.from N).seq n) (a.seq N + ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minusn:hn:n (a.from N).m((a.from N).seq n) (a.seq N + ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minusn:hn:n (a.from N).mhsteady:dist ((a.from N).seq n) ((a.from N).seq N) ε((a.from N).seq n) (a.seq N + ε) a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minusn:hn:n (a.from N).mhsteady:dist ((a.from N).seq n) ((a.from N).seq N) ε(a.from N).seq n a.seq N + ε a:SequenceL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow:0 L_plus - L_minusε::ε > 0N:hN:N a.mhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minusn:hn:n (a.from N).mhsteady:(a.from N).seq n - a.seq N ε -((a.from N).seq n - a.seq N) ε(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 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε)sInf {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 L_plus - L_minusε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε)(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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh1:(a.seq N - ε) (a.from N).infh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε) 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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε)h4:L_plus (a.from N).suph1:(a.seq N - ε) L_minusL_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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε)h1:(a.seq N - ε) L_minush4:L_plus (a.seq N + ε)L_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ε::ε > 0N:hN:N a.mhsteady: n (a.from N).m, m (a.from N).m, dist ((a.from N).seq n) ((a.from N).seq m) εhN0:N (a.from N).mhN1:(a.from N).seq N = a.seq Nh2:(a.from N).inf L_minush3:(a.from N).sup (a.seq N + ε)h1:a.seq N - ε L_minush4:L_plus a.seq N + εL_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_minushup: ε > 0, L_plus - L_minus 2 * ε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_minushup: ε > 0, L_plus - L_minus 2 * ε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_minushup: ε > 0, L_plus - L_minus 2 * εhlow:0 < L_plus - L_minusL_plus = L_minus specialize hup ((L_plus - L_minus)/3) (a:Sequenceh:a.isCauchyL_plus:hL_plus:a.limsup = L_plusL_minus:hL_minus:a.liminf = L_minushlow✝:0 L_plus - L_minushup: ε > 0, L_plus - L_minus 2 * εhlow:0 < L_plus - L_minus(L_plus - L_minus) / 3 > 0 All goals completed! 🐙) All goals completed! 🐙 All goals completed! 🐙

Вправа 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) { m := 0, seq := fun n => if n 0 then a n.toNat else 0, vanish := }.sup { m := 0, seq := fun n => if n 0 then b n.toNat else 0, vanish := }.sup All goals completed! 🐙
/- Вправа 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.extended_limit_point (a:Sequence) (x:EReal) : Prop := if x = then ¬ a.bddAbove else if x = then ¬ a.bddBelow else a.limit_point x.toReal

Вправа 6.4.8

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

Вправа 6.4.8

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

Вправа 6.4.9

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

Вправа 6.4.10

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