Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

5.1: Column space

The focus of Chapter 4 was solving problems of the form:

Given an n×dn\times d matrix AA and a vector b⃗∈Rn\vec b\in\mathbb R^n, find a vector v⃗∈Rd\vec v\in\mathbb R^d such that

Av⃗=b⃗.A\vec v=\vec b.

Now, we’d like to approach the same idea from a different perspective:

Given an n×dn\times d matrix AA, what are all possible outputs b⃗\vec b we can make using Av⃗A\vec v?

We’d also like to describe sets of possible outputs beyond R2\mathbb R^2 and R3\mathbb R^3. By the end, we’ll have precise terminology to describe the set of possible outputs of a matrix like

[2−1043−3250110−23−4031−254−2310−1520−3].\begin{bmatrix} 2&-1&0&4&3\\ -3&2&5&0&1\\ 1&0&-2&3&-4\\ 0&3&1&-2&5\\ 4&-2&3&1&0\\ -1&5&2&0&-3 \end{bmatrix}.

This is a 6×56\times5 matrix, so its set of possible outputs is some collection of vectors in R6\mathbb R^6. We can’t draw this collection the way we can draw a line or plane in R3\mathbb R^3, but we can still describe it!


Example: A plane

Let’s start with the 3×23\times2 matrix

A=[101101].A=\begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix}.

Suppose we multiply AA by v⃗=[v1v2]\vec v=\begin{bmatrix}v_1\\v_2\end{bmatrix}. What are the components of the output?

Av⃗=[v1v1+v2v2].A\vec v=\begin{bmatrix}v_1\\v_1+v_2\\v_2\end{bmatrix}.

Notice that any vector [xyz]\begin{bmatrix}x\\y\\z\end{bmatrix} that could be an output of Av⃗A\vec v satisfies

y=x+z,or equivalently,x−y+z=0.y=x+z,\qquad\text{or equivalently,}\qquad x-y+z=0.

Remember, a plane in R3\mathbb R^3 is a set of vectors whose entries satisfy a linear equation involving xx, yy, and zz. Here, the plane is

P={[xyz]∈R3:x−y+z=0}.P=\left\{\begin{bmatrix}x\\y\\z\end{bmatrix}\in\mathbb R^3:x-y+z=0\right\}.

Every output of AA lies on this plane: plugging in the entries of [v1v1+v2v2]\begin{bmatrix}v_1\\v_1+v_2\\v_2\end{bmatrix} gives

v1−(v1+v2)+v2=0.v_1-(v_1+v_2)+v_2=0.

And every vector on this plane is an output of AA. For example, [253]\begin{bmatrix}2\\5\\3\end{bmatrix} is on the plane, since 2−5+3=02-5+3=0, and

A[23]=[22+33]=[253].A\begin{bmatrix}2\\3\end{bmatrix} =\begin{bmatrix}2\\2+3\\3\end{bmatrix} =\begin{bmatrix}2\\5\\3\end{bmatrix}.

The same idea works for any vector on the plane: use its first and third entries as the input, and the middle entry takes care of itself because y=x+zy=x+z. So the set of possible outputs of AA is exactly this plane.

Loading...

Drag to rotate. The two columns, a⃗1=[110]\vec a_1=\begin{bmatrix}1\\1\\0\end{bmatrix} and a⃗2=[011]\vec a_2=\begin{bmatrix}0\\1\\1\end{bmatrix}, lie on the plane x−y+z=0x-y+z=0.


Span and column space

Recall the column perspective on matrix-vector multiplication. If we call the columns of AA a⃗1\vec a_1 and a⃗2\vec a_2, then

A[v1v2]=v1[110]⏟a⃗1+v2[011]⏟a⃗2.A\begin{bmatrix}v_1\\v_2\end{bmatrix} =v_1\underbrace{\begin{bmatrix}1\\1\\0\end{bmatrix}}_{\vec a_1} +v_2\underbrace{\begin{bmatrix}0\\1\\1\end{bmatrix}}_{\vec a_2}.

Each input gives us a linear combination of the columns. Letting the input vary gives us all possible linear combinations. This set is called their span.

This isn’t your first time seeing the idea of a span:

  • The span of a single nonzero vector is a line through the origin.

  • The span of two nonzero vectors u⃗\vec u and v⃗\vec v is either a line through the origin if the vectors are linearly dependent (one is a scalar multiple of the other), or a plane through the origin if they are linearly independent (they don’t lie along the same line).

