第 07 章

解 Ax = 0:主元变量、自由变量与特殊解

消元把矩阵化为阶梯形;主元列的个数就是秩 r,剩下 n-r 个自由变量。给每个自由变量取 1、其余取 0,就得到零空间的一组特殊解。

Solving Ax = 0: Pivot Variables, Free Variables, and Special Solutions

Elimination produces echelon form; the number of pivot columns is the rank r, leaving n-r free variables. Set each free variable to 1 and the rest to 0 to get the special solutions spanning the nullspace.

首发于 2009.05.07中 / EN
系统课程linear-algebranullspacerankrrefspecial-solutions
语言
字号
目录
篇内目录

从定义到算法

上一讲定义了零空间 N(A)={x∣Ax=0}N(A)=\{\mathbf{x}\mid A\mathbf{x}=\mathbf{0}\},但没有说怎么把它算出来。这一讲给出算法,核心是消元。

一个关键事实:消元不改变零空间。行交换、某行减去另一行的倍数,都是合法的方程变换,解集不变。但消元会改变列空间——这一点要记清楚。

时间轴

时间内容
1:22主元与秩
3:55消元产生零行
4:59主元列与自由列
6:12阶梯形
6:48秩
8:13找主元与自由变量
9:22给自由变量赋值 11
10:17回代求主元变量
12:14零空间是一条直线
15:10特殊解
17:28主元变量与自由变量的个数
19:25最简行阶梯形 RR
21:53向上消元化为 RR
29:54零空间矩阵
33:08第二个例子
37:06主元列数等于秩
41:28解中出现的单位矩阵
42:39−F-F 的来源

例子:一个 3×43\times4 矩阵

A=[1222246836810].A= \begin{bmatrix} 1&2&2&2\\ 2&4&6&8\\ 3&6&8&10 \end{bmatrix}.

先观察:

  • 第二列是第一列的 22 倍,不独立;
  • 第三行是第一行与第二行之和,行之间也不独立。

这些都应该由消元自动发现。

消元

第一步:用第一个主元 11 消去下方。

R2←R2−2R1=[0,0,2,4],R3←R3−3R1=[0,0,2,4].\begin{aligned} R_2 &\leftarrow R_2-2R_1=[0,0,2,4],\\ R_3 &\leftarrow R_3-3R_1=[0,0,2,4]. \end{aligned}

第二步:第二列的主元位置是 00,下面也是 00,这一列没有主元。不停下,直接看第三列。

第三列在第二行的值是 22,这就是第二个主元。用 R3←R3−R2R_3\leftarrow R_3-R_2 消去下方:

R3=[0,0,2,4]−[0,0,2,4]=[0,0,0,0].R_3=[0,0,2,4]-[0,0,2,4]=[0,0,0,0].

得到阶梯形

U=[122200240000].U= \begin{bmatrix} 1&2&2&2\\ 0&0&2&4\\ 0&0&0&0 \end{bmatrix}.

一共只有 两个主元。这个数叫矩阵的秩:

r=主元个数=2.r=\text{主元个数}=2.

第三行变成全零,说明原来的第三行是前两行的线性组合。

主元列与自由列

  • 主元在第 1、3 列 → x1,x3x_1,x_3 是主元变量;
  • 第 2、4 列没有主元 → x2,x4x_2,x_4 是自由变量。

自由变量的个数是

n−r=4−2=2.n-r=4-2=2.

「自由」的意思是:可以任意赋值,剩下的主元变量由方程唯一确定。

一句话总结: 消元找到 rr 个真正独立的方程;剩下 n−rn-r 个方向可以自由选择,它们张成零空间。

特殊解:给自由变量取 1 和 0

第一个特殊解:x2=1, x4=0x_2=1,\ x_4=0

Ux=0U\mathbf{x}=\mathbf{0} 写回方程:

x1+2x2+2x3+2x4=0,2x3+4x4=0.\begin{aligned} x_1+2x_2+2x_3+2x_4 &= 0,\\ 2x_3+4x_4 &= 0. \end{aligned}

代入 x2=1, x4=0x_2=1,\ x_4=0:

第二式给出 2x3=02x_3=0,所以 x3=0x_3=0。

第一式给出 x1+2=0x_1+2=0,所以 x1=−2x_1=-2。

s1=[−2100].\mathbf{s}_1=\begin{bmatrix}-2\\1\\0\\0\end{bmatrix}.

