Lean library Β· module TopologyByExample.Theorems.StoneCechButterflyRecursion

Transfinite construction of butterfly wings

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 exists_basic_subset

TopologyByExample.StoneCechRemainder.exists_basic_subset

Every neighbourhood in the remainder contains a basic neighbourhood.

theorem exists_basic_subset (p : Carrier) {U : Set Carrier} (hU : U ∈ 𝓝 p) :
    βˆƒ A : Set β„•, p ∈ basic A ∧ basic A βŠ† U
Proof
:= by
  rw [nhds_subtype_eq_comap] at hU
  obtain ⟨V, hV, hVU⟩ := mem_comap.mp hU
  obtain ⟨_, ⟨A, rfl⟩, hA, hAV⟩ := ultrafilterBasis_is_basis.mem_nhds_iff.mp hV
  exact ⟨A, hA, fun q hq ↦ hVU (hAV hq)⟩

definition Pair

TopologyByExample.StoneCechRemainder.Butterfly.Pair

A pair of supports for the two new pieces at one stage.

abbrev Pair
:= Set β„• Γ— Set β„•

definition Valid

TopologyByExample.StoneCechRemainder.Butterfly.Valid

The two unions of pieces already constructed are disjoint and omit the point.

def Valid (p : Carrier) {ΞΉ : Type*} (old : ΞΉ β†’ Pair) : Prop
:=
  (βˆ€ i, p βˆ‰ basic (old i).1) ∧ (βˆ€ i, p βˆ‰ basic (old i).2) ∧
    Disjoint (⋃ i, basic (old i).1) (⋃ i, basic (old i).2)

definition StepSpec

TopologyByExample.StoneCechRemainder.Butterfly.StepSpec

One extension preserves the old wings, covers outside its neighbourhood, and meets that neighbourhood on both sides.

def StepSpec (p : Carrier) (N : Set β„•) {ΞΉ : Type*} (old : ΞΉ β†’ Pair) (v : Pair) : Prop
Definition
:=
  Disjoint ((⋃ i, basic (old i).1) βˆͺ basic v.1)
    ((⋃ i, basic (old i).2) βˆͺ basic v.2) ∧
    p βˆ‰ basic v.1 ∧ p βˆ‰ basic v.2 ∧ (basic N)ᢜ βŠ† basic v.1 βˆͺ basic v.2 ∧
    (basic v.1 ∩ basic N).Nonempty ∧ (basic v.2 ∩ basic N).Nonempty

theorem exists_step

TopologyByExample.StoneCechRemainder.Butterfly.exists_step

A valid countable family always admits another extension.

theorem exists_step {ΞΉ : Type*} [Countable ΞΉ] (p : Carrier) (N : Set β„•)
    (hN : p ∈ basic N) (old : ΞΉ β†’ Pair) (hv : Valid p old) :
    βˆƒ v, StepSpec p N old v
Proof
:= by
  obtain ⟨U, V, h⟩ := butterfly_step_countable p (fun i ↦ (old i).1)
    (fun i ↦ (old i).2) hv.1 hv.2.1 hv.2.2 N hN
  exact ⟨(U, V), h⟩

definition next

TopologyByExample.StoneCechRemainder.Butterfly.next

Choose an extension whenever the preceding stages admit one.

def next (p : Carrier) (N : Set β„•) (a : OmegaOne) (old : Iio a β†’ Pair) : Pair
:= by
  classical
  exact if h : βˆƒ v, StepSpec p N old v then h.choose else (βˆ…, βˆ…)

theorem next_spec

TopologyByExample.StoneCechRemainder.Butterfly.next_spec

The choice has the required specification for valid preceding stages.

theorem next_spec (p : Carrier) (N : Set β„•) (hN : p ∈ basic N)
    (a : OmegaOne) (old : Iio a β†’ Pair) (hv : Valid p old) :
    StepSpec p N old (next p N a old)
Proof
:= by
  let : Countable (Iio a) := (OmegaOne.countable_Iio a).to_subtype
  have he := exists_step p N hN old hv
  simp only [next, dite_eq_left he]
  exact he.choose_spec

