This is a question about understanding a proof. Here is what my professor did.
However, I do not know how he reached the final conclusion where he states that
$$ \begin{align} \|f\|^2 - 2 \sum_{k=1}^n a_k c_k + \sum_{k=1}^n a_k^2 = \|f\|^2 - \sum_{k=1}^n c_k^2 + \sum_{k=1}^n (c_k - a_k)^2 \end{align} $$
