\begin{equation*}
\vec y = \widehat y + w^\perp
\end{equation*}
where \(\widehat y \in W\) and \(w^\perp \in W^\perp\text{.}\) In fact, if \(\{\vec u_1,\dots,\vec u_p\}\) is any orthogonal basis for \(W\text{,}\) then
For any \(\vec y\in\mathbb{R}^5\text{,}\) write the orthogonal decomposition: \(\vec y=\widehat y + w^\perp\text{,}\) with \(\widehat y\in W\) and \(w^\perp\in W^\perp\text{.}\)
construct the decomposition \(\vec y = \widehat y + w^\perp\text{,}\) where \(\widehat y\) is the orthogonal projection of \(\vec y\) onto \(W=\operatorname{Span}\{\vec u_1,\vec u_2\}\text{.}\)
Let \(W\subseteq\mathbb{R}^n\) and \(\vec y\in\mathbb{R}^n\text{.}\) If \(\widehat y\) is the orthogonal projection of \(\vec y\) onto \(W\text{;}\) that is \(\widehat y = \proj_W\vec y\text{,}\) then for every \(\vec w\in W\) with \(\vec w\ne \widehat y\text{,}\)
Let \(W \subset \mathbb{R}^n\) and \(\vec y \in \mathbb{R}^n\text{.}\) The distance of a vector \(\vec y\) from a subspace \(W\), denoted \(\dist(\vec y, W)\text{,}\) is the minimum distance between \(\vec y\) and a vector \(\vec w \in W\text{;}\) that is,
\begin{equation*}
\dist(\vec y, W) = \operatorname{min}\left\{\dist(\vec y, \vec w) : w \in W\right\}\text{.}
\end{equation*}
By TheoremΒ 6.39, we see that the vector in \(W\) which is closest to \(\vec y\) is \(\widehat y = \proj_W\vec y\text{.}\) Therefore,
\begin{equation*}
\dist(\vec y, W) = \dist(\vec y, \widehat y)\text{.}
\end{equation*}
If \(\vec y = \vec u_1 + \vec v_1\text{,}\) where \(\vec u_1 \in W\) and \(\vec v_1 \in W^\perp\text{,}\) then \(\vec u_1\) is the orthogonal projection of \(\vec y\) onto \(W\text{.}\)