它说的正是「第二列是第 1 列的 2 倍」:−2c1+c2=0-2\mathbf{c}_1+\mathbf{c}_2=\mathbf{0}。

第二个特殊解:x2=0, x4=1x_2=0,\ x_4=1

第二式:2x3+4=02x_3+4=0,所以 x3=−2x_3=-2。

第一式:x1+2(−2)+2(1)=0x_1+2(-2)+2(1)=0,所以 x1=2x_1=2。

s2=[20−21].\mathbf{s}_2=\begin{bmatrix}2\\0\\-2\\1\end{bmatrix}.

验证它对应列的关系:

2c1−2c3+c4=0.2\mathbf{c}_1-2\mathbf{c}_3+\mathbf{c}_4=\mathbf{0}.

整个零空间

N(A)={c1[−2100]+c2[20−21] | c1,c2∈R}.N(A)=\left\{c_1\begin{bmatrix}-2\\1\\0\\0\end{bmatrix} +c_2\begin{bmatrix}2\\0\\-2\\1\end{bmatrix} \ \middle|\ c_1,c_2\in R\right\}.

这是 R4R^4 中的一个二维子空间。两个特殊解就是它的一组基。

化简到最简行阶梯形 RR

阶梯形 UU 已经够用,但还可以继续化简,得到最简行阶梯形(reduced row echelon form, rref):

  1. 用向上消元把主元上方的元素也清零;
  2. 把每个主元除以自身,使主元变成 11。

对本例:

  • R1←R1−R2R_1\leftarrow R_1-R_2:第一行变成 [1,2,0,−2][1,2,0,-2];
  • R2←R2/2R_2\leftarrow R_2/2:第二行变成 [0,0,1,2][0,0,1,2]。
R=[120−200120000].R= \begin{bmatrix} 1&2&0&-2\\ 0&0&1&2\\ 0&0&0&0 \end{bmatrix}.

RR 的结构非常规整:

  • 主元行列交叉处是一个单位矩阵;
  • 其余非零部分 FF 位于自由列;
  • 下方是零行。
R=[IF00],F=[2−202].R=\begin{bmatrix}I&F\\0&0\end{bmatrix}, \qquad F=\begin{bmatrix}2&-2\\0&2\end{bmatrix}.

从 RR 直接读出零空间

把 Rx=0R\mathbf{x}=\mathbf{0} 按块写:

[IF][xpivotxfree]=0.\begin{bmatrix}I&F\end{bmatrix} \begin{bmatrix}\mathbf{x}_{\text{pivot}}\\ \mathbf{x}_{\text{free}}\end{bmatrix} =\mathbf{0}.

即

xpivot+Fxfree=0  ⟹  xpivot=−Fxfree.\mathbf{x}_{\text{pivot}}+F\mathbf{x}_{\text{free}}=\mathbf{0} \;\Longrightarrow\; \mathbf{x}_{\text{pivot}}=-F\mathbf{x}_{\text{free}}.

如果给自由变量取单位矩阵的值(第一个取 11、其余取 00,然后轮换),就得到零空间矩阵

N=[−FI]=[−22100−201].N=\begin{bmatrix}-F\\ I\end{bmatrix} = \begin{bmatrix} -2&2\\ 1&0\\ 0&-2\\ 0&1 \end{bmatrix}.

两列正是前面求出的 s1,s2\mathbf{s}_1,\mathbf{s}_2。所以「特殊解」不是技巧,而是把 −F-F 搬到了主元变量的位置。

第二个例子:转置矩阵

取

AT=[1232462682810].A^T= \begin{bmatrix} 1&2&3\\ 2&4&6\\ 2&6&8\\ 2&8&10 \end{bmatrix}.

这是 4×34\times3,xx 只有三个分量。

预期:前两列独立,第三列等于前两列之和,所以秩仍然是 22,自由变量 3−2=13-2=1 个。

消元

第一个主元 11:

R2−2R1=[0,0,0],R3−2R1=[0,2,2],R4−2R1=[0,4,4].R_2-2R_1=[0,0,0],\quad R_3-2R_1=[0,2,2],\quad R_4-2R_1=[0,4,4].

第二列的主元位置是 00,但下面有 22,于是交换第二、三行:

[123022000044].\begin{bmatrix} 1&2&3\\ 0&2&2\\ 0&0&0\\ 0&4&4 \end{bmatrix}.

