Suppose $W$ is a subspace of a Hiblert space(We can assume separability if it simplifies things) and fix an orthonormal family $\{e_{n}\}$ .(Note that this need not be an orthonormal basis as otherwise my question is trivial) . Suppose $W$ has the property that if for some $w\in W$, we have $\langle w,e_{n}\rangle =0$ for all $n$ , then $w$ has to be $0$.
Then is $W\subset\overline{span\{e_{n}\}}$ ?
The reason why I am asking is that I was reading the proof that Haar basis for $L^{2}[0,1]$ is complete . So we already have that if the integral of a continuous function is $0$ on all dyadic intervals then the function itself is $0$. I was thinking whether we can use this to conclude for all $L^{2}$ functions by using the density of $C[0,1]$ . So to do this, I would need that $C[0,1]\subseteq\overline{span\{e_{n}\}}$
What I have tried is just naively defined $w_{n}=\sum_{n=1}^{N}\langle w,e_{n}\rangle e_{n}$ which will converge due to Bessel's inequality . Now all we have to do is show that $w_{n}\to w$ . We directly have Cauchyness of $w_{n}$ so it does have a limit to some $w'\in\overline{W}$. But to show that $w'=w$ , I'll end up using that $\overline{W}$ also has the property that $\langle w',e_{n}\rangle =0$ for all $n$ implies $w'=0$.
Any suggestions?
The claim is not true even for two dimensional space $\mathbb{C}^2.$ Let $e_1=(1,0)$ and $$W=\{(z,z)\,:\, z\in \mathbb{C}\}$$ Then $W$ satisfies the assumptions with respect to $e_1,$ but $W$ is not contained in $\mathbb{C}e_1.$