Solution (source code)

= Solution

Suppose $u,v\in U_n$ both minimize the distance, with common value $d$. Apply the parallelogram identity to $x-u$ and $x-v$:
$$
4\left\|x-\frac{u+v}2\right\|^2+\|u-v\|^2=4d^2.
$$
The midpoint belongs to the linear subspace $U_n$, so its distance from $x$ is at least $d$. It follows that $\|u-v\|^2\leq0$, hence $u=v$. Thus \b[the best approximation is unique].