Lean library · module TopologyByExample.Spaces.MisraE0

Misra's Hausdorff semiregular P-space

Source file

The two sheets have isolated cells indexed by pairs of countable ordinals. A row point has cocountable tails in both sheets. Each of two apex points has cocountable tails in all rows above some countable ordinal, on its own sheet.

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

inductive type MisraE0

TopologyByExample.MisraE0

The points of Misra's space E₀.

inductive MisraE0
  | apex (side : Bool)
  | row (α : OmegaOne)
  | cell (side : Bool) (α β : OmegaOne)

On this site: Space: Misra’s \(E_0\)

definition RowLarge

TopologyByExample.MisraE0.RowLarge

A set contains a cocountable part of one row of one sheet.

def RowLarge (U : Set MisraE0) (s : Bool) (α : OmegaOne) : Prop
:=
  {β : OmegaOne | cell s α β ∉ U}.Countable

theorem mono

TopologyByExample.MisraE0.RowLarge.mono

Enlarging a row-large set preserves row largeness.

theorem RowLarge.mono {U V : Set MisraE0} {s : Bool} {α : OmegaOne}
    (h : RowLarge U s α) (hUV : U ⊆ V) : RowLarge V s α
Proof
:= by
  apply Set.Countable.mono (s₂ := {β : OmegaOne | cell s α β ∉ U}) ?_ h
  intro β hn hmem
  exact hn (hUV hmem)

theorem inter

TopologyByExample.MisraE0.RowLarge.inter

Intersections of two row-large sets are row-large.

theorem RowLarge.inter {U V : Set MisraE0} {s : Bool} {α : OmegaOne}
    (hU : RowLarge U s α) (hV : RowLarge V s α) : RowLarge (U ∩ V) s α
Proof
:= by
  apply (hU.union hV).mono
  intro β h
  simp only [mem_union, mem_ofPred_eq, mem_inter_iff] at *
  tauto

theorem iInter

TopologyByExample.MisraE0.RowLarge.iInter

Countable intersections preserve row largeness.

theorem RowLarge.iInter {ι : Type*} [Countable ι] {U : ι → Set MisraE0}
    {s : Bool} {α : OmegaOne} (h : ∀ i, RowLarge (U i) s α) :
    RowLarge (⋂ i, U i) s α
Proof
:= by
  have heq : {β : OmegaOne | cell s α β ∉ ⋂ i, U i} =
      ⋃ i, {β : OmegaOne | cell s α β ∉ U i} := by
    ext β
    simp
  rw [RowLarge, heq]
  exact countable_iUnion h

definition OpenCondition

TopologyByExample.MisraE0.OpenCondition

The neighbourhood conditions for an open set.

def OpenCondition (U : Set MisraE0) : Prop
:=
  (∀ α, row α ∈ U → ∀ s, RowLarge U s α) ∧
  (∀ s, apex s ∈ U → ∃ δ : OmegaOne, ∀ α, δ < α → RowLarge U s α)

instance

instance : TopologicalSpace MisraE0
Proof
where
  IsOpen := OpenCondition
  isOpen_univ := by
    have h (s : Bool) (α : OmegaOne) : RowLarge univ s α := by
      simp [RowLarge]
    exact ⟨fun α _ s ↦ h s α, fun s _ ↦ ⟨⊥, fun α _ ↦ h s α⟩⟩
  isOpen_inter := by
    intro U V hU hV
    constructor
    · intro α hα s
      exact (hU.1 α hα.1 s).inter (hV.1 α hα.2 s)
    · intro s hs
      obtain ⟨δ, hδ⟩ := hU.2 s hs.1
      obtain ⟨ε, hε⟩ := hV.2 s hs.2
      exact ⟨max δ ε, fun α hα ↦
        (hδ α (lt_of_le_of_lt (le_max_left _ _) hα)).inter
          (hε α (lt_of_le_of_lt (le_max_right _ _) hα))⟩
  isOpen_sUnion := by
    intro S hS
    constructor
    · intro α hα s
      obtain ⟨U, hUS, hαU⟩ := hα
      exact (hS U hUS).1 α hαU s |>.mono (subset_sUnion_of_mem hUS)
    · intro s hs
      obtain ⟨U, hUS, hsU⟩ := hs
      obtain ⟨δ, hδ⟩ := (hS U hUS).2 s hsU
      exact ⟨δ, fun α hα ↦ (hδ α hα).mono (subset_sUnion_of_mem hUS)⟩

