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:

variable (I : Type*)
Set.Icc_def.{u_1} {α : Type u_1} [Preorder α] (a b : α) : {x | a  x  x  b} = Set.Icc a b
Set.Ico_def.{u_1} {α : Type u_1} [Preorder α] (a b : α) : {x | a  x  x < b} = Set.Ico a b
Set.Ioc_def.{u_1} {α : Type u_1} [Preorder α] (a b : α) : {x | a < x  x  b} = Set.Ioc a b
Set.Ioo_def.{u_1} {α : Type u_1} [Preorder α] (a b : α) : {x | a < x  x < b} = Set.Ioo a b
Set.Ici_def.{u_1} {α : Type u_1} [Preorder α] (a : α) : {x | a  x} = Set.Ici a
Set.Ioi_def.{u_1} {α : Type u_1} [Preorder α] (a : α) : {x | a < x} = Set.Ioi a
Set.Iic_def.{u_1} {α : Type u_1} [Preorder α] (b : α) : {x | x  b} = Set.Iic b
Set.Iio_def.{u_1} {α : Type u_1} [Preorder α] (a : α) : {x | x < a} = Set.Iio a
EReal.image_coe_Icc (x y : ) : Real.toEReal '' Set.Icc x y = Set.Icc x y
EReal.image_coe_Ico (x y : ) : Real.toEReal '' Set.Ico x y = Set.Ico x y
EReal.image_coe_Ioc (x y : ) : Real.toEReal '' Set.Ioc x y = Set.Ioc x y
EReal.image_coe_Ioo (x y : ) : Real.toEReal '' Set.Ioo x y = Set.Ioo x y
EReal.image_coe_Ici (x : ) : Real.toEReal '' Set.Ici x = Set.Ico x 
EReal.image_coe_Ioi (x : ) : Real.toEReal '' Set.Ioi x = Set.Ioo x 
EReal.image_coe_Iic (x : ) : Real.toEReal '' Set.Iic x = Set.Ioc  x
EReal.image_coe_Iio (x : ) : Real.toEReal '' Set.Iio x = Set.Ioo  x

Example 9.1.4

declaration uses 'sorry'example {a b: EReal} (h: a > b) : Set.Icc a b = := I:Type u_1a:ERealb:ERealh:a > bSet.Icc a b = All goals completed! 🐙
declaration uses 'sorry'example {a b: EReal} (h: a b) : Set.Ico a b = := I:Type u_1a:ERealb:ERealh:a bSet.Ico a b = All goals completed! 🐙declaration uses 'sorry'example {a b: EReal} (h: a b) : Set.Ioc a b = := I:Type u_1a:ERealb:ERealh:a bSet.Ioc a b = All goals completed! 🐙declaration uses 'sorry'example {a b: EReal} (h: a b) : Set.Ioo a b = := I:Type u_1a:ERealb:ERealh:a bSet.Ioo a b = All goals completed! 🐙declaration uses 'sorry'example {a b: EReal} (h: a = b) : Set.Icc a a = {a} := I:Type u_1a:ERealb:ERealh:a = bSet.Icc a a = {a} All goals completed! 🐙

Definition 9.1.5. Note that a slightly different Unknown constant `Real.adherent`Real.adherent was defined in Chapter 6.4

abbrev Real.adherent' (ε:) (x:) (X: Set ) := y X, |x - y| ε

Example 9.1.7

declaration uses 'sorry'example : (0.5:).adherent' 1.1 (.Ioo 0 1) := I:Type u_1Real.adherent' 0.5 1.1 (Set.Ioo 0 1) All goals completed! 🐙
declaration uses 'sorry'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! 🐙declaration uses 'sorry'example : (0.5:).adherent' 1.1 {1,2,3} := I:Type u_1Real.adherent' 0.5 1.1 {1, 2, 3} All goals completed! 🐙namespace Chapter9

Definition 9.1.

abbrev AdherentPt (x:) (X:Set ) := ε > (0:), ε.adherent' x X
declaration uses 'sorry'example : AdherentPt 1 (.Ioo 0 1) := I:Type u_1AdherentPt 1 (Set.Ioo 0 1) All goals completed! 🐙declaration uses 'sorry'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| εε::0 < ε y X, |y - x✝| < ε all_goals X:Set x✝:h: (ε : ), 0 < ε y X, |x✝ - y| εε::0 < εy:hy:y Xhxy:|x✝ - y| ε / 2 y X, |y - x✝| < ε; exact _, hy, X:Set x✝:h: (ε : ), 0 < ε y X, |x✝ - y| εε::0 < εy:hy:y Xhxy:|x✝ - y| ε / 2|y - x✝| < ε X:Set x✝:h: (ε : ), 0 < ε y X, |x✝ - y| εε::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 Chapter9.AdherentPt (x : ) (X : Set ) : PropAdherentPt with Mathlib's ClusterPt.{u_1} {X : Type u_1} [TopologicalSpace X] (x : X) (F : Filter X) : PropClusterPt

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 declaration uses 'sorry'subset_closure (X:Set ): X closure X := X:Set X closure X All goals completed! 🐙

