Аналіз I, Глава 6.2

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:

Визначення 6.2.1

theorem EReal.def (x:EReal) : ( (y:Real), y = x) x = x = := x:EReal(∃ y, y = x) x = x = (x : EReal), (∃ y, y = x) x = x = ((∃ y, y = ) = = ) ((∃ y, y = ) = = ) (r : ), (∃ y, y = r) r = r = All goals completed! 🐙
theorem EReal.real_neq_infty (x:) : (x:EReal) := coe_ne_top _theorem EReal.real_neq_neg_infty (x:) : (x:EReal) := coe_ne_bot _theorem EReal.infty_neq_neg_infty : (:EReal) (:EReal) := add_top_iff_ne_bot.mp rflabbrev EReal.isFinite (x:EReal) : Prop := (y:Real), y = xabbrev EReal.isInfinite (x:EReal) : Prop := x = x = theorem EReal.infinite_iff_not_finite (x:EReal): x.isInfinite ¬ x.isFinite := x:ERealx.isInfinite ¬x.isFinite x:ERealx = x = ¬ y, y = x x:ERealh: y, y = xx = x = ¬ y, y = xx:ERealh:x = x = x = ¬ y, y = xx:ERealh:x = x = x = ¬ y, y = x all_goals All goals completed! 🐙 y:¬y = ¬y = All goals completed! 🐙

Визначення 6.2.2 (Negation of extended reals)

theorem EReal.neg_of_real (x:Real) : -(x:EReal) = (-x:) := rfl
EReal.neg_top : -⊤ = ⊥#check EReal.neg_top
EReal.neg_top : -⊤ = ⊥
EReal.neg_bot : -⊥ = ⊤#check EReal.neg_bot
EReal.neg_bot : -⊥ = ⊤

Визначення 6.2.3 (Ordering of extended reals)

theorem EReal.le_iff (x y:EReal) : x y ( (x' y':Real), x = x' y = y' x' y') y = x = := x:ERealy:ERealx y (∃ x' y', x = x' y = y' x' y') y = x = x:ERealy:ERealhx: y, y = xx y (∃ x' y', x = x' y = y' x' y') y = x = y:EReal y (∃ x' y', = x' y = y' x' y') y = = y:EReal y (∃ x' y', = x' y = y' x' y') y = = all_goals y:ERealhy: y_1, y_1 = y y (∃ x' y', = x' y = y' x' y') y = = (∃ x' y', = x' = y' x' y') = = (∃ x' y', = x' = y' x' y') = = all_goals All goals completed! 🐙 y:ERealhy: y_1, y_1 = yx':x' y (∃ x'_1, x' = x'_1 x, y = x x'_1 x) y = x' = x':y':x' y' (∃ x'_1, x' = x'_1 x, y' = x x'_1 x) y' = x' = All goals completed! 🐙

Визначення 6.2.3 (Ordering of extended reals)

theorem EReal.lt_iff (x y:EReal) : x < y x y x y := lt_iff_le_and_ne
EReal.coe_lt_coe_iff {x y : ℝ} : ↑x < ↑y ↔ x < y#check EReal.coe_lt_coe_iff
EReal.coe_lt_coe_iff {x y : ℝ} : ↑x < ↑y ↔ x < y

Приклади 6.2.4

declaration uses 'sorry'example : (3:EReal) (5:EReal) := 3 5 All goals completed! 🐙

Приклади 6.2.4

declaration uses 'sorry'example : (3:EReal) < := 3 < All goals completed! 🐙

Приклади 6.2.4

declaration uses 'sorry'example : (:EReal) < := < All goals completed! 🐙

Приклади 6.2.4

declaration uses 'sorry'example : ¬ (3:EReal) := ¬3 All goals completed! 🐙
instCompleteLinearOrderEReal : CompleteLinearOrder EReal#check instCompleteLinearOrderEReal
instCompleteLinearOrderEReal : CompleteLinearOrder EReal

Твердження 6.2.5(a) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.refl (x:EReal) : x x := x:ERealx x All goals completed! 🐙

Твердження 6.2.5(b) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.trichotomy (x y:EReal) : x < y x = y x > y := x:ERealy:ERealx < y x = y x > y All goals completed! 🐙

Твердження 6.2.5(b) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.not_lt_and_eq (x y:EReal) : ¬ (x < y x = y) := x:ERealy:EReal¬(x < y x = y) All goals completed! 🐙

Твердження 6.2.5(b) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.not_gt_and_eq (x y:EReal) : ¬ (x > y x = y) := x:ERealy:EReal¬(x > y x = y) All goals completed! 🐙

Твердження 6.2.5(b) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.not_lt_and_gt (x y:EReal) : ¬ (x < y x > y) := x:ERealy:EReal¬(x < y x > y) All goals completed! 🐙

Твердження 6.2.5(c) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.trans {x y z:EReal} (hxy : x y) (hyz: y z) : x z := x:ERealy:ERealz:ERealhxy:x yhyz:y zx z All goals completed! 🐙

Твердження 6.2.5(d) / Вправа 6.2.1

