Let $p_* \in P_n[a,b]$ be the best $L_2$ approximation to $f \in C[a,b]$. Then $f - p_*$ is orthogonal to all $p \in P_n[a,b]$
I set:
$$p_* = \sum_0^n c_i\Phi_i \text{ and } c_i = \langle f,\Phi_i\rangle$$
$$p = \sum_0^n d_j\Phi_j$$
and $\Phi_i = \Phi_j$ if $i = j$
I have:
\begin{align}\langle f-p_*,p\rangle & = \langle f,p\rangle - \langle p_*,p\rangle \\[10pt] & = \left\langle f,\sum_0^n c_i\Phi_i\right\rangle - \left\langle\sum_0^n c_i\Phi_i,\sum_0^n d_j\Phi_j\right\rangle \\[10pt] & = \sum_0^n d_i \langle f,\Phi_i\rangle - \sum_0^n c_id_j \langle\Phi_i,\Phi_j\rangle \\[10pt] & = \sum_0^n c_id_j - \sum_0^n c_id_j = 0 \end{align} --> QED
Could someone please review my solution? $i$ and $j$ in the formula really confused me. Thank you in advance.
Here is a proof that doesn't depend on a particular representation:
Let $L$ be a subspace and suppose there is some $p_* \in L$ such that $\|f-p_* \| \le \|f-p\|$ for all $p \in L$.
Since $L$ is a subspace, we can write this is the equivalent $\|f-p_* \| \le \|f-(p_*+t p)\|$ for all $p \in L$, and for all $t$.
Expanding $\|f-p_* \|^2 \le \|f-(p_*+t p)\|^2$ in terms of inner product results in $\|f-p_*\|^2 \le \|f-p_*\|^2 -2t \langle f-p_*, p \rangle + t^2 \|p\|^2$ and if we remove common terms, and suppose $t >0$ we get $\langle f-p_*, p \rangle \le {t \over 2} \|p\|^2$ for all $t >0$ and hence $\langle f-p_*, p \rangle \le 0$ for all $p$. Since $-p \in L$ we see that this means that $\langle f-p_*, p \rangle = 0$ for all $p \in L$.
In the above, take $L = P_n[a,b]$.
If $L$ is closed (and the ambient space complete, which it is in this instance) we can show that a unique point of minimum distance exists (this depends on convexity and completeness properties).
The space $P_n[a,b]$ is finite dimensional, it can be shown that finite dimensional subspaces are closed.