Metrizable Spaces

lean4-prooftopologyvisualization
d:X×XR0,  τ=τd\exists\, d:\, X\times X\to\mathbb{R}_{\ge 0},\;\tau = \tau_d

Statement

A topological space (X,τ)(X, \tau) is metrizable if there exists a metric d:X×XR0d : X \times X \to \mathbb{R}_{\ge 0} such that τ\tau equals the metric topology τd\tau_d (open balls form a basis):

d:X×XR0,τ=τd.\exists\, d: X \times X \to \mathbb{R}_{\ge 0},\quad \tau = \tau_d.

Urysohn Metrization Theorem: A regular Hausdorff (T3T_3) second-countable topological space is metrizable.

In Mathlib, MetrizableSpace X extends PseudoMetrizableSpace X (admits a compatible pseudometric) with T0Space X. Every metrizable space is T2T_2 (Hausdorff) and regular.

Visualization

Rn\mathbb{R}^n as a metrizable space — Euclidean metric induces the standard topology:

ℝ² with Euclidean metric d(x,y) = √((x₁-y₁)² + (x₂-y₂)²):

         y₂
          │         r
          │      ╭──────╮
          │     /    p   \    Open ball B_r(p) = {x : d(x,p) < r}
          │     \        /
          │      ╰──────╯
          └──────────────────── y₁

  Standard topology basis: {B_r(p) : p ∈ ℚ², r ∈ ℚ₊}  ← countable

  Finite products of metrizable spaces are metrizable:
  d_prod((x,y),(x',y')) = max(d_X(x,x'), d_Y(y,y'))  or  √(d_X² + d_Y²)

Which spaces are metrizable?

SpaceMetrizable?Witness
Rn\mathbb{R}^nyesEuclidean metric
[0,1]N[0,1]^\mathbb{N} (Hilbert cube)yes<span class="math-inline" data-latex="\sum 2^{-n}
[0,1]R[0,1]^{\mathbb{R}} (uncountable product)nonot first-countable
Discrete uncountableyesd(x,y)=1[xy]d(x,y) = \mathbb{1}[x \ne y]
Co-finite topology on R\mathbb{R}nonot Hausdorff

Proof Sketch

Urysohn Metrization (sketch):

  1. Separation: XX is regular (T3T_3) and second-countable; by Urysohn's lemma, for each pair of disjoint closed sets F,GF, G there exists a continuous f:X[0,1]f: X \to [0,1] with fF=0f|_F = 0, fG=1f|_G = 1.
  2. Countable separating family: second-countability yields countably many such functions {fn:X[0,1]}\{f_n : X \to [0,1]\} that separate points.
  3. Embedding: define ι:X[0,1]N\iota: X \to [0,1]^{\mathbb{N}} by ι(x)n=fn(x)\iota(x)_n = f_n(x). This is a topological embedding (continuous, injective, open onto image).
  4. Hilbert cube is metrizable: [0,1]N[0,1]^{\mathbb{N}} carries the metric d(x,y)=n2nxnynd(x,y) = \sum_{n} 2^{-n} |x_n - y_n|, which is compatible with the product topology.
  5. Subspace metric: pull the Hilbert cube metric back through ι\iota to get a compatible metric on XX.

Connections

  • Second-Countable SpacesSecond-Countable SpacesB countable basis for τ:  Uτ,  U=BB,BUB\exists\,\mathcal{B}\text{ countable basis for }\tau:\;\forall\, U\in\tau,\;U = \bigcup_{B\in\mathcal{B},B\subseteq U} BA topological space is second-countable if its topology has a countable basisRead more → — second-countability is the key hypothesis in Urysohn metrization; without it regularity alone does not suffice.
  • Regular SpaceRegular SpaceC closed,pC:  UC,Vp open,  UV=\forall\,C\text{ closed},\, p\notin C:\;\exists\,U\supseteq C,\,V\ni p\text{ open},\;U\cap V=\emptysetA topological space is regular if a closed set and a disjoint point can be separated by open neighborhoodsRead more → — the T3T_3 axiom (regular + T1T_1) is the other hypothesis; together with second-countability it characterizes metrizable spaces among T1T_1 spaces.
  • Urysohn's LemmaUrysohn's Lemmaf:X[0,1],fs=0,  ft=1\exists\, f : X \to [0,1],\quad f|_s = 0,\; f|_t = 1In a normal space, disjoint closed sets can be separated by a continuous functionRead more → — the core tool in the metrization proof: normal spaces admit continuous real-valued separation functions.
  • Tychonoff's TheoremTychonoff's TheoremiIXi compact    i,  Xi compact\prod_{i \in I} X_i \text{ compact} \iff \forall i,\; X_i \text{ compact}An arbitrary product of compact spaces is compact in the product topologyRead more → — the Hilbert cube [0,1]N[0,1]^{\mathbb{N}} is compact by Tychonoff; Urysohn metrization embeds second-countable regular spaces into it.

Lean4 Proof

import Mathlib.Topology.Metrizable.Basic
import Mathlib.Topology.MetricSpace.ProperSpace

/-- Every pseudometric space is pseudo-metrizable — direct instance. -/
instance {X : Type*} [PseudoMetricSpace X] : PseudoMetrizableSpace X :=
  inferInstance

/-- **ℝ is metrizable** (T0 + pseudo-metrizable). -/
theorem real_metrizable : MetrizableSpace  := inferInstance

/-- Products of metrizable spaces are metrizable. -/
theorem prod_metrizable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    [MetrizableSpace X] [MetrizableSpace Y] : MetrizableSpace (X × Y) :=
  inferInstance