TITLE: A complete orthonormal system contained in a dense sub-space.
QUESTION [16 upvotes]: 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?

REPLY [16 votes]: 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$.