第 03 章

矩阵乘法与逆矩阵:五种算法与 Gauss-Jordan

矩阵乘法可以从元素、列、行、列乘行、分块五个角度看,答案相同;方阵可逆当且仅当不存在非零向量被它送到零;Gauss-Jordan 用增广矩阵一次求出逆。

Matrix Multiplication and Inverses: Five Views and Gauss-Jordan

Matrix multiplication has five equivalent views — entries, columns, rows, column-times-row, and blocks. A square matrix is invertible exactly when no nonzero vector maps to zero, and Gauss-Jordan computes the inverse in one pass.

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

这一讲的两个主题

  1. 矩阵乘法到底在做什么。它有五种等价算法,每种都重要。
  2. 方阵的逆:什么时候存在,什么时候不存在,以及怎么求。

上一讲已经用过乘法,但只是「会算」。这一讲要把乘法拆开,看清它的结构,因为后面讲列空间、秩、LULU 分解时都要用到这些视角。

时间轴

时间内容
0:08矩阵乘法的规则
1:24CijC_{ij} 是行与列的点积
4:57矩形矩阵的乘法
7:09第二种看法:AA 乘 BB 的各列
9:57结果列是 AA 的列的组合
11:27结果行是 BB 的行的组合
18:28分块乘法
24:20可逆与奇异
29:05非零 x\mathbf{x} 使 Ax=0A\mathbf{x}=\mathbf{0} 则不可逆
30:02列的组合为零则不可逆
36:07Gauss-Jordan:一次解 nn 个方程组
38:32把 AA 化成单位矩阵
42:01用老办法验证
46:12求逆的完整流程

五种看法

设 AA 是 m×nm\times n,BB 是 n×pn\times p,C=ABC=AB 是 m×pm\times p。注意 AA 的列数必须等于 BB 的行数。

一、按元素:行点乘列

CC 的第 ii 行第 jj 列元素是

Cij=∑k=1nAikBkj.C_{ij}=\sum_{k=1}^{n} A_{ik}B_{kj}.

也就是「AA 的第 ii 行」与「BB 的第 jj 列」做点积。以 C34C_{34} 为例:

C34=A31B14+A32B24+⋯+A3nBn4.C_{34}=A_{31}B_{14}+A_{32}B_{24}+\cdots+A_{3n}B_{n4}.

这是教科书的标准算法,计算时最常用。

二、按列:CC 的列是 AA 的列的线性组合

把 BB 看成 pp 个列向量并排:

B=[b1b2⋯bp].B=\begin{bmatrix}\mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_p\end{bmatrix}.

那么

C=[Ab1Ab2⋯Abp].C=\begin{bmatrix}A\mathbf{b}_1 & A\mathbf{b}_2 & \cdots & A\mathbf{b}_p\end{bmatrix}.

因为 AbjA\mathbf{b}_j 是 AA 的列的线性组合,所以**CC 的每一列都是 AA 的列的组合**,组合系数来自 BB 的对应列。

三、按行:CC 的行是 BB 的行的线性组合

同样地,把 AA 看成 mm 个行向量:

A=[a1T⋮amT],C=[a1TB⋮amTB].A=\begin{bmatrix}\mathbf{a}_1^T\\ \vdots\\ \mathbf{a}_m^T\end{bmatrix}, \qquad C=\begin{bmatrix}\mathbf{a}_1^T B\\ \vdots\\ \mathbf{a}_m^T B\end{bmatrix}.

每个 aiTB\mathbf{a}_i^T B 是 BB 的行的线性组合,系数来自 AA 的第 ii 行。

四、列乘行:秩一矩阵之和

这是最容易被忽略、但结构最清楚的一种。若 AA 的列是 ak\mathbf{a}_k,BB 的行是 bkT\mathbf{b}_k^T,则

AB=∑k=1nakbkT.AB=\sum_{k=1}^{n}\mathbf{a}_k\mathbf{b}_k^T.

每项 akbkT\mathbf{a}_k\mathbf{b}_k^T 是「列乘行」,得到一个完整的 m×pm\times p 矩阵。

例子:

[234][16]=[212318424].\begin{bmatrix}2\\3\\4\end{bmatrix} \begin{bmatrix}1 & 6\end{bmatrix} = \begin{bmatrix} 2 & 12\\ 3 & 18\\ 4 & 24 \end{bmatrix}.

