Approximation is the method that lets one prove a theorem for simple or smooth functions and then pass to rough measurable functions by density.
Simple functions in \(L^p\)
Simple functions are the first dense class in \(L^p\).
Theorem. If \(1\le p\lt \infty\), simple functions are dense in \(L^p(\mu)\).
Proof. For \(f\ge0\), dyadic simple approximations of \(f\wedge n\) converge pointwise to \(f\) and are dominated by \(f\). Dominated convergence gives \(L^p\) convergence after applying the construction to \(|f|^p\). Decompose general real or complex \(f\) into positive and negative real and imaginary parts.
Continuous approximation on \(\mathbb R^d\)
Regularity upgrades measurable approximations to continuous ones on Euclidean spaces.
Theorem. For \(1\le p\lt \infty\), \(C_c(\mathbb R^d)\) is dense in \(L^p(\mathbb R^d)\).
Proof. First truncate in value and space: \[ f_n=f\,\mathbf1_{\{|f|\le n\}}\mathbf1_{B(0,n)}. \] Dominated convergence gives \(f_n\to f\) in \(L^p\). Approximate each bounded, finite-support \(f_n\) by a simple function \(\sum_ja_j\mathbf1_{E_j}\). Regularity gives compact \(K_j\subset E_j\subset U_j\) open with \(m(U_j\setminus K_j)\) arbitrarily small. The explicit continuous cutoff \[ \varphi_j(x)=\frac{d(x,U_j^c)}{d(x,U_j^c)+d(x,K_j)} \] satisfies \(0\le\varphi_j\le1\), equals \(1\) on \(K_j\), and vanishes outside \(U_j\). Hence \[ \|\varphi_j-\mathbf1_{E_j}\|_p^p \le m(U_j\setminus K_j). \] Finite linear combinations of the \(\varphi_j\) approximate the simple function and belong to \(C_c(\mathbb R^d)\).
Lemma (continuity of translations). If \(1\le p<\infty\) and \(\tau_hf(x)=f(x-h)\), then \[ \|\tau_hf-f\|_p\longrightarrow0 \qquad(h\to0). \]
Proof. For \(g\in C_c\), uniform continuity and one fixed compact support neighborhood give \(\|\tau_hg-g\|_p\to0\). Given general \(f\in L^p\), choose \(g\in C_c\) with \(\|f-g\|_p<\varepsilon\). Translation invariance of Lebesgue measure gives \[ \|\tau_hf-f\|_p \le2\|f-g\|_p+\|\tau_hg-g\|_p, \] and then \(h\to0\), \(\varepsilon\to0\).
Smooth approximation by mollifiers
Convolution with smooth approximate identities produces smooth functions.
Theorem. If \(f\in L^p(\mathbb R^d)\), \(1\le p\lt \infty\), and \(\rho_\varepsilon(x)=\varepsilon^{-d}\rho(x/\varepsilon)\) is a standard mollifier, then \(\rho_\varepsilon*f\to f\) in \(L^p\).
Proof. Since \(\int\rho_\varepsilon=1\), \[ \rho_\varepsilon*f-f =\int\rho_\varepsilon(h)(\tau_hf-f)\,\mathrm{d}h. \] Minkowski's integral inequality gives \[ \|\rho_\varepsilon*f-f\|_p \le\int\rho_\varepsilon(h)\|\tau_hf-f\|_p\,\mathrm{d}h. \] If \(\operatorname{supp}\rho\subset B(0,R)\), the integral uses only \(|h|\le R\varepsilon\). Translation continuity therefore makes the supremum of the integrand over this ball tend to zero.
Approximation with support control
Support matters in PDE and local analysis.
Proposition. If \(f\in L^p(\Omega)\) and \(\Omega\subset\mathbb R^d\) is open, then functions in \(C_c^\infty(\Omega)\) approximate \(f\) in \(L^p\) when \(f\) is supported away from the boundary; general \(f\) is handled by cutoff exhaustion.
Proof. For support away from the boundary, extend \(f\) by zero and mollify with \(\varepsilon\) smaller than the distance to the boundary. For general \(f\), multiply by cutoffs \(\chi_k\) supported in \(\Omega\) and equal to \(1\) on an increasing exhaustion; \(\chi_k f\to f\) in \(L^p\), then mollify each cutoff version.
Failure of sup-norm density
Density changes with the topology, even when the underlying measurable functions are the same.
Remark. Smooth functions are not dense in \(L^\infty\) under the essential sup norm. For example, no continuous \(g\) can approximate \(\mathbf1_{[0,\infty)}\) with essential-sup error below \(1/2\): continuity forces values near the jump to pass through the midpoint on sets of positive measure. Thus mollification converges in \(L^p\) for \(p<\infty\), and uniformly only when the original function is uniformly continuous.