theorem isOpen_iff

TopologyByExample.MisraE0.isOpen_iff

The defined topology is exactly the row and apex neighbourhood condition.

theorem isOpen_iff (U : Set MisraE0) : IsOpen U ↔ OpenCondition U
Proof
:= Iff.rfl

theorem isOpen_iInter_countable

TopologyByExample.MisraE0.isOpen_iInter_countable

Countable intersections of open subsets are open.

theorem isOpen_iInter_countable {ι : Type*} [Countable ι] (U : ι → Set MisraE0)
    (hU : ∀ i, IsOpen (U i)) : IsOpen (⋂ i, U i)
Proof
:= by
  constructor
  · intro α hα s
    exact RowLarge.iInter fun i ↦ (hU i).1 α (mem_iInter.1 hα i) s
  · intro s hs
    choose δ hδ using fun i ↦ (hU i).2 s (mem_iInter.1 hs i)
    obtain ⟨ε, hε⟩ := OmegaOne.bddAbove_of_countable (countable_range δ)
    refine ⟨ε, fun α hα ↦ RowLarge.iInter fun i ↦ ?_⟩
    exact hδ i α (lt_of_le_of_lt (hε (mem_range_self i)) hα)

instance

instance : PSpace MisraE0
Proof
where
  isOpen_of_isGδ U hU := by
    obtain ⟨V, hVo, rfl⟩ := hU.eq_iInter_nat
    exact isOpen_iInter_countable V hVo

instance

instance : Nonempty MisraE0
Proof
:= ⟨apex false⟩

theorem isOpen_singleton_cell

TopologyByExample.MisraE0.isOpen_singleton_cell

Every cell is isolated.

theorem isOpen_singleton_cell (s : Bool) (α β : OmegaOne) :
    IsOpen ({cell s α β} : Set MisraE0)
Proof
:= by
  constructor <;> simp

theorem rowLarge_compl_singleton

TopologyByExample.MisraE0.rowLarge_compl_singleton

Deleting any one point leaves a row-large set in every row.

theorem rowLarge_compl_singleton (x : MisraE0) (s : Bool) (α : OmegaOne) :
    RowLarge {x}ᶜ s α
Proof
:= by
  have hinj : Function.Injective (cell s α) := fun _ _ h ↦ (cell.inj h).2.2
  unfold RowLarge
  convert (countable_singleton x).preimage hinj using 1
  ext β
  simp

instance

instance : T1Space MisraE0
Proof
where
  t1 x := isOpen_compl_iff.1 (show IsOpen {x}ᶜ from
    ⟨fun α _ s ↦ rowLarge_compl_singleton x s α,
      fun s _ ↦ ⟨⊥, fun α _ ↦ rowLarge_compl_singleton x s α⟩⟩)

definition rowNhd

TopologyByExample.MisraE0.rowNhd

A neighbourhood consisting of an entire row in both sheets and its row point.

def rowNhd (α : OmegaOne) : Set MisraE0
:=
  {row α} ∪ {x | ∃ s β, x = cell s α β}

definition apexNhd

TopologyByExample.MisraE0.apexNhd

A neighbourhood of an apex containing all cells above a fixed row.

def apexNhd (s : Bool) (δ : OmegaOne) : Set MisraE0
:=
  {apex s} ∪ {x | ∃ α β, δ < α ∧ x = cell s α β}

theorem isOpen_rowNhd

TopologyByExample.MisraE0.isOpen_rowNhd

Whole-row neighbourhoods are open.

