Lean library · module TopologyByExample.Spaces.MisraLimitColour

Compatible colourings of the all-pairs limit

Source file

The colouring is set-theoretic; no continuity is asserted.

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 copyColour

TopologyByExample.MisraAllPairs.copyColour

Colour a new copy by its first endpoint, except at the prescribed apices.

def copyColour {X : Type*} (c : X → Bool) (p : X × X) : MisraE0 → Bool
  | .apex s => c (allPairs p s)
  | .row _ => c p.1
  | .cell _ _ _ => c p.1

definition attachColour

TopologyByExample.MisraAllPairs.attachColour

Extend an arbitrary colouring across an all-pairs attachment.

def attachColour {X : Type*} (c : X → Bool) : Space (allPairs (X := X)) → Bool
Definition
:=
  Quot.lift (Sum.elim c (fun p ↦ copyColour c p.1 p.2)) (by
    intro a b h
    cases h
    rfl)

theorem attachColour_base

TopologyByExample.MisraAllPairs.attachColour_base

Old points retain their colours.

@[simp] theorem attachColour_base {X : Type*} (c : X → Bool) (x : X) :
    attachColour c (base allPairs x) = c x
Proof
:= rfl

theorem attachColour_copy

TopologyByExample.MisraAllPairs.attachColour_copy

A copy whose endpoints have the same colour is monochromatic.

theorem attachColour_copy {X : Type*} (c : X → Bool) (x y : X) (h : c x = c y)
    (z : MisraE0) : attachColour c (copy allPairs (x, y) z) = c x
Proof
:= by
  cases z with
  | apex s => cases s <;> simp [attachColour, copy, copyColour, allPairs, h]
  | row _ => rfl
  | cell _ _ _ => rfl

definition stageColour

TopologyByExample.MisraAllPairs.stageColour

A compatible colouring of the finite stages, starting with the two sheets.

def stageColour : (n : ℕ) → Stage n → Bool
Definition
  | 0 => fun x ↦ match x with
    | .apex s => s
    | .row _ => false
    | .cell s _ _ => s
  | n + 1 => attachColour (stageColour n)

theorem stageColour_step

TopologyByExample.MisraAllPairs.stageColour_step

Colours are preserved by each bonding map.

@[simp] theorem stageColour_step (n : ℕ) (x : Stage n) :
    stageColour (n + 1) (step n x) = stageColour n x
Proof
:= rfl

definition colour

TopologyByExample.MisraAllPairs.colour

The compatible colouring descends to the limit as a function of sets.

def colour : Limit → Bool
Definition
:=
  Quot.lift (fun p : Σ n, Stage n ↦ stageColour p.1 p.2) (by
    intro a b h
    cases h
    rfl)

theorem colour_toLimit

TopologyByExample.MisraAllPairs.colour_toLimit

The limit colouring has the prescribed trace on every stage.

@[simp] theorem colour_toLimit (n : ℕ) (x : Stage n) :
    colour (toLimit n x) = stageColour n x
Proof
:= rfl

theorem stageColour_advance

TopologyByExample.MisraAllPairs.stageColour_advance

Advancing to a later stage preserves colours.

theorem stageColour_advance {n m : ℕ} (h : n ≤ m) (x : Stage n) :
    stageColour m (advance h x) = stageColour n x
Proof
:= by
  simpa only [colour_toLimit] using congrArg colour (toLimit_advance h x)

theorem colour_fibre_nontrivial

TopologyByExample.MisraAllPairs.colour_fibre_nontrivial

Each colour class contains two distinct points already in the initial stage.