这个矩阵的每一列都是 [2,3,4]T[2,3,4]^T 的倍数,每一行都是 [1,6][1,6] 的倍数。它的行空间是一条线,列空间也是一条线——这是「秩一矩阵」的原型。

五、分块乘法

把 AA 和 BB 都切成四块:

A=[A11A12A21A22],B=[B11B12B21B22].A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}, \qquad B=\begin{bmatrix}B_{11}&B_{12}\\B_{21}&B_{22}\end{bmatrix}.

则

AB=[A11B11+A12B21A11B12+A12B22A21B11+A22B21A21B12+A22B22].AB= \begin{bmatrix} A_{11}B_{11}+A_{12}B_{21} & A_{11}B_{12}+A_{12}B_{22}\\ A_{21}B_{11}+A_{22}B_{21} & A_{21}B_{12}+A_{22}B_{22} \end{bmatrix}.

规则和普通乘法一样,只是把标量换成块。五条路算出来的结果完全一致。

逆矩阵:方阵的核心问题

对 n×nn\times n 的方阵 AA,最重要的问题是:它可逆吗?

如果存在 A−1A^{-1} 使得

A−1A=I,A^{-1}A=I,

则称 AA 可逆(非奇异)。对方阵有一个不平凡的事实:左逆也是右逆,即 A−1A=IA^{-1}A=I 蕴含 AA−1=IAA^{-1}=I。对长方形矩阵不成立,因为形状根本不允许。

奇异矩阵:列的组合能产生零

考虑

A=[1326].A=\begin{bmatrix}1&3\\2&6\end{bmatrix}.

两列 [1,2]T[1,2]^T 与 [3,6]T[3,6]^T 在同一条直线上,第二列是第一列的 3 倍。

理由一(列图像):AA 乘任何矩阵,结果的列都是 AA 的列的组合,因此都落在同一条直线上。但单位矩阵 II 的列 [1,0]T[1,0]^T、[0,1]T[0,1]^T 不在那条线上。所以 AA 不可能乘出 II。

理由二(零空间):存在非零向量

x=[3−1],Ax=[1326][3−1]=[3−36−6]=[00].\mathbf{x}=\begin{bmatrix}3\\-1\end{bmatrix}, \qquad A\mathbf{x}= \begin{bmatrix}1&3\\2&6\end{bmatrix} \begin{bmatrix}3\\-1\end{bmatrix} = \begin{bmatrix}3-3\\6-6\end{bmatrix} = \begin{bmatrix}0\\0\end{bmatrix}.

如果 A−1A^{-1} 存在,两边左乘 A−1A^{-1}:

A−1Ax=A−10  ⟹  x=0.A^{-1}A\mathbf{x}=A^{-1}\mathbf{0} \;\Longrightarrow\; \mathbf{x}=\mathbf{0}.

但 x=[3,−1]T\mathbf{x}=[3,-1]^T 不是零向量,矛盾。所以 A−1A^{-1} 不存在。

一句话总结: 方阵不可逆,等价于存在非零向量被它压成零;一旦信息被压掉,就没有矩阵能还原。

这个判据会在后面变成「零空间是否只有零向量」以及「行列式是否为零」。

Gauss-Jordan:一次解 nn 个方程组

现在假设 AA 可逆。求 A−1A^{-1} 的关键观察是:把 A−1A^{-1} 按列看,第 jj 列满足

A (A−1的第 j列)=ej,A\,(A^{-1}\text{的第 }j\text{列})=\mathbf{e}_j,

其中 ej\mathbf{e}_j 是单位矩阵的第 jj 列。所以求逆等价于同时解 nn 个右端不同的方程组。

Gauss 只做前向消元,Jordan 多做一步:继续向上消元,直到左边变成单位矩阵。

例子

取

A=[1327].A=\begin{bmatrix}1&3\\2&7\end{bmatrix}.

构造增广矩阵 [A∣I][A\mid I]:

[13102701].\left[\begin{array}{cc|cc} 1&3&1&0\\ 2&7&0&1 \end{array}\right].

第一步:第二行减去 2 倍第一行。

[131001−21].\left[\begin{array}{cc|cc} 1&3&1&0\\ 0&1&-2&1 \end{array}\right].

