Lean library · module TopologyByExample.Spaces.MisraSparseRefinements

Clipped regular-open extensions in the sparse Misra limit

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
variable (e : OmegaOne → OmegaOne)

definition clippedForward

TopologyByExample.MisraSparse.clippedForward

Extend a chosen trace by tail patches clipped to a prescribed limit subset.

noncomputable def clippedForward (O : Set (Limit e)) {n m : ℕ} (U : Set (Stage e n))
    (h : n ≤ m) : Set (Stage e m)
:=
  Nat.leRecOn h (fun {k} V ↦
    (tailPatch (attachment e (layer e k)) V ⊥).set ∩ toLimit e (k + 1) ⁻¹' O) U

theorem clippedForward_self

TopologyByExample.MisraSparse.clippedForward_self

@[simp] theorem clippedForward_self (O : Set (Limit e)) (n : ℕ) (U : Set (Stage e n)) :
    clippedForward e O U (le_refl n) = U
Proof
:= Nat.leRecOn_self _

theorem clippedForward_succ

TopologyByExample.MisraSparse.clippedForward_succ

Each later clipped trace intersects a tail patch with the prescribed trace.

theorem clippedForward_succ (O : Set (Limit e)) {n m : ℕ} (U : Set (Stage e n)) (h : n ≤ m) :
    clippedForward e O U (h.trans (Nat.le_succ m)) =
      (tailPatch (attachment e (layer e m)) (clippedForward e O U h) ⊥).set ∩
        toLimit e (m + 1) ⁻¹' O
Proof
:= Nat.leRecOn_succ h _

theorem clippedForward_subset

TopologyByExample.MisraSparse.clippedForward_subset

Every clipped trace stays in the prescribed subset when the starting trace does.

theorem clippedForward_subset (O : Set (Limit e)) {n m : ℕ} {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) (h : n ≤ m) :
    clippedForward e O U h ⊆ toLimit e m ⁻¹' O
Proof
:= by
  induction m, h using Nat.le_induction with
  | base => simpa only [clippedForward_self] using hU
  | succ m h _ => rw [clippedForward_succ e O U h]; exact inter_subset_right

theorem isOpen_clippedForward

TopologyByExample.MisraSparse.isOpen_clippedForward

Clipping open traces preserves openness.

theorem isOpen_clippedForward {O : Set (Limit e)} (hO : IsOpen O) {n m : ℕ}
    {U : Set (Stage e n)} (hU : IsOpen U) (h : n ≤ m) :
    IsOpen (clippedForward e O U h)
Proof
:= by
  induction m, h using Nat.le_induction with
  | base => simpa only [clippedForward_self] using hU
  | succ m h ih =>
    rw [clippedForward_succ e O U h]
    exact (isOpen_tailPatch (attachment e (layer e m)) ih ⊥).inter
      (hO.preimage (continuous_toLimit e (m + 1)))

theorem preimage_clippedForward_succ

TopologyByExample.MisraSparse.preimage_clippedForward_succ

Clipping does not alter the preceding trace.

theorem preimage_clippedForward_succ (O : Set (Limit e)) {n m : ℕ}
    {U : Set (Stage e n)} (hU : U ⊆ toLimit e n ⁻¹' O) (h : n ≤ m) :
    step e m ⁻¹' clippedForward e O U (h.trans (Nat.le_succ m)) =
      clippedForward e O U h
Proof
:= by
  rw [clippedForward_succ e O U h]
  ext x
  change (x ∈ clippedForward e O U h ∧ toLimit e (m + 1) (step e m x) ∈ O) ↔ _
  rw [← toLimit_step]
  exact ⟨And.left, fun hx ↦ ⟨hx, clippedForward_subset e O hU h hx⟩⟩

definition clippedThread

TopologyByExample.MisraSparse.clippedThread

Use clipped traces later and inverse bonding images earlier.

noncomputable def clippedThread (O : Set (Limit e)) (n : ℕ) (U : Set (Stage e n))
    (k : ℕ) : Set (Stage e k)
:=
  if h : n ≤ k then clippedForward e O U h
  else advance e (Nat.le_of_lt (Nat.lt_of_not_ge h)) ⁻¹' U

theorem clippedThread_compatible

TopologyByExample.MisraSparse.clippedThread_compatible

The clipped traces agree along each bonding map.

theorem clippedThread_compatible (O : Set (Limit e)) (n : ℕ) {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) (k : ℕ) :
    step e k ⁻¹' clippedThread e O n U (k + 1) = clippedThread e O n U k
Proof
:= by
  by_cases h : n ≤ k
  · rw [clippedThread, dite_eq_left (h.trans (Nat.le_succ k)),
      clippedThread, dite_eq_left h, preimage_clippedForward_succ e O hU h]
  · by_cases h' : n ≤ k + 1
    · have heq : n = k + 1 := by omega
      subst n
      rw [clippedThread, dite_eq_left (le_refl (k + 1)), clippedForward_self,
        clippedThread, dite_eq_right h]
      congr 1
      funext x
      exact ((advance_succ e (le_refl k) x).trans
        (congrArg (step e k) (advance_self e k x))).symm
    · rw [clippedThread, dite_eq_right h', clippedThread, dite_eq_right h]
      ext x
      exact Iff.of_eq (congrArg (fun y ↦ y ∈ U) (advance_succ_left e (by omega) x))

definition clippedSet

TopologyByExample.MisraSparse.clippedSet

Descend the clipped traces to a subset of the limit.

noncomputable def clippedSet (O : Set (Limit e)) (n : ℕ) {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) : Set (Limit e)
Definition
:=
  Set.ofPred <| Quot.lift (fun p : Σ k, Stage e k ↦ p.2 ∈ clippedThread e O n U p.1) (by
    intro a b h
    cases h with
    | step k x =>
      exact congrArg (fun V : Set (Stage e k) ↦ x ∈ V)
        (clippedThread_compatible e O n hU k).symm)

theorem preimage_clippedSet

TopologyByExample.MisraSparse.preimage_clippedSet

The trace of the clipped subset is its thread member.

@[simp] theorem preimage_clippedSet (O : Set (Limit e)) (n k : ℕ) {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) :
    toLimit e k ⁻¹' clippedSet e O n hU = clippedThread e O n U k
Proof
:= rfl

theorem preimage_clippedSet_self

TopologyByExample.MisraSparse.preimage_clippedSet_self

The starting trace is retained exactly.

theorem preimage_clippedSet_self (O : Set (Limit e)) (n : ℕ) {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) : toLimit e n ⁻¹' clippedSet e O n hU = U
Proof
:= by
  simp [clippedThread]

theorem clippedSet_subset

TopologyByExample.MisraSparse.clippedSet_subset

The clipped subset refines the prescribed limit subset.

theorem clippedSet_subset (O : Set (Limit e)) (n : ℕ) {U : Set (Stage e n)}
    (hU : U ⊆ toLimit e n ⁻¹' O) : clippedSet e O n hU ⊆ O
Proof
:= by
  intro z
  induction z using Quot.inductionOn with
  | h p =>
    change p.2 ∈ clippedThread e O n U p.1 → toLimit e p.1 p.2 ∈ O
    unfold clippedThread
    split_ifs with h
    · intro hx
      exact clippedForward_subset e O hU h hx
    · intro hx
      have hy := hU hx
      change toLimit e n (advance e _ p.2) ∈ O at hy
      rwa [toLimit_advance] at hy

theorem isOpen_clippedSet

TopologyByExample.MisraSparse.isOpen_clippedSet

Clipped extensions of open traces inside open subsets are open.

theorem isOpen_clippedSet {O : Set (Limit e)} (hO : IsOpen O) (n : ℕ)
    {U : Set (Stage e n)} (ho : IsOpen U) (hU : U ⊆ toLimit e n ⁻¹' O) :
    IsOpen (clippedSet e O n hU)
Proof
:= by
  apply (isQuotientMap_quot_mk (r := Rel e)).isOpen_preimage.mp
  apply isOpen_sigma_iff.2
  intro k
  change IsOpen (clippedThread e O n U k)
  unfold clippedThread
  split_ifs with h
  · exact isOpen_clippedForward e hO ho h
  · exact ho.preimage (continuous_advance e _)

theorem isRegularOpen_clippedSet

TopologyByExample.MisraSparse.isRegularOpen_clippedSet

A regular-open starting trace yields a regular-open clipped extension.

theorem isRegularOpen_clippedSet {O : Set (Limit e)} (hO : IsOpen O) (n : ℕ)
    {U : Set (Stage e n)} (hr : IsRegularOpen U) (hU : U ⊆ toLimit e n ⁻¹' O) :
    IsRegularOpen (clippedSet e O n hU)
Proof
:= by
  apply isRegularOpen_of_tail_bound e (isOpen_clippedSet e hO n hr.isOpen hU) n
  · rw [preimage_clippedSet_self]
    exact hr
  · intro k h
    simp only [preimage_clippedSet, clippedThread]
    rw [dite_eq_left (h.trans (Nat.le_succ k)), dite_eq_left h, clippedForward_succ e O U h]
    exact inter_subset_left

theorem exists_clopen_refinement_new

TopologyByExample.MisraSparse.exists_clopen_refinement_new

A genuinely new point has a clopen neighbourhood inside any prescribed open set.

theorem exists_clopen_refinement_new {X ι : Type*} [TopologicalSpace X]
    (t : ι → Bool → X) (i : ι) {x : MisraE0} (hx : ∀ s, x ≠ MisraE0.apex s)
    {O : Set (Space t)} (hO : IsOpen O) (hxO : copy t i x ∈ O) :
    ∃ W : Set (Space t), IsClopen W ∧ copy t i x ∈ W ∧ W ⊆ O
Proof
:= by
  classical
  let F : Set MisraE0 := {MisraE0.apex false, MisraE0.apex true}
  have hF : IsClosed F := ((finite_singleton (MisraE0.apex true)).insert _).isClosed
  have hxF : x ∈ Fᶜ := by simp [F, hx false, hx true]
  obtain ⟨U, hU, hxU, hsub⟩ := MisraE0.exists_isClopen_subset_of_ne_apex hx
    ((hO.preimage (continuous_copy t i)).inter hF.isOpen_compl) ⟨hxO, hxF⟩
  have ha : ∀ s, MisraE0.apex s ∉ U := by
    intro s hs
    exact (hsub hs).2 (by cases s <;> simp [F])
  refine ⟨(singlePatch t i U ha).set, isClopen_singlePatch t i hU ha, ?_, ?_⟩
  · simpa [singlePatch] using hxU
  · intro z
    induction z using Quot.inductionOn with
    | h z =>
      cases z with
      | inl a => exact False.elim
      | inr p =>
        rcases p with ⟨j, y⟩
        intro hz
        change y ∈ (singlePatch t i U ha).fresh j at hz
        by_cases hj : j = i
        · subst j
          have hy : y ∈ U := by simpa [singlePatch] using hz
          exact (hsub hy).1
        · simp [singlePatch, hj] at hz

theorem exists_regularOpen_neighbourhood

TopologyByExample.MisraSparse.exists_regularOpen_neighbourhood

Every open neighbourhood in the sparse limit contains a regular-open neighbourhood.

theorem exists_regularOpen_neighbourhood {O : Set (Limit e)} (hO : IsOpen O)
    {z : Limit e} (hz : z ∈ O) :
    ∃ V : Set (Limit e), IsRegularOpen V ∧ z ∈ V ∧ V ⊆ O
Proof
:= by
  have hlift (n : ℕ) {U : Set (Stage e n)} (hr : IsRegularOpen U)
      (hsub : U ⊆ toLimit e n ⁻¹' O) {x : Stage e n} (hx : x ∈ U)
      (he : toLimit e n x = z) :
      ∃ V : Set (Limit e), IsRegularOpen V ∧ z ∈ V ∧ V ⊆ O := by
    refine ⟨clippedSet e O n hsub, isRegularOpen_clippedSet e hO n hr hsub, ?_,
      clippedSet_subset e O n hsub⟩
    rw [← he]
    change x ∈ toLimit e n ⁻¹' clippedSet e O n hsub
    exact (preimage_clippedSet_self e O n hsub).symm ▸ hx
  rcases old_or_later_birth e 0 z with ⟨x, rfl⟩ | ⟨k, hk, i, y, hy, rfl⟩
  · have hb := (inferInstance : SemiregularSpace MisraE0).isTopologicalBasis
    obtain ⟨U, hU, hx, hsub⟩ := hb.exists_subset_of_mem_open hz
      (hO.preimage (continuous_toLimit e 0))
    exact hlift 0 hU hsub hx rfl
  · cases k with
    | zero => omega
    | succ k =>
      obtain ⟨U, hU, hx, hsub⟩ := exists_clopen_refinement_new
        (attachment e (layer e k)) i hy (hO.preimage (continuous_toLimit e (k + 1))) hz
      exact hlift (k + 1) (TopologyByExample.IsClopen.isRegularOpen hU) hsub hx rfl

instance

The sparse limit has a base of regular-open subsets.

instance : SemiregularSpace (Limit e)
Proof
:= by
  refine ⟨TopologicalSpace.isTopologicalBasis_of_isOpen_of_nhds
    (fun _ hs ↦ IsRegularOpen.isOpen hs) ?_⟩
  intro z O hz hO
  obtain ⟨V, hV, hzV, hsub⟩ := exists_regularOpen_neighbourhood e hO hz
  exact ⟨V, hV, hzV, hsub⟩