Lean library · module TopologyByExample.Theorems.PartitionTopology

Arbitrary partition topologies

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

definition topology

TopologyByExample.PartitionTopology.topology

The partition topology whose blocks are the fibres of a map.

@[instance_reducible]
def topology (f : X → I) : TopologicalSpace X
:= .induced f ⊥

theorem isOpen_iff

TopologyByExample.PartitionTopology.isOpen_iff

Open sets are exactly unions of whole fibres.

theorem isOpen_iff (f : X → I) (s : Set X) :
    IsOpen[topology f] s ↔ ∀ x y, f x = f y → x ∈ s → y ∈ s
Proof
:= by
  constructor
  · rintro ⟨t, _, rfl⟩ x y h hx
    simpa only [mem_preimage, ← h] using hx
  · intro h
    refine ⟨f '' s, trivial, ?_⟩
    ext x
    exact ⟨fun ⟨y, hy, he⟩ ↦ h y x he hy, fun hx ↦ ⟨x, hx, rfl⟩⟩

theorem isClosed_of_isOpen

TopologyByExample.PartitionTopology.isClosed_of_isOpen

Every open set in a partition topology is closed.

theorem isClosed_of_isOpen (f : X → I) {s : Set X} (hs : IsOpen[topology f] s) :
    IsClosed[topology f] s
Proof
:= by
  let : TopologicalSpace X := topology f
  apply isOpen_compl_iff.mp
  apply (isOpen_iff f _).mpr
  intro x y h hx hy
  exact hx ((isOpen_iff f s).mp hs y x h.symm hy)

definition Block

TopologyByExample.PartitionTopology.Block

A block, equipped with the indiscrete topology.

abbrev Block (f : X → I) (i : I)
:= WithTopology {x // f x = i} ⊤

definition blockEquiv

TopologyByExample.PartitionTopology.blockEquiv

The set-theoretic identification with the disjoint union of the fibres.

def blockEquiv (f : X → I) : (Σ i, Block f i) ≃ WithTopology X (topology f)
:=
  ((Equiv.sigmaCongrRight fun i ↦ WithTopology.equiv {x // f x = i} ⊤).trans
    (Equiv.sigmaFiberEquiv f)).trans (WithTopology.equiv X (topology f)).symm

theorem indiscrete_open_iff

TopologyByExample.PartitionTopology.indiscrete_open_iff

private theorem indiscrete_open_iff {A : Type*} (s : Set (WithTopology A ⊤)) :
    IsOpen s ↔ ∀ x y, x ∈ s → y ∈ s
Proof
:= by
  rw [WithTopology.isOpen_iff, TopologicalSpace.isOpen_top_iff]
  constructor
  · rintro (h | h) x y hx
    · have : WithTopology.ofTopology x ∈ (WithTopology.toTopology ⊤ ⁻¹' s) := hx
      rw [h] at this
      exact this.elim
    · have : WithTopology.ofTopology y ∈ (WithTopology.toTopology ⊤ ⁻¹' s) := by
        rw [h]; trivial
      exact this
  · intro h
    by_cases hn : s.Nonempty
    · right
      obtain ⟨x, hx⟩ := hn
      ext y
      exact iff_true_intro (h x (WithTopology.toTopology ⊤ y) hx)
    · left
      simp only [not_nonempty_iff_eq_empty] at hn
      simp [hn]

definition blockHomeomorph

TopologyByExample.PartitionTopology.blockHomeomorph

A partition space is the topological sum of its indiscrete blocks.

def blockHomeomorph (f : X → I) : (Σ i, Block f i) ≃ₜ WithTopology X (topology f)
Definition
:=
  (blockEquiv f).toHomeomorph (by
    intro s
    rw [isOpen_sigma_iff, WithTopology.isOpen_iff, isOpen_iff]
    constructor
    · intro h x y hxy hx
      have hi := (indiscrete_open_iff _).mp (h (f x))
      exact hi (WithTopology.toTopology ⊤ ⟨x, rfl⟩)
        (WithTopology.toTopology ⊤ ⟨y, hxy.symm⟩) hx
    · intro h i
      apply (indiscrete_open_iff _).mpr
      intro x y hx
      exact h (WithTopology.ofTopology x).val (WithTopology.ofTopology y).val
        ((WithTopology.ofTopology x).property.trans (WithTopology.ofTopology y).property.symm) hx)

On this site: Theorem: A partition topology is the sum of its indiscrete blocks

theorem topology_id

TopologyByExample.PartitionTopology.topology_id

Equality classes give the discrete topology.

theorem topology_id : topology (id : X → X) = ⊥
Proof
:= by
  exact @induced_id X ⊥

theorem topology_const

TopologyByExample.PartitionTopology.topology_const

A single block gives the indiscrete topology.

theorem topology_const (i : I) : topology (fun _ : X ↦ i) = ⊤
Proof
:= by
  ext s
  rw [isOpen_iff, TopologicalSpace.isOpen_top_iff]
  constructor
  · intro h
    by_cases hs : s.Nonempty
    · right
      obtain ⟨x, hx⟩ := hs
      exact eq_univ_of_forall (fun y ↦ h x y rfl hx)
    · exact Or.inl (not_nonempty_iff_eq_empty.mp hs)
  · rintro (rfl | rfl) <;> simp

theorem oddEven_eq

TopologyByExample.PartitionTopology.oddEven_eq

The canonical odd–even topology is this fibre construction.

theorem oddEven_eq : topology (fun n : ℕ ↦ n / 2) = oddEvenTopology
Proof
:= rfl

theorem deletedInteger_eq

TopologyByExample.PartitionTopology.deletedInteger_eq

The deleted-integer topology is the partition into equal integer parts.

theorem deletedInteger_eq :
    topology (fun x : DeletedInteger.Carrier ↦ ⌊(x : ℝ)⌋) = deletedIntegerTopology
Proof
:= rfl

theorem isOpen_quotient_iff

TopologyByExample.PartitionTopology.isOpen_quotient_iff

Any equivalence relation gives the partition topology of its equivalence classes.

theorem isOpen_quotient_iff (r : Setoid X) (s : Set X) :
    IsOpen[topology (Quotient.mk r)] s ↔ ∀ x y, r x y → x ∈ s → y ∈ s
Proof
:= by
  simp only [isOpen_iff, Quotient.eq]

On this site: Theorem: Open sets in a partition topology are the saturated sets