[proofplan]
A direct computation: expand $\|x - \sum a_k e_k\|^2$ using bilinearity and orthonormality, complete the square in each $a_k$, and read off both the minimiser ($a_k = c_k$) and the minimal error. Bessel's inequality follows from non-negativity of the squared norm. The infinite case is obtained by taking the monotone limit.
[/proofplan]
[step:Expand the squared norm and complete the square]
Fix $n \le N$ and let $a_1, \ldots, a_n \in \mathbb{R}$.
By bilinearity and orthonormality:
\begin{align*}
\left\|x - \sum_{k=1}^n a_k\, e_k\right\|_H^2 = \|x\|_H^2 - 2\sum_{k=1}^n a_k\,(x, e_k)_H + \sum_{k=1}^n a_k^2.
\end{align*}
Writing $c_k = (x, e_k)_H$ and completing the square:
\begin{align*}
\left\|x - \sum_{k=1}^n a_k\, e_k\right\|_H^2 = \|x\|_H^2 - \sum_{k=1}^n c_k^2 + \sum_{k=1}^n (a_k - c_k)^2.
\end{align*}
The third term vanishes iff $a_k = c_k$ for every $k$, establishing both the unique minimiser and the minimal error formula.
[/step]
[step:Derive Bessel's inequality for the finite case]
Setting $a_k = c_k$, the left side is $\|x - \sum c_k e_k\|_H^2 \ge 0$, so
\begin{align*}
\sum_{k=1}^n c_k^2 \le \|x\|_H^2
\end{align*}
for every $n \le N$.
[/step]
[step:Extend to the infinite case by monotone convergence]
When $N = \infty$, the partial sums $S_n = \sum_{k=1}^n c_k^2$ form a non-decreasing sequence bounded above by $\|x\|_H^2$.
By the monotone convergence theorem for real sequences, $S_n$ converges and
\begin{align*}
\sum_{k=1}^\infty c_k^2 = \lim_{n \to \infty} S_n \le \|x\|_H^2.
\end{align*}
[/step]