这一步把左下角消成 0,得到上三角。Gauss 到这里就停。

第二步:第一行减去 3 倍第二行,把右上角也消成 0。

[107−301−21].\left[\begin{array}{cc|cc} 1&0&7&-3\\ 0&1&-2&1 \end{array}\right].

左边成了 II,右边就是

A−1=[7−3−21].A^{-1}=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}.

验证

A−1A=[7−3−21][1327]=[7−621−21−2+2−6+7]=[1001].A^{-1}A= \begin{bmatrix}7&-3\\-2&1\end{bmatrix} \begin{bmatrix}1&3\\2&7\end{bmatrix} = \begin{bmatrix} 7-6 & 21-21\\ -2+2 & -6+7 \end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}.

为什么右边会变成逆

把每一步消元写成矩阵 E1,E2,…E_1,E_2,\dots,合起来记为

E=Ek⋯E2E1.E=E_k\cdots E_2E_1.

对增广矩阵左乘 EE:

E [A∣I]=[EA∣E].E\,[A\mid I]=[EA\mid E].

消元完成时 EA=IEA=I。由逆的定义,E=A−1E=A^{-1}。于是右边

E I=E=A−1.E\,I=E=A^{-1}.

这就是 Gauss-Jordan 的全部原理:把 AA 化成 II 的那串行操作,作用在 II 上就得到 A−1A^{-1}。

本讲结论

  • ABAB 有五种算法:元素点积、按列、按行、列乘行求和、分块。结果相同。
  • CC 的列是 AA 的列的组合;CC 的行是 BB 的行的组合。
  • 列乘行得到一个秩一矩阵;ABAB 是这些秩一矩阵之和。
  • 方阵可逆等价于不存在非零 x\mathbf{x} 使 Ax=0A\mathbf{x}=\mathbf{0}。
  • 奇异矩阵的列共线(更一般地,线性相关),无法组合出单位矩阵的列。
  • Gauss-Jordan 对 [A∣I][A\mid I] 做完整消元,左边化为 II 时右边就是 A−1A^{-1}。

理解检验

1. 用元素公式写出 C23C_{23} 的求和表达式,并说明 AA、BB 的形状限制。

参考答案:

C23=∑k=1nA2kBk3=A21B13+A22B23+⋯+A2nBn3,C_{23}=\sum_{k=1}^{n}A_{2k}B_{k3}=A_{21}B_{13}+A_{22}B_{23}+\cdots+A_{2n}B_{n3},

即 AA 的第二行与 BB 的第三列做点积。形状限制:若 AA 是 m×nm\times n、BB 是 n×pn\times p,则 CC 是 m×pm\times p。要能写出 C23C_{23},必须 m≥2m\ge2、p≥3p\ge3;AA 的列数必须等于 BB 的行数 nn,这是乘法有定义的唯一条件。

2. 为什么 CC 的列一定是 AA 的列的组合?用「矩阵乘向量」的定义解释。

参考答案:把 BB 按列拆成 b1,…,bp\mathbf{b}_1,\dots,\mathbf{b}_p,则 CC 的第 jj 列就是 AbjA\mathbf{b}_j。而矩阵乘向量的定义正是「以 bj\mathbf{b}_j 的分量为权重,对 AA 的列做线性组合」:

Abj=∑k=1nbkj ak.A\mathbf{b}_j=\sum_{k=1}^{n}b_{kj}\,\mathbf{a}_k .

所以 CC 的每一列都落在 AA 的列张成的空间里,系数就是 BB 第 jj 列的那些数。这也解释了为什么 CC 的列数等于 BB 的列数、而每个列向量都由 AA 的列生成。

3. 证明 [2,3,4]T[1,6][2,3,4]^T[1,6] 的行空间是一条线、列空间也是一条线。

参考答案:先算乘积:

[234][16]=[212318424].\begin{bmatrix}2\\3\\4\end{bmatrix}\begin{bmatrix}1&6\end{bmatrix} =\begin{bmatrix}2&12\\3&18\\4&24\end{bmatrix}.

