Lean library Β· module TopologyByExample.Spaces.PsiSpace
Spaces associated to almost disjoint families
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 PsiSpace
TopologyByExample.PsiSpace
The naturals together with one additional point for each member of a family of subsets.
inductive PsiSpace (π : Set (Set β))
/-- An isolated natural-number point. -/
| nat (n : β)
/-- The point attached to a member of the family. -/
| point (A : π)
variable {π : Set (Set β)}
instance nonempty
TopologyByExample.PsiSpace.nonempty
Every family space contains the natural point zero.
instance nonempty : Nonempty (PsiSpace π)
Proof
:= β¨nat 0β©
instance
Open sets contain a cofinite tail of every family member whose added point they contain.
instance : TopologicalSpace (PsiSpace π)
Proof
where
IsOpen U := β A : π, point A β U β (A.val \ nat β»ΒΉ' U).Finite
isOpen_univ := by simp
isOpen_inter U V hU hV := by
intro A hA
simpa only [preimage_inter, sdiff_inter] using (hU A hA.1).union (hV A hA.2)
isOpen_sUnion S hS := by
intro A hA
obtain β¨U, hUS, hAUβ© := hA
apply (hS U hUS A hAU).subset
intro n hn
exact β¨hn.1, fun h => hn.2 β¨U, hUS, hβ©β©
theorem isOpen_iff
TopologyByExample.PsiSpace.isOpen_iff
The defining criterion for openness.
theorem isOpen_iff {U : Set (PsiSpace π)} :
IsOpen U β β A : π, point A β U β (A.val \ nat β»ΒΉ' U).Finite
Proof
:= Iff.rfl
theorem isOpen_singleton_nat
TopologyByExample.PsiSpace.isOpen_singleton_nat
Natural-number points are isolated.
theorem isOpen_singleton_nat (n : β) : IsOpen ({nat n} : Set (PsiSpace π))
Proof
:= by
intro A hA
simp at hA
definition basic
TopologyByExample.PsiSpace.basic
A basic neighbourhood of an added point, after omitting finitely many natural points.
def basic (A : π) (F : Finset β) : Set (PsiSpace π)
:=
{point A} βͺ nat '' (A.val \ (F : Set β))
theorem mem_basic
TopologyByExample.PsiSpace.mem_basic
The added point belongs to each of its basic neighbourhoods.
theorem mem_basic (A : π) (F : Finset β) : point A β basic A F
Proof
:=
Or.inl rfl
theorem inr_mem_basic_iff
TopologyByExample.PsiSpace.inr_mem_basic_iff
No other added point belongs to a basic neighbourhood.
theorem inr_mem_basic_iff {A B : π} {F : Finset β} :
point B β basic A F β B = A
Proof
:= by
simp [basic]
theorem inl_mem_basic_iff
TopologyByExample.PsiSpace.inl_mem_basic_iff
The natural points in a basic neighbourhood are precisely the specified tail.
theorem inl_mem_basic_iff {A : π} {F : Finset β} {n : β} :
nat n β basic A F β n β A.val β§ n β F
Proof
:= by
simp [basic]
theorem isOpen_basic
TopologyByExample.PsiSpace.isOpen_basic
Basic neighbourhoods are open, without any almost-disjointness assumption.
theorem isOpen_basic (A : π) (F : Finset β) : IsOpen (basic A F)
Proof
:= by
intro B hB
have hBA := inr_mem_basic_iff.mp hB
subst B
apply F.finite_toSet.subset
intro n hn
by_contra hnF
exact hn.2 (inl_mem_basic_iff.mpr β¨hn.1, hnFβ©)
theorem exists_basic_subset
TopologyByExample.PsiSpace.exists_basic_subset
Every open neighbourhood of an added point contains a basic neighbourhood.
theorem exists_basic_subset {A : π} {U : Set (PsiSpace π)}
(hU : IsOpen U) (hA : point A β U) : β F : Finset β, basic A F β U
Proof
:= by
classical
let F := (hU A hA).toFinset
refine β¨F, ?_β©
intro x hx
rcases hx with hx | β¨n, hn, rflβ©
Β· simpa only [mem_singleton_iff.mp hx] using hA
Β· by_contra hnu
exact hn.2 (by simpa [F] using (show n β A.val \ nat β»ΒΉ' U from β¨hn.1, hnuβ©))
instance t1Space
TopologyByExample.PsiSpace.t1Space
Every singleton is closed in the family space.
instance t1Space : T1Space (PsiSpace π)
Proof
:= by
constructor
intro x
apply isOpen_compl_iff.mp
cases x with
| nat n =>
intro A hA
apply (finite_singleton n).subset
intro m hm
simpa using not_not.mp hm.2
| point B =>
intro A hA
convert finite_empty (Ξ± := β) using 1
ext n
simp
theorem denseRange_nat
TopologyByExample.PsiSpace.denseRange_nat
If every family member is infinite, the natural-number points are dense.
theorem denseRange_nat (hπ : β A β π, A.Infinite) :
DenseRange (nat : β β PsiSpace π)
Proof
:= by
apply dense_iff_inter_open.mpr
intro U hU hne
obtain β¨x, hxβ© := hne
cases x with
| nat n => exact β¨nat n, hx, β¨n, rflβ©β©
| point A =>
obtain β¨n, hnA, hnβ© := (hπ A.val A.property).exists_notMem_finite (hU A hx)
have hnu : nat n β U := by
by_contra h
exact hn β¨hnA, hβ©
exact β¨nat n, hnu, β¨n, rflβ©β©
theorem separableSpace
TopologyByExample.PsiSpace.separableSpace
An infinite-member family space is separable.
theorem separableSpace (hπ : β A β π, A.Infinite) : SeparableSpace (PsiSpace π)
Proof
:=
SeparableSpace.of_denseRange nat (denseRange_nat hπ)
theorem disjoint_basic_of_finite_inter
TopologyByExample.PsiSpace.disjoint_basic_of_finite_inter
Almost-disjoint family members have disjoint basic neighbourhoods.
theorem disjoint_basic_of_finite_inter {A B : π} (hAB : A β B)
(hfin : (A.val β© B.val).Finite) :
Disjoint (basic A hfin.toFinset) (basic B β
)
Proof
:= by
classical
apply Set.disjoint_left.mpr
intro x hx hy
cases x with
| nat n =>
have hnA := inl_mem_basic_iff.mp hx
have hnB := inl_mem_basic_iff.mp hy
exact hnA.2 (by simpa using (show n β A.val β© B.val from β¨hnA.1, hnB.1β©))
| point C =>
exact hAB ((inr_mem_basic_iff.mp hx).symm.trans (inr_mem_basic_iff.mp hy))
theorem t2Space
TopologyByExample.PsiSpace.t2Space
An almost-disjoint family produces a Hausdorff space.
theorem t2Space (hπ : π.Pairwise fun A B => (A β© B).Finite) : T2Space (PsiSpace π)
Proof
:= by
classical
constructor
intro x y hxy
cases x with
| nat n =>
cases y with
| nat m =>
exact β¨{nat n}, {nat m}, isOpen_singleton_nat n, isOpen_singleton_nat m,
rfl, rfl, disjoint_singleton.mpr hxyβ©
| point A =>
refine β¨{nat n}, basic A {n}, isOpen_singleton_nat n, isOpen_basic A {n},
rfl, mem_basic A {n}, ?_β©
exact disjoint_singleton_left.mpr (by simp [inl_mem_basic_iff])
| point A =>
cases y with
| nat n =>
refine β¨basic A {n}, {nat n}, isOpen_basic A {n}, isOpen_singleton_nat n,
mem_basic A {n}, rfl, ?_β©
exact disjoint_singleton_right.mpr (by simp [inl_mem_basic_iff])
| point B =>
have hAB : A β B := fun h => hxy (congrArg point h)
have hfin := hπ A.property B.property (fun h => hAB (Subtype.ext h))
exact β¨basic A hfin.toFinset, basic B β
, isOpen_basic A _, isOpen_basic B _,
mem_basic A _, mem_basic B _, disjoint_basic_of_finite_inter hAB hfinβ©
theorem mem_nhds_point_iff
TopologyByExample.PsiSpace.mem_nhds_point_iff
A neighbourhood of an added point contains one of its finite-tail basic sets.
theorem mem_nhds_point_iff {A : π} {U : Set (PsiSpace π)} :
U β π (point A) β β F : Finset β, basic A F β U
Proof
:= by
constructor
Β· intro hU
obtain β¨V, hVU, hV, hAVβ© := mem_nhds_iff.mp hU
obtain β¨F, hFβ© := exists_basic_subset hV hAV
exact β¨F, hF.trans hVUβ©
Β· rintro β¨F, hFβ©
exact mem_of_superset ((isOpen_basic A F).mem_nhds (mem_basic A F)) hF
theorem nhds_point_hasBasis
TopologyByExample.PsiSpace.nhds_point_hasBasis
The finite-tail sets are a countable neighbourhood basis at an added point.
theorem nhds_point_hasBasis (A : π) :
(π (point A)).HasBasis (fun _ : Finset β => True) (basic A)
Proof
:= by
constructor
intro U
simp only [mem_nhds_point_iff, true_and]
instance firstCountableTopology
TopologyByExample.PsiSpace.firstCountableTopology
Every family space is first countable.
instance firstCountableTopology : FirstCountableTopology (PsiSpace π)
Proof
where
nhds_generated_countable x := by
cases x with
| nat n =>
rw [(isOpen_singleton_iff_nhds_eq_pure _).mp (isOpen_singleton_nat n)]
infer_instance
| point A => exact (nhds_point_hasBasis A).isCountablyGenerated
theorem tendsto_nat_cofinite
TopologyByExample.PsiSpace.tendsto_nat_cofinite
The cofinite filter on a tail converges to its attached point.
theorem tendsto_nat_cofinite (A : π) (F : Finset β) :
Tendsto (fun n : (A.val \ (F : Set β) : Set β) => nat n.val) cofinite (π (point A))
Proof
:= by
classical
apply tendsto_def.mpr
intro U hU
obtain β¨G, hGβ© := mem_nhds_point_iff.mp hU
apply mem_cofinite.mpr
apply (G.finite_toSet.preimage Subtype.val_injective.injOn).subset
intro n hn
by_contra hnG
exact hn (hG (inl_mem_basic_iff.mpr β¨n.property.1, hnGβ©))
theorem isCompact_basic
TopologyByExample.PsiSpace.isCompact_basic
Every basic neighbourhood of an added point is compact.
theorem isCompact_basic (A : π) (F : Finset β) : IsCompact (basic A F)
Proof
:= by
have h := (tendsto_nat_cofinite A F).isCompact_insert_range_of_cofinite
convert h using 1
ext x
simp [basic, Set.mem_range, Set.mem_image]
instance weaklyLocallyCompactSpace
TopologyByExample.PsiSpace.weaklyLocallyCompactSpace
Every family space has a compact neighbourhood at each point.
instance weaklyLocallyCompactSpace : WeaklyLocallyCompactSpace (PsiSpace π)
Proof
where
exists_compact_mem_nhds x := by
cases x with
| nat n => exact β¨{nat n}, isCompact_singleton,
(isOpen_singleton_nat n).mem_nhds rflβ©
| point A => exact β¨basic A β
, isCompact_basic A β
,
(isOpen_basic A β
).mem_nhds (mem_basic A β
)β©
theorem isClopen_basic
TopologyByExample.PsiSpace.isClopen_basic
Under almost-disjointness, the compact basic neighbourhoods are clopen.
theorem isClopen_basic (hπ : π.Pairwise fun A B => (A β© B).Finite)
(A : π) (F : Finset β) : IsClopen (basic A F)
Proof
:= by
let := t2Space hπ
exact β¨(isCompact_basic A F).isClosed, isOpen_basic A Fβ©
theorem zeroDimensionalSpace
TopologyByExample.PsiSpace.zeroDimensionalSpace
Almost-disjoint family spaces are zero-dimensional.
theorem zeroDimensionalSpace (hπ : π.Pairwise fun A B => (A β© B).Finite) :
ZeroDimensionalSpace (PsiSpace π)
Proof
:= by
rw [zeroDimensionalSpace_iff_nhds_hasBasis_isClopen]
intro x
refine β¨fun U => β¨fun hU => ?_, ?_β©β©
Β· cases x with
| nat n =>
exact β¨{nat n}, β¨β¨isClosed_singleton, isOpen_singleton_nat nβ©, rflβ©,
singleton_subset_iff.mpr (mem_of_mem_nhds hU)β©
| point A =>
obtain β¨F, hFβ© := mem_nhds_point_iff.mp hU
exact β¨basic A F, β¨isClopen_basic hπ A F, mem_basic A Fβ©, hFβ©
Β· rintro β¨V, β¨hV, hxVβ©, hVUβ©
exact mem_of_superset (hV.isOpen.mem_nhds hxV) hVU
theorem isClosed_image_point
TopologyByExample.PsiSpace.isClosed_image_point
Every subset of the added-point set is closed.
theorem isClosed_image_point (S : Set π) : IsClosed (point '' S)
Proof
:= by
apply isOpen_compl_iff.mp
intro A hA
convert finite_empty (Ξ± := β) using 1
ext n
simp
theorem isClosedEmbedding_point
TopologyByExample.PsiSpace.isClosedEmbedding_point
The added points form a closed discrete subspace.
theorem isClosedEmbedding_point [TopologicalSpace π] [DiscreteTopology π] :
IsClosedEmbedding (point : π β PsiSpace π)
Proof
:=
.of_continuous_injective_isClosedMap continuous_of_discreteTopology
(fun _ _ h => point.inj h) (fun S _ => isClosed_image_point S)
definition addedPoints
TopologyByExample.PsiSpace.addedPoints
The subset consisting of all the added points.
def addedPoints : Set (PsiSpace π)
:= range point
theorem isClosed_addedPoints
TopologyByExample.PsiSpace.isClosed_addedPoints
The added-point set is closed.
theorem isClosed_addedPoints : IsClosed (addedPoints (π := π))
Proof
:= by
simpa only [image_univ, addedPoints] using isClosed_image_point (π := π) univ
instance discreteTopology_addedPoints
TopologyByExample.PsiSpace.discreteTopology_addedPoints
The subspace of added points has the discrete topology.
instance discreteTopology_addedPoints : DiscreteTopology (addedPoints (π := π))
Proof
:= by
let : TopologicalSpace π := β₯
let : DiscreteTopology π := β¨rflβ©
exact isDiscrete_iff_discreteTopology.mp isClosedEmbedding_point.isInducing.isDiscrete_range
theorem countable_compl_addedPoints
TopologyByExample.PsiSpace.countable_compl_addedPoints
Only the natural points lie outside the added-point set.
theorem countable_compl_addedPoints : (addedPoints (π := π))αΆ.Countable
Proof
:= by
have he : (addedPoints (π := π))αΆ = range nat := by
ext x
cases x <;> simp [addedPoints]
rw [he]
exact countable_range _
instance countablyMetacompactSpace
TopologyByExample.PsiSpace.countablyMetacompactSpace
Every family space is countably metacompact.
instance countablyMetacompactSpace : CountablyMetacompactSpace (PsiSpace π)
Proof
:=
countablyMetacompactSpace_of_closed_discrete_countable_compl isClosed_addedPoints
(isDiscrete_iff_discreteTopology.mpr inferInstance) countable_compl_addedPoints
instance scatteredSpace
TopologyByExample.PsiSpace.scatteredSpace
Every nonempty subset of a family space has an isolated point.
instance scatteredSpace : ScatteredSpace (PsiSpace π)
Proof
:= by
refine β¨fun s hs => eq_empty_iff_forall_notMem.mpr fun z hz => ?_β©
have hnat (n : β) (hn : nat n β s) : False := by
obtain β¨y, β¨hy, _β©, hneβ© := accPt_iff_nhds.mp (hs _ hn) _
((isOpen_singleton_nat n).mem_nhds rfl)
exact hne hy
cases z with
| nat n => exact hnat n hz
| point A =>
obtain β¨y, β¨hy, hysβ©, hneβ© := accPt_iff_nhds.mp (hs _ hz) _
((isOpen_basic A β
).mem_nhds (mem_basic A β
))
cases y with
| nat n => exact hnat n hys
| point B => exact hne (congrArg point (inr_mem_basic_iff.mp hy))