再用第二行消去第四行:R4−2R2=[0,0,0]R_4-2R_2=[0,0,0]。得到

U=[123022000000],r=2.U= \begin{bmatrix} 1&2&3\\ 0&2&2\\ 0&0&0\\ 0&0&0 \end{bmatrix}, \qquad r=2.

主元列是 1、2,自由列是 3。

零空间

令 x3=1x_3=1。第二式:

2x2+2=0  ⟹  x2=−1.2x_2+2=0 \;\Longrightarrow\; x_2=-1.

第一式:

x1+2(−1)+3=0  ⟹  x1=−1.x_1+2(-1)+3=0 \;\Longrightarrow\; x_1=-1. N(AT)={c[−1−11] | c∈R}.N(A^T)=\left\{c\begin{bmatrix}-1\\-1\\1\end{bmatrix}\ \middle|\ c\in R\right\}.

这是一条直线。

化简到 RR

用第一行减去第二行,再把第二行除以 22:

R=[101011000000]=[IF00],F=[11].R= \begin{bmatrix} 1&0&1\\ 0&1&1\\ 0&0&0\\ 0&0&0 \end{bmatrix} =\begin{bmatrix}I&F\\0&0\end{bmatrix}, \qquad F=\begin{bmatrix}1\\1\end{bmatrix}.

零空间矩阵是

N=[−FI]=[−1−11].N=\begin{bmatrix}-F\\I\end{bmatrix} =\begin{bmatrix}-1\\-1\\1\end{bmatrix}.

秩的一个基本事实

AA 与 ATA^T 的秩相同。本例中原来 AA 是 3×43\times4、秩 22;ATA^T 是 4×34\times3、秩仍是 22。

秩等于主元个数,也等于列空间中独立方向的个数。这个数会在下一讲与四个基本子空间一起被完整解释。

本讲结论

  • 消元不改变零空间,但会改变列空间。
  • 秩 rr = 主元个数 = 主元列数。
  • 自由变量有 n−rn-r 个;每个自由变量对应一个特殊解。
  • 特殊解的做法:一个自由变量取 11,其余取 00,再回代求主元变量。
  • 零空间是所有特殊解的线性组合,维数为 n−rn-r。
  • 最简行阶梯形 R=[I F;0 0]R=[I\ F;0\ 0],零空间矩阵直接是 [−F;I][-F;I]。
  • AA 与 ATA^T 的秩相同。

理解检验

1. 对第一个例子,写出秩、主元列、自由列,并解释第三行为什么会变成零行。

参考答案:秩 r=2r=2。主元列是第 1、3 列,所以主元变量是 x1,x3x_1,x_3;自由列是第 2、4 列,自由变量是 x2,x4x_2,x_4,共 n−r=4−2=2n-r=4-2=2 个。 第三行变成零行的原因是它本来就是前两行的组合:

[3,6,8,10]=[1,2,2,2]+[2,4,6,8],[3,6,8,10]=[1,2,2,2]+[2,4,6,8],

即 R3=R1+R2R_3=R_1+R_2。消元先做 R3←R3−3R1R_3\leftarrow R_3-3R_1,再做 R3←R3−R2R_3\leftarrow R_3-R_2,恰好把组合关系逐步减掉,最后整行归零。零行说明第三个方程没有提供新信息。

2. 用 RR 的块结构推导零空间矩阵 [−F;I][-F;I]。

参考答案:把 R=[I  F]R=[I\ \ F] 与 x=[xpivot;xfree]\mathbf{x}=[\mathbf{x}_{\text{pivot}};\mathbf{x}_{\text{free}}] 分块,方程 Rx=0R\mathbf{x}=\mathbf{0} 变成

I xpivot+F xfree=0  ⟹  xpivot=−F xfree.I\,\mathbf{x}_{\text{pivot}}+F\,\mathbf{x}_{\text{free}}=\mathbf{0} \;\Longrightarrow\; \mathbf{x}_{\text{pivot}}=-F\,\mathbf{x}_{\text{free}}.

自由变量可以任意取值,所以零空间由「自由变量决定主元变量」这一条规则完全描述。依次让 xfree\mathbf{x}_{\text{free}} 取单位矩阵的各列(第一个自由变量取 1、其余取 0,再轮换),对应的 xpivot=−F\mathbf{x}_{\text{pivot}}=-F 的相应列,把两者叠起来就得到

N=[−FI].N=\begin{bmatrix}-F\\ I\end{bmatrix}.

