1.3 Elimination with Matrices 阅读笔记


消元法,矩阵乘法,线性变换的组合

reference的内容为唯一教程,接下来的内容仅为本人的课后感悟,对他人或无法起到任何指导作用。

Reference

  1. Course website: Elimination with Matrices | Unit I: Ax = b and the Four Subspaces | Linear Algebra | Mathematics | MIT OpenCourseWare
  2. Course video: 麻省理工公开课:线性代数-矩阵消元-网易公开课 (163.com)
  3. Course summary: Elimination with Matrices (mit.edu)
  4. Extra reading: Section 2.1, 2.2, 2.3 in Introduction to Linear Algebra, Fifth Edition by Gilbert Strang.
  5. Extra videos (3Blue1Brown):
    1. Matrix multiplication as composition | Chapter 4, Essence of linear algebra - YouTube
    2. Three-dimensional linear transformations | Chapter 5, Essence of linear algebra - YouTube

Recap

  • 线性方程组可以看成矩阵乘向量,是组成矩阵的(列)向量的线性组合,不过仍然可以从原来内积的角度看。
  • 线性组合生成张成空间。线性相关的向量的线性组合无法张成全部向量空间,有向量是多余的。线性无关的向量如果能张成全部向量空间就构成基。
  • 方阵乘向量又可以看作对原来的向量进行一次线性变换,映射到了线性子空间上,可能会因为方阵列向量线性相关导致张成的线性子空间不能填满全部向量空间,此时方阵是奇异的。

有个问题无法避开:线性方程组有没有解?\(\mathbf{A}\mathbf{x}=\mathbf{b}\)有没有解?对于线性变换后的子空间一点or向量和线性变换,是否可以得到原来的向量?这一讲就从线性方程组的解的消元法(Elimination)讲怎么解方程,再到消元法的本质是方阵与方阵的乘法。看完3blue1brown的视频之后提前明白了方阵之间乘法的本质是线性变换的组合。

Elimination

好像我学完线代解线性方程组就直接按照程序:列出\(\mathbf{A}\mathbf{x}=\mathbf{b}\) → 写出增广矩阵\(\begin{bmatrix}\mathbf{A} & \vdots\mathbf{b}\end{bmatrix}\) → 化为对角阵和\(\begin{bmatrix}\mathbf{I} & \vdots\mathbf{A}^{-1}\mathbf{b}\end{bmatrix}\) → 最右边的列等于解\(\mathbf{x}\)

好像它是从高斯消元法来的,但是当时没什么印象了。

就是利用行变换(乘以倍数后加减,调换行的顺序)操作增广矩阵\(\begin{bmatrix}\mathbf{A} & \vdots\mathbf{b}\end{bmatrix}\),把矩阵\(\mathbf{A}\)化为左下全0的矩阵,好像叫上三角矩阵,对角线的元素pivot point尽可能非零。如果都非0就可以回代(Back Substitution)。具体就不赘述了。

Elementary Matrices for Elimination

重新用矩阵的角度来描述消元法,比如矩阵\(\mathbf{A}\)是3行3列的,则有

\[\mathbf{A}\mathbf{x}=\mathbf{b}\Rightarrow f(\mathbf{A}\mathbf{x})=f(\mathbf{b})\Rightarrow g(f(\mathbf{A}\mathbf{x}))=g(f(\mathbf{b})) \]

其中\(f(\cdot)\)为对第一行进行行变换,\(g(\cdot)\)为对第二行行变换。

行变换是什么,是用初等矩阵(Elementary Matrix)左乘另一个矩阵,何为初等矩阵?就是对单位阵进行行变换的矩阵。为什么初等矩阵左乘另一个矩阵会等价于行变换,这得将矩阵乘法重新看作行向量和列向量的内积。于是重新写成:

