Orthogonal Projection#
The point in a subspace \(U \subset \mathbb{R}^n\) nearest to \(\boldsymbol{x} \in \mathbb{R}^n\) is the projection \(\mathrm{proj}_U (\boldsymbol{x})\) of \(\boldsymbol{x}\) onto \(U\).

Projection onto a Vector#
The projection of a vector \(\boldsymbol{x}\) onto a vector \(\boldsymbol{u}\) is
Projection onto \(\boldsymbol{u}\) is given by matrix multiplication
Note that \(P^2 = P\), \(P^T = P\) and \(\mathrm{rank}(P) = 1\).
Orthogonal Bases#
Let \(U \subseteq \mathbb{R}^n\) be a subspace. A set of vectors \(\{ \boldsymbol{w}_1,\dots,\boldsymbol{w}_m \}\) is an orthogonal basis for \(U\) if it is a basis for \(U\) and the vectors are orthogonal, \(\langle \boldsymbol{w}_i , \boldsymbol{w}_j \rangle = 0\) for all \(i \not= j\). Furthermore, if each \(\boldsymbol{w}_j\) is a unit vector, \(\|\boldsymbol{w}_j\| = 1\), then \(\{ \boldsymbol{w}_1,\dots,\boldsymbol{w}_m \}\) is an orthonormal basis for \(U\).
Let \(\{ \boldsymbol{u}_1 , \dots , \boldsymbol{u}_m \}\) be a basis of a subspace \(U \subseteq \mathbb{R}^n\). The Gram-Schmidt orthogonalization algorithm constructs an orthogonal basis of \(U\):
Then \(\{ \boldsymbol{v}_1 , \dots , \boldsymbol{v}_m \}\) is an orthogonal basis of \(U\). Furthermore, let
Then \(\{ \boldsymbol{w}_1 , \dots , \boldsymbol{w}_m \}\) is an orthonormal basis of \(U\).
Construct an orthonormal basis of the subspace \(U\) spanned by
Solution
Compute
and we find an orthogonal basis
and an orthonormal basis
Projection onto a Subspace#
Let \(U \subseteq \mathbb{R}^n\) be a subspace and let \(\{ \boldsymbol{u}_1, \dots, \boldsymbol{u}_m \}\) be an orthogonal basis of \(U\). The projection of a vector \(\boldsymbol{x}\) onto \(U\) is
Projection onto \(U\) is given by matrix multiplication
Note that \(P^2 = P\), \(P^T = P\) and \(\mathrm{rank}(P) = m\).
A matrix \(P\) is an orthogonal projector (or orthogonal projection matrix) if \(P^2 = P\) and \(P^T = P\).
Let \(P\) be the orthogonal projection onto \(U\). Then \(I - P\) is the orthogonal projection matrix onto \(U^{\perp}\).
Find the orthogonal projection matrix \(P\) which projects onto the subspace spanned by the vectors
Solution
Compute \(\langle \boldsymbol{u}_1 , \boldsymbol{u}_2 \rangle = 0\) therefore the vectors are orthogonal. Compute
Find the orthogonal projection matrix \(P_{\perp}\) which projects onto \(U^{\perp}\) where \(U\) the subspace spanned by the vectors
Solution
As in the previous example. Compute
Note that
is orthogonal to both \(\boldsymbol{u}_1\) and \(\boldsymbol{u}_2\) and is a basis of the orthogonal complement \(U^{\perp}\). Therefore we could also compute
Projection Theorem#
Let \(U \subseteq \mathbb{R}^n\) be a subspace and let \(\boldsymbol{x} \in \mathbb{R}^n\). Then
and \(\mathrm{proj}_U(\boldsymbol{x})\) is the closest vector in \(U\) to \(\boldsymbol{x}\) in the sense that
Proof. The proof will be given by the QR decomposition later.
Exercises#
Let \(\boldsymbol{u}\) and \(\boldsymbol{v}\) be nonzero column vectors in \(\mathbb{R}^n\) such that \(\langle \boldsymbol{u} , \boldsymbol{v} \rangle = 0\) and let
Determine whether the statement is True or False.
\(\mathrm{rank}(P) = 1\)
\(P^2\) is the identity matrix
\(P^2\) is the zero matrix
\(P \boldsymbol{x}\) is the projection \(\boldsymbol{x}\) onto \(\boldsymbol{u}\)
\(P \boldsymbol{x}\) is the projection \(\boldsymbol{x}\) onto \(\boldsymbol{v}\)
\(P \boldsymbol{u} = c \boldsymbol{v}\) for some nonzero number \(c\)
Solution
True
False
True
False
False
True
Let \(U \subset \mathbb{R}^n\) be a subspace. Let \(P_1\) be the orthogonal projector onto \(U\) and let \(P_2\) be the orthogonal projector onto the orthogonal complement \(U^{\perp}\). Determine whether the statement is True or False.
\(I = P_1 + P_2\)
\(P_1P_2 = P_2P_1 = 0\)
Solution
True
True
Let \(U \subset \mathbb{R}^3\) be the subspace spanned by
Find the vector in \(U\) which is closest to the vector
Solution
Let \(U \subset \mathbb{R}^3\) be the subspace spanned by
Find the shortest distance from \(\boldsymbol{x}\) to \(U\) where
Solution
Let \(\boldsymbol{u} \in \mathbb{R}^n\) be a nonzero vector and let
The matrix \(H\) is called an elementary reflector. Determine whether the statement is True or False.
There is a unique unit vector \(\boldsymbol{v}\) such that \(H \boldsymbol{v} = \boldsymbol{v}\).
\(H \boldsymbol{v} = \boldsymbol{v}\) for all \(\boldsymbol{v} \in \mathrm{span} \{ \boldsymbol{u} \}^{\perp}\).
Solution
False
True