# Linear Algebra/Projection Onto a Subspace/Solutions

## Solutions

This exercise is recommended for all readers.
Problem 1

Project the vectors onto ${\displaystyle M}$ along ${\displaystyle N}$.

1. ${\displaystyle {\begin{pmatrix}3\\-2\end{pmatrix}},\quad M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x+y=0\},\quad N=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,-x-2y=0\}}$
2. ${\displaystyle {\begin{pmatrix}1\\2\end{pmatrix}},\quad M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x-y=0\},\quad N=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,2x+y=0\}}$
3. ${\displaystyle {\begin{pmatrix}3\\0\\1\end{pmatrix}},\quad M=\{{\begin{pmatrix}x\\y\\z\end{pmatrix}}\,{\big |}\,x+y=0\},\quad N=\{c\cdot {\begin{pmatrix}1\\0\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}}$
1. When bases for the subspaces
${\displaystyle B_{M}=\langle {\begin{pmatrix}1\\-1\end{pmatrix}}\rangle \qquad B_{N}=\langle {\begin{pmatrix}2\\-1\end{pmatrix}}\rangle }$
are concatenated
${\displaystyle B=B_{M}\!{\mathbin {{}^{\frown }}}\!B_{N}=\langle {\begin{pmatrix}1\\-1\end{pmatrix}},{\begin{pmatrix}2\\-1\end{pmatrix}}\rangle }$
and the given vector is represented
${\displaystyle {\begin{pmatrix}3\\-2\end{pmatrix}}=1\cdot {\begin{pmatrix}1\\-1\end{pmatrix}}+1\cdot {\begin{pmatrix}2\\-1\end{pmatrix}}}$
then the answer comes from retaining the ${\displaystyle M}$ part and dropping the ${\displaystyle N}$ part.
${\displaystyle {\mbox{proj}}_{M,N}({\begin{pmatrix}3\\-2\end{pmatrix}})={\begin{pmatrix}1\\-1\end{pmatrix}}}$
2. When the bases
${\displaystyle B_{M}=\langle {\begin{pmatrix}1\\1\end{pmatrix}}\rangle \qquad B_{N}\langle {\begin{pmatrix}1\\-2\end{pmatrix}}\rangle }$
are concatenated, and the vector is represented,
${\displaystyle {\begin{pmatrix}1\\2\end{pmatrix}}=(4/3)\cdot {\begin{pmatrix}1\\1\end{pmatrix}}-(1/3)\cdot {\begin{pmatrix}1\\-2\end{pmatrix}}}$
then retaining only the ${\displaystyle M}$ part gives this answer.
${\displaystyle {\mbox{proj}}_{M,N}({\begin{pmatrix}1\\2\end{pmatrix}})={\begin{pmatrix}4/3\\4/3\end{pmatrix}}}$
3. With these bases
${\displaystyle B_{M}=\langle {\begin{pmatrix}1\\-1\\0\end{pmatrix}},{\begin{pmatrix}0\\0\\1\end{pmatrix}}\rangle \qquad B_{N}=\langle {\begin{pmatrix}1\\0\\1\end{pmatrix}}\rangle }$
the representation with respect to the concatenation is this.
${\displaystyle {\begin{pmatrix}3\\0\\1\end{pmatrix}}=0\cdot {\begin{pmatrix}1\\-1\\0\end{pmatrix}}-2\cdot {\begin{pmatrix}0\\0\\1\end{pmatrix}}+3\cdot {\begin{pmatrix}1\\0\\1\end{pmatrix}}}$
and so the projection is this.
${\displaystyle {\mbox{proj}}_{M,N}({\begin{pmatrix}3\\0\\1\end{pmatrix}})={\begin{pmatrix}0\\0\\-2\end{pmatrix}}}$
This exercise is recommended for all readers.
Problem 2

Find ${\displaystyle M^{\perp }}$.

1. ${\displaystyle M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x+y=0\}}$
2. ${\displaystyle M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,-2x+3y=0\}}$
3. ${\displaystyle M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x-y=0\}}$
4. ${\displaystyle M=\{{\vec {0}}\,\}}$
5. ${\displaystyle M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x=0\}}$
6. ${\displaystyle M=\{{\begin{pmatrix}x\\y\\z\end{pmatrix}}\,{\big |}\,-x+3y+z=0\}}$
7. ${\displaystyle M=\{{\begin{pmatrix}x\\y\\z\end{pmatrix}}\,{\big |}\,x=0{\text{ and }}y+z=0\}}$

As in Example 3.5, we can simplify the calculation by just finding the space of vectors perpendicular to all the vectors in ${\displaystyle M}$'s basis.

