# Proof of separability of $L^2(\mathbb{R})$ without Stone-Weierstrass Theorem

Is there a more elementary proof of the fact that $L^2(\mathbb{R})$ is a separable Hilbert Space? The one I am aware of uses the fact that the set of polynomials is dense in $C([0,1])$ (the Stone-Weierstrass Theorem), but I wonder if something simpler can be done.

If $S$ is the set of all functions of the form $$f=\sum_1^n\alpha_j\chi_{(a_j,b_j)}$$where $\alpha_j$, $a_j$ and $b_j$ are all rational then $S$ is countable and it's not hard to show $S$ is dense in $L^2$.

• Actually much more simpler than I expected. Jan 12, 2018 at 19:43

You could use this argument: It's enough to show $L^2[-a,a]$ is separable for each $a>0.$ Each one of those is isomorphic to $L^2[0,2\pi].$ In the last space the exponentials $\{e^{int}:n\in \mathbb Z\}$ form an orthonormal basis. Hence the set of trigonmetric polynomials with rational coefficients, which is countable, is dense in $L^2[0,2\pi].$

• Good argument, but I would need the SW theorem in order to show that the set of trigonometric polynomials is dense in $L^2[0,2\pi]$. My doubt was if I would necessarily need to use the SW theorem in any way. Jan 12, 2018 at 19:42
• We don't need SW here. By Fejer, the trigonometric polynomials are dense in the continuous functions on $[0,2\pi].$ And $C[0,2\pi]$ is dense in $L^2[0,2\pi].$
– zhw.
Jan 12, 2018 at 19:54

David Ullrich's comment is the quickest proof I know. Nonetheless, I'll expand on zhw's answer and show it's not necessary to use the Stone-Weierstrass Theorem to prove the exponentials densely span $L^{2}([0,1])$. For each $n \in \mathbb{Z}$, let $e_{n} : [0,1] \to \mathbb{C}$ be given by $e_{n}(x) = e^{i 2 \pi n x}$. I claim that $\text{span}\{e_{n} \, \mid \, n \in \mathbb{Z}\}$ is dense in $L^{2}([0,1])$.

Recall the definition of the Fourier coefficients of a $L^{2}([0,2 \pi])$ function: if $f \in L^{2}([0,1])$ and $n \in \mathbb{Z}$, then the $n$th Fourier coefficient of $f$ is given by $$\hat{f}(n) = \int_{0}^{1} f(x) e^{- i 2 \pi n x} \, dx.$$
Given $N \in \mathbb{N}$, define the Fejer kernel $K_{N} : [0,1] \to \mathbb{C}$ by $$K_{N}(x) = \sum_{|j| \leq N} \left(1 - \frac{|j|}{N} \right) e^{i 2 \pi j x}.$$ After some calculus, we obtain $$K_{N}(x) = \frac{1}{N} \left(\frac{\sin(N \pi x)}{\sin(\pi x)}\right)^{2}.$$ In particular, $0 \leq K_{N}(x) \leq C N^{-1} \min\{N^{2},x^{-2}\}$. Our original definition shows that $\int_{0}^{1} K_{N}(x) \, dx = 1$, and the inequality just stated shows that $$\forall \delta > 0 \quad \lim_{N \to \infty} \int_{\{x \in [-1/2,1/2] \, \mid \, |x| > \delta\}} K_{N}(x) \, dx = 0.$$ This proves the family $\{K_{N}\}_{N \in \mathbb{N}}$ is an approximate identity. Specifically, the following fact is standard: \begin{align*} \forall f \in C(\mathbb{T}) \quad K_{N} * f \to f \quad \text{uniformly}, \end{align*} where $C(\mathbb{T}) = \{f \in C([0,1]) \, \mid \, f(0) = f(1)\}$. From this, density of $C(\mathbb{T})$ in $L^{2}([0,1])$, and the properties of $\{K_{N}\}_{N \in \mathbb{N}}$, we obtain \begin{align*} \forall f \in L^{2}([0,1]) \quad K_{N} * f \overset{L^{2}}\to f. \end{align*} However, note that $$(K_{N} * f)(x) = \sum_{|j| \leq N} \left(1 - \frac{|j|}{N}\right) \hat{f}(j) e^{i 2 \pi j x}.$$ In particular, $K_{N} * f \in \text{span}\{e_{n} \, \mid \, n \in \mathbb{Z}\}$. This proves $\text{span}\{e_{n} \, \mid \, n \in \mathbb{Z}\}$ is dense in $L^{2}([0,1])$.

Given $a > 0$, our previous work extends to $L^{2}[-a,a]$ by working with the functions $e_{n}(x) = e^{\frac{i \pi n x}{a}}$ instead. Now that we know that $L^{2}([-N,N])$ has a countable dense subset for each $N$, we can use $$\forall f \in L^{2}(\mathbb{R}) \quad f \chi_{[-N,N]} \overset{L^{2}}\to f$$ to conclude.