Chapter 2: Matrix Algebra
2.8 Subspaces of R^n
Study guide for Linear Algebra and Its Applications (David C. Lay, 6th edition)
Independent study guide. Not affiliated with or endorsed by Pearson.
Big idea
Some sets of vectors are closed worlds: add two members and you stay inside, scale a member and you stay inside. Those are the subspaces, and they are the sets on which the rest of linear algebra operates. Lines and planes through the origin are the examples in $\mathbf{R}^3$, and a line that misses the origin is the standard non-example.
Every matrix produces two of them, on opposite sides. The column space lives in the output space and collects every vector the matrix can produce. The null space lives in the input space and collects every vector the matrix crushes to zero. One measures reach, the other measures collapse, and between them they answer the existence and uniqueness questions from the first chapter in a single vocabulary.
A basis is the efficient description of such a set: enough vectors to build everything, few enough that none is wasted. The point of this section is that one row reduction hands you a basis for both spaces at once. The free variables give the null space basis; the pivot columns mark the column space basis.
Decoder
A subspace is a subset closed under addition and scalar multiplication that contains the zero vector.
Plain version: three tests. Is $\mathbf{0}$ in the set. If you add two members, is the result still a member. If you scale a member by any number, is the result still a member. Pass all three and the set is a subspace; fail any one and it is not.
The zero test is usually the fast one, so try it first. And note the scalar test allows every real number, including negatives and zero, which is what rules out the first quadrant and every other set that stops at a boundary.
The two spaces are described in opposite styles, which is worth noticing early. The column space comes with a recipe for building its members and no test for membership. The null space comes with a test its members must pass and no recipe. Turning either description into the other is work, and row reduction is the tool that does it.
Definitions and results
Subspace. A set $H$ of vectors in $\mathbf{R}^n$ is a subspace when $\mathbf{0}$ is in $H$, the sum of any two vectors of $H$ is in $H$, and any scalar multiple of a vector of $H$ is in $H$. The set containing only $\mathbf{0}$ is a subspace, the zero subspace. All of $\mathbf{R}^n$ is a subspace of itself.
Spans are subspaces. For any vectors $\mathbf{v}_1, \dots, \mathbf{v}_p$ in $\mathbf{R}^n$, the set $\text{Span}\{\mathbf{v}_1, \dots, \mathbf{v}_p\}$ is a subspace. Combining combinations gives combinations, and taking every weight zero gives $\mathbf{0}$. This is the quickest way to prove a set is a subspace: exhibit it as a span.
Column space. $\text{Col}\,A$ is the span of the columns of $A$. For an $m \times n$ matrix it is a subspace of $\mathbf{R}^m$. A vector $\mathbf{b}$ lies in $\text{Col}\,A$ exactly when $A\mathbf{x} = \mathbf{b}$ is consistent, so the column space is the set of right-hand sides the matrix can reach.
Null space. $\text{Nul}\,A$ is the set of solutions of $A\mathbf{x} = \mathbf{0}$. For an $m \times n$ matrix it is a subspace of $\mathbf{R}^n$. That it is a subspace needs a short argument, not an appeal to the span rule: if $A\mathbf{u} = \mathbf{0}$ and $A\mathbf{v} = \mathbf{0}$ then $A(\mathbf{u} + \mathbf{v}) = \mathbf{0}$ and $A(c\mathbf{u}) = \mathbf{0}$, and $A\mathbf{0} = \mathbf{0}$ settles the zero vector.
Basis. A basis for a subspace $H$ is a linearly independent set that spans $H$. Independence forbids waste and spanning forbids gaps. The standard basis of $\mathbf{R}^n$ is the set of columns of $I_n$.
Basis for the null space. Solve $A\mathbf{x} = \mathbf{0}$ and write the general solution in parametric vector form, one free variable at a time. The vectors multiplying the free variables form a basis of $\text{Nul}\,A$. They span by construction, and they are independent because each has a $1$ in the position of its own free variable and $0$ in the positions of the others.
Basis for the column space. The pivot columns of $A$ form a basis of $\text{Col}\,A$. Take the columns of $A$ itself, not of the echelon form: row operations change the column space, so the reduced matrix has the right pivot positions and the wrong columns.
Two spaces, two homes. For an $m \times n$ matrix, the null space sits in $\mathbf{R}^n$ and the column space sits in $\mathbf{R}^m$. Mixing them up is the usual error, and checking the length of the vectors catches it every time.
Worked examples
Testing three sets
The set of all $(x_1, x_2)$ with $x_1 + x_2 = 1$ is not a subspace: the zero vector gives $0 + 0 = 0$, not $1$. It is a line, but the wrong line.
The set of all $(x_1, x_2)$ with $x_1 \geq 0$ and $x_2 \geq 0$ is not a subspace either. It contains $\mathbf{0}$ and is closed under addition, but scaling $(1, 1)$ by $-1$ gives $(-1, -1)$, which is outside. One failed test is enough.
The set of all $(a - 3b, \; 2a, \; b)$ with $a$ and $b$ real is a subspace. Split it: $a(1, 2, 0) + b(-3, 0, 1)$. Every member is a combination of two fixed vectors, so the set is their span, so it is a subspace of $\mathbf{R}^3$. Those two vectors are also a basis for it, since neither is a multiple of the other.
Both spaces of one matrix
Let
$$ A = \begin{bmatrix} 1 & 2 & 0 & 3 \\ 2 & 4 & 1 & 7 \\ 1 & 2 & 1 & 4 \end{bmatrix} $$
Reduce. Row $2$ minus $2$ times row $1$ gives $(0, 0, 1, 1)$, and row $3$ minus row $1$ gives the same, so the new row $3$ minus the new row $2$ is zero:
$$ \begin{bmatrix} 1 & 2 & 0 & 3 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} $$
Pivots sit in columns $1$ and $3$, so $x_2$ and $x_4$ are free. The equations read $x_1 = -2x_2 - 3x_4$ and $x_3 = -x_4$, giving the parametric form
$$ \mathbf{x} = x_2\begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix} + x_4\begin{bmatrix} -3 \\ 0 \\ -1 \\ 1 \end{bmatrix} $$
so those two vectors are a basis of $\text{Nul}\,A$, a subspace of $\mathbf{R}^4$.
Check the second one against the original matrix. $A$ times $(-3, 0, -1, 1)$ has first entry $-3 + 0 + 0 + 3 = 0$, second entry $-6 + 0 - 1 + 7 = 0$, third entry $-3 + 0 - 1 + 4 = 0$. The zero vector, as required.
For the column space, take columns $1$ and $3$ of $A$:
$$ \left\{\begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix}, \; \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}\right\} $$
a basis of $\text{Col}\,A$, a subspace of $\mathbf{R}^3$. The discarded columns are combinations of these two: column $2$ is twice column $1$, and column $4$ is $3$ times column $1$ plus column $3$, since $3(1, 2, 1) + (0, 1, 1) = (3, 7, 4)$, which is column $4$.
Membership in the column space
Is $\mathbf{b} = (1, 3, 2)$ in $\text{Col}\,A$? Try to build it from the basis: $c_1(1, 2, 1) + c_2(0, 1, 1) = (1, 3, 2)$. The first coordinate forces $c_1 = 1$, the second forces $2 + c_2 = 3$, so $c_2 = 1$, and the third must then hold on its own: $1 + 1 = 2$. It does, so $\mathbf{b}$ is in the column space, and $A\mathbf{x} = \mathbf{b}$ is consistent with, for instance, $\mathbf{x} = (1, 0, 1, 0)$.
Check that solution in $A$ directly: $1 + 0 = 1$, $2 + 1 = 3$, $1 + 1 = 2$. Correct.
Now try $\mathbf{c} = (1, 1, 1)$. The first coordinate forces $c_1 = 1$, the second forces $c_2 = -1$, and the third then demands $1 - 1 = 1$, which is false. So $\mathbf{c}$ is not in $\text{Col}\,A$ and $A\mathbf{x} = \mathbf{c}$ is inconsistent. The column space here is a plane in $\mathbf{R}^3$, not all of it, so most vectors miss it.
Practice
Decide whether a described set is a subspace, using the three tests.
Practice
Generated problems for this section, graded instantly.
Solve the homogeneous system and read a basis for the null space off the parametric form.
Practice
Generated problems for this section, graded instantly.
Identify the pivot columns and test membership in the column space.
Practice
Generated problems for this section, graded instantly.
Verify that a proposed set is a basis: independent, and spanning.
Practice
Generated problems for this section, graded instantly.
Videos
Watch for the passage naming the column space and the null space and showing what each one looks like when a transformation flattens space. The null space appearing as the line that collapses to the origin is the picture to keep.
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
3Blue1Brown
Quiz
Six items on subspaces, null spaces, column spaces, and bases.
Quiz
6 problems with a score at the end.