Unit 3, lesson 17

Null Space and Left Null Space

How to find bases for the null space and the left null space of a matrix, how the rank and the size of the matrix fix the nullity and the left nullity, and where each of the four fundamental subspaces lives.

  • Video 17
  • The Four Fundamental Subspaces

Let MM be the 3 by 3 matrix with columns (1,2,3)(1, 2, 3), (2,4,6)(2, 4, 6) and (1,0,1)(1, 0, 1), where each tuple stands for a column vector. It sends both (0,0,1)(0, 0, 1) and (2,−1,1)(2, -1, 1) to the same output (1,0,1)(1, 0, 1), so the input change (2,−1,0)(2, -1, 0) is invisible to it. Which input changes does a matrix send to zero, and which combinations of output entries vanish for every input? This lesson finds both sets, the null space and the left null space, counts their dimensions, and places all four fundamental subspaces of a matrix in their proper spaces.

Key terms

Null space

Definition The null space of a real m×nm \times n matrix AA is the solution set of the homogeneous system Ax=0A\mathbf{x} = \mathbf{0},

Null⁡A={x∈Rn∣Ax=0}.\operatorname{Null} A = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\}.

It is a subspace of Rn\mathbb{R}^n, the input space of AA. Row operations do not change it. If they take AA to FF, then F=EAF = EA with EE invertible, so Ax=0A\mathbf{x} = \mathbf{0} exactly when Fx=0F\mathbf{x} = \mathbf{0}. A basis comes from the reduced row echelon form, by solving for the pivot variables in terms of the free variables. If Ap=bA\mathbf{p} = \mathbf{b}, then the solutions of Ax=bA\mathbf{x} = \mathbf{b} are exactly the vectors p+z\mathbf{p} + \mathbf{z} with z\mathbf{z} in Null⁡A\operatorname{Null} A.

In plain words The null space holds the inputs the matrix sends to zero, which are exactly the input changes that leave every output as it was. The word null describes the output, not the inputs. The null space contains nonzero vectors exactly when the columns of AA are dependent.

Example The matrix MM and its reduced row echelon form are

M=[121240361],F=[120001000].\begin{aligned} M &= \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 0 \\ 3 & 6 & 1 \end{bmatrix}, \\[0.4em] F &= \begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}. \end{aligned}

So Mx=0M\mathbf{x} = \mathbf{0} means x1+2x2=0x_1 + 2x_2 = 0 and x3=0x_3 = 0. The variable x2=tx_2 = t is free, and

x=[−2tt0]=t[−210].\mathbf{x} = \begin{bmatrix} -2t \\ t \\ 0 \end{bmatrix} = t \begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix}.

Hence Null⁡M\operatorname{Null} M is the line through 0\mathbf{0} spanned by (−2,1,0)(-2, 1, 0), and the rows of MM check it, since −2+2=0-2 + 2 = 0, −4+4=0-4 + 4 = 0 and −6+6=0-6 + 6 = 0. The inputs with output (1,0,1)(1, 0, 1) are the vectors (0,0,1)+t(−2,1,0)(0, 0, 1) + t(-2, 1, 0), a parallel line that misses the origin.

Nullity

Definition The nullity of AA is dim⁡Null⁡A\dim \operatorname{Null} A. If AA is a real m×nm \times n matrix of rank rr, then

dim⁡Null⁡A=n−r.\dim \operatorname{Null} A = n - r.

Proof. An echelon form of AA has rr pivot columns, so Ax=0A\mathbf{x} = \mathbf{0} has n−rn - r free variables. For each free variable, set it to 11 and the other free variables to 00, and solve for the pivot variables. This gives n−rn - r vectors in Null⁡A\operatorname{Null} A. Each one has a 11 in its own free position and 00 in the other free positions, so a zero combination of them forces every coefficient to be 00, and they are independent. They also span. Subtracting from a solution the combination of them whose coefficients are its own free entries leaves a solution whose free entries are all 00, and the reduced equations then make its pivot entries 00 as well. When r=nr = n there are no free variables, the null space is {0}\{\mathbf{0}\}, and its basis is the empty list.

In plain words Each free variable gives one independent direction of input changes that the matrix cannot detect. The nullity counts these directions, and the rank counts the pivot variables, the rest of the nn input coordinates.

Example Let

B=[13112613].B = \begin{bmatrix} 1 & 3 & 1 & 1 \\ 2 & 6 & 1 & 3 \end{bmatrix}.