Lemma 9.1.11 / Exercise 9.1.2

theorem declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'closure_subset {X Y:Set } (h: X Y): closure X closure Y := X:Set Y:Set h:X Yclosure X closure Y All goals completed! 🐙

Exercise 9.1.1

theorem declaration uses 'sorry'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 Xclosure Y = closure X All goals completed! 🐙

Lemma 9.1.12

theorem declaration uses 'sorry'closure_of_Ioo {a b:} (h:a < b) : closure (.Ioo a b) = .Icc a b := a:b:h:a < bclosure (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 < x0 < x - b All goals completed! 🐙 a:b:h✝:a < bx:h':a xh:b < xy:left✝:a < yright✝:y < bx - 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 < a0 < a - x All goals completed! 🐙 a:b:h✝:a < bx:h:a x b < xh':x < ay:left✝:a < yright✝:y < ba - 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 declaration uses 'sorry'closure_of_Ioc {a b:} (h:a < b) : closure (.Ioc a b) = .Icc a b := a:b:h:a < bclosure (Set.Ioc a b) = Set.Icc a b All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Ico {a b:} (h:a < b) : closure (.Ico a b) = .Icc a b := a:b:h:a < bclosure (Set.Ico a b) = Set.Icc a b All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Icc {a b:} (h:a b) : closure (.Icc a b) = .Icc a b := a:b:h:a bclosure (Set.Icc a b) = Set.Icc a b All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Ioi {a:} : closure (.Ioi a) = .Ici a := a:closure (Set.Ioi a) = Set.Ici a All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Ici {a:} : closure (.Ici a) = .Ici a := a:closure (Set.Ici a) = Set.Ici a All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Iio {a:} : closure (.Iio a) = .Iic a := a:closure (Set.Iio a) = Set.Iic a All goals completed! 🐙theorem declaration uses 'sorry'closure_of_Iic {a:} : closure (.Iic a) = .Iic a := a:closure (Set.Iic a) = Set.Iic a All goals completed! 🐙theorem declaration uses 'sorry'closure_of_R : closure (.univ: Set ) = .univ := closure Set.univ = Set.univ All goals completed! 🐙

Lemma 9.1.13 / Exercise 9.1.3

theorem declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 XAdherentPt 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.symm
theorem 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 declaration uses 'sorry'Icc_closed {a b:} : IsClosed (.Icc a b) := a:b:IsClosed (Set.Icc a b) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'Ici_closed (a:) : IsClosed (.Ici a) := a:IsClosed (Set.Ici a) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'Iic_closed (a:) : IsClosed (.Iic a) := a:IsClosed (Set.Iic a) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'R_closed : IsClosed (.univ : Set ) := IsClosed Set.univ All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'Ioi_not_closed (a:) : ¬ IsClosed (.Ioi a) := a:¬IsClosed (Set.Ioi a) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'Iio_not_closed (a:) : ¬ IsClosed (.Iio a) := a:¬IsClosed (Set.Iio a) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'N_closed : IsClosed ((fun n: (n:)) '' .univ) := IsClosed ((fun n => n) '' Set.univ) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'Z_closed : IsClosed ((fun n: (n:)) '' .univ) := IsClosed ((fun n => n) '' Set.univ) All goals completed! 🐙

Examples 9.1.16

theorem declaration uses 'sorry'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✝ Xx✝ 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! 🐙

Definition 9.1.18 (Limit points)

abbrev LimitPt (x:) (X: Set ) := AdherentPt x (X \ {x})

Identification with Mathlib's AccPt.{u_1} {X : Type u_1} [TopologicalSpace X] (x : X) (F : Filter X) : PropAccPt

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

declaration uses 'sorry'example : AdherentPt 3 ((.Ioo 1 2) {3}) := I:Type u_1AdherentPt 3 (Set.Ioo 1 2 {3}) All goals completed! 🐙
declaration uses 'sorry'example : ¬ LimitPt 3 ((.Ioo 1 2) {3}) := I:Type u_1¬LimitPt 3 (Set.Ioo 1 2 {3}) All goals completed! 🐙declaration uses 'sorry'example : IsolatedPt 3 ((.Ioo 1 2) {3}) := I:Type u_1IsolatedPt 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 declaration uses 'sorry'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 bLimitPt 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 bLimitPt 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 < bFilter.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 bLimitPt x (Set.Icc a b) All goals completed! 🐙 have : (b - x)⁻¹ > 0 := a:b:x:h:a < bhx:x Set.Icc a bLimitPt x (Set.Icc a b) All goals completed! 🐙 have : n + (b - x)⁻¹ > 0 := a:b:x:h:a < bhx:x Set.Icc a bLimitPt x (Set.Icc a b) All goals completed! 🐙 have : (n+(b - x)⁻¹)⁻¹ > 0 := a:b:x:h:a < bhx:x Set.Icc a bLimitPt x (Set.Icc a b) All goals completed! 🐙 have : (b-x)⁻¹ n + (b - x)⁻¹ := a:b:x:h:a < bhx:x Set.Icc a bLimitPt x (Set.Icc a b) All goals completed! 🐙 have : (n + (b - x)⁻¹)⁻¹ b-x := a:b:x:h:a < bhx:x Set.Icc a bLimitPt 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.1523510 < 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.1523510 < 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.1523510 < 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.1523510 < b - x All goals completed! 🐙 All goals completed! 🐙 a:b:x:h:a < bhx:a x x bhxb:x < bx = x + 0a:b:x:h:a < bhx:a x x bhxb:x < bFilter.Tendsto (fun k => 1 / (k + (b - x)⁻¹)) Filter.atTop (nhds 0); a:b:x:h:a < bhx:a x x bhxb:x < bFilter.Tendsto (fun k => 1 / (k + (b - x)⁻¹)) Filter.atTop (nhds 0) a:b:x:h:a < bhx:a x x bhxb:x < bFilter.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 < b1 0 All goals completed! 🐙) using 2 with n; All goals completed! 🐙 All goals completed! 🐙
theorem declaration uses 'sorry'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 bLimitPt x (Set.Ico a b) All goals completed! 🐙theorem declaration uses 'sorry'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 bLimitPt x (Set.Ioc a b) All goals completed! 🐙theorem declaration uses 'sorry'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 bLimitPt x (Set.Ioo a b) All goals completed! 🐙theorem declaration uses 'sorry'mem_Ici_isLimit {a x:} (hx: x Set.Ici a) : LimitPt x (.Ici a) := a:x:hx:x Set.Ici aLimitPt x (Set.Ici a) All goals completed! 🐙theorem declaration uses 'sorry'mem_Ioi_isLimit {a x:} (hx: x Set.Ioi a) : LimitPt x (.Ioi a) := a:x:hx:x Set.Ioi aLimitPt x (Set.Ioi a) All goals completed! 🐙theorem declaration uses 'sorry'mem_Iic_isLimit {a x:} (hx: x Set.Iic a) : LimitPt x (.Iic a) := a:x:hx:x Set.Iic aLimitPt x (Set.Iic a) All goals completed! 🐙theorem declaration uses 'sorry'mem_Iio_isLimit {a x:} (hx: x Set.Iio a) : LimitPt x (.Iio a) := a:x:hx:x Set.Iio aLimitPt x (Set.Iio a) All goals completed! 🐙theorem declaration uses 'sorry'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.{u_2} {α : Type u_2} [Bornology α] (s : Set α) : PropBornology.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| C0 < 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| C0 < 1 All goals completed! 🐙) (le_max_right _ _), ?_ X:Set C:hC✝: x X, |x| Cx:hx:x XhC:|x| Cx Set.Icc (-max C 1) (max C 1); X:Set C:hC✝: x X, |x| Cx:hx:x XhC:x C -x Cx 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 declaration uses 'sorry'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 declaration uses 'sorry'Ici_unbounded (a: ) : ¬ Bornology.IsBounded (.Ici a) := a:¬Bornology.IsBounded (Set.Ici a) All goals completed! 🐙

