Solution (source code)

= Solution

Use the convention that the <inner product> is linear in its first argument. Set $a_n=\langle x,e_n\rangle$ and $P_Nx=\sum_{n\leq N}a_ne_n$. Orthogonality makes $P_Nx$ the nearest point in the finite span of the first $N$ basis vectors. Since an <orthonormal basis> has dense linear span, for every $\epsilon>0$ a finite linear combination approximates $x$ within $\epsilon$. For all larger $N$, the nearest-point property gives $\|x-P_Nx\|<\epsilon$. Thus the series converges in $X$ to $x$ even without completeness. Taking <inner products> with each $e_n$ proves uniqueness of its coefficients.

In the Hilbert-space case, <Parseval's identity> gives $\sum|a_n|^2=\|x\|^2$. Completeness makes
$$
\boxed{Ux=\sum_{n=1}^\infty\langle x,e_n\rangle f_n}
$$
convergent. It is linear and preserves <inner products> and norms, so bounded with norm one. Its inverse is the corresponding map sending $f_n$ to $e_n$; equivalently every coefficient sequence of a vector in the $f_n$ basis is also square-summable in the $e_n$ basis. Hence $U$ is surjective and \b[unitary]. Any bounded map agreeing on the $e_n$ agrees on their dense span and then on all of $X$, proving uniqueness.