Separable Spaces

lean4-prooftopologyvisualization
DX,  D0 and D=X\exists\, D \subseteq X,\; |D| \le \aleph_0 \text{ and } \overline{D} = X

Statement

A topological space XX is separable if it contains a countable dense subset DXD \subseteq X:

DX,D0andD=X.\exists\, D \subseteq X,\quad |D| \le \aleph_0 \quad \text{and} \quad \overline{D} = X.

The real line R\mathbb{R} is separable: Q\mathbb{Q} is countable and dense in R\mathbb{R} (between any two reals lies a rational). By contrast, an uncountable discrete space (every singleton open) is not separable: any dense set must contain every point.

Visualization

Dense rational approximation to arbitrary reals:

Real line ℝ:
  ...─────[0]─────[0.3]──[0.33]─[0.333]──···──[1/3]──[0.5]─────[1]─────...
                   │      │       │              │
                  3/10  33/100  333/1000       exact  ← rationals approaching 1/3

Dense subset D = ℚ:
  Every open interval (a, b) ⊆ ℝ contains a rational:
  a < p/q < b  for some integers p, q  (Archimedean property)

                    a         p/q        b
  ──────────────────(──────────•──────────)──────────────▶
                    ↑                     ↑
               any open ball     contains a rational

Non-separable example (co-countable topology comparison):

SpaceDense subsetCountable?Separable?
R\mathbb{R} (standard)Q\mathbb{Q}yesyes
R\mathbb{R} (discrete)R\mathbb{R} itselfnono
Rn\mathbb{R}^nQn\mathbb{Q}^nyesyes
\ell^\infty (bounded sequences)none countablenono

Proof Sketch

R\mathbb{R} is separable:

  1. Countability: Q\mathbb{Q} is countable — it bijects with Z×Z>0\mathbb{Z} \times \mathbb{Z}_{>0}, which is countable.
  2. Density: For any xRx \in \mathbb{R} and ε>0\varepsilon > 0, we need a rational in (xε,x+ε)(x - \varepsilon, x + \varepsilon).
  3. By the Archimedean property, pick nNn \in \mathbb{N} with n>1/εn > 1/\varepsilon. Then nx/n\lfloor nx \rfloor / n is rational and within 1/n<ε1/n < \varepsilon of xx.
  4. Hence Q\mathbb{Q} is dense, so Q=R\overline{\mathbb{Q}} = \mathbb{R} and R\mathbb{R} is separable.

General principle: a metrizable separable space has a countable basis, hence is second-countable (the converse direction requires metric structure).

Connections

  • Heine–Borel TheoremHeine–Borel TheoremKRn  compact    K  closed and boundedK \subseteq \mathbb{R}^n \;\text{compact} \iff K \;\text{closed and bounded}In ℝⁿ, a subset is compact if and only if it is closed and boundedRead more → — compact metric spaces are separable (a compact metric space has a finite ε\varepsilon-net for every ε>0\varepsilon > 0, yielding a countable dense set).
  • Baire Category TheoremBaire Category Theoremn=1Un dense,Un open dense in complete metric space\bigcap_{n=1}^{\infty} U_n \text{ dense},\quad U_n \text{ open dense in complete metric space}In a complete metric space, the intersection of countably many dense open sets is denseRead more → — in a complete metric space, separability is equivalent to second-countability via IsSeparable.secondCountableTopology.
  • Bolzano–Weierstrass TheoremBolzano–Weierstrass Theorembounded (xn)Rn    convergent subsequence\text{bounded } (x_n) \subseteq \mathbb{R}^n \implies \exists\, \text{convergent subsequence}Every bounded sequence in ℝⁿ has a convergent subsequenceRead more → — a separable metric space satisfies a sequential compactness criterion: bounded sequences have convergent subsequences (Bolzano–Weierstrass gives this for Rn\mathbb{R}^n).

Lean4 Proof

import Mathlib.Topology.Bases
import Mathlib.Topology.Algebra.Order.Archimedean

/-- **ℝ is separable**: the rationals are countable and dense in ℝ.
    Mathlib's `Rat.denseRange_cast` gives density of ℚ → ℝ;
    `SeparableSpace` bundles the countable dense-subset witness. -/
theorem real_isSeparable : SeparableSpace  := inferInstance