theorem declaration uses 'sorry'EReal.neg_of_lt {x y:EReal} (hxy : x y): -y -x := x:ERealy:ERealhxy:x y-y -x All goals completed! 🐙

Визначення 6.2.6

theorem EReal.sup_of_bounded_nonempty {E: Set } (hbound: BddAbove E) (hnon: E.Nonempty) : sSup ((fun (x:) (x:EReal)) '' E) = sSup E := calc _ = sSup ((fun (x:WithTop ) (x:WithBot (WithTop ))) '' ((fun (x:) (x:WithTop )) '' E)) := E:Set hbound:BddAbove Ehnon:E.NonemptysSup ((fun x => x) '' E) = sSup ((fun x => x) '' ((fun x => x) '' E)) E:Set hbound:BddAbove Ehnon:E.NonemptysSup ((fun x => x) '' E) = sSup (((fun x => x) fun x => x) '' E) All goals completed! 🐙 _ = sSup ((fun (x:) (x:WithTop )) '' E) := E:Set hbound:BddAbove Ehnon:E.NonemptysSup ((fun x => x) '' ((fun x => x) '' E)) = (sSup ((fun x => x) '' E)) E:Set hbound:BddAbove Ehnon:E.Nonempty(sSup ((fun x => x) '' E)) = sSup ((fun x => x) '' ((fun x => x) '' E)) E:Set hbound:BddAbove Ehnon:E.Nonempty((fun x => x) '' E).NonemptyE:Set hbound:BddAbove Ehnon:E.NonemptyBddAbove ((fun x => x) '' E) E:Set hbound:BddAbove Ehnon:E.Nonempty((fun x => x) '' E).Nonempty All goals completed! 🐙 All goals completed! 🐙 _ = ((sSup E : ) : WithTop ) := E:Set hbound:BddAbove Ehnon:E.Nonempty(sSup ((fun x => x) '' E)) = (sSup E) E:Set hbound:BddAbove Ehnon:E.NonemptysSup ((fun x => x) '' E) = (sSup E); E:Set hbound:BddAbove Ehnon:E.Nonempty(sSup E) = sSup ((fun x => x) '' E) All goals completed! 🐙 _ = _ := E:Set hbound:BddAbove Ehnon:E.Nonempty(sSup E) = (sSup E) All goals completed! 🐙

Визначення 6.2.6

theorem EReal.sup_of_unbounded_nonempty {E: Set } (hunbound: ¬ BddAbove E) (hnon: E.Nonempty) : sSup ((fun (x:) (x:EReal)) '' E) = := E:Set hunbound:¬BddAbove Ehnon:E.NonemptysSup ((fun x => x) '' E) = E:Set hunbound:¬BddAbove Ehnon:E.Nonempty b < , a (fun x => x) '' E, b < a E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyb:ERealhb:b < a (fun x => x) '' E, b < a E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyb:ERealhb:b < hb': y, y = b a (fun x => x) '' E, b < aE:Set hunbound:¬BddAbove Ehnon:E.Nonemptyhb: < a (fun x => x) '' E, < aE:Set hunbound:¬BddAbove Ehnon:E.Nonemptyhb: < a (fun x => x) '' E, < a E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyb:ERealhb:b < hb': y, y = b a (fun x => x) '' E, b < a E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyy:hb:y < a (fun x => x) '' E, y < a E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyy:hb:y < a E, y < a E:Set hnon:E.Nonemptyy:hb:y < hunbound: a E, a yBddAbove E All goals completed! 🐙 E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyhb: < a (fun x => x) '' E, < a All goals completed! 🐙 E:Set hunbound:¬BddAbove Ehnon:E.Nonemptyhb: < a, a E All goals completed! 🐙

Визначення 6.2.6

theorem EReal.sup_of_empty : sSup (:Set EReal) = := sSup_empty

Визначення 6.2.6

theorem EReal.sup_of_infty_mem {E: Set EReal} (hE: E) : sSup E = := csSup_eq_top_of_top_mem hE

Визначення 6.2.6

theorem EReal.sup_of_neg_infty_mem {E: Set EReal} : sSup E = sSup (E \ {}) := (sSup_diff_singleton_bot _).symm
theorem EReal.inf_eq_neg_sup (E: Set EReal) : sInf E = - sSup (-E) := E:Set ERealsInf E = -sSup (-E) E:Set EReal (b : EReal), sSup (-E) -b b lowerBounds E E:Set ERealb:ERealsSup (-E) -b b lowerBounds E E:Set ERealb:EReal(∀ (b_1 : EReal), -b_1 E b_1 -b) a : EReal⦄, a E b a E:Set ERealb:EReal(∀ (b_1 : EReal), -b_1 E b_1 -b) a : EReal⦄, a E b aE:Set ERealb:EReal(∀ a : EReal⦄, a E b a) (b_1 : EReal), -b_1 E b_1 -b E:Set ERealb:EReal(∀ (b_1 : EReal), -b_1 E b_1 -b) a : EReal⦄, a E b a E:Set ERealb:ERealh: (b_1 : EReal), -b_1 E b_1 -ba:ERealha:a Eb a specialize h (-a) (E:Set ERealb:ERealh: (b_1 : EReal), -b_1 E b_1 -ba:ERealha:a E- -a E All goals completed! 🐙) All goals completed! 🐙 E:Set ERealb:ERealh: a : EReal⦄, a E b aa:ERealha:-a Ea -b E:Set ERealb:EReala:ERealha:-a Eh:b -aa -b All goals completed! 🐙

