Compact support functions dense in $L_1$

How do you show that the space $C_c (\mathbb{R})$ of continuous functions on $\mathbb{R}$ is dense in $L_1(\mu)$, where $\mu$ is a regular measure on the reals, without using Lusin’s theorem directly?

More concretly, given an integrable function $f$, I’d like to know how to explicitely construct a sequence of functions in $C_c(\mathbb{R})$ that converges to it in $L_1$, without just using simple functions at all, or their density in $L_1(\mu)$.

I thought about defining $f_k:=f\chi_{E_k}$, where $E_k:=\{x\in\mathbb{R}: |f(x)|\geq \frac 1k\}$, but there’s no guarantee that these would be continuous (there’s no guarantee that $f$ is continuous). Perhaps there is a way to “smooth” them out enough to make them continuous?

Solutions Collecting From Web of "Compact support functions dense in $L_1$"

What you do is convolution against “good” functions. If you do the convolution with a $C^\infty$ function, the result will be $C^\infty$.

You can find the details in Chapter 9 of Wheeden-Zygmund. There you can find proofs of the following facts (I’ll write $1$-dimensional versions, but the results are $n$-dimensional):

1) If $f\in L^p(\mathbb R)$, $g\in C^k_0(\mathbb R)$, then $f*g\in C^k(\mathbb R)$ and $D^\alpha(f*g)(x)=(f*D^\alpha g)(x)$ for any $\alpha$.

2) Given $g\in C^\infty_0(\mathbb R)$ with $g\geq0$ and $\int_{\mathbb R}g=1$, $\varepsilon>0$, let $g_\varepsilon(x)=\varepsilon^{-1}g(\varepsilon^{-1}x)$. For any $f\in L^p(\mathbb R)$, $\|f*g_\varepsilon-f\|_p\to0$ as $\varepsilon\to0$.

3) Given $f\in L^p(\mathbb R)$, $\delta>0$, let $f=f_1+f_2$, where $f_1$ has compact support and $\|f_2\|_2<\delta$. Choose $g$ as in 2); then $\|f_1*g_\varepsilon-f_1\|_p\to0$ as $\varepsilon\to0$. Now
\|f_1*g_\varepsilon-f\|_p\leq \|f_1*g_\varepsilon-f_1\|_p+\|f_2\|_p<2\delta
if $\varepsilon$ is small enough. As $f_1*g_\varepsilon\in C_c(\mathbb R)$, we are done.

Another approach uses the representation of the dual $\left[ L^1(\mathbb{R})\right]^\star$ as $L^\infty(\mathbb{R})$ and the Hahn-Banach separation theorem. Namely, to prove that a vector subspace of a Banach space is dense we only need to show that the only continuous linear functional that vanishes on it is the null one.

To do this fix $\phi \in L^\infty(\mathbb{R})$ and suppose that
$$\tag{1}\int_{-\infty}^\infty \phi(x)f(x)\, dx=0, \quad \forall f\in C_c(\mathbb{R}).$$
We claim that $\phi=0$ almost everywhere. Indeed, let $a<b$ be fixed numbers. Approximate the characteristic function $\chi_{[a,b]}$ with a family $\chi^{(\varepsilon)}_{[a, b]}$ of “trapezoidal-like” functions:

trapezoidal function

We have
$$\int_{-\infty}^\infty \left\lvert \chi_{[a,b]}(x)-\chi_{[a,b]}^{(\varepsilon)}\right\rvert\, dx = 2\varepsilon$$
\left\lvert \int_{-\infty}^\infty \phi(x)\chi_{[a,b]}(x)\, dx – \int_{-\infty}^\infty \phi(x)\chi_{[a, b]}^{(\varepsilon)}(x)\, dx \right\rvert & \le \lVert \phi\rVert_{\infty} \int_{-\infty}^\infty \left\lvert \chi_{[a,b]}(x)-\chi_{[a,b]}^{(\varepsilon)}(x)\right\rvert\, dx \\
&=2\varepsilon \lVert \phi\rVert_\infty.
In particular,
$$\int_a^b \phi(x)\, dx=\lim_{\varepsilon \to 0} \int_{-\infty}^\infty \phi(x)\chi_{[a,b]}^{(\varepsilon)}\, dx,$$
and the last limit is $0$ due to our assumption (1): indeed, every $\chi_{[a, b]}^{(\varepsilon)}$ is a continuous function with compact support. We have thus shown that
$$\tag{2} \int_a^b\phi(x)\, dx=0, \qquad \forall a<b.$$
It is intuitively clear that this can happen only if $\phi=0$ almost everywhere: for a rigorous proof of this you can apply the Lebesgue differentiation theorem or Lemma 1 of this post. This proves the claim.

To conclude we only need to recall that every continuous linear functional $\Lambda \in \left[ L^1(\mathbb{R})\right]^\star$ is of the form
$$\Lambda f= \int_{-\infty}^\infty \phi(x)f(x)\, dx,\qquad f \in L^1(\mathbb{R}),$$
for a unique $\phi\in L^\infty(\mathbb{R})$, and then apply the Hahn-Banach separation theorem. $\square$

A final remark: Even if we did not mention convolutions explicitly, the present proof is not that different in nature from the ones presented above. Both rely on the possibility of approximating “rough” functions (like our $\chi_{[a, b]}$) with “smooth” ones.

One standard way of doing this is with convolutions. Let $f\in L^1$.

First note that the sequence $f\chi_{[-n,n]}$ converges to $f$ in $L^1$ as $n\to \infty$, so it suffices to find compactly supported continuous functions converging to $f\chi_{[-n,n]}$. In other words, we may assume with no loss of generality that $f$ is compactly supported.

Let $\varphi\colon \mathbb{R}\to \mathbb{R}$ be a compactly supported smooth function that is nonnegative and has $\int \varphi\,d\mu = 1$. For each $\epsilon>0$, let $\varphi_\epsilon(x) = \epsilon^{-1}\varphi(x/\epsilon)$. Then $\varphi_\epsilon$ is also a nonnegative compactly supported smooth function with $\int\varphi_\epsilon\,d\mu = 1$. One can show that the convolution $f*\varphi_\epsilon$ is a compactly supported smooth function for each $\epsilon$, and that $f*\varphi_\epsilon\to f$ in $L^1$ as $\epsilon\to 0$.