Continuous functions on $[0,1]$ is dense in $L^p[0,1]$ for $1\leq p< \infty$
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?
Solution 1:
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$.
Solution 2:
Since $L_p([0,1])=\mathrm{cl}(\mathrm{span}\{\chi_E:E\in\mathfrak{M}([0,1])\})$, it is enough to prove that $$ \forall\varepsilon>0\quad\forall E\in\mathfrak{M}([0,1])\quad\exists f\in C([0,1])\quad \Vert f-\chi_E\Vert<\varepsilon $$ Indeed, by regularity of the Lebesgue measure there exists a closed set $F$ and an open set $U$ such that, $F\subset E\subset U$ with $\mu(U\setminus F)<\varepsilon$. The desired $f\in C([0,1])$ is $$ f(t)=\frac{d(t, [0,1]\setminus U)}{d(t, [0,1]\setminus U)+d(t,F)} $$ where $d(t, S)=\inf\{|t-s|:s\in S\}$ is the distance function.
Solution 3:
Fix $p\text{ , and }1\leq p\lt \infty.$
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]$.
Note that $f\equiv g$ on $F_\epsilon$, so we only need to take care of the integral on $[0,1]- F_\epsilon$.
Continuous function is always integrable on $[0,1]$, so $g^p$ is integrable on $[0,1]$.
Since $|f(x)-g(x)|^p \leq 2^p (|f(x)|^p + |g(x)|^p)$ and $f \in L^p[0,1],$
we know $\int_{[0,1]}|f(x)-g(x)|^p \lt \infty, i.e. |f(x)-g(x)|^p$ is integrable on $[0,1].$
By the proposition I post, $ \int_{[0,1]-F_\epsilon}|f(x)-g(x)|^p \to 0 $ when $m([0,1]- F_\epsilon)\to 0.$
Note that $\epsilon \to 0 \Rightarrow m([0,1]- F_\epsilon)\to 0$ (Since $m([0,1]- F_\epsilon \lt \epsilon$)
For each $\epsilon \gt 0$, we can find a corresponding continuous function $g_\epsilon, $ and $\Vert f-g_\epsilon \Vert \to 0$ when $\epsilon \to 0$.
So, $C([0,1])$ is dense in $L^p[0,1]$.
Reference: The proposition is from the Real Analysis,4th Ed, written by Royden and Fitzpatrick.