1. Parametrizing to get
${\displaystyle M=\{c\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}}$
gives that
${\displaystyle M^{\perp }\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,0={\begin{pmatrix}u\\v\end{pmatrix}}\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}\}=\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,0=-u+v\}}$
Parametrizing the one-equation linear system gives this description.
${\displaystyle M^{\perp }=\{k\cdot {\begin{pmatrix}1\\1\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}}$
2. As in the answer to the prior part, ${\displaystyle M}$ can be described as a span
${\displaystyle M=\{c\cdot {\begin{pmatrix}3/2\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}\qquad B_{M}=\langle {\begin{pmatrix}3/2\\1\end{pmatrix}}\rangle }$
and then ${\displaystyle M^{\perp }}$ is the set of vectors perpendicular to the one vector in this basis.
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,(3/2)\cdot u+1\cdot v=0\}=\{k\cdot {\begin{pmatrix}-2/3\\1\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}}$
3. Parametrizing the linear requirement in the description of ${\displaystyle M}$ gives this basis.
${\displaystyle M=\{c\cdot {\begin{pmatrix}1\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}\qquad B_{M}=\langle {\begin{pmatrix}1\\1\end{pmatrix}}\rangle }$
Now, ${\displaystyle M^{\perp }}$ is the set of vectors perpendicular to (the one vector in) ${\displaystyle B_{M}}$.
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,u+v=0\}=\{k\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}}$
(By the way, this answer checks with the first item in this question.)
4. Every vector in the space is perpendicular to the zero vector so ${\displaystyle M^{\perp }=\mathbb {R} ^{n}}$.
5. The appropriate description and basis for ${\displaystyle M}$ are routine.
${\displaystyle M=\{y\cdot {\begin{pmatrix}0\\1\end{pmatrix}}\,{\big |}\,y\in \mathbb {R} \}\qquad B_{M}=\langle {\begin{pmatrix}0\\1\end{pmatrix}}\rangle }$
Then
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,0\cdot u+1\cdot v=0\}=\{k\cdot {\begin{pmatrix}1\\0\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}}$
and so ${\displaystyle (y{\text{-axis}})^{\perp }=x{\text{-axis}}}$.
6. The description of ${\displaystyle M}$ is easy to find by parametrizing.
${\displaystyle M=\{c\cdot {\begin{pmatrix}3\\1\\0\end{pmatrix}}+d\cdot {\begin{pmatrix}1\\0\\1\end{pmatrix}}\,{\big |}\,c,d\in \mathbb {R} \}\qquad B_{M}=\langle {\begin{pmatrix}3\\1\\0\end{pmatrix}},{\begin{pmatrix}1\\0\\1\end{pmatrix}}\rangle }$
Finding ${\displaystyle M^{\perp }}$ here just requires solving a linear system with two equations
${\displaystyle {\begin{array}{*{3}{rc}r}3u&+&v&&&=&0\\u&&&+&w&=&0\end{array}}\;{\xrightarrow[{}]{-(1/3)\rho _{1}+\rho _{2}}}\;{\begin{array}{*{3}{rc}r}3u&+&v&&&=&0\\&&-(1/3)v&+&w&=&0\end{array}}}$
and parametrizing.
${\displaystyle M^{\perp }=\{k\cdot {\begin{pmatrix}-1\\3\\1\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}}$
7. Here, ${\displaystyle M}$ is one-dimensional
${\displaystyle M=\{c\cdot {\begin{pmatrix}0\\-1\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}\qquad B_{M}=\langle {\begin{pmatrix}0\\-1\\1\end{pmatrix}}\rangle }$
and as a result, ${\displaystyle M^{\perp }}$ is two-dimensional.
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\\w\end{pmatrix}}\,{\big |}\,0\cdot u-1\cdot v+1\cdot w=0\}=\{j\cdot {\begin{pmatrix}1\\0\\0\end{pmatrix}}+k\cdot {\begin{pmatrix}0\\1\\1\end{pmatrix}}\,{\big |}\,j,k\in \mathbb {R} \}}$
Problem 3

This subsection shows how to project orthogonally in two ways, the method of Example 3.2 and 3.3, and the method of Theorem 3.8. To compare them, consider the plane ${\displaystyle P}$ specified by ${\displaystyle 3x+2y-z=0}$ in ${\displaystyle \mathbb {R} ^{3}}$.

1. Find a basis for ${\displaystyle P}$.
2. Find ${\displaystyle P^{\perp }}$ and a basis for ${\displaystyle P^{\perp }}$.
3. Represent this vector with respect to the concatenation of the two bases from the prior item.
${\displaystyle {\vec {v}}={\begin{pmatrix}1\\1\\2\end{pmatrix}}}$
4. Find the orthogonal projection of ${\displaystyle {\vec {v}}}$ onto ${\displaystyle P}$ by keeping only the ${\displaystyle P}$ part from the prior item.
5. Check that against the result from applying Theorem 3.8.
1. Parametrizing the equation leads to this basis for ${\displaystyle P}$.
${\displaystyle B_{P}=\langle {\begin{pmatrix}1\\0\\3\end{pmatrix}},{\begin{pmatrix}0\\1\\2\end{pmatrix}}\rangle }$
2. Because ${\displaystyle \mathbb {R} ^{3}}$ is three-dimensional and ${\displaystyle P}$ is two-dimensional, the complement ${\displaystyle P^{\perp }}$ must be a line. Anyway, the calculation as in Example 3.5
${\displaystyle P^{\perp }=\{{\begin{pmatrix}x\\y\\z\end{pmatrix}}\,{\big |}\,{\begin{pmatrix}1&0&3\\0&1&2\end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}={\begin{pmatrix}0\\0\end{pmatrix}}\;\}}$
gives this basis for ${\displaystyle P^{\perp }}$.
${\displaystyle B_{P^{\perp }}=\langle {\begin{pmatrix}3\\2\\-1\end{pmatrix}}\rangle }$
3. ${\displaystyle \displaystyle {\begin{pmatrix}1\\1\\2\end{pmatrix}}=(5/14)\cdot {\begin{pmatrix}1\\0\\3\end{pmatrix}}+(8/14)\cdot {\begin{pmatrix}0\\1\\2\end{pmatrix}}+(3/14)\cdot {\begin{pmatrix}3\\2\\-1\end{pmatrix}}}$
4. ${\displaystyle {\mbox{proj}}_{P}({\begin{pmatrix}1\\1\\2\end{pmatrix}})={\begin{pmatrix}5/14\\8/14\\31/14\end{pmatrix}}}$
5. The matrix of the projection
${\displaystyle {\begin{array}{rl}{\begin{pmatrix}1&0\\0&1\\3&2\end{pmatrix}}{\bigl (}{\begin{pmatrix}1&0&3\\0&1&2\end{pmatrix}}{\begin{pmatrix}1&0\\0&1\\3&2\end{pmatrix}}{\bigr )}^{-1}{\begin{pmatrix}1&0&3\\0&1&2\end{pmatrix}}&={\begin{pmatrix}1&0\\0&1\\3&2\end{pmatrix}}{\begin{pmatrix}10&6\\6&5\end{pmatrix}}^{-1}{\begin{pmatrix}1&0&3\\0&1&2\end{pmatrix}}\\&={\frac {1}{14}}{\begin{pmatrix}5&-6&3\\-6&10&2\\3&2&13\end{pmatrix}}\end{array}}}$
when applied to the vector, yields the expected result.
${\displaystyle {\frac {1}{14}}{\begin{pmatrix}5&-6&3\\-6&10&2\\3&2&13\end{pmatrix}}{\begin{pmatrix}1\\1\\2\end{pmatrix}}={\begin{pmatrix}5/14\\8/14\\31/14\end{pmatrix}}}$
This exercise is recommended for all readers.
Problem 4

