Solution (source code)

= Solution

The <Beppo Levi theorem>, or <monotone convergence theorem>, states that if $(f_n)$ is a sequence of nonnegative measurable functions on a <measure space> and
$$
f_n\uparrow f
$$
pointwise almost everywhere, then $f$ is measurable and
$$
\boxed{\int f\,d\mu
=\lim_{n\to\infty}\int f_n\,d\mu},
$$
where either side may be infinite.

Measurability of $f=\sup_nf_n$ follows from measurability of countable suprema. Since $f_n\leq f$, <monotonicity of the Lebesgue integral> gives
$$
\lim_n\int f_n\,d\mu\leq\int f\,d\mu.
$$
For the reverse inequality, let $s$ be a nonnegative <simple function> with $s\leq f$, and fix $0<c<1$. Define
$$
E_n=\{x:f_n(x)\geq c,s(x)\}.
$$
Then $E_n\uparrow X$ up to the null set on which convergence fails. Since $f_n\geq c,s\mathbf1_{E_n}$,
$$
\int f_n\,d\mu
\geq c\int_{E_n}s\,d\mu
\longrightarrow c\int s\,d\mu
$$
by <continuity from below of a measure>, applied to the finitely many level sets of $s$. Hence $\lim_n\int f_n\geq c\int s$. Letting $c\uparrow1$ and taking the supremum over all simple $s\leq f$, as in the definition of the <Lebesgue integral>, gives the reverse inequality and proves the theorem.