Lean library · module TopologyByExample.Spaces.IntervalTwoPoints

A closed interval and two isolated points

Source file

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 Space

TopologyByExample.IntervalTwoPoints.Space

The common sum presentation of the two displayed subsets.

abbrev Space
:= unitInterval ⊕ Bool

On this site: Space: Closed interval with two isolated points

definition firstSet

TopologyByExample.IntervalTwoPoints.firstSet

The first arrangement, with one isolated point on each side.

def firstSet : Set ℝ
:= {0} ∪ Icc 1 2 ∪ {3}

definition secondSet

TopologyByExample.IntervalTwoPoints.secondSet

The second arrangement, with both isolated points on the right.

def secondSet : Set ℝ
:= Icc 0 1 ∪ {2} ∪ {3}

definition firstMap

TopologyByExample.IntervalTwoPoints.firstMap

Parametrize the first arrangement.

def firstMap : Space → ℝ
:= Sum.elim (fun x ↦ (x : ℝ) + 1) (fun b ↦ if b then 3 else 0)

definition secondMap

TopologyByExample.IntervalTwoPoints.secondMap

Parametrize the second arrangement.

def secondMap : Space → ℝ
:= Sum.elim (fun x ↦ (x : ℝ)) (fun b ↦ if b then 3 else 2)

theorem continuous_firstMap

TopologyByExample.IntervalTwoPoints.continuous_firstMap

Both maps are continuous.

theorem continuous_firstMap : Continuous firstMap
Proof
:=
  continuous_sum_dom.mpr ⟨continuous_subtypeVal.add_const 1, continuous_of_discreteTopology⟩

theorem continuous_secondMap

TopologyByExample.IntervalTwoPoints.continuous_secondMap

The second map is continuous.

theorem continuous_secondMap : Continuous secondMap
Proof
:=
  continuous_sum_dom.mpr ⟨continuous_subtypeVal, continuous_of_discreteTopology⟩

theorem firstMap_injective

TopologyByExample.IntervalTwoPoints.firstMap_injective

The first parametrization is injective.

theorem firstMap_injective : Function.Injective firstMap
Proof
:= by
  intro x y h
  cases x with
  | inl x =>
    cases y with
    | inl y => exact congrArg Sum.inl (Subtype.ext (add_right_cancel h))
    | inr y => cases y <;> simp only [firstMap, Sum.elim_inl, Sum.elim_inr, Bool.false_eq_true,
        ↓reduceIte] at h <;> linarith [x.property.1, x.property.2]
  | inr x =>
    cases y with
    | inl y => cases x <;> simp only [firstMap, Sum.elim_inl, Sum.elim_inr, Bool.false_eq_true,
        ↓reduceIte] at h <;> linarith [y.property.1, y.property.2]
    | inr y => cases x <;> cases y <;> simp_all [firstMap]

theorem secondMap_injective

TopologyByExample.IntervalTwoPoints.secondMap_injective

The second parametrization is injective.

theorem secondMap_injective : Function.Injective secondMap
Proof
:= by
  intro x y h
  cases x with
  | inl x =>
    cases y with
    | inl y => exact congrArg Sum.inl (Subtype.ext h)
    | inr y => cases y <;> simp only [secondMap, Sum.elim_inl, Sum.elim_inr, Bool.false_eq_true,
        ↓reduceIte] at h <;> linarith [x.property.1, x.property.2]
  | inr x =>
    cases y with
    | inl y => cases x <;> simp only [secondMap, Sum.elim_inl, Sum.elim_inr, Bool.false_eq_true,
        ↓reduceIte] at h <;> linarith [y.property.1, y.property.2]
    | inr y => cases x <;> cases y <;> simp_all [secondMap]

theorem range_firstMap

TopologyByExample.IntervalTwoPoints.range_firstMap

The first image is exactly the displayed subset.

theorem range_firstMap : range firstMap = firstSet
Proof
:= by
  ext x
  constructor
  · rintro ⟨y, rfl⟩
    cases y with
    | inl y => exact Or.inl (Or.inr ⟨by change 1 ≤ (y : ℝ) + 1; linarith [y.property.1],
        by change (y : ℝ) + 1 ≤ 2; linarith [y.property.2]⟩)
    | inr b => cases b <;> simp [firstMap, firstSet]
  · rintro ((hx | hx) | hx)
    · exact ⟨Sum.inr false, by simpa [firstMap] using hx.symm⟩
    · exact ⟨Sum.inl ⟨x - 1, by constructor <;> linarith [hx.1, hx.2]⟩, by simp [firstMap]⟩
    · exact ⟨Sum.inr true, by simpa [firstMap] using hx.symm⟩

theorem range_secondMap

TopologyByExample.IntervalTwoPoints.range_secondMap

The second image is exactly the displayed subset.

theorem range_secondMap : range secondMap = secondSet
Proof
:= by
  ext x
  constructor
  · rintro ⟨y, rfl⟩
    cases y with
    | inl y => exact Or.inl (Or.inl y.property)
    | inr b => cases b <;> simp [secondMap, secondSet]
  · rintro ((hx | hx) | hx)
    · exact ⟨Sum.inl ⟨x, hx⟩, rfl⟩
    · exact ⟨Sum.inr false, by simpa [secondMap] using hx.symm⟩
    · exact ⟨Sum.inr true, by simpa [secondMap] using hx.symm⟩

definition firstHomeomorph

TopologyByExample.IntervalTwoPoints.firstHomeomorph

The first displayed subset is a closed interval with two isolated points.

def firstHomeomorph : Space ≃ₜ firstSet
Definition
:=
  (continuous_firstMap.subtype_mk (fun x ↦ mem_range_self x)).homeoOfEquivCompactToT2
    (f := Equiv.ofInjective firstMap firstMap_injective) |>.trans
      (Homeomorph.setCongr range_firstMap)

definition secondHomeomorph

TopologyByExample.IntervalTwoPoints.secondHomeomorph

The second displayed subset has the same sum presentation.

def secondHomeomorph : Space ≃ₜ secondSet
Definition
:=
  (continuous_secondMap.subtype_mk (fun x ↦ mem_range_self x)).homeoOfEquivCompactToT2
    (f := Equiv.ofInjective secondMap secondMap_injective) |>.trans
      (Homeomorph.setCongr range_secondMap)

definition arrangementsHomeomorph

TopologyByExample.IntervalTwoPoints.arrangementsHomeomorph

The two arrangements are homeomorphic as subspaces.

def arrangementsHomeomorph : firstSet ≃ₜ secondSet
:= firstHomeomorph.symm.trans secondHomeomorph

On this site: Closed interval with two isolated points: Two real arrangements of an interval and two isolated points