线性代数的本质 · 精研复习站

第 08·拓展 集:克莱姆法则的几何解释

Cramer's rule, explained geometrically
一句话直觉:把输入向量的每个坐标改写成“与其余基向量张成的有向面积或体积”,经变换 $A$ 后所有面积/体积统一乘以 $\det(A)$,因此未知坐标可直接由输出端替换列行列式与 $\det(A)$ 的比值求得。

克莱姆法则虽然在数值计算速度上不如高斯消元法,却以惊人的几何美感把线性方程组 $A\vec{x}=\vec{b}$ 与行列式紧密焊接在一起。本讲先揭示为何“用点积提取坐标”在一般线性变换下失效(仅在保持垂直和单位长度的正交变换下成立);随后引入巧妙的替代方案——用基向量与未知输入向量张成的平行四边形有向面积(三维为平行六面体有向体积)来表达坐标;最后利用行列式“等比例缩放所有区域面积/体积”的核心定理,干净利落地推导出克莱姆法则。

▶ YouTube 原片 📺 B站官方双语 P16

前置依赖

← 第 05 集 · 行列式:理解变换矩阵 $A$ 会把空间中一切区域的面积(或体积)统一缩放 $\det(A)$ 倍,以及有向面积/体积与右手定则。
← 第 06 集 · 逆矩阵、列空间、秩与零空间:理解当 $\det(A)\neq 0$ 时,线性方程组 $A\vec{x}=\vec{b}$ 对任意输出都有唯一对应的输入向量解。
← 第 07 集 · 点积与对偶性:理解点积作为正交投影提取坐标的机制,理解正交变换保持点积不变的特质。

后续延伸

