Analysis I, Section 9.1: Subsets of the real line
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:
-
Review of Mathlib intervals.
-
Adherent points, limit points, isolated points.
-
Closed sets and closure.
-
The Heine-Borel theorem for the real line.
variable (I : Type*)Example 9.1.4
example {a b: EReal} (h: a > b) : Set.Icc a b = ∅ := I:Type u_1a:ERealb:ERealh:a > b⊢ Set.Icc a b = ∅
All goals completed! 🐙example {a b: EReal} (h: a ≥ b) : Set.Ico a b = ∅ := I:Type u_1a:ERealb:ERealh:a ≥ b⊢ Set.Ico a b = ∅
All goals completed! 🐙example {a b: EReal} (h: a ≥ b) : Set.Ioc a b = ∅ := I:Type u_1a:ERealb:ERealh:a ≥ b⊢ Set.Ioc a b = ∅
All goals completed! 🐙example {a b: EReal} (h: a ≥ b) : Set.Ioo a b = ∅ := I:Type u_1a:ERealb:ERealh:a ≥ b⊢ Set.Ioo a b = ∅
All goals completed! 🐙example {a b: EReal} (h: a = b) : Set.Icc a a = {a} := I:Type u_1a:ERealb:ERealh:a = b⊢ Set.Icc a a = {a}
All goals completed! 🐙
Definition 9.1.5. Note that a slightly different Real.adherent was defined in Chapter 6.4
abbrev Real.adherent' (ε:ℝ) (x:ℝ) (X: Set ℝ) := ∃ y ∈ X, |x - y| ≤ εExample 9.1.7
example : (0.5:ℝ).adherent' 1.1 (.Ioo 0 1) := I:Type u_1⊢ Real.adherent' 0.5 1.1 (Set.Ioo 0 1) All goals completed! 🐙example : ¬ (0.1:ℝ).adherent' 1.1 (.Ioo 0 1) := I:Type u_1⊢ ¬Real.adherent' 0.1 1.1 (Set.Ioo 0 1) All goals completed! 🐙example : (0.5:ℝ).adherent' 1.1 {1,2,3} := I:Type u_1⊢ Real.adherent' 0.5 1.1 {1, 2, 3} All goals completed! 🐙namespace Chapter9
example : AdherentPt 1 (.Ioo 0 1) := I:Type u_1⊢ AdherentPt 1 (Set.Ioo 0 1) All goals completed! 🐙example : ¬ AdherentPt 2 (.Ioo 0 1) := I:Type u_1⊢ ¬AdherentPt 2 (Set.Ioo 0 1) All goals completed! 🐙Definition 9.1.10 (Closure). Here we identify this definition with the Mathilb version.
theorem closure_def (X:Set ℝ) : closure X = { x | AdherentPt x X } := X:Set ℝ⊢ closure X = {x | AdherentPt x X}
X:Set ℝx✝:ℝ⊢ x✝ ∈ closure X ↔ x✝ ∈ {x | AdherentPt x X}; X:Set ℝx✝:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |y - x✝| < ε) ↔ ∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ ε
X:Set ℝx✝:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |y - x✝| < ε) → ∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εX:Set ℝx✝:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ ε) → ∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |y - x✝| < ε X:Set ℝx✝:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |y - x✝| < ε) → ∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εX:Set ℝx✝:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ ε) → ∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |y - x✝| < ε X:Set ℝx✝:ℝh:∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εε:ℝhε:0 < ε⊢ ∃ y ∈ X, |y - x✝| < ε
all_goals X:Set ℝx✝:ℝh:∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εε:ℝhε:0 < εy:ℝhy:y ∈ Xhxy:|x✝ - y| ≤ ε / 2⊢ ∃ y ∈ X, |y - x✝| < ε; exact ⟨ _, hy, X:Set ℝx✝:ℝh:∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εε:ℝhε:0 < εy:ℝhy:y ∈ Xhxy:|x✝ - y| ≤ ε / 2⊢ |y - x✝| < ε X:Set ℝx✝:ℝh:∀ (ε : ℝ), 0 < ε → ∃ y ∈ X, |x✝ - y| ≤ εε:ℝhε:0 < εy:ℝhy:y ∈ Xhxy:|x✝ - y| ≤ ε / 2⊢ |x✝ - y| < ε; All goals completed! 🐙 ⟩theorem closure_def' (X:Set ℝ) (x :ℝ) : x ∈ closure X ↔ AdherentPt x X := X:Set ℝx:ℝ⊢ x ∈ closure X ↔ AdherentPt x X
All goals completed! 🐙
identification of AdherentPt with Mathlib's ClusterPt
theorem AdherentPt_def (x:ℝ) (X:Set ℝ) : AdherentPt x X = ClusterPt x (.principal X) := x:ℝX:Set ℝ⊢ AdherentPt x X = ClusterPt x (Filter.principal X)
All goals completed! 🐙Lemma 9.1.11 / Exercise 9.1.2
theorem subset_closure (X:Set ℝ): X ⊆ closure X := X:Set ℝ⊢ X ⊆ closure X All goals completed! 🐙Lemma 9.1.11 / Exercise 9.1.2
theorem closure_union (X Y:Set ℝ): closure (X ∪ Y) = closure X ∪ closure Y := X:Set ℝY:Set ℝ⊢ closure (X ∪ Y) = closure X ∪ closure Y All goals completed! 🐙Lemma 9.1.11 / Exercise 9.1.2
theorem closure_inter (X Y:Set ℝ): closure (X ∩ Y) ⊆ closure X ∩ closure Y := X:Set ℝY:Set ℝ⊢ closure (X ∩ Y) ⊆ closure X ∩ closure Y All goals completed! 🐙Lemma 9.1.11 / Exercise 9.1.2
theorem closure_subset {X Y:Set ℝ} (h: X ⊆ Y): closure X ⊆ closure Y := X:Set ℝY:Set ℝh:X ⊆ Y⊢ closure X ⊆ closure Y All goals completed! 🐙Exercise 9.1.1
theorem closure_of_subset_closure {X Y:Set ℝ} (h: X ⊆ Y) (h' : Y ⊆ closure X): closure Y = closure X := X:Set ℝY:Set ℝh:X ⊆ Yh':Y ⊆ closure X⊢ closure Y = closure X All goals completed! 🐙Lemma 9.1.12
theorem closure_of_Ioo {a b:ℝ} (h:a < b) : closure (.Ioo a b) = .Icc a b := a:ℝb:ℝh:a < b⊢ closure (Set.Ioo a b) = Set.Icc a b
-- This proof is written to follow the structure of the original text.
a:ℝb:ℝh:a < bx:ℝ⊢ x ∈ closure (Set.Ioo a b) ↔ x ∈ Set.Icc a b; a:ℝb:ℝh:a < bx:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε) ↔ a ≤ x ∧ x ≤ b
a:ℝb:ℝh:a < bx:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε) → a ≤ x ∧ x ≤ ba:ℝb:ℝh:a < bx:ℝ⊢ a ≤ x ∧ x ≤ b → ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε
a:ℝb:ℝh:a < bx:ℝ⊢ (∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε) → a ≤ x ∧ x ≤ b a:ℝb:ℝh✝:a < bx:ℝh:∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε⊢ a ≤ x ∧ x ≤ b; a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < x⊢ ∃ ε, 0 < ε ∧ ∀ (y : ℝ), a < y ∧ y < b → ε < |x - y|
a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':a ≤ x⊢ ∃ ε, 0 < ε ∧ ∀ (y : ℝ), a < y ∧ y < b → ε < |x - y|a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':x < a⊢ ∃ ε, 0 < ε ∧ ∀ (y : ℝ), a < y ∧ y < b → ε < |x - y|
a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':a ≤ x⊢ ∃ ε, 0 < ε ∧ ∀ (y : ℝ), a < y ∧ y < b → ε < |x - y| a:ℝb:ℝh✝:a < bx:ℝh':a ≤ xh:b < x⊢ ∃ ε, 0 < ε ∧ ∀ (y : ℝ), a < y ∧ y < b → ε < |x - y|
use x-b, a:ℝb:ℝh✝:a < bx:ℝh':a ≤ xh:b < x⊢ 0 < x - b All goals completed! 🐙
a:ℝb:ℝh✝:a < bx:ℝh':a ≤ xh:b < xy:ℝleft✝:a < yright✝:y < b⊢ x - b < |x - y|; a:ℝb:ℝh✝:a < bx:ℝh':a ≤ xh:b < xy:ℝleft✝:a < yright✝:y < bthis:x - y ≤ |x - y|⊢ x - b < |x - y|; All goals completed! 🐙
use a-x, a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':x < a⊢ 0 < a - x All goals completed! 🐙
a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':x < ay:ℝleft✝:a < yright✝:y < b⊢ a - x < |x - y|; a:ℝb:ℝh✝:a < bx:ℝh:a ≤ x → b < xh':x < ay:ℝleft✝:a < yright✝:y < bthis:-(x - y) ≤ |x - y|⊢ a - x < |x - y|; All goals completed! 🐙
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ b⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:x = a⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ εa:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = a⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:x = a⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε All goals completed! 🐙
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:x = b⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ εa:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:¬x = b⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:x = b⊢ ∀ (ε : ℝ), 0 < ε → ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε All goals completed! 🐙
a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:¬x = bε:ℝa✝:0 < ε⊢ ∃ y, (a < y ∧ y < b) ∧ |x - y| ≤ ε; use x, (a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:¬x = bε:ℝa✝:0 < ε⊢ a < x ∧ x < b All goals completed! 🐙); a:ℝb:ℝh:a < bx:ℝh1:a ≤ xh2:x ≤ bha:¬x = ahb:¬x = bε:ℝa✝:0 < ε⊢ 0 ≤ ε; All goals completed! 🐙theorem closure_of_Ioc {a b:ℝ} (h:a < b) : closure (.Ioc a b) = .Icc a b := a:ℝb:ℝh:a < b⊢ closure (Set.Ioc a b) = Set.Icc a b
All goals completed! 🐙theorem closure_of_Ico {a b:ℝ} (h:a < b) : closure (.Ico a b) = .Icc a b := a:ℝb:ℝh:a < b⊢ closure (Set.Ico a b) = Set.Icc a b
All goals completed! 🐙theorem closure_of_Icc {a b:ℝ} (h:a ≤ b) : closure (.Icc a b) = .Icc a b := a:ℝb:ℝh:a ≤ b⊢ closure (Set.Icc a b) = Set.Icc a b
All goals completed! 🐙theorem closure_of_Ioi {a:ℝ} : closure (.Ioi a) = .Ici a := a:ℝ⊢ closure (Set.Ioi a) = Set.Ici a
All goals completed! 🐙theorem closure_of_Ici {a:ℝ} : closure (.Ici a) = .Ici a := a:ℝ⊢ closure (Set.Ici a) = Set.Ici a
All goals completed! 🐙theorem closure_of_Iio {a:ℝ} : closure (.Iio a) = .Iic a := a:ℝ⊢ closure (Set.Iio a) = Set.Iic a
All goals completed! 🐙theorem closure_of_Iic {a:ℝ} : closure (.Iic a) = .Iic a := a:ℝ⊢ closure (Set.Iic a) = Set.Iic a
All goals completed! 🐙theorem closure_of_R : closure (.univ: Set ℝ) = .univ := ⊢ closure Set.univ = Set.univ All goals completed! 🐙Lemma 9.1.13 / Exercise 9.1.3
theorem closure_of_N :
closure ((fun n:ℕ ↦ (n:ℝ)) '' .univ) = ((fun n:ℕ ↦ (n:ℝ)) '' .univ) := ⊢ closure ((fun n => ↑n) '' Set.univ) = (fun n => ↑n) '' Set.univ
All goals completed! 🐙Lemma 9.1.13 / Exercise 9.1.3
theorem closure_of_Z :
closure ((fun n:ℤ ↦ (n:ℝ)) '' .univ) = ((fun n:ℤ ↦ (n:ℝ)) '' .univ) := ⊢ closure ((fun n => ↑n) '' Set.univ) = (fun n => ↑n) '' Set.univ
All goals completed! 🐙Lemma 9.1.13 / Exercise 9.1.3
theorem closure_of_Q :
closure ((fun n:ℚ ↦ (n:ℝ)) '' .univ) = .univ := ⊢ closure ((fun n => ↑n) '' Set.univ) = Set.univ
All goals completed! 🐙Lemma 9.1.14 / Exercise 9.1.5
theorem limit_of_AdherentPt (X: Set ℝ) (x:ℝ) :
AdherentPt x X ↔ ∃ a : ℕ → ℝ, (∀ n, a n ∈ X) ∧ Filter.atTop.Tendsto a (nhds x) := X:Set ℝx:ℝ⊢ AdherentPt x X ↔ ∃ a, (∀ (n : ℕ), a n ∈ X) ∧ Filter.Tendsto a Filter.atTop (nhds x)
All goals completed! 🐙theorem AdherentPt.of_mem {X: Set ℝ} {x: ℝ} (h: x ∈ X) : AdherentPt x X := X:Set ℝx:ℝh:x ∈ X⊢ AdherentPt x X
X:Set ℝx:ℝh:x ∈ X⊢ ∃ a, (∀ (n : ℕ), a n ∈ X) ∧ Filter.Tendsto a Filter.atTop (nhds x); X:Set ℝx:ℝh:x ∈ X⊢ (∀ (n : ℕ), (fun x_1 => x) n ∈ X) ∧ Filter.Tendsto (fun x_1 => x) Filter.atTop (nhds x); All goals completed! 🐙Definition 9.1.15. Here we use the Mathlib definition.
theorem isClosed_def (X:Set ℝ): IsClosed X ↔ closure X = X :=
closure_eq_iff_isClosed.symmtheorem isClosed_def' (X:Set ℝ): IsClosed X ↔ ∀ x, AdherentPt x X → x ∈ X := X:Set ℝ⊢ IsClosed X ↔ ∀ (x : ℝ), AdherentPt x X → x ∈ X
X:Set ℝ⊢ closure X ⊆ X ↔ ∀ (x : ℝ), AdherentPt x X → x ∈ X; X:Set ℝ⊢ {x | AdherentPt x X} ⊆ X ↔ ∀ (x : ℝ), AdherentPt x X → x ∈ X; All goals completed! 🐙Examples 9.1.16
theorem Icc_closed {a b:ℝ} : IsClosed (.Icc a b) := a:ℝb:ℝ⊢ IsClosed (Set.Icc a b) All goals completed! 🐙Examples 9.1.16
theorem Ici_closed (a:ℝ) : IsClosed (.Ici a) := a:ℝ⊢ IsClosed (Set.Ici a) All goals completed! 🐙Examples 9.1.16
theorem Iic_closed (a:ℝ) : IsClosed (.Iic a) := a:ℝ⊢ IsClosed (Set.Iic a) All goals completed! 🐙Examples 9.1.16
theorem R_closed : IsClosed (.univ : Set ℝ) := ⊢ IsClosed Set.univ All goals completed! 🐙Examples 9.1.16
theorem Ico_not_closed {a b:ℝ} (h: a < b) : ¬ IsClosed (.Ico a b) := a:ℝb:ℝh:a < b⊢ ¬IsClosed (Set.Ico a b) All goals completed! 🐙Examples 9.1.16
theorem Ioc_not_closed {a b:ℝ} (h: a < b) : ¬ IsClosed (.Ioc a b) := a:ℝb:ℝh:a < b⊢ ¬IsClosed (Set.Ioc a b) All goals completed! 🐙Examples 9.1.16
theorem Ioo_not_closed {a b:ℝ} (h: a < b) : ¬ IsClosed (.Ioo a b) := a:ℝb:ℝh:a < b⊢ ¬IsClosed (Set.Ioo a b) All goals completed! 🐙Examples 9.1.16
theorem Ioi_not_closed (a:ℝ) : ¬ IsClosed (.Ioi a) := a:ℝ⊢ ¬IsClosed (Set.Ioi a) All goals completed! 🐙Examples 9.1.16
theorem Iio_not_closed (a:ℝ) : ¬ IsClosed (.Iio a) := a:ℝ⊢ ¬IsClosed (Set.Iio a) All goals completed! 🐙Examples 9.1.16
theorem N_closed : IsClosed ((fun n:ℕ ↦ (n:ℝ)) '' .univ) := ⊢ IsClosed ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Examples 9.1.16
theorem Z_closed : IsClosed ((fun n:ℤ ↦ (n:ℝ)) '' .univ) := ⊢ IsClosed ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Examples 9.1.16
theorem Q_not_closed : ¬ IsClosed ((fun n:ℚ ↦ (n:ℝ)) '' .univ) := ⊢ ¬IsClosed ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Corollary 9.1.17
theorem isClosed_iff_limits_mem (X: Set ℝ) :
IsClosed X ↔ ∀ (a:ℕ → ℝ) (L:ℝ), (∀ n, a n ∈ X) → Filter.atTop.Tendsto a (nhds L) → L ∈ X := X:Set ℝ⊢ IsClosed X ↔ ∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ X
X:Set ℝ⊢ (∀ (x : ℝ), AdherentPt x X → x ∈ X) ↔
∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ X
X:Set ℝ⊢ (∀ (x : ℝ), AdherentPt x X → x ∈ X) →
∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ XX:Set ℝ⊢ (∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ X) →
∀ (x : ℝ), AdherentPt x X → x ∈ X
X:Set ℝ⊢ (∀ (x : ℝ), AdherentPt x X → x ∈ X) →
∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ X X:Set ℝh:∀ (x : ℝ), AdherentPt x X → x ∈ Xa✝²:ℕ → ℝL:ℝa✝¹:∀ (n : ℕ), a✝² n ∈ Xa✝:Filter.Tendsto a✝² Filter.atTop (nhds L)⊢ L ∈ X; X:Set ℝh:∀ (x : ℝ), AdherentPt x X → x ∈ Xa✝²:ℕ → ℝL:ℝa✝¹:∀ (n : ℕ), a✝² n ∈ Xa✝:Filter.Tendsto a✝² Filter.atTop (nhds L)⊢ AdherentPt L X; X:Set ℝh:∀ (x : ℝ), AdherentPt x X → x ∈ Xa✝²:ℕ → ℝL:ℝa✝¹:∀ (n : ℕ), a✝² n ∈ Xa✝:Filter.Tendsto a✝² Filter.atTop (nhds L)⊢ ∃ a, (∀ (n : ℕ), a n ∈ X) ∧ Filter.Tendsto a Filter.atTop (nhds L); All goals completed! 🐙
X:Set ℝa✝:∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ Xx✝:ℝhx:AdherentPt x✝ X⊢ x✝ ∈ X; X:Set ℝa✝:∀ (a : ℕ → ℝ) (L : ℝ), (∀ (n : ℕ), a n ∈ X) → Filter.Tendsto a Filter.atTop (nhds L) → L ∈ Xx✝:ℝhx:∃ a, (∀ (n : ℕ), a n ∈ X) ∧ Filter.Tendsto a Filter.atTop (nhds x✝)⊢ x✝ ∈ X; All goals completed! 🐙
Identification with Mathlib's AccPt
theorem LimitPt.iff_AccPt (x:ℝ) (X: Set ℝ) : LimitPt x X ↔ AccPt x (.principal X) := x:ℝX:Set ℝ⊢ LimitPt x X ↔ AccPt x (Filter.principal X)
All goals completed! 🐙Definition 9.1.18 (Isolated points)
abbrev IsolatedPt (x:ℝ) (X: Set ℝ) := x ∈ X ∧ ∃ ε>0, ∀ y ∈ X \ {x}, |x-y| > εExample 9.1.19
example : AdherentPt 3 ((.Ioo 1 2) ∪ {3}) := I:Type u_1⊢ AdherentPt 3 (Set.Ioo 1 2 ∪ {3}) All goals completed! 🐙example : ¬ LimitPt 3 ((.Ioo 1 2) ∪ {3}) := I:Type u_1⊢ ¬LimitPt 3 (Set.Ioo 1 2 ∪ {3}) All goals completed! 🐙example : IsolatedPt 3 ((.Ioo 1 2) ∪ {3}) := I:Type u_1⊢ IsolatedPt 3 (Set.Ioo 1 2 ∪ {3}) All goals completed! 🐙Remark 9.1.20
theorem LimitPt.iff_limit (x:ℝ) (X: Set ℝ) :
LimitPt x X ↔ ∃ a : ℕ → ℝ, (∀ n, a n ∈ X \ {x}) ∧ Filter.atTop.Tendsto a (nhds x) := x:ℝX:Set ℝ⊢ LimitPt x X ↔ ∃ a, (∀ (n : ℕ), a n ∈ X \ {x}) ∧ Filter.Tendsto a Filter.atTop (nhds x)
All goals completed! 🐙Lemma 9.1.21
theorem mem_Icc_isLimit {a b x:ℝ} (h: a < b) (hx: x ∈ Set.Icc a b) : LimitPt x (.Icc a b) := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b)
-- This proof is written to follow the structure of the original text, with some slight simplifications.
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ b⊢ LimitPt x (Set.Icc a b)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ b⊢ ∃ a_1, (∀ (n : ℕ), a_1 n ∈ Set.Icc a b \ {x}) ∧ Filter.Tendsto a_1 Filter.atTop (nhds x)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ ∃ a_1, (∀ (n : ℕ), a_1 n ∈ Set.Icc a b \ {x}) ∧ Filter.Tendsto a_1 Filter.atTop (nhds x)a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x = b⊢ ∃ a_1, (∀ (n : ℕ), a_1 n ∈ Set.Icc a b \ {x}) ∧ Filter.Tendsto a_1 Filter.atTop (nhds x)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ ∃ a_1, (∀ (n : ℕ), a_1 n ∈ Set.Icc a b \ {x}) ∧ Filter.Tendsto a_1 Filter.atTop (nhds x) a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ (∀ (n : ℕ), (fun n => x + 1 / (↑n + (b - x)⁻¹)) n ∈ Set.Icc a b \ {x}) ∧
Filter.Tendsto (fun n => x + 1 / (↑n + (b - x)⁻¹)) Filter.atTop (nhds x)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ ∀ (n : ℕ), x + 1 / (↑n + (b - x)⁻¹) ∈ Set.Icc a b \ {x}a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ Filter.Tendsto (fun n => x + 1 / (↑n + (b - x)⁻¹)) Filter.atTop (nhds x)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ ∀ (n : ℕ), x + 1 / (↑n + (b - x)⁻¹) ∈ Set.Icc a b \ {x} a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕ⊢ x + 1 / (↑n + (b - x)⁻¹) ∈ Set.Icc a b \ {x}; a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕ⊢ (a ≤ x + (↑n + (b - x)⁻¹)⁻¹ ∧ x + (↑n + (b - x)⁻¹)⁻¹ ≤ b) ∧ ¬↑n + (b - x)⁻¹ = 0
have : b - x > 0 := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) All goals completed! 🐙
have : (b - x)⁻¹ > 0 := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) All goals completed! 🐙
have : n + (b - x)⁻¹ > 0 := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) All goals completed! 🐙
have : (n+(b - x)⁻¹)⁻¹ > 0 := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) All goals completed! 🐙
have : (b-x)⁻¹ ≤ n + (b - x)⁻¹ := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) All goals completed! 🐙
have : (n + (b - x)⁻¹)⁻¹ ≤ b-x := a:ℝb:ℝx:ℝh:a < bhx:x ∈ Set.Icc a b⊢ LimitPt x (Set.Icc a b) rwa [inv_le_comm₀ ?_ ?_a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕthis✝³:_fvar.134614 - _fvar.134615 > 0 := ?_mvar.143048this✝²:(_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.143475this✝¹:↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.145783this✝:(↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹)⁻¹ > 0 := ?_mvar.148122this:(_fvar.134614 - _fvar.134615)⁻¹ ≤ ↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ := ?_mvar.152351⊢ (b - x)⁻¹ ≤ ↑n + (b - x)⁻¹a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕthis✝³:_fvar.134614 - _fvar.134615 > 0 := ?_mvar.143048this✝²:(_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.143475this✝¹:↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.145783this✝:(↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹)⁻¹ > 0 := ?_mvar.148122this:(_fvar.134614 - _fvar.134615)⁻¹ ≤ ↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ := ?_mvar.152351⊢ 0 < ↑n + (b - x)⁻¹a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕthis✝³:_fvar.134614 - _fvar.134615 > 0 := ?_mvar.143048this✝²:(_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.143475this✝¹:↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.145783this✝:(↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹)⁻¹ > 0 := ?_mvar.148122this:(_fvar.134614 - _fvar.134615)⁻¹ ≤ ↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ := ?_mvar.152351⊢ 0 < b - x a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕthis✝³:_fvar.134614 - _fvar.134615 > 0 := ?_mvar.143048this✝²:(_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.143475this✝¹:↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.145783this✝:(↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹)⁻¹ > 0 := ?_mvar.148122this:(_fvar.134614 - _fvar.134615)⁻¹ ≤ ↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ := ?_mvar.152351⊢ 0 < ↑n + (b - x)⁻¹a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < bn:ℕthis✝³:_fvar.134614 - _fvar.134615 > 0 := ?_mvar.143048this✝²:(_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.143475this✝¹:↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ > 0 := ?_mvar.145783this✝:(↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹)⁻¹ > 0 := ?_mvar.148122this:(_fvar.134614 - _fvar.134615)⁻¹ ≤ ↑_fvar.137254 + (_fvar.134614 - _fvar.134615)⁻¹ := ?_mvar.152351⊢ 0 < b - x All goals completed! 🐙
All goals completed! 🐙
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ x = x + 0a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ Filter.Tendsto (fun k => 1 / (↑k + (b - x)⁻¹)) Filter.atTop (nhds 0); a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ Filter.Tendsto (fun k => 1 / (↑k + (b - x)⁻¹)) Filter.atTop (nhds 0)
a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ Filter.Tendsto (fun k => 1 / (k + (b - x)⁻¹)) Filter.atTop (nhds 0)
convert tendsto_mul_add_inv_atTop_nhds_zero 1 (b - x)⁻¹ (a:ℝb:ℝx:ℝh:a < bhx:a ≤ x ∧ x ≤ bhxb:x < b⊢ 1 ≠ 0 All goals completed! 🐙) using 2 with n; All goals completed! 🐙
All goals completed! 🐙theorem mem_Ico_isLimit {a b x:ℝ} (hx: x ∈ Set.Ico a b) : LimitPt x (.Ico a b) := a:ℝb:ℝx:ℝhx:x ∈ Set.Ico a b⊢ LimitPt x (Set.Ico a b)
All goals completed! 🐙theorem mem_Ioc_isLimit {a b x:ℝ} (hx: x ∈ Set.Ioc a b) : LimitPt x (.Ioc a b) := a:ℝb:ℝx:ℝhx:x ∈ Set.Ioc a b⊢ LimitPt x (Set.Ioc a b)
All goals completed! 🐙theorem mem_Ioo_isLimit {a b x:ℝ} (hx: x ∈ Set.Ioo a b) : LimitPt x (.Ioo a b) := a:ℝb:ℝx:ℝhx:x ∈ Set.Ioo a b⊢ LimitPt x (Set.Ioo a b)
All goals completed! 🐙theorem mem_Ici_isLimit {a x:ℝ} (hx: x ∈ Set.Ici a) : LimitPt x (.Ici a) := a:ℝx:ℝhx:x ∈ Set.Ici a⊢ LimitPt x (Set.Ici a)
All goals completed! 🐙theorem mem_Ioi_isLimit {a x:ℝ} (hx: x ∈ Set.Ioi a) : LimitPt x (.Ioi a) := a:ℝx:ℝhx:x ∈ Set.Ioi a⊢ LimitPt x (Set.Ioi a)
All goals completed! 🐙theorem mem_Iic_isLimit {a x:ℝ} (hx: x ∈ Set.Iic a) : LimitPt x (.Iic a) := a:ℝx:ℝhx:x ∈ Set.Iic a⊢ LimitPt x (Set.Iic a)
All goals completed! 🐙theorem mem_Iio_isLimit {a x:ℝ} (hx: x ∈ Set.Iio a) : LimitPt x (.Iio a) := a:ℝx:ℝhx:x ∈ Set.Iio a⊢ LimitPt x (Set.Iio a)
All goals completed! 🐙theorem mem_R_isLimit {x:ℝ} : LimitPt x (.univ) := x:ℝ⊢ LimitPt x Set.univ
All goals completed! 🐙
Definition 9.1.22. We use here Mathlib's Bornology.IsBounded
theorem isBounded_def (X: Set ℝ) : Bornology.IsBounded X ↔ ∃ M > 0, X ⊆ .Icc (-M) M := X:Set ℝ⊢ Bornology.IsBounded X ↔ ∃ M > 0, X ⊆ Set.Icc (-M) M
X:Set ℝ⊢ (∃ C, ∀ x ∈ X, |x| ≤ C) ↔ ∃ M, 0 < M ∧ X ⊆ Set.Icc (-M) M
X:Set ℝ⊢ (∃ C, ∀ x ∈ X, |x| ≤ C) → ∃ M, 0 < M ∧ X ⊆ Set.Icc (-M) MX:Set ℝ⊢ (∃ M, 0 < M ∧ X ⊆ Set.Icc (-M) M) → ∃ C, ∀ x ∈ X, |x| ≤ C
X:Set ℝ⊢ (∃ C, ∀ x ∈ X, |x| ≤ C) → ∃ M, 0 < M ∧ X ⊆ Set.Icc (-M) M X:Set ℝC:ℝhC:∀ x ∈ X, |x| ≤ C⊢ ∃ M, 0 < M ∧ X ⊆ Set.Icc (-M) M; X:Set ℝC:ℝhC:∀ x ∈ X, |x| ≤ C⊢ 0 < max C 1 ∧ X ⊆ Set.Icc (-max C 1) (max C 1)
refine ⟨ lt_of_lt_of_le (X:Set ℝC:ℝhC:∀ x ∈ X, |x| ≤ C⊢ 0 < 1 All goals completed! 🐙) (le_max_right _ _), ?_ ⟩
X:Set ℝC:ℝhC✝:∀ x ∈ X, |x| ≤ Cx:ℝhx:x ∈ XhC:|x| ≤ C⊢ x ∈ Set.Icc (-max C 1) (max C 1); X:Set ℝC:ℝhC✝:∀ x ∈ X, |x| ≤ Cx:ℝhx:x ∈ XhC:x ≤ C ∧ -x ≤ C⊢ x ∈ Set.Icc (-max C 1) (max C 1); X:Set ℝC:ℝhC✝:∀ x ∈ X, |x| ≤ Cx:ℝhx:x ∈ XhC:x ≤ C ∧ -x ≤ C⊢ -max C 1 ≤ x; All goals completed! 🐙
X:Set ℝM:ℝhM:0 < MhXM:X ⊆ Set.Icc (-M) M⊢ ∃ C, ∀ x ∈ X, |x| ≤ C; X:Set ℝM:ℝhM:0 < MhXM:X ⊆ Set.Icc (-M) M⊢ ∀ x ∈ X, |x| ≤ M; X:Set ℝM:ℝhM:0 < MhXM:X ⊆ Set.Icc (-M) Mx:ℝhx:x ∈ X⊢ |x| ≤ M; X:Set ℝM:ℝhM:0 < Mx:ℝhx:x ∈ XhXM:x ∈ Set.Icc (-M) M⊢ |x| ≤ M; X:Set ℝM:ℝhM:0 < Mx:ℝhx:x ∈ XhXM:-M ≤ x ∧ x ≤ M⊢ -x ≤ M; All goals completed! 🐙Example 9.1.23
theorem Icc_bounded (a b:ℝ) : Bornology.IsBounded (.Icc a b) := a:ℝb:ℝ⊢ Bornology.IsBounded (Set.Icc a b) All goals completed! 🐙Example 9.1.23
theorem Ici_unbounded (a: ℝ) : ¬ Bornology.IsBounded (.Ici a) := a:ℝ⊢ ¬Bornology.IsBounded (Set.Ici a) All goals completed! 🐙Example 9.1.23
theorem N_unbounded (a: ℝ) : ¬ Bornology.IsBounded ((fun n:ℕ ↦ (n:ℝ)) '' .univ) := a:ℝ⊢ ¬Bornology.IsBounded ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Example 9.1.23
theorem Z_unbounded (a: ℝ) : ¬ Bornology.IsBounded ((fun n:ℤ ↦ (n:ℝ)) '' .univ) := a:ℝ⊢ ¬Bornology.IsBounded ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Example 9.1.23
theorem Q_unbounded (a: ℝ) : ¬ Bornology.IsBounded ((fun n:ℚ ↦ (n:ℝ)) '' .univ) := a:ℝ⊢ ¬Bornology.IsBounded ((fun n => ↑n) '' Set.univ) All goals completed! 🐙Example 9.1.23
theorem R_unbounded (a: ℝ) : ¬ Bornology.IsBounded (.univ: Set ℝ) := a:ℝ⊢ ¬Bornology.IsBounded Set.univ All goals completed! 🐙Theorem 9.1.24 / Exercise 9.1.13 (Heine-Borel theorem for the line)
theorem Heine_Borel (X: Set ℝ) :
IsClosed X ∧ Bornology.IsBounded X ↔ ∀ a : ℕ → ℝ, (∀ n, a n ∈ X) →
(∃ n : ℕ → ℕ, StrictMono n
∧ ∃ L ∈ X, Filter.atTop.Tendsto (fun j ↦ a (n j)) (nhds L)) := X:Set ℝ⊢ IsClosed X ∧ Bornology.IsBounded X ↔
∀ (a : ℕ → ℝ),
(∀ (n : ℕ), a n ∈ X) → ∃ n, StrictMono n ∧ ∃ L ∈ X, Filter.Tendsto (fun j => a (n j)) Filter.atTop (nhds L)
All goals completed! 🐙Exercise 9.1.4
example : ∃ (X Y:Set ℝ), closure (X ∩ Y) ≠ closure X ∩ closure Y := I:Type u_1⊢ ∃ X Y, closure (X ∩ Y) ≠ closure X ∩ closure Y
All goals completed! 🐙Exercise 9.1.6
example (X:Set ℝ) : IsClosed (closure X) := I:Type u_1X:Set ℝ⊢ IsClosed (closure X)
All goals completed! 🐙Exercise 9.1.6
example {X Y:Set ℝ} (hY: IsClosed Y) (hXY: X ⊆ Y) : closure X ⊆ Y := I:Type u_1X:Set ℝY:Set ℝhY:IsClosed YhXY:X ⊆ Y⊢ closure X ⊆ Y
All goals completed! 🐙Exercise 9.1.7
example {n:ℕ} (X: Fin n → Set ℝ) (hX: ∀ i, IsClosed (X i)) :
IsClosed (⋃ i, X i) := I:Type u_1n:ℕX:Fin n → Set ℝhX:∀ (i : Fin n), IsClosed (X i)⊢ IsClosed (⋃ i, X i)
All goals completed! 🐙Exercise 9.1.8
example {I:Type} (X: I → Set ℝ) (hX: ∀ i, IsClosed (X i)) :
IsClosed (⋂ i, X i) := I✝:Type u_1I:TypeX:I → Set ℝhX:∀ (i : I), IsClosed (X i)⊢ IsClosed (⋂ i, X i)
All goals completed! 🐙Exercise 9.1.9
example {X:Set ℝ} {x:ℝ} (hx: AdherentPt x X) : LimitPt x X ∨ IsolatedPt x X := I:Type u_1X:Set ℝx:ℝhx:AdherentPt x X⊢ LimitPt x X ∨ IsolatedPt x X
All goals completed! 🐙Exercise 9.1.9
example {X:Set ℝ} {x:ℝ} : ¬ (LimitPt x X ∧ IsolatedPt x X) := I:Type u_1X:Set ℝx:ℝ⊢ ¬(LimitPt x X ∧ IsolatedPt x X)
All goals completed! 🐙Exercise 9.1.10
example {X:Set ℝ} (hX: X ≠ ∅) : Bornology.IsBounded X ↔
sSup ((fun x:ℝ ↦ (x:EReal)) '' X) < ⊤ ∧
sInf ((fun x:ℝ ↦ (x:EReal)) '' X) > ⊥ := I:Type u_1X:Set ℝhX:X ≠ ∅⊢ Bornology.IsBounded X ↔ sSup ((fun x => ↑x) '' X) < ⊤ ∧ sInf ((fun x => ↑x) '' X) > ⊥
All goals completed! 🐙Exercise 9.1.11
example {X:Set ℝ} (hX: Bornology.IsBounded X) : Bornology.IsBounded (closure X) := I:Type u_1X:Set ℝhX:Bornology.IsBounded X⊢ Bornology.IsBounded (closure X)
All goals completed! 🐙
Exercise 9.1.12. As a followup: prove or disprove this exercise with [Fintype I] removed.
example {I:Type} [Fintype I] (X: I → Set ℝ) (hX: ∀ i, Bornology.IsBounded (X i)) :
Bornology.IsBounded (⋃ i, X i) := I✝:Type u_1I:Typeinst✝:Fintype IX:I → Set ℝhX:∀ (i : I), Bornology.IsBounded (X i)⊢ Bornology.IsBounded (⋃ i, X i)
All goals completed! 🐙Exercise 9.1.14
example (I: Finset ℝ) : IsClosed (I:Set ℝ) ∧ Bornology.IsBounded (I:Set ℝ) := I✝:Type u_1I:Finset ℝ⊢ IsClosed ↑I ∧ Bornology.IsBounded ↑I
All goals completed! 🐙Exercise 9.1.15
example {E:Set ℝ} (hE: Bornology.IsBounded E) (hnon: E.Nonempty): AdherentPt (sSup E) E ∧ AdherentPt (sSup E) Eᶜ := I:Type u_1E:Set ℝhE:Bornology.IsBounded Ehnon:E.Nonempty⊢ AdherentPt (sSup E) E ∧ AdherentPt (sSup E) Eᶜ
All goals completed! 🐙end Chapter9