Lean library · module TopologyByExample.Theorems.FilterAttachment

Spaces obtained by attaching filter limits to a discrete set

Source file

This construction supplies the topology underlying ladder-system spaces. No existence principle for ladder systems is assumed here.

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
variable {B I : Type*}

inductive type Space

TopologyByExample.FilterAttachment.Space

A discrete lower layer and a layer of points attached along filters.

inductive Space (F : I → Filter B) where
  | lower : B → Space F
  | upper : I → Space F

instance

instance (F : I → Filter B) : TopologicalSpace (Space F)
Proof
where
  IsOpen U := ∀ i, Space.upper i ∈ U → Space.lower ⁻¹' U ∈ F i
  isOpen_univ := fun _ _ ↦ Filter.univ_mem
  isOpen_inter U V hU hV i hi := Filter.inter_mem (hU i hi.1) (hV i hi.2)
  isOpen_sUnion S hS i hi := by
    obtain ⟨U, hUS, hiU⟩ := hi
    exact mem_of_superset (hS U hUS i hiU) (preimage_mono (subset_sUnion_of_mem hUS))

definition basic

TopologyByExample.FilterAttachment.basic

A basic neighbourhood of an upper point.

def basic (F : I → Filter B) (i : I) (s : Set B) : Set (Space F)
:=
  Space.lower '' s ∪ {Space.upper i}

theorem isOpen_basic

TopologyByExample.FilterAttachment.isOpen_basic

A filter member gives an open basic neighbourhood.

theorem isOpen_basic (F : I → Filter B) (i : I) {s : Set B} (hs : s ∈ F i) :
    IsOpen (basic F i s)
Proof
:= by
  intro j hj
  have hji : j = i := by simpa [basic] using hj
  subst j
  have he : Space.lower ⁻¹' basic F i s = s := by
    ext b
    simp [basic]
  rw [he]
  exact hs

theorem isOpen_singleton_lower

TopologyByExample.FilterAttachment.isOpen_singleton_lower

Every lower-layer point is isolated.

theorem isOpen_singleton_lower (F : I → Filter B) (b : B) :
    IsOpen ({Space.lower b} : Set (Space F))
Proof
:= by
  intro i hi
  simp at hi

theorem isClosed_upper

TopologyByExample.FilterAttachment.isClosed_upper

Every subset of the upper layer is closed.

theorem isClosed_upper (F : I → Filter B) (s : Set I) :
    IsClosed (Space.upper '' s : Set (Space F))
Proof
:= by
  rw [← isOpen_compl_iff]
  intro i hi
  have he : Space.lower ⁻¹' (Space.upper '' s : Set (Space F))ᶜ = univ := by
    ext b
    simp
  rw [he]
  exact Filter.univ_mem

instance

The attached-filter space is scattered, with at most two nonempty derivative layers.

instance (F : I → Filter B) : ScatteredSpace (Space F)
Proof
:= by
  apply scatteredSpace_iff_exists_isolated.mpr
  intro s hs
  by_cases hlow : ∃ b : B, Space.lower b ∈ s
  · obtain ⟨b, hb⟩ := hlow
    exact ⟨Space.lower b, hb, {Space.lower b},
      (isOpen_singleton_lower F b).mem_nhds (mem_singleton _), inter_subset_left⟩
  · obtain ⟨x, hx⟩ := hs
    cases x with
    | lower b => exact (hlow ⟨b, hx⟩).elim
    | upper i =>
      refine ⟨Space.upper i, hx, basic F i univ,
        (isOpen_basic F i Filter.univ_mem).mem_nhds (Or.inr rfl), ?_⟩
      rintro y ⟨hy, hys⟩
      rcases hy with ⟨b, _, rfl⟩ | hy
      · exact (hlow ⟨b, hys⟩).elim
      · exact hy

theorem exists_eventual_domination

TopologyByExample.FilterAttachment.exists_eventual_domination

Countable metacompactness bounds every natural-valued upper-layer label by a natural-valued function on the lower layer, eventually along each attaching filter.

theorem exists_eventual_domination (F : I → Filter B)
    [CountablyMetacompactSpace (Space F)] (g : I → ℕ) :
    ∃ f : B → ℕ, ∀ i, {b | g i < f b} ∈ F i
Proof
:= by
  classical
  let D : ℕ → Set (Space F) := fun n ↦ Space.upper '' {i | n ≤ g i}
  have hclosed (n : ℕ) : IsClosed (D n) := isClosed_upper F _
  have hanti : Antitone D := fun n m hnm ↦ image_mono (fun i hi ↦ hnm.trans hi)
  have hempty : ⋂ n, D n = ∅ := by
    apply eq_empty_of_forall_notMem
    intro x hx
    obtain ⟨i, _, rfl⟩ := mem_iInter.mp hx 0
    have h := mem_iInter.mp hx (g i + 1)
    simp [D] at h
  obtain ⟨G, hGo, hDG, hG⟩ :=
    exists_open_supersets_of_countablyMetacompactSpace D hclosed hanti hempty
  have hex (b : B) : ∃ n, (Space.lower b : Space F) ∉ G n := by
    by_contra h
    push Not at h
    have hb : (Space.lower b : Space F) ∈ ⋂ n, G n := mem_iInter.mpr h
    simp [hG] at hb
  let f : B → ℕ := fun b ↦ Nat.find (hex b)
  refine ⟨f, fun i ↦ ?_⟩
  have htrace (k : Fin (g i + 1)) : Space.lower ⁻¹' G k ∈ F i :=
    hGo k i (hDG k ⟨i, Nat.le_of_lt_succ k.isLt, rfl⟩)
  have hinter : (⋂ k : Fin (g i + 1), Space.lower ⁻¹' G k) ∈ F i :=
    Filter.iInter_mem.mpr htrace
  apply mem_of_superset hinter
  intro b hb
  by_contra hlt
  have hle : f b ≤ g i := le_of_not_gt hlt
  exact Nat.find_spec (hex b) (mem_iInter.mp hb ⟨f b, Nat.lt_succ_of_le hle⟩)