Suppose $A$ is an $m \times n$ matrix with $\operatorname{rank} A=n$. (a) Show that applying the GramSchmidt algorithm to the columns of $A$ produces an orthonormal basis for img $A$. (b) Prove that this is equivalent to the matrix factorization $A=Q R$, where $Q$ is an $m \times n$ matrix with orthonormal columns, while $R$ is a nonsingular $n \times n$ upper triangular matrix. (c) Show that the $Q R$ program in the text also works for rectangular, $m \times n$, matrices as stated, the only modification being that the row indices $i$ run from 1 to $m$. (d) Apply this method to factor
(i) $\left(\begin{array}{rr}1 & -1 \\ 2 & 3 \\ 0 & 2\end{array}\right)$,
(ii) $\left(\begin{array}{rr}-3 & 2 \\ 1 & -1 \\ 4 & 1\end{array}\right)$,
(iii)
$\left(\begin{array}{rr}-1 & 1 \\ 1 & -2 \\ -1 & -3 \\ 0 & 5\end{array}\right)$
(iv)
$$
\left(\begin{array}{rrr}
0 & 1 & 2 \\
-3 & 1 & -1 \\
-1 & 0 & -2 \\
1 & 1 & -2
\end{array}\right)
$$
(e) Explain what happens if $\operatorname{rank} A<n$.