The operation R2→R2−2R1R_2 \to R_2 - 2R_1 gives (0,0,−1,1)(0, 0, -1, 1), and then R2→−R2R_2 \to -R_2 and R1→R1−R2R_1 \to R_1 - R_2 give the reduced rows (1,3,0,2)(1, 3, 0, 2) and (0,0,1,−1)(0, 0, 1, -1). The pivots are in columns 1 and 3, so rank⁡B=2\operatorname{rank} B = 2 and the variables x2x_2, x4x_4 are free. Setting x2=1x_2 = 1, x4=0x_4 = 0 gives (−3,1,0,0)(-3, 1, 0, 0), and setting x2=0x_2 = 0, x4=1x_4 = 1 gives (−2,0,1,1)(-2, 0, 1, 1). These two vectors form a basis of Null⁡B\operatorname{Null} B, and the nullity is 4−2=24 - 2 = 2.

Left null space

Definition The left null space of a real m×nm \times n matrix AA is the null space of its transpose,

Null⁡A⊤={y∈Rm∣A⊤y=0},\begin{aligned} \operatorname{Null} A^{\top} = \{ & \mathbf{y} \in \mathbb{R}^m \\[0.4em] & \mid A^{\top}\mathbf{y} = \mathbf{0}\}, \end{aligned}

a subspace of Rm\mathbb{R}^m, the output space of AA. Transposing A⊤y=0A^{\top}\mathbf{y} = \mathbf{0} gives y⊤A=0⊤\mathbf{y}^{\top}A = \mathbf{0}^{\top}, with y\mathbf{y} on the left, which explains the name. So a vector y\mathbf{y} is in the left null space exactly when the combination y1y_1 times row 1 plus ⋯\cdots plus ymy_m times row mm of AA is the zero row. For every output AxA\mathbf{x},

y⊤(Ax)=(y⊤A)x=0.\mathbf{y}^{\top}(A\mathbf{x}) = (\mathbf{y}^{\top}A)\mathbf{x} = 0.

Hence if y⊤b≠0\mathbf{y}^{\top}\mathbf{b} \ne 0 for some y\mathbf{y} in Null⁡A⊤\operatorname{Null} A^{\top}, the system Ax=bA\mathbf{x} = \mathbf{b} has no solution.

In plain words A left null vector is a list of weights on the rows that cancels them completely. The same weights give a measurement of the output that is zero for every input, so a target with a nonzero measurement cannot be reached.

Example To solve M⊤y=0M^{\top}\mathbf{y} = \mathbf{0}, reduce

M⊤=[123246101].M^{\top} = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 0 & 1 \end{bmatrix}.

The operation R2→R2−2R1R_2 \to R_2 - 2R_1 gives a zero row and R3→R3−R1R_3 \to R_3 - R_1 gives (0,−2,−2)(0, -2, -2). Swapping these two rows, then R2→−12R2R_2 \to -\tfrac{1}{2}R_2 and R1→R1−2R2R_1 \to R_1 - 2R_2, leaves the reduced rows (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1). So y1=−y3y_1 = -y_3 and y2=−y3y_2 = -y_3, and with y3=sy_3 = s every solution is s(−1,−1,1)s(-1, -1, 1). The left null space of MM has basis (−1,−1,1)(-1, -1, 1), which says that minus row 1 minus row 2 plus row 3 of MM is the zero row. Every output w=Mx\mathbf{w} = M\mathbf{x} therefore satisfies −w1−w2+w3=0-w_1 - w_2 + w_3 = 0. The target (1,0,2)(1, 0, 2) gives −1−0+2=1-1 - 0 + 2 = 1, so Mx=(1,0,2)M\mathbf{x} = (1, 0, 2) has no solution.

Left nullity

Definition The left nullity of AA is dim⁡Null⁡A⊤\dim \operatorname{Null} A^{\top}. If AA is a real m×nm \times n matrix of rank rr, then

dim⁡Null⁡A⊤=m−r.\dim \operatorname{Null} A^{\top} = m - r.

This is the nullity count applied to the n×mn \times m matrix A⊤A^{\top}, which has mm columns and rank rr, because rank⁡A⊤=rank⁡A\operatorname{rank} A^{\top} = \operatorname{rank} A. The left nullity differs from the nullity n−rn - r whenever m≠nm \ne n. If y1,…,ym−r\mathbf{y}_1, \dots, \mathbf{y}_{m-r} is a basis of Null⁡A⊤\operatorname{Null} A^{\top}, then b\mathbf{b} lies in Col⁡A\operatorname{Col} A exactly when yi⊤b=0\mathbf{y}_i^{\top}\mathbf{b} = 0 for every ii. When r=mr = m there are no tests, and indeed Col⁡A\operatorname{Col} A has dimension mm, so it is all of Rm\mathbb{R}^m. When r<mr < m, the vectors b\mathbf{b} that pass all these tests form the null space of the (m−r)×m(m - r) \times m matrix with the independent rows yi⊤\mathbf{y}_i^{\top}. That null space has dimension m−(m−r)=rm - (m - r) = r and contains Col⁡A\operatorname{Col} A, which also has dimension rr, so the two subspaces are equal.