theorem isOpen_rowNhd (α : OmegaOne) : IsOpen (rowNhd α)
Proof
:= by
  constructor
  · intro γ hγ s
    have hγα : γ = α := by simpa [rowNhd] using hγ
    subst γ
    simp [RowLarge, rowNhd]
  · simp [rowNhd]

theorem isOpen_apexNhd

TopologyByExample.MisraE0.isOpen_apexNhd

Apex tail neighbourhoods are open.

theorem isOpen_apexNhd (s : Bool) (δ : OmegaOne) : IsOpen (apexNhd s δ)
Proof
:= by
  constructor
  · simp [apexNhd]
  · intro t ht
    have hts : t = s := by simpa [apexNhd] using ht
    subst t
    refine ⟨δ, fun α hα ↦ ?_⟩
    simp [RowLarge, apexNhd, hα]

theorem disjoint_rowNhd

TopologyByExample.MisraE0.disjoint_rowNhd

Distinct rows have disjoint whole-row neighbourhoods.

theorem disjoint_rowNhd {α γ : OmegaOne} (h : α ≠ γ) :
    Disjoint (rowNhd α) (rowNhd γ)
Proof
:= by
  apply disjoint_left.2
  intro x hx hy
  cases x <;> simp_all [rowNhd]
  aesop

theorem disjoint_apexNhd_rowNhd

TopologyByExample.MisraE0.disjoint_apexNhd_rowNhd

A tail above a row misses that whole row.

theorem disjoint_apexNhd_rowNhd (s : Bool) (α : OmegaOne) :
    Disjoint (apexNhd s α) (rowNhd α)
Proof
:= by
  apply disjoint_left.2
  intro x hx hy
  cases x <;> simp_all [rowNhd, apexNhd]
  aesop

theorem disjoint_apexNhd

TopologyByExample.MisraE0.disjoint_apexNhd

Neighbourhoods on different sheets are disjoint.

theorem disjoint_apexNhd {s t : Bool} (h : s ≠ t) (δ ε : OmegaOne) :
    Disjoint (apexNhd s δ) (apexNhd t ε)
Proof
:= by
  apply disjoint_left.2
  intro x hx hy
  cases x <;> simp_all [apexNhd]

instance

instance : T2Space MisraE0
Proof
where
  t2 x y hxy := by
    cases x with
    | cell s α β =>
      exact ⟨{cell s α β}, {cell s α β}ᶜ, isOpen_singleton_cell s α β,
        isClosed_singleton.isOpen_compl, rfl, hxy.symm, disjoint_compl_right⟩
    | apex s =>
      cases y with
      | cell t α β =>
        exact ⟨{cell t α β}ᶜ, {cell t α β}, isClosed_singleton.isOpen_compl,
          isOpen_singleton_cell t α β, hxy, rfl, disjoint_compl_left⟩
      | apex t =>
        refine ⟨apexNhd s ⊥, apexNhd t ⊥, isOpen_apexNhd s ⊥,
          isOpen_apexNhd t ⊥, ?_, ?_, disjoint_apexNhd (fun h ↦ hxy (congrArg apex h)) _ _⟩
        · simp [apexNhd]
        · simp [apexNhd]
      | row α =>
        refine ⟨apexNhd s α, rowNhd α, isOpen_apexNhd s α, isOpen_rowNhd α,
          ?_, ?_, disjoint_apexNhd_rowNhd s α⟩
        · simp [apexNhd]
        · simp [rowNhd]
    | row α =>
      cases y with
      | cell t γ β =>
        exact ⟨{cell t γ β}ᶜ, {cell t γ β}, isClosed_singleton.isOpen_compl,
          isOpen_singleton_cell t γ β, hxy, rfl, disjoint_compl_left⟩
      | apex t =>
        refine ⟨rowNhd α, apexNhd t α, isOpen_rowNhd α, isOpen_apexNhd t α,
          ?_, ?_, (disjoint_apexNhd_rowNhd t α).symm⟩
        · simp [rowNhd]
        · simp [apexNhd]
      | row γ =>
        refine ⟨rowNhd α, rowNhd γ, isOpen_rowNhd α, isOpen_rowNhd γ,
          ?_, ?_, disjoint_rowNhd (fun h ↦ hxy (congrArg row h))⟩
        · simp [rowNhd]
        · simp [rowNhd]

