Lean library · module TopologyByExample.Spaces.MisraAttachment

Continuous maps and the attachment step in Misra's construction

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

theorem apply_apex_eq

TopologyByExample.MisraE0.apply_apex_eq

A continuous map to a first-countable T₁ space identifies the two apex points.

theorem apply_apex_eq {Y : Type*} [TopologicalSpace Y] [FirstCountableTopology Y]
    [T1Space Y] {f : MisraE0 → Y} (hf : Continuous f) : f (apex false) = f (apex true)
Proof
:= by
  have hU := PSpace.isOpen_fiber hf (f (apex false))
  have hV := PSpace.isOpen_fiber hf (f (apex true))
  obtain ⟨δ, hδ⟩ := exists_tail_rows_mem_closure (s := false) hU (by simp)
  obtain ⟨ε, hε⟩ := exists_tail_rows_mem_closure (s := true) hV (by simp)
  obtain ⟨α, hα⟩ := exists_gt (max δ ε)
  have hleft := hδ α (lt_of_le_of_lt (le_max_left _ _) hα)
  have hright := hε α (lt_of_le_of_lt (le_max_right _ _) hα)
  rw [(isClosed_singleton.preimage hf).closure_eq] at hleft hright
  exact hleft.symm.trans hright

On this site: Theorem: Continuous maps identify the apices of Misra's two-sheet space

theorem isClopen_cell_image

TopologyByExample.MisraE0.isClopen_cell_image

Countably many cells on one sheet and row form a clopen subset.

theorem isClopen_cell_image (s : Bool) (α : OmegaOne) {C : Set OmegaOne}
    (hC : C.Countable) : IsClopen (cell s α '' C)
Proof
:= by
  refine ⟨PSpace.isClosed_of_countable (hC.image _), ?_⟩
  rw [show cell s α '' C = ⋃ β ∈ C, {cell s α β} by
    ext x
    simp [eq_comm]]
  exact isOpen_iUnion (fun β ↦ isOpen_iUnion (fun _ ↦ isOpen_singleton_cell s α β))

theorem exists_proper_clopen_cell_image

TopologyByExample.MisraE0.exists_proper_clopen_cell_image

A nonempty countable collection of cells is a proper clopen subset.

theorem exists_proper_clopen_cell_image (s : Bool) (α : OmegaOne) {C : Set OmegaOne}
    (hC : C.Countable) (hne : C.Nonempty) :
    IsClopen (cell s α '' C) ∧ (cell s α '' C).Nonempty ∧ apex false ∉ cell s α '' C
Proof
:= by
  exact ⟨isClopen_cell_image s α hC, hne.image _, by simp⟩

theorem exists_countable_invariant_of_injective

TopologyByExample.exists_countable_invariant_of_injective

A countable family of injections has a nonempty countable set invariant in both directions.

theorem exists_countable_invariant_of_injective {X ι : Type*} [Countable ι]
    (f : ι → X → X) (hf : ∀ i, Function.Injective (f i)) (x₀ : X) :
    ∃ C : Set X, C.Countable ∧ x₀ ∈ C ∧ ∀ i x, f i x ∈ C ↔ x ∈ C
Proof
:= by
  classical
  let : Nonempty X := ⟨x₀⟩
  let step : ι × Bool → X → X := fun p ↦ if p.2 then f p.1 else Function.invFun (f p.1)
  let eval : List (ι × Bool) → X := fun l ↦ l.foldr step x₀
  let C : Set X := range eval
  have hs : ∀ p x, x ∈ C → step p x ∈ C := by
    rintro p _ ⟨l, rfl⟩
    exact ⟨p :: l, rfl⟩
  refine ⟨C, countable_range _, ⟨[], rfl⟩, fun i x ↦ ⟨?_, ?_⟩⟩
  · intro hx
    have h := hs (i, false) (f i x) hx
    simpa [step, Function.leftInverse_invFun (hf i) x] using h
  · intro hx
    simpa [step] using hs (i, true) x hx

inductive type Rel

TopologyByExample.MisraAttachment.Rel

Identify the two apices of each fresh copy with its prescribed attachment points.

inductive Rel {X ι : Type*} (t : ι → Bool → X) :
    (X ⊕ (Σ _ : ι, MisraE0)) → (X ⊕ (Σ _ : ι, MisraE0)) → Prop
  | attach (i : ι) (s : Bool) : Rel t (.inr ⟨i, .apex s⟩) (.inl (t i s))

definition Space

TopologyByExample.MisraAttachment.Space

Attach a disjoint family of copies of E₀ to a space along their two apices.

def Space {X ι : Type*} (t : ι → Bool → X)
:= Quot (Rel t)

instance

instance {X ι : Type*} [TopologicalSpace X] (t : ι → Bool → X) :
    TopologicalSpace (Space t)