它的每一列就是一个特殊解,列数 n−rn-r 就是零空间的维数。本例中 F=[2−202]F=\begin{bmatrix}2&-2\\0&2\end{bmatrix},所以 N=[−22100−201]N=\begin{bmatrix}-2&2\\1&0\\0&-2\\0&1\end{bmatrix},两列正是 s1,s2\mathbf{s}_1,\mathbf{s}_2。

3. 第二个例子中,为什么交换行之后秩仍然是 22?

参考答案:行交换只是改变方程的排列顺序,不改变方程组本身,等价于左乘一个可逆的排列矩阵,因此不会增加或减少主元的个数。交换前第二个主元位置是 00、下方有非零的 22,交换后主元变成 22,继续消元把第四行也消成零,最终仍只有两个主元:

U=[123022000000].U=\begin{bmatrix}1&2&3\\0&2&2\\0&0&0\\0&0&0\end{bmatrix}.

另外也可从行列两个角度看:这个矩阵来自 ATA^T,而 AA 的秩是 22,转置不改变秩,所以 ATA^T 的秩也是 22。

4. 如果 AA 是 5×75\times7 且秩为 33,零空间的维数是多少?

参考答案:n=7n=7(列数),r=3r=3(主元个数),自由变量个数为

n−r=7−3=4.n-r=7-3=4.

所以零空间 N(A)N(A) 是 R7R^7 中的四维子空间。直观上:7 个未知数里只有 3 个被独立方程约束住,剩下 4 个方向可以自由变动,每个方向对应一个特殊解。

5. 为什么「消元不改变零空间」但「消元改变列空间」?各举一个具体变化。

参考答案:零空间不变,因为每一种行操作(交换、某行减另一行的倍数、某行乘非零常数)都是可逆的方程变换:若 Ax=0A\mathbf{x}=\mathbf{0},则操作后仍然成立;反过来,把操作倒回去也能从 Ux=0U\mathbf{x}=\mathbf{0} 恢复 Ax=0A\mathbf{x}=\mathbf{0}。解集完全相同。 列空间会变,因为行操作是把行重新组合,列的摆法随之改变。本例中 AA 的第一列是 [1,2,3]T[1,2,3]^T,它显然在 C(A)C(A) 里;但 UU 的所有列第三分量都是 00,所以 C(U)C(U) 只含第三分量为 00 的向量,[1,2,3]T∉C(U)[1,2,3]^T\notin C(U)。可见 C(A)≠C(U)C(A)\neq C(U),尽管两者的零空间相同。记法是:行操作保零空间、改列空间;列操作则相反。

与前后课的关系

这一讲给出了零空间的完整算法。下一讲处理 Ax=bA\mathbf{x}=\mathbf{b}:先用消元判断是否有解,再写出「特解 + 零空间」的全部解,并引出四个基本子空间。

From definition to algorithm

The previous lecture defined the nullspace N(A)={x∣Ax=0}N(A)=\{\mathbf{x}\mid A\mathbf{x}=\mathbf{0}\} but did not compute it. This lecture supplies the algorithm, built on elimination.

One key fact: elimination does not change the nullspace. Swapping rows and subtracting a multiple of one row from another are legitimate equation operations, so the solution set is unchanged. Elimination does change the column space — a distinction worth keeping straight.

Timeline

TimeTopic
1:22Pivots and rank
3:55Elimination produces a zero row
4:59Pivot columns and free columns
6:12Echelon form
6:48The rank
8:13Finding pivots and free variables
9:22Setting a free variable to one
10:17Back substitution
12:14The null space is a line
15:10Special solutions
17:28Counting pivot and free variables
19:25Reduced row echelon form
21:53Eliminating upward to reach RR
29:54The null space matrix
33:08A second example
37:06The number of pivot columns equals the rank
41:28The identity block inside the solution
42:39Where the minus FF comes from

Example: a 3×43\times4 matrix

A=[1222246836810].A= \begin{bmatrix} 1&2&2&2\\ 2&4&6&8\\ 3&6&8&10 \end{bmatrix}.

Two things are visible before any computation:

  • column two is twice column one, so it is not independent;
  • row three is the sum of rows one and two, so the rows are not independent either.

Elimination should discover both.

Elimination

Step one: use the first pivot 11 to clear below it.

