From book "Introduction to Hilbert spaces with applications" by Lokenath Debnath, and Piotr Mikusinski
(Complete orthonormal sequence) An orthonormal sequence $(x_n)$ in an inner product space $E$ is said to be complete if for every $x \in E$ we have $$x = \sum_{n=1}^\infty \langle x, x_n \rangle x_n.$$
(Orthonormal basis) An orthonormal system $B$ in an inner product space $E$ is called an orthonormal basis if every $x \in E$ has a unique representation $$x = \sum_{n=1}^\infty \alpha_n x_n,$$ where $\alpha_n \in \mathbb{C}$ and $x_n$'s are distinct elements of $B.$
theorem Let $(x_n)$ be an orthonormal sequence in a Hilbert space $H,$ and let $(\alpha_n)$ be a sequence of complex numbers. Then the series $\sum_{n=1}^\infty \alpha_n x_n$ converges if and only if $\sum_{n=1}^\infty |\alpha_n|^2 < \infty$ and in that case \begin{eqnarray} \label{orthonormal_sequence_H_series_converges_iff_coefficients_in_l2_equality}\left \lVert \sum_{n=1}^\infty \alpha_n x_n \right \rVert^2 = \sum_{n=1}^\infty |\alpha_n|^2. \end{eqnarray}
To show that a complete orthonormal sequence $(x_n)$ is an orthonormal basis. It suffices to show the uniqueness. Indeed, if $$x = \sum_{n=1}^\infty \alpha_n x_n \ \text{and} \ x = \sum_{n=1}^\infty \beta_n x_n,$$ then $$ 0 = \|x-x\|^2 = \|\sum_{n=1}^\infty \alpha_n x_n - \sum_{n=1}^\infty \beta_n x_n\|^2 = \|\sum_{n=1}^\infty (\alpha_n - \beta_n) x_n\|^2 = \sum_{n=1}^\infty |\alpha_n - \beta_n|^2$$ by the last theorem. This means that $\alpha_n = \beta_n$ for all $n \in \mathbb{N},$ proving the uniqueness.
My question is how he use that the sequence is a complete orthonormal sequence in his proof and how he can make use of the last theorem.
My proof is if $(x_n)$ is a complete orthonormal sequence then for every $x \in H,$ $x = \sum_{n=1}^\infty \langle x, x_n \rangle x_n$. To prove that $(x_n)$ is an orthonormal basis, it sufficies to show that $\langle x, x_n \rangle$ is the only possible coefficients for the expansion of $x.$ Suppose that $x = \sum_{n=1}^\infty \alpha_n x_n$ then we want to prove that $\alpha_n = \langle x, x_n \rangle$. does this work?? $\langle x, x_n \rangle = \langle \sum_{k=1}^\infty \alpha_k x_k, x_n\rangle = \sum_{k=1}^\infty \alpha_k\langle x_k, x_n\rangle = \alpha_n$