列空间:第 1 列是 [2,3,4]T[2,3,4]^T,第 2 列是 6[2,3,4]T6[2,3,4]^T,两列都是同一个向量的倍数,所以列空间是 span⁡{[2,3,4]T}\operatorname{span}\{[2,3,4]^T\},一条过原点的直线。行空间:第一行是 [2,12]=2[1,6][2,12]=2[1,6],第二行是 3[1,6]3[1,6],第三行是 4[1,6]4[1,6],所以行空间是 span⁡{[1,6]}\operatorname{span}\{[1,6]\},也是一条线。两者维数都是 1,这正是秩一矩阵的特征:它把整个平面压到一条线上。

4. 用零空间论证说明 [1326]\begin{bmatrix}1&3\\2&6\end{bmatrix} 不可逆。

参考答案:取非零向量 x=[3,−1]T\mathbf{x}=[3,-1]^T,计算

[1326][3−1]=[3−36−6]=[00].\begin{bmatrix}1&3\\2&6\end{bmatrix}\begin{bmatrix}3\\-1\end{bmatrix} =\begin{bmatrix}3-3\\6-6\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}.

若 A−1A^{-1} 存在,两边左乘 A−1A^{-1}:

A−1Ax=A−10  ⟹  x=0,A^{-1}A\mathbf{x}=A^{-1}\mathbf{0}\;\Longrightarrow\;\mathbf{x}=\mathbf{0},

与 x≠0\mathbf{x}\ne\mathbf{0} 矛盾。所以不存在逆矩阵。直观上,两个不同的输入(0\mathbf 0 与 [3,−1]T[3,-1]^T)被映到同一个输出,信息已经丢失,无法唯一还原。

5. 对 A=[1327]A=\begin{bmatrix}1&3\\2&7\end{bmatrix} 完整执行 Gauss-Jordan,并验证结果。

参考答案:从增广矩阵出发,

[13102701]→R2−2R1[131001−21]→R1−3R2[107−301−21].\left[\begin{array}{cc|cc}1&3&1&0\\2&7&0&1\end{array}\right] \xrightarrow{R_2-2R_1} \left[\begin{array}{cc|cc}1&3&1&0\\0&1&-2&1\end{array}\right] \xrightarrow{R_1-3R_2} \left[\begin{array}{cc|cc}1&0&7&-3\\0&1&-2&1\end{array}\right].

左边已是 II,所以 A−1=[7−3−21]A^{-1}=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}。验证:

A−1A=[7−3−21][1327]=[7−621−21−2+2−6+7]=[1001].A^{-1}A=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}\begin{bmatrix}1&3\\2&7\end{bmatrix} =\begin{bmatrix}7-6&21-21\\-2+2&-6+7\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix}.

原理是:把这串行操作记为 EE,则 E[A∣I]=[EA∣E]=[I∣A−1]E[A\mid I]=[EA\mid E]=[I\mid A^{-1}],所以右边的变化正是 A−1A^{-1} 本身。

与前后课的关系

这一讲把乘法与逆讲成了结构。下一讲把消元写成 A=LUA=LU,其中 LL 记录乘数、UU 是上三角;再往后,可逆性会被翻译成「主元个数」「行列式非零」「零空间只有零向量」等互相等价的条件。

Two topics

  1. What matrix multiplication actually does. There are five equivalent algorithms, and all of them matter.
  2. Inverses of square matrices: when one exists, when it does not, and how to compute it.

The previous lecture used multiplication mechanically. This one opens it up, because column spaces, rank, and LULU factorization all depend on these views.

Timeline

TimeTopic
0:08The rules for matrix multiplication
1:24The (i,j)(i,j) entry as a row times a column
4:57Rectangular matrices
7:09Second view: AA times the columns of BB
9:57Columns of ABAB are combinations of columns of AA
11:27Rows of ABAB are combinations of rows of BB
18:28Block multiplication
24:20Invertible versus singular
29:05A nonzero x\mathbf{x} with Ax=0A\mathbf{x}=\mathbf{0} rules out an inverse
30:02Columns that combine to zero rule out an inverse
36:07Gauss-Jordan: nn right-hand sides at once
38:32Reducing AA to the identity
42:01Checking the answer the old way
46:12The full algorithm for the inverse

Five ways to multiply

Let AA be m×nm\times n, BB be n×pn\times p, and C=ABC=AB be m×pm\times p. The number of columns of AA must equal the number of rows of BB.

1. By entries: row dot column