The new thing is that we’ve generalized the definition to an arbitrary number of vectors, with any number of entries. Intuitively, think of the span as the set of all new vectors you can produce using v⃗1,…,v⃗d\vec v_1,\ldots,\vec v_d as building blocks.

When the vectors are the columns of a matrix, we give their span a special name.

Pay attention to the two numbers in the shape n×dn\times d. Inputs have dd entries, while outputs have nn entries. So the column space is a subset of Rn\mathbb R^n, regardless of how many columns there are.

For our matrix

A=[101101],A=\begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix},

we found that

colsp⁡(A)={[xyz]∈R3:x−y+z=0}=P,\operatorname{colsp}(A) =\left\{\begin{bmatrix}x\\y\\z\end{bmatrix}\in\mathbb R^3:x-y+z=0\right\}=P,

a plane in R3\mathbb R^3.

This gives us a way to connect our new question back to the one from Chapter 4. Asking whether Ax⃗=b⃗A\vec x=\vec b has a solution is asking whether b⃗\vec b is one of the outputs AA can produce. In our new terminology:


Adding a column

What happens to the column space if we add another column to AA? It depends on whether that column can already be made using the original columns.

A redundant column

Now consider the matrix

B=[10211101−1].B=\begin{bmatrix}1&0&2\\1&1&1\\0&1&-1\end{bmatrix}.

Its first two columns are the same as AA’s. Its third column is a linear combination of the first two:

a⃗3=[21−1]=2[110]−[011]=2a⃗1−a⃗2.\vec a_3=\begin{bmatrix}2\\1\\-1\end{bmatrix} =2\begin{bmatrix}1\\1\\0\end{bmatrix}-\begin{bmatrix}0\\1\\1\end{bmatrix} =2\vec a_1-\vec a_2.

Does this column give us any new outputs? Let’s write a general output:

B[pqr]=pa⃗1+qa⃗2+r(2a⃗1−a⃗2)=(p+2r)a⃗1+(q−r)a⃗2.B\begin{bmatrix}p\\q\\r\end{bmatrix} =p\vec a_1+q\vec a_2+r(2\vec a_1-\vec a_2) =(p+2r)\vec a_1+(q-r)\vec a_2.

This is still a combination of the first two columns. Conversely, we can produce any output of AA using BB by putting a zero in the third input entry. For example,

A[45]=B[450]=[495].A\begin{bmatrix}4\\5\end{bmatrix} =B\begin{bmatrix}4\\5\\0\end{bmatrix} =\begin{bmatrix}4\\9\\5\end{bmatrix}.

Thus colsp⁡(B)=colsp⁡(A)=P\operatorname{colsp}(B)=\operatorname{colsp}(A)=P. We call the third column redundant because removing it does not change the span.

But [450]\begin{bmatrix}4\\5\\0\end{bmatrix} is not the only input that BB sends to [495]\begin{bmatrix}4\\9\\5\end{bmatrix}. There are infinitely many! How can we find them? We solve

Bx⃗=[495].B\vec x=\begin{bmatrix}4\\9\\5\end{bmatrix}.

An LU factorization is

B=[100110011]⏟L[10201−1000]⏟U.B=\underbrace{\begin{bmatrix}1&0&0\\1&1&0\\0&1&1\end{bmatrix}}_L \underbrace{\begin{bmatrix}1&0&2\\0&1&-1\\0&0&0\end{bmatrix}}_U.

Forward substitution in Ly⃗=[495]L\vec y=\begin{bmatrix}4\\9\\5\end{bmatrix} gives y⃗=[450]\vec y=\begin{bmatrix}4\\5\\0\end{bmatrix}. Then Ux⃗=y⃗U\vec x=\vec y gives

x1+2x3=4,x2−x3=5,0=0.x_1+2x_3=4,\qquad x_2-x_3=5,\qquad 0=0.

Setting the free variable x3=tx_3=t, the complete set of solutions is

x⃗=[450]+t[−211]=[4−2t5+tt],t∈R.\boxed{\vec x=\begin{bmatrix}4\\5\\0\end{bmatrix} +t\begin{bmatrix}-2\\1\\1\end{bmatrix} =\begin{bmatrix}4-2t\\5+t\\t\end{bmatrix},\qquad t\in\mathbb R.}

The input [450]\begin{bmatrix}4\\5\\0\end{bmatrix} corresponds to t=0t=0. For example, t=1t=1 gives the different input [261]\begin{bmatrix}2\\6\\1\end{bmatrix}, with the same output [495]\begin{bmatrix}4\\9\\5\end{bmatrix}.

