Solution (source code)

= Solution

Let $d=\inf_{y\in Y}\|x-y\|$ and choose $y_n\in Y$ with $\|x-y_n\|\to d$. The <parallelogram law> gives
$$
\|y_n-y_m\|^2
=2\|x-y_n\|^2+2\|x-y_m\|^2
-4\left\|x-\frac{y_n+y_m}{2}\right\|^2
\leq2\|x-y_n\|^2+2\|x-y_m\|^2-4d^2.
$$
The right side tends to zero. Thus $(y_n)$ is Cauchy. The closed subspace $Y$ of a <Hilbert space> is complete, so $y_n\to y_0\in Y$. Continuity of the <norm> gives $\|x-y_0\|=d$, proving \b[the <distance> is attained].