Lean library · module TopologyByExample.Theorems.CocountableTopology
The cocountable topology
TopologyByExample.CocountableTopology X is the type X with the cocountable topology: a set
is open if it is empty or its complement is countable. Its closed sets are the countable sets and
the whole space. It is defined after Mathlib's CofiniteTopology, as WithTopology X for the
topology TopologyByExample.cocountableTopology X.
If X is countable, every subset is closed and the topology is discrete. For every X the
space is T₁ (singletons are countable), Lindelöf (one open set of a cover leaves out only countably
many points) and anticompact (an infinite set contains a countably infinite set t, and the open
sets omitting all of t but one point cover the space with no finite subcover of t); so its
compact sets are exactly its finite sets and its convergent sequences are eventually constant. If
X is uncountable, any two nonempty open sets meet (the space is hyperconnected), a countable set
is closed and not dense (the space is not separable), and a nowhere dense set is countable (the
space is of second category).
Main definitions
TopologyByExample.cocountableTopology X: the cocountable topology onX.TopologyByExample.CocountableTopology X: the typeXwith this topology.TopologyByExample.CocountableTopology.of: the identity equivalenceX ≃ CocountableTopology X.
Main statements
TopologyByExample.CocountableTopology.isOpen_iff,.isClosed_iff: the open and closed sets.TopologyByExample.CocountableTopology.discreteTopology: for countableX, discreteness.TopologyByExample.CocountableTopology.t1Space,.lindelofSpace,.anticompactSpace: for everyX, the space is T₁, Lindelöf and anticompact.TopologyByExample.CocountableTopology.isCompact_iff_finite,TopologyByExample.CocountableTopology.tendsto_nhds_iff: compact sets are the finite sets, and a sequence converges toxif and only if it is eventually equal tox.TopologyByExample.CocountableTopology.nonempty,.preirreducibleSpace,.not_separableSpace,.not_isMeagre_univ: for uncountableX, the space is nonempty, hyperconnected, not separable and of second category.
Tags
cocountable topology, countable complement topology, Lindelöf, not separable, anticompact
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 cocountableTopology
TopologyByExample.cocountableTopology
The cocountable topology on X: a set is open if it is empty or its complement is
countable.
@[instance_reducible]
def cocountableTopology (X : Type*) : TopologicalSpace X
Definition
where
IsOpen s := s.Nonempty → sᶜ.Countable
isOpen_univ := by simp
isOpen_inter s t := by
rintro hs ht ⟨x, hxs, hxt⟩
rw [compl_inter]
exact (hs ⟨x, hxs⟩).union (ht ⟨x, hxt⟩)
isOpen_sUnion := by
rintro s h ⟨x, t, hts, hzt⟩
rw [compl_sUnion]
exact (h t hts ⟨x, hzt⟩).mono (sInter_subset_of_mem (mem_image_of_mem _ hts))
definition CocountableTopology
TopologyByExample.CocountableTopology
The type X with the cocountable topology, whose open sets are the empty set and the sets
with countable complement.
abbrev CocountableTopology (X : Type*)
:=
WithTopology X (cocountableTopology X)
variable {X : Type*}
definition of
TopologyByExample.CocountableTopology.of
The identity equivalence between X and CocountableTopology X.
def of : X ≃ CocountableTopology X
:=
(WithTopology.equiv _ _).symm
theorem isOpen_iff
TopologyByExample.CocountableTopology.isOpen_iff
A set is open in the cocountable topology if and only if it is empty or its complement is countable.
theorem isOpen_iff {s : Set (CocountableTopology X)} : IsOpen s ↔ s.Nonempty → sᶜ.Countable
Proof
:= by
rw [WithTopology.isOpen_iff]
change (_ : Set X).Nonempty → _ ↔ _
rw [← preimage_compl]
constructor
· rintro h ⟨x, hx⟩
exact (h ⟨x.ofTopology, hx⟩).preimage (WithTopology.ofTopology_injective _)
· rintro h ⟨x, hx⟩
exact (h ⟨_, hx⟩).preimage (WithTopology.toTopology_injective _)
theorem isOpen_iff'
TopologyByExample.CocountableTopology.isOpen_iff'
A set is open in the cocountable topology if and only if it is empty or its complement is countable.
theorem isOpen_iff' {s : Set (CocountableTopology X)} : IsOpen s ↔ s = ∅ ∨ sᶜ.Countable
Proof
:= by
simp only [isOpen_iff, ← ne_empty_iff_nonempty, or_iff_not_imp_left]
theorem isClosed_iff
TopologyByExample.CocountableTopology.isClosed_iff
A set is closed in the cocountable topology if and only if it is the whole space or it is countable.
theorem isClosed_iff {s : Set (CocountableTopology X)} : IsClosed s ↔ s = univ ∨ s.Countable
Proof
:= by
simp only [← isOpen_compl_iff, isOpen_iff', compl_compl, compl_empty_iff]
theorem isClosed_cocountableTopology
Set.Countable.isClosed_cocountableTopology
A countable set is closed in the cocountable topology.
theorem _root_.Set.Countable.isClosed_cocountableTopology {s : Set (CocountableTopology X)}
(hs : s.Countable) : IsClosed s
Proof
:=
isClosed_iff.2 (Or.inr hs)
theorem discreteTopology
TopologyByExample.CocountableTopology.discreteTopology
If X is countable, the cocountable topology on X is discrete: every subset is
countable, so closed.
theorem discreteTopology [Countable X] : DiscreteTopology (CocountableTopology X)
Proof
:=
have : Countable (CocountableTopology X) := (of (X := X)).symm.injective.countable
discreteTopology_iff_forall_isClosed.2 fun s ↦ s.to_countable.isClosed_cocountableTopology
On this site: Cocountable topologies: Countable sets give the discrete topology
instance t1Space
TopologyByExample.CocountableTopology.t1Space
The cocountable topology is T₁: singletons are countable, so closed.
instance t1Space : T1Space (CocountableTopology X)
Proof
:=
⟨fun x ↦ (countable_singleton x).isClosed_cocountableTopology⟩
On this site: Cocountable topologies: the space is T₁
instance lindelofSpace
TopologyByExample.CocountableTopology.lindelofSpace
The cocountable topology is Lindelöf: one member of an open cover containing a point leaves out only countably many points, and one member for each of these completes a countable subcover.
instance lindelofSpace : LindelofSpace (CocountableTopology X)
Proof
:= by
refine ⟨isLindelof_of_countable_subcover fun {ι} U hU hcover ↦ ?_⟩
rcases isEmpty_or_nonempty (CocountableTopology X) with hX | ⟨⟨x⟩⟩
· exact ⟨∅, countable_empty, fun y ↦ (IsEmpty.false y).elim⟩
have hmem (y : CocountableTopology X) : ∃ i, y ∈ U i := mem_iUnion.1 (hcover (mem_univ y))
choose f hf using hmem
refine ⟨insert (f x) (f '' (U (f x))ᶜ), ((isOpen_iff.1 (hU (f x)) ⟨x, hf x⟩).image f).insert _,
fun y _ ↦ ?_⟩
by_cases hy : y ∈ U (f x)
· exact mem_biUnion (mem_insert _ _) hy
· exact mem_biUnion (mem_insert_of_mem _ (mem_image_of_mem f hy)) (hf y)
On this site: Cocountable topologies: the space is Lindelöf
instance anticompactSpace
TopologyByExample.CocountableTopology.anticompactSpace
The cocountable topology is anticompact: an infinite set s contains a countably infinite set
t, and the open sets (t \ {x})ᶜ for x ∈ t cover s with no finite subcover.
instance anticompactSpace : AnticompactSpace (CocountableTopology X)
Proof
:= by
refine ⟨fun s hs ↦ ?_⟩
by_contra hinf
obtain ⟨t, hts, htc, hti⟩ := Set.Infinite.exists_subset_countable_infinite hinf
have hopen (x : t) : IsOpen ((t \ {(x : CocountableTopology X)})ᶜ) :=
(htc.mono sdiff_subset).isClosed_cocountableTopology.isOpen_compl
have hcover : s ⊆ ⋃ x : t, (t \ {(x : CocountableTopology X)})ᶜ := by
intro y _
by_cases hy : y ∈ t
· exact mem_iUnion.2 ⟨⟨y, hy⟩, fun h ↦ h.2 rfl⟩
· obtain ⟨x, hx⟩ := hti.nonempty
exact mem_iUnion.2 ⟨⟨x, hx⟩, fun h ↦ hy h.1⟩
obtain ⟨F, hF⟩ := hs.elim_finite_subcover _ hopen hcover
obtain ⟨y, hyt, hyF⟩ := (hti.sdiff ((F.finite_toSet.image Subtype.val))).nonempty
obtain ⟨x, hxF, hyx⟩ := mem_iUnion₂.1 (hF (hts hyt))
refine hyF ⟨x, hxF, ?_⟩
by_contra hne
exact hyx ⟨hyt, Ne.symm hne⟩
On this site: Cocountable topologies: the space is anticompact
theorem isCompact_iff_finite
TopologyByExample.CocountableTopology.isCompact_iff_finite
In the cocountable topology, the compact sets are exactly the finite sets.
theorem isCompact_iff_finite {s : Set (CocountableTopology X)} : IsCompact s ↔ s.Finite
Proof
:=
⟨AnticompactSpace.finite_of_isCompact s, Set.Finite.isCompact⟩
On this site: Cocountable topologies: The compact sets are the finite sets
theorem tendsto_nhds_iff
TopologyByExample.CocountableTopology.tendsto_nhds_iff
In the cocountable topology, a sequence converges to x if and only if it is eventually equal
to x.
theorem tendsto_nhds_iff {u : ℕ → CocountableTopology X} {x : CocountableTopology X} :
Tendsto u atTop (𝓝 x) ↔ ∀ᶠ n in atTop, u n = x
Proof
:= by
refine ⟨AnticompactSpace.sequentiallyDiscreteSpace.eventually_eq_of_tendsto u x, fun h ↦ ?_⟩
exact tendsto_nhds_of_eventually_eq h
On this site: Cocountable topologies: Convergent sequences are eventually constant
variable [Uncountable X]
theorem uncountable
TopologyByExample.CocountableTopology.uncountable
An uncountable cocountable topology has uncountably many points.
theorem uncountable : Uncountable (CocountableTopology X)
Proof
:=
(of (X := X)).injective.uncountable
theorem nonempty
TopologyByExample.CocountableTopology.nonempty
An uncountable cocountable topology is nonempty.
theorem nonempty : Nonempty (CocountableTopology X)
Proof
:=
have := uncountable (X := X)
inferInstance
On this site: Cocountable topologies: the space is nonempty when \(X\) is uncountable
theorem nonempty_inter
TopologyByExample.CocountableTopology.nonempty_inter
In an uncountable cocountable topology, any two nonempty open sets meet: otherwise the whole space would be the union of their two countable complements.
theorem nonempty_inter {U V : Set (CocountableTopology X)} (hU : IsOpen U) (hV : IsOpen V)
(hU' : U.Nonempty) (hV' : V.Nonempty) : (U ∩ V).Nonempty
Proof
:= by
have := uncountable (X := X)
by_contra h
rw [not_nonempty_iff_eq_empty] at h
apply not_countable_univ (α := CocountableTopology X)
rw [← compl_empty, ← h, compl_inter]
exact (isOpen_iff.1 hU hU').union (isOpen_iff.1 hV hV')
instance preirreducibleSpace
TopologyByExample.CocountableTopology.preirreducibleSpace
An uncountable cocountable topology is hyperconnected: any two nonempty open sets meet.
instance preirreducibleSpace : PreirreducibleSpace (CocountableTopology X)
Proof
:=
⟨fun _ _ hU hV ⟨x, _, hxU⟩ ⟨y, _, hyV⟩ ↦ by
simpa using nonempty_inter hU hV ⟨x, hxU⟩ ⟨y, hyV⟩⟩
On this site: Cocountable topologies: the space is hyperconnected when \(X\) is uncountable
theorem not_separableSpace
TopologyByExample.CocountableTopology.not_separableSpace
An uncountable cocountable topology is not separable: a countable set is closed, so it is its own closure, which is not the whole space.
theorem not_separableSpace : ¬SeparableSpace (CocountableTopology X)
Proof
:= fun _ ↦ by
have := uncountable (X := X)
obtain ⟨D, hDc, hDd⟩ := exists_countable_dense (CocountableTopology X)
apply not_countable_univ (α := CocountableTopology X)
rw [← hDd.closure_eq, hDc.isClosed_cocountableTopology.closure_eq]
exact hDc
On this site: Cocountable topologies: the space is not separable when \(X\) is uncountable
theorem not_isMeagre_univ
TopologyByExample.CocountableTopology.not_isMeagre_univ
An uncountable cocountable topology is of second category: a nowhere dense set has a closure other than the whole space, so it is countable, and countably many countable sets do not cover an uncountable set.
theorem not_isMeagre_univ : ¬IsMeagre (univ : Set (CocountableTopology X))
Proof
:= by
intro h
have := uncountable (X := X)
obtain ⟨S, hSn, hSc, hS⟩ := isMeagre_iff_countable_union_isNowhereDense.1 h
have hcount (t : Set (CocountableTopology X)) (ht : t ∈ S) : t.Countable := by
rcases isClosed_iff.1 (isClosed_closure (s := t)) with h1 | h1
· have hnd := hSn t ht
rw [IsNowhereDense, h1, interior_univ] at hnd
obtain ⟨x⟩ : Nonempty (CocountableTopology X) := inferInstance
exact absurd (hnd ▸ mem_univ x) (notMem_empty x)
· exact h1.mono subset_closure
exact not_countable_univ ((hSc.sUnion fun t ht ↦ hcount t ht).mono hS)
On this site: Cocountable topologies: the space is of second category when \(X\) is uncountable
On this site: Family: Cocountable topologies