Lean library · module TopologyByExample.Spaces.StrongUltrafilter

The strong ultrafilter topology

Source file

The strong ultrafilter topology is the set ℕ ⊕ M, where M is the set of free ultrafilters on ℕ (those coarser than the cofinite filter), in which a set U is open when every free ultrafilter F ∈ U contains the set of natural numbers in U. So the natural numbers are isolated, and the neighbourhoods of a free ultrafilter F are the sets containing A ∪ {F} for some A ∈ F. For A ⊆ ℕ, the set clopenSet A of the natural numbers in A and the free ultrafilters containing A is clopen.

Main statements

  • totallySeparatedSpace: the sets clopenSet A separate points.
  • separableSpace: the natural numbers are dense.
  • extremallyDisconnected: the closure of an open set U lies in the clopen set clopenSet (ℕ ∩ U), and contains ℕ ∩ U, so it is open.
  • scatteredSpace: the natural numbers are isolated, and the free ultrafilters form a discrete set.
  • exists_closed_discrete_continuum_le: the free ultrafilters form a closed discrete set of cardinality at least 𝔠.
  • pseudocompactSpace: a continuous real function is bounded: if it were unbounded on ℕ, a free ultrafilter containing every set {n | M ≤ |f n|} would be a point at which it is not continuous.
  • not_semiregularSpace: no regular open neighbourhood of a free ultrafilter F lies in ℕ ∪ {F}.

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

definition StrongUltrafilter

TopologyByExample.StrongUltrafilter

The strong ultrafilter topology: the natural numbers together with the free ultrafilters on ℕ. Its topology is StrongUltrafilter.instTopologicalSpace.

