Consider a given orthonormal $M$ in a Hilbert space $H$. Then $M$ is total iff $$\sum_k |\left< x,e_k \right>|^2=\|x\|^2$$ holds for all $x\in H$ where $\left< x,e_k \right>$ are the nonzero Fourier coefficients of $x$.
In Kreyszigs Functional Analysis a problem asks to derive from this equality the following: $$\left<x,y\right>=\sum_k \left< x,e_k \right>\overline{\left< y,e_k \right>}.$$
How would I derive the second equality from the first? Clearly setting $y=x$ derives the first from the second equality, but what about the other direction?