Math Core

Lesson 4.2 · Vector Spaces

Null spaces and column spaces

Every matrix AA comes with two subspaces attached. One collects the inputs that AA sends to zero, and the other collects every output AA can produce. These two subspaces, the null space and the column space, answer the two basic questions about Ax=bA\mathbf{x} = \mathbf{b}: are solutions unique, and do solutions exist?

The null space

Definition

Null space

The null space of an m×nm \times n matrix AA is the set of all solutions of the homogeneous equation Ax=0A\mathbf{x} = \mathbf{0}:

Nul⁡A={x∈Rn:Ax=0}.\operatorname{Nul} A = \lbrace \mathbf{x} \in \mathbb{R}^n : A\mathbf{x} = \mathbf{0} \rbrace.

Nul⁡A\operatorname{Nul} A is a subspace of Rn\mathbb{R}^n, where nn is the number of columns of AA. The check uses only the linearity of matrix multiplication: A0=0A\mathbf{0} = \mathbf{0}; if Au=0A\mathbf{u} = \mathbf{0} and Av=0A\mathbf{v} = \mathbf{0} then A(u+v)=Au+Av=0A(\mathbf{u} + \mathbf{v}) = A\mathbf{u} + A\mathbf{v} = \mathbf{0}; and A(cu)=cAu=0A(c\mathbf{u}) = cA\mathbf{u} = \mathbf{0}.

Deciding whether a particular vector is in Nul⁡A\operatorname{Nul} A is easy: multiply. For example, with

A=[13121−3],u=[2−11],A = \begin{bmatrix} 1 & 3 & 1 \\ 2 & 1 & -3 \end{bmatrix}, \qquad \mathbf{u} = \begin{bmatrix} 2 \\ -1 \\ 1 \end{bmatrix},

you get Au=(2−3+1,  4−1−3)=(0,0)A\mathbf{u} = (2 - 3 + 1,\; 4 - 1 - 3) = (0, 0), so u\mathbf{u} is in Nul⁡A\operatorname{Nul} A.

The definition of Nul⁡A\operatorname{Nul} A is implicit: it gives a test that vectors must pass, not a list of the vectors. To make it explicit, solve Ax=0A\mathbf{x} = \mathbf{0} and write the solution in parametric vector form. The vectors that multiply the free variables span Nul⁡A\operatorname{Nul} A.

Worked example: A spanning set for a null space

Find a spanning set for Nul⁡A\operatorname{Nul} A, where

A=[120−124113610].A = \begin{bmatrix} 1 & 2 & 0 & -1 \\ 2 & 4 & 1 & 1 \\ 3 & 6 & 1 & 0 \end{bmatrix}.

Row reduce AA (the augmented column of zeros never changes, so leave it off). R2−2R1R_2 - 2R_1 and R3−3R1R_3 - 3R_1 give rows (0,0,1,3)(0, 0, 1, 3) and (0,0,1,3)(0, 0, 1, 3); then R3−R2R_3 - R_2 clears the last row:

[120−100130000].\begin{bmatrix} 1 & 2 & 0 & -1 \\ 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 0 \end{bmatrix}.

The pivots are in columns 11 and 33, so x2x_2 and x4x_4 are free. Reading the rows:

x1=−2x2+x4,x3=−3x4.x_1 = -2x_2 + x_4, \qquad x_3 = -3x_4.

So every solution has the form

x=[−2x2+x4x2−3x4x4]=x2[−2100]+x4[10−31].\mathbf{x} = \begin{bmatrix} -2x_2 + x_4 \\ x_2 \\ -3x_4 \\ x_4 \end{bmatrix} = x_2 \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix} + x_4 \begin{bmatrix} 1 \\ 0 \\ -3 \\ 1 \end{bmatrix}.

Hence Nul⁡A=Span⁡{(−2,1,0,0),  (1,0,−3,1)}\operatorname{Nul} A = \operatorname{Span}\lbrace (-2, 1, 0, 0),\; (1, 0, -3, 1) \rbrace.

Two features of this method matter later. The spanning set it produces is automatically linearly independent, because each vector has a 11 in the position of its own free variable and 00 in the positions of the other free variables. And the number of vectors equals the number of free variables. If Ax=0A\mathbf{x} = \mathbf{0} has only the trivial solution, then Nul⁡A={0}\operatorname{Nul} A = \lbrace \mathbf{0} \rbrace.

The column space

Definition

Column space

The column space of an m×nm \times n matrix A=[ a1  ⋯  an ]A = [\,\mathbf{a}_1 \;\cdots\; \mathbf{a}_n\,] is the set of all linear combinations of its columns:

Col⁡A=Span⁡{a1,…,an}={Ax:x∈Rn}.\operatorname{Col} A = \operatorname{Span}\lbrace \mathbf{a}_1, \dots, \mathbf{a}_n \rbrace = \lbrace A\mathbf{x} : \mathbf{x} \in \mathbb{R}^n \rbrace.

As a span, Col⁡A\operatorname{Col} A is automatically a subspace, and it lives in Rm\mathbb{R}^m, where mm is the number of rows. The second description says b\mathbf{b} is in Col⁡A\operatorname{Col} A exactly when Ax=bA\mathbf{x} = \mathbf{b} is consistent. In particular, Col⁡A=Rm\operatorname{Col} A = \mathbb{R}^m exactly when Ax=bA\mathbf{x} = \mathbf{b} has a solution for every b\mathbf{b}, which happens when AA has a pivot in every row.