definition pieces

TopologyByExample.StoneCechRemainder.Butterfly.pieces

The pair of new pieces at every countable ordinal.

def pieces (p : Carrier) (N : OmegaOne β†’ Set β„•) : OmegaOne β†’ Pair
:=
  wellFounded_lt.fix fun a old ↦ next p (N a) a (fun b ↦ old b.val b.property)

theorem pieces_spec

TopologyByExample.StoneCechRemainder.Butterfly.pieces_spec

Every stage satisfies the extension invariant.

theorem pieces_spec (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a)) (a : OmegaOne) :
    StepSpec p (N a) (fun b : Iio a ↦ pieces p N b.val) (pieces p N a)
Proof
:= by
  refine (wellFounded_lt : WellFounded ((Β· < Β·) : OmegaOne β†’ OmegaOne β†’ Prop)).induction
    (C := fun a : OmegaOne ↦ StepSpec p (N a)
      (fun b : Iio a ↦ pieces p N b.val) (pieces p N a)) a ?_
  intro a ih
  have hv : Valid p (fun b : Iio a ↦ pieces p N b.val) := by
    refine ⟨fun b ↦ (ih b.val (mem_Iio.mp b.property)).2.1,
      fun b ↦ (ih b.val (mem_Iio.mp b.property)).2.2.1, ?_⟩
    apply disjoint_left.mpr
    intro q hqA hqB
    obtain ⟨b, hb⟩ := mem_iUnion.mp hqA
    obtain ⟨c, hc⟩ := mem_iUnion.mp hqB
    rcases lt_trichotomy b.val c.val with hbc | hbc | hcb
    Β· exact disjoint_left.mp (ih c.val (mem_Iio.mp c.property)).1
        (Or.inl (mem_iUnion.mpr ⟨⟨b.val, hbc⟩, hb⟩)) (Or.inr hc)
    Β· have he : b = c := Subtype.ext hbc
      subst c
      exact disjoint_left.mp (ih b.val (mem_Iio.mp b.property)).1 (Or.inr hb) (Or.inr hc)
    Β· exact disjoint_left.mp (ih b.val (mem_Iio.mp b.property)).1
        (Or.inr hb) (Or.inl (mem_iUnion.mpr ⟨⟨c.val, hcb⟩, hc⟩))
  conv_rhs => rw [pieces, WellFounded.fix_eq]
  exact next_spec p (N a) (hN a) a _ hv

definition leftWing

TopologyByExample.StoneCechRemainder.Butterfly.leftWing

The union of the first pieces.

def leftWing (p : Carrier) (N : OmegaOne β†’ Set β„•) : Set Carrier
:=
  ⋃ a, basic (pieces p N a).1

definition rightWing

TopologyByExample.StoneCechRemainder.Butterfly.rightWing

The union of the second pieces.

def rightWing (p : Carrier) (N : OmegaOne β†’ Set β„•) : Set Carrier
:=
  ⋃ a, basic (pieces p N a).2

theorem disjoint_pieces

TopologyByExample.StoneCechRemainder.Butterfly.disjoint_pieces

Any first piece is disjoint from any second piece.

theorem disjoint_pieces (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a)) (a b : OmegaOne) :
    Disjoint (basic (pieces p N a).1) (basic (pieces p N b).2)
Proof
:= by
  apply disjoint_left.mpr
  intro q ha hb
  rcases lt_trichotomy a b with hab | rfl | hba
  Β· exact disjoint_left.mp (pieces_spec p N hN b).1
      (Or.inl (mem_iUnion.mpr ⟨⟨a, hab⟩, ha⟩)) (Or.inr hb)
  Β· exact disjoint_left.mp (pieces_spec p N hN a).1 (Or.inr ha) (Or.inr hb)
  Β· exact disjoint_left.mp (pieces_spec p N hN a).1
      (Or.inr ha) (Or.inl (mem_iUnion.mpr ⟨⟨b, hba⟩, hb⟩))

theorem disjoint_wings