In plain words The left nullity counts the independent conditions that every reachable output must satisfy. When it is zero there are no conditions, and every target in Rm\mathbb{R}^m can be reached.

Example The matrix

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

has m=2m = 2, n=3n = 3 and rank 22. Its nullity is 3−2=13 - 2 = 1, with basis (−1,−1,1)(-1, -1, 1), and its left nullity is 2−2=02 - 2 = 0. Directly, the system A⊤y=0A^{\top}\mathbf{y} = \mathbf{0} reads y1=0y_1 = 0, y2=0y_2 = 0 and y1+y2=0y_1 + y_2 = 0, so only y=0\mathbf{y} = \mathbf{0} remains. The left null space is the zero subspace of R2\mathbb{R}^2, whose basis is the empty list, not the list containing 0\mathbf{0}. Every b\mathbf{b} in R2\mathbb{R}^2 is an output, even though one input direction is lost. For MM the left nullity is 3−2=13 - 2 = 1, so the single test −w1−w2+w3=0-w_1 - w_2 + w_3 = 0 decides exactly which targets are reachable.

Ambient space of a subspace

Definition A subspace WW of Rk\mathbb{R}^k has ambient space Rk\mathbb{R}^k, the space whose vectors it is made of. Its vectors, including the vectors of any basis of WW, have kk entries, and dim⁡W≤k\dim W \le k. For a real m×nm \times n matrix AA, the subspaces Row⁡A\operatorname{Row} A and Null⁡A\operatorname{Null} A have ambient space Rn\mathbb{R}^n, the input space, while Col⁡A\operatorname{Col} A and Null⁡A⊤\operatorname{Null} A^{\top} have ambient space Rm\mathbb{R}^m, the output space. Subspaces with different ambient spaces cannot be equal, whatever their dimensions.

In plain words Before asking whether a vector lies in a subspace, check that it has the right number of entries. The number of entries says where a vector lives, and the dimension says how much room the subspace takes up there.

Example The matrix

A=[123246]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{bmatrix}

has rank 11. Its column space is the line in R2\mathbb{R}^2 spanned by (1,2)(1, 2), and its row space is the line in R3\mathbb{R}^3 spanned by (1,2,3)(1, 2, 3). Both have dimension 11, yet they are different spaces. The null space is the plane x1+2x2+3x3=0x_1 + 2x_2 + 3x_3 = 0 in R3\mathbb{R}^3, with basis (−2,1,0)(-2, 1, 0), (−3,0,1)(-3, 0, 1), and the left null space is the line in R2\mathbb{R}^2 spanned by (−2,1)(-2, 1). That vector is a left null vector, since −2-2 times row 1 plus row 2 is the zero row. The product of AA with (−2,1)(-2, 1) is not even defined, because AA takes inputs with three entries.

Four fundamental subspaces

Definition The four fundamental subspaces of a real m×nm \times n matrix AA of rank rr are its column space, left null space, row space and null space.

SubspaceAmbient spaceDimension
Col⁡A\operatorname{Col} ARm\mathbb{R}^mrr
Null⁡A⊤\operatorname{Null} A^{\top}Rm\mathbb{R}^mm−rm - r
Row⁡A\operatorname{Row} ARn\mathbb{R}^nrr
Null⁡A\operatorname{Null} ARn\mathbb{R}^nn−rn - r

The dimensions in the output space add up to mm, and those in the input space add up to nn. Elimination gives all four bases. Take the pivot columns of AA for Col⁡A\operatorname{Col} A, the nonzero rows of an echelon form for Row⁡A\operatorname{Row} A, and the free-variable solutions of Ax=0A\mathbf{x} = \mathbf{0} and of A⊤y=0A^{\top}\mathbf{y} = \mathbf{0} for the two null spaces.

In plain words Two of the spaces describe outputs, what the matrix can reach and which conditions every output obeys. The other two describe inputs, what the rows can detect and which changes the matrix cannot see. Once the size of the matrix is known, one number, the rank, fixes all four dimensions.

Example For MM we have m=n=3m = n = 3 and r=2r = 2.

SubspaceBasisDimension
Col⁡M\operatorname{Col} M(1,2,3)(1, 2, 3), (1,0,1)(1, 0, 1)22
Null⁡M⊤\operatorname{Null} M^{\top}(−1,−1,1)(-1, -1, 1)11
Row⁡M\operatorname{Row} M(1,2,0)(1, 2, 0), (0,0,1)(0, 0, 1)22
Null⁡M\operatorname{Null} M(−2,1,0)(-2, 1, 0)11