R2←R2−2R1=[0,0,2,4],R3←R3−3R1=[0,0,2,4].\begin{aligned} R_2 &\leftarrow R_2-2R_1=[0,0,2,4],\\ R_3 &\leftarrow R_3-3R_1=[0,0,2,4]. \end{aligned}

Step two: the pivot position in column two is 00, and so is everything below it. That column has no pivot. Do not stop; move to column three.

Column three has a 22 in row two, which becomes the second pivot. Use R3←R3−R2R_3\leftarrow R_3-R_2:

R3=[0,0,2,4]−[0,0,2,4]=[0,0,0,0].R_3=[0,0,2,4]-[0,0,2,4]=[0,0,0,0].

The echelon form is

U=[122200240000].U= \begin{bmatrix} 1&2&2&2\\ 0&0&2&4\\ 0&0&0&0 \end{bmatrix}.

There are only two pivots. That count is the rank:

r=number of pivots=2.r=\text{number of pivots}=2.

The zero row records that the original third row was a combination of the first two.

Pivot columns and free columns

  • Pivots are in columns 1 and 3, so x1,x3x_1,x_3 are pivot variables;
  • Columns 2 and 4 have no pivot, so x2,x4x_2,x_4 are free variables.

The number of free variables is

n−r=4−2=2.n-r=4-2=2.

"Free" means they may be assigned arbitrarily; the equations then determine the pivot variables uniquely.

One-sentence summary: Elimination finds the r genuinely independent equations; the remaining n-r directions are free choices, and they span the nullspace.

Special solutions: give free variables 1 and 0

First special solution: x2=1, x4=0x_2=1,\ x_4=0

Write Ux=0U\mathbf{x}=\mathbf{0} as equations:

x1+2x2+2x3+2x4=0,2x3+4x4=0.\begin{aligned} x_1+2x_2+2x_3+2x_4 &= 0,\\ 2x_3+4x_4 &= 0. \end{aligned}

Substitute x2=1, x4=0x_2=1,\ x_4=0:

The second equation gives 2x3=02x_3=0, so x3=0x_3=0.

The first gives x1+2=0x_1+2=0, so x1=−2x_1=-2.

s1=[−2100].\mathbf{s}_1=\begin{bmatrix}-2\\1\\0\\0\end{bmatrix}.

It says exactly that column two is twice column one: −2c1+c2=0-2\mathbf{c}_1+\mathbf{c}_2=\mathbf{0}.

Second special solution: x2=0, x4=1x_2=0,\ x_4=1

Second equation: 2x3+4=02x_3+4=0, so x3=−2x_3=-2.

First equation: x1+2(−2)+2(1)=0x_1+2(-2)+2(1)=0, so x1=2x_1=2.

s2=[20−21].\mathbf{s}_2=\begin{bmatrix}2\\0\\-2\\1\end{bmatrix}.

Check the column relation:

2c1−2c3+c4=0.2\mathbf{c}_1-2\mathbf{c}_3+\mathbf{c}_4=\mathbf{0}.

The whole nullspace

N(A)={c1[−2100]+c2[20−21] | c1,c2∈R}.N(A)=\left\{c_1\begin{bmatrix}-2\\1\\0\\0\end{bmatrix} +c_2\begin{bmatrix}2\\0\\-2\\1\end{bmatrix} \ \middle|\ c_1,c_2\in R\right\}.

This is a two-dimensional subspace of R4R^4. The two special solutions form a basis.

Reducing to RR

The echelon form UU is enough, but it can be cleaned further into reduced row echelon form (rref):

  1. eliminate upward so entries above each pivot are zero;
  2. divide each pivot row by its pivot so every pivot is 11.

For this example:

  • R1←R1−R2R_1\leftarrow R_1-R_2: row one becomes [1,2,0,−2][1,2,0,-2];
  • R2←R2/2R_2\leftarrow R_2/2: row two becomes [0,0,1,2][0,0,1,2].
R=[120−200120000].R= \begin{bmatrix} 1&2&0&-2\\ 0&0&1&2\\ 0&0&0&0 \end{bmatrix}.

The structure is now transparent:

  • the pivot rows and pivot columns contain an identity matrix;
  • the remaining nonzero part FF sits in the free columns;
  • zero rows lie below.
R=[IF00],F=[2−202].R=\begin{bmatrix}I&F\\0&0\end{bmatrix}, \qquad F=\begin{bmatrix}2&-2\\0&2\end{bmatrix}.

Reading the nullspace off RR

