Linear Algebra / Unit 4, Vector Spaces / Topic 4.4
Unit 4. Vector Spaces
This topic describes the four subspaces that belong to a matrix: the column space, the null space, the row space, and the left null space. Their dimensions are fixed by one number, the rank, and together they give a complete account of the system Ax = b.
You need Topics 2.3, 3.3, 4.1, 4.2, and 4.3 for this topic.
The matrix of Topic 2.3 is used throughout this topic. Its reduced row echelon form R has two pivots, in columns 1 and 3.
A = 121243364 R = 120001000An m by n matrix takes vectors in ℝⁿ and gives vectors in ℝm. Two of its four subspaces are parts of ℝⁿ, and the other two are parts of ℝm. For this matrix m = 3 and n = 3.
The column space is the span of the columns of A. It is the set of all vectors Ax, and it is a subspace of ℝm. From Topic 4.3, the columns of A that have pivots are a basis.
For the example, the pivots are in columns 1 and 3, so a basis of the column space is (1, 2, 3) and (1, 3, 4). The column space is a plane in ℝ³. Column 2 is 2 times column 1, so it adds nothing.
The null space is the set of solutions of Ax = 0. It is a subspace of ℝⁿ. A basis comes from the general solution, with one basis vector for each free variable.
For the example, R gives x + 2y = 0 and z = 0, with y free. The solutions are the multiples of (−2, 1, 0). The null space is a line in ℝ³.
The row space is the span of the rows of A. It is a subspace of ℝⁿ. Because the rows of A are the columns of AT, the row space is the column space of AT.
Row operations replace rows by combinations of rows, so they do not change the row space. The rows of R that are not zero are a basis of it.
For the example, a basis of the row space is (1, 2, 0) and (0, 0, 1). The row space is a plane in ℝ³.
The left null space is the null space of AT: the set of vectors y with ATy = 0. It is a subspace of ℝm. The name comes from writing the same equation as yT A = 0, with y on the left of A. This equation says that the combination of the rows of A with the coefficients in y is the zero row.
For the example, reducing AT gives the solutions y = t(−1, −1, 1). So −(row 1) − (row 2) + (row 3) is the zero row: the third row of A is the sum of the first two. The left null space is a line in ℝ³.
The rank r of a matrix is its number of pivots. The four dimensions follow from it.
| Subspace | Part of | Dimension | In the example |
|---|---|---|---|
| Column space | ℝm | r | 2 |
| Left null space | ℝm | m − r | 1 |
| Row space | ℝⁿ | r | 2 |
| Null space | ℝⁿ | n − r | 1 |
The statement r + (n − r) = n is called the rank-nullity theorem. Each of the n columns either has a pivot or belongs to a free variable. The dimension of the null space is called the nullity.
Try it: the four subspaces of a matrix
Type numbers into the matrix, or choose an example. The readout shows the reduced row echelon form, the rank, and a basis of each of the four subspaces.
The equation Ax = 0 says that the dot product of each row of A with x is 0. So each vector in the null space is orthogonal to each row, and to each combination of the rows.
The null space is orthogonal to the row space. In the same way, the left null space is orthogonal to the column space.
Check this for the example.
In ℝ³, the row space of the example is a plane, and the null space is the line through the origin that is perpendicular to that plane.
For the example, the left null space is spanned by (−1, −1, 1), so the system has a solution exactly when −b₁ − b₂ + b₃ = 0. The right side (4, 9, 13) of Topic 2.3 passes this test, and the right side (4, 9, 14) does not.
| Rank | Meaning | Solutions of Ax = b |
|---|---|---|
| r = n | The columns are independent, and the null space contains only the zero vector | At most one |
| r = m | The column space is all of ℝm | At least one, for each b |
| r = m = n | The matrix is square and has an inverse | Exactly one, for each b |
The rank can never be larger than m or larger than n.
| Subspace | Definition | A basis |
|---|---|---|
| Column space | All vectors Ax | The columns of A that have pivots |
| Null space | All x with Ax = 0 | One vector for each free variable |
| Row space | All combinations of the rows of A | The rows of R that are not zero |
| Left null space | All y with ATy = 0 | One vector for each free variable of AT |
Work each problem on paper first. Then open the answer to check your work.
dimension of the column space = 2the rank rdimension of the row space = 2the rank rdimension of the null space = 5 − 2 = 3n − rdimension of the left null space = 3 − 2 = 1m − r
Column 2 is 2 times column 1, so the only pivot is in column 1. A basis of the column space is (1, 2, 3).
The equation x + 2y = 0 has y free. A basis of the null space is (−2, 1).
m − r = 3 − 1 = 2.
A vector y is in the left null space when y₁ + 2y₂ + 3y₃ = 0. One choice is (2, −1, 0).
There are 3 pivots, so the rank is 3.
A basis of the row space is the three rows (1, 0, 3, 0), (0, 1, −1, 0), and (0, 0, 0, 1).
The third unknown is free. With that unknown equal to t, the solutions are t(−3, 1, 1, 0). A basis of the null space is (−3, 1, 1, 0).
No. The rank is at most 4, so the dimension of the null space is at least 6 − 4 = 2.
The column space and the row space are all of ℝ⁵.
The null space and the left null space contain only the zero vector. The matrix has an inverse.
The instruction np.linalg.matrix_rank gives the rank of a matrix, and A.T is the transpose of A. The code below uses the matrix of this topic.
Python
Both ranks are 2. The column space and the row space have the same dimension.
Change the matrix to any other 3 by 3 matrix and run the code again. The two ranks are equal each time.
The expression A.shape gives the number of rows and the number of columns. The number of rows is A.shape[0], and the number of columns is A.shape[1]. The code below stores them under the names m and n, and prints the dimensions of the column space and the null space.
Python
The results are 2 and 1.
The next box has a matrix with 3 rows and 4 columns. Replace the 0 in the line that starts with left with an expression that gives the dimension of the left null space. Use the names m, n, and r.
Python
This matrix has the rank 2, because its second row is 2 times its first row. Its null space has the dimension 4 − 2 = 2, and its left null space has the dimension 3 − 2 = 1.
The @ sign multiplies a matrix by a vector. The code below checks that (−2, 1, 0) is in the null space of the matrix of this topic.
Python
The result is [0 0 0]. Each component of the result is the dot product of one row of A with x, so x is orthogonal to each row.
A vector y is in the left null space of A when ATy = 0. The code below checks the vector (−1, −1, 1) from Part 5.
Python
The result is [0 0 0].
The next box has the matrix of Practice Problem 2. Replace the zeros so that y is a vector of its left null space, other than the zero vector.
Python
From Part 8, the system Ax = b has a solution exactly when b is orthogonal to the left null space. For the matrix of this topic, the test is the dot product of (−1, −1, 1) with b. The instruction np.dot calculates a dot product.
Python
The first result is 0, so the system with the right side (4, 9, 13) has a solution. The second result is 1, so the system with the right side (4, 9, 14) has none.
In the next box, change the third component of b so that the system has a solution. Do not change the first two components.
Python
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. A is a 4 by 7 matrix with the rank 3. Find the dimension of its null space.
The null space is part of ℝ⁷, and its dimension is n − r = 7 − 3 = 4.
2. For the same 4 by 7 matrix with the rank 3, find the dimension of its left null space.
The left null space is part of ℝ⁴, and its dimension is m − r = 4 − 3 = 1.
3. The null space of a matrix A is orthogonal to which subspace?
The equation Ax = 0 says that the dot product of each row of A with x is 0. So each vector in the null space is orthogonal to each vector in the row space.
4. The system Ax = b has a solution exactly when b is in which subspace?
The product Ax is a combination of the columns of A. So Ax = b can be solved exactly when b is a combination of the columns.
5. Find the rank of 123246101.
The second row is 2 times the first row, so elimination turns it into a row of zeros. The first row and the third row are independent, so there are two pivots.