def StrongUltrafilter : Type
:= ℕ ⊕ {F : Ultrafilter ℕ // (F : Filter ℕ) ≤ cofinite}

On this site: Space: Strong ultrafilter topology

definition Free

TopologyByExample.StrongUltrafilter.Free

The free ultrafilters on ℕ.

abbrev Free : Type
:= {F : Ultrafilter ℕ // (F : Filter ℕ) ≤ cofinite}

definition nat

TopologyByExample.StrongUltrafilter.nat

A natural number, as a point of the space.

def nat (n : ℕ) : StrongUltrafilter
:= Sum.inl n

instance

The space is nonempty.

instance : Nonempty StrongUltrafilter
Proof
:= ⟨nat 0⟩

definition free

TopologyByExample.StrongUltrafilter.free

A free ultrafilter, as a point of the space.

def free (F : Free) : StrongUltrafilter
:= Sum.inr F

theorem nat_injective

TopologyByExample.StrongUltrafilter.nat_injective

theorem nat_injective : Function.Injective nat
Proof
:= Sum.inl_injective

theorem free_injective

TopologyByExample.StrongUltrafilter.free_injective

theorem free_injective : Function.Injective free
Proof
:= Sum.inr_injective

theorem nat_ne_free

TopologyByExample.StrongUltrafilter.nat_ne_free

theorem nat_ne_free (n : ℕ) (F : Free) : nat n ≠ free F
Proof
:= Sum.inl_ne_inr

theorem forall_iff

TopologyByExample.StrongUltrafilter.forall_iff

Every point is a natural number or a free ultrafilter.

theorem forall_iff {p : StrongUltrafilter → Prop} :
    (∀ x, p x) ↔ (∀ n, p (nat n)) ∧ ∀ F, p (free F)
Proof
:=
  Sum.forall

instance instTopologicalSpace

TopologyByExample.StrongUltrafilter.instTopologicalSpace

The topology: a set is open when every free ultrafilter in it contains the set of natural numbers in it.

instance instTopologicalSpace : TopologicalSpace StrongUltrafilter
Proof
where
  IsOpen U := ∀ F : Free, free F ∈ U → nat ⁻¹' U ∈ F.val
  isOpen_univ _ _ := univ_mem
  isOpen_inter _ _ hU hV F h := inter_mem (hU F h.1) (hV F h.2)
  isOpen_sUnion S hS F := by
    rintro ⟨U, hU, hF⟩
    exact mem_of_superset (hS U hU F hF) (preimage_mono (subset_sUnion_of_mem hU))

theorem isOpen_iff

TopologyByExample.StrongUltrafilter.isOpen_iff

theorem isOpen_iff {U : Set StrongUltrafilter} :
    IsOpen U ↔ ∀ F : Free, free F ∈ U → nat ⁻¹' U ∈ F.val
Proof
:=
  Iff.rfl

theorem notMem_of_finite

TopologyByExample.StrongUltrafilter.notMem_of_finite

A finite set belongs to no free ultrafilter.

theorem notMem_of_finite (F : Free) {s : Set ℕ} (hs : s.Finite) : s ∉ F.val
Proof
:=
  Ultrafilter.compl_mem_iff_notMem.1 (F.property hs.compl_mem_cofinite)

definition clopenSet

TopologyByExample.StrongUltrafilter.clopenSet

The natural numbers together with the free ultrafilters containing A.

def clopenSet (A : Set ℕ) : Set StrongUltrafilter
:=
  {x | Sum.elim (fun n : ℕ ↦ n ∈ A) (fun F : Free ↦ A ∈ F.val) x}

theorem nat_mem_clopenSet

TopologyByExample.StrongUltrafilter.nat_mem_clopenSet

@[simp] theorem nat_mem_clopenSet {A : Set ℕ} {n : ℕ} : nat n ∈ clopenSet A ↔ n ∈ A
Proof
:= Iff.rfl

theorem free_mem_clopenSet

TopologyByExample.StrongUltrafilter.free_mem_clopenSet

@[simp] theorem free_mem_clopenSet {A : Set ℕ} {F : Free} : free F ∈ clopenSet A ↔ A ∈ F.val
Proof
:=
  Iff.rfl

theorem isOpen_clopenSet

TopologyByExample.StrongUltrafilter.isOpen_clopenSet

theorem isOpen_clopenSet (A : Set ℕ) : IsOpen (clopenSet A)
Proof
:= fun _ h ↦ h

theorem compl_clopenSet

TopologyByExample.StrongUltrafilter.compl_clopenSet

theorem compl_clopenSet (A : Set ℕ) : (clopenSet A)ᶜ = clopenSet Aᶜ
Proof
:= by
  ext x
  cases x with
  | inl n => rfl
  | inr F => exact Ultrafilter.compl_mem_iff_notMem.symm

theorem isClopen_clopenSet

TopologyByExample.StrongUltrafilter.isClopen_clopenSet

theorem isClopen_clopenSet (A : Set ℕ) : IsClopen (clopenSet A)
Proof
:=
  ⟨isOpen_compl_iff.1 (compl_clopenSet A ▸ isOpen_clopenSet _), isOpen_clopenSet A⟩

On this site: Strong ultrafilter topology: The sets \(\widetilde{A}\) are clopen

theorem isOpen_singleton_nat

TopologyByExample.StrongUltrafilter.isOpen_singleton_nat

A natural number is isolated.

theorem isOpen_singleton_nat (n : ℕ) : IsOpen {nat n}
Proof
:= fun F h ↦
  absurd (mem_singleton_iff.1 h) (nat_ne_free n F).symm

theorem isOpen_insert_free_range_nat

TopologyByExample.StrongUltrafilter.isOpen_insert_free_range_nat

The natural numbers together with one free ultrafilter form an open set.

theorem isOpen_insert_free_range_nat (F : Free) : IsOpen (insert (free F) (range nat))
Proof
:= by
  intro G hG
  rcases hG with hG | ⟨n, hn⟩
  · rw [free_injective hG]
    exact mem_of_superset univ_mem fun n _ ↦ Or.inr ⟨n, rfl⟩
  · exact absurd hn (nat_ne_free n G)

theorem totallySeparatedSpace

TopologyByExample.StrongUltrafilter.totallySeparatedSpace

The space is totally separated: the clopen sets clopenSet A separate points.

theorem totallySeparatedSpace : TotallySeparatedSpace StrongUltrafilter
Proof
:= by
  refine totallySeparatedSpace_iff_exists_isClopen.2 fun x y hxy ↦ ?_
  cases x with
  | inl n =>
    refine ⟨clopenSet {n}, isClopen_clopenSet _, rfl, ?_⟩
    cases y with
    | inl m => exact fun h ↦ hxy (congrArg Sum.inl (mem_singleton_iff.1 h).symm)
    | inr G => exact notMem_of_finite G (finite_singleton n)
  | inr F =>
    cases y with
    | inl m =>
      refine ⟨clopenSet {m}ᶜ, isClopen_clopenSet _, F.property ?_, fun h ↦ h rfl⟩
      exact (finite_singleton m).compl_mem_cofinite
    | inr G =>
      have hFG : F ≠ G := fun h ↦ hxy (congrArg Sum.inr h)
      obtain ⟨A, hAF, hAG⟩ : ∃ A ∈ F.val, A ∉ G.val := by
        by_contra! h
        exact hFG (Subtype.ext (Ultrafilter.coe_le_coe.1 fun A hA ↦ h A hA).symm)
      exact ⟨clopenSet A, isClopen_clopenSet A, hAF, hAG⟩

On this site: The strong ultrafilter topology is totally separated

theorem dense_range_nat

TopologyByExample.StrongUltrafilter.dense_range_nat

An open set meeting the space meets the natural numbers.

theorem dense_range_nat : Dense (range nat)
Proof
:= by
  refine dense_iff_inter_open.2 fun U hU ⟨x, hx⟩ ↦ ?_
  cases x with
  | inl n => exact ⟨nat n, hx, n, rfl⟩
  | inr F =>
    obtain ⟨n, hn⟩ := F.val.nonempty_of_mem (hU F hx)
    exact ⟨nat n, hn, n, rfl⟩

theorem separableSpace

TopologyByExample.StrongUltrafilter.separableSpace

The space is separable: the natural numbers are dense.

theorem separableSpace : SeparableSpace StrongUltrafilter
Proof
:=
  ⟨⟨range nat, countable_range nat, dense_range_nat⟩⟩

On this site: The strong ultrafilter topology is separable

theorem extremallyDisconnected

TopologyByExample.StrongUltrafilter.extremallyDisconnected

The space is extremally disconnected. The closure of an open set U lies in the clopen set clopenSet (nat ⁻¹' U), which contains U; so every free ultrafilter in it contains nat ⁻¹' U, and with it the set of natural numbers in the closure.

theorem extremallyDisconnected : ExtremallyDisconnected StrongUltrafilter
Proof
:= by
  refine ⟨fun U hU F hF ↦ mem_of_superset ?_ (preimage_mono subset_closure)⟩
  have hsub : U ⊆ clopenSet (nat ⁻¹' U) := by
    intro x hx
    cases x with
    | inl n => exact hx
    | inr G => exact hU G hx
  exact closure_minimal hsub (isClopen_clopenSet _).isClosed hF

On this site: The strong ultrafilter topology is extremally disconnected

theorem scatteredSpace

TopologyByExample.StrongUltrafilter.scatteredSpace

The space is scattered: a natural number is isolated, and a free ultrafilter F is the only free ultrafilter in its neighbourhood ℕ ∪ {F}.

theorem scatteredSpace : ScatteredSpace StrongUltrafilter
Proof
:= by
  refine scatteredSpace_iff_exists_isolated.2 fun S hS ↦ ?_
  by_cases hn : ∃ n, nat n ∈ S
  · obtain ⟨n, hn⟩ := hn
    exact ⟨nat n, hn, {nat n}, (isOpen_singleton_nat n).mem_nhds rfl, inter_subset_left⟩
  · push Not at hn
    obtain ⟨x, hx⟩ := hS
    cases x with
    | inl m => exact absurd hx (hn m)
    | inr F =>
      refine ⟨free F, hx, _, (isOpen_insert_free_range_nat F).mem_nhds (mem_insert _ _), ?_⟩
      rintro y ⟨hy | ⟨m, rfl⟩, hyS⟩
      · exact hy
      · exact absurd hyS (hn m)

On this site: The strong ultrafilter topology is scattered

theorem branchUltrafilter_le_cofinite

TopologyByExample.StrongUltrafilter.branchUltrafilter_le_cofinite

Every free ultrafilter of the branches of the binary tree is free.

theorem branchUltrafilter_le_cofinite (f : ℕ → Bool) :
    (StoneCechNaturals.branchUltrafilter f : Filter ℕ) ≤ cofinite
Proof
:=
  (StoneCechNaturals.branchUltrafilter f).le_cofinite_or_eq_pure.resolve_right fun ⟨a, ha⟩ ↦
    StoneCechNaturals.notMem_branchUltrafilter_of_finite f (finite_singleton a)
      (ha ▸ Ultrafilter.mem_pure.2 rfl)

theorem continuum_le_mk_free

TopologyByExample.StrongUltrafilter.continuum_le_mk_free

There are at least 𝔠 free ultrafilters on ℕ.

theorem continuum_le_mk_free : 𝔠 ≤ #Free
Proof
:= by
  rw [← StoneCechNaturals.mk_range_branchUltrafilter]
  refine mk_le_of_injective (f := fun x ↦ (⟨x.val, ?_⟩ : Free)) fun x y h ↦
    Subtype.ext (Subtype.mk.inj h)
  obtain ⟨f, hf⟩ := x.property
  rw [← hf]
  exact branchUltrafilter_le_cofinite f

theorem exists_closed_discrete_continuum_le

TopologyByExample.StrongUltrafilter.exists_closed_discrete_continuum_le

The free ultrafilters form a closed discrete set of cardinality at least 𝔠.

theorem exists_closed_discrete_continuum_le :
    ∃ s : Set StrongUltrafilter, IsClosed s ∧ IsDiscrete s ∧ 𝔠 ≤ #s
Proof
:= by
  refine ⟨range free, ?_, ?_, ?_⟩
  · refine isOpen_compl_iff.1 fun F hF ↦ absurd ⟨F, rfl⟩ hF
  · refine isDiscrete_iff_forall_mem_exists_isOpen.2 ?_
    rintro _ ⟨F, rfl⟩
    refine ⟨_, isOpen_insert_free_range_nat F, ?_⟩
    ext y
    constructor
    · rintro ⟨hy, G, rfl⟩
      rcases hy with hy | ⟨n, hn⟩
      · exact hy
      · exact absurd hn (nat_ne_free n G)
    · rintro rfl
      exact ⟨mem_insert _ _, F, rfl⟩
  · rw [mk_range_eq _ free_injective]
    exact continuum_le_mk_free

On this site: The strong ultrafilter topology has a closed discrete subset of cardinality \(\mathfrak{c}\)

theorem abs_le_of_forall_nat

TopologyByExample.StrongUltrafilter.abs_le_of_forall_nat

A continuous real function bounded on the natural numbers is bounded on the space: if M < |f x| at a free ultrafilter x, the open set where M < |f| contains a natural number.

theorem abs_le_of_forall_nat (f : C(StrongUltrafilter, ℝ)) {M : ℝ} (hM : ∀ n, |f (nat n)| ≤ M)
    (x : StrongUltrafilter) : |f x| ≤ M
Proof
:= by
  cases x with
  | inl n => exact hM n
  | inr F =>
    by_contra! hx
    have hopen : IsOpen {y | M < |f y|} :=
      isOpen_lt continuous_const (continuous_abs.comp f.continuous)
    obtain ⟨n, hn⟩ := F.val.nonempty_of_mem (hopen F hx)
    exact (hM n).not_gt hn

theorem pseudocompactSpace

TopologyByExample.StrongUltrafilter.pseudocompactSpace

The space is pseudocompact: every continuous real function is bounded. If f were unbounded on the natural numbers, the sets {n | M ≤ |f n|} would lie in a free ultrafilter G, and f would not be continuous at G.

theorem pseudocompactSpace : PseudocompactSpace StrongUltrafilter
Proof
:= by
  refine ⟨fun f ↦ ?_⟩
  set g : ℕ → ℝ := fun n ↦ |f (nat n)|
  obtain ⟨M, hM⟩ : ∃ M, ∀ n, g n ≤ M := by
    by_contra! hunb
    have hne : (comap g atTop).NeBot := comap_neBot fun t ht ↦ by
      obtain ⟨M, hM⟩ := mem_atTop_sets.1 ht
      obtain ⟨n, hn⟩ := hunb M
      exact ⟨n, hM _ hn.le⟩
    have hcof : comap g atTop ≤ cofinite := by
      intro s hs
      obtain ⟨B, hB⟩ := ((mem_cofinite.1 hs).image g).bddAbove
      refine ⟨Ioi B, Ioi_mem_atTop B, fun n hn ↦ ?_⟩
      by_contra hns
      exact (not_le.2 hn) (hB ⟨n, hns, rfl⟩)
    set G : Free := ⟨Ultrafilter.of (comap g atTop), (Ultrafilter.of_le _).trans hcof⟩
    have hball : nat ⁻¹' (f ⁻¹' Metric.ball (f (free G)) 1) ∈ G.val :=
      (Metric.isOpen_ball.preimage f.continuous) G (Metric.mem_ball_self one_pos)
    have hbig : g ⁻¹' Ici (|f (free G)| + 1) ∈ G.val :=
      Ultrafilter.of_le (comap g atTop) (preimage_mem_comap (Ici_mem_atTop _))
    obtain ⟨n, hn1, hn2⟩ := G.val.nonempty_of_mem (inter_mem hball hbig)
    have h1 : |f (nat n) - f (free G)| < 1 := hn1
    have h2 : |f (free G)| + 1 ≤ |f (nat n)| := hn2
    linarith [abs_sub_abs_le_abs_sub (f (nat n)) (f (free G))]
  have hb := abs_le_of_forall_nat f hM
  exact ⟨⟨M, by rintro _ ⟨x, rfl⟩; exact (abs_le.1 (hb x)).2⟩,
    ⟨-M, by rintro _ ⟨x, rfl⟩; exact (abs_le.1 (hb x)).1⟩⟩

On this site: The strong ultrafilter topology is pseudocompact

theorem free_mem_closure

TopologyByExample.StrongUltrafilter.free_mem_closure

A free ultrafilter containing a set B is in the closure of every set containing the natural numbers in B.

theorem free_mem_closure {V : Set StrongUltrafilter} {F : Free} (hF : nat ⁻¹' V ∈ F.val) :
    free F ∈ closure V
Proof
:= by
  refine mem_closure_iff.2 fun O hO hFO ↦ ?_
  obtain ⟨n, hnO, hnV⟩ := F.val.nonempty_of_mem (inter_mem (hO F hFO) hF)
  exact ⟨nat n, hnO, hnV⟩

theorem not_semiregularSpace

TopologyByExample.StrongUltrafilter.not_semiregularSpace

The space is not semiregular: a regular open neighbourhood V of the free ultrafilter hyperfilter ℕ inside ℕ ∪ {hyperfilter ℕ} would contain every free ultrafilter containing the set B of natural numbers in V, and B is infinite, so lies in another free ultrafilter.

theorem not_semiregularSpace : ¬SemiregularSpace StrongUltrafilter
Proof
:= by
  intro h
  set F0 : Free := ⟨hyperfilter ℕ, hyperfilter_le_cofinite⟩
  obtain ⟨V, hVreg, hFV, hVU⟩ := h.isTopologicalBasis.mem_nhds_iff.1
    ((isOpen_insert_free_range_nat F0).mem_nhds (mem_insert _ _))
  have hVreg' : interior (closure V) = V := hVreg
  have hVopen : IsOpen V := hVreg' ▸ isOpen_interior
  set B := nat ⁻¹' V
  have hB : B ∈ F0.val := hVopen F0 hFV
  have hBinf : B.Infinite := fun hfin ↦ notMem_of_finite F0 hfin hB
  obtain ⟨C, hCB, hCinf, hCF0⟩ := exists_infinite_subset_notMem hBinf F0.val
  have := hCinf.cofinite_inf_principal_neBot
  have hGle : ((Ultrafilter.of (cofinite ⊓ 𝓟 C) : Ultrafilter ℕ) : Filter ℕ) ≤ cofinite ⊓ 𝓟 C :=
    Ultrafilter.of_le _
  set G : Free := ⟨Ultrafilter.of (cofinite ⊓ 𝓟 C), hGle.trans inf_le_left⟩
  have hGC : C ∈ G.val := le_principal_iff.1 (hGle.trans inf_le_right)
  have hsub : clopenSet B ⊆ closure V := by
    intro x hx
    cases x with
    | inl n => exact subset_closure hx
    | inr H => exact free_mem_closure hx
  have hGV : free G ∈ V := by
    rw [← hVreg']
    exact interior_maximal hsub (isOpen_clopenSet B) (mem_of_superset hGC hCB)
  rcases hVU hGV with hG | ⟨n, hn⟩
  · exact hCF0 (congrArg Subtype.val (free_injective hG) ▸ hGC)
  · exact nat_ne_free n G hn

On this site: The strong ultrafilter topology is not semiregular