$L^p(\mathbb{R})$ separable.

I'm trying to prove $L^p(\mathbb{R})$, $p \in [1,\infty)$ is separable by showing the collection$$S:= \{\sum_{i=1}^nr\chi_{(a_i,b_i)}\}_{(a_i,b_i,r) \in \mathbb{Q}^3}$$ is dense in $L^p$. So, since simple functions are dense in $L^p$ given $f \in L^p$, Let $\epsilon >0$ and choose $s$ such that $\|s-f\|_{L^p} < \frac{\epsilon}{2}$. Now, let $$s = \sum_{i=1}^{n} c_i \chi_{E_i}$$ with $E_i$ pairwise disjoint, wlog. Let $r \in S$ with $$r = \sum_{i=1}^{n} r_i \chi_{A_i}$$ be such that $|r_i - c_i| <1$ and $\mu((E_i\setminus A_i) \cup (A_i\setminus E_i)) < \frac{\epsilon^p}{2n}$ with the $A_i$ pairwise disjoint, wlog. Then,

\begin{eqnarray*} \left( \int_\mathbb{R} |s-r|^p \, d\mu \right)^\frac{1}{p} &\leq& \left( \int_\mathbb{R} \left(\sum_{i=1}^{n}|c_i\chi_{E_i}-r\chi_{A_i}| \right)^p \, d\mu \right)^\frac{1}{p} \\ & \stackrel{Minkowski}{\leq}& \sum_{i=1}^{n} \left( \int_\mathbb{R} |c_i\chi_{E_i}-r_i\chi_{A_i}|^p \, d\mu \right)^\frac{1}{p} \\ &<& \sum_{i=1}^{n} \left( \int_\mathbb{R} |\chi_{(E_i\setminus A_i) \cup (A_i\setminus E_i)}|^p \, d\mu \right)^\frac{1}{p} \\ &=& \sum_{i=1}^{n} \left( \int_{(E_i\setminus A_i) \cup (A_i\setminus E_i)} 1 \, d\mu \right)^\frac{1}{p} \\ &<& \sum_{i=1}^{n} (\frac{\epsilon^p}{n})^\frac{1}{p} = \frac{\epsilon}{2} \end{eqnarray*}

since $$|c_i\chi_{E_i} - r_i\chi_{A_i}| = \begin{cases} 0 \quad \,: x \notin A_i \cup E_i, x \in A_i \cap E_i\\ |c_i-r_i| \quad \, : x \in (E_i \setminus A_i) \cup (A_i \setminus E_i). \\ \end{cases} < \chi_{(E_i\setminus A_i) \cup (A_i\setminus E_i)}$$
and therefore $\|f-r\|_{L^p} < \epsilon$, as desired.

Is this correct? Do I need fix anything? Are the assumptions I've made about disjointness okay?

• You didn't specify for which $p$ you want to show this result. In case of $p = \infty$, the result does not hold. – Olorun Oct 29 '15 at 8:38
• @Olorun Indeed $p<\infty$. I've already proven $L^\infty$ is not separable – Anthony Peter Oct 29 '15 at 8:42
• Then it might be good to specify $p \in [1,\infty)$ somewhere. – Olorun Oct 29 '15 at 8:44
• @Olorun Edited. – Anthony Peter Oct 29 '15 at 8:44
• I haven't checked the details of the proof, but the way I did it before was to apply Lusin's theorem (i.e. continuous functions are dense in $L^p$, and then use the fact that the space of trigonometric polynomials is dense in that space). Just in case you are interested in another method. – Olorun Oct 29 '15 at 8:45

$E_i$ could be any measurable set, for instance, $E_i=(1,2)\cup (3,4$). It is not clear from your proof how to approximate an arbitrary $E_i$ with a single open interval.