We have three ways to find the orthogonal projection of a vector onto a line, the Definition 1.1 way from the first subsection of this section, the Example 3.2 and 3.3 way of representing the vector with respect to a basis for the space and then keeping the ${\displaystyle M}$ part, and the way of Theorem 3.8. For these cases, do all three ways.

1. ${\displaystyle {\vec {v}}={\begin{pmatrix}1\\-3\end{pmatrix}},\quad M=\{{\begin{pmatrix}x\\y\end{pmatrix}}\,{\big |}\,x+y=0\}}$
2. ${\displaystyle {\vec {v}}={\begin{pmatrix}0\\1\\2\end{pmatrix}},\quad M=\{{\begin{pmatrix}x\\y\\z\end{pmatrix}}\,{\big |}\,x+z=0{\text{ and }}y=0\}}$
1. Parametrizing gives this.
${\displaystyle M=\{c\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}}$
For the first way, we take the vector spanning the line ${\displaystyle M}$ to be
${\displaystyle {\vec {s}}={\begin{pmatrix}-1\\1\end{pmatrix}}}$
and the Definition 1.1 formula gives this.
${\displaystyle {\mbox{proj}}_{[{\vec {s}}\,]}({\begin{pmatrix}1\\-3\end{pmatrix}})={\frac {{\begin{pmatrix}1\\-3\end{pmatrix}}\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}}{{\begin{pmatrix}-1\\1\end{pmatrix}}\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}}}\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}={\frac {-4}{2}}\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}={\begin{pmatrix}2\\-2\end{pmatrix}}}$
For the second way, we fix
${\displaystyle B_{M}=\langle {\begin{pmatrix}-1\\1\end{pmatrix}}\rangle }$
and so (as in Example 3.5 and 3.6, we can just find the vectors perpendicular to all of the members of the basis)
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\end{pmatrix}}\,{\big |}\,-1\cdot u+1\cdot v=0\}=\{k\cdot {\begin{pmatrix}1\\1\end{pmatrix}}\,{\big |}\,k\in \mathbb {R} \}\qquad B_{M^{\perp }}=\langle {\begin{pmatrix}1\\1\end{pmatrix}}\rangle }$
and representing the vector with respect to the concatenation gives this.
${\displaystyle {\begin{pmatrix}1\\-3\end{pmatrix}}=-2\cdot {\begin{pmatrix}-1\\1\end{pmatrix}}-1\cdot {\begin{pmatrix}1\\1\end{pmatrix}}}$
Keeping the ${\displaystyle M}$ part yields the answer.
${\displaystyle {\mbox{proj}}_{M,M^{\perp }}({\begin{pmatrix}1\\-3\end{pmatrix}})={\begin{pmatrix}2\\-2\end{pmatrix}}}$
The third part is also a simple calculation (there is a ${\displaystyle 1\!\times \!1}$ matrix in the middle, and the inverse of it is also ${\displaystyle 1\!\times \!1}$)
${\displaystyle A\left({{A}^{\rm {trans}}}A\right)^{-1}{{A}^{\rm {trans}}}={\begin{pmatrix}-1\\1\end{pmatrix}}\left({\begin{pmatrix}-1&1\end{pmatrix}}{\begin{pmatrix}-1\\1\end{pmatrix}}\right)^{-1}{\begin{pmatrix}-1&1\end{pmatrix}}={\begin{pmatrix}-1\\1\end{pmatrix}}{\begin{pmatrix}2\end{pmatrix}}^{-1}{\begin{pmatrix}-1&1\end{pmatrix}}}$
${\displaystyle ={\begin{pmatrix}-1\\1\end{pmatrix}}{\begin{pmatrix}1/2\end{pmatrix}}{\begin{pmatrix}-1&1\end{pmatrix}}={\begin{pmatrix}-1\\1\end{pmatrix}}{\begin{pmatrix}-1/2&1/2\end{pmatrix}}={\begin{pmatrix}1/2&-1/2\\-1/2&1/2\end{pmatrix}}}$
which of course gives the same answer.
${\displaystyle {\mbox{proj}}_{M}({\begin{pmatrix}1\\-3\end{pmatrix}})={\begin{pmatrix}1/2&-1/2\\-1/2&1/2\end{pmatrix}}{\begin{pmatrix}1\\-3\end{pmatrix}}={\begin{pmatrix}2\\-2\end{pmatrix}}}$
2. Parametrization gives this.
${\displaystyle M=\{c\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}\,{\big |}\,c\in \mathbb {R} \}}$
With that, the formula for the first way gives this.
${\displaystyle {\frac {{\begin{pmatrix}0\\1\\2\end{pmatrix}}\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}}{{\begin{pmatrix}-1\\0\\1\end{pmatrix}}\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}}}\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}={\frac {2}{2}}\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}}$
To proceed by the second method we find ${\displaystyle M^{\perp }}$,
${\displaystyle M^{\perp }=\{{\begin{pmatrix}u\\v\\w\end{pmatrix}}\,{\big |}\,-u+w=0\}=\{j\cdot {\begin{pmatrix}1\\0\\1\end{pmatrix}}+k\cdot {\begin{pmatrix}0\\1\\0\end{pmatrix}}\,{\big |}\,j,k\in \mathbb {R} \}}$
find the representation of the given vector with respect to the concatenation of the bases ${\displaystyle B_{M}}$ and ${\displaystyle B_{M^{\perp }}}$
${\displaystyle {\begin{pmatrix}0\\1\\2\end{pmatrix}}=1\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}+1\cdot {\begin{pmatrix}1\\0\\1\end{pmatrix}}+1\cdot {\begin{pmatrix}0\\1\\0\end{pmatrix}}}$
and retain only the ${\displaystyle M}$ part.
${\displaystyle {\mbox{proj}}_{M}({\begin{pmatrix}0\\1\\2\end{pmatrix}})=1\cdot {\begin{pmatrix}-1\\0\\1\end{pmatrix}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}}$
Finally, for the third method, the matrix calculation
${\displaystyle A\left({{A}^{\rm {trans}}}A\right)^{-1}{{A}^{\rm {trans}}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}{\bigl (}{\begin{pmatrix}-1&0&1\end{pmatrix}}{\begin{pmatrix}-1\\0\\1\end{pmatrix}}{\bigr )}^{-1}{\begin{pmatrix}-1&0&1\end{pmatrix}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}{\begin{pmatrix}2\end{pmatrix}}^{-1}{\begin{pmatrix}-1&0&1\end{pmatrix}}}$
${\displaystyle ={\begin{pmatrix}-1\\0\\1\end{pmatrix}}{\begin{pmatrix}1/2\end{pmatrix}}{\begin{pmatrix}-1&0&1\end{pmatrix}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}{\begin{pmatrix}-1/2&0&1/2\end{pmatrix}}={\begin{pmatrix}1/2&0&-1/2\\0&0&0\\-1/2&0&1/2\end{pmatrix}}}$
followed by matrix-vector multiplication
${\displaystyle {\mbox{proj}}_{M}({\begin{pmatrix}0\\1\\2\end{pmatrix}}){\begin{pmatrix}1/2&0&-1/2\\0&0&0\\-1/2&0&1/2\end{pmatrix}}{\begin{pmatrix}0\\1\\2\end{pmatrix}}={\begin{pmatrix}-1\\0\\1\end{pmatrix}}}$
Problem 5

