# 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?

-
I'm sorry for this.. I accepted all of my questions after I saw your comment. –  Detectives Oct 31 '12 at 14:39

• We can assume $f$ bounded almost everywhere by $N$, has the sequence $\{f\chi_{-n\leq f\leq n}\}$ converges in $L^p$ to $f$.

• Lusin's theorem gives a closed set $F_k$ such that $[0,1]\setminus F_k$ has measure $\leq k^{-1}$, and $f$ restricted to $F_k$ is continuous. So $f_{\mid F_k}$ is bounded by $M$.

• Tietze extension theorem gives that the extension still is bounded by $M$.

The preceding point show the result when $f$ is bounded almost everywhere. So we can approximate an almost everywhere bounded function by a continuous one in $L^p$. Now we use a $2\varepsilon$ argument: fix $f\in L^p$, $\widetilde f$ approximating $f$ in $L^p$ by $\varepsilon$. Take $g$ continuous approximating $\widetilde f$ in $L^p$ up to $\varepsilon$. Then $\lVert f-g\rVert_{L^p}\leq 2\varepsilon$.

-
but isn't it still true that M depends on k? what if M goes to infinity if k goes to infinity? –  Detectives Oct 31 '12 at 14:41
I've added details. –  Davide Giraudo Oct 31 '12 at 14:47

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 Lebesgue measure there exist closed set $F$ and 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 a distance function.

-