Real Analysis – Continuous Functions on $[0,1]$ is Dense in $L^p[0,1]$ for $1\leq p< \infty$

real-analysis

I tried to show that the continuous functions on $[0,1]$ are dense in $L^p[0,1]$ for $ 1 \leq p< \infty $

by using Lusin's theorem.

I proceeded as follows..

By using Lusin's theorem, for any $f \in L^p[0,1]$, for any given $ \epsilon $ $ > $ 0, there exists a closed set $ F_\epsilon $ such that $ m([0,1]- F_\epsilon) < \epsilon$
and $f$ restricted to $F_\epsilon$ is continuous.

Using Tietze's extension theorem, extend $f$ to a continuous function $g$ on $[0,1]$.
We claim that $\Vert f-g\Vert_p $ is sufficiently small.

$$
\Vert f-g\Vert_p ^p = \displaystyle \int_{[0,1]-F_\epsilon} |f(x)-g(x)|^p dx
$$
$$
\leq \displaystyle \int_{[0,1]-F_\epsilon} 2^p (|f(x)|^p + |g(x)|^p) dx
$$
now using properties of $L^p$ functions, we can make first part of our integral sufficiently small. furthermore, since $g$ is conti on $[0,1]$, $g$ has an upper bound $M$, so that second part of integration also become sufficiently small.

I thought I solved problem, but there was a serious problem.. our choice of g is dependent of $\epsilon$ , so constant $M$ is actually dependent of $\epsilon$, so it is not guaranteed that second part of integration becomes 0 as $\epsilon $ tends to 0.

I think if our choice of extension can be chosen further specifically, for example, by imposing $g \leq f$ such kind of argument would work. Can anyone help to complete my proof here?

Best Answer

Let $f\in\mathbb L^p$ and $\varepsilon\gt 0$. Choose $N$ such that $\left\lVert f-f\mathbf 1_{-N\leqslant f\leqslant N}\right\rVert_p\leqslant \varepsilon/2$. Let $f_N:=f\mathbf 1_{-N\leqslant f\leqslant N}$.

  • Lusin's theorem gives a closed set $F$ such that $[0,1]\setminus F$ has measure smaller than $2^{-p} \varepsilon^p/\left(2N\right)^p$, and $f_N$ restricted to $F$ is continuous.

  • Tietze extension theorem applied to $f_N$ and $F$ gives that the extension $g$ is still bounded by $N$.

    Consequently, $$\left\lVert f_N-g\right\rVert_p^p=\int_{[0,1]\setminus F} \left\lvert f_N-g\right\rvert_p^p\leqslant (2N)^p\lambda\left([0,1]\setminus F\right)\leqslant 2^{-p}\varepsilon^{-p}. $$ We thus got a continuous function $g$ such that $$\left\lVert f-g\right\rVert_p\leqslant \varepsilon,$$ which show that the set of continuous functions is dense in $\mathbb L^p$.