= Solution
Set $u=\sum_{k=1}^n\langle x,e_k\rangle e_k$, with the convention that the <inner product> is linear in its first argument. <Orthonormality> gives $\langle x-u,e_j\rangle=0$, hence $x-u\perp U_n$. For any $v\in U_n$ the <Pythagorean identity> yields
$$
\|x-v\|^2=\|x-u\|^2+\|u-v\|^2\ge\|x-u\|^2.
$$
Thus this $u$ is the <best approximation>, and uniqueness gives $\boxed{P_nx=\sum_{k=1}^n\langle x,e_k\rangle e_k}$. No <completeness> assumption on $H$ is necessary for this finite-dimensional construction.
Back to article page