→ 第 09 集 · 基变换:进一步从向量在不同坐标系下的坐标表示出发,理解矩阵如何跨基描述同一线性变换。
正交矩阵求解特例
$$T\text{ 正交} \;\Longrightarrow\; x = \vec{a}_1\cdot\vec{b},\quad y = \vec{a}_2\cdot\vec{b}$$
用有向面积改写二维坐标
$$x = \operatorname{SignedArea}(\vec{x},\hat{\jmath}) = \det\begin{bmatrix} x & 0 \\ y & 1 \end{bmatrix},\qquad y = \operatorname{SignedArea}(\hat{\imath},\vec{x}) = \det\begin{bmatrix} 1 & x \\ 0 & y \end{bmatrix}$$
面积等比例缩放关系
$$\operatorname{SignedArea}(T(\hat{\imath}), T(\vec{x})) = \det(A)\cdot y,\qquad \operatorname{SignedArea}(T(\vec{x}), T(\hat{\jmath})) = \det(A)\cdot x$$
二维克莱姆法则(Cramer's Rule)
$$x = \frac{\det\begin{bmatrix} b_1 & a_{12} \\ b_2 & a_{22} \end{bmatrix}}{\det(A)},\qquad y = \frac{\det\begin{bmatrix} a_{11} & b_1 \\ a_{21} & b_2 \end{bmatrix}}{\det(A)} \qquad (\det(A)\neq 0)$$

线性方程组的几何视角与学习克莱姆法则的意义

⏱ 00:11 – 03:13

在实际工程中,高斯消元法总是比克莱姆法则跑得更快,但深入剖析克莱姆法则是一次绝佳的数学“文化之旅”:它不仅能检验我们是否真正吃透了线性代数的底层结构,还能把线性方程组和行列式优雅地串联在一起。

几何上,一个 $2\times 2$ 线性方程组 $A\vec{x}=\vec{b}$ 就像一个已知终点的追踪谜题:我们知道变换矩阵 $A$(两列记录了 $\hat{\imath}$ 和 $\hat{\jmath}$ 的落点),也知道输出向量 $\vec{b}=\begin{bmatrix}-4\\-2\end{bmatrix}$,要反推究竟哪一个未知输入向量 $\begin{bmatrix}x\\y\end{bmatrix}$ 经过变换后恰好落到 $\vec{b}$ 上。

⚠️ 限定前提:$\det(A) \neq 0$
如果 $\det(A)=0$,整个空间会被压扁到更低维度,此时方程组要么无解(输出不在列空间里),要么有无穷多解。本讲限定在 $\det(A)\neq 0$ 的非退化情况:输出依然张满整个 $n$ 维空间,输入与输出形成严格的一一对应。
克莱姆法则概览:以 $3\times 3$ 线性方程组用列替换行列式比值解出 $x$ 引入全篇主题 00:25
克莱姆法则概览:以 $3\times 3$ 线性方程组用列替换行列式比值解出 $x$ 引入全篇主题画面重点:三阶线性方程组与克莱姆法则比值公式
二维方程组的几何建模:已知矩阵 $A=[[3,2],[-1,2]]$ 与输出向量 $[-4,-2]^T$,反推输入 $[x,y]^T$ 01:55
二维方程组的几何建模:已知矩阵 $A=[[3,2],[-1,2]]$ 与输出向量 $[-4,-2]^T$,反推输入 $[x,y]^T$画面重点:坐标网格及 $A[x,y]^T=[-4,-2]^T$ 矩阵等式
退化情形对比:当矩阵将平面压扁至直线(行列式为零)时,输入输出不再一一对应 02:42
退化情形对比:当矩阵将平面压扁至直线(行列式为零)时,输入输出不再一一对应画面重点:折叠坍缩成一维斜线的二维网格与 $A\vec{x}=\vec{v}$
非退化限定:当 $\det(A)\neq 0$ 时,变换后空间维持原有维度,每个输出存在唯一输入解 03:04
非退化限定:当 $\det(A)\neq 0$ 时,变换后空间维持原有维度,每个输出存在唯一输入解画面重点:$\det(A)\neq 0$ 标注及完整拉伸后的二维网格
[00:11] ↗
在之前的视频中,我讲过线性方程组,当时一笔带过了具体求解它们的方法。
In a previous video I've talked about linear systems of equations, and I sort of brushed aside the discussion of actually computing solutions to these systems.
[00:20] ↗
虽然繁琐的数值计算通常可以交给计算机,但深入研究一些计算方法,是检验你是否真正理解背后原理的一块绝佳试金石——因为这正是理论真正落到实处的关键所在。
And while it's true that number crunching is typically something we leave to the computers, digging into some of these computational methods is a good litmus test for whether or not you actually understand what's going on, since that's really where the rubber meets the road.
[00:32] ↗
本期视频中,我想从几何角度解释一种求解线性方程组的方法,它就是著名的克莱姆法则(Cramer's rule)。
Here I want to describe the geometry behind a certain method for computing solutions to these systems, known as Cramer's rule.
[00:40] ↗
本期内容需要的背景知识包括行列式、少量点积知识,当然还有线性方程组本身;如果你对这些概念还不熟悉或有些生疏,建议先回顾对应的视频。
The relevant background here is understanding determinants, a little bit of dot products, and of course linear systems of equations, so be sure to watch the relevant videos on those topics if you're unfamiliar or rusty.
[00:51] ↗
不过首先我要坦白说,克莱姆法则其实并不是求解线性方程组最高效的方法,例如高斯消元法在实际计算中总是比它更快。
But first I should say up front that this Cramer's rule is not actually the best way for computing solutions to linear systems of equations, Gaussian elimination for example will always be faster.
[01:02] ↗
那为什么还要学它呢?
So why learn it?
[01:04] ↗
不妨把它看作一次数学文化之旅吧。
Well think of it as a sort of cultural excursion.
[01:06] ↗
这是一次非常有价值的思维训练,能加深你对线性方程组背后理论的认识。
It's a helpful exercise in deepening your knowledge of the theory behind these systems.
[01:11] ↗
彻底弄懂这个思路,能帮你把行列式、线性方程组等线性代数核心概念融会贯通,看清它们之间的内在联系。
Wrapping your mind around this concept is going to help consolidate ideas from linear algebra, like the determinant and linear systems, by seeing how they relate to each other.
[01:20] ↗
而且单从数学美感来看,它最终呈现的几何图景实在太优美了,远比按部就班的高斯消元法赏心悦目得多。
Also from a purely artistic standpoint the ultimate result here is just really pretty to think about, way more so than Gaussian elimination.
[01:29] ↗
好了,我们先设定一个场景:一个线性方程组,比如包含两个未知数 x、y 以及两个方程。
Alright so the setup here will be some linear system of equations, say with two unknowns x and y and two equations.
[01:36] ↗
原则上,我们接下来讨论的一切都可以推广到未知数更多、且方程数与未知数个数相等的方程组,不过为了直观起见,先看一个小规模的例子更容易在大脑中构想画面。
In principle everything we're talking about will also work for systems with larger number of unknowns and the same number of equations, but for simplicity a smaller example is just nicer to hold in our heads.
[01:46] ↗
正如我在前面视频中所讲的,你可以从几何上把这个方程组看作:某个已知矩阵对未知向量 (x, y) 施加线性变换,而我们已知变换后的输出向量,在这个例子里是 (-4, -2)。
So as I talked about in a previous video you can think of this setup geometrically as a certain known matrix transforming an unknown vector x y where you know what the output is going to be, in this case negative 4 negative 2.
[02:01] ↗
记住,矩阵的各列刻画了这个变换的具体作用,每一列分别告诉你输入空间的基向量变换后落在哪里。
Remember the columns of this matrix are telling you how that matrix acts as a transform, each one telling you where the basis vectors of the input space land.
[02:11] ↗
所以我们面临的就像是一个谜题:究竟哪一个输入向量 (x, y),在变换后会恰好落在输出向量 (-4, -2) 的位置上?
So what we have is a sort of puzzle, which input vector x y is going to land on this output negative 4 negative 2.
[02:20] ↗
思考这个小谜题的一种方式是:我们知道给定的输出向量,可以写成矩阵两列的线性组合,也就是 x 乘以变换后的i帽,加上 y 乘以变换后的j帽;而我们的目标是找出这组线性组合的系数究竟是多少。
One way to think about our little puzzle here is that we know the given output vector is some linear combination of the columns of the matrix x times the vector where i hat lands plus y times the vector where j hat lands, but what we want is to figure out what exactly that linear combination should be.
[02:37] ↗
请记住,解的情况取决于该变换是否把整个空间压缩到了更低的维度,也就是说,它的行列式是否为零。
Remember the type of answer you get here can depend on whether or not the transformation squishes all of space into a lower dimension, that is if it has a zero determinant.
[02:46] ↗
如果行列式为零,要么没有任何输入向量能落在给定输出上,要么会有无穷多个输入向量同时落在它上面。
In that case either none of the inputs land on our given output, or there's a whole bunch of inputs landing on that output.
[02:57] ↗
但在本期视频中,我们把讨论限定在行列式非零的情况,这意味着变换后的输出仍然张满它最初所在的整个 n 维空间。
But for this video we'll limit our view to the case of a non-zero determinant, meaning the outputs of this transformation still span the full in-dimensional space that it started in.
[03:08] ↗
每一个输入向量只对应唯一一个输出向量,反过来每一个输出向量也只对应唯一一个输入向量。
Every input lands on one and only one output, and every output has one and only one input.

为何“点积求坐标”在一般变换下失效?(正交变换的启示)

⏱ 03:14 – 05:34

先看一个“方向正确但结论错误”的尝试:在输入空间中,未知向量的横坐标 $x=\vec{x}\cdot\hat{\imath}$、纵坐标 $y=\vec{x}\cdot\hat{\jmath}$。如果变换前后点积保持不变,那只要拿已知输出向量 $\vec{b}$ 分别与矩阵的两列点乘不就能直接读出 $x,y$ 了吗?

可惜绝大多数线性变换都不保持点积:原本同向、点积为正的两向量可能被拉扯成钝角使点积变负;原本相互垂直(点积为 $0$)的 $\hat{\imath}$、$\hat{\jmath}$ 变换后通常也不再垂直,长度也会被任意拉伸。

💡 特例中的启示:正交变换(Orthonormal Transformations)
唯独把所有基向量保持两两正交且为单位长度的变换(即纯旋转等无伸缩变形的刚体运动)才严格保持任意向量的点积不变。对这类正交矩阵,确实直接满足 $x=\vec{a}_1\cdot\vec{b},\;y=\vec{a}_2\cdot\vec{b}$。虽然该捷径对一般矩阵失效,但它指明了核心探索方向:有没有另一种关于坐标 $x,y$ 的几何表达,在一般线性变换后依然能受控保持关系?
初步尝试:未知向量的 $x$ 坐标在变换前等于它与第一个基向量 $[1,0]^T$ 的点积 03:24
初步尝试:未知向量的 $x$ 坐标在变换前等于它与第一个基向量 $[1,0]^T$ 的点积画面重点:$[x,y]^T\cdot[1,0]^T=x$ 及其在平面上的直角投影
失效演示:一般变换会扭曲夹角与长度,使原本同向正点积的两个向量变为钝角负点积 04:08
失效演示:一般变换会扭曲夹角与长度,使原本同向正点积的两个向量变为钝角负点积画面重点:拉开后的 $T(\vec{v}), T(\vec{w})$ 与 $\vec{v}\cdot\vec{w}>0$ 对比
重要特例——正交变换(Orthonormal):保持所有基向量相互垂直且单位长,因而保持所有点积不变 04:40
重要特例——正交变换(Orthonormal):保持所有基向量相互垂直且单位长,因而保持所有点积不变画面重点:If $T(\vec{v})\cdot T(\vec{w})=\vec{v}\cdot\vec{w}$, $T$ is Orthonormal
正交矩阵求解特例:在旋转矩阵等正交变换下,直接取输出与矩阵各列点积即可得到坐标 $x,y$ 05:18
正交矩阵求解特例:在旋转矩阵等正交变换下,直接取输出与矩阵各列点积即可得到坐标 $x,y$画面重点:旋转矩阵方程与 $x = [1,2]^T\cdot [\cos 30^\circ, \sin 30^\circ]^T$
[03:14] ↗
作为第一轮尝试,我先给你展示一个虽然结论不对、但思路方向却很启发人的想法。
As a first pass let me show you an idea that's wrong but in the right direction.
[03:19] ↗
这个神秘输入向量的 x 坐标,其实就是它与第一个基向量 (1, 0) 做点积的结果。
The x coordinate of this mystery input vector is what you get by taking its dot product with the first basis vector 1 0.
[03:26] ↗
同理,它的 y 坐标就是它与第二个基向量 (0, 1) 做点积的结果。
Likewise the y coordinate is what you get by dotting it with the second basis vector 0 1.
[03:32] ↗
于是你也许会满怀希望地猜想:在经过变换之后,输出向量(即变换后的神秘向量)与变换后基向量的点积,会不会依然等于这些坐标 x 和 y 呢?
So maybe you hope that after the transformation the dot products with the transformed version of the mystery vector with the transformed version of the basis vectors will also be these coordinates x and y.
[03:44] ↗
如果真是那样就太棒了,因为我们完全知道输出向量以及变换后基向量的具体数值。
That'd be fantastic because we know what the transformed version of each of those vectors are.
[03:51] ↗
可惜这个猜想有一个致命问题:它根本不成立。
There's just one problem with it, it's not at all true.
[03:55] ↗
对于绝大多数线性变换,变换前与变换后的点积结果往往大相径庭。
For most linear transformations the dot product before and after the transformation will look very different.
[04:01] ↗
举个例子,原本两个大致指向相同方向、点积为正的向量,在变换过程中可能会被相互拉开,结果最终的点积反而变成了负数。
For example, you could have two vectors generally pointing in the same direction with a positive dot product, which get pulled apart from each other during the transformation in such a way that they end up having a negative dot product.
[04:12] ↗
同样地,原本相互垂直、点积为 0 的向量——比如两个标准基向量——在变换之后往往不再彼此垂直,也就是说它们不会保持那份 0 点积。
Likewise things that start off perpendicular with dot product 0, like the two basis vectors, quite often don't stay perpendicular to each other after the transformation, that is they don't preserve that 0 dot product.
[04:24] ↗
再看刚才展示的例子,点积显然也没有保持不变,由于大多数向量被拉长了,点积往往会变大。
And looking at the example I just showed dot products certainly aren't preserved, they tend to get bigger since most vectors are getting stretched out.
[04:31] ↗
不过这里有一个值得顺带一提的重要特例:确实能保持点积不变的变换非常特别,它们拥有一个专门的名字——正交变换(orthonormal transformations)。
In fact, worthwhile side note here, transformations which do preserve dot products are special enough to have their own name, orthonormal transformations.
[04:40] ↗
正交变换会让所有基向量在变换后依然保持两两相互垂直,并且长度仍为单位长度 1。
These are the ones that leave all of the basis vectors perpendicular to each other and still with unit lengths.
[04:46] ↗
你通常会把这类变换想象成旋转矩阵,它们对应的是没有拉伸、挤压或扭曲变形的刚体运动。
You often think of these as the rotation matrices, they correspond to rigid motion with no stretching or squishing or morphing.
[04:53] ↗
用正交矩阵求解线性方程组其实超级简单。
Solving a linear system with an orthonormal matrix is actually super easy.
[04:57] ↗
因为点积在变换前后保持不变,所以计算输出向量与矩阵各列的点积,就等同于计算神秘输入向量与各标准基向量的点积——而这恰恰就是在直接读取神秘输入向量的各个坐标。
Because dot products are preserved, taking the dot product between the output vector and all the columns of your matrix will be the same as taking the dot product between the mystery input vector and all of the basis vectors, which is the same as just finding the coordinates of that mystery input.
[05:14] ↗
因此,在这种非常特殊的情况下,x 就是矩阵第一列与输出向量的点积,而 y 就是矩阵第二列与输出向量的点积。
So in that very special case, x would be the dot product of the first column with the output vector, and y would be the dot product of the second column with the output vector.
[05:27] ↗
既然这个思路对几乎所有一般线性方程组都会失效,我为什么还要专门提起它呢?
Why am I bringing this up when this idea breaks down for almost all linear systems?
[05:31] ↗
因为它为我们指明了接下来要寻找的方向。
Well, it points us in a direction of something to look for.

奇思妙想:用有向面积与有向体积重新刻画坐标

⏱ 05:34 – 07:51

真正能在一般变换后保持比例受控的几何量,不是点积,而是有向面积与有向体积!先把平面上未知向量 $\begin{bmatrix}x\\y\end{bmatrix}$ 的坐标改写成平行四边形的面积:

  • $y$ 坐标的面积表达:取 $\hat{\imath}$ 与 $\begin{bmatrix}x\\y\end{bmatrix}$ 张成的平行四边形,其底边长度为 $1$、垂直于底的高正是 $y$,因此有向面积 $\operatorname{SignedArea}(\hat{\imath},\vec{x}) = 1\times y = y$(当 $y<0$ 时因顺序定向翻转恰好给出负面积)。
  • $x$ 坐标的面积表达:对称地,取 $\begin{bmatrix}x\\y\end{bmatrix}$ 与 $\hat{\jmath}$ 张成的平行四边形(注意顺序保持 $\vec{x}$ 在前),其有向面积 $\operatorname{SignedArea}(\vec{x},\hat{\jmath}) = 1\times x = x$。
📐 三维坐标的有向体积推广
$$z = \det\begin{bmatrix} 1 & 0 & x \\ 0 & 1 & y \\ 0 & 0 & z \end{bmatrix}$$
在三维空间中,以 $\hat{\imath}$、$\hat{\jmath}$ 张成面积为 $1$ 的单位正方形为底面,再与未知向量 $(x,y,z)$ 搭成平行六面体,按右手定则定义的有向体积恰好等于第三个坐标 $z$。
二维重构 $y$ 坐标:由 $\hat{\imath}$ 与 $[x,y]^T$ 张成底为 $1$、高为 $y$ 的平行四边形,面积等于 $y$ 06:00
二维重构 $y$ 坐标:由 $\hat{\imath}$ 与 $[x,y]^T$ 张成底为 $1$、高为 $y$ 的平行四边形,面积等于 $y$画面重点:绿色底边 $1$、白色大括号高 $y$ 与 Area $= 1\times y$ 标注
有向面积处理负坐标:当向量位于 $x$ 轴下方($y<0$)时,定向翻转使有向面积自然为负 06:28
有向面积处理负坐标:当向量位于 $x$ 轴下方($y<0$)时,定向翻转使有向面积自然为负画面重点:Signed Area $= y$ 红色反向阴影平行四边形
二维重构 $x$ 坐标:由 $[x,y]^T$ 与 $\hat{\jmath}$ 张成的平行四边形,其有向面积等于 $x$ 06:45
二维重构 $x$ 坐标:由 $[x,y]^T$ 与 $\hat{\jmath}$ 张成的平行四边形,其有向面积等于 $x$画面重点:以 $\hat{\jmath}$ 为垂直底边 $1$、高为 $x$ 的平行四边形 Area $= 1\times x$
三维推广:由 $\hat{\imath},\hat{\jmath}$ 与未知向量张成的平行六面体,底面积为 $1$,有向体积恰等于 $z$ 坐标 07:20
三维推广:由 $\hat{\imath},\hat{\jmath}$ 与未知向量张成的平行六面体,底面积为 $1$,有向体积恰等于 $z$ 坐标画面重点:三维灰白色平行六面体与 $z = \det([1,0,x;0,1,y;0,0,z])$
[05:34] ↗
我们能不能为输入向量的各个坐标找到另一种几何诠释,使它在经过一般线性变换之后,依然能保留某种可控的联系呢?
Is there an alternate geometric understanding for the coordinates of our input vector that remains unchanged after the transformation?
[05:42] ↗
如果你一直在脑海中琢磨行列式,或许就会想到下面这个巧妙的点子。
If your mind has been mulling over determinants, you might think of the following clever idea.
[05:47] ↗
考虑由第一个基向量 i帽 和神秘输入向量 (x, y) 所张成的平行四边形。
Take the parallelogram defined by the first basis vector i-hat and the mystery input vector xy.
[05:54] ↗
这个平行四边形的面积等于底边长度 1 乘以垂直于底边的高,而这个高恰恰就是输入向量的 y 坐标。
The area of this parallelogram is the base, 1, times the height perpendicular to that base, which is the y-coordinate of that input vector.
[06:04] ↗
所以,这个平行四边形的面积,就成了描述向量 y 坐标的一种看似拐弯抹角的巧妙方式。
So the area of that parallelogram is a sort of screwy roundabout way to describe the vector's y-coordinate.
[06:10] ↗
用这种方式谈论坐标确实有些古怪,不过请先跟着我往下看。
It's a wacky way to talk about coordinates, but run with me.
[06:14] ↗
而且再严谨一点说,你应该把它理解成这个平行四边形的有向面积,就像我们在行列式那一讲中定义的那样。
And actually, to be a little more accurate, you should think of this as the signed area of that parallelogram, in the sense described in the determinant video.
[06:22] ↗
这样一来,y 坐标为负的向量就会对应这个平行四边形的负面积——只要我们约定在这两个张成平行四边形的向量中,i帽 排在第一位。
That way, a vector with a negative y-coordinate would correspond to a negative area for this parallelogram, at least if you think of i-hat as in some sense being the first out of these two vectors defining the parallelogram.
[06:35] ↗
对称地,如果你观察由神秘输入向量和第二个基向量 j帽 所张成的平行四边形,它的有向面积就恰好等于这个神秘向量的 x 坐标。
And symmetrically, if you look at the parallelogram spanned by our mystery input vector and the second basis, j-hat, its area is going to be the x-coordinate of that mystery vector.
[06:46] ↗
同样地,这种表示 x 坐标的方式依然很奇特,但过一会儿你就会看到它带来的巨大回报。
Again, it's a strange way to represent the x-coordinate, but see what it buys us in a moment.
[06:51] ↗
为了确保大家清楚这个想法如何推广,我们再来看看三维空间的情况。
And just to make sure it's clear how this might generalize, let's look in three dimensions.
[06:54] ↗
通常情况下,思考一个向量某个坐标(比如 z 坐标)的方法,是求它与第三个标准基向量(常记作 k帽)的点积。
Ordinarily, the way you might think about one of a vector's coordinates, say its z-coordinate, would be to take its dot product with the third standard basis vector, often called k-hat.
[07:04] ↗
但另一种几何解释则是考虑这个向量与另外两个基向量 i帽、j帽 共同张成的平行六面体。
But an alternate geometric interpretation would be to consider the parallelepiped that it creates with the other two basis vectors, i-hat and j-hat.
[07:13] ↗
如果把 i帽 和 j帽 张成的、面积为 1 的正方形视为整个几何体的底面,那么它的体积在数值上就等于它的高,也就是向量的第三个坐标 z。
If you think of the square with area 1 spanned by i-hat and j-hat as the base of this whole shape, then its volume is the same as its height, which is the third coordinate of our vector.
[07:24] ↗
同样地,用这种奇特视角去表达向量的另外两个坐标时,只需要用这个向量,搭配除了目标坐标方向以外的所有其他基向量,来共同构成一个平行六面体。
And likewise, the wacky way to think about the other coordinates of the vector would be to form a parallelepiped using the vector and then all of the basis vectors other than the one corresponding to the direction you're looking for.
[07:36] ↗
那么这个平行六面体的体积,就给出了对应的坐标值。
Then the volume of this gives you the coordinate.
[07:38] ↗
更准确地说,我们讨论的应该是平行六面体的有向体积,即行列式那一讲中借助右手定则所定义的有向体积。
Or rather, we should be talking about the signed volume of parallelepiped in the sense described in the determinant video using the right-hand rule.
[07:46] ↗
因此,列出这三个向量的先后顺序非常重要。
So the order in which you list these three vectors matters.
[07:49] ↗
这样一来,负坐标也就能顺理成章地由负体积来表示了。
That way, negative coordinates still make sense.

面积按 $\det(A)$ 等比例缩放:克莱姆法则的诞生与三维推广

⏱ 07:52 – 11:48

施加矩阵变换 $A$ 后,平面上图形的面积虽然会发生变化,但所有区域的面积都严格乘上同一个缩放系数——$\det(A)$!这一性质直接把输入坐标与输出端的可计算面积连通起来:

原本由 $\hat{\imath}$ 和未知向量 $\vec{x}$ 张成、面积等于 $y$ 的平行四边形,经变换 $A$ 后变成了由矩阵第一列 $T(\hat{\imath})=\vec{a}_1$ 和已知输出向量 $\vec{b}=T(\vec{x})$ 张成的新平行四边形,其有向面积必等于 $\det(A)\cdot y$。用输出端矩阵 $\begin{bmatrix}\vec{a}_1 & \vec{b}\end{bmatrix}$ 的行列式除以 $\det(A)$,瞬间解出 $y$!完全对称地,用输出端替换第一列构成的 $\begin{bmatrix}\vec{b} & \vec{a}_2\end{bmatrix}$ 行列式除以 $\det(A)$,立刻解出 $x$。

📐 具体算例验算:$A=\begin{bmatrix}2 & -1 \\ 0 & 1\end{bmatrix},\;\vec{b}=\begin{bmatrix}4 \\ 2\end{bmatrix}$
$$x = \frac{\det\begin{bmatrix}4 & -1\\ 2 & 1\end{bmatrix}}{\det\begin{bmatrix}2 & -1\\ 0 & 1\end{bmatrix}} = \frac{4 - (-2)}{2 - 0} = \frac{6}{2} = 3,\qquad y = \frac{\det\begin{bmatrix}2 & 4\\ 0 & 2\end{bmatrix}}{\det\begin{bmatrix}2 & -1\\ 0 & 1\end{bmatrix}} = \frac{4}{2} = 2$$
验算原方程组:$A\begin{bmatrix}3\\2\end{bmatrix}=\begin{bmatrix}2(3)-1(2)\\0(3)+1(2)\end{bmatrix}=\begin{bmatrix}4\\2\end{bmatrix}$,完美吻合!
💡 推广到 $n$ 维线性系统的通用法则
在三维或任意 $n$ 维空间中逻辑一模一样:把未知向量 $\vec{x}$ 的第 $k$ 个坐标看作“把标准基第 $k$ 列替换为 $\vec{x}$ 后张成 $n$ 维平行多面体的有向体积”;经非奇异矩阵 $A$ 变换后,该几何体变成“把 $A$ 的第 $k$ 列替换为已知输出向量 $\vec{b}$ 所张成的多面体”,体积缩放 $\det(A)$ 倍,从而立刻得到通用克莱姆公式 $x_k = \frac{\det(A_k(\vec{b}))}{\det(A)}$。
核心定理回顾:在任意线性变换 $A$ 下,平面上所有区域的面积都被等比例缩放 $\det(A)$ 倍 08:10
核心定理回顾:在任意线性变换 $A$ 下,平面上所有区域的面积都被等比例缩放 $\det(A)$ 倍画面重点:All areas get scaled by $\det(A)$ 与多种几何图形面积缩放
追踪 $y$ 平行四边形:变换后由第一列与输出向量张成,面积变成 $\det(A)\cdot y$ 08:48
追踪 $y$ 平行四边形:变换后由第一列与输出向量张成,面积变成 $\det(A)\cdot y$画面重点:Signed Area $= \det(A)y$ 与反解式 $y = \text{Area}/\det(A)$
导出 $y$ 的克莱姆公式:把 $A$ 的第二列替换为输出向量 $[4,2]^T$ 求行列式再除以 $\det(A)$ 09:10
导出 $y$ 的克莱姆公式:把 $A$ 的第二列替换为输出向量 $[4,2]^T$ 求行列式再除以 $\det(A)$画面重点:$y = \det([[2,4],[0,2]]) / \det([[2,-1],[0,1]])$ 推导过程
对称追踪 $x$ 平行四边形:变换后由输出向量与 $A$ 的第二列张成,面积变成 $\det(A)\cdot x$ 09:43
对称追踪 $x$ 平行四边形:变换后由输出向量与 $A$ 的第二列张成,面积变成 $\det(A)\cdot x$画面重点:输出向量与第二列 $[-1,1]^T$ 围成的黄色阴影平行四边形
数值验算 $x$ 坐标:替换第一列后的分子行列式为 $4+2=6$,除以 $\det(A)=2$ 得 $x=3$ 10:25
数值验算 $x$ 坐标:替换第一列后的分子行列式为 $4+2=6$,除以 $\det(A)=2$ 得 $x=3$画面重点:$x = \text{Area}/\det(A) = 6/2 = 3$ 完整计算步骤
数值验算 $y$ 坐标:替换第二列后的分子行列式为 $4$,除以 $\det(A)=2$ 得 $y=2$ 10:43
数值验算 $y$ 坐标:替换第二列后的分子行列式为 $4$,除以 $\det(A)=2$ 得 $y=2$画面重点:$y = \text{Area}/\det(A) = 4/2 = 2$ 完整计算步骤
三维推广思考:将 $(\hat{\imath},\hat{\jmath},\vec{x})$ 张成的平行六面体送入三维线性变换,体积缩放 $\det(A)$ 倍 11:24
三维推广思考:将 $(\hat{\imath},\hat{\jmath},\vec{x})$ 张成的平行六面体送入三维线性变换,体积缩放 $\det(A)$ 倍画面重点:随三维空间网格同步扭曲缩放后的灰白平行六面体
[07:52] ↗
好了,为什么要费尽周折把坐标看成面积和体积呢?
Okay, so why think of coordinates as areas and volumes like this?
[07:56] ↗
原因在于,当你对空间施加某个矩阵变换时,这些平行四边形的面积虽然不会保持不变,可能会被放大或缩小,
Well, as you apply some sort of matrix transformation, the areas of these parallelograms, well, they don't stay the same, they might get scaled up or down.
[08:04] ↗
但是——这正是行列式的核心思想——平面上所有区域的面积都会按完全相同的比例缩放,这个比例恰好就是变换矩阵的行列式。
But, and this is the key idea of determinants, all of the areas get scaled by the same amount, namely the determinant of our transformation matrix.
[08:14] ↗
举个例子,如果观察由变换后的第一个基向量(即矩阵的第一列)与变换后的未知向量 (x, y) 所张成的平行四边形,它的面积是多少呢?
For example, if you look at the parallelogram spanned by the vector where your first basis vector lands, which is the first column of the matrix, and the transformed version of xy, what is its area?
[08:26] ↗
它正是我们刚才研究的那个平行四边形变换后的样子——变换前那个平行四边形的面积恰好等于神秘输入向量的 y 坐标。
Well, this is the transformed version of the parallelogram we were looking at earlier, the one whose area was the y-coordinate of the mystery input vector.
[08:34] ↗
因此,变换后的面积必然就等于该变换的行列式乘以这个 y 坐标。
So its area is just going to be the determinant of the transformation multiplied by that y-coordinate.
[08:40] ↗
这就意味着,我们可以用输出空间中这个新平行四边形的面积,除以整个变换的行列式,从而直接解出 y。
So that means we can solve for y by taking the area of this new parallelogram in the output space divided by the determinant of the full transformation.
[08:51] ↗
那么这个输出空间的面积又该怎么求呢?
And how do you get that area?
[08:53] ↗
别忘了,我们本来就知道神秘输入向量变换后落在哪里——输出向量的坐标正是线性方程组已知条件的核心所在。
Well, we know the coordinates for where the mystery input vector lands, that's the whole point of a linear system of equations.
[09:00] ↗
所以你只需要构造一个新矩阵:它的第一列与原矩阵第一列相同,而第二列替换成已知的输出向量,然后计算这个新矩阵的行列式即可。
So what you might do is create a new matrix whose first column is the same as that of our matrix, but whose second column is the output vector, and then you take its determinant.
[09:11] ↗
看看这个结果:仅仅利用输出端的数据——也就是原矩阵的列向量和输出向量的坐标——我们就把神秘输入向量的 y 坐标恢复出来了,这已经解决掉一半方程组了。
So look at that, just using data from the output of the transformation, namely the columns of the matrix and the coordinates of our output vector, we can recover the y-coordinate of the mystery input vector, which is halfway to solving the system.
[09:25] ↗
同样地,完全相同的思路也能帮我们求出 x 坐标。
Likewise, the same idea can give us the x-coordinate.
[09:28] ↗
看看我们之前定义过的另一个平行四边形,它是由神秘输入向量和 j帽 张成的,编码了神秘输入向量的 x 坐标。
Look at the parallelogram we defined earlier, which encodes the x-coordinate of the mystery input vector spanned by that vector and j-hat.
[09:36] ↗
经过变换后,它变成了由输出向量和原矩阵第二列所张成的平行四边形,其面积必然被乘上了这个矩阵的行列式。
The transformed version of this guy is spanned by the output vector and the second column of the matrix, and its area will have been multiplied by the determinant of that matrix.
[09:48] ↗
因此要求解 x,你只需要拿这个新平行四边形的面积,除以原变换的行列式即可。
So to solve for x, you can take this new area divided by the determinant of the full transformation.
[09:54] ↗
与刚才的做法如出一辙,你可以构造一个新矩阵来计算这个输出平行四边形的面积:让它的第一列为输出向量,第二列保留原矩阵的第二列。
And similar to what we did before, you can compute the area of that output parallelogram by creating a new matrix whose first column is the output vector and whose second column is the same as the original matrix.
[10:06] ↗
于是再一次,仅仅依靠输出空间的数据——也就是我们在原始线性方程组中能直接看到的那些数字——我们就能把 x 究竟是多少给算出来。
So again, just using data from the output space, the numbers we see in our original linear system, we can solve for what x must be.
[10:13] ↗
这套用来求解线性方程组的公式,就是著名的克莱姆法则。
This formula for finding the solutions to a linear system of equations is known as Cramer's rule.
[10:19] ↗
我们顺手代几个具体数字进来验算一下,确认结果无误。
Here, just to sanity check ourselves, plug in some numbers here.
[10:22] ↗
分子上那个替换列后得到的矩阵,其行列式是 4 加 2 等于 6,分母的行列式是 2,所以算出的 x 坐标应该是 3。
The determinant of that top altered matrix is 4 plus 2, which is 6, and the bottom determinant is 2, so the x-coordinate should be 3.
[10:31] ↗
回头核对一下我们一开始设定的输入向量,它的 x 坐标确实就是 3。
And indeed, looking back at the input vector we started with, the x-coordinate is 3.
[10:36] ↗
同理,克莱姆法则给出 y 坐标应该是 4 除以 2 等于 2,而这同样正是我们最初输入向量的 y 坐标。
Likewise, Cramer's rule suggests that the y-coordinate should be 4 divided by 2, or 2, and that is in fact the y-coordinate of the input vector we were starting with.
[10:47] ↗
三维乃至更高维度的情形也完全类似,我强烈建议你暂停一下视频,自己把推导过程梳理一遍。
The case with three dimensions or more is similar, and I highly recommend you take a moment to pause and think through it yourself.
[10:54] ↗
来,我先给你起个头。
Here, I'll give you a little bit of momentum.
[10:56] ↗
我们手头有一个由某个 3×3 矩阵给出的已知变换,以及方程组等号右边给出的已知输出向量,我们想知道哪个输入向量变换后会落在这个输出上。
What we have is a known transformation given by some 3x3 matrix and a known output vector given by the right side of our linear system, and we want to know what input lands on that output.
[11:09] ↗
如果你把输入向量的 z 坐标看作之前那个特殊平行六面体的体积——也就是由 i帽、j帽 和神秘输入向量张成的平行六面体——那么经过这个线性变换后,它的体积会发生怎样的变化?
And if you think of, say, the z-coordinate of that input vector as the volume of that special parallelepiped we were looking at earlier, spanned by i-hat, j-hat, and the mystery input vector, what happens to that volume after the transformation?
[11:25] ↗
又有哪些不同的方法可以算出变换后的这个体积呢?
And what are the various ways you can compute that volume?
[11:28] ↗
真心建议你暂停一会儿,把推广到高维的细节亲手推敲一遍,写出更大规模线性方程组解的每一个坐标表达式。
Really, pause and take a moment to think through the details of generalizing this to higher dimensions, finding an expression for each coordinate of the solution to a larger linear system.
[11:38] ↗
独立思考这类更一般的情形,并说服自己它为什么成立以及怎样成立,才是真正习得知识的过程——这可比光听 YouTube 上某个家伙再给你把同样的推理讲一遍管用得多。
Thinking through more general cases like this and convincing yourself that it works and why it works is where all the learning really happens, much more so than listening to some dude on YouTube walk you through the same reasoning again.

📝 几何直觉自测(点击题目展开解答)

Q1. 为什么说只有正交变换(Orthonormal transformations)才能直接用输出向量与矩阵各列做点积来求未知坐标?▼
未知输入向量 $\vec{x}$ 的坐标在输入空间等于它与标准基向量 $\hat{\imath},\hat{\jmath}$ 的点积。一般线性变换会拉伸向量长度、改变夹角,因此点积在变换前后不保持不变;只有正交变换能令基向量变换后仍保持单位长度且两两垂直,从而严格保持所有点积不变,使得 $x_k = \vec{x}\cdot\hat{e}_k = T(\vec{x})\cdot T(\hat{e}_k) = \vec{b}\cdot\vec{a}_k$。
Q2. 在二维情况下,如何把未知向量 $\vec{x}=(x,y)^T$ 的 $x$ 坐标表示为平行四边形的有向面积?为什么向量顺序不能写反?▼
由 $\vec{x}$ 和第二个基向量 $\hat{\jmath}$ 张成的平行四边形以 $\hat{\jmath}$ 为底(长度 $1$),高为 $|x|$;按先 $\vec{x}$ 后 $\hat{\jmath}$ 的顺序(对应矩阵 $[\vec{x}\;\hat{\jmath}]$),当 $x>0$ 时 $\vec{x}$ 在 $\hat{\jmath}$ 右侧,有向面积为 $+x$,当 $x<0$ 时 $\vec{x}$ 在 $\hat{\jmath}$ 左侧,有向面积为 $-|x|=x$。若写成 $[\hat{\jmath}\;\vec{x}]$ 则符号正好相反。
Q3. 克莱姆法则的几何推导依赖行列式的哪一条核心定理?它如何导出最终除法公式?▼
依赖“任意线性变换 $A$ 将平面(或空间)上所有区域的面积(或体积)统一缩放 $\det(A)$ 倍”。输入空间中以 $\hat{\imath}$ 和 $\vec{x}$ 张成的面积为 $y$ 的平行四边形,变换后成为以第一列 $\vec{a}_1$ 与输出向量 $\vec{b}$ 张成的平行四边形,其面积必为 $\det(A)\cdot y$,同时也等于 $\det([\vec{a}_1\;\vec{b}])$,故立即得到 $y=\det([\vec{a}_1\;\vec{b}])/\det(A)$。
Q4. 如果矩阵 $A$ 的行列式 $\det(A)=0$,克莱姆法则还能使用吗?为什么?▼
不能使用。不仅代数上分母 $\det(A)=0$ 导致除零无意义,几何上 $\det(A)=0$ 意味着变换把空间压缩到了更低维度,所有输出区域面积都被压成 $0$,无法通过面积比值区分唯一的输入向量(方程组此时无解或有无穷多解)。