Let \(B=\{\boldw_1, \boldw_2, \dots, \boldw_r\}\text{.}\) We first show that the vectors
\begin{equation}
\boldw=\sum_{i=1}^r\frac{\angvec{\boldv,\boldw_i}}{\angvec{\boldw_i, \boldw_i}}\boldw_i\tag{5.12}
\end{equation}
and
\(\boldw^\perp=\boldv-\boldw\) satisfy the conditions in
(5.9). It is clear that the
\(\boldw\) defined in
(5.12) is an element of
\(W\text{,}\) since it is a linear combination of the
\(\boldw_i\text{.}\) Furthermore, we see easily that our choice
\(\boldw^\perp=\boldv-\boldw\) satisfies
\begin{equation*}
\boldw+\boldw^\perp=\boldw+(\boldv-\boldw)=\boldv\text{.}
\end{equation*}
It remains only to show that \(\boldw^\perp=\boldv-\boldw\in W^\perp\text{.}\) Since \(B\) is a basis of \(W\text{,}\) it suffices to show that \(\langle \boldw^\perp,\boldw_j\rangle=0\) for all \(1\leq i\leq r\text{.}\) We compute:
\begin{align*}
\langle \boldw^\perp, \boldw_j \rangle\amp = \langle \boldv-\proj{\boldv}{W}, \boldw_i \rangle\\
\amp =
\left\langle \boldv-\sum_{i=1}^r\frac{\angvec{\boldv,\boldw_i}}{\angvec{\boldw_i, \boldw_i}}\boldw_i, \boldw_j\right\rangle \\
\amp =
\langle \boldv, \boldw_j\rangle -\sum_{i=1}^r\frac{\angvec{\boldv,\boldw_i}}{\angvec{\boldw_i, \boldw_i}}\langle \boldw_i, \boldw_j\rangle \\
\amp =
\langle \boldv, \boldw_j\rangle -\frac{\langle \boldv, \boldw_j\rangle}{\cancel{\langle \boldw_j, \boldw_j\rangle}}\cancel{\langle \boldw_j, \boldw_j\rangle}\\
\amp = 0 \text{,}
\end{align*}
as desired.
Having shown that a decomposition of
\(\boldv\) of the form
(5.9) exists, we now show it is unique in the sense specified. Suppose we have
\begin{equation*}
\boldv=\boldw+\boldw^\perp=\boldu+\boldu^\perp\text{,}
\end{equation*}
where \(\boldw, \boldu\in W\) and \(\boldw^\perp, \boldu^\perp\in W^\perp\text{.}\) Rearranging, we see that
\begin{equation*}
\boldw-\boldu=\boldu^\perp-\boldw^\perp\text{.}
\end{equation*}
We now claim that
\(\boldw-\boldu=\boldu^\perp-\boldw^\perp=\boldzero\text{,}\) in which case
\(\boldw=\boldu\) and
\(\boldw^\perp=\boldu^\perp\text{,}\) as desired. To see why the claim is true, consider the vector
\(\boldv'=\boldw-\boldu=\boldu^\perp-\boldw^\perp\text{.}\) Since
\(\boldv'=\boldw-\boldu\text{,}\) and
\(\boldw, \boldu\in W\text{,}\) we have
\(\boldv'\in W\text{.}\) On the other hand, since
\(\boldv'=\boldu^\perp-\boldw^\perp\text{,}\) and
\(\boldu^\perp, \boldw^\perp\in W^\perp\text{,}\) we have
\(\boldv'\in W^\perp\text{.}\) Thus
\(\boldv'\in W\cap W^\perp\text{.}\) Since
\(W\cap W^\perp=\{\boldzero\}\) (
TheoremΒ 5.3.5), we conclude
\(\boldv'=\boldw-\boldu=\boldu^\perp-\boldw^\perp=\boldzero\text{,}\) as claimed.
At this point we have proved both (1) and (2), and it remains only to show that
(5.11) holds for all
\(\boldw'\in W\text{.}\) To this end we compute:
\begin{align*}
\norm{\boldv-\boldw'}^2\amp = \norm{\boldw^\perp+(\boldw-\boldw')}^2\\
\amp =\norm{\boldw^\perp}^2+\norm{\boldw-\boldw'}^2 \amp (\knowl{./knowl/xref/ex_ortho_pythag.html}{\text{Exercise 18}})\\
\amp \geq \norm{\boldw^\perp}^2\\
\amp =\norm{\boldv-\boldw}^2\text{.}
\end{align*}
This shows \(\norm{\boldv-\boldw'}^2\geq \norm{\boldv-\boldw}^2\text{.}\) Taking square-roots now proves the desired inequality.