Proof
:= inferInstanceAs (TopologicalSpace (Quot (Rel t)))

definition base

TopologyByExample.MisraAttachment.base

The canonical map of the old space into the adjunction.

def base {X ι : Type*} (t : ι → Bool → X) (x : X) : Space t
:= Quot.mk _ (.inl x)

definition extend

TopologyByExample.MisraAttachment.extend

Functions that agree on each attached pair extend constantly over each new copy.

def extend {X ι Y : Type*} {t : ι → Bool → X} (g : X → Y)
    (h : ∀ i, g (t i false) = g (t i true)) : Space t → Y
Definition
:=
  Quot.lift (Sum.elim g (fun p ↦ g (t p.1 false))) (by
    intro a b hab
    cases hab with
    | attach i s =>
      cases s
      · rfl
      · exact h i)

theorem extend_base

TopologyByExample.MisraAttachment.extend_base

The extension restricts to the original function.

@[simp] theorem extend_base {X ι Y : Type*} {t : ι → Bool → X} (g : X → Y)
    (h : ∀ i, g (t i false) = g (t i true)) (x : X) :
    extend g h (base t x) = g x
Proof
:= rfl

theorem continuous_extend

TopologyByExample.MisraAttachment.continuous_extend

A continuous function agreeing on the attachment pairs extends continuously.