Check that the operation of Definition 3.1 is well-defined. That is, in Example 3.2 and 3.3, doesn't the answer depend on the choice of bases?

No, a decomposition of vectors ${\displaystyle {\vec {v}}={\vec {m}}+{\vec {n}}}$ into ${\displaystyle {\vec {m}}\in M}$ and ${\displaystyle {\vec {n}}\in N}$ does not depend on the bases chosen for the subspaces— this was shown in the Direct Sum subsection.

Problem 6

What is the orthogonal projection onto the trivial subspace?

The orthogonal projection of a vector onto a subspace is a member of that subspace. Since a trivial subspace has only one member, ${\displaystyle {\vec {0}}}$, the projection of any vector must equal ${\displaystyle {\vec {0}}}$.

Problem 7

What is the projection of ${\displaystyle {\vec {v}}}$ onto ${\displaystyle M}$ along ${\displaystyle N}$ if ${\displaystyle {\vec {v}}\in M}$?

The projection onto ${\displaystyle M}$ along ${\displaystyle N}$ of a ${\displaystyle {\vec {v}}\in M}$ is ${\displaystyle {\vec {v}}}$. Decomposing ${\displaystyle {\vec {v}}={\vec {m}}+{\vec {n}}}$ gives ${\displaystyle {\vec {m}}={\vec {v}}}$ and ${\displaystyle {\vec {n}}={\vec {0}}}$, and dropping the ${\displaystyle N}$ part but retaining the ${\displaystyle M}$ part results in a projection of ${\displaystyle {\vec {m}}={\vec {v}}}$.

Problem 8

Show that if ${\displaystyle M\subseteq \mathbb {R} ^{n}}$ is a subspace with orthonormal basis ${\displaystyle \langle {\vec {\kappa }}_{1},\ldots ,{\vec {\kappa }}_{n}\rangle }$ then the orthogonal projection of ${\displaystyle {\vec {v}}}$ onto ${\displaystyle M}$ is this.

${\displaystyle ({\vec {v}}\cdot {\vec {\kappa }}_{1})\cdot {\vec {\kappa }}_{1}+\dots +({\vec {v}}\cdot {\vec {\kappa }}_{n})\cdot {\vec {\kappa }}_{n}}$

The proof of Lemma 3.7 shows that each vector ${\displaystyle {\vec {v}}\in \mathbb {R} ^{n}}$ is the sum of its orthogonal projections onto the lines spanned by the basis vectors.

${\displaystyle {\vec {v}}={\mbox{proj}}_{[{\vec {\kappa }}_{1}]}({{\vec {v}}\,})+\dots +{\mbox{proj}}_{[{\vec {\kappa }}_{n}]}({{\vec {v}}\,})={\frac {{\vec {v}}\cdot {\vec {\kappa }}_{1}}{{\vec {\kappa }}_{1}\cdot {\vec {\kappa }}_{1}}}\cdot {\vec {\kappa }}_{1}+\dots +{\frac {{\vec {v}}\cdot {\vec {\kappa }}_{n}}{{\vec {\kappa }}_{n}\cdot {\vec {\kappa }}_{n}}}\cdot {\vec {\kappa }}_{n}}$

