A counterexample to theorem about orthogonal projection Can someone give me an example of noncomplete inner product space $H$, its closed linear subspace of $H_0$ and element $x\in H$ such that there is no orthogonal projection of $x$ on $H_0$. In other words I need to construct a counterexample to theorem about orthogonal projection when inner product space is not complete.

As I did not succeed to come with an example by myself, I tried searching google books for
"not complete" "orthogonal projection".
I found a counterexample in the book Linear Operator Theory in Engineering and Science
By Arch W. Naylor, George R. Sell, pages
289
and 302. (BTW this was the first ever book on functional analysis I was reading as a student. Now I wish didn't stop somewhere halfway back then - it seems that it contains a lot of interesting things and I remember the style of the book as very readable.)
I will reproduce a brief version of their example below, but it is probably better if you have a look in the book.
I've kept the notation from the book, so $X$ is the noncomplete space (your $H$) and $M$ is the subspace (your $H_0$).


Suppose that $H$ is any Hilbert space and $X$ is a dense subspace
of $H$ that is not closed. Let $z\in H\setminus X$. We define
$$M=\{y\in X; \langle y,z \rangle=0\}.$$
This set $M$ is a closed subspace of $X$.


Now choose $x_0\in X\setminus M$. We will show that $x_0$
has no orthogonal projection on $M$.


Suppose that $y_0\in M$ is the orthogonal projection of $x_0$.
This means $y_0-x_0$ is orthogonal to $M$ and thus it is a scalar
multiple of $z$. This would imply $z\in X$, a contradiction.


So now we only ask whether it is possible to find $H$, $M$, $z$,
$x_0$ as above.
The choice from the book I mentioned is the following:
$H=\ell_2$,
$X=$ the set of all sequences that have only
finitely many nonzero terms
$z=(\frac1{k^2})_{k=0}^\infty$
$x_0$ can be chosen arbitrary such that $\langle x_0,z \rangle \ne 0$.
