See the Bessel inequality for what we'll prove.

Since we're approximating x, let's write down the exact approximation and error term:

y_{n} = ∑_{i=1}^{n}⟨x,e_{i}⟩e_{i}

r_{n} = x - y_{n}

Now a bit of simple

magic: r

_{n} is x without its projections on e

_{1},...,e

_{n}, so it should be

orthogonal to all of them

Indeed, for j=1,...,n, we have that

⟨r_{n},e_{j}⟩ = ⟨x,e_{j}⟩ - ∑_{i=1}^{n}⟨⟨x,e_{i}⟩e_{i},e_{j}⟩ =

(All elements of the sum disappear except for i=j, since ⟨e_{i},e_{j}⟩=0...)
⟨x,e_{j}⟩ - ⟨x,e_{j} = 0.

Thus we have a shorter

orthogonal sequence of elements e

_{1},...,e

_{n},r

_{n}; in particular, r

_{n}⊥y

_{n}
But (applying what is essentially the Pythagorean theorem...) we know that

||x||^{2} = ||r_{n}+y_{n}||^{2} =
⟨r_{n}+y_{n},r_{n}+y_{n}⟩ =
||r_{n}||^{2}+||y_{n}||^{2}

The first term ||r

_{n}||

^{2} is

nonnegative, so

||y_{n}||^{2} ≤ ||x||^{2}.

Computing ||y

_{n}||

^{2}=∑

_{i=1}^{n}|⟨x,e

_{i}⟩|

^{2} yields the inequality.