The column space is the opposite of the null space: it is defined explicitly (you can write down its vectors instantly) but testing membership takes work (you must row reduce [ A∣b ][\,A \mid \mathbf{b}\,]).

Worked example: Is b in the column space?

Let A=[122537]A = \begin{bmatrix} 1 & 2 \\ 2 & 5 \\ 3 & 7 \end{bmatrix}. For which hh is b=(1,h,5)\mathbf{b} = (1, h, 5) in Col⁡A\operatorname{Col} A?

You need c1,c2c_1, c_2 with c1+2c2=1c_1 + 2c_2 = 1, 2c1+5c2=h2c_1 + 5c_2 = h and 3c1+7c2=53c_1 + 7c_2 = 5. The first and third equations involve no hh. Subtracting 33 times the first from the third gives c2=2c_2 = 2, and then c1=1−4=−3c_1 = 1 - 4 = -3. The middle equation must also hold:

h=2(−3)+5(2)=4.h = 2(-3) + 5(2) = 4.

So b\mathbf{b} is in Col⁡A\operatorname{Col} A only when h=4h = 4.

Comparing the two

For an m×nm \times n matrix AA:

Nul⁡A\operatorname{Nul} ACol⁡A\operatorname{Col} A
Lives inRn\mathbb{R}^nRm\mathbb{R}^m
Descriptionimplicit: Ax=0A\mathbf{x} = \mathbf{0}explicit: span of the columns
Membership testcompute AvA\mathbf{v}row reduce [ A∣v ][\,A \mid \mathbf{v}\,]
Finding a spanning setsolve Ax=0A\mathbf{x} = \mathbf{0}read off the columns
Trivial case{0}\lbrace \mathbf{0} \rbrace iff columns are independentRm\mathbb{R}^m iff a pivot in every row

Common mistake

Keep track of where each subspace lives. For a 3×53 \times 5 matrix, null space vectors have 55 entries and column space vectors have 33. A vector can be in one only if it has the right size, so a quick size check catches many errors.

Kernel and range

The same ideas apply to any linear transformation T:V→WT : V \to W between vector spaces. The kernel of TT is the set of u\mathbf{u} in VV with T(u)=0T(\mathbf{u}) = \mathbf{0}, and the range of TT is the set of all outputs T(u)T(\mathbf{u}). The kernel is a subspace of VV and the range is a subspace of WW. When T(x)=AxT(\mathbf{x}) = A\mathbf{x}, the kernel is Nul⁡A\operatorname{Nul} A and the range is Col⁡A\operatorname{Col} A.

Worked example: The kernel of a transformation

Let T:R3→R2T : \mathbb{R}^3 \to \mathbb{R}^2 be T(x,y,z)=(x−y,  y−z)T(x, y, z) = (x - y,\; y - z). Find the kernel.

T(x,y,z)=0T(x, y, z) = \mathbf{0} means x=yx = y and y=zy = z. So the kernel is all vectors (t,t,t)(t, t, t), the line Span⁡{(1,1,1)}\operatorname{Span}\lbrace (1, 1, 1) \rbrace. The range is all of R2\mathbb{R}^2, since any (a,b)(a, b) equals T(a+b,b,0)T(a + b, b, 0).

Tip

A nonzero vector in Nul⁡A\operatorname{Nul} A is a dependence relation among the columns of AA: if Ax=0A\mathbf{x} = \mathbf{0}, then x1a1+⋯+xnan=0x_1\mathbf{a}_1 + \cdots + x_n\mathbf{a}_n = \mathbf{0}. In the first example, (−2,1,0,0)(-2, 1, 0, 0) says column 22 is twice column 11.

Practice

Practice 1

AA is a 4×64 \times 6 matrix. Col⁡A\operatorname{Col} A is a subspace of Rk\mathbb{R}^k. What is kk?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

AA is a 5×75 \times 7 matrix. Nul⁡A\operatorname{Nul} A is a subspace of Rk\mathbb{R}^k. What is kk?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Let A=[31−2145]A = \begin{bmatrix} 3 & 1 & -2 \\ 1 & 4 & 5 \end{bmatrix} and v=(1,−2,1)\mathbf{v} = (1, -2, 1). Is v\mathbf{v} in Nul⁡A\operatorname{Nul} A?

Practice 4

Let A=[10−2013]A = \begin{bmatrix} 1 & 0 & -2 \\ 0 & 1 & 3 \end{bmatrix}. Nul⁡A\operatorname{Nul} A is spanned by a single vector of the form (a,b,1)(a, b, 1). Find it.

Enter a point like (2, -3)

Practice 5

Let A=[1−242−48−12−4]A = \begin{bmatrix} 1 & -2 & 4 \\ 2 & -4 & 8 \\ -1 & 2 & -4 \end{bmatrix}. The standard method (solving Ax=0A\mathbf{x} = \mathbf{0} in parametric vector form) produces a spanning set for Nul⁡A\operatorname{Nul} A. How many vectors are in it?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Let A=[100123]A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 2 & 3 \end{bmatrix}. For what value of hh is b=(2,1,h)\mathbf{b} = (2, 1, h) in Col⁡A\operatorname{Col} A?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Let T:R3→R2T : \mathbb{R}^3 \to \mathbb{R}^2 be T(x,y,z)=(x+z,  y−2z)T(x, y, z) = (x + z,\; y - 2z). The kernel of TT is a line spanned by a vector whose third entry is 11. Find that vector.

Enter a point like (2, -3)

Practice 8

AA is a 3×33 \times 3 matrix and Nul⁡A={0}\operatorname{Nul} A = \lbrace \mathbf{0} \rbrace. Which statement must be true?