theorem exists_mem_inter

TopologyByExample.MisraE0.RowLarge.exists_mem_inter

Two cocountable subsets of the same uncountable row meet.

theorem RowLarge.exists_mem_inter {U V : Set MisraE0} {s : Bool} {α : OmegaOne}
    (hU : RowLarge U s α) (hV : RowLarge V s α) :
    ∃ β, cell s α β ∈ U ∧ cell s α β ∈ V
Proof
:= by
  classical
  by_contra h
  push Not at h
  apply not_countable_univ (α := OmegaOne)
  apply (hU.union hV).mono
  intro β _
  by_cases hβ : cell s α β ∈ U
  · exact Or.inr (h β hβ)
  · exact Or.inl hβ

theorem row_mem_closure

TopologyByExample.MisraE0.row_mem_closure

A row-large set accumulates at the corresponding row point.

theorem row_mem_closure {U : Set MisraE0} {s : Bool} {α : OmegaOne}
    (hU : RowLarge U s α) : row α ∈ closure U
Proof
:= by
  apply mem_closure_iff.2
  intro V hV hαV
  obtain ⟨β, hβU, hβV⟩ := hU.exists_mem_inter (hV.1 α hαV s)
  exact ⟨cell s α β, hβV, hβU⟩

theorem exists_tail_rows_mem_closure

TopologyByExample.MisraE0.exists_tail_rows_mem_closure

An open apex neighbourhood accumulates at every row point above some ordinal.

theorem exists_tail_rows_mem_closure {U : Set MisraE0} {s : Bool}
    (hU : IsOpen U) (hs : apex s ∈ U) :
    ∃ δ : OmegaOne, ∀ α, δ < α → row α ∈ closure U
Proof
:= by
  obtain ⟨δ, hδ⟩ := hU.2 s hs
  exact ⟨δ, fun α hα ↦ row_mem_closure (hδ α hα)⟩

theorem not_t25Space

TopologyByExample.MisraE0.not_t25Space

The two apex points cannot have neighbourhoods with disjoint closures.

theorem not_t25Space : ¬T25Space MisraE0
Proof
:= by
  intro h
  let := h
  obtain ⟨U, haU, hU, V, hbV, hV, hUV⟩ :=
    exists_open_nhds_disjoint_closure (show apex false ≠ apex true by simp)
  obtain ⟨δ, hδ⟩ := exists_tail_rows_mem_closure hU haU
  obtain ⟨ε, hε⟩ := exists_tail_rows_mem_closure hV hbV
  obtain ⟨α, hα⟩ := exists_gt (max δ ε)
  exact disjoint_left.1 hUV
    (hδ α (lt_of_le_of_lt (le_max_left _ _) hα))
    (hε α (lt_of_le_of_lt (le_max_right _ _) hα))

On this site: Misra’s \(E_0\) is not Urysohn

theorem cell_mem_closure_iff

TopologyByExample.MisraE0.cell_mem_closure_iff

An isolated cell belongs to a closure exactly when it belongs to the set.

theorem cell_mem_closure_iff (s : Bool) (α β : OmegaOne) (U : Set MisraE0) :
    cell s α β ∈ closure U ↔ cell s α β ∈ U
Proof
:= by
  refine ⟨fun h ↦ ?_, fun h ↦ subset_closure h⟩
  have hne := mem_closure_iff.1 h _ (isOpen_singleton_cell s α β) (mem_singleton _)
  simpa only [singleton_inter_nonempty] using hne

theorem isClosed_rowNhd

TopologyByExample.MisraE0.isClosed_rowNhd

A whole row together with its row point is closed.