\[\mathbf{A}\mathbf{x}=\mathbf{b}\Rightarrow \mathbf{E}_1(\mathbf{A}\mathbf{x})=\mathbf{E}_1\mathbf{b}\Rightarrow \mathbf{E}_2(\mathbf{E}_1(\mathbf{A}\mathbf{x}))=\mathbf{E}_2(\mathbf{E}_1\mathbf{b}) \]

矩阵乘法是可以结合(Associate)的,括号可以随便放,于是有

\[(\mathbf{E}_2\mathbf{E}_1)\mathbf{Ax}=(\mathbf{E}_2\mathbf{E}_1)\mathbf{b}\Rightarrow\mathbf{EAx}=\mathbf{Eb}\Rightarrow\mathbf{Ux}=\mathbf{Eb}=\mathbf{c} \]

消元后得到的矩阵为\(\mathbf{U}\),如果pivot point非零,那么就能通过解\(\mathbf{Ux}=\mathbf{c}\)反推得到\(\mathbf{Ax}=\mathbf{b}\)的解,这些箭头都是可逆的。

Matrix Multiplication: Combination of Linear Transformation

矩阵乘法,用烂了,不可能不会。可以associate,不可交换(Commutative),以及矩阵的size问题,计算方式,单位矩阵......

矩阵乘向量相当于线性变换,那矩阵乘矩阵呢?看完3Blue1Brown明白了,是线性变换的组合。

注意:按照变换的先后顺序需要不断左乘,是从右向左的顺序,就跟函数嵌套一样。

矩阵乘矩阵的公式为什么要背呢?矩阵\(\mathbf{B}=\begin{bmatrix} a & b\\ c & d \end{bmatrix}\)\(\mathbf{A}=\begin{bmatrix} e & f\\ g & h \end{bmatrix}\)相乘相当于先进行线性变换A再进行线性变换B。进行线性变换A之后有\(\hat{\mathbf{i}}=(e,g)\)\(\hat{\mathbf{j}}=(f,h)\)。进行线性变换B之后\(\hat{\hat{\mathbf{i}}}=\mathbf{B}\hat{\mathbf{i}}\)\(\hat{\hat{\mathbf{j}}}=\mathbf{B}\hat{\mathbf{j}}\)\(\mathbf{B}\mathbf{A}=\begin{bmatrix}\hat{\hat{\mathbf{i}}} & \hat{\hat{\mathbf{j}}}\end{bmatrix}\)。于是:

\[\begin{align*} \begin{bmatrix} a & b\\ c & d \end{bmatrix}\begin{bmatrix} e & f\\ g & h \end{bmatrix}&=\begin{bmatrix} \begin{bmatrix} a & b\\ c & d \end{bmatrix}\begin{bmatrix} e\\ g \end{bmatrix} & \begin{bmatrix} a & b\\ c & d \end{bmatrix}\begin{bmatrix} f\\ h \end{bmatrix}\\ \end{bmatrix}=\begin{bmatrix} e\begin{bmatrix} a\\ c \end{bmatrix}+g\begin{bmatrix} b\\ d \end{bmatrix} & f\begin{bmatrix} a\\ c \end{bmatrix}+h\begin{bmatrix} b\\ d \end{bmatrix}\\ \end{bmatrix}\\ &=\begin{bmatrix} ae+bg & af+bh\\ ce+dg & cf+dh \end{bmatrix} \end{align*} \]

由于是组合,所以结合的方式是随意的,对向量先进行A变换,再B,再C,可以直接等效成进行一个D变换,也可以说先AB再C,把AB等效成E,也可以先A再BC,把BC等效成F。但是不能换顺序,先C再B再A,会不一样的。行变换也是线性变换,于是上面两个公式可以按照这样的组合方式去理解。

Good explanation > Symbol proof !!!

Inverses

最后引入一点点矩阵逆的概念。有没有可能,进行了线性变换A之后,再进行一个线性变换B,结果回到最初的起点?线性变换B就是线性变换A的逆,组合之后就是单位阵。