The entry in row ii, column jj of CC is

Cij=∑k=1nAikBkj.C_{ij}=\sum_{k=1}^{n} A_{ik}B_{kj}.

That is the dot product of row ii of AA with column jj of BB. For example,

C34=A31B14+A32B24+⋯+A3nBn4.C_{34}=A_{31}B_{14}+A_{32}B_{24}+\cdots+A_{3n}B_{n4}.

This is the textbook algorithm and the one used in computation.

2. By columns: each column of CC is a combination of columns of AA

Write BB as pp columns side by side:

B=[b1b2⋯bp].B=\begin{bmatrix}\mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_p\end{bmatrix}.

Then

C=[Ab1Ab2⋯Abp].C=\begin{bmatrix}A\mathbf{b}_1 & A\mathbf{b}_2 & \cdots & A\mathbf{b}_p\end{bmatrix}.

Since AbjA\mathbf{b}_j is a linear combination of the columns of AA, every column of CC is a combination of the columns of AA, with coefficients taken from the corresponding column of BB.

3. By rows: each row of CC is a combination of rows of BB

Similarly, writing AA by rows,

A=[a1T⋮amT],C=[a1TB⋮amTB].A=\begin{bmatrix}\mathbf{a}_1^T\\ \vdots\\ \mathbf{a}_m^T\end{bmatrix}, \qquad C=\begin{bmatrix}\mathbf{a}_1^T B\\ \vdots\\ \mathbf{a}_m^T B\end{bmatrix}.

Each aiTB\mathbf{a}_i^T B is a combination of the rows of BB, with coefficients from row ii of AA.

4. Column times row: a sum of rank-one matrices

This view is the easiest to overlook and the most structural. If ak\mathbf{a}_k are the columns of AA and bkT\mathbf{b}_k^T the rows of BB, then

AB=∑k=1nakbkT.AB=\sum_{k=1}^{n}\mathbf{a}_k\mathbf{b}_k^T.

Each term is a full m×pm\times p matrix. For example,

[234][16]=[212318424].\begin{bmatrix}2\\3\\4\end{bmatrix} \begin{bmatrix}1 & 6\end{bmatrix} = \begin{bmatrix} 2 & 12\\ 3 & 18\\ 4 & 24 \end{bmatrix}.

Every column is a multiple of [2,3,4]T[2,3,4]^T; every row is a multiple of [1,6][1,6]. Its row space is a line and its column space is a line — the prototype of a rank-one matrix.

5. By blocks

Cut both matrices into four blocks:

A=[A11A12A21A22],B=[B11B12B21B22].A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}, \qquad B=\begin{bmatrix}B_{11}&B_{12}\\B_{21}&B_{22}\end{bmatrix}.

Then

AB=[A11B11+A12B21A11B12+A12B22A21B11+A22B21A21B12+A22B22].AB= \begin{bmatrix} A_{11}B_{11}+A_{12}B_{21} & A_{11}B_{12}+A_{12}B_{22}\\ A_{21}B_{11}+A_{22}B_{21} & A_{21}B_{12}+A_{22}B_{22} \end{bmatrix}.

The rule is the usual one with scalars replaced by blocks. All five routes agree.

Inverses: the central question for square matrices

For an n×nn\times n matrix AA, the important question is: is it invertible?

If there is a matrix A−1A^{-1} with

A−1A=I,A^{-1}A=I,

then AA is invertible, or nonsingular. For square matrices there is a non-obvious fact: a left inverse is also a right inverse, so A−1A=IA^{-1}A=I implies AA−1=IAA^{-1}=I. For rectangular matrices this fails, simply because the shapes do not allow it.

Singular matrices: columns that combine to zero

Consider

A=[1326].A=\begin{bmatrix}1&3\\2&6\end{bmatrix}.

The columns [1,2]T[1,2]^T and [3,6]T[3,6]^T lie on the same line; the second is three times the first.

Reason one (column picture). AA times any matrix has columns that are combinations of the columns of AA, so they all lie on that one line. But the columns of II, [1,0]T[1,0]^T and [0,1]T[0,1]^T, do not. So AA cannot produce II.

Reason two (nullspace). There is a nonzero vector

