Let $X$ be a separable Hilbert space and $Y$ a closed subset. Then I want to conclude that $Y$ is separable. So I wanted to invoke the theorem that says that a Hilbert space is separable iff it has a complete orthonormal system, but then I realized that since $Y \subset X$ then the same complete orthonormal system works for $Y$.
So I think there is something wrong in my reasoning, because the above argument seems a little bit awful for me. Then Can someone help me to prove that theorem please?
Thanks a lot in advance.
Hint: Since $Y$ is closed, the orthogonal projection $P_Y$ is well defined. Now take a countable dense subset of $X$ and consider its projection onto $Y$.
More specifically: let $A$ be a countable dense subset in $X$. Take an arbitrary open set $U$ in $Y$, and consider $P_Y^{-1}(U) \subset X$, which is open by continuity. Now, by denseness of $A$ there exists an element $a \in A$ such that $a \in P_Y^{-1}(U)$. Then $P_Y(a) \in U$, so $P_Y(A)$ is the desired countable dense subset (every open set in $Y$ contains an element of the dense subset).
Note that this also proves that if you have $f\colon H \to H'$ continuous and surjective, and $H$ is separable, then $H'$ is separable.