Lean library · module TopologyByExample.Spaces.BingExampleG
Bing's Example G and Michael's closed subspace
A point is the support of a binary vector indexed by subsets of the real line. Principal evaluations keep the finite-coordinate neighbourhoods of the cube. All other points are isolated. Michael's subspace consists of the principal evaluations and the finite supports.
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
definition Coord
TopologyByExample.BingExampleG.Coord
A coordinate in Bing's binary cube.
abbrev Coord
:= Set ℝ
structure Space
TopologyByExample.BingExampleG.Space
The full binary cube, represented by the set of coordinates taking value one.
@[ext] structure Space where
/-- The coordinates at which this point takes value one. -/
support : Set Coord
On this site: Space: Bing's Example G
definition point
TopologyByExample.BingExampleG.point
The principal evaluation at a real number.
def point (r : ℝ) : Space
:= ⟨{q | r ∈ q}⟩
theorem point_injective
TopologyByExample.BingExampleG.point_injective
Distinct real labels give distinct principal evaluations.
theorem point_injective : Function.Injective point
theorem not_countable_support_point
TopologyByExample.BingExampleG.not_countable_support_point
Every principal evaluation has uncountably many nonzero coordinates.
theorem not_countable_support_point (r : ℝ) : ¬ (point r).support.Countable
Proof
:= by
intro h
have hf : Function.Injective (fun a : ℝ ↦ ({r, a} : Coord)) := by
intro a b he
rcases pair_eq_pair_iff.1 he with he | he <;> grind
have hh := h.preimage hf
have he : (fun a : ℝ ↦ ({r, a} : Coord)) ⁻¹' (point r).support = univ := by
ext x
simp [point]
exact not_countable_univ (he ▸ hh)
definition cyl
TopologyByExample.BingExampleG.cyl
A finite-coordinate cylinder, with coordinates equal to those of its centre.
def cyl (x : Space) (f : Finset Coord) : Set Space
:=
{y | ∀ q ∈ f, q ∈ y.support ↔ q ∈ x.support}
theorem mem_cyl_self
TopologyByExample.BingExampleG.mem_cyl_self
A vector belongs to each cylinder centred at it.
theorem mem_cyl_self (x : Space) (f : Finset Coord) : x ∈ cyl x f
Proof
:= fun _ _ ↦ Iff.rfl
theorem cyl_anti
TopologyByExample.BingExampleG.cyl_anti
Specifying more coordinates makes the cylinder smaller.
theorem cyl_anti {x : Space} {f g : Finset Coord} (h : f ⊆ g) : cyl x g ⊆ cyl x f
Proof
:=
fun _ hy q hq ↦ hy q (h hq)
theorem cyl_trans
TopologyByExample.BingExampleG.cyl_trans
Agreement on the same finite coordinates is transitive.
theorem cyl_trans {x y z : Space} {f : Finset Coord} (hy : y ∈ cyl x f) (hz : z ∈ cyl y f) :
z ∈ cyl x f
Proof
:= fun q hq ↦ (hz q hq).trans (hy q hq)
definition basic
TopologyByExample.BingExampleG.basic
The basic neighbourhoods are cylinders at principal points, and singletons elsewhere.
def basic (x : Space) (f : Finset Coord) : Set Space
:= by
classical exact if x ∈ range point then cyl x f else {x}
theorem basic_point
TopologyByExample.BingExampleG.basic_point
Principal points retain their finite-coordinate cylinders.
theorem basic_point (r : ℝ) (f : Finset Coord) : basic (point r) f = cyl (point r) f
Proof
:= by
simp [basic]
theorem basic_other
TopologyByExample.BingExampleG.basic_other
Every nonprincipal point has a singleton basic neighbourhood.
theorem basic_other {x : Space} (h : x ∉ range point) (f : Finset Coord) :
basic x f = {x}
Proof
:= by simp [basic, h]
theorem mem_basic_self
TopologyByExample.BingExampleG.mem_basic_self
Each basic neighbourhood contains its centre.
theorem mem_basic_self (x : Space) (f : Finset Coord) : x ∈ basic x f
Proof
:= by
classical
by_cases h : x ∈ range point <;> simp [basic, h, mem_cyl_self]
theorem basic_subset_cyl
TopologyByExample.BingExampleG.basic_subset_cyl
Every basic neighbourhood lies in its corresponding cylinder.
theorem basic_subset_cyl (x : Space) (f : Finset Coord) : basic x f ⊆ cyl x f
Proof
:= by
classical
by_cases h : x ∈ range point <;> simp [basic, h, mem_cyl_self]
theorem basic_anti
TopologyByExample.BingExampleG.basic_anti
private theorem basic_anti (x : Space) {f g : Finset Coord} (h : f ⊆ g) :
basic x g ⊆ basic x f
theorem basic_trans
TopologyByExample.BingExampleG.basic_trans
private theorem basic_trans {x y z : Space} {f : Finset Coord} (hy : y ∈ basic x f)
(hz : z ∈ basic y f) : z ∈ basic x f
Proof
:= by
classical
by_cases hx : x ∈ range point
· simp only [basic, hx, ↓reduceIte] at hy ⊢
exact cyl_trans hy (basic_subset_cyl y f hz)
· have he : y = x := by simpa [basic_other hx] using hy
exact he ▸ hz
definition neighbourhoods
TopologyByExample.BingExampleG.neighbourhoods
The filter generated by the basic neighbourhoods of a point.
def neighbourhoods (x : Space) : Filter Space
:= ⨅ f : Finset Coord, 𝓟 (basic x f)
theorem basis_filter
TopologyByExample.BingExampleG.basis_filter
private theorem basis_filter (x : Space) :
(neighbourhoods x).HasBasis (fun _ ↦ True) (basic x)
Proof
:= by
classical
apply hasBasis_iInf_principal
exact fun f g ↦ ⟨f ∪ g, basic_anti x Finset.subset_union_left,
basic_anti x Finset.subset_union_right⟩
instance
instance : TopologicalSpace Space
Proof
:= .mkOfNhds neighbourhoods
theorem nhds_basis
TopologyByExample.BingExampleG.nhds_basis
The specified basic sets form the neighbourhood basis.
theorem nhds_basis (x : Space) : (𝓝 x).HasBasis (fun _ ↦ True) (basic x)
Proof
:= by
have he : 𝓝 x = neighbourhoods x := nhds_mkOfNhds_of_hasBasis basis_filter
(fun a f _ ↦ mem_basic_self a f) (fun a f _ ↦ (basis_filter a).eventually_iff.2
⟨f, trivial, fun b hb ↦ (basis_filter b).mem_iff.2 ⟨f, trivial, fun _ ↦ basic_trans hb⟩⟩) x
exact he ▸ basis_filter x
theorem nhds_point
TopologyByExample.BingExampleG.nhds_point
Principal points have the finite-coordinate neighbourhood basis.
theorem nhds_point (r : ℝ) : (𝓝 (point r)).HasBasis (fun _ ↦ True) (cyl (point r))
Proof
:= by
rw [← show basic (point r) = cyl (point r) from funext (basic_point r)]
exact nhds_basis _
theorem isOpen_singleton_of_not_principal
TopologyByExample.BingExampleG.isOpen_singleton_of_not_principal
Nonprincipal points are isolated.
theorem isOpen_singleton_of_not_principal {x : Space} (hx : x ∉ range point) :
IsOpen ({x} : Set Space)
Proof
:= by
apply isOpen_iff_mem_nhds.2
intro y hy
obtain rfl : y = x := hy
exact (nhds_basis _).mem_iff.2 ⟨∅, trivial, (basic_other (x := _) hx ∅).le⟩
theorem isOpen_of_disjoint_principals
TopologyByExample.BingExampleG.isOpen_of_disjoint_principals
Every set of nonprincipal points is open.
theorem isOpen_of_disjoint_principals {s : Set Space} (hs : Disjoint s (range point)) :
IsOpen s
Proof
:= by
apply isOpen_iff_forall_mem_open.2
exact fun x hx ↦ ⟨{x}, singleton_subset_iff.2 hx,
isOpen_singleton_of_not_principal (Set.disjoint_left.1 hs hx), rfl⟩
theorem isClosed_principals
TopologyByExample.BingExampleG.isClosed_principals
The principal evaluations form a closed set.
theorem isClosed_principals : IsClosed (range point)
Proof
:=
isOpen_compl_iff.1 (isOpen_of_disjoint_principals disjoint_compl_left)
theorem isClopen_cyl
TopologyByExample.BingExampleG.isClopen_cyl
Every finite-coordinate cylinder is clopen.
theorem isClopen_cyl (x : Space) (f : Finset Coord) : IsClopen (cyl x f)
Proof
:= by
constructor
· apply isOpen_compl_iff.1
apply isOpen_iff_mem_nhds.2
intro y hy
refine (nhds_basis y).mem_iff.2 ⟨f, trivial, fun z hz hzc ↦ hy ?_⟩
exact fun q hq ↦ ((basic_subset_cyl y f hz q hq).symm).trans (hzc q hq)
· apply isOpen_iff_mem_nhds.2
exact fun y hy ↦ (nhds_basis y).mem_iff.2
⟨f, trivial, fun _ hz ↦ cyl_trans hy (basic_subset_cyl y f hz)⟩
definition yes
TopologyByExample.BingExampleG.yes
The clopen set of vectors whose value at the specified coordinate is one.
def yes (q : Coord) : Set Space
:= {x | q ∈ x.support}
theorem isClopen_yes
TopologyByExample.BingExampleG.isClopen_yes
The positive cylinder at one coordinate is clopen.
theorem isClopen_yes (q : Coord) : IsClopen (yes q)
Proof
:= by
have he : cyl ⟨{q}⟩ {q} = yes q := by ext x; simp [cyl, yes]
exact he ▸ isClopen_cyl _ _
instance
instance : T1Space Space
Proof
:= ⟨fun x ↦ by
apply isOpen_compl_iff.1
apply isOpen_iff_mem_nhds.2
intro y hy
have hne : y.support ≠ x.support := fun h ↦ hy (Space.ext h)
obtain ⟨q, hq⟩ := Set.ext_iff.not.1 hne |> Classical.not_forall.mp
refine (nhds_basis y).mem_iff.2 ⟨{q}, trivial, fun z hz he ↦ hq ?_⟩
obtain rfl : z = x := he
exact (basic_subset_cyl y {q} hz q (by simp)).symm⟩
instance
instance : ZeroDimensionalSpace Space
Proof
:= by
apply zeroDimensionalSpace_iff_isTopologicalBasis_isClopen.2
apply isTopologicalBasis_of_isOpen_of_nhds (s := {s : Set Space | IsClopen s})
(fun _ h ↦ h.2)
intro x U hx hU
obtain ⟨f, -, hf⟩ := (nhds_basis x).mem_iff.1 (hU.mem_nhds hx)
refine ⟨basic x f, ?_, mem_basic_self x f, hf⟩
by_cases h : x ∈ range point
· obtain ⟨r, rfl⟩ := h
rw [basic_point]
exact isClopen_cyl _ _
· rw [basic_other h]
exact ⟨isClosed_singleton, isOpen_singleton_of_not_principal h⟩
theorem isDiscrete_principals
TopologyByExample.BingExampleG.isDiscrete_principals
The principal evaluations form a discrete subspace.
theorem isDiscrete_principals : IsDiscrete (range point)
Proof
:= by
apply isDiscrete_iff_forall_mem_exists_isOpen.2
rintro _ ⟨r, rfl⟩
refine ⟨yes {r}, (isClopen_yes _).isOpen, ?_⟩
ext x
constructor
· rintro ⟨h, s, rfl⟩
exact congrArg point (show s = r from h)
· rintro rfl
exact ⟨rfl, mem_range_self _⟩
definition Michael
TopologyByExample.BingExampleG.Michael
Michael's closed subspace of Bing's Example G.
abbrev Michael
:= {x : Space // x ∈ range point ∨ x.support.Finite}
On this site: Space: Michael's subspace of Bing's Example G
theorem isClosed_michael
TopologyByExample.BingExampleG.isClosed_michael
Michael’s finite-support extension of the principal set is closed.
theorem isClosed_michael : IsClosed {x : Space | x ∈ range point ∨ x.support.Finite}
Proof
:= by
apply isOpen_compl_iff.1 (isOpen_of_disjoint_principals ?_)
exact Set.disjoint_left.2 fun _ h hp ↦ h (Or.inl hp)