All four lie in R3\mathbb{R}^3 only because MM is square. The first two are subspaces of the output space and the last two of the input space, and each basis is checked in its own role. The basis vector of the null space satisfies Mx=0M\mathbf{x} = \mathbf{0}, the basis vector of the left null space satisfies y⊤M=0⊤\mathbf{y}^{\top}M = \mathbf{0}^{\top}, and the column basis consists of columns of MM itself.

Check yourself

  1. Find a basis of Null⁡A\operatorname{Null} A and a basis of Null⁡A⊤\operatorname{Null} A^{\top} for the matrix below.
A=[1−3−26]A = \begin{bmatrix} 1 & -3 \\ -2 & 6 \end{bmatrix}
Show the answer

The second row is −2-2 times the first, so Ax=0A\mathbf{x} = \mathbf{0} reduces to x1−3x2=0x_1 - 3x_2 = 0. With x2=tx_2 = t free, the null space has basis (3,1)(3, 1). The transpose has rows (1,−2)(1, -2) and (−3,6)(-3, 6), so A⊤y=0A^{\top}\mathbf{y} = \mathbf{0} reduces to y1−2y2=0y_1 - 2y_2 = 0, and the left null space has basis (2,1)(2, 1). Check that AA times (3,1)(3, 1) is (3−3,−6+6)=(0,0)(3 - 3, -6 + 6) = (0, 0), and that 22 times row 1 plus row 2 is (2−2,−6+6)(2 - 2, -6 + 6), the zero row. Even for a square matrix the two null spaces can differ.

  1. A real 4 by 6 matrix AA has rank 44. Give the ambient space and the dimension of each of its four fundamental subspaces. Does Ax=bA\mathbf{x} = \mathbf{b} have a solution for every b\mathbf{b}, and can a solution be unique?
Show the answer

The column space lies in R4\mathbb{R}^4 with dimension 44, and the left null space lies in R4\mathbb{R}^4 with dimension 4−4=04 - 4 = 0, so it is {0}\{\mathbf{0}\} with the empty basis. The row space lies in R6\mathbb{R}^6 with dimension 44, and the null space lies in R6\mathbb{R}^6 with dimension 6−4=26 - 4 = 2. A subspace of R4\mathbb{R}^4 of dimension 44 is all of R4\mathbb{R}^4, so every b\mathbf{b} is reachable. No solution is unique, because each solution plus any nonzero vector of the two-dimensional null space is another solution.

  1. For the matrix below, find a basis of the left null space and the nullity. Then decide, without solving for an input, whether c=(1,0,1)\mathbf{c} = (1, 0, 1) and b=(1,1,1)\mathbf{b} = (1, 1, 1) lie in Col⁡A\operatorname{Col} A.
A=[122103]A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \\ 0 & 3 \end{bmatrix}
Show the answer

The transpose has rows (1,2,0)(1, 2, 0) and (2,1,3)(2, 1, 3). The operation R2→R2−2R1R_2 \to R_2 - 2R_1 gives (0,−3,3)(0, -3, 3), then R2→−13R2R_2 \to -\tfrac{1}{3}R_2 gives (0,1,−1)(0, 1, -1) and R1→R1−2R2R_1 \to R_1 - 2R_2 gives (1,0,2)(1, 0, 2). So y1=−2y3y_1 = -2y_3 and y2=y3y_2 = y_3, and the single vector y=(−2,1,1)\mathbf{y} = (-2, 1, 1) forms a basis of the left null space. Indeed −2-2 times row 1 plus row 2 plus row 3 is (−2+2+0,−4+1+3)=(0,0)(-2 + 2 + 0, -4 + 1 + 3) = (0, 0). The transpose has two pivots, so rank⁡A=2\operatorname{rank} A = 2 and the nullity of AA is 2−2=02 - 2 = 0. For c\mathbf{c} the test gives y⊤c=−2+0+1=−1≠0\mathbf{y}^{\top}\mathbf{c} = -2 + 0 + 1 = -1 \ne 0, so c\mathbf{c} is not in Col⁡A\operatorname{Col} A. For b\mathbf{b} it gives −2+1+1=0-2 + 1 + 1 = 0. The left nullity is 3−2=13 - 2 = 1, so this single test is exact and b\mathbf{b} is in Col⁡A\operatorname{Col} A. In fact the input (13,13)(\tfrac{1}{3}, \tfrac{1}{3}) gives the output (1,1,1)(1, 1, 1).

How this lesson connects

Where this leads in Linear Algebra II