[proofplan]
We decompose $f = f^+ - f^-$ into positive and negative parts and approximate each separately. For a non-negative $L^p$ function, the [Monotone Approximation by Simple Functions](/theorems/1020) provides a pointwise increasing sequence of non-negative simple functions $s_k \uparrow f$. The $L^p$ convergence $\|f - s_k\|_{L^p} \to 0$ then follows from the Dominated Convergence Theorem applied to $|f - s_k|^p$, with dominator $|f|^p \in L^1$.
[/proofplan]
custom_env
admin
[step:Reduce to the non-negative case via $f = f^+ - f^-$]Write $f = f^+ - f^-$ where $f^+ := \max(f, 0) \ge 0$ and $f^- := \max(-f, 0) \ge 0$. Both $f^+$ and $f^-$ are $\mathcal{A}$-measurable, and both belong to $L^p(X, \mu)$: since $|f^{\pm}| \le |f|$, we have $\int_X |f^{\pm}|^p \, d\mu \le \int_X |f|^p \, d\mu < \infty$.
If we can find simple functions $s^+$ and $s^-$ with $\|f^+ - s^+\|_{L^p} < \varepsilon/2$ and $\|f^- - s^-\|_{L^p} < \varepsilon/2$, then $s := s^+ - s^-$ is simple (by the [Algebra of Simple Functions](/theorems/1077)) and
\begin{align*}
\|f - s\|_{L^p} = \|(f^+ - s^+) - (f^- - s^-)\|_{L^p} \le \|f^+ - s^+\|_{L^p} + \|f^- - s^-\|_{L^p} < \varepsilon,
\end{align*}
using the triangle inequality for $\|\cdot\|_{L^p}$. It therefore suffices to approximate non-negative $L^p$ functions by simple functions.[/step]
custom_env
admin
[guided]The decomposition $f = f^+ - f^-$ reduces the problem to the non-negative case. The triangle inequality in $L^p$ ensures that approximating each part to within $\varepsilon/2$ gives a total error less than $\varepsilon$. The difference $s^+ - s^-$ is simple by the [Algebra of Simple Functions](/theorems/1077), which shows that simple functions are closed under subtraction.[/guided]
custom_env
admin
[step:Approximate a non-negative $L^p$ function by simple functions using monotone approximation]Let $g \in L^p(X, \mu)$ with $g \ge 0$. By the [Monotone Approximation by Simple Functions](/theorems/1020), there exists a sequence of simple functions $s_k : X \to [0, \infty)$, $k = 1, 2, \ldots$, such that
\begin{align*}
0 \le s_1(x) \le s_2(x) \le \cdots \le g(x) \quad \text{and} \quad s_k(x) \to g(x) \quad \text{for every } x \in X.
\end{align*}
Since $0 \le s_k \le g$, $|g(x) - s_k(x)|^p = (g(x) - s_k(x))^p \le g(x)^p$ for every $x$. The function $g^p$ is integrable: $\int_X g^p \, d\mu = \|g\|_{L^p}^p < \infty$. Since $s_k(x) \to g(x)$ pointwise, $(g(x) - s_k(x))^p \to 0$ pointwise. The [Dominated Convergence Theorem](/theorems/4) applies to the sequence $h_k := |g - s_k|^p : X \to [0, \infty)$:
- $h_k$ is measurable for each $k$ (composition of measurable functions with continuous maps).
- $h_k(x) \to 0$ for every $x \in X$.
- $|h_k(x)| = (g(x) - s_k(x))^p \le g(x)^p$ for all $k$ and all $x$, and $g^p \in L^1(X, \mu)$.
Therefore
\begin{align*}
\|g - s_k\|_{L^p}^p = \int_X |g - s_k|^p \, d\mu \to \int_X 0 \, d\mu = 0 \quad \text{as } k \to \infty.
\end{align*}
In particular, for every $\varepsilon > 0$, there exists $K$ with $\|g - s_K\|_{L^p} < \varepsilon$, and $s_K$ is a simple function.[/step]
custom_env
admin
[guided]The [Monotone Approximation by Simple Functions](/theorems/1020) provides a pointwise increasing sequence $s_k \uparrow g$, which is the natural way to approximate a non-negative measurable function by simple ones. The issue is upgrading pointwise convergence to $L^p$ convergence.
Why does the [Dominated Convergence Theorem](/theorems/4) apply? The dominator is $g^p$: since $0 \le s_k \le g$, we get $0 \le g - s_k \le g$, so $(g - s_k)^p \le g^p$. The integrability condition $\int g^p \, d\mu < \infty$ is precisely the hypothesis $g \in L^p$. The pointwise convergence $s_k \to g$ gives $(g - s_k)^p \to 0$ pointwise, and DCT then yields $\int (g - s_k)^p \, d\mu \to 0$.
Note: the [Monotone Convergence Theorem](/theorems/509) alone is insufficient here. MCT applied to $s_k^p \uparrow g^p$ gives $\int s_k^p \, d\mu \to \int g^p \, d\mu$, but this does not immediately yield $\int |g - s_k|^p \, d\mu \to 0$ (the difference is not monotone). DCT is the right tool.[/guided]
custom_env
admin
[step:Combine the two parts]
Given $\varepsilon > 0$, apply the preceding step to $f^+$ and $f^-$ to obtain simple functions $s^+$ and $s^-$ with $\|f^+ - s^+\|_{L^p} < \varepsilon/2$ and $\|f^- - s^-\|_{L^p} < \varepsilon/2$. The function $s := s^+ - s^-$ is simple, and
\begin{align*}
\|f - s\|_{L^p} \le \|f^+ - s^+\|_{L^p} + \|f^- - s^-\|_{L^p} < \varepsilon.
\end{align*}
Since $\varepsilon > 0$ was arbitrary, simple functions are dense in $L^p(X, \mu)$.
[/step]