Since the basis is orthonormal, the bottom of each fraction has ${\displaystyle {\vec {\kappa }}_{i}\cdot {\vec {\kappa }}_{i}=1}$.

This exercise is recommended for all readers.
Problem 9

Prove that the map ${\displaystyle p:V\to V}$ is the projection onto ${\displaystyle M}$ along ${\displaystyle N}$ if and only if the map ${\displaystyle {\mbox{id}}-p}$ is the projection onto ${\displaystyle N}$ along ${\displaystyle M}$. (Recall the definition of the difference of two maps: ${\displaystyle ({\mbox{id}}-p)\,({\vec {v}})={\mbox{id}}({\vec {v}})-p({\vec {v}})={\vec {v}}-p({\vec {v}})}$.)

If ${\displaystyle V=M\oplus N}$ then every vector can be decomposed uniquely as ${\displaystyle {\vec {v}}={\vec {m}}+{\vec {n}}}$. For all ${\displaystyle {\vec {v}}}$ the map ${\displaystyle p}$ gives ${\displaystyle p({\vec {v}})={\vec {m}}}$ if and only if ${\displaystyle {\vec {v}}-p({\vec {v}})={\vec {n}}}$, as required.

This exercise is recommended for all readers.
Problem 10

Show that if a vector is perpendicular to every vector in a set then it is perpendicular to every vector in the span of that set.

Let ${\displaystyle {\vec {v}}}$ be perpendicular to every ${\displaystyle {\vec {w}}\in S}$. Then ${\displaystyle {\vec {v}}\cdot (c_{1}{\vec {w}}_{1}+\dots +c_{n}{\vec {w}}_{n})={\vec {v}}\cdot (c_{1}{\vec {w}}_{1})+\dots +{\vec {v}}\cdot (c_{n}\cdot {\vec {w}}_{n})=c_{1}({\vec {v}}\cdot {\vec {w}}_{1})+\dots +c_{n}({\vec {v}}\cdot {\vec {w}}_{n})=c_{1}\cdot 0+\dots +c_{n}\cdot 0=0}$.

Problem 11

True or false: the intersection of a subspace and its orthogonal complement is trivial.

True; the only vector orthogonal to itself is the zero vector.

Problem 12

Show that the dimensions of orthogonal complements add to the dimension of the entire space.

This is immediate from the statement in Lemma 3.7 that the space is the direct sum of the two.

This exercise is recommended for all readers.
Problem 13

Suppose that ${\displaystyle {\vec {v}}_{1},{\vec {v}}_{2}\in \mathbb {R} ^{n}}$ are such that for all complements ${\displaystyle M,N\subseteq \mathbb {R} ^{n}}$, the projections of ${\displaystyle {\vec {v}}_{1}}$ and ${\displaystyle {\vec {v}}_{2}}$ onto ${\displaystyle M}$ along ${\displaystyle N}$ are equal. Must ${\displaystyle {\vec {v}}_{1}}$ equal ${\displaystyle {\vec {v}}_{2}}$? (If so, what if we relax the condition to: all orthogonal projections of the two are equal?)

The two must be equal, even only under the seemingly weaker condition that they yield the same result on all orthogonal projections. Consider the subspace ${\displaystyle M}$ spanned by the set ${\displaystyle \{{\vec {v}}_{1},{\vec {v}}_{2}\}}$. Since each is in ${\displaystyle M}$, the orthogonal projection of ${\displaystyle {\vec {v}}_{1}}$ onto ${\displaystyle M}$ is ${\displaystyle {\vec {v}}_{1}}$ and the orthogonal projection of ${\displaystyle {\vec {v}}_{2}}$ onto ${\displaystyle M}$ is ${\displaystyle {\vec {v}}_{2}}$. For their projections onto ${\displaystyle M}$ to be equal, they must be equal.

This exercise is recommended for all readers.
Problem 14

Let ${\displaystyle M,N}$ be subspaces of ${\displaystyle \mathbb {R} ^{n}}$. The perp operator acts on subspaces; we can ask how it interacts with other such operations.

