Lean library · module TopologyByExample.Spaces.MisraInvariantNeighbourhoods

Invariant clopen neighbourhoods of non-apex points

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_invariant_neighbourhood

TopologyByExample.MisraSparse.exists_invariant_neighbourhood

Non-apex points have clopen neighbourhoods avoiding apices and invariant under all edges.

theorem exists_invariant_neighbourhood (e : OmegaOne → OmegaOne) (he : Function.Injective e)
    (x : MisraE0) (hx : ∀ s, x ≠ MisraE0.apex s) :
    ∃ U : Set MisraE0, IsClopen U ∧ x ∈ U ∧ (∀ s, MisraE0.apex s ∉ U) ∧
      ∀ i, printedTargets e i false ∈ U ↔ printedTargets 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
  have hp {U : Set MisraE0}
      (h : ∀ i : Edge, targets e i false ∈ U ↔ targets e i true ∈ U) :
      ∀ i, printedTargets e i false ∈ U ↔ printedTargets e i true ∈ U := by
    intro i
    cases hi : i.2.1
    · simpa [printedTargets, hi] using (h i).symm
    · simpa [printedTargets, hi] using h i
  cases x with
  | apex s => exact False.elim (hx s rfl)
  | cell s α β =>
    obtain ⟨C, hC, hβ, hCf⟩ := exists_countable_invariant_of_injective f hf β
    let U : Set MisraE0 := MisraE0.cell s α '' 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 ⟨t, δ⟩
        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 s α hC, ⟨β, hβ, rfl⟩,
      fun t ↦ by simp [U], hp ?_⟩
    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
  | row α =>
    obtain ⟨C, hC, hα, hCf⟩ := exists_countable_invariant_of_injective f hf α
    let : Countable C := hC.to_subtype
    let U : Set MisraE0 := ⋃ γ : C, MisraE0.rowNhd γ
    have hclosed : IsClosed U := by
      apply isOpen_compl_iff.1
      simpa only [U, compl_iUnion] using
        PSpace.isOpen_iInter (fun γ : C ↦ (MisraE0.rowNhd γ)ᶜ)
          (fun γ ↦ (MisraE0.isClosed_rowNhd γ).isOpen_compl)
    have hrow (γ : OmegaOne) : MisraE0.row γ ∈ U ↔ γ ∈ C := by
      simp [U, MisraE0.rowNhd]
    have hcell (s : Bool) (γ δ : OmegaOne) : MisraE0.cell s γ δ ∈ U ↔ γ ∈ C := by
      cases s <;> simp [U, MisraE0.rowNhd]
    refine ⟨U, ⟨hclosed, isOpen_iUnion (fun γ : C ↦ MisraE0.isOpen_rowNhd γ)⟩,
      (hrow α).2 hα, fun s ↦ by simp [U, MisraE0.rowNhd], hp ?_⟩
    rintro ⟨d, b, β⟩
    cases d with
    | none =>
      simpa [targets, strand, f, ite_apply] using
        (hrow β).trans ((hCf b β).symm.trans (hrow (f b β)).symm)
    | some p =>
      rcases p with ⟨s, γ⟩
      simp [targets, strand, hcell]