not understanding a step in a proof Hi: I'm reading some introductory notes on hilbert spaces and there is a step in a proof that I don't follow. I will put the exact statement below. If someone could explain how it is obtained, it's appreciated. Note that commans between two terms when they have < and > around them denotes the innner product. Also, $e_{n}$ for $n = 1,2,3,\ldots$ is a complete orthonormal sequence in a Hilbert space $H$ and $x$ is in $H$.
Proof: Observe that
\begin{eqnarray*}
0 <=  || x - \sum_{n=1}^{m} <x,e_{n}>e_{n}) ||^2 
& = & \left< x - \sum_{n=1}^{m} <x,e_{n}>e_{n}, x - \sum_{n=1}^{m} <x,e_{n}>e_{n} \right> \\
& = & \left< x, x - \sum_{n=1}^{m} <x,e_{n}>e_{n} \right> 
- \sum_{n=1}^{m} <x, e_{n}> \left < e_{n}, x - \sum_{n=1}^{m} <x,e_{n}>e_{n} \right > \\
& = & ||x||^2 - \sum_{n=1}^{m} |<x, e_{n}>|^2
\end{eqnarray*}
I understand the first two lines of above.
My question is how one goes from the second to the last line to the last line. Thanks for your help.
 A: Note that the first inner product in the second-last line is:
$$ \left\langle x, x - \sum_{n=1}^m \langle x,e_n\rangle e_n\right\rangle = \langle x,x\rangle - \sum_{n=1}^m \langle x,e_n\rangle \langle x,e_n\rangle = \|x\|^2 - \sum_{n=1}^m |\langle x,e_n\rangle|^2 $$
so we would hope that the second is equal to zero. We have
$$ \sum_{n=1}^m \langle x,e_n\rangle\left\langle e_n, x - \sum_{n=1}^m \langle x,e_n\rangle e_n\right\rangle = \sum_{n=1}^m \langle x,e_n\rangle\langle e_n,x\rangle - \sum_{n=1}^m \langle x,e_n\rangle^2 \sum_{k=1}^m \langle e_n,e_k\rangle $$
Luckily, $\langle e_n,e_k\rangle = 1$ if $n=k$ and $0$ otherwise, so the two terms in the difference are equal.
A: For clarity's sake, I've rewritten this second to last line as
$$\left< x, x - \sum_{n=1}^{m}\left[ <x,e_{n}>e_{n}\right] \right> 
- \sum_{n=1}^{m}\left[ <x, e_{n}> \left < e_{n}, x - \sum_{i=1}^{m} <x,e_{i}>e_{i} \right >\right].$$
By linearity of the inner-product,
$$\left< x, x - \sum_{n=1}^{m}\left[ <x,e_{n}>e_{n}\right] \right> =||x||^2-\sum_{n=1}^m \left[<x,e_n>^2\right].$$
Since $<e_n,e_m>=0$ whenever $m \neq n$ and $1$ otherwise, whenever $1 \leq n\leq m$, we find that
$$\left < e_{n}, x - \sum_{i=1}^{m} <x,e_{i}>e_{i} \right >=<e_n,x>-<x,e_n>=0,$$
since inner-products are symmetric. Hence the second term in the original expression is identically zero.
Hope that helps! Let me know if anything here is unclear.