x=[3−1],Ax=[1326][3−1]=[3−36−6]=[00].\mathbf{x}=\begin{bmatrix}3\\-1\end{bmatrix}, \qquad A\mathbf{x}= \begin{bmatrix}1&3\\2&6\end{bmatrix} \begin{bmatrix}3\\-1\end{bmatrix} = \begin{bmatrix}3-3\\6-6\end{bmatrix} = \begin{bmatrix}0\\0\end{bmatrix}.

If A−1A^{-1} existed, multiply both sides on the left:

A−1Ax=A−10  ⟹  x=0.A^{-1}A\mathbf{x}=A^{-1}\mathbf{0} \;\Longrightarrow\; \mathbf{x}=\mathbf{0}.

But x=[3,−1]T\mathbf{x}=[3,-1]^T is not zero. Contradiction: A−1A^{-1} does not exist.

One-sentence summary: A square matrix is singular exactly when some nonzero vector is crushed to zero; once information is destroyed, no matrix can restore it.

This criterion later becomes "the nullspace contains only the zero vector" and "the determinant is zero".

Gauss-Jordan: solving nn systems at once

Assume AA is invertible. The key observation is that column jj of A−1A^{-1} satisfies

A (column j of A−1)=ej,A\,(\text{column }j\text{ of }A^{-1})=\mathbf{e}_j,

where ej\mathbf{e}_j is column jj of the identity. Finding the inverse is therefore solving nn systems with different right-hand sides.

Gauss stops after forward elimination. Jordan continues upward until the left side is the identity.

Example

Take

A=[1327].A=\begin{bmatrix}1&3\\2&7\end{bmatrix}.

Form the augmented matrix [A∣I][A\mid I]:

[13102701].\left[\begin{array}{cc|cc} 1&3&1&0\\ 2&7&0&1 \end{array}\right].

Step one: subtract twice row one from row two.

[131001−21].\left[\begin{array}{cc|cc} 1&3&1&0\\ 0&1&-2&1 \end{array}\right].

The lower-left entry is gone; this is upper triangular. Gauss would stop here.

Step two: subtract three times row two from row one, clearing the upper-right entry.

[107−301−21].\left[\begin{array}{cc|cc} 1&0&7&-3\\ 0&1&-2&1 \end{array}\right].

The left side is II, so the right side is

A−1=[7−3−21].A^{-1}=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}.

Check

A−1A=[7−3−21][1327]=[7−621−21−2+2−6+7]=[1001].A^{-1}A= \begin{bmatrix}7&-3\\-2&1\end{bmatrix} \begin{bmatrix}1&3\\2&7\end{bmatrix} = \begin{bmatrix} 7-6 & 21-21\\ -2+2 & -6+7 \end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}.

Why the right side becomes the inverse

Write each elimination step as a matrix E1,E2,…E_1,E_2,\dots, and let

E=Ek⋯E2E1.E=E_k\cdots E_2E_1.

Applying EE to the augmented matrix:

E [A∣I]=[EA∣E].E\,[A\mid I]=[EA\mid E].

When elimination finishes, EA=IEA=I. By definition of the inverse, E=A−1E=A^{-1}. Therefore the right side is

E I=E=A−1.E\,I=E=A^{-1}.

That is the whole idea: the row operations that turn AA into II turn II into A−1A^{-1}.

Takeaways

  • ABAB has five algorithms: entry dot products, by columns, by rows, sum of column-times-row, and blocks. They agree.
  • Columns of CC are combinations of columns of AA; rows of CC are combinations of rows of BB.
  • A column times a row is a rank-one matrix; ABAB is a sum of such matrices.
  • A square matrix is invertible exactly when no nonzero x\mathbf{x} satisfies Ax=0A\mathbf{x}=\mathbf{0}.
  • A singular matrix has linearly dependent columns, which cannot combine to produce the identity's columns.
  • Gauss-Jordan reduces [A∣I][A\mid I]; when the left half becomes II, the right half is A−1A^{-1}.

Check your understanding

1. Write C23C_{23} with the summation formula and state the shape constraints on AA and BB.

Reference answer:

C23=∑k=1nA2kBk3=A21B13+A22B23+⋯+A2nBn3,C_{23}=\sum_{k=1}^{n}A_{2k}B_{k3}=A_{21}B_{13}+A_{22}B_{23}+\cdots+A_{2n}B_{n3},

