第 10 章
四个基本子空间
一个 m×n 矩阵自带四个子空间:列空间、零空间、行空间与左零空间;它们的基、维数与所在的 R^m / R^n 构成线性代数的主干。
The Four Fundamental Subspaces
Every m by n matrix carries four subspaces — column, null, row, and left null — and their bases and dimensions form the backbone of linear algebra.
篇内目录
- An error corrected, and the lecture it opens
- Timeline
- The four subspaces
- Where the spaces sit
- Four bases, four dimensions
- Column space: the pivot columns
- Row space: the first rows of
- Null space: the special solutions
- Left null space: via the elimination matrix
- Why the dimensions split this way
- Row rank equals column rank
- Matrices are themselves vectors
- Intersection and sum
- Takeaways
- Check your understanding
- How this connects to the course
一个错误的修正,也是本讲的引子
上一讲结尾,Strang 想给 换一组基,取了
他以为第三个向量跳出了前两个张成的平面。课后一位学生指出:这组向量相关。
验证的方法不是硬解组合系数,而是看矩阵
第一行和第二行完全相同,所以 不可逆,列必然相关。直接算也确实如此:
这个修正引出本讲的核心:行之间的关系会决定列的独立性。要讲清这件事,需要把行也当成一个空间来看。
时间轴
| 时间 | 内容 |
|---|---|
| 0:09 | 开场:上一讲的四个子空间图 |
| 2:02 | 一个学生的修正:列空间与行空间并不相同 |
| 3:45 | 四个子空间各自的定义 |
| 5:26 | 与 同处 还是 |
| 8:54 | 零空间: 的全部解 |
| 10:38 | 中的两个子空间 |
| 14:05 | 列空间的一组基 |
| 17:27 | 行化简后行空间不变 |
| 19:15 | 零空间维数 |
| 21:03 | 的列空间就是行空间 |
| 28:02 | 最简行阶梯形给出最干净的基 |
| 35:01 | 最简形的主元列构成单位阵 |
| 36:51 | 消元矩阵 与左零空间 |
| 42:03 | 不求转置也能得到行空间的基 |
| 43:43 | 矩阵空间 本身也是向量空间 |
| 45:26 | 矩阵空间上的加法与数乘 |
| 48:57 | 右端项与解的关系预告 |
四个子空间
图:四个基本子空间:维数、基与两组正交关系。
对 矩阵 :
| 子空间 | 记号 | 定义 | 所在空间 | 维数 |
|---|---|---|---|---|
| 列空间 | 所有列的线性组合 | |||
| 零空间 | 所有满足 的 | |||
| 行空间 | 所有行的线性组合 | |||
| 左零空间 | 所有满足 的 |
行空间写成 ,只是把躺着的行向量转成列向量,方便沿用列空间的全部结论。左零空间的名字来自转置:
是一个行向量,从左边乘 ,所以叫左零空间。
四个空间的位置关系
在 里放行空间与零空间,它们的维数相加为 ;在 里放列空间与左零空间,维数相加为 。这两组空间分别把输入空间与输出空间「分干净」了——后面会看到,它们还是正交补。
四个基与四个维数
列空间:主元列
对 消元,找出主元所在的列。取原矩阵 的这些列,它们构成列空间的一组基,数量为 。
为什么必须是 的列而不是行简化形 的列?因为行变换保持行空间,却会改变列空间。 的列空间一般与 的不同。
行空间: 的前 行
行变换是行与行之间的线性组合,因此行空间不变。把 化成行简化形 后, 的非零行就是一组基。
更准确地说: 的前 行(非零行)构成行空间的基,维数为 。这也顺带证明了行秩等于列秩:两者都等于主元个数。
零空间:特殊解
对每个自由变量,令它取 1、其余自由变量取 0,解出主元变量,得到一个特殊解。共有 个,构成零空间的基。
左零空间:来自消元矩阵
左零空间的基不那么直观。做法是高斯-若尔当消元的「增广」版本:
其中 记录了所有行变换,满足
是 的。它的最后 行构成左零空间的一组基。
一个小例子
取
第二行是第一行的两倍,秩 。消元:,对应的消元矩阵
的最后 行是 。验证:
它确实是左零空间的一组基。直观含义是:第二行减去两倍第一行得到零行,这个系数组合就是左零空间里的向量。
维数为什么这样分配
四个维数满足两条加法关系:
第一条对应「 个变量 = 个主元变量 + 个自由变量」;第二条把同样的逻辑用在 上—— 是 ,有 列,所以主元与自由变量相加为 。
行秩等于列秩
这是本讲最重要的定理之一:
它解释了开头的错误:矩阵有两行相同,行空间维数至多为 2,因此列空间维数也至多为 2,三个列向量必然相关。
矩阵本身也可以构成向量空间
最后几分钟把「向量」的概念再拓宽一次。所有 矩阵构成一个向量空间 :矩阵可以相加、可以乘标量,零矩阵是零元素。注意这里不使用矩阵乘法——向量空间只要求加法与数乘。
于是可以讨论子空间:
| 子空间 | 约束 | 维数 |
|---|---|---|
| 全体 矩阵 | 无 | 9 |
| 对称矩阵 | 6 | |
| 上三角矩阵 | 时 | 6 |
| 对角矩阵 | 非对角元为 0 | 3 |
对角矩阵的基可以取三个「只有一个对角元为 1」的矩阵,因此维数为 3。
交与和
- 交 :既对称又上三角,只能是对角矩阵,维数 3。
- 并不是子空间(两条不同方向的直线并起来,连加法都不封闭)。
- 和 :任取一个对称矩阵加一个上三角矩阵,可以得到任意 矩阵,因此 ,维数 9。
维数满足
即 。这不是巧合,而是子空间维数的普遍公式。
本讲结论
- 每个矩阵自带四个子空间,分别住在 与 。
- 四个基: 的主元列、 的前 行、特殊解、 的最后 行。
- 四个维数:。
- 行秩等于列秩,这是「行约束列」的定量版本。
- 矩阵本身可以看作向量,从而拥有子空间、基与维数。
理解检验
1. 为什么列空间的基要取 的主元列,而不能取 的列?
参考答案:行变换保持行空间与零空间,却会改写列向量,因此 一般不成立。 的列已经被消元改过,用它们张成的是另一个空间。
的主元列则同时无关且张成 :行变换不改变列之间的线性关系,所以主元列在 中对应的列无关, 的主元列也无关;又因为 的每一列都是其主元列的组合,且组合系数在行变换前后不变,所以 的每一列也是 的主元列的同一组合。两组性质合起来, 的主元列构成 的基,个数为 。
2. 消元矩阵 的最后 行为什么是左零空间的基?
参考答案:由 可知 的第 行等于 的第 行左乘 。矩阵 只有前 行非零,第 到第 行全为零行,所以对这些行有
即 的最后 行都属于左零空间 (写成行向量)。它们线性无关,因为 可逆(它是若干初等矩阵的乘积,行列式非零)。而 ,所以这 个无关向量恰好构成一组基。
3. 一个 矩阵秩为 2,四个子空间的维数各是多少?它们分别住在哪个 ?
参考答案:。
| 子空间 | 维数 | 所在空间 |
|---|---|---|
| 列空间 | ||
| 零空间 | ||
| 行空间 | ||
| 左零空间 |
校验:,。注意列空间与左零空间都在 里,行空间与零空间都在 里。
4. 对称矩阵空间与上三角矩阵空间的交、和分别是什么?维数是否满足加法公式?
参考答案:在 矩阵空间中,设 为对称矩阵、 为上三角矩阵。
- 交 :既对称又上三角。上三角矩阵满足 时 ,对称性又要求 ,于是所有非对角元都为 ,只剩对角矩阵,。
- 和 :任取一个对称矩阵与一个上三角矩阵相加可以得到任意矩阵。一个构造是:对任意 ,把 的下三角部分(不含对角)单独拿出来,其转置是上三角的,两者相加恰好还原 的对角及以下部分;剩余部分用上三角补上。所以 ,。
代入公式
满足。
5. 如果一个矩阵有两行相同,你能立刻对它的秩说什么?
参考答案:两行相同意味着这两行线性相关,所以行空间维数至多为 ,由行秩等于列秩,
也就是说矩阵不是满行秩, 必有非零零空间(左零空间维数至少为 );若 是方阵,则 不可逆。对列的影响是:当 时列数不少于秩的上界,列必然相关——这正是本讲开头 例子中「第一行与第二行相同 三列相关」的道理。
与前后课程的关系
上一讲定义了无关、基与维数;这一讲把它们一次性用在矩阵的四个子空间上。下一讲继续拓宽「向量空间」的边界:矩阵空间、函数空间,以及秩一矩阵作为所有矩阵的积木。
An error corrected, and the lecture it opens
At the end of the previous lecture Strang tried to replace the standard basis of with
assuming the third vector stepped out of the plane spanned by the first two. A student pointed out that the three are dependent.
The check does not require solving for coefficients. Form the matrix
Rows one and two are identical, so is singular and its columns must be dependent. Direct calculation confirms
The lesson opens the lecture: relations among rows constrain the columns. To say that precisely, rows have to be treated as a space of their own.
Timeline
| Time | Topic |
|---|---|
| 0:09 | Opening: the four-subspace picture |
| 2:02 | A student's correction: column space is not row space |
| 3:45 | Definitions of the four subspaces |
| 5:26 | Which ambient space each subspace lives in |
| 8:54 | The null space as all solutions of |
| 10:38 | The two subspaces of |
| 14:05 | A basis for the column space |
| 17:27 | Row reduction preserves the row space |
| 19:15 | Null space dimension |
| 21:03 | The column space of is the row space |
| 28:02 | Reduced row echelon form gives the cleanest basis |
| 35:01 | Pivot columns of the reduced form form an identity block |
| 36:51 | The elimination matrix and the left null space |
| 42:03 | Row space bases without transposing |
| 43:43 | The matrix space is a vector space |
| 45:26 | Addition and scalar multiplication on matrix spaces |
| 48:57 | Looking ahead to the right-hand side |
The four subspaces
Figure:The four subspaces: dimensions, bases and orthogonality。
For an matrix :
| Subspace | Notation | Definition | Lives in | Dimension |
|---|---|---|---|---|
| Column space | All combinations of the columns | |||
| Null space | All with | |||
| Row space | All combinations of the rows | |||
| Left null space | All with |
Writing the row space as just stands the rows up so that every fact proved for column spaces applies. The left null space earns its name by transposing:
Now is a row vector multiplying from the left.
Where the spaces sit
In , the row space and null space have dimensions adding to . In , the column space and left null space have dimensions adding to . Each pair splits one ambient space completely — and, as later lectures show, each pair is an orthogonal complement.
Four bases, four dimensions
Column space: the pivot columns
Run elimination on and identify the pivot columns. Take those columns from the original ; they form a basis, and there are of them.
Why not the pivot columns of the reduced form ? Because row operations preserve the row space but change the column space. The columns of generally span a different space.
Row space: the first rows of
Row operations combine rows with rows, so the row space is unchanged. Once is reduced to , the nonzero rows of form a basis.
More precisely, the first (nonzero) rows of form a basis of the row space. This also proves row rank equals column rank: both count pivots.
Null space: the special solutions
For each free variable, set it to 1 and the other free variables to 0, then solve for the pivot variables. The resulting vectors form a basis of the null space.
Left null space: via the elimination matrix
This basis is less immediate. Use the augmented Gauss-Jordan form:
where records every row operation and satisfies
is . Its last rows form a basis of the left null space.
A small example
Take
The second row is twice the first, so . Elimination does , and the elimination matrix is
Its last row is . Check:
So is a basis of the left null space. The meaning is concrete: row two minus twice row one gives the zero row, and those coefficients are the vector.
Why the dimensions split this way
The four dimensions satisfy two additive relations:
The first mirrors " variables = pivot variables + free variables". The second applies the same logic to , which is and therefore has columns.
Row rank equals column rank
This is the central theorem of the lecture:
It resolves the opening error: two identical rows mean the row space has dimension at most 2, so the column space does too, and three columns must be dependent.
Matrices are themselves vectors
The last minutes widen the definition once more. All matrices form a vector space : they can be added and scaled, and the zero matrix is the zero element. Note that matrix multiplication is not used — a vector space only needs addition and scalar multiplication.
Subspaces follow:
| Subspace | Constraint | Dimension |
|---|---|---|
| All matrices, | none | 9 |
| Symmetric matrices, | 6 | |
| Upper triangular matrices, | for | 6 |
| Diagonal matrices, | all off-diagonal entries zero | 3 |
A basis of is the three matrices with a single 1 on one diagonal position, so the dimension is 3.
Intersection and sum
- Intersection : symmetric and upper triangular forces diagonal, dimension 3.
- Union is not a subspace: two differently directed lines fail closure under addition.
- Sum : any symmetric plus any upper triangular can produce an arbitrary matrix, so , dimension 9.
Dimensions obey
that is, . This is not a coincidence but a general formula for subspaces.
Takeaways
- Every matrix carries four subspaces, living in and .
- Bases: pivot columns of , first rows of , special solutions, last rows of .
- Dimensions: , , , .
- Row rank equals column rank — the quantitative form of "rows constrain columns".
- Matrices can be treated as vectors, with their own subspaces, bases, and dimensions.
Check your understanding
1. Why must a column-space basis use the pivot columns of rather than the columns of ?
Reference answer: Row operations preserve the row space and the null space but rewrite the columns, so generally . The columns of have been altered by elimination and span a different space.
The pivot columns of are both independent and spanning for : row operations do not change linear relations among columns, so the pivot columns of are independent because their counterparts in are; and every column of is a combination of its pivot columns with coefficients unchanged by the row operations, so every column of is the same combination of the pivot columns of . Hence the pivot columns of form a basis of , and there are of them.
2. Why do the last rows of the elimination matrix form a basis of the left null space?
Reference answer: From , the -th row of equals the -th row of times . Since has only nonzero rows, rows are zero, so for each of them
meaning the last rows of (read as row vectors) lie in . They are linearly independent because is invertible, being a product of elementary matrices with nonzero determinant. Since , these independent vectors form a basis.
3. For a matrix of rank 2, give the four dimensions and the ambient space of each.
Reference answer: , , .
| Subspace | Dimension | Ambient space |
|---|---|---|
| Column space | ||
| Null space | ||
| Row space | ||
| Left null space |
Check: and . The column and left null spaces live in ; the row and null spaces live in .
4. What are the intersection and sum of the symmetric and upper triangular matrix spaces? Do the dimensions satisfy the formula?
Reference answer: In the space of matrices, let be symmetric and upper triangular.
- Intersection : a matrix that is both. Upper triangular means for ; symmetry forces , so all off-diagonal entries vanish. The intersection is the diagonal matrices, of dimension .
- Sum : every matrix is a sum of a symmetric and an upper triangular matrix. One construction: for an arbitrary , take the strictly lower triangular part separately; its transpose is upper triangular, and adding the two recovers the diagonal-and-below part of ; the rest is upper triangular. Hence and .
Substituting,
so the formula holds.
5. If a matrix has two identical rows, what can you say immediately about its rank?
Reference answer: Two identical rows are linearly dependent, so the row space has dimension at most ; since row rank equals column rank,
So the matrix is not of full row rank, has a nontrivial null space (left null space of dimension at least ), and if is square it is singular. On the column side: when , the columns are necessarily dependent — exactly the lesson of the opening example, where identical first and second rows forced the three columns to be dependent.
How this connects to the course
The previous lecture defined independence, basis, and dimension. This one applies them to a matrix's four subspaces. The next lecture widens "vector space" again: matrix spaces, function spaces, and rank-one matrices as the building blocks of all matrices.