For AA, the only input producing this output is [45]\begin{bmatrix}4\\5\end{bmatrix}: the first and third output entries determine its two input entries. The extra column of BB gives us infinitely many ways to produce the same output, without changing which outputs are possible.

Loading...

A column outside the span

Now consider the matrix

C=[102114013].C=\begin{bmatrix}1&0&2\\1&1&4\\0&1&3\end{bmatrix}.

The third column is [243]\begin{bmatrix}2\\4\\3\end{bmatrix}. It is not on PP, since 2−4+3≠02-4+3\ne0. So it cannot be written as a linear combination of the first two columns. The three columns are linearly independent: none can be made using the other two. The span of all three columns is larger than the span of just the first two. We will formally define linear independence in Chapter 5.2.

All the old outputs are still available: C[450]=A[45]C\begin{bmatrix}4\\5\\0\end{bmatrix}=A\begin{bmatrix}4\\5\end{bmatrix}. But now there are new outputs, too.

Do we get all of R3\mathbb R^3? An LU factorization of CC answers this:

C=[100110011]⏟L[102012001]⏟U.C= \underbrace{\begin{bmatrix}1&0&0\\1&1&0\\0&1&1\end{bmatrix}}_L \underbrace{\begin{bmatrix}1&0&2\\0&1&2\\0&0&1\end{bmatrix}}_U.

For any right-hand side, forward substitution determines one intermediate vector, and back substitution determines one input. There are no free variables or consistency conditions. Therefore,

colsp⁡(C)=R3.\operatorname{colsp}(C)=\mathbb R^3.

Geometrically, the first two columns span a plane, and the third adds a direction outside that plane. Their linear combinations fill all of R3\mathbb R^3.

Adding a column can change which outputs are possible, how many inputs produce them, or both. In Chapter 5.2, we’ll connect these observations to linear independence and invertibility.


More examples

Example: A line or all of R2\mathbb R^2

For D=[2−63−9]D=\begin{bmatrix}2&-6\\3&-9\end{bmatrix}, the second column is -3 times the first, so colsp⁡(D)\operatorname{colsp}(D) is a line:

colsp⁡(D)={t[23]:t∈R}={[xy]∈R2:3x−2y=0}.\operatorname{colsp}(D) =\left\{t\begin{bmatrix}2\\3\end{bmatrix}:t\in\mathbb R\right\} =\left\{\begin{bmatrix}x\\y\end{bmatrix}\in\mathbb R^2:3x-2y=0\right\}.

This is what we mean by the line 3x−2y=03x-2y=0: the set of vectors whose entries satisfy that equation.

For E=[2−113]E=\begin{bmatrix}2&-1\\1&3\end{bmatrix}, the columns are not scalar multiples, so

colsp⁡(E)=R2.\operatorname{colsp}(E)=\mathbb R^2.

We can also see this using the inverse. The matrix EE is invertible, with

E−1=12(3)−(−1)(1)[31−12]=17[31−12].E^{-1}=\frac{1}{2(3)-(-1)(1)}\begin{bmatrix}3&1\\-1&2\end{bmatrix} =\frac17\begin{bmatrix}3&1\\-1&2\end{bmatrix}.

For any b⃗=[b1b2]∈R2\vec b=\begin{bmatrix}b_1\\b_2\end{bmatrix}\in\mathbb R^2, the equation Ex⃗=b⃗E\vec x=\vec b has the unique solution

x⃗=E−1b⃗=17[31−12][b1b2]=[(3b1+b2)/7(−b1+2b2)/7].\vec x=E^{-1}\vec b =\frac17\begin{bmatrix}3&1\\-1&2\end{bmatrix}\begin{bmatrix}b_1\\b_2\end{bmatrix} =\begin{bmatrix}(3b_1+b_2)/7\\(-b_1+2b_2)/7\end{bmatrix}.

Every vector in R2\mathbb R^2 is therefore an output of EE.

DD, on the other hand, is not invertible. Trying the same inverse formula would require

12(−9)−(−6)(3)[−96−32]=10[−96−32],\frac{1}{2(-9)-(-6)(3)}\begin{bmatrix}-9&6\\-3&2\end{bmatrix} =\frac{1}{0}\begin{bmatrix}-9&6\\-3&2\end{bmatrix},

which is undefined. Its columns only produce vectors on the line 3x−2y=03x-2y=0, so we cannot solve Dx⃗=b⃗D\vec x=\vec b for every b⃗∈R2\vec b\in\mathbb R^2.