In my text book it says that if $c_n$ are fourier coefficients of $f$ and $f_n$ is an orthonormal set then
$\bigg( \sum_{n=1}^N c_n f_n, f - \sum_{n=1}^N c_n f_n\bigg) = 0$
This is not immediately obvious to me and I am wondering if someone has a proof of this?
We have:
$$\left( \sum_{n=1}^N c_n f_n, f - \sum_{n=1}^N c_n f_n\right) = \left(\sum_{n=1}^N c_nf_n, f\right) - \left(\sum_{n=1}^N c_n f_n , \sum_{m=1}^N c_m f_m\right) \\ = \sum_{n=1}^N c_n (f_n,f) - \sum_{n=1}^N\sum_{m=1}^Nc_n c_m \underbrace{(f_n,f_m)}_{= \delta_{nm}} \\ = \sum_{n=1}^N c_n^2 - \sum_{n=1}^Nc_n^2 = 0$$