Lusin‘s Theorem
Theorem 1 (Lusin’s theorem). Suppose that $X$ and $Y$ are Polish spaces, that $\mu$ is a finite Borel measure on $X$, that $f:X\to Y$ is Borel measurable, and that $\varepsilon>0$. Then there exists a compact subset $K$ of $X$, with
$$
\mu(X\setminus K)<\varepsilon,
$$
such that the restriction of $f$ to $K$ is continuous.
Proof : Let $d$ be a metric on $Y$ which defines the topology of $Y$. Since $Y$ is Polish, in particular it is separable, so there exists a dense sequence $(y_n)_{n=1}^\infty$ in $Y$.
Fix $j\in \mathbb{N}$. For each $n\in \mathbb{N}$, define
$$
A_{n,j}=\{x\in X:d(f(x),y_n)<1/j\},
$$
which is a Borel subset of $X$.
Now define
$$
B_{n,j}=A_{n,j}\setminus \bigcup_{m=1}^{n-1}A_{m,j},
$$
and
$$
C_{n,j}=\bigcup_{m=1}^n A_{m,j}=\bigcup_{m=1}^n B_{m,j}.
$$
Then $(C_{n,j})_{n=1}^\infty$ is an increasing sequence of Borel subsets of $X$ with
$$
\bigcup_{n=1}^\infty C_{n,j}=X.
$$
Since $\mu$ is finite, continuity from below tells us that there exists $N_j\in \mathbb{N}$ such that
$$
\mu(X\setminus C_{N_j,j})<\frac{\varepsilon}{2^{j+1}}.
$$
Now fix $1\le n\le N_j$. Since $B_{n,j}$ is Borel in the Polish space $X$, and $\mu$ is a finite Borel measure on $X$, which implies $\mu$ is tight, hence there is a compact set $K_{n,j}\subseteq B_{n,j}$ such that
$$
\mu(B_{n,j}\setminus K_{n,j})<\frac{\varepsilon}{2^{j+1}N_j}.
$$
Let
$$
K_j=\bigcup_{n=1}^{N_j}K_{n,j}.
$$
Since this is a finite union of compact sets, $K_j$ is compact.
We next estimate $\mu(X\setminus K_j)$. Since
$$
C_{N_j,j}\setminus K_j
=\bigcup_{n=1}^{N_j}(B_{n,j}\setminus K_{n,j}),
$$
we have
$$
\mu(C_{N_j,j}\setminus K_j)
\le \sum_{n=1}^{N_j}\mu(B_{n,j}\setminus K_{n,j})
< \sum_{n=1}^{N_j}\frac{\varepsilon}{2^{j+1}N_j}
=\frac{\varepsilon}{2^{j+1}}.
$$
Moreover,
$$
X\setminus K_j
=(X\setminus C_{N_j,j})\cup (C_{N_j,j}\setminus K_j),
$$
we have
$$
\mu(X\setminus K_j)
\le \mu(X\setminus C_{N_j,j})+\mu(C_{N_j,j}\setminus K_j)
<\frac{\varepsilon}{2^{j+1}}+\frac{\varepsilon}{2^{j+1}}
=\frac{\varepsilon}{2^j}.
$$
Now define a function $f_j:K_j\to Y$ by setting
$$
f_j(x)=y_n \qquad \text{for } x\in K_{n,j},\ 1\le n\le N_j.
$$
This is well-defined because the sets $K_{n,j}$ are pairwise disjoint.
We claim that $f_j$ is continuous on $K_j$. Indeed, for each $n$, the set $K_{n,j}$ is compact in the metric space $X$, hence closed in $X$, and therefore also closed in the subspace $K_j$. Since there are only finitely many such sets and they are pairwise disjoint, each point $x\in K_j$ lies in exactly one $K_{n,j}$. Let $x\in K_{n,j}$. Because
$$
K_j\setminus K_{n,j}=\bigcup_{\substack{1\le m\le N_j\\ m\ne n}}K_{m,j},
$$
which is a finite union of closed sets in $K_j$, it is closed in $K_j$. Hence $K_{n,j}$ is open in $K_j$ as well. So each $K_{n,j}$ is clopen in the subspace $K_j$. Now let $U\subseteq Y$ be open. Then
$$
f_j^{-1}(U)=\bigcup_{\{n:y_n\in U\}}K_{n,j},
$$
which is open in $K_j$ because each $K_{n,j}$ is open in $K_j$. Thus $f_j$ is continuous.
Next we show that $f_j$ uniformly approximates $f$ on $K_j$. If $x\in K_{n,j}$, then $K_{n,j}\subseteq B_{n,j}\subseteq A_{n,j}$, so by the definition of $A_{n,j}$,
$$
d(f(x),y_n)<\frac{1}{j}.
$$
Since $f_j(x)=y_n$, it follows that
$$
d(f_j(x),f(x))<\frac{1}{j}
\qquad \text{for all } x\in K_j.
$$
Finally, define
$$
K=\bigcap_{j=1}^\infty K_j.
$$
Since $K\subseteq K_1$ and $K_1$ is compact, and since $K$ is closed in $K_1$, it follows that $K$ is compact. Also,
$$
X\setminus K
= X\setminus \bigcap_{j=1}^\infty K_j
= \bigcup_{j=1}^\infty (X\setminus K_j).
$$
Therefore,
$$
\mu(X\setminus K)
\le \sum_{j=1}^\infty \mu(X\setminus K_j)
< \sum_{j=1}^\infty \frac{\varepsilon}{2^j}
=\varepsilon.
$$
For each $j$, since $K\subseteq K_j$, the restriction $f_j|_K$ is continuous on $K$. Moreover, for every $x\in K$, we have $x\in K_j$, so
$$
d(f_j(x),f(x))<\frac{1}{j}.
$$
Hence
$$
\sup_{x\in K} d(f_j(x),f(x))\le \frac{1}{j}\to 0,
$$
so $f_j|_K\to f|_K$ uniformly on $K$. Because each $f_j|_K$ is continuous and the uniform limit of continuous functions is continuous, it follows that $f|_K$ is continuous. This completes the proof. $\square$
Corollary 1. Suppose that $f$ is a non-negative real-valued Borel measurable function on $X$. Then
$$
\int_X f\ d\mu
=
\sup\left\{
\int_K f\ d\mu
:
K \text{ compact},\ K\subseteq X,\ f|_K \text{ continuous}
\right\}.
$$
Proof : By Lusin’s theorem, for each $j\in \mathbb{N}$ there exists a compact set $L_j\subseteq X$ such that
$$
\mu(X\setminus L_j)<\frac{1}{2^j}
$$
and such that $f|_{L_j}$ is continuous. Define
$$
K_j=\bigcap_{m=j}^\infty L_m.
$$
Then each $K_j$ is closed subset of $L_j$, which follows that $K_j$ is compact. Moreover, the sequence $(K_j)_{j=1}^\infty$ is increasing.
Since
$$
X\setminus K_j
=
X\setminus \bigcap_{m=j}^\infty L_m
=
\bigcup_{m=j}^\infty (X\setminus L_m),
$$
we have
$$
\mu(X\setminus K_j)
\le \sum_{m=j}^\infty \mu(X\setminus L_m)\le \sum_{m=j}^\infty \frac{1}{2^m}\to 0\quad \text{as } j\to\infty.
$$
Also, since $K_j\subseteq L_j$, the restriction $f|_{K_j}$ is continuous for every $j$.
Thus we have constructed an increasing sequence $(K_j)_{j=1}^\infty$ of compact subsets of $X$ such that
$$
\mu(X\setminus K_j)\to 0
$$
and such that $f|_{K_j}$ is continuous for every $j$.
Now define
$$
f_j=f\ \mathbf{1}_{K_j}.
$$
Then $f_j\ge 0$ and
$$
f_j(x)\uparrow f(x)
\qquad \text{for } \mu\text{-a.e. } x.
$$
By the monotone convergence theorem,
$$
\int_X f\ d\mu
=
\lim_{j\to\infty}\int_X f_j\ d\mu=\lim_{j\to\infty}
\int_X f\ \mathbf 1_{K_j}\ d\mu
=\lim_{j\to\infty}
\int_{K_j} f\ d\mu.
$$
Now let
$$
S=
\left\{ \int_K f\ d\mu : K \text{ compact},\ K\subseteq X,\ f|_K \text{ continuous} \right\}.
$$
For each $j$, the set $K_j$ is compact and $f|_{K_j}$ is continuous, so
$$
\int_{K_j} f\ d\mu\in S.
$$
Hence
$$
\int_{K_j} f\ d\mu\le \sup S
\qquad \text{for every } j.
$$
Let $j\to\infty$, we have
$$
\int_X f\ d\mu\le \sup S.
$$
On the other hand, if $K\subseteq X$ is compact and $f|_K$ is continuous, then since $f\ge 0$,
$$
\int_K f\ d\mu\le \int_X f\ d\mu.
$$
Therefore every element of $S$ is bounded above by $\int_X f\ d\mu$, and so
$$
\sup S\le \int_X f\ d\mu.
$$
Combining the two inequalities, we conclude that
$$
\int_X f\ d\mu
=
\sup\left\{
\int_K f\ d\mu
:
K \text{ compact},\ K\subseteq X,\ f|_K \text{ continuous}
\right\}.
$$
This completes the proof. $\square$
Reference
Chapter 16 in the following reference:
Garling, David JH. Analysis on Polish spaces and an introduction to optimal transportation. Vol. 89. Cambridge University Press, 2018.
The cover image of this article was taken on Rottnest Island in Western Australia, Australia.
Lusin‘s Theorem
