Proof verification-density of smooth compactly supported functions

167 Views Asked by At

I am trying to show that $C_{c}^{\infty}(\mathbb{R})$ (smooth compactly supported functions) is dense in $C_{c}(\mathbb{R})$ (in the $L^{p}$ sense). Can anyone check if my proof is correct?

Let $f \in C_{c}(\mathbb{R})$. Then $f$ is supported on some compact set $K \subset B(0, r)$. Let $\{\psi_{n}\}$ be an approximation of the identity. We may assume that all the $\psi_{n}$ are supported in $B(0, r)$. Let $f_{n} := f \ast \psi_{n}$. Then $f_{n}$ is supported in $C := \overline{B(0, 2r)}$. Since $C$ is compact, $f_{n} \rightarrow f$ uniformly on $C$. Then there exists an $N$ such that for $n \geq N$, $\|f_{n} - f\|_{L^{\infty}} \leq \epsilon/|C|^{1/p}$ where $|C|$ is the Lebesgue measure of $C$. Therefore for $n \geq N$, $$\|f_{n} - f\|_{L^{p}} = \left(\int_{\mathbb{R}}|(f_{n} - f)\chi_{C}|^{p}\, dx\right)^{1/p} \leq \|f_{n} - f\|_{L^{\infty}}|C|^{1/p} \leq \epsilon.$$ Since $f_{n} \in C_{c}^{\infty}(\mathbb{R})$, we are done.