Example 9.1.23

theorem declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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

declaration uses 'sorry'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

declaration uses 'sorry'example (X:Set ) : IsClosed (closure X) := I:Type u_1X:Set IsClosed (closure X) All goals completed! 🐙

Exercise 9.1.6

declaration uses 'sorry'example {X Y:Set } (hY: IsClosed Y) (hXY: X Y) : closure X Y := I:Type u_1X:Set Y:Set hY:IsClosed YhXY:X Yclosure X Y All goals completed! 🐙

Exercise 9.1.7

declaration uses 'sorry'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

declaration uses 'sorry'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

declaration uses 'sorry'example {X:Set } {x:} (hx: AdherentPt x X) : LimitPt x X IsolatedPt x X := I:Type u_1X:Set x:hx:AdherentPt x XLimitPt x X IsolatedPt x X All goals completed! 🐙

Exercise 9.1.9

declaration uses 'sorry'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

declaration uses 'sorry'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

declaration uses 'sorry'example {X:Set } (hX: Bornology.IsBounded X) : Bornology.IsBounded (closure X) := I:Type u_1X:Set hX:Bornology.IsBounded XBornology.IsBounded (closure X) All goals completed! 🐙

Exercise 9.1.12. As a followup: prove or disprove this exercise with [Fintype I] : List (Type u_2)[Fintype I] removed.

declaration uses 'sorry'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

declaration uses 'sorry'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

declaration uses 'sorry'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.NonemptyAdherentPt (sSup E) E AdherentPt (sSup E) E All goals completed! 🐙
end Chapter9