Urysohn's Lemma

lean4-prooftopologyseparationvisualization
f:X[0,1],fs=0,  ft=1\exists\, f : X \to [0,1],\quad f|_s = 0,\; f|_t = 1

Statement

Let XX be a normal topological space (T4: disjoint closed sets can be separated by open sets). For any two disjoint closed sets s,tXs, t \subseteq X, there exists a continuous function f:X[0,1]f : X \to [0,1] such that

f(x)=0 for all xs,f(x)=1 for all xt.f(x) = 0 \text{ for all } x \in s, \qquad f(x) = 1 \text{ for all } x \in t.

Visualization

Two disjoint closed discs ss (left) and tt (right) in R2\mathbb{R}^2, with the separating function drawn as altitude:

ℝ² top view (f is height, shown as contour levels):

       s                        t
   ●●●●●●●     0.25   0.5   0.75  ●●●●●●●
  ●●●●●●●●●  ──┄┄┄───┄┄┄───┄┄┄──  ●●●●●●●●●
  ●●●●●●●●●  f=0      ↑       f=1 ●●●●●●●●●
   ●●●●●●●    contour lines of f   ●●●●●●●●
              evenly spaced in the gap

f = 0 everywhere on s (left disc, solid)
f = 1 everywhere on t (right disc, solid)
f rises smoothly from 0 to 1 across the gap
f is continuous — no jumps allowed

The function ff acts as a "landscape" separating the two closed islands. Normality of XX is what guarantees the gap between ss and tt is wide enough (in the topological sense) to fill with a continuous slope.

Proof Sketch

Step 1. Since XX is normal and st=s \cap t = \varnothing, find disjoint open sets U0sU_0 \supseteq s and V0tV_0 \supseteq t.

Step 2. Using normality repeatedly on dyadic rationals D={k/2n:0k2n,n1}D = \{k/2^n : 0 \le k \le 2^n,\, n \ge 1\}, construct a family of open sets {Ur:rD}\{U_r : r \in D\} with UrUr\overline{U_r} \subseteq U_{r'} whenever r<rr < r'.

Step 3. Define f(x)=inf{rD:xUr}f(x) = \inf\{r \in D : x \in U_r\} (with inf=1\inf \varnothing = 1). Verifying continuity uses the chain {Ur}\{U_r\}; the boundary conditions fs=0f|_s = 0 and ft=1f|_t = 1 follow by construction.

This inductive "dyadic filling" is the core of Urysohn's construction.

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 Hausdorff spaces are normal, so Urysohn applies; in Rn\mathbb{R}^n normality is automatic.
  • 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 → — Urysohn functions give explicit test functions used to separate limit points of sequences.
  • Brouwer Fixed-Point TheoremBrouwer Fixed-Point Theoremf:DnDn continuous    x,  f(x)=xf : D^n \to D^n \text{ continuous} \implies \exists\, x,\; f(x) = xEvery continuous map from a compact convex set to itself has a fixed pointRead more → — Urysohn's lemma underlies the partition-of-unity construction, which feeds into degree theory.
  • 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 → — Tychonoff spaces (completely regular) are precisely those where Urysohn-type separation by continuous functions is available; normality strengthens this to full separation.
  • Hausdorff DistanceHausdorff DistancedH(A,B)=max(supaAd(a,B), supbBd(b,A))d_H(A, B) = \max\left(\sup_{a \in A} d(a, B),\ \sup_{b \in B} d(b, A)\right)A metric on non-empty compact sets, foundation for the IFS attractor theoremRead more → — Urysohn-type functions appear in the proof that the Hausdorff metric topology on compact subsets of a normal space behaves well.
  • Iterated Function SystemsIterated Function SystemsA=i=1Nfi(A)A = \bigcup_{i=1}^{N} f_i(A)Constructing fractals via contractive affine transformationsRead more → — Partition of unity (an extension of Urysohn) allows gluing local definitions of IFS maps into globally continuous ones.

Lean4 Proof

import Mathlib.Topology.UrysohnsLemma

open Set ContinuousMap

/-- **Urysohn's Lemma**: in a normal topological space, any two disjoint closed sets
    can be separated by a continuous function with values in [0, 1].
    Mathlib: `exists_continuous_zero_one_of_isClosed`. -/
theorem urysohn_separation {X : Type*} [TopologicalSpace X] [NormalSpace X]
    {s t : Set X} (hs : IsClosed s) (ht : IsClosed t) (hst : Disjoint s t) :
     f : C(X, ), EqOn f 0 s  EqOn f 1 t   x, f x  Icc (0 : ) 1 :=
  exists_continuous_zero_one_of_isClosed hs ht hst