1. Show that two perps cancel: ${\displaystyle (M^{\perp })^{\perp }=M}$.
2. Prove that ${\displaystyle M\subseteq N}$ implies that ${\displaystyle N^{\perp }\subseteq M^{\perp }}$.
3. Show that ${\displaystyle (M+N)^{\perp }=M^{\perp }\cap N^{\perp }}$.
1. We will show that the sets are mutually inclusive, ${\displaystyle M\subseteq (M^{\perp })^{\perp }}$ and ${\displaystyle (M^{\perp })^{\perp }\subseteq M}$. For the first, if ${\displaystyle {\vec {m}}\in M}$ then by the definition of the perp operation, ${\displaystyle {\vec {m}}}$ is perpendicular to every ${\displaystyle {\vec {v}}\in M^{\perp }}$, and therefore (again by the definition of the perp operation) ${\displaystyle {\vec {m}}\in (M^{\perp })^{\perp }}$. For the other direction, consider ${\displaystyle {\vec {v}}\in (M^{\perp })^{\perp }}$. Lemma 3.7's proof shows that ${\displaystyle \mathbb {R} ^{n}=M\oplus M^{\perp }}$ and that we can give an orthogonal basis for the space ${\displaystyle \langle {\vec {\kappa }}_{1},\dots ,{\vec {\kappa }}_{k},{\vec {\kappa }}_{k+1},\dots ,{\vec {\kappa }}_{n}\rangle }$ such that the first half ${\displaystyle \langle {\vec {\kappa }}_{1},\dots ,{\vec {\kappa }}_{k}\rangle }$ is a basis for ${\displaystyle M}$ and the second half is a basis for ${\displaystyle M^{\perp }}$. The proof also checks that each vector in the space is the sum of its orthogonal projections onto the lines spanned by these basis vectors.
${\displaystyle {\vec {v}}={\mbox{proj}}_{[{\vec {\kappa }}_{1}]}({{\vec {v}}\,})+\dots +{\mbox{proj}}_{[{\vec {\kappa }}_{n}]}({{\vec {v}}\,})}$
Because ${\displaystyle {\vec {v}}\in (M^{\perp })^{\perp }}$, it is perpendicular to every vector in ${\displaystyle M^{\perp }}$, and so the projections in the second half are all zero. Thus ${\displaystyle {\vec {v}}={\mbox{proj}}_{[{\vec {\kappa }}_{1}]}({{\vec {v}}\,})+\dots +{\mbox{proj}}_{[{\vec {\kappa }}_{k}]}({{\vec {v}}\,})}$, which is a linear combination of vectors from ${\displaystyle M}$, and so ${\displaystyle {\vec {v}}\in M}$. (Remark. Here is a slicker way to do the second half: write the space both as ${\displaystyle M\oplus M^{\perp }}$ and as ${\displaystyle M^{\perp }\oplus (M^{\perp })^{\perp }}$. Because the first half showed that ${\displaystyle M\subseteq (M^{\perp })^{\perp }}$ and the prior sentence shows that the dimension of the two subspaces ${\displaystyle M}$ and ${\displaystyle (M^{\perp })^{\perp }}$ are equal, we can conclude that ${\displaystyle M}$ equals ${\displaystyle (M^{\perp })^{\perp }}$.)
2. Because ${\displaystyle M\subseteq N}$, any ${\displaystyle {\vec {v}}}$ that is perpendicular to every vector in ${\displaystyle N}$ is also perpendicular to every vector in ${\displaystyle M}$. But that sentence simply says that ${\displaystyle N^{\perp }\subseteq M^{\perp }}$.
3. We will again show that the sets are equal by mutual inclusion. The first direction is easy; any ${\displaystyle {\vec {v}}}$ perpendicular to every vector in ${\displaystyle M+N=\{{\vec {m}}+{\vec {n}}\,{\big |}\,{\vec {m}}\in M,\,{\vec {n}}\in N\}}$ is perpendicular to every vector of the form ${\displaystyle {\vec {m}}+{\vec {0}}}$ (that is, every vector in ${\displaystyle M}$) and every vector of the form ${\displaystyle {\vec {0}}+{\vec {n}}}$ (every vector in ${\displaystyle N}$), and so ${\displaystyle (M+N)^{\perp }\subseteq M^{\perp }\cap N^{\perp }}$. The second direction is also routine; any vector ${\displaystyle {\vec {v}}\in M^{\perp }\cap N^{\perp }}$ is perpendicular to any vector of the form ${\displaystyle c{\vec {m}}+d{\vec {n}}}$ because ${\displaystyle {\vec {v}}\cdot (c{\vec {m}}+d{\vec {n}})=c\cdot ({\vec {v}}\cdot {\vec {m}})+d\cdot ({\vec {v}}\cdot {\vec {n}})=c\cdot 0+d\cdot 0=0}$.
This exercise is recommended for all readers.
Problem 15

The material in this subsection allows us to express a geometric relationship that we have not yet seen between the rangespace and the nullspace of a linear map.