theorem isClosed_rowNhd (α : OmegaOne) : IsClosed (rowNhd α)
Proof
:= by
  apply isOpen_compl_iff.1
  constructor
  · intro γ hγ s
    have hne : γ ≠ α := by simpa [rowNhd] using hγ
    simp [RowLarge, rowNhd, hne]
  · intro s _
    refine ⟨α, fun γ hγ ↦ ?_⟩
    have hne : γ ≠ α := ne_of_gt hγ
    simp [RowLarge, rowNhd, hne]

theorem isClopen_row_inter

TopologyByExample.MisraE0.isClopen_row_inter

Intersecting an open row-point neighbourhood with its whole row gives a clopen set.

theorem isClopen_row_inter {U : Set MisraE0} {α : OmegaOne}
    (hU : IsOpen U) (hα : row α ∈ U) : IsClopen (U ∩ rowNhd α)
Proof
:= by
  refine ⟨isClosed_of_closure_subset ?_, hU.inter (isOpen_rowNhd α)⟩
  intro x hx
  have hr : x ∈ rowNhd α := (closure_minimal inter_subset_right (isClosed_rowNhd α)) hx
  cases x with
  | apex s => simp [rowNhd] at hr
  | row γ =>
    have heq : γ = α := by simpa [rowNhd] using hr
    subst γ
    exact ⟨hα, hr⟩
  | cell s γ β => exact (cell_mem_closure_iff s γ β _).1 hx

definition apexPart

TopologyByExample.MisraE0.apexPart

The portion of a neighbourhood on one sheet, together with that sheet's apex.

def apexPart (s : Bool) (U : Set MisraE0) : Set MisraE0
Definition
:=
  {x | match x with
    | apex t => t = s
    | row _ => False
    | cell t _ _ => t = s ∧ x ∈ U}

theorem isOpen_apexPart

TopologyByExample.MisraE0.isOpen_apexPart

The single-sheet portion of an apex neighbourhood is open.

theorem isOpen_apexPart {s : Bool} {U : Set MisraE0}
    (hU : IsOpen U) (hs : apex s ∈ U) : IsOpen (apexPart s U)
Proof
:= by
  constructor
  · simp [apexPart]
  · intro t ht
    have hts : t = s := ht
    subst t
    obtain ⟨δ, hδ⟩ := hU.2 s hs
    refine ⟨δ, fun α hα ↦ ?_⟩
    simpa only [RowLarge, apexPart, mem_ofPred_eq, true_and] using hδ α hα

theorem apex_not_mem_closure_apexPart

TopologyByExample.MisraE0.apex_not_mem_closure_apexPart

The opposite apex is not in the closure of a single-sheet portion.

theorem apex_not_mem_closure_apexPart {s t : Bool} (hst : t ≠ s) (U : Set MisraE0) :
    apex t ∉ closure (apexPart s U)
Proof
:= by
  intro h
  obtain ⟨x, hx, hy⟩ := mem_closure_iff.1 h _ (isOpen_apexNhd t ⊥)
    (show apex t ∈ apexNhd t ⊥ by simp [apexNhd])
  cases x <;> simp_all [apexNhd, apexPart]

theorem row_not_mem_interior_closure_apexPart

TopologyByExample.MisraE0.row_not_mem_interior_closure_apexPart

A row point cannot be interior to the closure of a single-sheet portion.

theorem row_not_mem_interior_closure_apexPart (s : Bool) (α : OmegaOne)
    (U : Set MisraE0) : row α ∉ interior (closure (apexPart s U))
Proof
:= by
  intro h
  have hopen : IsOpen (interior (closure (apexPart s U))) := isOpen_interior
  have hlarge := hopen.1 α h (!s)
  have hall : RowLarge univ (!s) α := by simp [RowLarge]
  obtain ⟨β, hβ, _⟩ := hlarge.exists_mem_inter hall
  have hc := (cell_mem_closure_iff (!s) α β _).1 (interior_subset hβ)
  simp [apexPart] at hc

theorem isRegularOpen_apexPart