TopologyByExample.StoneCechRemainder.Butterfly.disjoint_wings

The two final wings are disjoint.

theorem disjoint_wings (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a)) : Disjoint (leftWing p N) (rightWing p N)
Proof
:= by
  apply disjoint_left.mpr
  intro q ha hb
  obtain ⟨a, ha⟩ := mem_iUnion.mp ha
  obtain ⟨b, hb⟩ := mem_iUnion.mp hb
  exact disjoint_left.mp (disjoint_pieces p N hN a b) ha hb

theorem point_notMem_wings

TopologyByExample.StoneCechRemainder.Butterfly.point_notMem_wings

Both final wings omit the point.

theorem point_notMem_wings (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a)) : p βˆ‰ leftWing p N ∧ p βˆ‰ rightWing p N
Proof
:= by
  constructor
  Β· intro hp
    obtain ⟨a, ha⟩ := mem_iUnion.mp hp
    exact (pieces_spec p N hN a).2.1 ha
  Β· intro hp
    obtain ⟨a, ha⟩ := mem_iUnion.mp hp
    exact (pieces_spec p N hN a).2.2.1 ha

theorem wings_union

TopologyByExample.StoneCechRemainder.Butterfly.wings_union

Enumerating all basic neighbourhoods makes the wings cover the punctured remainder.

theorem wings_union (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a))
    (hcover : βˆ€ A, p ∈ basic A β†’ βˆƒ a, N a = A) :
    leftWing p N βˆͺ rightWing p N = {p}ᢜ
Proof
:= by
  ext q
  constructor
  Β· intro hq he
    have heq : q = p := mem_singleton_iff.mp he
    subst q
    exact hq.elim (point_notMem_wings p N hN).1 (point_notMem_wings p N hN).2
  Β· intro hq
    have hpq : p ∈ ({q}ᢜ : Set Carrier) := by
      simpa only [mem_compl_iff, mem_singleton_iff, ne_eq, eq_comm] using hq
    obtain ⟨A, hpA, hAq⟩ := exists_basic_subset p
      (isClosed_singleton.isOpen_compl.mem_nhds hpq)
    obtain ⟨a, rfl⟩ := hcover A hpA
    have hqa : q βˆ‰ basic (N a) := fun h ↦ hAq h (mem_singleton q)
    rcases (pieces_spec p N hN a).2.2.2.1 hqa with hl | hr
    · exact Or.inl (mem_iUnion.mpr ⟨a, hl⟩)
    · exact Or.inr (mem_iUnion.mpr ⟨a, hr⟩)

theorem point_mem_closure_wings

TopologyByExample.StoneCechRemainder.Butterfly.point_mem_closure_wings

Both wings accumulate at the omitted point when every basic neighbourhood occurs.

theorem point_mem_closure_wings (p : Carrier) (N : OmegaOne β†’ Set β„•)
    (hN : βˆ€ a, p ∈ basic (N a))
    (hcover : βˆ€ A, p ∈ basic A β†’ βˆƒ a, N a = A) :
    p ∈ closure (leftWing p N) ∧ p ∈ closure (rightWing p N)
Proof
:= by
  constructor
  Β· apply mem_closure_iff_nhds.mpr
    intro U hU
    obtain ⟨A, hpA, hAU⟩ := exists_basic_subset p hU
    obtain ⟨a, rfl⟩ := hcover A hpA
    obtain ⟨q, hq, hqN⟩ := (pieces_spec p N hN a).2.2.2.2.1
    exact ⟨q, hAU hqN, mem_iUnion.mpr ⟨a, hq⟩⟩
  Β· apply mem_closure_iff_nhds.mpr
    intro U hU
    obtain ⟨A, hpA, hAU⟩ := exists_basic_subset p hU
    obtain ⟨a, rfl⟩ := hcover A hpA
    obtain ⟨q, hq, hqN⟩ := (pieces_spec p N hN a).2.2.2.2.2
    exact ⟨q, hAU hqN, mem_iUnion.mpr ⟨a, hq⟩⟩