theorem continuous_extend {X ι Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {t : ι → Bool → X} {g : X → Y} (hg : Continuous g)
    (h : ∀ i, g (t i false) = g (t i true)) : Continuous (extend g h)
Proof
:= by
  apply continuous_quot_lift
  exact hg.sumElim (continuous_sigma (fun i ↦
    (show Continuous (fun _ : MisraE0 ↦ g (t i false)) from continuous_const)))

definition strand

TopologyByExample.MisraAttachment.strand

A strand is either the sequence of row points or one sheet of one row of cells.

def strand : Option (Bool × OmegaOne) → OmegaOne → MisraE0
  | none, β => .row β
  | some (s, α), β => .cell s α β

definition targets

TopologyByExample.MisraAttachment.targets

Edges join successors and the argument of an injective enumeration to its value.

noncomputable def targets (e : OmegaOne → OmegaOne)
    (i : Option (Bool × OmegaOne) × Bool × OmegaOne) (s : Bool) : MisraE0
:=
  strand i.1 (if s then (if i.2.1 then Order.succ i.2.2 else e i.2.2) else i.2.2)

theorem exists_invariant_clopen

TopologyByExample.MisraAttachment.exists_invariant_clopen

The successor/enumeration attachment graph preserves a proper clopen subset of E₀.

theorem exists_invariant_clopen (e : OmegaOne → OmegaOne) (he : Function.Injective e) :
    ∃ U : Set MisraE0, IsClopen U ∧ MisraE0.cell false ⊥ ⊥ ∈ U ∧
      MisraE0.apex false ∉ U ∧ ∀ i, targets e i false ∈ U ↔ targets e i true ∈ U
Proof
:= by
  classical
  let f : Bool → OmegaOne → OmegaOne := fun b ↦ if b then Order.succ else e
  have hf : ∀ b, Function.Injective (f b) := by
    intro b
    cases b
    · exact he
    · exact Order.succ_injective
  obtain ⟨C, hC, h₀, hCf⟩ := exists_countable_invariant_of_injective f hf ⊥
  let U : Set MisraE0 := MisraE0.cell false ⊥ '' C
  have hstrand (d : Option (Bool × OmegaOne)) (β : OmegaOne) (b : Bool) :
      strand d β ∈ U ↔ strand d (f b β) ∈ U := by
    cases d with
    | none => simp [strand, U]
    | some p =>
      rcases p with ⟨s, α⟩
      simp only [strand, U, mem_image, MisraE0.cell.injEq]
      constructor
      · rintro ⟨γ, hγ, hs, hα, rfl⟩
        exact ⟨f b γ, (hCf b γ).2 hγ, hs, hα, rfl⟩
      · rintro ⟨γ, hγ, hs, hα, hγβ⟩
        exact ⟨β, (hCf b β).1 (hγβ ▸ hγ), hs, hα, rfl⟩
  refine ⟨U, MisraE0.isClopen_cell_image false ⊥ hC, ⟨⊥, h₀, rfl⟩, by simp [U], ?_⟩
  intro i
  simpa only [targets, Bool.false_eq_true, ite_false, ite_true, f, ite_apply] using
    hstrand i.1 i.2.2 i.2.1

theorem exists_nonconstant_map

TopologyByExample.MisraAttachment.exists_nonconstant_map

The first attachment stage already admits a nonconstant continuous Boolean-valued map.

theorem exists_nonconstant_map (e : OmegaOne → OmegaOne) (he : Function.Injective e) :
    ∃ g : Space (targets e) → Bool, Continuous g ∧
      g (base (targets e) (MisraE0.cell false ⊥ ⊥)) = true ∧
      g (base (targets e) (MisraE0.apex false)) = false
Proof
:= by
  classical
  obtain ⟨U, hU, hx, ha, hpair⟩ := exists_invariant_clopen e he
  have h : ∀ i, U.boolIndicator (targets e i false) = U.boolIndicator (targets e i true) := by
    intro i
    simp only [Set.boolIndicator, ← hpair i]
  refine ⟨extend U.boolIndicator h, continuous_extend
    ((continuous_boolIndicator_iff_isClopen U).2 hU) h, ?_, ?_⟩
  · exact (U.mem_iff_boolIndicator _).1 hx
  · exact (U.notMem_iff_boolIndicator _).1 ha

instance

instance {X ι : Type*} [TopologicalSpace X] [PSpace X] (t : ι → Bool → X) :
    PSpace (Space t)
Proof
:=
  PSpace.of_isQuotientMap (isQuotientMap_quot_mk (r := Rel t))

definition copy

TopologyByExample.MisraAttachment.copy

The canonical map of one attached copy.

def copy {X ι : Type*} (t : ι → Bool → X) (i : ι) (x : MisraE0) : Space t
:=
  Quot.mk _ (.inr ⟨i, x⟩)

theorem copy_apex

TopologyByExample.MisraAttachment.copy_apex

An attached apex is identified with its designated old point.

theorem copy_apex {X ι : Type*} (t : ι → Bool → X) (i : ι) (s : Bool) :
    copy t i (MisraE0.apex s) = base t (t i s)
Proof
:= Quot.sound (Rel.attach i s)

theorem continuous_base

TopologyByExample.MisraAttachment.continuous_base

The old-space map is continuous.

theorem continuous_base {X ι : Type*} [TopologicalSpace X] (t : ι → Bool → X) :
    Continuous (base t)
Proof
:= continuous_quot_mk.comp continuous_inl

theorem continuous_copy

TopologyByExample.MisraAttachment.continuous_copy

Each attached-copy map is continuous.

theorem continuous_copy {X ι : Type*} [TopologicalSpace X] (t : ι → Bool → X) (i : ι) :
    Continuous (copy t i)
Proof
:=
  continuous_quot_mk.comp (continuous_inr.comp continuous_sigmaMk)

theorem extend_copy

TopologyByExample.MisraAttachment.extend_copy

The extended function is constant on each attached copy.

theorem extend_copy {X ι Y : Type*} {t : ι → Bool → X} (g : X → Y)
    (h : ∀ i, g (t i false) = g (t i true)) (i : ι) (x : MisraE0) :
    extend g h (copy t i x) = g (t i false)
Proof
:= rfl

definition allPairs

TopologyByExample.MisraAttachment.allPairs

Attach along every ordered pair, an explicit alternative to the printed sparse pattern.

def allPairs {X : Type*} (p : X × X) (s : Bool) : X
:= if s then p.2 else p.1

theorem apply_base_eq_allPairs

TopologyByExample.MisraAttachment.apply_base_eq_allPairs

Attaching along all pairs forces continuous maps to first-countable T₁ spaces to agree on all points of the old space.

theorem apply_base_eq_allPairs {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    [FirstCountableTopology Y] [T1Space Y] {g : Space (allPairs (X := X)) → Y}
    (hg : Continuous g) (x y : X) : g (base allPairs x) = g (base allPairs y)
Proof
:= by
  have h := MisraE0.apply_apex_eq (hg.comp (continuous_copy allPairs (x, y)))
  simpa only [Function.comp_apply, copy_apex, allPairs, Bool.false_eq_true, ite_false,
    ite_true] using h

theorem exists_nonconstant_real_map

TopologyByExample.MisraAttachment.exists_nonconstant_real_map

The first printed-pattern stage admits a continuous real function separating old points.

theorem exists_nonconstant_real_map (e : OmegaOne → OmegaOne) (he : Function.Injective e) :
    ∃ g : Space (targets e) → ℝ, Continuous g ∧
      g (base (targets e) (MisraE0.cell false ⊥ ⊥)) = 1 ∧
      g (base (targets e) (MisraE0.apex false)) = 0
Proof
:= by
  obtain ⟨g, hg, hx, ha⟩ := exists_nonconstant_map e he
  let v : Bool → ℝ := fun b ↦ if b then 1 else 0
  refine ⟨v ∘ g, continuous_of_discreteTopology.comp hg, ?_, ?_⟩
  · simp [Function.comp_apply, hx, v]
  · simp [Function.comp_apply, ha, v]