Аналіз 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:
-
Some API for Mathlib's extended reals
EReal
, particularly with regard to the supremum operationsSup
and infimum operationsInf
.
Визначення 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 rfl
abbrev EReal.isFinite (x:EReal) : Prop := ∃ (y:Real), y = x
abbrev EReal.isInfinite (x:EReal) : Prop := x = ⊤ ∨ x = ⊥
theorem EReal.infinite_iff_not_finite (x:EReal): x.isInfinite ↔ ¬ x.isFinite := x:EReal⊢ x.isInfinite ↔ ¬x.isFinite
x:EReal⊢ x = ⊤ ∨ x = ⊥ ↔ ¬∃ y, ↑y = x
x:ERealh:∃ y, ↑y = x⊢ x = ⊤ ∨ 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
#check EReal.neg_top
EReal.neg_top : -⊤ = ⊥
#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:EReal⊢ x ≤ y ↔ (∃ x' y', x = ↑x' ∧ y = ↑y' ∧ x' ≤ y') ∨ y = ⊤ ∨ x = ⊥
x:ERealy:ERealhx:∃ y, ↑y = x⊢ x ≤ 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
#check EReal.coe_lt_coe_iff
EReal.coe_lt_coe_iff {x y : ℝ} : ↑x < ↑y ↔ x < y
#check instCompleteLinearOrderEReal
instCompleteLinearOrderEReal : CompleteLinearOrder EReal
Твердження 6.2.5(a) / Вправа 6.2.1
theorem EReal.refl (x:EReal) : x ≤ x := x:EReal⊢ x ≤ x All goals completed! 🐙
Твердження 6.2.5(b) / Вправа 6.2.1
theorem EReal.trichotomy (x y:EReal) : x < y ∨ x = y ∨ x > y := x:ERealy:EReal⊢ x < y ∨ x = y ∨ x > y All goals completed! 🐙
Твердження 6.2.5(b) / Вправа 6.2.1
theorem 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 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 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 EReal.trans {x y z:EReal} (hxy : x ≤ y) (hyz: y ≤ z) : x ≤ z := x:ERealy:ERealz:ERealhxy:x ≤ yhyz:y ≤ z⊢ x ≤ z All goals completed! 🐙
Твердження 6.2.5(d) / Вправа 6.2.1
theorem 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.Nonempty⊢ sSup ((fun x => ↑x) '' E) = sSup ((fun x => ↑x) '' ((fun x => ↑x) '' E))
E:Set ℝhbound:BddAbove Ehnon:E.Nonempty⊢ sSup ((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.Nonempty⊢ sSup ((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.Nonempty⊢ BddAbove ((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.Nonempty⊢ sSup ((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.Nonempty⊢ sSup ((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 ≤ y⊢ BddAbove 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_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 EReal⊢ sInf E = -sSup (-E)
E:Set EReal⊢ ∀ (b : EReal), sSup (-E) ≤ -b ↔ b ∈ lowerBounds E
E:Set ERealb:EReal⊢ sSup (-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 ∈ E⊢ b ≤ 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 ∈ E⊢ a ≤ -b
E:Set ERealb:EReala:ERealha:-a ∈ Eh:b ≤ -a⊢ a ≤ -b
All goals completed! 🐙
example : sSup Example_6_2_7 = -1 := ⊢ sSup Example_6_2_7 = -1
⊢ sSup (Example_6_2_7 \ {⊥}) = -1
All goals completed! 🐙
example : sInf Example_6_2_7 = ⊥ := ⊢ sInf Example_6_2_7 = ⊥
⊢ -sSup (-Example_6_2_7) = ⊥
All goals completed! 🐙
example : sInf Example_6_2_8 = (0.9:ℝ) := ⊢ sInf Example_6_2_8 = ↑0.9 All goals completed! 🐙
example : sSup Example_6_2_8 = 1 := ⊢ sSup Example_6_2_8 = 1 All goals completed! 🐙
example : sInf Example_6_2_9 = 1 := ⊢ sInf Example_6_2_9 = 1 All goals completed! 🐙
example : sSup Example_6_2_9 = ⊤ := ⊢ sSup Example_6_2_9 = ⊤ All goals completed! 🐙
example : sInf (∅ : Set EReal) = ⊤ := ⊢ sInf ∅ = ⊤ All goals completed! 🐙
example (E: Set EReal) : sSup E < sInf E ↔ E = ∅ := E:Set EReal⊢ sSup E < sInf E ↔ E = ∅ All goals completed! 🐙
Теорема 6.2.11 (a) / Вправа 6.2.2
theorem EReal.mem_le_sup (E: Set EReal) {x:EReal} (hx: x ∈ E) : x ≤ sSup E := E:Set ERealx:ERealhx:x ∈ E⊢ x ≤ sSup E All goals completed! 🐙
Теорема 6.2.11 (a) / Вправа 6.2.2
theorem EReal.mem_ge_inf (E: Set EReal) {x:EReal} (hx: x ∈ E) : x ≤ sInf E := E:Set ERealx:ERealhx:x ∈ E⊢ x ≤ sInf E All goals completed! 🐙
Теорема 6.2.11 (b) / Вправа 6.2.2
theorem EReal.sup_le_upper (E: Set EReal) {M:EReal} (hM: M ∈ upperBounds E) : sSup E ≤ M := E:Set ERealM:ERealhM:M ∈ upperBounds E⊢ sSup E ≤ M All goals completed! 🐙
Теорема 6.2.11 (c) / Вправа 6.2.2
theorem EReal.inf_ge_upper (E: Set EReal) {M:EReal} (hM: M ∈ upperBounds E) : sInf E ≥ M := E:Set ERealM:ERealhM:M ∈ upperBounds E⊢ sInf E ≥ M All goals completed! 🐙
#check isLUB_iff_sSup_eq
isLUB_iff_sSup_eq.{u_1} {α : Type u_1} [CompleteSemilatticeSup α] {s : Set α} {a : α} : IsLUB s a ↔ sSup 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 Chapter5.ExtendedReal.coe_inj : Function.Injective toEReal := ⊢ Function.Injective toEReal All goals completed! 🐙
theorem Chapter5.ExtendedReal.coe_surj : Function.Surjective toEReal := ⊢ Function.Surjective toEReal All goals completed! 🐙
noncomputable abbrev Chapter5.ExtendedReal.equivEReal : Chapter5.ExtendedReal ≃ EReal where
toFun := toEReal
invFun := sorry
left_inv x := x:ExtendedReal⊢ sorry x.toEReal = x
All goals completed! 🐙
right_inv x := x:EReal⊢ (sorry x).toEReal = x
All goals completed! 🐙