# 4.18 Column space basis

We can now calculate a basis for the nullspace of a $m\times n$ matrix $A$ by putting it into RREF and reading off the fundamental solutions to $A\mathbf{x}=\mathbf{0}$. In this section we consider the problem of finding a basis of the column space $C(A)$, which we defined in Definition 3.6.2 to be the span of the columns of $A$.

By Proposition 3.2.1, the set of vectors $A\mathbf{v}$ is exactly the set of linear combinations of the columns of $A$. Therefore the column space $C(A)$ is equal to the image of $T_{A}:\mathbb{F}^{n}\to\mathbb{F}^{m}$ given by $T_{A}(\mathbf{x})=A\mathbf{x}$.

It would be nice to be able to solve this problem using RREF, because it is very easy to find a basis for the column space of a RREF matrix like

 $R=\begin{pmatrix}0&1&2&0&3\\ 0&0&0&1&4\\ 0&0&0&0&0\end{pmatrix}.$

The columns containing a leading entry, in this example columns 2 and 4, are easily seen to be a basis for the column space of $R$. Unfortunately doing row operations can change the column space of a matrix, so knowing the column space of $R$ does not immediately give you the column space of $A$.

One solution for this would be to introduce column operations and column reduced echelon form, and re-prove all the things about row operations and row reduced echelon form. Instead we are going to stick with the row operations we already know and use the transpose to convert columns into rows.

We defined the column space of a matrix as the span of its columns. The row space is defined similarly.

###### Definition 4.18.1.

Let $A$ be a $m\times n$ matrix. The row space of $A$ is defined to be the span of the rows of $A$.

###### Theorem 4.18.1.

Let $A$ be $m\times n$, let $E$ be a $m\times m$ invertible matrix, and let $F$ be a $n\times n$ invertible matrix. Then the row space of $EA$ equals the row space of $A$ and the column space of $AF$ equals the column space of $A$.

###### Proof.

We will do the second part only as the first one can be proved similarly. By Corollary 3.2.4, the columns of $AF$ are linear combinations of the columns of $A$, that is, elements of the subspace $C(A)$. The span $C(AF)$ of the columns of $AF$ is therefore also contained in $C(A)$.

Applying the same argument again with $AF$ in place of $A$ and $F^{-1}$ in place of $F$, the column space $C(AF)$ is contained in $C(AFF^{-1})$, that is, in $C(A)$. ∎

Since doing a row operation to a matrix is the same as left multiplication by an elementary matrix (Theorem 3.8.1), this shows that doing row operations to a matrix doesn’t change its row space.

###### Theorem 4.18.2.

Let $R$ be a $m\times n$ RREF matrix. Then the nonzero rows of $R$ are a basis for the row space of $R$.

###### Proof.

Certainly the nonzero rows span the row space, so we only need show they are linearly independent. Let the nonzero rows be $\mathbf{r}_{1},\ldots,\mathbf{r}_{l}$, and let the leading entry in row $i$ occur in column $c_{i}$. Suppose $\sum_{i=1}^{l}a_{i}\mathbf{r}_{i}=\mathbf{0}$. Pick any $1\leqslant i\leqslant l$ and consider the entry in column $c_{i}$ of this sum. On the right we have 0. On the left $a_{i}\mathbf{r}_{i}$ has a $a_{i}$ in column $c_{i}$, and all the other $\mathbf{r}_{j}$s have zeros in column $c_{i}$ because $R$ is in RREF. Thus we have $a_{i}=0$ for $1\leqslant i\leqslant l$, so the rows are linearly independent. ∎

The columns of $A$ are the transposes of the rows of $A^{T}$, so we can get a basis for the column space of $A$ by forming the matrix $A^{T}$, doing row operations until we reach a RREF matrix, then taking the transposes of the nonzero rows of this RREF matrix.

###### Example 4.18.1.

Let $A=\begin{pmatrix}1&2&3\\ 4&5&6\\ 7&8&9\end{pmatrix}$. To find a basis of $C(A)$ we take the transpose of $A$ to get

 $A^{T}=\begin{pmatrix}1&4&7\\ 2&5&8\\ 3&6&9\end{pmatrix}$

Doing row operations, we reach the RREF matrix

 $R=\begin{pmatrix}1&0&-1\\ 0&1&2\\ 0&0&0\end{pmatrix}.$

The nonzero rows $\begin{pmatrix}1&0&-1\end{pmatrix}$ and $\begin{pmatrix}0&1&2\end{pmatrix}$ are a basis for the row space of $R$, which equals the row space of $A^{T}$, so their transposes

 $\begin{pmatrix}1\\ 0\\ -1\end{pmatrix},\begin{pmatrix}0\\ 1\\ 2\end{pmatrix}$

are a basis for the column space of $A$.