本文证明任何一个 m × n m \times n m×n矩阵的秩和对应齐次线性方程组的秩和为n。
Rank-Nullity Theorem叙述如下:
对任意
m
×
n
m\times n
m×n矩阵
A
A
A
r
a
n
k
(
A
)
+
n
u
l
l
i
t
y
(
A
)
=
n
(1)
rank(A) + nullity(A) = n \tag{1}
rank(A)+nullity(A)=n(1)
其中,
r
a
n
k
(
A
)
rank(A)
rank(A)是矩阵
A
A
A 的秩,
n
u
l
l
i
t
y
(
A
)
nullity(A)
nullity(A) 是矩阵
A
A
A 的
n
u
l
l
s
p
q
c
e
nullspqce
nullspqce 的秩。如果之前不知道矩阵
A
A
A 的
n
u
l
l
s
p
a
c
e
(
A
)
,
n
u
l
l
i
t
y
(
A
)
nullspace(A), \quad nullity(A)
nullspace(A),nullity(A) 的定义,只需要把
n
u
l
l
i
t
y
(
A
)
nullity(A)
nullity(A) 理解为齐次线性方程组(system of homogenous linear equations)
A
x
⃗
=
0
⃗
(2)
A \vec{x} = \vec{0} \tag{2}
Ax=0(2)
的基础解系的秩(rank)即可。
证明如下:
-
当 r a n k ( A ) = n rank(A) = n rank(A)=n 时, 那么 A x = 0 ⃗ Ax=\vec{0} Ax=0 只有唯一的零解,根据空间维度的定义,立刻有方程(2)解空间的维度是0(零向量永远线性相关)。此时等式(1)成立。
-
当 r a n k ( A ) = r < n rank(A) \;= \;r \;< n rank(A)=r<n 时, 对矩阵 A A A 做高斯消元法, 得到一个 行阶梯矩阵(严格要求非零行第一个非零元素为1)。此时,在方程(2)的解 x ⃗ \vec{x} x 的分量中有 n − r > 0 n-r>0 n−r>0 个自由变量。选取行阶梯矩阵中不存在leading one 的列,对应 x ⃗ \vec{x} x 中的分量为自由变量(下面有例子说明怎么选取)。leading one指的是,行阶梯矩阵中非零行中第一个1。记
t 1 , t 2 , . . . t n − r (3) t_1,t_2,...t_{n-r} \tag{3} t1,t2,...tn−r(3)
为自由变量(标量)。如下图所示,矩阵的第1,2列有leading one,所以对应解向量的第1, 2个分量不是自由变量,而矩阵的第3,4列不含leading one,所以对应的解向量的第3, 4个分量是自由变量。并且把解向量中的3,4个自由变量分别赋值给 t 1 , t 2 t_1, \;t_2 t1,t2。
把自由变量移项到等号右边,令第 t i t_i ti 对应的分量取1,其余分量取0( i = 1 , 2 , 3 , . . . , n − r i=1,2,3,...,n-r i=1,2,3,...,n−r ),得到
x ⃗ 1 , x ⃗ 2 , . . . x ⃗ n − r (4) \vec{x}_1,\vec{x}_2,...\vec{x}_{n-r} \tag{4} x1,x2,...xn−r(4)
其实,如下图所示, x ⃗ 1 , x ⃗ 2 \vec{x}_1,\vec{x}_2 x1,x2 对应用红色序号标出来的1对应的 x 3 x_3 x3后面的列向量和 x 4 x_4 x4后面的列向量
注意到:
{ x ⃗ 1 , x ⃗ 2 , . . . x ⃗ n − r } (5) \{\vec{x}_1,\vec{x}_2,...\vec{x}_{n-r}\} \tag{5} {x1,x2,...xn−r}(5)
是一组线性无关组(这里其实需要证明。事实上,因为每个向量 x ⃗ i \vec{x}_i xi 的构造方法导致了 x ⃗ i \vec{x}_i xi中 t i t_i ti对应的分量 取1,而其他 t j , j ≠ i t_j\;,j \neq i tj,j=i取0,注意这里 t i t_i ti是前文选取的自由变量。那么如果每个向量 x ⃗ i \vec{x}_i xi 都取其中的 t i {t_i} ti对应的分量构成新的向量,这些新向量构成的显然是一个线性无关组。然后用反证法证明原来向量组是线性无关即可)。进而,方程(2)的任何一个解都能表示成(3)的一个线性组合(这里其实是把自由变量移项到等号右边而已)
x ⃗ = t 1 x ⃗ 1 + t 2 x ⃗ 2 + . . . + t n − r x ⃗ n − r (6) \vec{x} = t_1\vec{x}_1+t_2\vec{x}_2+...+t_{n-r}\vec{x}_{n-r} \tag{6} x=t1x1+t2x2+...+tn−rxn−r(6)
这表明(5)张成了 n u l l s p a c e ( A ) nullspace(A) nullspace(A)。即(4)是 n u l l s p a c e ( A ) nullspace(A) nullspace(A)的一个基,故 n u l l i t y ( A ) = n − r nullity(A)\; = \; n-r nullity(A)=n−r 。等式6可能看上去会比较奇怪,拿解向量的分量(标量) t i t_i ti作向量的 x i x_i xi的系数。其实不奇怪,只需要认真看一下本文图2即可理解。实际上, x ⃗ i \vec{x}_i xi 和对应的自由向量所在列在行阶梯矩阵中的列向量有极大关联,大家自己观察就能发现。命题得证。
Proof:
If rank( A A A) = n, , the only solution to the above equation ( 2 ) (2) (2) is 0 \mathbb 0 0. Thus n u l l s p a c e ( A ) nullspace(A) nullspace(A) is { 0 } \{\mathbb{0}\} {0} . According to the definition of Linear Dependence, the relation of dimenson of space and number of vector in a maximal linearly independent group. Instanly obtains n u l l i t y ( A ) = 0 nullity(A)=0 nullity(A)=0. Hence, e q u a t i o n ( 1 ) equation (1) equation(1) holds.
Now suppose
r
a
n
k
(
A
)
=
r
<
n
rank(A) \;= \;r \;< n
rank(A)=r<n, do Gauss Elimination to matrix
A
A
A, obtain a Row-Echelon matrix. In this case, there are
n
−
r
>
0
n\;-\;r\;>\;0
n−r>0 free variables in the solution to equation (2). Let
t
1
,
t
2
,
.
.
.
t
n
−
r
t_1,t_2,...t_{n-r}
t1,t2,...tn−r
denote these free variables(chosen as those variables not attached to a leading one in any row-echelon form of
A
A
A), and let
x
⃗
1
,
x
⃗
2
,
.
.
.
x
⃗
n
−
r
(7)
\vec{x}_1,\vec{x}_2,...\vec{x}_{n-r} \tag{7}
x1,x2,...xn−r(7)
denote the solutions obtained by sequentially setting each free variable to 1 and the remaining free variables to zero. Note that
{
x
⃗
1
,
x
⃗
2
,
.
.
.
x
⃗
n
−
r
}
(8)
\{\vec{x}_1,\vec{x}_2,...\vec{x}_{n-r}\} \tag{8}
{x1,x2,...xn−r}(8)
is linearly independent, since there is only one sequential element in each vector does not equas zeros. Moreover, every solution to equation (2) is a linear combination of (8) :
x
⃗
=
t
1
x
⃗
1
+
t
2
x
⃗
2
+
.
.
.
+
t
n
−
r
x
⃗
n
−
r
(9)
\vec{x} = t_1\vec{x}_1+t_2\vec{x}_2+...+t_{n-r}\vec{x}_{n-r} \tag{9}
x=t1x1+t2x2+...+tn−rxn−r(9)
which shows that (4) spans
n
u
l
l
s
p
a
c
e
(
A
)
nullspace(A)
nullspace(A). Thus, (4) is a basis for
n
u
l
l
s
p
a
c
e
(
A
)
nullspace(A)
nullspace(A), and
n
u
l
l
i
t
y
(
A
)
=
n
−
r
.
nullity(A)\; = \; n-r.
nullity(A)=n−r. So the Rank-Nullity Theorem has been proved.