the dot product of row two of AA with column three of BB. If AA is m×nm\times n and BB is n×pn\times p, then CC is m×pm\times p; writing C23C_{23} requires m≥2m\ge2 and p≥3p\ge3. The only compatibility condition is that the number of columns of AA equals the number of rows of BB.

2. Why must every column of CC be a combination of columns of AA? Use the definition of matrix times vector.

Reference answer: Split BB into columns b1,…,bp\mathbf{b}_1,\dots,\mathbf{b}_p; then column jj of CC is AbjA\mathbf{b}_j. By definition,

Abj=∑k=1nbkj ak,A\mathbf{b}_j=\sum_{k=1}^{n}b_{kj}\,\mathbf{a}_k,

a linear combination of the columns ak\mathbf{a}_k of AA with weights taken from column jj of BB. Hence every column of CC lies in the span of the columns of AA, and there are as many columns in CC as in BB.

3. Show that [2,3,4]T[1,6][2,3,4]^T[1,6] has a one-dimensional row space and a one-dimensional column space.

Reference answer: The product is

[234][16]=[212318424].\begin{bmatrix}2\\3\\4\end{bmatrix}\begin{bmatrix}1&6\end{bmatrix} =\begin{bmatrix}2&12\\3&18\\4&24\end{bmatrix}.

Columns: the second is 66 times the first, so the column space is span⁡{[2,3,4]T}\operatorname{span}\{[2,3,4]^T\}, a line. Rows: they are 2[1,6]2[1,6], 3[1,6]3[1,6], 4[1,6]4[1,6], so the row space is span⁡{[1,6]}\operatorname{span}\{[1,6]\}, also a line. Both dimensions are 1 — the signature of a rank-one matrix, which collapses the whole plane onto a single line.

4. Use the nullspace argument to show that [1326]\begin{bmatrix}1&3\\2&6\end{bmatrix} is singular.

Reference answer: Take x=[3,−1]T≠0\mathbf{x}=[3,-1]^T\ne\mathbf{0}. Then

[1326][3−1]=[3−36−6]=[00].\begin{bmatrix}1&3\\2&6\end{bmatrix}\begin{bmatrix}3\\-1\end{bmatrix} =\begin{bmatrix}3-3\\6-6\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}.

If A−1A^{-1} existed, left multiplication would give

A−1Ax=A−10  ⟹  x=0,A^{-1}A\mathbf{x}=A^{-1}\mathbf{0}\;\Longrightarrow\;\mathbf{x}=\mathbf{0},

a contradiction. Two different inputs (0\mathbf 0 and [3,−1]T[3,-1]^T) map to the same output, so the information is lost and cannot be recovered.

5. Run Gauss-Jordan on A=[1327]A=\begin{bmatrix}1&3\\2&7\end{bmatrix} and verify the result.

Reference answer: Starting from the augmented matrix,

[13102701]→R2−2R1[131001−21]→R1−3R2[107−301−21].\left[\begin{array}{cc|cc}1&3&1&0\\2&7&0&1\end{array}\right] \xrightarrow{R_2-2R_1} \left[\begin{array}{cc|cc}1&3&1&0\\0&1&-2&1\end{array}\right] \xrightarrow{R_1-3R_2} \left[\begin{array}{cc|cc}1&0&7&-3\\0&1&-2&1\end{array}\right].

The left block is II, so A−1=[7−3−21]A^{-1}=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}. Check:

A−1A=[7−3−21][1327]=[7−621−21−2+2−6+7]=[1001].A^{-1}A=\begin{bmatrix}7&-3\\-2&1\end{bmatrix}\begin{bmatrix}1&3\\2&7\end{bmatrix} =\begin{bmatrix}7-6&21-21\\-2+2&-6+7\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix}.

The reason it works: with EE the product of the row operations, E[A∣I]=[EA∣E]=[I∣A−1]E[A\mid I]=[EA\mid E]=[I\mid A^{-1}], so whatever happens to the right block is exactly A−1A^{-1}.

How it connects

This lecture turns multiplication and inversion into structure. The next one writes elimination as A=LUA=LU, with LL storing the multipliers and UU upper triangular. Later, invertibility is translated into equivalent conditions: nonzero pivots, a nonzero determinant, and a nullspace containing only zero.

来源