The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V13. General topology

Mathlib.Topology.Perfect

26 declarations and 2 deprecated aliases. Mathlib docs · Source

Perfect Sets

In this file we define perfect subsets of a topological space, and prove some basic properties, including a version of the Cantor-Bendixson Theorem.

Main Definitions

  • Preperfect C: A set C is preperfect if every point of C is an accumulation point of C. Equivalently, if it has no isolated points in the induced topology. This property is also called dense-in-itself.
  • Perfect C: A set C is perfect, meaning it is closed and every point of it is an accumulation point of itself.
  • PerfectSpace X: A topological space X is perfect if its universe is a perfect set.

Main Statements

  • preperfect_iff_perfect_closure: In a T1 space, a set is preperfect iff its closure is perfect.
  • Perfect.splitting: A perfect nonempty set contains two disjoint perfect nonempty subsets. The main inductive step in the construction of an embedding from the Cantor space to a perfect nonempty complete metric space.
  • exists_countable_union_perfect_of_isClosed: One version of the Cantor-Bendixson Theorem: A closed set in a second countable space can be written as the union of a countable set and a perfect set.

Implementation notes

We do not require perfect sets to be nonempty.

See also

Mathlib/Topology/MetricSpace/Perfect.lean, for properties of perfect sets in metric spaces, namely Polish spaces.

References

  • [kechris1995] (Chapters 6-7)

Tags

accumulation point, perfect set, dense-in-itself, cantor-bendixson.

theorem AccPt.nhds_inter E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α} {x : α} {U : Set α},
  AccPt x (Filter.principal C) → U ∈ nhds x → AccPt x (Filter.principal (U ∩ C))

If x is an accumulation point of a set C and U is a neighborhood of x, then x is an accumulation point of U ∩ C.

def Preperfect E1 #

{α : Type u_1} → [TopologicalSpace α] → Set α → Prop

A set C is preperfect if all of its points are accumulation points of itself. If α is a T1 space, this is equivalent to the closure of C being perfect, see preperfect_iff_perfect_closure. This property is also called dense-in-itself.

structure Perfect E3 #

{α : Type u_1} → [TopologicalSpace α] → Set α → Prop

A set C is called perfect if it is closed and all of its points are accumulation points of itself. Note that we do not require C to be nonempty.

theorem perfect_def E0 #

∀ {α : Type u_1} [inst : TopologicalSpace α] (C : Set α), Perfect C ↔ IsClosed C ∧ Preperfect C

ctor Perfect.mk E0 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α}, IsClosed C → Preperfect C → Perfect C

theorem Perfect.isClosed E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α}, Perfect C → IsClosed C

theorem Perfect.preperfect E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α}, Perfect C → Preperfect C

theorem preperfect_iff_nhds E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α}, Preperfect C ↔ ∀ x ∈ C, ∀ U ∈ nhds x, ∃ y ∈ U ∩ C, y ≠ x

class PerfectSpace E1 #

(α : Type u_1) → [TopologicalSpace α] → Prop

A topological space X is said to be perfect if its universe is a perfect set. Equivalently, this means that 𝓝[≠] x ≠ ⊥ for every point x : X.

theorem perfectSpace_def E0 #

∀ (α : Type u_1) [inst : TopologicalSpace α], PerfectSpace α ↔ Preperfect Set.univ

ctor PerfectSpace.mk E0 #

∀ {α : Type u_1} [inst : TopologicalSpace α], Preperfect Set.univ → PerfectSpace α

theorem PerfectSpace.univ_preperfect E1 #

∀ {α : Type u_1} {inst : TopologicalSpace α} [self : PerfectSpace α], Preperfect Set.univ

theorem PerfectSpace.univ_perfect E1 #

∀ (α : Type u_1) [inst : TopologicalSpace α] [PerfectSpace α], Perfect Set.univ

theorem Preperfect.open_inter E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C U : Set α}, Preperfect C → IsOpen U → Preperfect (U ∩ C)

The intersection of a preperfect set and an open set is preperfect.

theorem Preperfect.perfect_closure E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α}, Preperfect C → Perfect (closure C)

The closure of a preperfect set is perfect. For a converse, see preperfect_iff_perfect_closure.

theorem IsOpen.preperfect E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] [PerfectSpace α] {U : Set α}, IsOpen U → Preperfect U

theorem IsOpen.perfect_closure E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] [PerfectSpace α] {U : Set α}, IsOpen U → Perfect (closure U)

theorem preperfect_iff_perfect_closure E3 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α} [T1Space α], Preperfect C ↔ Perfect (closure C)

In a T1 space, being preperfect is equivalent to having perfect closure.

theorem Perfect.closure_nhds_inter E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C U : Set α},
  Perfect C → ∀ x ∈ C, x ∈ U → IsOpen U → Perfect (closure (U ∩ C)) ∧ (closure (U ∩ C)).Nonempty

theorem Perfect.splitting E3 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α} [T25Space α],
  Perfect C →
    C.Nonempty → ∃ C₀ C₁, (Perfect C₀ ∧ C₀.Nonempty ∧ C₀ ⊆ C) ∧ (Perfect C₁ ∧ C₁.Nonempty ∧ C₁ ⊆ C) ∧ Disjoint C₀ C₁

Given a perfect nonempty set in a T2.5 space, we can find two disjoint perfect subsets. This is the main inductive step in the proof of the Cantor-Bendixson Theorem.

theorem IsPreconnected.preperfect_of_nontrivial E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] [T1Space α] {U : Set α}, U.Nontrivial → IsPreconnected U → Preperfect U

instance instPerfectSpaceOfT1SpaceOfConnectedSpaceOfNontrivial E0 #

∀ {α : Type u_1} [inst : TopologicalSpace α] [T1Space α] [ConnectedSpace α] [Nontrivial α], PerfectSpace α

theorem exists_countable_union_perfect_of_isClosed E3 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α} [SecondCountableTopology α],
  IsClosed C → ∃ V D, V.Countable ∧ Perfect D ∧ C = V ∪ D

The Cantor-Bendixson Theorem: Any closed subset of a second countable space can be written as the union of a countable set and a perfect set.

theorem exists_perfect_nonempty_of_isClosed_of_not_countable E1 #

∀ {α : Type u_1} [inst : TopologicalSpace α] {C : Set α} [SecondCountableTopology α],
  IsClosed C → ¬C.Countable → ∃ D, Perfect D ∧ D.Nonempty ∧ D ⊆ C

Any uncountable closed set in a second countable space contains a nonempty perfect subset.

theorem perfectSpace_iff_forall_not_isolated E1 #

∀ {X : Type u_1} [inst : TopologicalSpace X], PerfectSpace X ↔ ∀ (x : X), (nhdsWithin x {x}ᶜ).NeBot

instance PerfectSpace.not_isolated E0 #

∀ {X : Type u_1} [inst : TopologicalSpace X] [PerfectSpace X] (x : X), (nhdsWithin x {x}ᶜ).NeBot

Deprecated aliases

NameNew nameSince
Perfect.accPerfect.preperfect2026-11-12
Perfect.closedPerfect.isClosed2026-11-12