Locally Compact Spaces & Urysohn's Lemma

So far we've built measures by hand: count the points, put weights on them, write down a rule and check it adds up. This part of the course runs the other way. Start from something that looks nothing like a measure, a machine that eats continuous functions and spits out numbers, and get the measure out of it. That's the Riesz Representation Theorem, next page. This page builds its tools: the kind of space it works on, a weaker cousin of continuity, and one lemma that manufactures continuous functions to order.

Integration as a Linear Functional

On Measures, a measure ate sets and returned sizes. The integral is the same idea one level up: it eats functions. (Its full construction is on The Lebesgue Integral. For most of this page, ordinary integrals of continuous functions are all we need.)

Look at what the integral does with a function: $f \mapsto \int_0^1 f(x)\,dx$. It takes in a function and hands back one number, and it respects addition and scaling. That shape has a name.

Let $V$ be a complex vector space. A linear functional on $V$ is a linear map $\Lambda\colon V \to \mathbb{C}$.

"Linear" here means $\Lambda(f + g) = \Lambda f + \Lambda g$ and $\Lambda(cf) = c\,\Lambda f$, so in particular $\Lambda(0) = 0$. Integrals are linear. But they also have a second property that a general linear map doesn't: feed one a function that's never negative, and the answer is never negative. That property is the one that will turn a functional into a measure, so it gets its own name.

Let $V$ be a complex vector space of functions on a set $X$. A linear functional $\Lambda$ on $V$ is positive if $\Lambda f \ge 0$ for every $f \in V$ with $f \ge 0$ (that is, $f(x)$ is real and $f(x) \ge 0$ for every $x$).

Here are two that pass and one that doesn't, all on $C([0, 1])$, the continuous complex functions on $[0, 1]$.

Which of these are positive linear functionals on $C([0, 1])$? (a) $\Lambda f = \int_0^1 f(x)\,dx$. (b) $\Lambda f = f(\tfrac{1}{2})$. (c) $\Lambda f = f(0) - f(1)$.


All three are linear: integrals and evaluations respect sums and scalar multiples, and so does a difference of two evaluations.

(a) If $f \ge 0$ on $[0, 1]$, its integral is $\ge 0$. Positive.

(b) If $f \ge 0$ everywhere, then in particular $f(\tfrac{1}{2}) \ge 0$. Positive.

(c) Take $f(x) = x$. Then $f \ge 0$ on $[0, 1]$, but $\Lambda f = 0 - 1 = -1 < 0$. Linear, not positive.

The failure in (c) has a pattern. Think of $f(0) - f(1)$ as putting weight $+1$ at $0$ and weight $-1$ at $1$. A nonnegative function piled up near $1$ only sees the negative weight. Try to break each of these yourself.

Positive or Not?

You can't break $\int f$ or $f(\tfrac{1}{2})$ no matter where the bump goes. And the third mission makes a point worth keeping: positive means $\Lambda f \ge 0$, not $\Lambda f > 0$. A positive functional is allowed to ignore a function completely. Now go the other way. Build a functional out of weighted evaluations and watch exactly when it stops being positive.

Point Masses

Did you see the measure in the readout? A positive functional built from weights is an integral against point masses: $\Lambda f = \int f\,d\mu$ with $\mu = c_1\delta_{0.2} + c_2\delta_{0.5} + c_3\delta_{0.8}$. The Riesz Representation Theorem (next page) says every positive linear functional on $C_c(X)$ is an integral against some measure. This page builds the tools its proof needs.

Positive exactly when every weight is $\ge 0$, and checking $\Lambda(1) \ge 0$ isn't enough. Your turn: pick out the positive linear functional.

Loading practice engine...

A Compactness Toolkit

From Compact Spaces and Hausdorff Spaces, we'll use four facts without reproving them: a closed subset of a compact set is compact; a compact subset of a Hausdorff space is closed; a continuous image of a compact set is compact; and in $\mathbb{R}^n$, compact means closed and bounded (Heine–Borel).

Measure theory on a topological space keeps needing to wrap compact sets in open ones and pull open sets in around compact ones. Two more facts about compact sets in Hausdorff spaces do most of that wrapping. The first says that a point and a compact set can be pulled apart, the way two points can.

Let $X$ be a Hausdorff space, $K \subseteq X$ compact, and $p \notin K$. Then there are disjoint open sets $U$ and $V$ with $p \in U$ and $K \subseteq V$.

Show proof

Proof. For each $q \in K$, the Hausdorff property gives disjoint open sets $U_q \ni p$ and $V_q \ni q$. The sets $V_q$ cover $K$, so finitely many of them, $V_{q_1}, \ldots, V_{q_n}$, already do. Let $$V = V_{q_1} \cup \cdots \cup V_{q_n}, \qquad U = U_{q_1} \cap \cdots \cap U_{q_n}.$$ Both are open ($U$ is a finite intersection), $K \subseteq V$, and $p \in U$. If some $y$ were in both, then $y \in V_{q_i}$ for some $i$ and also $y \in U \subseteq U_{q_i}$, but $U_{q_i} \cap V_{q_i} = \emptyset$. So $U \cap V = \emptyset$. $\blacksquare$

Compactness turned infinitely many separations into finitely many, and that's what let us intersect. The second fact is the finite intersection property, the closed-set mirror of "every open cover has a finite subcover".

Let $X$ be a Hausdorff space and $\{K_\alpha\}_{\alpha \in A}$ a nonempty family of compact subsets of $X$. If every finite subfamily has nonempty intersection, then $\bigcap_{\alpha \in A} K_\alpha \neq \emptyset$.

Show proof

Proof. We prove the contrapositive. Suppose $\bigcap_\alpha K_\alpha = \emptyset$, and fix one index $\beta$. Every point of $K_\beta$ misses some $K_\alpha$, so $$K_\beta \subseteq \bigcup_{\alpha \in A} K_\alpha^c.$$ Each $K_\alpha$ is compact in a Hausdorff space, hence closed, so each $K_\alpha^c$ is open. Since $K_\beta$ is compact, finitely many of them cover it: $K_\beta \subseteq K_{\alpha_1}^c \cup \cdots \cup K_{\alpha_n}^c$. Then $K_\beta \cap K_{\alpha_1} \cap \cdots \cap K_{\alpha_n} = \emptyset$, a finite subfamily with empty intersection. $\blacksquare$

