In V. Moretti's "Spectral Theory and Quantum Mechanics," example 3.32 (1), he attempts to show that the functions
$$f_n(x)=\frac{1}{\sqrt{L}}e^{i\frac{2\pi n}{L}x},$$
where $n\in\mathbb Z,x\in[-L/2,L/2]$ for fixed $L>0$, generate a dense subspace of $L^2[-L/2,L/2]$. But I think his argument is wrong, as confirmed by this post and discussed by me below. My question is, how can we most easily correct this proof, preferably without resorting to an entirely different method?
Let $S=\operatorname{span}\{f_n\}_{n\in\mathbb N}$. Moretti's approach is to show that $S$ is dense in $C[-L/2,L/2]$ (the continuous functions from $[-L/2,L/2]$ to $\mathbb C$), and then that $C[-L/2,L/2]$ is dense in $L^2[-L/2,L/2]$. But to show that $S$ is dense in $C[-L/2,L/2]$, he invokes the Stone-Weierstrass theorem, which requires that $S$ separates points in $[-L/2,L/2].$ From what I can tell (and as is similarly claimed in the above-linked post), $S$ does not separate the endpoints $-L/2$ and $L/2$. Can this approach still be salvaged, and if so, how?
The proof is essentially correct. The fix is to prove the density instead on the torus, ie. $[-L/2,L/2]$ with the endpoints quotiented together. Then they are the same point, so there’s nothing to separate! (Note that S-W still works on a compact Hausdorff space.) Then since null sets don’t matter, $L^2$ on the torus is naturally identified with $L^2$ on this interval.