Lean library Β· module TopologyByExample.Spaces.PsiSpace

Spaces associated to almost disjoint families

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

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))