A complete orthonormal system contained in a dense sub-space.
Let H be a separable complex Hilbert space. Let A be a dense sub-space of H. Is it possible to find a complete orthonormal system for H that is contained in A?
nonseparable counterexample (but the original question specifies "separable")
Pointed out to me in newsgroup sci.math.research by Robert Israel in 2000.
See Dixmier, "Sur les bases orthonormales dans les espaces prehilbertiens", Acta Sci. Math. Szeged 15 (1953) 29-30.
Let $H_1$ be an infinite-dimensional separable Hilbert space. There is a linearly independent set $\{x_b: b \in B\}$ in $H_1$, indexed by a set $B$ of cardinality $c$ (e.g. in $L^2([0,1])$ you could take $x_b$ for $0 < b < 1$ as the step function $x_b(t) = 0$ for $t < b$, $1$ for $t \ge b$). Let $H_2$ be the non-separable Hilbert space with orthonormal basis $\{y_b: b \in B\}$ indexed by $B$. Let $K$ be the linear span of the vectors $\{x_b + y_b: b \in B\}$ in the direct sum $H_1 \oplus H_2$. Then there is no orthonormal set in $K$ whose span is dense in $K$. In fact:
1) Any orthonormal set in $K$ is countable.
Proof: Suppose $\{ z_a: a \in A \}$ is an orthonormal set in $K$. We can write each $z_a$ as a finite sum: $$z_a = \sum_{i=1}^n c_i (x_{b_i} + y_{b_i}),$$ where $\sum_i c_i x_{b_i} \ne 0$ since the $x_b$ are linearly independent. Let $\{ w_j: j \in \mathbb N \}$ be an orthonormal basis of $H_1$. For each $j$, we can have $\langle w_j, z_a\rangle \ne 0$ for at most countably many $a$'s, so there are only countably many $a$'s for which some $\langle w_j, z_a\rangle \ne 0$, and thus at most countably many $a$'s for which any $\langle w, z_a\rangle \ne 0$ with $w \in H_1$. But since $$\left\langle \sum_{i=1}^n c_i x_{b_i}, z_a\right\rangle = \left\|\sum_{i=1}^n c_i x_{b_i}\right\|^2 > 0,$$ this says that $A$ is at most countable.
2) The span of any countable orthonormal set is separable, and therefore is not dense in $K$.
Yes.
The proof is essentially the same as finding an orthonormal basis for $H$ itself. As a subspace of a separable metric space, $A$ has a countable dense subset $\{x_n\}$. Apply the Gram-Schmidt algorithm to $\{x_n\}$ to get an orthonormal set $\{e_n\}$. By construction, the linear span of $\{e_n\}$ contains every $x_n$, so it is dense in $A$ and hence also in $H$, making $\{e_n\}$ a complete orthonormal system.
Edit: I'd be interested in seeing an answer which addresses the non-separable case. I thought about using my argument with a transfinite induction, but it doesn't work. Suppose we have an orthonormal subset of $A$, $\{e_i\}_{i < \alpha}$ for some ordinal $\alpha$. Let $E_\alpha$ be the closed span of $\{e_i\}_{i <\alpha}$; if $E_\alpha \ne H$ then we can find some vector $x \in A \cap E_\alpha^c$. The natural choice for the next basis vector $e_\alpha$ would be $e_\alpha = x - P_{E_\alpha} x$, as this will be orthogonal to all $\{e_i\}_{i < \alpha}$; but as $A$ is not closed, $E_\alpha$ need not be contained in $A$, so we could get $e_\alpha \notin A$ and this breaks down.
Of course the problem can happen only when $\alpha$ is a limit ordinal, so this seems to suggest that maybe there is something special about the separable case, and perhaps the statement is false in general. But I couldn't think of a counterexample offhand.
Let $\{e_n\}_{n=1}^{+\infty}$ a countable orthonormal basis for $H$. Since $A$ is dense in $H$, for each $n,k\geq 1$, let $a_{n,k}\in A$ such that $\lVert e_n-a_{n,k}\rVert\leq k^{—1}$. We apply Gram-Schmidt process to get an orthonormal family $\{b_{nk}\}\subset A$ (as $A$ is a subspace) which generates $\operatorname{Span}(a_{n,k},k,n\geq 1\}$. Then $\{b_{n,k}\}$ is an orthonormal basis.