Lean library · module TopologyByExample.Spaces.RealRaySums
Open rays in the closure–complement example
This file was written by Codex (OpenAI's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.
Imports
definition upperPositive
TopologyByExample.RealRaySums.upperPositive
Translate an upper open ray to the positive real numbers.
def upperPositive (a : ℝ) : Ioi a ≃ₜ Ioi (0 : ℝ)
Definition
where
toFun x := ⟨x.val - a, sub_pos.mpr x.property⟩
invFun y := ⟨y.val + a, by have h : 0 < y.val := y.property; change a < y.val + a; linarith⟩
left_inv x := Subtype.ext (by simp)
right_inv y := Subtype.ext (by simp)
continuous_toFun := by fun_prop
continuous_invFun := by fun_prop
definition lowerPositive
TopologyByExample.RealRaySums.lowerPositive
Reflect a lower open ray to the positive real numbers.
def lowerPositive (a : ℝ) : Iio a ≃ₜ Ioi (0 : ℝ)
Definition
where
toFun x := ⟨a - x.val, sub_pos.mpr x.property⟩
invFun y := ⟨a - y.val, by have h : 0 < y.val := y.property; change a - y.val < a; linarith⟩
left_inv x := Subtype.ext (by ring)
right_inv y := Subtype.ext (by ring)
continuous_toFun := by fun_prop
continuous_invFun := by fun_prop
definition upperReal
TopologyByExample.RealRaySums.upperReal
Every upper open ray is a real line.
def upperReal (a : ℝ) : Ioi a ≃ₜ ℝ
:=
(upperPositive a).trans Real.expOrderIso.toHomeomorph.symm
definition lowerReal
TopologyByExample.RealRaySums.lowerReal
Every lower open ray is a real line.
def lowerReal (a : ℝ) : Iio a ≃ₜ ℝ
:=
(lowerPositive a).trans Real.expOrderIso.toHomeomorph.symm
theorem complement_twoClosed
TopologyByExample.RealRaySums.complement_twoClosed
The complement of the two closed intervals consists of three open intervals or rays.
theorem complement_twoClosed : (Icc (2 : ℝ) 4 ∪ Icc 5 6)ᶜ =
(Iio 2 ∪ Ioo 4 5) ∪ Ioi 6
Proof
:= by
ext x
simp only [mem_compl_iff, mem_union, mem_Icc, mem_Iio, mem_Ioo, mem_Ioi, not_or]
constructor
· rintro ⟨h24, h56⟩
by_cases h2 : x < 2
· exact Or.inl (Or.inl h2)
· have h4 : 4 < x := lt_of_not_ge (fun h ↦ h24 ⟨le_of_not_gt h2, h⟩)
by_cases h5 : x < 5
· exact Or.inl (Or.inr ⟨h4, h5⟩)
· exact Or.inr (lt_of_not_ge (fun h ↦ h56 ⟨le_of_not_gt h5, h⟩))
· rintro ((h | ⟨h4, h5⟩) | h)
· constructor <;> rintro ⟨ha, hb⟩ <;> linarith
· constructor <;> rintro ⟨ha, hb⟩ <;> linarith
· constructor <;> rintro ⟨ha, hb⟩ <;> linarith
theorem complement_threeClosed
TopologyByExample.RealRaySums.complement_threeClosed
The complement of the three closed intervals has four open components.
theorem complement_threeClosed : ((Icc (2 : ℝ) 4 ∪ Icc 5 6) ∪ Icc 7 8)ᶜ =
(Iio 2 ∪ Ioo 4 5) ∪ (Ioo 6 7 ∪ Ioi 8)
Proof
:= by
rw [compl_union, complement_twoClosed]
ext x
simp only [mem_inter_iff, mem_compl_iff, mem_union, mem_Icc, mem_Iio, mem_Ioo, mem_Ioi]
constructor
· rintro ⟨(h | h6), h78⟩
· exact Or.inl h
· by_cases h7 : x < 7
· exact Or.inr (Or.inl ⟨h6, h7⟩)
· exact Or.inr (Or.inr (lt_of_not_ge (fun h ↦ h78 ⟨le_of_not_gt h7, h⟩)))
· rintro (h | (h | h))
· refine ⟨Or.inl h, ?_⟩
rcases h with h | ⟨_, h⟩ <;> rintro ⟨ha, hb⟩ <;> linarith
· exact ⟨Or.inr h.1, fun hx ↦ (not_lt_of_ge hx.1) h.2⟩
· exact ⟨Or.inr (by linarith), fun hx ↦ (not_lt_of_ge hx.2) h⟩
definition firstPair
TopologyByExample.RealRaySums.firstPair
The left ray and next bounded interval form two real lines.
def firstPair : (Iio (2 : ℝ) ∪ Ioo 4 5 : Set ℝ) ≃ₜ ℝ ⊕ ℝ
Definition
:=
(cutHomeomorph (Iio 2) (Ioo 4 5) 3
(by intro x hx; change x < 3; have h : x < 2 := hx; linarith)
(by intro x hx; change 3 < x; linarith [hx.1])).trans
((lowerReal 2).sumCongr (intervalReal 4 5 (by norm_num)))
definition lastPair
TopologyByExample.RealRaySums.lastPair
The next bounded interval and the right ray form two real lines.
def lastPair : (Ioo (6 : ℝ) 7 ∪ Ioi 8 : Set ℝ) ≃ₜ ℝ ⊕ ℝ
Definition
:=
(cutHomeomorph (Ioo 6 7) (Ioi 8) (15 / 2)
(by intro x hx; change x < (15 : ℝ) / 2; linarith [hx.2])
(by intro x hx; change (15 : ℝ) / 2 < x; have h : 8 < x := hx; linarith)).trans
((intervalReal 6 7 (by norm_num)).sumCongr (upperReal 8))
definition complementClosureInteriorHomeomorph
TopologyByExample.RealRaySums.complementClosureInteriorHomeomorph
Complementing the closed interior gives the same three-real-line type.
def complementClosureInteriorHomeomorph : ↥((closure (interior original))ᶜ) ≃ₜ (ℝ ⊕ ℝ) ⊕ ℝ
Definition
:=
(Homeomorph.setCongr (congrArg compl closure_interior_original |>.trans
complement_twoClosed)).trans
((cutHomeomorph (Iio 2 ∪ Ioo 4 5) (Ioi 6) (11 / 2)
(by
rintro x (hx | hx)
· change x < (11 : ℝ) / 2; have h : x < 2 := hx; linarith
· change x < (11 : ℝ) / 2; linarith [hx.2])
(by intro x hx; change (11 : ℝ) / 2 < x; have h : 6 < x := hx; linarith)).trans
(firstPair.sumCongr (upperReal 6)))
On this site: Sum of three real lines: Complementing the closed interior also gives three real lines
definition complementClosureInteriorClosureHomeomorph
TopologyByExample.RealRaySums.complementClosureInteriorClosureHomeomorph
Complementing the closed interior of the closure gives four real lines.
def complementClosureInteriorClosureHomeomorph : ↥((closure (interior (closure original)))ᶜ) ≃ₜ
(ℝ ⊕ ℝ) ⊕ (ℝ ⊕ ℝ)
Definition
:=
(Homeomorph.setCongr (congrArg compl closure_interior_closure_original |>.trans
complement_threeClosed)).trans
((cutHomeomorph (Iio 2 ∪ Ioo 4 5) (Ioo 6 7 ∪ Ioi 8) (11 / 2)
(by
rintro x (hx | hx)
· change x < (11 : ℝ) / 2; have h : x < 2 := hx; linarith
· change x < (11 : ℝ) / 2; linarith [hx.2])
(by
rintro x (hx | hx)
· change (11 : ℝ) / 2 < x; linarith [hx.1]
· change (11 : ℝ) / 2 < x; have h : 8 < x := hx; linarith)).trans
(firstPair.sumCongr lastPair))
On this site: Sum of four real lines: Complementing the closed interior of the closure gives four real lines
On this site: Space: Sum of four real lines