Write Rx=0R\mathbf{x}=\mathbf{0} in blocks:

[IF][xpivotxfree]=0.\begin{bmatrix}I&F\end{bmatrix} \begin{bmatrix}\mathbf{x}_{\text{pivot}}\\ \mathbf{x}_{\text{free}}\end{bmatrix} =\mathbf{0}.

So

xpivot+Fxfree=0  ⟹  xpivot=−Fxfree.\mathbf{x}_{\text{pivot}}+F\mathbf{x}_{\text{free}}=\mathbf{0} \;\Longrightarrow\; \mathbf{x}_{\text{pivot}}=-F\mathbf{x}_{\text{free}}.

Give the free variables the columns of the identity (one gets 11, the rest 00, then rotate), and the result is the nullspace matrix

N=[−FI]=[−22100−201].N=\begin{bmatrix}-F\\ I\end{bmatrix} = \begin{bmatrix} -2&2\\ 1&0\\ 0&-2\\ 0&1 \end{bmatrix}.

Its columns are exactly s1,s2\mathbf{s}_1,\mathbf{s}_2. The "special solutions" are not a trick; they are −F-F moved into the pivot-variable slots.

A second example: the transpose

Take

AT=[1232462682810].A^T= \begin{bmatrix} 1&2&3\\ 2&4&6\\ 2&6&8\\ 2&8&10 \end{bmatrix}.

This is 4×34\times3, so xx has three components.

Prediction: the first two columns are independent, the third is their sum, so the rank is still 22 and there is 3−2=13-2=1 free variable.

Elimination

First pivot 11:

R2−2R1=[0,0,0],R3−2R1=[0,2,2],R4−2R1=[0,4,4].R_2-2R_1=[0,0,0],\quad R_3-2R_1=[0,2,2],\quad R_4-2R_1=[0,4,4].

The pivot position in column two is 00, but there is a 22 below it, so swap rows two and three:

[123022000044].\begin{bmatrix} 1&2&3\\ 0&2&2\\ 0&0&0\\ 0&4&4 \end{bmatrix}.

Eliminate row four with row two: R4−2R2=[0,0,0]R_4-2R_2=[0,0,0]. Thus

U=[123022000000],r=2.U= \begin{bmatrix} 1&2&3\\ 0&2&2\\ 0&0&0\\ 0&0&0 \end{bmatrix}, \qquad r=2.

Pivot columns are 1 and 2; column 3 is free.

Nullspace

Set x3=1x_3=1. The second equation gives

2x2+2=0  ⟹  x2=−1.2x_2+2=0 \;\Longrightarrow\; x_2=-1.

The first gives

x1+2(−1)+3=0  ⟹  x1=−1.x_1+2(-1)+3=0 \;\Longrightarrow\; x_1=-1. N(AT)={c[−1−11] | c∈R}.N(A^T)=\left\{c\begin{bmatrix}-1\\-1\\1\end{bmatrix}\ \middle|\ c\in R\right\}.

This is a line.

Reducing to RR

Subtract row two from row one, then divide row two by 22:

R=[101011000000]=[IF00],F=[11].R= \begin{bmatrix} 1&0&1\\ 0&1&1\\ 0&0&0\\ 0&0&0 \end{bmatrix} =\begin{bmatrix}I&F\\0&0\end{bmatrix}, \qquad F=\begin{bmatrix}1\\1\end{bmatrix}.

The nullspace matrix is

N=[−FI]=[−1−11].N=\begin{bmatrix}-F\\I\end{bmatrix} =\begin{bmatrix}-1\\-1\\1\end{bmatrix}.

A basic fact about rank

AA and ATA^T have the same rank. The original AA is 3×43\times4 with rank 22; ATA^T is 4×34\times3 with rank 22.

Rank equals the number of pivots, and also the number of independent directions in the column space. The next lecture explains this fully alongside the four fundamental subspaces.

Takeaways

  • Elimination preserves the nullspace but changes the column space.
  • Rank rr = number of pivots = number of pivot columns.
  • There are n−rn-r free variables, one special solution per free variable.
  • To get a special solution, set one free variable to 11 and the rest to 00, then back-substitute.
  • The nullspace is all combinations of the special solutions, with dimension n−rn-r.
  • In rref, R=[I F;0 0]R=[I\ F;0\ 0], and the nullspace matrix is [−F;I][-F;I].
  • AA and ATA^T have the same rank.

Check your understanding