Приклад 6.2.7

abbrev Example_6_2_7 : Set EReal := { x | n:, x = -((n+1):EReal)} {}
declaration uses 'sorry'example : sSup Example_6_2_7 = -1 := sSup Example_6_2_7 = -1 sSup (Example_6_2_7 \ {}) = -1 All goals completed! 🐙declaration uses 'sorry'example : sInf Example_6_2_7 = := sInf Example_6_2_7 = -sSup (-Example_6_2_7) = All goals completed! 🐙

Приклад 6.2.8

abbrev Example_6_2_8 : Set EReal := { x | n:, x = (1 - (10:)^(-(n:)-1):Real)}
declaration uses 'sorry'example : sInf Example_6_2_8 = (0.9:) := sInf Example_6_2_8 = 0.9 All goals completed! 🐙declaration uses 'sorry'example : sSup Example_6_2_8 = 1 := sSup Example_6_2_8 = 1 All goals completed! 🐙

Приклад 6.2.9

abbrev Example_6_2_9 : Set EReal := { x | n:, x = n+1}
declaration uses 'sorry'example : sInf Example_6_2_9 = 1 := sInf Example_6_2_9 = 1 All goals completed! 🐙declaration uses 'sorry'example : sSup Example_6_2_9 = := sSup Example_6_2_9 = All goals completed! 🐙declaration uses 'sorry'example : sInf ( : Set EReal) = := sInf = All goals completed! 🐙declaration uses 'sorry'example (E: Set EReal) : sSup E < sInf E E = := E:Set ERealsSup E < sInf E E = All goals completed! 🐙

Теорема 6.2.11 (a) / Вправа 6.2.2

theorem declaration uses 'sorry'EReal.mem_le_sup (E: Set EReal) {x:EReal} (hx: x E) : x sSup E := E:Set ERealx:ERealhx:x Ex sSup E All goals completed! 🐙

Теорема 6.2.11 (a) / Вправа 6.2.2

theorem declaration uses 'sorry'EReal.mem_ge_inf (E: Set EReal) {x:EReal} (hx: x E) : x sInf E := E:Set ERealx:ERealhx:x Ex sInf E All goals completed! 🐙

Теорема 6.2.11 (b) / Вправа 6.2.2

theorem declaration uses 'sorry'EReal.sup_le_upper (E: Set EReal) {M:EReal} (hM: M upperBounds E) : sSup E M := E:Set ERealM:ERealhM:M upperBounds EsSup E M All goals completed! 🐙

Теорема 6.2.11 (c) / Вправа 6.2.2

theorem declaration uses 'sorry'EReal.inf_ge_upper (E: Set EReal) {M:EReal} (hM: M upperBounds E) : sInf E M := E:Set ERealM:ERealhM:M upperBounds EsInf E M All goals completed! 🐙
isLUB_iff_sSup_eq.{u_1} {α : Type u_1} [CompleteSemilatticeSup α] {s : Set α} {a : α} : IsLUB s a ↔ sSup s = a#check isLUB_iff_sSup_eq
isLUB_iff_sSup_eq.{u_1} {α : Type u_1} [CompleteSemilatticeSup α] {s : Set α} {a : α} : IsLUB s a ↔ sSup s = a
isGLB_iff_sInf_eq.{u_1} {α : Type u_1} [CompleteSemilatticeInf α] {s : Set α} {a : α} : IsGLB s a ↔ sInf s = a#check isGLB_iff_sInf_eq
isGLB_iff_sInf_eq.{u_1} {α : Type u_1} [CompleteSemilatticeInf α] {s : Set α} {a : α} : IsGLB s a ↔ sInf s = a

Not in textbook: identify the Chapter 5 extended reals with the Mathlib extended reals.

noncomputable abbrev Chapter5.ExtendedReal.toEReal (x:Chapter5.ExtendedReal) : EReal := match x with | real r => ((Chapter5.Real.equivR r):EReal) | infty => | neg_infty =>
theorem declaration uses 'sorry'Chapter5.ExtendedReal.coe_inj : Function.Injective toEReal := Function.Injective toEReal All goals completed! 🐙theorem declaration uses 'sorry'Chapter5.ExtendedReal.coe_surj : Function.Surjective toEReal := Function.Surjective toEReal All goals completed! 🐙noncomputable abbrev declaration uses 'sorry'declaration uses 'sorry'declaration uses 'sorry'Chapter5.ExtendedReal.equivEReal : Chapter5.ExtendedReal EReal where toFun := toEReal invFun := sorry left_inv x := x:ExtendedRealsorry x.toEReal = x All goals completed! 🐙 right_inv x := x:EReal(sorry x).toEReal = x All goals completed! 🐙