theorem colour_fibre_nontrivial (s : Bool) : Nontrivial {x : Limit // colour x = s}
Proof
:= by
  let a : {x : Limit // colour x = s} := ⟨toLimit 0 (MisraE0.apex s), rfl⟩
  let b : {x : Limit // colour x = s} := ⟨toLimit 0 (MisraE0.cell s ⊥ ⊥), rfl⟩
  refine ⟨⟨a, b, ?_⟩⟩
  intro h
  have he := toLimit_injective 0 (congrArg Subtype.val h)
  cases he

theorem fibre_apply_toLimit_eq

TopologyByExample.MisraAllPairs.fibre_apply_toLimit_eq

Continuous maps on a colour class identify same-coloured points of each stage.

theorem fibre_apply_toLimit_eq {Y : Type*} [TopologicalSpace Y]
    [FirstCountableTopology Y] [T1Space Y] (s : Bool)
    {f : {z : Limit // colour z = s} → Y} (hf : Continuous f)
    (n : ℕ) (x y : Stage n) (hx : stageColour n x = s) (hy : stageColour n y = s) :
    f ⟨toLimit n x, hx⟩ = f ⟨toLimit n y, hy⟩
Proof
:= by
  let g : MisraE0 → {z : Limit // colour z = s} := fun z ↦
    ⟨toLimit (n + 1) (copy allPairs (x, y) z),
      (attachColour_copy (stageColour n) x y (hx.trans hy.symm) z).trans hx⟩
  have hg : Continuous g :=
    ((continuous_toLimit (n + 1)).comp (continuous_copy allPairs (x, y))).subtype_mk _
  have he := MisraE0.apply_apex_eq (hf.comp hg)
  have hfalse : g (MisraE0.apex false) = ⟨toLimit n x, hx⟩ := by
    apply Subtype.ext
    change toLimit (n + 1) (copy allPairs (x, y) (MisraE0.apex false)) = _
    rw [copy_apex]
    exact (toLimit_step n x).symm
  have htrue : g (MisraE0.apex true) = ⟨toLimit n y, hy⟩ := by
    apply Subtype.ext
    change toLimit (n + 1) (copy allPairs (x, y) (MisraE0.apex true)) = _
    rw [copy_apex]
    exact (toLimit_step n y).symm
  change f (g (MisraE0.apex false)) = f (g (MisraE0.apex true)) at he
  rwa [hfalse, htrue] at he

theorem fibre_apply_eq

TopologyByExample.MisraAllPairs.fibre_apply_eq

Every continuous map from one colour class to a first-countable T₁ space is constant.

theorem fibre_apply_eq {Y : Type*} [TopologicalSpace Y]
    [FirstCountableTopology Y] [T1Space Y] (s : Bool)
    {f : {z : Limit // colour z = s} → Y} (hf : Continuous f)
    (x y : {z : Limit // colour z = s}) : f x = f y
Proof
:= by
  obtain ⟨⟨n, a⟩, ha⟩ := Quot.exists_rep x.val
  obtain ⟨⟨m, b⟩, hb⟩ := Quot.exists_rep y.val
  change toLimit n a = x.val at ha
  change toLimit m b = y.val at hb
  let k := max n m
  let a' := advance (Nat.le_max_left n m) a
  let b' := advance (Nat.le_max_right n m) b
  have ha' : toLimit k a' = x.val := (toLimit_advance _ a).trans ha
  have hb' : toLimit k b' = y.val := (toLimit_advance _ b).trans hb
  have hca : stageColour k a' = s := (congrArg colour ha').trans x.property
  have hcb : stageColour k b' = s := (congrArg colour hb').trans y.property
  have he := fibre_apply_toLimit_eq s hf k a' b' hca hcb
  have hxa : (⟨toLimit k a', hca⟩ : {z : Limit // colour z = s}) = x :=
    Subtype.ext ha'
  have hyb : (⟨toLimit k b', hcb⟩ : {z : Limit // colour z = s}) = y :=
    Subtype.ext hb'
  rwa [hxa, hyb] at he

instance

Each colour class is strongly connected.

instance (s : Bool) : StronglyConnectedSpace {z : Limit // colour z = s}
Proof
where
  apply_eq_apply f x y := fibre_apply_eq s f.continuous x y

instance

Both colour classes are connected and contain more than one point.

instance (s : Bool) : ConnectedSpace {z : Limit // colour z = s}
Proof
:= by
  let := colour_fibre_nontrivial s
  exact { toNonempty := inferInstance, toPreconnectedSpace := inferInstance }

theorem isConnected_colour_fibre

TopologyByExample.MisraAllPairs.isConnected_colour_fibre

Each fibre of the colouring is connected as a subset of the limit.

theorem isConnected_colour_fibre (s : Bool) : IsConnected {z : Limit | colour z = s}
Proof
:=
  isConnected_iff_connectedSpace.mpr
    (inferInstanceAs (ConnectedSpace {z : Limit // colour z = s}))

On this site: The all-pairs Misra limit: Two connected colour classes

theorem not_biconnectedSpace

TopologyByExample.MisraAllPairs.not_biconnectedSpace

The two colour classes give a partition into nondegenerate connected sets.

theorem not_biconnectedSpace : ¬BiconnectedSpace Limit
Proof
:= by
  let C : Bool → Set Limit := fun s ↦ {z | colour z = s}
  have hc (s : Bool) : IsPreconnected (C s) :=
    isPreconnected_iff_preconnectedSpace.mpr
      (inferInstanceAs (PreconnectedSpace {z : Limit // colour z = s}))
  have hn (s : Bool) : ¬(C s).Subsingleton := by
    intro h
    let := colour_fibre_nontrivial s
    obtain ⟨x, y, hxy⟩ := exists_pair_ne {z : Limit // colour z = s}
    exact hxy (Subtype.ext (h x.property y.property))
  apply not_biconnectedSpace_of_partition (hc false) (hc true) _ _ (hn false) (hn true)
  · exact Set.disjoint_left.mpr (fun z hz hz' ↦ Bool.false_ne_true (hz.symm.trans hz'))
  · apply Set.eq_univ_of_forall
    intro z
    cases h : colour z
    · exact Or.inl h
    · exact Or.inr h

On this site: The all-pairs Misra limit is not biconnected

theorem not_hasDispersionPoint

TopologyByExample.MisraAllPairs.not_hasDispersionPoint

The all-pairs limit has no dispersion point.

theorem not_hasDispersionPoint : ¬HasDispersionPoint Limit
Proof
:= by
  intro h
  let := h
  exact not_biconnectedSpace inferInstance