5.2.6 矩阵乘法的性质
现在我们来讨论矩阵乘法的基本性质。这些性质可以利用矩阵乘法的定义加以证明,这留作读者的练习。
(a) 交换律
矩阵一般不满足交换律,尽管在某些特殊情况下可能满足。在例 5.4 中我们看到 $\mathbf{AB} \neq \mathbf{BA}$ ,另一个例子也说明了同样的结果:
$$\mathbf{A} = \begin{bmatrix} 1 & 0 \ 0 & 0 \end{bmatrix}, \quad \mathbf{B} = \begin{bmatrix} 1 & 2 \ 1 & 0 \end{bmatrix}$$
$$\mathbf{AB} = \begin{bmatrix} 1 & 2 \ 0 & 0 \end{bmatrix}, \quad \mathbf{BA} = \begin{bmatrix} 1 & 0 \ 1 & 0 \end{bmatrix}$$
所以同样有 $\mathbf{AB} \neq \mathbf{BA}$ 。两个乘积不一定具有相同的尺寸,如例 5.4(a 和 b) 所示,其中 $\mathbf{AB}$ 是一个 $2 \times 2$ 矩阵,而 $\mathbf{BA}$ 是 $3 \times 3$ 。事实上,即使 $\mathbf{AB}$ 存在,也不能推出 $\mathbf{BA}$ 成立。以矩阵为例
$$\mathbf{a} = [1 \ 1 \ 1] \quad \text{and} \quad \mathbf{B} = \begin{bmatrix} 1 & 2 \ 2 & 1 \ 1 & 1 \end{bmatrix}. \quad \text{The product } \mathbf{aB} = [4 \ 4] \text{ is well defined but } \mathbf{Ba}$$
无法计算,因为一个 $3 \times 2$ 矩阵不能在右侧乘以一个 $1 \times 3$ 矩阵。因此顺序很重要,我们需要区分 $\mathbf{AB}$ 和 $\mathbf{BA}$ 。为此,我们谈到 $\mathbf{B}$ 的左乘(pre-multiplication),即用 $\mathbf{A}$ 去左乘以得到 $\mathbf{AB}$ ,以及 $\mathbf{B}$ 的右乘(post-multiplication),即用 $\mathbf{A}$ 构成 $\mathbf{BA}$ .
(b) 结合律
根据矩阵乘法的定义并仔细运用双重求和,可得
$$\mathbf{A}(\mathbf{BC}) = (\mathbf{AB})\mathbf{C}$$
其中 $\mathbf{A}$ 是 $m \times p$ , $\mathbf{B}$ 是 $p \times q$ 且 $\mathbf{C}$ 是 $q \times n$ 。
矩阵乘法满足结合律,因此我们可以省略括号。
(c) 对标量乘法的分配律
$$(\lambda\mathbf{A})\mathbf{B} = \mathbf{A}(\lambda\mathbf{B}) = \lambda\mathbf{AB} \text{ holds}$$
(d) 对加法的分配律
$$(\mathbf{A} + \mathbf{B})\mathbf{C} = \mathbf{AC} + \mathbf{BC} \quad \text{and} \quad \mathbf{A}(\mathbf{B} + \mathbf{C}) = \mathbf{AB} + \mathbf{AC}$$