1. For the first example, state the rank, pivot columns, and free columns, and explain why row three became a zero row.

Reference answer: The rank is r=2r=2. The pivot columns are columns 1 and 3, so x1,x3x_1,x_3 are pivot variables; columns 2 and 4 are free, so x2,x4x_2,x_4 are free variables, n−r=4−2=2n-r=4-2=2 of them. Row three became zero because it was already a combination of the first two rows:

[3,6,8,10]=[1,2,2,2]+[2,4,6,8],[3,6,8,10]=[1,2,2,2]+[2,4,6,8],

i.e. R3=R1+R2R_3=R_1+R_2. Elimination performs R3←R3−3R1R_3\leftarrow R_3-3R_1 and then R3←R3−R2R_3\leftarrow R_3-R_2, peeling off exactly that combination until the row vanishes. A zero row means the third equation adds no new information.

2. Derive the nullspace matrix [−F;I][-F;I] from the block structure of RR.

Reference answer: Write R=[I  F]R=[I\ \ F] and x=[xpivot;xfree]\mathbf{x}=[\mathbf{x}_{\text{pivot}};\mathbf{x}_{\text{free}}]. Then Rx=0R\mathbf{x}=\mathbf{0} becomes

I xpivot+F xfree=0  ⟹  xpivot=−F xfree.I\,\mathbf{x}_{\text{pivot}}+F\,\mathbf{x}_{\text{free}}=\mathbf{0} \;\Longrightarrow\; \mathbf{x}_{\text{pivot}}=-F\,\mathbf{x}_{\text{free}}.

Free variables are arbitrary and determine the pivot variables. Taking xfree\mathbf{x}_{\text{free}} to be the columns of the identity (first free variable 1 and the rest 0, then rotate) produces the columns [−F][-F] stacked on II:

N=[−FI].N=\begin{bmatrix}-F\\ I\end{bmatrix}.

Each column is one special solution, and there are n−rn-r of them, the dimension of the nullspace. Here F=[2−202]F=\begin{bmatrix}2&-2\\0&2\end{bmatrix}, so N=[−22100−201]N=\begin{bmatrix}-2&2\\1&0\\0&-2\\0&1\end{bmatrix}, whose columns are exactly s1,s2\mathbf{s}_1,\mathbf{s}_2.

3. In the second example, why is the rank still 22 after the row exchange?

Reference answer: A row exchange only reorders the equations; equivalently it left-multiplies by an invertible permutation matrix, so it neither creates nor destroys pivots. Before the swap the second pivot slot was zero with a nonzero 22 below it; after the swap that 22 is the pivot, and further elimination zeros row four. Two pivots remain:

U=[123022000000].U=\begin{bmatrix}1&2&3\\0&2&2\\0&0&0\\0&0&0\end{bmatrix}.

Consistently, this matrix is ATA^T of the earlier matrix, which had rank 22; transposition preserves rank.

4. If AA is 5×75\times7 with rank 33, what is the dimension of its nullspace?

Reference answer: With n=7n=7 columns and r=3r=3 pivots, the number of free variables is

n−r=7−3=4,n-r=7-3=4,

so N(A)N(A) is a four-dimensional subspace of R7R^7. Intuitively, only three of the seven unknowns are pinned down by independent equations; four directions remain free, one special solution each.

5. Why does elimination preserve the nullspace but change the column space? Give a concrete change for each.

Reference answer: The nullspace is preserved because every row operation is invertible: if Ax=0A\mathbf{x}=\mathbf{0} then the operated system still holds, and reversing the operation recovers Ax=0A\mathbf{x}=\mathbf{0} from Ux=0U\mathbf{x}=\mathbf{0}. The solution sets coincide. The column space changes because row operations recombine rows. In the example, the first column of AA is [1,2,3]T[1,2,3]^T, which is in C(A)C(A); but every column of UU has zero third component, so C(U)C(U) contains only vectors with third component zero, and [1,2,3]T∉C(U)[1,2,3]^T\notin C(U). Hence C(A)≠C(U)C(A)\ne C(U) even though the nullspaces agree. The slogan: row operations preserve the nullspace and change the column space; column operations do the reverse.

How it connects

This lecture gives the complete algorithm for the nullspace. The next tackles Ax=bA\mathbf{x}=\mathbf{b}: elimination first decides whether a solution exists, then "particular solution plus nullspace" describes all of them, leading into the four fundamental subspaces.

来源