Solution (source code)

= Solution

Expand using the <inner product>. The two cross terms cancel:
$$
\|x+y\|^2=\|x\|^2+\|y\|^2+2\Re\langle x,y\rangle,\qquad\|x-y\|^2=\|x\|^2+\|y\|^2-2\Re\langle x,y\rangle.
$$
Adding proves $\boxed{\|x-y\|^2+\|x+y\|^2=2(\|x\|^2+\|y\|^2)}$, for real or complex inner products.