Lean library · module TopologyByExample.Theorems.Category
Completeness and category
This file relates complete metrizability, Baire spaces, being of second category in oneself (not
meagre in oneself) and having an isolated point. How complete metrizability and second category
behave under disjoint sums, binary products, countable powers and the closed extension is proved
with the other transfers, in the files TopologyByExample.Operators.Sum, .Product,
.CountablePower and .ClosedExtension.
A space of second category is nonempty, so the classical statements "every Baire space (every
completely metrizable space, every locally compact Hausdorff space) is of second category" need
the space to be nonempty. They are stated here in two forms: for a nonempty Baire space
(TopologyByExample.not_isMeagre_univ_of_baireSpace), and unconditionally as "a Baire space that
is meagre in itself is empty" (TopologyByExample.isEmpty_of_baireSpace_of_isMeagre_univ).
Main statements
TopologyByExample.isCompletelyMetrizableSpace_of_metrizableSpace_of_weaklyLocallyCompactSpace: a weakly locally compact metrizable space is completely metrizable (it is open in the completion of any compatible metric).TopologyByExample.baireSpace_of_countablyCompactSpace_of_regularSpace: a countably compact regular space is a Baire space.TopologyByExample.baireSpace_of_continuous_of_surjective: if a continuous surjection onto a Baire space maps every nonempty open set onto a set containing a nonempty open set in the sense that the preimage of that open set lies inside it, its domain is a Baire space. The special case of two topologies on one set, the finer one with this property, isTopologyByExample.baireSpace_of_le.TopologyByExample.baireSpace_of_isOpen_of_dense: a space with a dense open Baire subspace is a Baire space.TopologyByExample.baireSpace_of_isInducing_of_denseRange,TopologyByExample.baireSpace_of_dense: a space with a dense Baire subspace, open or not, is a Baire space.TopologyByExample.baireSpace_of_forall_specializes: a space with a point whose closure is the whole space is a Baire space.TopologyByExample.not_isMeagre_univ_of_hasIsolatedPoint: a space with an isolated point is of second category;TopologyByExample.hasIsolatedPoint_of_countable_of_not_isMeagre_univ: a countable T₁ space of second category has an isolated point.TopologyByExample.EmptySpace.not_not_isMeagre_univ,TopologyByExample.OnePointSpace.not_isMeagre_univ: the empty space is meagre in itself, the one-point space is not.
Tags
Baire space, meagre, second category, completely metrizable, isolated point
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
Complete metrizability
variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
theorem metrizableSpace_of_isCompletelyMetrizableSpace
TopologyByExample.metrizableSpace_of_isCompletelyMetrizableSpace
A completely metrizable space is metrizable.
theorem metrizableSpace_of_isCompletelyMetrizableSpace [IsCompletelyMetrizableSpace X] :
MetrizableSpace X
Proof
:=
inferInstance
On this site: Theorem: Completely metrizable spaces are metrizable
theorem baireSpace_of_isCompletelyMetrizableSpace
TopologyByExample.baireSpace_of_isCompletelyMetrizableSpace
A completely metrizable space is a Baire space (the Baire category theorem).
theorem baireSpace_of_isCompletelyMetrizableSpace [IsCompletelyMetrizableSpace X] :
BaireSpace X
Proof
:=
inferInstance
On this site: Theorem: Completely metrizable spaces are Baire spaces
theorem isCompletelyMetrizableSpace_of_discreteTopology
TopologyByExample.isCompletelyMetrizableSpace_of_discreteTopology
A discrete space is completely metrizable.
theorem isCompletelyMetrizableSpace_of_discreteTopology [DiscreteTopology X] :
IsCompletelyMetrizableSpace X
Proof
:=
inferInstance
On this site: Theorem: Discrete spaces are completely metrizable
theorem isOpen_range_of_isDenseInducing
TopologyByExample.isOpen_range_of_isDenseInducing
The range of a dense inducing map from a weakly locally compact space into a Hausdorff space is open.
theorem isOpen_range_of_isDenseInducing [WeaklyLocallyCompactSpace X] [T2Space Y] {f : X → Y}
(hf : IsDenseInducing f) : IsOpen (range f)
Proof
:= by
rw [isOpen_iff_mem_nhds]
rintro _ ⟨x, rfl⟩
obtain ⟨K, hK, hKx⟩ := exists_compact_mem_nhds x
rw [hf.isInducing.nhds_eq_comap, mem_comap] at hKx
obtain ⟨t, ht, htK⟩ := hKx
obtain ⟨U, hUt, hU, hxU⟩ := mem_nhds_iff.1 ht
refine mem_of_superset (hU.mem_nhds hxU) ?_
have hc : IsClosed (f '' K) := (hK.image hf.continuous).isClosed
calc U ⊆ closure (U ∩ range f) := hf.dense.open_subset_closure_inter hU
_ ⊆ f '' K := closure_minimal (fun _ ⟨hyU, x', hx'⟩ ↦
⟨x', htK (by rw [mem_preimage, hx']; exact hUt hyU), hx'⟩) hc
_ ⊆ range f := image_subset_range _ _
theorem isCompletelyMetrizableSpace_of_metrizableSpace_of_weaklyLocallyCompactSpace
TopologyByExample.isCompletelyMetrizableSpace_of_metrizableSpace_of_weaklyLocallyCompactSpace
A weakly locally compact metrizable space is completely metrizable: choosing a compatible metric, the space is open in its completion, and an open subspace of a complete metric space is completely metrizable.
theorem isCompletelyMetrizableSpace_of_metrizableSpace_of_weaklyLocallyCompactSpace
[MetrizableSpace X] [WeaklyLocallyCompactSpace X] : IsCompletelyMetrizableSpace X
Proof
:= by
let := metrizableSpaceMetric X
have he := UniformSpace.Completion.isDenseEmbedding_coe (α := X)
have := (isOpen_range_of_isDenseInducing he.isDenseInducing).isCompletelyMetrizableSpace
exact he.isEmbedding.toHomeomorph.isClosedEmbedding.IsCompletelyMetrizableSpace
On this site: Theorem: Weakly locally compact metrizable spaces are completely metrizable
Baire spaces
variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
theorem baireSpace_of_regularSpace_of_weaklyLocallyCompactSpace
TopologyByExample.baireSpace_of_regularSpace_of_weaklyLocallyCompactSpace
A weakly locally compact regular space is a Baire space: it is locally compact and R₁.
theorem baireSpace_of_regularSpace_of_weaklyLocallyCompactSpace [RegularSpace X]
[WeaklyLocallyCompactSpace X] : BaireSpace X
Proof
:=
inferInstance
On this site: Theorem: Weakly locally compact regular spaces are Baire spaces
theorem baireSpace_of_countablyCompactSpace_of_regularSpace
TopologyByExample.baireSpace_of_countablyCompactSpace_of_regularSpace
A countably compact regular space is a Baire space. Inside a nonempty open set, regularity gives a decreasing sequence of nonempty open sets, the closure of each lying inside the previous one and inside the next dense open set; countable compactness gives a point in all their closures.
theorem baireSpace_of_countablyCompactSpace_of_regularSpace [CountablyCompactSpace X]
[RegularSpace X] : BaireSpace X
Proof
:= by
refine ⟨fun f ho hd ↦ dense_iff_inter_open.2 fun V hV hVne ↦ ?_⟩
let S := {W : Set X // IsOpen W ∧ W.Nonempty}
have step : ∀ (n : ℕ) (W : S), ∃ W' : S, closure W'.val ⊆ W.val ∩ f n := by
rintro n ⟨W, hW, hWne⟩
obtain ⟨y, hy⟩ := (hd n).inter_open_nonempty W hW hWne
obtain ⟨C, hC, hCc, hCs⟩ := exists_mem_nhds_isClosed_subset ((hW.inter (ho n)).mem_nhds hy)
exact ⟨⟨interior C, isOpen_interior, y, mem_interior_iff_mem_nhds.2 hC⟩,
(closure_minimal interior_subset hCc).trans hCs⟩
choose g hg using step
let s : ℕ → S := fun n ↦ Nat.rec ⟨V, hV, hVne⟩ (fun k w ↦ g k w) n
have hs : ∀ n, closure (s (n + 1)).val ⊆ (s n).val ∩ f n := fun n ↦ hg n (s n)
have hanti : Antitone fun n ↦ (s n).val := antitone_nat_of_succ_le fun n ↦
subset_closure.trans ((hs n).trans inter_subset_left)
choose x hx using fun n ↦ (s n).property.2
obtain ⟨a, -, ha⟩ :=
(CountablyCompactSpace.isCountablyCompact_univ (E := X)).seq_clusterPt x
(Eventually.of_forall fun _ ↦ mem_univ _)
have hmem : ∀ n, a ∈ closure (s n).val := fun n ↦
closure_mono (image_subset_iff.2 fun (m : ℕ) (hm : n ≤ m) ↦ hanti hm (hx m) :
x '' Ici n ⊆ (s n).val) (mapClusterPt_atTop_iff_forall_mem_closure.1 ha n)
refine ⟨a, ?_, mem_iInter.2 fun n ↦ ((hs n) (hmem (n + 1))).2⟩
exact ((hs 0) (hmem 1)).1
On this site: Theorem: Countably compact regular spaces are Baire spaces
theorem isEmpty_of_baireSpace_of_isMeagre_univ
TopologyByExample.isEmpty_of_baireSpace_of_isMeagre_univ
A Baire space that is meagre in itself is empty.
theorem isEmpty_of_baireSpace_of_isMeagre_univ [BaireSpace X] (h : IsMeagre (univ : Set X)) :
IsEmpty X
Proof
:=
not_nonempty_iff.1 fun _ ↦ not_isMeagre_of_isOpen isOpen_univ univ_nonempty h
theorem subsingleton_of_baireSpace_of_isMeagre_univ
TopologyByExample.subsingleton_of_baireSpace_of_isMeagre_univ
A Baire space that is meagre in itself has at most one point (indeed, it is empty).
theorem subsingleton_of_baireSpace_of_isMeagre_univ [BaireSpace X]
(h : IsMeagre (univ : Set X)) : Subsingleton X
Proof
:=
have := isEmpty_of_baireSpace_of_isMeagre_univ h
inferInstance
On this site: Theorem: A Baire space that is not of second category has at most one point
theorem not_isMeagre_univ_of_baireSpace
TopologyByExample.not_isMeagre_univ_of_baireSpace
A nonempty Baire space is of second category in itself.
theorem not_isMeagre_univ_of_baireSpace [BaireSpace X] [Nonempty X] :
¬IsMeagre (univ : Set X)
Proof
:=
not_isMeagre_of_isOpen isOpen_univ univ_nonempty
On this site: Theorem: A nonempty Baire space is of second category
theorem isNowhereDense_image_of_continuous_of_surjective
TopologyByExample.isNowhereDense_image_of_continuous_of_surjective
Under a continuous surjection, the image of a nowhere dense set is nowhere dense, provided every nonempty open set of the domain contains the preimage of a nonempty open set.
theorem isNowhereDense_image_of_continuous_of_surjective {f : X → Y} (hf : Continuous f)
(hs : Function.Surjective f)
(h : ∀ U : Set X, IsOpen U → U.Nonempty → ∃ V : Set Y, IsOpen V ∧ V.Nonempty ∧ f ⁻¹' V ⊆ U)
{N : Set X} (hN : IsNowhereDense N) : IsNowhereDense (f '' N)
Proof
:= by
by_contra hW
have hWne : (interior (closure (f '' N))).Nonempty := ne_empty_iff_nonempty.1 hW
have hU : IsOpen (f ⁻¹' interior (closure (f '' N)) \ closure N) :=
(isOpen_interior.preimage hf).sdiff isClosed_closure
have hUne : (f ⁻¹' interior (closure (f '' N)) \ closure N).Nonempty := by
rw [sdiff_nonempty]
intro hsub
obtain ⟨y, hy⟩ := hWne
obtain ⟨x, rfl⟩ := hs y
have := interior_maximal hsub (isOpen_interior.preimage hf) hy
rw [show interior (closure N) = ∅ from hN] at this
exact this
obtain ⟨V, hV, ⟨y, hyV⟩, hVU⟩ := h _ hU hUne
obtain ⟨x, rfl⟩ := hs y
have hmem : f x ∈ closure (f '' N) := interior_subset (hVU hyV).1
obtain ⟨_, hzV, n, hn, rfl⟩ := mem_closure_iff.1 hmem V hV hyV
exact (hVU hzV).2 (subset_closure hn)
theorem baireSpace_of_continuous_of_surjective
TopologyByExample.baireSpace_of_continuous_of_surjective
If f : X → Y is a continuous surjection onto a Baire space and every nonempty open subset
of X contains the preimage of a nonempty open subset of Y, then X is a Baire space: the
image of a nowhere dense set is nowhere dense, so a nonempty open set of X covered by countably
many nowhere dense sets would give a nonempty open set of Y covered by countably many nowhere
dense sets.
theorem baireSpace_of_continuous_of_surjective [BaireSpace Y] {f : X → Y} (hf : Continuous f)
(hs : Function.Surjective f)
(h : ∀ U : Set X, IsOpen U → U.Nonempty → ∃ V : Set Y, IsOpen V ∧ V.Nonempty ∧ f ⁻¹' V ⊆ U) :
BaireSpace X
Proof
:= by
rw [baireSpace_iff_interior_iUnion_eq_empty]
intro F _ hFnd
by_contra hne
obtain ⟨V, hV, hVne, hVU⟩ := h _ isOpen_interior (ne_empty_iff_nonempty.1 hne)
refine not_isMeagre_of_isOpen hV hVne ((isMeagre_iUnion fun n ↦
(isNowhereDense_image_of_continuous_of_surjective hf hs h (hFnd n)).isMeagre).mono ?_)
intro y hy
obtain ⟨x, rfl⟩ := hs y
obtain ⟨n, hn⟩ := mem_iUnion.1 (interior_subset (hVU hy))
exact mem_iUnion.2 ⟨n, mem_image_of_mem f hn⟩
On this site: Theorem: A space mapping onto a Baire space so that nonempty open sets contain preimages of nonempty open sets is Baire
theorem baireSpace_of_le
TopologyByExample.baireSpace_of_le
A topology t finer than a Baire topology s, every nonempty t-open set of which contains a
nonempty s-open set, is a Baire topology.
theorem baireSpace_of_le {X : Type*} {t s : TopologicalSpace X} [@BaireSpace X s] (hle : t ≤ s)
(h : ∀ U : Set X, IsOpen[t] U → U.Nonempty → ∃ V : Set X, IsOpen[s] V ∧ V.Nonempty ∧ V ⊆ U) :
@BaireSpace X t
Proof
:=
@baireSpace_of_continuous_of_surjective X X t s _ id (continuous_id_of_le hle)
Function.surjective_id h
On this site: Theorem: A finer topology whose nonempty open sets contain nonempty open sets of a Baire topology is Baire
theorem baireSpace_of_isOpen_of_dense
TopologyByExample.baireSpace_of_isOpen_of_dense
A space with a dense open subset that is a Baire space (in the subspace topology) is a Baire space.
theorem baireSpace_of_isOpen_of_dense {Y : Type*} [TopologicalSpace Y] {U : Set Y} (hU : IsOpen U)
(hd : Dense U) [BaireSpace U] : BaireSpace Y
Proof
:= by
refine ⟨fun f hfo hfd ↦ ?_⟩
have hint : Dense (⋂ n, ((↑) : U → Y) ⁻¹' f n) :=
dense_iInter_of_isOpen (fun n ↦ (hfo n).preimage continuous_subtypeVal)
fun n ↦ (hfd n).preimage hU.isOpenMap_subtypeVal
refine (hd.denseRange_subtypeVal.dense_image continuous_subtypeVal hint).mono ?_
rintro _ ⟨y, hy, rfl⟩
exact mem_iInter.2 fun n ↦ mem_iInter.1 hy n
On this site: Theorem: A space with a dense open Baire subspace is a Baire space
Spaces with a generic point
variable {X : Type*} [TopologicalSpace X]
theorem baireSpace_of_forall_specializes
TopologyByExample.baireSpace_of_forall_specializes
A space with a point whose closure is the whole space is a Baire space: every dense open set contains that point, so a countable intersection of dense open sets contains it too, and is dense because the point is.
theorem baireSpace_of_forall_specializes (p : X) (h : ∀ x, p ⤳ x) : BaireSpace X
Proof
where
baire_property f hfo hfd := by
have hp : p ∈ ⋂ n, f n := mem_iInter.2 fun n ↦ by
obtain ⟨x, hx⟩ := (hfd n).nonempty_iff.2 ⟨p⟩
exact (h x).mem_open (hfo n) hx
refine dense_iff_closure_eq.2 (eq_univ_of_forall fun x ↦ ?_)
exact closure_mono (singleton_subset_iff.2 hp) (specializes_iff_mem_closure.1 (h x))
On this site: Theorem: A space with a point whose closure is the whole space is a Baire space
Isolated points and second category
variable {X : Type*} [TopologicalSpace X]
theorem not_isMeagre_univ_of_hasIsolatedPoint
TopologyByExample.not_isMeagre_univ_of_hasIsolatedPoint
A space with an isolated point is of second category in itself: an isolated point lies in no nowhere dense set.
theorem not_isMeagre_univ_of_hasIsolatedPoint [HasIsolatedPoint X] :
¬IsMeagre (univ : Set X)
Proof
:= by
obtain ⟨x, hx⟩ := HasIsolatedPoint.exists_isOpen_singleton (X := X)
rw [isMeagre_iff_countable_union_isNowhereDense]
rintro ⟨S, hS, -, hsub⟩
obtain ⟨t, htS, hxt⟩ := mem_sUnion.1 (hsub (mem_univ x))
have : x ∈ interior (closure t) :=
interior_maximal (singleton_subset_iff.2 (subset_closure hxt)) hx (mem_singleton x)
exact (hS t htS : interior (closure t) = ∅).subset this
On this site: Theorem: A space with an isolated point is of second category
theorem isEmpty_of_scatteredSpace_of_not_hasIsolatedPoint
TopologyByExample.isEmpty_of_scatteredSpace_of_not_hasIsolatedPoint
A scattered space with no isolated point is empty: the whole space is then dense in itself.
theorem isEmpty_of_scatteredSpace_of_not_hasIsolatedPoint [ScatteredSpace X]
(h : ¬HasIsolatedPoint X) : IsEmpty X
Proof
:= by
have hp : Preperfect (univ : Set X) := fun x _ ↦ by
have hx : 𝓝[≠] x ≠ ⊥ := fun h' ↦ h ⟨x, (isOpen_singleton_iff_punctured_nhds x).2 h'⟩
change NeBot (𝓝[≠] x ⊓ 𝓟 univ)
rw [principal_univ, inf_top_eq]
exact ⟨hx⟩
exact univ_eq_empty_iff.1 (ScatteredSpace.eq_empty_of_preperfect _ hp)
theorem subsingleton_of_scatteredSpace_of_not_hasIsolatedPoint
TopologyByExample.subsingleton_of_scatteredSpace_of_not_hasIsolatedPoint
A scattered space with no isolated point has at most one point (indeed, it is empty).
theorem subsingleton_of_scatteredSpace_of_not_hasIsolatedPoint [ScatteredSpace X]
(h : ¬HasIsolatedPoint X) : Subsingleton X
Proof
:=
have := isEmpty_of_scatteredSpace_of_not_hasIsolatedPoint h
inferInstance
On this site: Theorem: A scattered space with no isolated point has at most one point
theorem hasIsolatedPoint_of_countable_of_not_isMeagre_univ
TopologyByExample.hasIsolatedPoint_of_countable_of_not_isMeagre_univ
A countable T₁ space of second category in itself has an isolated point: otherwise every singleton is closed with empty interior, and the space is the countable union of its singletons.
theorem hasIsolatedPoint_of_countable_of_not_isMeagre_univ [Countable X] [T1Space X]
(h : ¬IsMeagre (univ : Set X)) : HasIsolatedPoint X
Proof
:= by
by_contra hno
refine h ?_
rw [← iUnion_of_singleton X]
refine isMeagre_iUnion fun x ↦ IsNowhereDense.isMeagre ?_
have : NeBot (𝓝[≠] x) := ⟨fun h' ↦ hno ⟨x, (isOpen_singleton_iff_punctured_nhds x).2 h'⟩⟩
change interior (closure {x}) = ∅
rw [closure_singleton]
exact interior_singleton x
On this site: Theorem: A countable T₁ space of second category has an isolated point
The empty space and the one-point space
Lean types Empty and Unit (no file of their own).
Dense Baire subspaces
theorem baireSpace_of_isInducing_of_denseRange
TopologyByExample.baireSpace_of_isInducing_of_denseRange
A space into which a Baire space embeds (by an inducing map) with dense image is a Baire space.
theorem baireSpace_of_isInducing_of_denseRange {Z X : Type*} [TopologicalSpace Z]
[TopologicalSpace X] [BaireSpace Z] {f : Z → X} (hf : IsInducing f) (hd : DenseRange f) :
BaireSpace X
Proof
:= by
refine ⟨fun U hUo hUd ↦ ?_⟩
have hpre : ∀ n, Dense (f ⁻¹' U n) := fun n ↦ by
refine dense_iff_inter_open.2 fun O hO hOne ↦ ?_
obtain ⟨O', hO', rfl⟩ := hf.isOpen_iff.1 hO
obtain ⟨z, hz⟩ := hOne
obtain ⟨w, hw⟩ := hd.exists_mem_open (hO'.inter (hUo n))
((hUd n).inter_open_nonempty O' hO' ⟨f z, hz⟩)
exact ⟨w, hw.1, hw.2⟩
have hint : Dense (⋂ n, f ⁻¹' U n) :=
dense_iInter_of_isOpen (fun n ↦ (hUo n).preimage hf.continuous) hpre
refine (hd.dense_image hf.continuous hint).mono ?_
rintro _ ⟨z, hz, rfl⟩
exact mem_iInter.2 fun n ↦ mem_iInter.1 hz n
theorem baireSpace_of_dense
TopologyByExample.baireSpace_of_dense
A space with a dense Baire subspace is a Baire space.
theorem baireSpace_of_dense {X : Type*} [TopologicalSpace X] {D : Set X} (hD : Dense D)
[BaireSpace D] : BaireSpace X
Proof
:=
baireSpace_of_isInducing_of_denseRange IsInducing.subtypeVal hD.denseRange_subtypeVal
On this site: Theorem: A space with a dense Baire subspace is a Baire space
theorem not_not_isMeagre_univ
TopologyByExample.EmptySpace.not_not_isMeagre_univ
The empty space is not of second category: it is meagre in itself.
theorem not_not_isMeagre_univ : ¬¬IsMeagre (univ : Set Empty)
Proof
:=
not_not_intro isMeagre_univ_of_isEmpty
On this site: The empty space is not of second category
theorem not_isMeagre_univ
TopologyByExample.OnePointSpace.not_isMeagre_univ
The one-point space is of second category.
theorem not_isMeagre_univ : ¬IsMeagre (univ : Set Unit)
Proof
:=
not_isMeagre_univ_of_subsingleton