1. Represent ${\displaystyle f:\mathbb {R} ^{3}\to \mathbb {R} }$ given by
${\displaystyle {\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}\mapsto 1v_{1}+2v_{2}+3v_{3}}$
with respect to the standard bases and show that
${\displaystyle {\begin{pmatrix}1\\2\\3\end{pmatrix}}}$
is a member of the perp of the nullspace. Prove that ${\displaystyle {\mathcal {N}}(f)^{\perp }}$ is equal to the span of this vector.
2. Generalize that to apply to any ${\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} }$.
3. Represent ${\displaystyle f:\mathbb {R} ^{3}\to \mathbb {R} ^{2}}$
${\displaystyle {\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}\mapsto {\begin{pmatrix}1v_{1}+2v_{2}+3v_{3}\\4v_{1}+5v_{2}+6v_{3}\end{pmatrix}}}$
with respect to the standard bases and show that
${\displaystyle {\begin{pmatrix}1\\2\\3\end{pmatrix}},\;{\begin{pmatrix}4\\5\\6\end{pmatrix}}}$
are both members of the perp of the nullspace. Prove that ${\displaystyle {\mathcal {N}}(f)^{\perp }}$ is the span of these two. (Hint. See the third item of Problem 14.)
4. Generalize that to apply to any ${\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$.

This, and related results, is called the Fundamental Theorem of Linear Algebra in (Strang 1993).

1. The representation of
${\displaystyle {\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}{\stackrel {f}{\longmapsto }}1v_{1}+2v_{2}+3v_{3}}$
is this.
${\displaystyle {\rm {Rep}}_{{\mathcal {E}}_{3},{\mathcal {E}}_{1}}(f)={\begin{pmatrix}1&2&3\end{pmatrix}}}$
By the definition of ${\displaystyle f}$
${\displaystyle {\mathcal {N}}(f)=\{{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}\,{\big |}\,1v_{1}+2v_{2}+3v_{3}=0\}=\{{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}\,{\big |}\,{\begin{pmatrix}1\\2\\3\end{pmatrix}}\cdot {\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}=0\}}$
and this second description exactly says this.
${\displaystyle {\mathcal {N}}(f)^{\perp }=[\{{\begin{pmatrix}1\\2\\3\end{pmatrix}}\}]}$
2. The generalization is that for any ${\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} }$ there is a vector ${\displaystyle {\vec {h}}}$ so that
${\displaystyle {\begin{pmatrix}v_{1}\\\vdots \\v_{n}\end{pmatrix}}{\stackrel {f}{\longmapsto }}h_{1}v_{1}+\dots +h_{n}v_{n}}$
and ${\displaystyle {\vec {h}}\in {\mathcal {N}}(f)^{\perp }}$. We can prove this by, as in the prior item, representing ${\displaystyle f}$ with respect to the standard bases and taking ${\displaystyle {\vec {h}}}$ to be the column vector gotten by transposing the one row of that matrix representation.
3. Of course,
${\displaystyle {\rm {Rep}}_{{\mathcal {E}}_{3},{\mathcal {E}}_{2}}(f)={\begin{pmatrix}1&2&3\\4&5&6\end{pmatrix}}}$
and so the nullspace is this set.
${\displaystyle {\mathcal {N}}(f)\{{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}\,{\big |}\,\;{\begin{pmatrix}1&2&3\\4&5&6\end{pmatrix}}{\begin{pmatrix}v_{1}\\v_{2}\\v_{3}\end{pmatrix}}={\begin{pmatrix}0\\0\end{pmatrix}}\;\}}$
That description makes clear that
${\displaystyle {\begin{pmatrix}1\\2\\3\end{pmatrix}},\,{\begin{pmatrix}4\\5\\6\end{pmatrix}}\in {\mathcal {N}}(f)^{\perp }}$
and since ${\displaystyle {\mathcal {N}}(f)^{\perp }}$ is a subspace of ${\displaystyle \mathbb {R} ^{n}}$, the span of the two vectors is a subspace of the perp of the nullspace. To see that this containment is an equality, take
${\displaystyle M=[\{{\begin{pmatrix}1\\2\\3\end{pmatrix}}\}]\qquad N=[\{{\begin{pmatrix}4\\5\\6\end{pmatrix}}\}]}$
in the third item of Problem 14, as suggested in the hint.
4. As above, generalizing from the specific case is easy: for any ${\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$ the matrix ${\displaystyle H}$ representing the map with respect to the standard bases describes the action
${\displaystyle {\begin{pmatrix}v_{1}\\\vdots \\v_{n}\end{pmatrix}}{\stackrel {f}{\longmapsto }}{\begin{pmatrix}h_{1,1}v_{1}+h_{1,2}v_{2}+\dots +h_{1,n}v_{n}\\\vdots \\h_{m,1}v_{1}+h_{m,2}v_{2}+\dots +h_{m,n}v_{n}\end{pmatrix}}}$
and the description of the nullspace gives that on transposing the ${\displaystyle m}$ rows of ${\displaystyle H}$
${\displaystyle {\vec {h}}_{1}={\begin{pmatrix}h_{1,1}\\h_{1,2}\\\vdots \\h_{1,n}\end{pmatrix}},\dots {\vec {h}}_{m}={\begin{pmatrix}h_{m,1}\\h_{m,2}\\\vdots \\h_{m,n}\end{pmatrix}}}$
we have ${\displaystyle {\mathcal {N}}(f)^{\perp }=[\{{\vec {h}}_{1},\dots ,{\vec {h}}_{m}\}]}$. (In (Strang 1993), this space is described as the transpose of the row space of ${\displaystyle H}$.)
Problem 16

Define a projection to be a linear transformation ${\displaystyle t:V\to V}$ with the property that repeating the projection does nothing more than does the projection alone: ${\displaystyle (t\circ t)\,({\vec {v}})=t({\vec {v}})}$ for all ${\displaystyle {\vec {v}}\in V}$.

1. Show that orthogonal projection onto a line has that property.
2. Show that projection along a subspace has that property.
3. Show that for any such ${\displaystyle t}$ there is a basis ${\displaystyle B=\langle {\vec {\beta }}_{1},\ldots ,{\vec {\beta }}_{n}\rangle }$ for ${\displaystyle V}$ such that
${\displaystyle t({\vec {\beta }}_{i})={\begin{cases}{\vec {\beta }}_{i}&i=1,2,\dots ,\,r\\{\vec {0}}&i=r+1,r+2,\dots ,\,n\end{cases}}}$
where ${\displaystyle r}$ is the rank of ${\displaystyle t}$.
4. Conclude that every projection is a projection along a subspace.
5. Also conclude that every projection has a representation
${\displaystyle {\rm {Rep}}_{B,B}(t)=\left({\begin{array}{c|c}I&Z\\\hline Z&Z\end{array}}\right)}$
in block partial-identity form.
1. First note that if a vector ${\displaystyle {\vec {v}}}$ is already in the line then the orthogonal projection gives ${\displaystyle {\vec {v}}}$ itself. One way to verify this is to apply the formula for projection onto the line spanned by a vector ${\displaystyle {\vec {s}}}$, namely ${\displaystyle ({\vec {v}}\cdot {\vec {s}}/{\vec {s}}\cdot {\vec {s}})\cdot {\vec {s}}}$. Taking the line as ${\displaystyle \{k\cdot {\vec {v}}\,{\big |}\,k\in \mathbb {R} \}}$ (the ${\displaystyle {\vec {v}}={\vec {0}}}$ case is separate but easy) gives ${\displaystyle ({\vec {v}}\cdot {\vec {v}}/{\vec {v}}\cdot {\vec {v}})\cdot {\vec {v}}}$, which simplifies to ${\displaystyle {\vec {v}}}$, as required. Now, that answers the question because after once projecting onto the line, the result ${\displaystyle {\mbox{proj}}_{\ell }({\vec {v}})}$ is in that line. The prior paragraph says that projecting onto the same line again will have no effect.
2. The argument here is similar to the one in the prior item. With ${\displaystyle V=M\oplus N}$, the projection of ${\displaystyle {\vec {v}}={\vec {m}}+{\vec {n}}}$ is ${\displaystyle {\mbox{proj}}_{M,N}({{\vec {v}}\,})={\vec {m}}}$. Now repeating the projection will give ${\displaystyle {\mbox{proj}}_{M,N}({\vec {m}})={\vec {m}}}$, as required, because the decomposition of a member of ${\displaystyle M}$ into the sum of a member of ${\displaystyle M}$ and a member of ${\displaystyle N}$ is ${\displaystyle {\vec {m}}={\vec {m}}+{\vec {0}}}$. Thus, projecting twice onto ${\displaystyle M}$ along ${\displaystyle N}$ has the same effect as projecting once.
3. As suggested by the prior items, the condition gives that ${\displaystyle t}$ leaves vectors in the rangespace unchanged, and hints that we should take ${\displaystyle {\vec {\beta }}_{1}}$, ..., ${\displaystyle {\vec {\beta }}_{r}}$ to be basis vectors for the range, that is, that we should take the range space of ${\displaystyle t}$ for ${\displaystyle M}$ (so that ${\displaystyle \dim(M)=r}$). As for the complement, we write ${\displaystyle N}$ for the nullspace of ${\displaystyle t}$ and we will show that ${\displaystyle V=M\oplus N}$. To show this, we can show that their intersection is trivial ${\displaystyle M\cap N=\{{\vec {0}}\}}$ and that they sum to the entire space ${\displaystyle M+N=V}$. For the first, if a vector ${\displaystyle {\vec {m}}}$ is in the rangespace then there is a ${\displaystyle {\vec {v}}\in V}$ with ${\displaystyle t({\vec {v}})={\vec {m}}}$, and the condition on ${\displaystyle t}$ gives that ${\displaystyle t({\vec {m}})=(t\circ t)\,({\vec {v}})=t({\vec {v}})={\vec {m}}}$, while if that same vector is also in the nullspace then ${\displaystyle t({\vec {m}})={\vec {0}}}$ and so the intersection of the rangespace and nullspace is trivial. For the second, to write an arbitrary ${\displaystyle {\vec {v}}}$ as the sum of a vector from the rangespace and a vector from the nullspace, the fact that the condition ${\displaystyle t({\vec {v}})=t(t({\vec {v}}))}$ can be rewritten as ${\displaystyle t({\vec {v}}-t({\vec {v}}))={\vec {0}}}$ suggests taking ${\displaystyle {\vec {v}}=t({\vec {v}})+({\vec {v}}-t({\vec {v}}))}$. So we are finished on taking a basis ${\displaystyle B=\langle {\vec {\beta }}_{1},\ldots ,{\vec {\beta }}_{n}\rangle }$ for ${\displaystyle V}$ where ${\displaystyle \langle {\vec {\beta }}_{1},\ldots ,{\vec {\beta }}_{r}\rangle }$ is a basis for the rangespace ${\displaystyle M}$ and ${\displaystyle \langle {\vec {\beta }}_{r+1},\ldots ,{\vec {\beta }}_{n}\rangle }$ is a basis for the nullspace ${\displaystyle N}$.
4. Every projection (as defined in this exercise) is a projection onto its rangespace and along its nullspace.
5. This also follows immediately from the third item.
Problem 17

A square matrix is symmetric if each ${\displaystyle i,j}$ entry equals the ${\displaystyle j,i}$ entry (i.e., if the matrix equals its transpose). Show that the projection matrix ${\displaystyle A({{A}^{\rm {trans}}}A)^{-1}{{A}^{\rm {trans}}}}$ is symmetric. (Strang 1980) Hint. Find properties of transposes by looking in the index under "transpose".

For any matrix ${\displaystyle M}$ we have that ${\displaystyle {{(M^{-1})}^{\rm {trans}}}=({{M}^{\rm {trans}}})^{-1}}$, and for any two matrices ${\displaystyle M}$, ${\displaystyle N}$ we have that ${\displaystyle {{MN}^{\rm {trans}}}={{N}^{\rm {trans}}}{{M}^{\rm {trans}}}}$ (provided, of course, that the inverse and product are defined). Applying these two gives that the matrix equals its transpose.

${\displaystyle {{{\bigl (}A({{A}^{\rm {trans}}}A)^{-1}{{A}^{\rm {trans}}}{\bigr )}}^{\rm {trans}}}=({{{A}^{\rm {trans}}}^{\rm {trans}}})({{{\bigl (}({{A}^{\rm {trans}}}A)^{-1}{\bigr )}}^{\rm {trans}}})({{A}^{\rm {trans}}})}$
${\displaystyle =({{{A}^{\rm {trans}}}^{\rm {trans}}})({\bigl (}{{({{A}^{\rm {trans}}}A)}^{\rm {trans}}}{\bigr )}^{-1})({{A}^{\rm {trans}}})=A({{A}^{\rm {trans}}}{{{A}^{\rm {trans}}}^{\rm {trans}}})^{-1}{{A}^{\rm {trans}}}=A({{A}^{\rm {trans}}}A)^{-1}{{A}^{\rm {trans}}}}$

## References

• Strang, Gilbert (Nov. 1993), "The Fundamental Theorem of Linear Algebra", American Mathematical Monthly (American Mathematical Society): 848-855 .
• Strang, Gilbert (1980), Linear Algebra and its Applications (2nd ed.), Hartcourt Brace Javanovich