So if a family of compact sets has nothing in common, the reason already shows up in finitely many of them. Compactness is doing real work there, and closed alone won't do.

In $\mathbb{R}$, let $F_n = [n, \infty)$ for $n \in \mathbb{N}$. Show that every finite subfamily has nonempty intersection, but $\bigcap_n F_n = \emptyset$. Which hypothesis of the proposition fails?


The sets shrink: $F_1 \supseteq F_2 \supseteq \cdots$. So any finite subfamily $F_{n_1}, \ldots, F_{n_k}$ has intersection $F_m$ with $m = \max\{n_1, \ldots, n_k\}$, which is not empty.

But no real number $x$ is in every $F_n$: it misses $F_n$ as soon as $n > x$. So $\bigcap_n F_n = \emptyset$.

Each $F_n$ is closed but not compact (it isn't bounded). The proposition needs compact sets, and this family shows it can't be weakened to closed ones.

We'll use the proposition in a moment to shrink an open set until its closure fits.

Locally Compact Hausdorff Spaces

$\mathbb{R}$ isn't compact, but it's compact up close: every point sits inside a closed interval, and closed intervals are compact. That "compact up close" is all the Riesz theorem needs, and it's the right setting for this whole chapter.

A topological space $X$ is locally compact if every point $p \in X$ has a neighborhood $U$ whose closure $\overline{U}$ is compact.

(The Topology course asks for less: a compact set containing a neighborhood of $p$. For Hausdorff spaces, the only kind on this page, the two definitions agree; that's this theorem on Local Connectedness & Compactness.) Most spaces you'd draw pass. Here's the usual list.

Show that each of these is locally compact: (a) $\mathbb{R}^n$; (b) any open subset of $\mathbb{R}^n$; (c) any discrete space; (d) any compact space.


(a) Take $U$ to be the open ball $B(p, 1)$. Its closure is the closed ball, which is closed and bounded, so compact by Heine–Borel.

(b) If $W \subseteq \mathbb{R}^n$ is open and $p \in W$, pick $r > 0$ with $B(p, 2r) \subseteq W$. The closed ball $\overline{B(p, r)}$ lies in $W$ and is compact, and it's also the closure of $B(p, r)$ inside the subspace $W$.

(c) In a discrete space, $U = \{p\}$ is open, it's its own closure, and a single point is compact.

(d) Take $U = X$: it's open, $\overline{X} = X$, and $X$ is compact.

Now one that fails, and it's the one to remember, because it looks so harmless.

$\mathbb{Q}$ isn't locally compact. It's locally full of holes.

Show that $\mathbb{Q}$, with the topology it gets from $\mathbb{R}$, is not locally compact.


Let $q \in \mathbb{Q}$ and let $U$ be any neighborhood of $q$ in $\mathbb{Q}$. It contains some $(q - r, q + r) \cap \mathbb{Q}$ with $r > 0$. Suppose the closure $C$ of $U$ in $\mathbb{Q}$ were compact.

Compactness doesn't depend on the surrounding space, so $C$ is a compact subset of $\mathbb{R}$, and so it is closed in $\mathbb{R}$. It contains $(q - r, q + r) \cap \mathbb{Q}$, so it contains the closure of that set in $\mathbb{R}$, which is $[q - r, q + r]$. But that interval has irrational numbers in it, and $C \subseteq \mathbb{Q}$. Contradiction. So no neighborhood of $q$ has compact closure.

Here's the same argument as a movie: rationals marching toward a hole.

Shrinking the neighborhood doesn't help: there's an irrational in every interval, and a sequence of rationals closing in on it. Now try it in the plane. Drag a point around four different spaces and look for a neighborhood whose closure stays inside.

Compact Neighborhood

The third space is the sneaky one: an open disk plus a single boundary point $q$. Every point but $q$ is fine, and one bad point is enough to fail. Sort a few more.

Locally Compact or Not?

From here on, "locally compact Hausdorff space" is the standing setting. The first payoff is a shrinking theorem: around any compact set inside an open set, there's room for an open set whose closure is compact and still fits.

Let $X$ be a locally compact Hausdorff space, $K \subseteq X$ compact, and $U \subseteq X$ open with $K \subseteq U$. Then there is an open set $V$ with compact closure such that $$K \subseteq V \subseteq \overline{V} \subseteq U.$$

Show proof

Proof. Each $x \in K$ has an open neighborhood with compact closure, and since $K$ is compact, finitely many of them, $W_1, \ldots, W_n$, cover $K$. Let $G = W_1 \cup \cdots \cup W_n$. Then $G$ is open, $K \subseteq G$, and $\overline{G} = \overline{W_1} \cup \cdots \cup \overline{W_n}$ is compact, as a finite union of compact sets.

If $U = X$, take $V = G$. Otherwise $C = U^c$ is a nonempty closed set. For each $p \in C$, the previous proposition gives disjoint open sets $U_p \ni p$ and $W_p \supseteq K$. Since $U_p$ is an open set around $p$ that misses $W_p$, we get $p \notin \overline{W_p}$.

Consider the family $\{C \cap \overline{G} \cap \overline{W_p} : p \in C\}$. Each member is a closed subset of the compact set $\overline{G}$, so it's compact. Their intersection is empty: a point of $C$ that is in all of them would have to be in $\overline{W_p}$ for its own $p$, and it isn't. By the finite intersection property, some finite subfamily already has empty intersection: $$C \cap \overline{G} \cap \overline{W_{p_1}} \cap \cdots \cap \overline{W_{p_m}} = \emptyset.$$

Let $V = G \cap W_{p_1} \cap \cdots \cap W_{p_m}$. It is open (a finite intersection) and contains $K$. Its closure satisfies $\overline{V} \subseteq \overline{G} \cap \overline{W_{p_1}} \cap \cdots \cap \overline{W_{p_m}}$, which misses $C = U^c$ by the display, so $\overline{V} \subseteq U$. Finally, $\overline{V}$ is a closed subset of the compact set $\overline{G}$, so it is compact. $\blacksquare$

The proof does two things: cover $K$ with sets that have compact closures, then trim away whatever pokes out of $U$. Here's that as a picture.

We'll use this theorem over and over in the proof of Urysohn's lemma: every time we need one more open set squeezed between two others. Before that, check the definition against a lineup.

Loading practice engine...

Semicontinuity

Continuity asks a lot: preimages of every open set are open. For real-valued functions, the open rays $(\alpha, \infty)$ and $(-\infty, \alpha)$ are enough to generate everything, and it turns out to be useful to ask for just one of the two kinds at a time.

Let $X$ be a topological space and $f\colon X \to [-\infty, \infty]$. Then $f$ is lower semicontinuous if $\{x : f(x) > \alpha\}$ is open for every $\alpha \in \mathbb{R}$.

Flip the inequality and you get the other one.

Let $X$ be a topological space and $f\colon X \to [-\infty, \infty]$. Then $f$ is upper semicontinuous if $\{x : f(x) < \alpha\}$ is open for every $\alpha \in \mathbb{R}$.

The first examples to try are indicator functions, because their level sets are so easy to list.

Let $E \subseteq X$. Show that $\chi_E$ is lower semicontinuous exactly when $E$ is open, and upper semicontinuous exactly when $E$ is closed.


$\chi_E$ only takes the values $0$ and $1$, so $$\{\chi_E > \alpha\} = \begin{cases} X, & \alpha < 0, \\ E, & 0 \le \alpha < 1, \\ \emptyset, & \alpha \ge 1. \end{cases}$$ $X$ and $\emptyset$ are always open, so all of these are open exactly when $E$ is. In the same way, $\{\chi_E < \alpha\}$ is $\emptyset$, $E^c$, or $X$, and these are all open exactly when $E^c$ is open, that is, when $E$ is closed.

So $\chi_{(0, \infty)}$ is lower semicontinuous, $\chi_{[0, \infty)}$ is upper semicontinuous, and $\chi_{[0, 1)}$ is neither.

Compare $\chi_{(0, \infty)}$ and $\chi_{[0, \infty)}$. They're the same function except at $0$, the jump, and the only question is which value it takes there. Watch a level slide through both.

A lower semicontinuous function always takes the low road at a jump.

That's the whole picture at a jump: lower semicontinuous functions can jump up away from a point, never down, so the value at the jump is the low one. Upper is the mirror. And a function that's both has no room to jump at all.

A function $f\colon X \to \mathbb{R}$ is continuous if and only if it is both lower and upper semicontinuous.

Show proof

Proof. If $f$ is continuous, the preimages of the open rays $(\alpha, \infty)$ and $(-\infty, \alpha)$ are open, so $f$ is both.

Conversely, suppose $f$ is both. For an open interval, $f^{-1}((\alpha, \beta)) = \{f > \alpha\} \cap \{f < \beta\}$ is open. Every open set of $\mathbb{R}$ is a union of open intervals, and preimages respect unions, so every open set has an open preimage. $\blacksquare$

So semicontinuity really is half of continuity, split along the order of $\mathbb{R}$. Two more facts fall straight out of the definitions: $f$ is lower semicontinuous exactly when $-f$ is upper semicontinuous (since $\{-f < -\alpha\} = \{f > \alpha\}$), and a minus sign swaps the two kinds. Here's one with infinitely many jumps.

Classify $f(x) = \lfloor x \rfloor$ and $g(x) = \lceil x \rceil$ on $\mathbb{R}$.


$\{\lfloor x \rfloor < \alpha\} = (-\infty, n)$, where $n$ is the smallest integer $\ge \alpha$: open, for every $\alpha$. So $f$ is upper semicontinuous. But $\{\lfloor x \rfloor > \tfrac{1}{2}\} = [1, \infty)$ is not open, so $f$ is not lower semicontinuous. At each integer, $\lfloor n \rfloor = n$ is the high value (the left side is $n - 1$), just as the picture predicts.

$\lceil x \rceil$ is the mirror: $\lceil x \rceil = -\lfloor -x \rfloor$, and the minus sign swaps the kinds, so $g$ is lower semicontinuous and not upper.

On σ-Algebras & Measurable Functions, $f$ was measurable as soon as every $\{f > a\}$ was measurable. For a lower semicontinuous $f$, every $\{f > a\}$ is open, so lower semicontinuous functions are Borel measurable for free. Half of continuity is already enough for integration.

Now you set the value at the jump.

Set the Jump

In the third mission, the failing set is a filled dot at $0$ with nothing around it on one side. That's what a set that isn't open looks like on a line. Same hunt, three functions you didn't build:

Break It With a Level

Your turn to classify. Look at the jumps, and at the value each one takes.

Loading practice engine...

Semicontinuous functions survive operations that continuous ones survive, plus one that continuous ones don't: a supremum of any family, even an uncountable one. That last one is exactly the move Urysohn's proof needs.

Let $X$ be a topological space.

(a) If $f, g\colon X \to (-\infty, \infty]$ are lower semicontinuous, so is $f + g$. If $f, g\colon X \to [-\infty, \infty)$ are upper semicontinuous, so is $f + g$.

(b) The supremum of any family of lower semicontinuous functions is lower semicontinuous. In particular, if $u_1 \le u_2 \le \cdots$ are lower semicontinuous, so is $\lim_{n} u_n$.

(c) The infimum of any family of upper semicontinuous functions is upper semicontinuous.

Show proof

Proof. (a) We claim that for every $\alpha \in \mathbb{R}$, $$\{f + g > \alpha\} = \bigcup_{r \in \mathbb{Q}} \left(\{f > r\} \cap \{g > \alpha - r\}\right).$$ The right side is a union of open sets, so this proves the first statement. If $f(x) > r$ and $g(x) > \alpha - r$, then $f(x) + g(x) > \alpha$, which gives $\supseteq$. For $\subseteq$, let $f(x) + g(x) > \alpha$. If $f(x) = \infty$, pick a rational $r$ larger than $\alpha - g(x)$ (possible since $g(x) > -\infty$). If $g(x) = \infty$, pick a rational $r < f(x)$. If both are finite, then $\alpha - g(x) < f(x)$, and we pick a rational $r$ between them. In each case $f(x) > r$ and $g(x) > \alpha - r$. The upper statement follows by applying this to $-f$ and $-g$.

(b) Let $u = \sup_i u_i$. Then $u(x) > \alpha$ exactly when $u_i(x) > \alpha$ for some $i$, so $\{u > \alpha\} = \bigcup_i \{u_i > \alpha\}$, a union of open sets. An increasing sequence converges to its supremum, which gives the particular case.

(c) Apply (b) to the functions $-u_i$: $\inf_i u_i = -\sup_i (-u_i)$. $\blacksquare$

Notice what's not there: no infimum rule for lower semicontinuous functions. The infimum of $\chi_{(-1/n,\, 1/n)}$ over $n$ is $\chi_{\{0\}}$, which is upper, not lower. The next exercise finds where else the rules stop.

Let $(f_n)$ be a sequence of real, nonnegative functions on $\mathbb{R}$. Three of these statements are true and one is false. Which is which?

(a) If $f_1$ and $f_2$ are upper semicontinuous, so is $f_1 + f_2$.   (b) If $f_1$ and $f_2$ are lower semicontinuous, so is $f_1 + f_2$.   (c) If each $f_n$ is upper semicontinuous, so is $\sum_{n=1}^{\infty} f_n$.   (d) If each $f_n$ is lower semicontinuous, so is $\sum_{n=1}^{\infty} f_n$.

What happens if "nonnegative" is dropped? Does anything change if $\mathbb{R}$ is replaced by a general topological space?

Show answer

(a) and (b) are true by part (a) of the proposition (real values, so no $\infty - \infty$).

(d) is true. By (b) and induction, every partial sum $s_N = f_1 + \cdots + f_N$ is lower semicontinuous. Since $f_n \ge 0$, the partial sums increase, so $\sum f_n = \sup_N s_N$ is lower semicontinuous by part (b) of the proposition.

(c) is false. Let $f_n = \chi_{\{1/n\}}$. Each $\{1/n\}$ is closed, so each $f_n$ is upper semicontinuous. But $\sum f_n = \chi_S$ with $S = \{\tfrac{1}{n} : n \in \mathbb{N}\}$, and $S$ is not closed ($0$ is a limit of points of $S$ and isn't in it), so $\chi_S$ is not upper semicontinuous: $\{\chi_S < 1\} = S^c$ contains $0$ but no interval around it.

Without "nonnegative": (a) and (b) still hold (the proof never used signs), and (c) is still false. Now (d) fails too: $f_n = -\chi_{\{1/n\}}$ is lower semicontinuous (a minus sign swaps the kinds), each $x$ has at most one nonzero term, and $\sum f_n = -\chi_S$. But $\{-\chi_S > -\tfrac{1}{2}\} = S^c$ is not open. The partial sums are no longer increasing, so part (b) doesn't apply.

A general space: nothing changes. The proofs of (a), (b), (d) used only open sets in $X$ and rationals in the values, so they work in any topological space; and (c) already fails on $\mathbb{R}$, which is one of them. $\blacksquare$

Upper semicontinuity also buys a piece of the Extreme Value Theorem. A continuous function on a compact set has a max and a min. Upper semicontinuity is exactly the half of continuity that the max needs.

Let $X$ be a nonempty compact space and $f\colon X \to (-\infty, \infty)$ upper semicontinuous. Prove that $f$ attains its maximum at some point of $X$.

Show proof

Proof. The sets $\{f < n\}$, $n \in \mathbb{N}$, are open and cover $X$ (each $f(x)$ is a real number). By compactness, finitely many cover $X$, so $f < N$ on $X$ for some $N$. Hence $M = \sup_X f$ is a real number.

Suppose $f(x) < M$ for every $x$. Then the open sets $\{f < M - \tfrac{1}{n}\}$, $n \in \mathbb{N}$, cover $X$, and they increase with $n$, so one of them, $\{f < M - \tfrac{1}{N}\}$, is all of $X$. Then $M - \tfrac{1}{N}$ is an upper bound for $f$ smaller than its supremum, a contradiction. So $f(x) = M$ for some $x$. $\blacksquare$

The last exercise of the section shows that semicontinuity was hiding inside plain continuity all along. It measures how badly a function fails to be continuous at each point, and that measurement turns out to be upper semicontinuous.

Let $f$ be any complex function on $\mathbb{R}$. For $x \in \mathbb{R}$ and $\delta > 0$, let $$\omega(x, \delta) = \sup\{|f(s) - f(t)| : s, t \in (x - \delta, x + \delta)\}, \qquad \omega(x) = \inf_{\delta > 0} \omega(x, \delta).$$ Prove that $\omega\colon \mathbb{R} \to [0, \infty]$ is upper semicontinuous, that $f$ is continuous at $x$ if and only if $\omega(x) = 0$, and so the set of points where $f$ is continuous is a countable intersection of open sets.

Show proof

Proof. Upper semicontinuity. Let $\omega(x) < \alpha$, and pick $\delta$ with $\omega(x, \delta) < \alpha$. If $|y - x| < \delta/2$, then $(y - \delta/2, y + \delta/2) \subseteq (x - \delta, x + \delta)$, so $$\omega(y) \le \omega(y, \delta/2) \le \omega(x, \delta) < \alpha.$$ So $\{\omega < \alpha\}$ contains an interval around each of its points: it is open.

Continuity. If $f$ is continuous at $x$ and $\varepsilon > 0$, pick $\delta$ with $|f(s) - f(x)| < \varepsilon/2$ whenever $|s - x| < \delta$. Then $|f(s) - f(t)| < \varepsilon$ for $s, t \in (x - \delta, x + \delta)$, so $\omega(x) \le \omega(x, \delta) \le \varepsilon$. As $\varepsilon$ was arbitrary, $\omega(x) = 0$. Conversely, if $\omega(x) = 0$ and $\varepsilon > 0$, pick $\delta$ with $\omega(x, \delta) < \varepsilon$; taking $t = x$ gives $|f(s) - f(x)| < \varepsilon$ whenever $|s - x| < \delta$.

The continuity set. It is $\{\omega = 0\} = \bigcap_{n=1}^{\infty} \{\omega < \tfrac{1}{n}\}$, and each $\{\omega < \tfrac{1}{n}\}$ is open by upper semicontinuity. $\blacksquare$

A countable intersection of open sets has a name, a $G_\delta$ set, and it shows up on the Riesz Representation Theorem page, which proves $\mathbb{Q}$ isn't one. So: the points where any function is continuous form a $G_\delta$. That's why no function on $\mathbb{R}$ is continuous exactly at the rationals.

Support and $C_c(X)$

The Riesz theorem feeds its functional a specific kind of continuous function: one that lives on a compact set and is zero everywhere else. To say "lives on" precisely, we need the support.

Let $X$ be a topological space and $f\colon X \to \mathbb{C}$. The support of $f$ is $$\operatorname{supp} f = \overline{\{x \in X : f(x) \neq 0\}}.$$

The closure bar is the part people drop, and it changes the answer. Here's why it's there.

The support is where a function is nonzero, plus everywhere it's thinking about being nonzero.

So $\operatorname{supp} f$ is closed, and outside it $f$ is zero on a whole open set, not just at isolated points. Three quick ones:

Find $\operatorname{supp} f$ for (a) $f(x) = \max\{0, 1 - |x|\}$, (b) $f = \chi_{\mathbb{Q}}$, (c) $f(x) = e^{-x^2}$, all on $\mathbb{R}$.


(a) The tent is nonzero exactly on $(-1, 1)$, so $\operatorname{supp} f = [-1, 1]$.

(b) $\chi_{\mathbb{Q}}$ is nonzero exactly on $\mathbb{Q}$, and the closure of $\mathbb{Q}$ is $\mathbb{R}$. So $\operatorname{supp} f = \mathbb{R}$, even though $f$ is zero at every irrational.

(c) $e^{-x^2}$ is never $0$, so $\operatorname{supp} f = \mathbb{R}$. It gets small fast, but small isn't zero.

Of these three, only the tent is the kind of function Riesz wants: continuous, with a compact support.

Let $X$ be a topological space. A function $f\colon X \to \mathbb{C}$ has compact support if $\operatorname{supp} f$ is compact, and $$C_c(X) = \{f\colon X \to \mathbb{C} : f \text{ is continuous and } \operatorname{supp} f \text{ is compact}\}.$$

On $\mathbb{R}^n$, compact support just means $f$ is zero outside some ball. The closure in the definition of the support is what makes this work.

Never forget the closure. Without it, the "support" of the tent would be $(-1, 1)$, which isn't compact, so the tent wouldn't be in $C_c(\mathbb{R})$, and neither would any nonzero continuous function on $\mathbb{R}$ (a set where a continuous function is nonzero is open, and a nonempty open subset of $\mathbb{R}$ is never compact). The whole space $C_c$ would collapse to $\{0\}$.

Riesz needs $C_c(X)$ to be a vector space, so that "linear functional on $C_c(X)$" makes sense. It is, and the closure makes the proof short.

Let $X$ be a topological space. Show that $C_c(X)$ is a complex vector space, using $\operatorname{supp}(f + g) \subseteq \operatorname{supp} f \cup \operatorname{supp} g$.

Show proof

Proof. It's enough to show $C_c(X)$ contains $0$ and is closed under addition and scalar multiplication, since the continuous functions already form a vector space.

$\operatorname{supp} 0 = \overline{\emptyset} = \emptyset$, which is compact. For $c \neq 0$, $cf$ is nonzero exactly where $f$ is, so $\operatorname{supp}(cf) = \operatorname{supp} f$; and $0 \cdot f = 0$.

For $f, g \in C_c(X)$: wherever $f + g \neq 0$, at least one of $f, g$ is nonzero, so $$\{f + g \neq 0\} \subseteq \{f \neq 0\} \cup \{g \neq 0\} \subseteq \operatorname{supp} f \cup \operatorname{supp} g.$$ The right side is closed, as a finite union of closed sets, so it contains the closure of the left side: $\operatorname{supp}(f + g) \subseteq \operatorname{supp} f \cup \operatorname{supp} g$. A union of two compact sets is compact (combine the two finite subcovers), and a closed subset of a compact set is compact. So $\operatorname{supp}(f + g)$ is compact, and $f + g \in C_c(X)$. $\blacksquare$

Build some supports yourself. Each arch is zero at its ends, so watch what happens when two of them touch.

Support Painter

The zeros between touching arches disappear into the support, and a gap of a whole cell stays a gap. Your turn: find some supports.

Loading practice engine...

Urysohn's Lemma

Here's the problem Riesz has. To get a measure out of $\Lambda$, it wants to approximate the indicator $\chi_K$ of a compact set by continuous functions. But in an arbitrary locally compact Hausdorff space, are there even any continuous functions besides constants? Urysohn's lemma says yes, as many as you like, and shaped to order: equal to $1$ on any compact set you pick, and vanishing outside any open set around it.

Let $X$ be a locally compact Hausdorff space, $K \subseteq X$ compact, and $V \subseteq X$ open with $K \subseteq V$. Then there is $f \in C_c(X)$ with $$\chi_K \le f \le \chi_V \quad \text{and} \quad \operatorname{supp} f \subseteq V.$$ That is, $0 \le f \le 1$, $f = 1$ on $K$, and the support of $f$ is a compact subset of $V$.

Show proof

Proof. Step 1: one open set for each rational level. List the rationals in $[0, 1]$ as $r_1 = 0$, $r_2 = 1$, $r_3, r_4, \ldots$, each exactly once. By the shrinking theorem there is an open $V_0$ with compact closure and $K \subseteq V_0 \subseteq \overline{V_0} \subseteq V$. Applying it again to $K \subseteq V_0$ gives an open $V_1$ with $K \subseteq V_1 \subseteq \overline{V_1} \subseteq V_0$.

Suppose $n \ge 2$ and open sets $V_{r_1}, \ldots, V_{r_n}$ have been chosen so that $$(\ast) \qquad r < s \implies \overline{V_s} \subseteq V_r.$$ Among $r_1, \ldots, r_n$, let $r_i$ be the largest below $r_{n+1}$ and $r_j$ the smallest above it (both exist, since $0$ and $1$ are on the list). By $(\ast)$, $\overline{V_{r_j}} \subseteq V_{r_i}$, and $\overline{V_{r_j}}$ is compact, as a closed subset of the compact set $\overline{V_0}$. The shrinking theorem gives an open $V_{r_{n+1}}$ with $$\overline{V_{r_j}} \subseteq V_{r_{n+1}} \subseteq \overline{V_{r_{n+1}}} \subseteq V_{r_i}.$$ Then $(\ast)$ still holds. For a listed $r < r_{n+1}$ we have $r \le r_i$, and $\overline{V_{r_{n+1}}} \subseteq V_{r_i} \subseteq V_r$. For a listed $s > r_{n+1}$ we have $s \ge r_j$, and $\overline{V_s} \subseteq \overline{V_{r_j}} \subseteq V_{r_{n+1}}$. By induction we get an open $V_r$ for every rational $r \in [0, 1]$, with $K \subseteq V_1$, $\overline{V_0} \subseteq V$ compact, and $(\ast)$.

Step 2: one function from below, one from above. For rationals $r, s \in [0, 1]$ define $$f_r(x) = \begin{cases} r, & x \in V_r, \\ 0, & \text{otherwise}, \end{cases} \qquad g_s(x) = \begin{cases} 1, & x \in \overline{V_s}, \\ s, & \text{otherwise}, \end{cases}$$ and let $f = \sup_r f_r$ and $g = \inf_s g_s$. The set $\{f_r > \alpha\}$ is $X$, $V_r$, or $\emptyset$ (for $\alpha < 0$, $0 \le \alpha < r$, $\alpha \ge r$), always open, so each $f_r$ is lower semicontinuous. The set $\{g_s < \alpha\}$ is $\emptyset$, $\overline{V_s}^{\,c}$, or $X$ (for $\alpha \le s$, $s < \alpha \le 1$, $\alpha > 1$), always open, so each $g_s$ is upper semicontinuous. By the proposition on suprema and infima, $f$ is lower semicontinuous and $g$ is upper semicontinuous.

Step 3: $f$ has the right shape. Each $f_r$ takes values in $[0, 1]$, so $0 \le f \le 1$. On $K \subseteq V_1$, $f \ge f_1 = 1$, so $f = 1$ on $K$. Every $V_r$ lies in $V_0$ (for $r > 0$, by $(\ast)$), so $f = 0$ outside $V_0$. Hence $\{f \neq 0\} \subseteq V_0$ and $\operatorname{supp} f \subseteq \overline{V_0}$, which is compact and lies in $V$. So $\operatorname{supp} f$ is compact (a closed subset of a compact set) and lies in $V$.

Step 4: $f = g$. First, $f \le g$. If $f_r(x) > g_s(x)$ for some $r, s$, then $f_r(x) > 0$ means $x \in V_r$ and $f_r(x) = r$; and $g_s(x) < r \le 1$ means $x \notin \overline{V_s}$ and $g_s(x) = s$, so $s < r$. But $s < r$ gives $V_r \subseteq \overline{V_r} \subseteq V_s \subseteq \overline{V_s}$ by $(\ast)$, so $x \in \overline{V_s}$, a contradiction. So $f_r \le g_s$ for all $r, s$, which gives $f \le g$.

Next, $g \le f$. Suppose $f(x) < g(x)$ for some $x$, and pick rationals $r, s$ with $f(x) < r < s < g(x)$ (possible since $0 \le f(x)$ and $g(x) \le 1$). Since $f(x) < r$, $x \notin V_r$ (otherwise $f(x) \ge f_r(x) = r$). Since $g(x) > s$, $g_s(x) > s$, so $g_s(x) = 1$ and $x \in \overline{V_s}$. But $r < s$ gives $\overline{V_s} \subseteq V_r$, so $x \in V_r$, a contradiction.

So $f = g$ is both lower and upper semicontinuous, and real-valued, so it is continuous. With Step 3, $f \in C_c(X)$, $\chi_K \le f \le \chi_V$, and $\operatorname{supp} f \subseteq V$. $\blacksquare$

That's a long proof, so here's the plan of it in pictures. Step 1 builds a nested stack of open sets, one for each rational level, each squeezed between two older ones by the shrinking theorem. On $\mathbb{R}$ the stack looks like this, with the staircase "highest level whose set contains $x$" drawn over it.

One open set for every rational number, all to pitch a single tent. Camping in a locally compact Hausdorff space is a lot of work.

Steps 2 to 4 prove that the limit really is continuous, using this page's semicontinuity. The sup of the lower steps is lower semicontinuous, the inf of the upper steps is upper semicontinuous, and they get pinched together.

Why not just check continuity with sequences, the way you would on $\mathbb{R}$? Because in a general topological space, sequences can't detect continuity, so a sequence argument would prove nothing. That's why the proof takes the semicontinuous route. On $\mathbb{R}$, though, you can simply write a Urysohn function down.

On $\mathbb{R}$, find a Urysohn function for $K = [0, 1]$ and $V = (-1, 2)$.


Ramp up to $1$ just before $K$ and back down just after it, finishing well inside $V$: $$f(x) = \begin{cases} 0, & x \le -\tfrac{1}{2}, \\ 2x + 1, & -\tfrac{1}{2} \le x \le 0, \\ 1, & 0 \le x \le 1, \\ 3 - 2x, & 1 \le x \le \tfrac{3}{2}, \\ 0, & x \ge \tfrac{3}{2}. \end{cases}$$ The pieces agree where they meet, so $f$ is continuous; $0 \le f \le 1$; $f = 1$ on $K$; and $\operatorname{supp} f = [-\tfrac{1}{2}, \tfrac{3}{2}]$, which is compact and inside $(-1, 2)$.

Why stop the ramps at $-\tfrac{1}{2}$ and $\tfrac{3}{2}$ instead of running them all the way to the edges of $V$?

$f \le \chi_V$ alone doesn't keep the support inside $V$. The ramp $f(x) = x + 1$ on $[-1, 0]$ (and the mirror on $[1, 2]$) is $0$ outside $V$, so $f \le \chi_V$ holds, but $\{f \neq 0\} = (-1, 2)$ has closure $[-1, 2]$, which sticks out of $V$ at both ends. Always finish the ramp strictly inside $V$.

Now do Step 1 yourself on the line. You choose where each new open set ends, as long as it sits between its neighbors.

Nest the Sets

Every choice you made gave a valid Urysohn function, so they're far from unique. That freedom is exactly what Riesz uses: it can make $f$ hug $K$ as tightly as it wants. Test yourself on the proof.

Loading practice engine...

Every hypothesis got used: local compactness to find sets with compact closures, Hausdorff to separate points from compact sets. Hausdorff can't be dropped, even in a space with only two points.

Let $X = \{a, b\}$ with open sets $\emptyset$, $\{a\}$, and $X$. Show that $X$ is compact and locally compact, but Urysohn's lemma fails for $K = V = \{a\}$.


$X$ is finite, so it's compact, and with $U = X$ every point has a neighborhood with compact closure. ($X$ is not Hausdorff: every open set containing $b$ is $X$, which also contains $a$.)

$K = \{a\}$ is compact and $V = \{a\}$ is open. A Urysohn function would need $f(a) = 1$ and $f(b) = 0$. But if $f\colon X \to \mathbb{R}$ is continuous, the preimage of $(-\infty, \tfrac{1}{2})$ would be the open set $\{b\}$, and $\{b\}$ isn't open. So no such $f$ exists.

In a metric space there's a shortcut that skips Steps 1 to 4 entirely: build $f$ out of distances. This is a prelim problem.

Let $(X, d)$ be a metric space. For nonempty $E \subseteq X$, let $d(x, E) = \inf\{d(x, y) : y \in E\}$.

(a) Show that $|d(x, E) - d(y, E)| \le d(x, y)$, so $x \mapsto d(x, E)$ is uniformly continuous.

(b) Let $A, B$ be disjoint, nonempty, closed subsets of $X$, and let $$f(x) = \frac{d(x, A)}{d(x, A) + d(x, B)}.$$ Show that $f$ is continuous, $0 \le f \le 1$, $f = 0$ exactly on $A$, and $f = 1$ exactly on $B$.

(c) Use (b) to prove Urysohn's lemma in $\mathbb{R}^n$ directly. What goes wrong in a general metric space?

Show proof

Proof. (a) For each $y' \in E$, $d(x, E) \le d(x, y') \le d(x, y) + d(y, y')$. Taking the infimum over $y' \in E$ gives $d(x, E) \le d(x, y) + d(y, E)$. Swapping $x$ and $y$ gives the same with the roles reversed, so $|d(x, E) - d(y, E)| \le d(x, y)$. Given $\varepsilon > 0$, $\delta = \varepsilon$ works for every $x$ at once: uniform continuity.

(b) First, $d(x, A) = 0$ exactly when $x \in A$. If $x \in A$, take $y = x$. If $d(x, A) = 0$, there are $a_n \in A$ with $d(x, a_n) \to 0$, so $x \in \overline{A} = A$. The same holds for $B$. Since $A \cap B = \emptyset$, the two distances are never both $0$, so the denominator is positive everywhere. Then $f$ is a quotient of continuous functions with a nonzero denominator, so it is continuous; $0 \le f \le 1$ because the numerator is at most the denominator; $f(x) = 0$ exactly when $d(x, A) = 0$, that is, $x \in A$; and $f(x) = 1$ exactly when $d(x, B) = 0$, that is, $x \in B$.

(c) Let $K \subseteq V \subseteq \mathbb{R}^n$ with $K$ compact and $V$ open. If $K = \emptyset$, take $f = 0$. Otherwise, let $\delta = 1$ if $V = \mathbb{R}^n$, and otherwise let $\delta = \min\{1, \min_{x \in K} d(x, V^c)\}$. The function $x \mapsto d(x, V^c)$ is continuous and positive on $K$ (by (b)'s argument, it's $0$ only on the closed set $V^c$, which misses $K$), so it has a positive minimum on the compact set $K$, and $\delta > 0$.

Let $B = K$ and $A = \{x : d(x, K) \ge \delta/2\}$. Both are closed (by (a), $d(\cdot, K)$ is continuous), they are disjoint, and $A \neq \emptyset$ since $K$ is bounded. By (b), $f$ is continuous with $0 \le f \le 1$ and $f = 1$ on $K$. And $f = 0$ on $A$, so $\{f \neq 0\} \subseteq \{d(x, K) < \delta/2\}$ and $\operatorname{supp} f \subseteq C = \{x : d(x, K) \le \delta/2\}$.

$C$ is closed and bounded, so compact by Heine–Borel. And $C \subseteq V$: if $d(x, K) \le \delta/2$, then $d(x, k) \le \delta/2$ for some $k \in K$ (the infimum of a continuous function on a compact set is attained), while every point of $V^c$ is at distance $\ge \delta$ from $k$. So $f$ is a Urysohn function.

In a general metric space, everything works except the last step: $C$ is closed and bounded, but closed and bounded doesn't mean compact. In $\mathbb{Q}$, for instance, with $K = \{0\}$ and $V = \mathbb{Q}$, a continuous $f$ with $f(0) = 1$ is nonzero on a whole neighborhood of $0$, so its support contains the closure of a neighborhood of $0$ in $\mathbb{Q}$, which is never compact. Local compactness is exactly the missing ingredient. $\blacksquare$

Here's the formula from (b) in the plane. Two closed disks, and $f$ shaded across everything.

Urysohn in a Metric Space

Notice the formula never needed compactness: in a metric space, any two disjoint closed sets can be separated by a continuous function. Compute a few values by hand.

Loading practice engine...

Last, the reason Riesz cares. Integrals of functions in $C_c(X)$ are finite exactly when compact sets have finite measure, and Urysohn's lemma is what proves one direction. (This uses the integral of $L^1$ functions, from The Lebesgue Integral and Integrable Functions.)

Let $X$ be a locally compact Hausdorff space, and $\mu$ a positive measure on a σ-algebra $\mathcal{M}$ in $X$ that contains the Borel sets $\mathcal{B}(X)$. Then $\mu(K) < \infty$ for every compact $K \subseteq X$ if and only if $C_c(X) \subseteq L^1(\mu)$. In that case, $\Lambda f = \int_X f\,d\mu$ is a positive linear functional on $C_c(X)$.

Show proof

Proof. Every $f \in C_c(X)$ is Borel measurable (preimages of open sets are open), so it is $\mathcal{M}$-measurable, and every compact set is closed, so it's in $\mathcal{M}$.

($\implies$) Let $f \in C_c(X)$ and $K = \operatorname{supp} f$, which is compact. The continuous function $|f|$ maps $K$ onto a compact subset of $\mathbb{R}$, so $|f| \le M$ on $K$ for some $M < \infty$, and $f = 0$ off $K$. Hence $$\int_X |f|\,d\mu = \int_K |f|\,d\mu \le M \mu(K) < \infty,$$ so $f \in L^1(\mu)$. (Finite values aren't enough here: it's the bound $M$ that makes the integral finite.)

($\impliedby$) Let $K$ be compact. Urysohn's lemma with $V = X$ gives $f \in C_c(X)$ with $\chi_K \le f$. Then $$\mu(K) = \int_X \chi_K\,d\mu \le \int_X f\,d\mu < \infty.$$

Finally, when $C_c(X) \subseteq L^1(\mu)$, the integral is linear on $L^1(\mu)$, and $\int_X f\,d\mu \ge 0$ whenever $f \ge 0$. So $\Lambda$ is a positive linear functional on $C_c(X)$. $\blacksquare$

So every measure that's finite on compact sets gives a positive linear functional on $C_c(X)$. The Riesz Representation Theorem, next page, runs this arrow backwards: every positive linear functional on $C_c(X)$ comes from such a measure. Urysohn's lemma is the tool it uses to build that measure, one compact set at a time.

Mixed Practice

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, some of them the kind that sounds right and isn't. 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. Flip the switch to type your answer; most types here need their answer choices, and they'll say so.

Loading practice engine...

Last, the Spicy Bonus. An increasing limit of continuous functions is lower semicontinuous (that's part (b) of the proposition). In a metric space, the converse holds too: every nonnegative lower semicontinuous function is an increasing limit of continuous ones, and you can write them down.

🌶️ SPICY BONUS 🌶️

Let $(X, d)$ be a metric space and $f\colon X \to [0, \infty]$ lower semicontinuous, with $f(p) < \infty$ for at least one $p \in X$. For $n \in \mathbb{N}$ and $x \in X$, let $$g_n(x) = \inf\{f(p) + n\,d(x, p) : p \in X\}.$$ Prove that (a) $|g_n(x) - g_n(y)| \le n\,d(x, y)$; (b) $0 \le g_1 \le g_2 \le \cdots \le f$; and (c) $g_n(x) \to f(x)$ for every $x \in X$. Conclude that $f$ is the pointwise limit of an increasing sequence of continuous functions.

Show proof

Proof. Fix $p_0$ with $f(p_0) < \infty$. Then $0 \le g_n(x) \le f(p_0) + n\,d(x, p_0) < \infty$, so each $g_n$ is real-valued.

(a) For every $p$, $f(p) + n\,d(x, p) \le f(p) + n\,d(y, p) + n\,d(x, y)$ by the triangle inequality. Taking the infimum over $p$ on both sides gives $g_n(x) \le g_n(y) + n\,d(x, y)$. Swapping $x$ and $y$ gives the other half. In particular, each $g_n$ is continuous.

(b) Each term $f(p) + n\,d(x, p)$ is $\ge 0$ and increases with $n$, so $0 \le g_n \le g_{n+1}$. Taking $p = x$ gives $g_n(x) \le f(x)$.

(c) Fix $x$, and let $c$ be any real number with $c < f(x)$. The set $\{f > c\}$ is open and contains $x$, so it contains a ball $B(x, r)$ with $r > 0$. For $p \in B(x, r)$, $f(p) + n\,d(x, p) \ge f(p) > c$. For $p \notin B(x, r)$, $f(p) + n\,d(x, p) \ge n r$. So $$g_n(x) \ge \min\{c, \, n r\},$$ which equals $c$ once $n \ge c / r$. Hence $\lim_n g_n(x) \ge c$. This holds for every $c < f(x)$, and $g_n(x) \le f(x)$, so $\lim_n g_n(x) = f(x)$ (also when $f(x) = \infty$).

So $(g_n)$ is an increasing sequence of continuous functions converging pointwise to $f$. Combined with part (b) of the proposition on suprema, for $f\colon X \to [0, \infty]$ on a metric space with $f \not\equiv \infty$: $f$ is lower semicontinuous exactly when it is an increasing limit of continuous functions. $\blacksquare$