A normal space can put disjoint open sets around two disjoint closed sets. That sounds like a statement about open sets, and it is. The surprise of this page is that it's secretly a statement about functions: from those open sets you can build a continuous function that is $0$ on one closed set and $1$ on the other.
That one construction, Urysohn's lemma, pays for three things. It tells you when a space is secretly a metric space (the Urysohn metrization theorem), it lets you extend continuous functions off a closed set (the Tietze extension theorem), and it shows that normal spaces have plenty of continuous real functions. Practice sits right after each idea, and the Mixed Practice at the bottom takes that hint away.
Here's the statement. The interval $[a, b]$ is just for flexibility; everything happens in $[0, 1]$.
Let $X$ be a normal space. Let $A$ and $B$ be disjoint closed subsets of $X$. Let $a < b$ be real numbers. There exists a continuous function $f\colon X \to [a, b]$ such that $f(x) = a$ for every $x \in A$ and $f(x) = b$ for every $x \in B$.
Proof. It suffices to set $a = 0$ and $b = 1$: compose with $t \mapsto a + (b - a)t$. We divide the proof into steps.
Step 1. Let $P$ be the set of rational numbers in $[0, 1]$. List $P$ as a sequence and assume that $1$ and $0$ are the first two elements on the list. Our goal is to define an open set $U_p$ for each $p \in P$ such that whenever $p < q$, we have $\overline{U_p} \subseteq U_q$. We proceed inductively. First, define $U_1 = X \setminus B$. Second, because $A$ is closed, $A \subseteq U_1$, and $U_1$ is open, normality gives (by the shrinking lemma) an open set $U_0$ such that $$A \subseteq U_0 \quad \text{and} \quad \overline{U_0} \subseteq U_1.$$ In general, let $P_n$ be the first $n$ rational numbers in the list, $n \ge 2$. Suppose $U_p$ is defined for every $p \in P_n$, with $$\overline{U_p} \subseteq U_q \quad \text{whenever } p < q.$$ Let $r$ be the next rational number in the sequence. We wish to define $U_r$. Consider the set $P_{n+1} = P_n \cup \{r\}$. Since $0$ and $1$ are already in $P_n$, the point $r$ has an immediate predecessor $p$ in $P_{n+1}$ and an immediate successor $q$ in $P_{n+1}$. The sets $U_p$ and $U_q$ are already defined, with $\overline{U_p} \subseteq U_q$ by the induction hypothesis. Using normality of $X$ (the shrinking lemma, applied to the closed set $\overline{U_p}$ inside the open set $U_q$), we can find an open set $U_r$ in $X$ such that $$\overline{U_p} \subseteq U_r \quad \text{and} \quad \overline{U_r} \subseteq U_q.$$ This keeps $\overline{U_s} \subseteq U_t$ for all $s < t$ in $P_{n+1}$: if $s \le p$, then $\overline{U_s} \subseteq U_p \subseteq \overline{U_p} \subseteq U_r$ (or $s = p$ directly), and if $t \ge q$, then $\overline{U_r} \subseteq U_q \subseteq U_t$. This completes the inductive step.
Step 2. We have defined $U_p$ for all $p \in \mathbb{Q} \cap [0, 1]$. Extend this definition to all $p \in \mathbb{Q}$ by defining $U_p = \emptyset$ if $p < 0$ and $U_p = X$ if $p > 1$. It is still true that for all $p, q \in \mathbb{Q}$, $p < q \implies \overline{U_p} \subseteq U_q$.
Step 3. Given $x \in X$, define $R(x) = \{p \in \mathbb{Q} : x \in U_p\}$. Define $$f(x) = \inf R(x) = \inf\{p \in \mathbb{Q} : x \in U_p\}.$$ Notice that $f(x) \in [0, 1]$: every $p > 1$ is in $R(x)$, and no $p < 0$ is.
Step 4. We show that $f$ is the desired function. If $x \in A$, then $x \in U_p$ for every rational $p \ge 0$, so $f(x) = 0$. If $x \in B$, then $x \notin U_1$, so $x \notin U_p$ for any $p \le 1$ (as $U_p \subseteq \overline{U_p} \subseteq U_1$ for $p < 1$), and $f(x) = \inf\{p \in \mathbb{Q} : p > 1\} = 1$.
Continuity is tricky. First, we have the following facts, for rational $r$:
Now let $x_0 \in X$ and let $(c, d)$ be an open interval in $\mathbb{R}$ containing $f(x_0)$. Choose $p, q \in \mathbb{Q}$ such that $$c < p < f(x_0) < q < d.$$ We assert that the open set $U = U_q \setminus \overline{U_p}$ maps into $(c, d)$ under $f$ and contains $x_0$. First, note that $x_0 \in U$. This is so because $f(x_0) < q$ implies $x_0 \in U_q$ by (2), and $f(x_0) > p$ implies $x_0 \notin \overline{U_p}$ by (1). Second, we show that $f(U) \subseteq (c, d)$. Let $x \in U$. Then $x \in U_q \subseteq \overline{U_q}$, so $f(x) \le q$ by (1). Next, $x \notin \overline{U_p}$, so $x \notin U_p$, and $f(x) \ge p$ by (2). Therefore $f(U) \subseteq [p, q] \subseteq (c, d)$, as desired. $\blacksquare$
Every step of the construction leans on one tool from the last page: in a normal space, a closed set inside an open set fits inside a smaller open set whose closure still fits.
The shrinking lemma: $X$ is normal exactly when, for every closed $A$ inside an open $U$, there's an open $V$ with $A \subseteq V$ and $\overline{V} \subseteq U$. Urysohn uses it once for $U_0$ and then once for every rational in $[0, 1]$.
Watch the sets arrive in the order the rationals are listed. Each new one squeezes between its two neighbors, and the level curves of $f$ appear one at a time.
One open set for every rational in $[0, 1]$. One. At. A. Time. Somewhere an induction is filing for overtime.
The construction has one choice at every step: where exactly the new set goes. Any position strictly between its neighbors works. Try making the choices yourself.
Now the function itself. $f(x)$ asks one question of every set: does it contain $x$? The answer is a set of rationals, $R(x)$, and $f(x)$ is where that set starts.
In $\mathbb{R}$, let $A = (-\infty, 0]$ and $B = [3, \infty)$, and for rational $p \in [0, 1]$ let $U_p = (-\infty, 1 + 2p)$. Check that these sets satisfy Step 1, and compute $f(2)$ and $f(\frac12)$.
Each $U_p$ is open. $U_0 = (-\infty, 1)$ contains $A$, and $U_1 = (-\infty, 3) = \mathbb{R} \setminus B$. For $p < q$, $\overline{U_p} = (-\infty, 1 + 2p]$, which lies inside $(-\infty, 1 + 2q)$ since $1 + 2p < 1 + 2q$.
For $x = 2$: $2 \in U_p$ exactly when $2 < 1 + 2p$, that is, $p > \frac12$. So $R(2)$ is every rational greater than $\frac12$ (those above $1$ included), and $f(2) = \frac12$.
For $x = \frac12$: $\frac12 \in U_0$ already, so every $p \ge 0$ is in $R(\frac12)$, and $f(\frac12) = 0$. Notice $\frac12 \notin A$: the function is $0$ on all of $(-\infty, 1]$, not only on $A$.
That last observation trips people up often enough to deserve a warning.
"f = 0 on A" doesn't mean "f is 0 only on A". The function is 0 on the whole closure of U₀, which can be much bigger than A. If you need f⁻¹(0) to be exactly A, that takes more (A has to be a countable intersection of open sets), and it's a different theorem.
Click around and read $R(x)$ off a family yourself. The more rationals you've built sets for, the closer the readout gets to the true value.
The continuity argument is the clever part: the set $U_q \setminus \overline{U_p}$ is open, contains $x_0$, and is squeezed between two level sets, so $f$ can't stray outside $[p, q]$ there.
Two questions. First, which families actually satisfy Step 1? Every wrong one breaks exactly one requirement.
Loading practice engine...
Then compute $f$ from a family. Type it or pick it.
Loading practice engine...
The first payoff is immediate. A point is a closed set in a normal space, so Urysohn separates a point from a closed set by a function. That's the definition from the Stone–Čech page.
Every normal space is completely regular.
Proof. One-point sets are closed in a normal space. Given $x_0$ and a closed set $A$ not containing it, apply Urysohn's lemma to the disjoint closed sets $\{x_0\}$ and $A$: there is a continuous $f\colon X \to [0, 1]$ with $f(x_0) = 1$ and $f = 0$ on $A$. That is exactly complete regularity. $\blacksquare$
The converse fails ($\mathbb{R}_l \times \mathbb{R}_l$ is completely regular, as a product of completely regular spaces, and not normal), so complete regularity sits strictly between regular and normal.
On Stone–Čech Compactification, completely regular spaces were exactly the ones with a compactification, and compact Hausdorff spaces were shown completely regular using the locally compact version of Urysohn. Now every normal space joins the club too.
The Measure Theory course has its own Urysohn's lemma, for a compact set inside an open set of a locally compact Hausdorff space, with a function of compact support. Same idea, different setting: there the space needn't be normal, but the set is compact.
When is a topological space secretly a metric space? Metrizable spaces are regular, so regularity is necessary. Add a countable basis, and it's enough.
Every regular space $X$ with a countable basis is metrizable.
The plan: build countably many continuous functions $f_n\colon X \to [0, 1]$ that between them see every open set, then use them as coordinates. That puts $X$ inside $[0, 1]^\omega$, which we already know is metrizable. First, the functions.
Let $X$ be regular with a countable basis. There is a countable collection of continuous functions $f_n\colon X \to [0, 1]$ such that, given any point $x_0$ of $X$ and any neighborhood $U$ of $x_0$, there is an $n$ with $f_n(x_0) > 0$ and $f_n = 0$ outside $U$.
Proof. Let $\{B_n\}$ be a countable basis. $X$ is normal, by the theorem that regular second-countable spaces are normal. For each pair $(n, m)$ with $\overline{B_n} \subseteq B_m$, Urysohn's lemma gives a continuous $g_{n,m}\colon X \to [0, 1]$ with $g_{n,m} = 1$ on $\overline{B_n}$ and $g_{n,m} = 0$ on $X \setminus B_m$. There are countably many pairs.
Given $x_0 \in U$, choose a basis element $B_m$ with $x_0 \in B_m \subseteq U$. By regularity (the shrinking lemma), there is a neighborhood $V$ of $x_0$ with $\overline{V} \subseteq B_m$, and a basis element $B_n$ with $x_0 \in B_n \subseteq V$, so $\overline{B_n} \subseteq B_m$. Then $g_{n,m}(x_0) = 1 > 0$, and $g_{n,m}$ vanishes outside $B_m$, hence outside $U$. Reindex the $g_{n,m}$ as $f_1, f_2, \ldots$ $\blacksquare$
In $\mathbb{R}$ you can write these functions down, which makes the lemma less mysterious.
Find functions as in the lemma for $X = \mathbb{R}$.
For rationals $a < c < d < b$, let $g_{a,c,d,b}$ be the "tent with a flat top": $0$ outside $(a, b)$, $1$ on $[c, d]$, and linear on $[a, c]$ and $[d, b]$. It's continuous with values in $[0, 1]$, and there are countably many, since they're indexed by four rationals.
Given $x_0$ and a neighborhood $U$, choose rationals with $a < c < x_0 < d < b$ and $(a, b) \subseteq U$. Then $g_{a,c,d,b}(x_0) = 1 > 0$, and $g_{a,c,d,b} = 0$ outside $(a, b)$, so outside $U$. That's exactly what the proof builds with Urysohn's lemma, where there's no formula to write.
Now the coordinates. Each point gets the address $(f_1(x), f_2(x), \ldots)$, and the lemma is exactly what makes the address faithful, both for points and for open sets.
Let $X$ be a space in which one-point sets are closed, and let $f_n\colon X \to [0, 1]$ be continuous functions as in the lemma. Then $F(x) = (f_1(x), f_2(x), \ldots)$ is an imbedding of $X$ in $[0, 1]^\omega$.
Proof. $F$ is continuous, because each coordinate $f_n$ is, and $[0, 1]^\omega$ has the product topology.
$F$ is one-to-one. If $x \neq y$, then $X \setminus \{y\}$ is a neighborhood of $x$, so some $f_n$ has $f_n(x) > 0$ and $f_n(y) = 0$.
$F$ is open onto its image $Z = F(X)$. Let $U$ be open in $X$ and $z_0 = F(x_0) \in F(U)$. Choose $n$ with $f_n(x_0) > 0$ and $f_n = 0$ outside $U$. Let $W = Z \cap \pi_n^{-1}\big((0, \infty)\big)$, open in $Z$ and containing $z_0$. If $z = F(x) \in W$, then $f_n(x) = \pi_n(z) > 0$, so $x \in U$ and $z \in F(U)$. So $W \subseteq F(U)$, and $F(U)$ is open in $Z$. $\blacksquare$
Here's the imbedding at work, with three coordinates standing in for all of them: points that are far apart in $X$ get addresses that differ somewhere.
Put the pieces together and the metrization theorem falls out.
Prove the Urysohn metrization theorem.
Let $X$ be regular with a countable basis. Regular spaces have closed points. The lemma gives functions $f_n$, and the imbedding theorem makes $X$ homeomorphic to a subspace of $[0, 1]^\omega \subseteq \mathbb{R}^\omega$. The product topology on $\mathbb{R}^\omega$ is metrizable (the Spicy Bonus on Metric Topology writes a metric down), and a subspace of a metrizable space is metrizable: restrict the metric. So $X$ is metrizable.
The theorem is a sufficient condition, not a necessary one, and its hypotheses are sharp. Three spaces show it.
Decide whether each is metrizable, and say what the theorem does or doesn't tell you: $\mathbb{R}_K$; $\mathbb{R}_l$; $\mathbb{R}^\omega$ with the uniform topology.
Your turn: decide metrizability with the tools of this page and the last one.
Loading practice engine...
Urysohn builds a function from nothing but two closed sets. Tietze goes further: hand it any continuous function on a closed set, and it extends to the whole space.
Let $X$ be a normal space and $A$ a closed subspace of $X$.
Proof. Step 1: one third at a time. Let $f\colon A \to [-r, r]$ be continuous. Split $[-r, r]$ into thirds $I_1 = [-r, -\frac r3]$, $I_2 = [-\frac r3, \frac r3]$, $I_3 = [\frac r3, r]$. The sets $B = f^{-1}(I_1)$ and $C = f^{-1}(I_3)$ are disjoint and closed in $A$, hence closed in $X$. By Urysohn's lemma (or a constant function, if $B$ or $C$ is empty) there is a continuous $g\colon X \to [-\frac r3, \frac r3]$ with $g = -\frac r3$ on $B$ and $g = \frac r3$ on $C$. Then $|g(x)| \le \frac r3$ on $X$, and $|f(a) - g(a)| \le \frac{2r}{3}$ on $A$: if $a \in B$, both $f(a)$ and $g(a)$ lie in $I_1$; if $a \in C$, both lie in $I_3$; otherwise both lie in $I_2$. Each interval has length $\frac{2r}3$.
Step 2: part (1). We may take $[a, b] = [-1, 1]$. Apply Step 1 to $f$ with $r = 1$: we get $g_1$ with $|g_1| \le \frac13$ and $|f - g_1| \le \frac23$ on $A$. Apply Step 1 to $f - g_1$ with $r = \frac23$: we get $g_2$ with $|g_2| \le \frac13 \cdot \frac23$ and $|f - g_1 - g_2| \le (\frac23)^2$ on $A$. By induction there are continuous $g_n$ on $X$ with $$|g_n(x)| \le \tfrac13 \big(\tfrac23\big)^{n-1} \text{ on } X, \qquad \big|f(a) - (g_1(a) + \cdots + g_n(a))\big| \le \big(\tfrac23\big)^n \text{ on } A.$$ The series $g = \sum g_n$ converges uniformly on $X$ (its tails are bounded by a geometric series), so $g$ is continuous by the uniform limit theorem. Also $|g(x)| \le \sum_n \frac13 (\frac23)^{n-1} = 1$, and on $A$ the partial sums converge to $f$, so $g = f$ on $A$.
Step 3: part (2). Since $\mathbb{R}$ is homeomorphic to $(-1, 1)$, we may take $f\colon A \to (-1, 1)$. Part (1) gives a continuous $g\colon X \to [-1, 1]$ extending $f$. The set $D = g^{-1}(\{-1, 1\})$ is closed and disjoint from $A$, since $g = f$ takes values in $(-1, 1)$ on $A$. By Urysohn's lemma (or the constant $1$ if $D$ is empty) there is a continuous $u\colon X \to [0, 1]$ with $u = 0$ on $D$ and $u = 1$ on $A$. Then $h = u g$ is continuous, equals $f$ on $A$, and $|h(x)| < 1$ for every $x$: on $D$ it's $0$, and off $D$, $|g(x)| < 1$. So $h$ maps $X$ into $(-1, 1)$. $\blacksquare$
The engine is Step 1: one application of Urysohn fixes a third of the error, and repeating it shrinks the error geometrically. Here's the first few rounds.
The Uniform Limit Theorem: a uniform limit of continuous functions into a metric space is continuous. Tietze needs it to know that the infinite sum $g_1 + g_2 + \cdots$ is still continuous.
Fix a third of the error, then a third of what's left, then a third of that... Zeno would love this proof, and for once it actually finishes.
Set the function yourself and watch the rounds converge. The extension is built on all of $[0, 1]$, but it only has to agree with your function on the closed pieces.
Every hypothesis is doing work. Drop "closed", and even a bounded function can refuse to extend.
Let $A = (0, 1]$, a subset of the normal space $[0, 1]$, and $f(x) = \sin(1/x)$ on $A$. Show that $f$ is bounded and continuous but has no continuous extension to $[0, 1]$.
$f$ is continuous on $A$ and takes values in $[-1, 1]$. Suppose $F$ were a continuous extension. The points $x_k = \frac{1}{\pi/2 + 2k\pi}$ and $y_k = \frac{1}{3\pi/2 + 2k\pi}$ both converge to $0$, with $f(x_k) = 1$ and $f(y_k) = -1$. Continuity at $0$ would force $F(0) = \lim F(x_k) = 1$ and $F(0) = \lim F(y_k) = -1$. Contradiction. The theorem doesn't apply because $A$ isn't closed.
Before you trust a function to extend, predict whether it will. Some of these go through, and some can't.
One last observation about how Tietze relates to the lemma it's built from: you can run the implication backwards.
Tietze implies Urysohn: if A and B are disjoint and closed, the function that is 0 on A and 1 on B is continuous on the closed set A ∪ B, and Tietze extends it. So the two theorems are equivalent ways of saying a space is normal.
Last practice before the mix: the bookkeeping inside Tietze's proof.
Loading practice engine...
Every question so far came right after its idea, which is a hint. Down here the hint is gone. First, true or false: a claim about anything on this page. Decide, then read why.
Loading practice engine...
Next, the mixed set. Every question type on this page except true or false goes into one hat, and each click draws a new one at random. Two of them can be typed; the rest show their choices either way.
Loading practice engine...
Last, the Spicy Bonus. For compact Hausdorff spaces, the metrization theorem becomes an "if and only if".
Let $X$ be a compact Hausdorff space. Prove that $X$ is metrizable if and only if $X$ is second-countable.
Proof. ($\impliedby$) A compact Hausdorff space is normal (Countability & Separation), hence regular. With a countable basis, the Urysohn metrization theorem makes it metrizable.
($\implies$) Let $d$ be a metric for $X$. For each $n$, the balls $B_d(x, \frac1n)$, $x \in X$, cover $X$, so by compactness finitely many of them do; call that finite collection $\mathcal{C}_n$. The union $\mathcal{C} = \bigcup_n \mathcal{C}_n$ is countable. It is a basis: let $U$ be open and $x \in U$, with $B_d(x, \varepsilon) \subseteq U$. Choose $n$ with $\frac2n < \varepsilon$. Some ball $B_d(c, \frac1n) \in \mathcal{C}_n$ contains $x$, and by the triangle inequality $B_d(c, \frac1n) \subseteq B_d(x, \frac2n) \subseteq U$. So $X$ is second-countable. $\blacksquare$