Lean library · module TopologyByExample.Theorems.SeparatedRealSubsets

Disjoint real subsets and interval identifications

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 unionHomeomorph

TopologyByExample.SeparatedRealSubsets.unionHomeomorph

A union of two disjoint relatively open sets is their topological sum.

def unionHomeomorph {X : Type*} [TopologicalSpace X] (s t : Set X)
    (hd : Disjoint s t) (hs : IsOpen (Subtype.val ⁻¹' s : Set ↥(s ∪ t)))
    (ht : IsOpen (Subtype.val ⁻¹' t : Set ↥(s ∪ t))) :
    (s ∪ t : Set X) ≃ₜ s ⊕ t
Definition
:= by
  classical
  exact ((Equiv.Set.union hd).symm.toHomeomorphOfContinuousOpen
    (continuous_sum_dom.mpr ⟨continuous_subtypeVal.subtype_mk _,
      continuous_subtypeVal.subtype_mk _⟩)
    (isOpenMap_sum.mpr ⟨(Topology.IsOpenEmbedding.inclusion subset_union_left hs).isOpenMap,
      (Topology.IsOpenEmbedding.inclusion subset_union_right ht).isOpenMap⟩)).symm

definition cutHomeomorph

TopologyByExample.SeparatedRealSubsets.cutHomeomorph

An omitted cut point separates the two parts of a real subspace.

def cutHomeomorph (s t : Set ℝ) (c : ℝ) (hs : s ⊆ Iio c) (ht : t ⊆ Ioi c) :
    (s ∪ t : Set ℝ) ≃ₜ s ⊕ t
Definition
:= by
  have hd : Disjoint s t := Set.disjoint_left.mpr (fun x hx hy ↦
    (lt_asymm (hs hx) (ht hy)))
  apply unionHomeomorph s t hd
  · have he : (Subtype.val ⁻¹' s : Set ↥(s ∪ t)) = Subtype.val ⁻¹' Iio c := by
      ext x
      exact ⟨fun h ↦ hs h, fun h ↦ x.property.resolve_right (fun hx ↦ lt_asymm h (ht hx))⟩
    rw [he]
    exact isOpen_Iio.preimage continuous_subtypeVal
  · have he : (Subtype.val ⁻¹' t : Set ↥(s ∪ t)) = Subtype.val ⁻¹' Ioi c := by
      ext x
      exact ⟨fun h ↦ ht h, fun h ↦ x.property.resolve_left (fun hx ↦ lt_asymm h (hs hx))⟩
    rw [he]
    exact isOpen_Ioi.preimage continuous_subtypeVal

definition intervalRescale

TopologyByExample.SeparatedRealSubsets.intervalRescale

Affine rescaling identifies any nonempty bounded open interval with (-1,1).

def intervalRescale (a b : ℝ) (h : a < b) : Ioo a b ≃ₜ Ioo (-1 : ℝ) 1
Definition
where
  toFun x := ⟨(2 * x.val - a - b) / (b - a), by
    constructor
    · rw [lt_div_iff₀ (sub_pos.mpr h)]
      linarith [x.property.1]
    · rw [div_lt_iff₀ (sub_pos.mpr h)]
      linarith [x.property.2]⟩
  invFun y := ⟨((b - a) * y.val + a + b) / 2, by
    constructor <;> nlinarith [y.property.1, y.property.2]⟩
  left_inv x := by
    apply Subtype.ext
    change ((b - a) * ((2 * x.val - a - b) / (b - a)) + a + b) / 2 = x.val
    field_simp
    ring
  right_inv y := by
    apply Subtype.ext
    change (2 * (((b - a) * y.val + a + b) / 2) - a - b) / (b - a) = y.val
    field_simp
    ring
  continuous_toFun := by fun_prop
  continuous_invFun := by fun_prop

definition intervalReal

TopologyByExample.SeparatedRealSubsets.intervalReal

Every nonempty bounded open real interval is homeomorphic to the real line.

def intervalReal (a b : ℝ) (h : a < b) : Ioo a b ≃ₜ ℝ
:=
  (intervalRescale a b h).trans (orderIsoIooNegOneOne ℝ).toHomeomorph.symm