TITLE: Haar's base for $L^2[0,1]$
QUESTION [7 upvotes]: $\newcommand{\span}{\operatorname{span}}$
Define $e_{0,0}\equiv 1$, and for all $n\in \mathbb{N}$
$$e_{n,k}=\begin{cases} 2^{n/2} &\text{if } \frac{k-1}{2^n}\leq x\lt \frac{k-\frac{1}{2}}{2^n}\\
-2^{n/2}&\text{if } \frac{k-\frac{1}{2}}{2^n}\leq x\lt \frac{k}{2^n}\\
0 &\text{otherwise} \end{cases}$$
for $k=1,\ldots,2^n$. Let $$H:=\{e_{n,k}:n,k\in \mathbb{N}\}.$$
I want to prove that $H$ is a Hilbert's base for $L^2[0,1]$ with the usal inner product. In order to prove this we must show that $H$ is orthonormal and that $\span(H)$ is dense in $L^2[0,1]$. Here is a good place to begin to see the orthonormality. For the second thing I have the following exercise:
Let $f\in H^{\bot}$, i.e. $f$ is such that for all $n\in \mathbb{N}$ $$\int_0^1 f(x)e_{n,k}(x)dx=0,$$ for $k=1,\ldots,2^n$. Show that for all $n\in \mathbb{N}$ $$\int_0^1f\cdot 1_{[0,k/2^{n})}=0,$$ $k=1,\ldots,2^n$. Conclude that $f\equiv 0$.
The exercise show that $(\overline{\span(H)})^{\bot}=\{0\}$ and then the density follows. And here is where I'm stuck. I wish it $f$ were continuous function, but $f$ is square integrable only. If the notation is not clear, just tell me and I'll fix it. Thanks for your help.

REPLY [11 votes]: ncmathsadist's idea works with a minor change:
First of all, observe that $L^2[0,1] \subset L^1[0,1]$. 

If $f \in L^1[0,1]$ satisfies $\int_{0}^{1} f \cdot e_{k,n} = 0$ for all $k,n \in \mathbb{N}$ then $f = 0$ a.e.

Note that the integral makes sense, as each $e_{k,n}$ is bounded.
Consider the function $\displaystyle F(t) = \int_{0}^{t} f(x)\,dx$ and note that it is absolutely continuous since $f$ is integrable. It is straightforward to show that $0 = F(1) = F(1/2) = F(1/4) = F(3/4) = \cdots $, in words, $F(r) = 0$ for each dyadic rational $r$. But this means $F \equiv 0$ on $[0,1]$.
On the other hand, by the Lebesgue differentiation theorem, we have $F'(t) = f(t)$ almost everywhere on $[0,1]$, so $f = 0$ a.e., as we wanted.
This is essentially Haar's original argument in his Ph.D. thesis, see III §1, pp.363-365. The first part of the thesis appeared as A. Haar, Zur Theorie der orthogonalen Funktionensysteme, Mathematische Annalen 69 (3) (1910), 331–371.

Here's a more hands-on but somewhat more laborious approach — I hope I've got the indices right, but most likely I haven't...
For $m = 2^{k} + n$ put $h_m = e_{k,n}$.

For $f \in L^2 [0,1]$ put $P^M f = \sum_{m=0}^{2^{M}} \langle f, h_m \rangle h_m$. Note that $P^M$ is the orthogonal projection onto the space of functions that are constant on certain intervals with dyadic rational endpoints.
If $f \in C[0,1]$ then $P^M f \to f$ uniformly on $[0,1]$.
If $f \in L^2$ is arbitrary then $P^M f \to f$ in $L^2[0,1]$.

This proves that the subspace spanned by the Haar functions is dense in $L^2$.