TopologyByExample.MisraE0.isRegularOpen_apexPart

The single-sheet portion of an apex neighbourhood is regular open.

theorem isRegularOpen_apexPart {s : Bool} {U : Set MisraE0}
    (hU : IsOpen U) (hs : apex s ∈ U) : IsRegularOpen (apexPart s U)
Proof
:= by
  apply isRegularOpen_iff.2
  apply Subset.antisymm
  · intro x hx
    cases x with
    | cell t α β => exact (cell_mem_closure_iff t α β _).1 (interior_subset hx)
    | row α => exact (row_not_mem_interior_closure_apexPart s α U hx).elim
    | apex t =>
      by_cases hts : t = s
      · exact hts
      · exact (apex_not_mem_closure_apexPart hts U (interior_subset hx)).elim
  · exact interior_maximal subset_closure (isOpen_apexPart hU hs)

instance

instance : SemiregularSpace MisraE0
Proof
:= by
  rw [semiregularSpace_iff_isRegularOpen]
  refine isTopologicalBasis_of_isOpen_of_nhds (fun _ hs ↦ IsRegularOpen.isOpen hs)
    fun x U hx hU ↦ ?_
  cases x with
  | cell s α β =>
    exact ⟨{cell s α β}, TopologyByExample.IsClopen.isRegularOpen
      ⟨isClosed_singleton, isOpen_singleton_cell s α β⟩,
      mem_singleton _, singleton_subset_iff.2 hx⟩
  | row α =>
    exact ⟨U ∩ rowNhd α, TopologyByExample.IsClopen.isRegularOpen (isClopen_row_inter hU hx),
      ⟨hx, by simp [rowNhd]⟩, inter_subset_left⟩
  | apex s =>
    refine ⟨apexPart s U, isRegularOpen_apexPart hU hx, rfl, ?_⟩
    intro y hy
    cases y with
    | apex t => exact (show t = s from hy) ▸ hx
    | row α => exact hy.elim
    | cell t α β => exact hy.2

theorem exists_isClopen_subset_of_ne_apex

TopologyByExample.MisraE0.exists_isClopen_subset_of_ne_apex

Every non-apex point has clopen refinements of its open neighbourhoods.

theorem exists_isClopen_subset_of_ne_apex {x : MisraE0}
    (hx : ∀ s, x ≠ apex s) {U : Set MisraE0} (hU : IsOpen U) (hxU : x ∈ U) :
    ∃ V : Set MisraE0, IsClopen V ∧ x ∈ V ∧ V ⊆ U
Proof
:= by
  cases x with
  | apex s => exact (hx s rfl).elim
  | row α =>
    exact ⟨U ∩ rowNhd α, isClopen_row_inter hU hxU,
      ⟨hxU, by simp [rowNhd]⟩, inter_subset_left⟩
  | cell s α β =>
    exact ⟨{cell s α β}, ⟨isClosed_singleton, isOpen_singleton_cell s α β⟩,
      mem_singleton _, singleton_subset_iff.2 hxU⟩

definition rowTail

TopologyByExample.MisraE0.rowTail

A row neighbourhood with a common set of omitted column indices.

def rowTail (α : OmegaOne) (C : Set OmegaOne) : Set MisraE0
:=
  {row α} ∪ {x | ∃ s β, β ∉ C ∧ x = cell s α β}

theorem isOpen_rowTail

TopologyByExample.MisraE0.isOpen_rowTail

Deleting countably many indices from a row neighbourhood leaves it open.

theorem isOpen_rowTail (α : OmegaOne) {C : Set OmegaOne} (hC : C.Countable) :
    IsOpen (rowTail α C)
Proof
:= by
  constructor
  · intro γ hγ s
    have heq : γ = α := by simpa [rowTail] using hγ
    subst γ
    have hbad : {β : OmegaOne | cell s α β ∉ rowTail α C} = C := by
      ext β
      cases s <;> simp [rowTail]
    unfold RowLarge
    rw [hbad]
    exact hC
  · simp [rowTail]