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

第 06·附注 集:非方阵:不同维度间的线性变换

Nonsquare matrices as transformations between dimensions
一句话直觉:$m\times n$ 非方阵完全遵循“列即变换后基向量落点”的同一规则,只不过它架设在两个维度不同的独立空间之间:列数 $n$ 决定输入空间的维数,行数 $m$ 决定输出空间的维数。

作为方阵线性变换的简短附注,本章将几何框架推广到任意维度的跨维映射:从 $3\times 2$ 矩阵把二维平面嵌入三维空间,到 $2\times 3$ 矩阵把三维空间压入二维平面,再到 $1\times 2$ 矩阵把二维向量映向一维数轴——后者直接为下一章“点积与对偶性”埋下关键伏笔。

▶ YouTube 原片 📺 B站官方双语 P9 🎙 B站中文配音 P9

前置依赖

← 第 04·附注 集 · 三维空间的线性变换:熟悉用三维列向量编码线性变换后基向量的落点位置。
← 第 06 集 · 逆矩阵、列空间、秩与零空间:理解列空间与满秩概念(秩等于矩阵列数 / 输入空间维数)。

后续延伸

→ 第 07 集 · 点积与对偶性:将 $1\times 2$ 矩阵代表的“二维向量映向数轴”线性变换与向量点积建立严格对偶。
m×n 矩阵的跨维映射规则
$$A \in \mathbb{R}^{m \times n} \iff L: \mathbb{R}^n \to \mathbb{R}^m \quad (\text{列数}=\text{输入维数},\; \text{行数}=\text{输出维数})$$
3×2 示例矩阵(2D → 3D)
$$\begin{bmatrix} 2 & 0 \\ -1 & 1 \\ -2 & 1 \end{bmatrix}: \; \hat{\imath} \mapsto \begin{bmatrix} 2 \\ -1 \\ -2 \end{bmatrix},\; \hat{\jmath} \mapsto \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}$$
1×2 矩阵与点积伏笔(2D → 1D)
$$\begin{bmatrix} a & b \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = ax + by \in \mathbb{R}^1$$

3×2 矩阵:从二维输入空间映射到三维输出空间

⏱ 00:11 – 02:37

此前我们只探讨过 $2\times 2$(二维到二维)与 $3\times 3$(三维到三维)的方阵。实际上,线性变换完全可以发生在不同维度之间,例如把二维向量映射到三维空间。判断它是否线性的核心条件依然不变:网格线保持平行且等距分布,并且原点映射为自身。

⚠️ 两个完全独立的“物种”空间
展示跨维度变换时,画面左侧是二维输入空间,右侧是三维输出空间,而不像方阵那样把同一套网格直接扭动变形。这并非动画偷懒,而是因为二维输入向量与三维输出向量本质上是完全不同的“物种”,它们生活在毫无直接关联的两套独立空间中。
📐 3×2 矩阵的列编码规则
$$A = \begin{bmatrix} 2 & 0 \\ -1 & 1 \\ -2 & 1 \end{bmatrix}, \qquad L(\hat{\imath}) = \begin{bmatrix} 2 \\ -1 \\ -2 \end{bmatrix},\quad L(\hat{\jmath}) = \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}$$
矩阵有 3 行 2 列,因而称为 3×2 矩阵(读作“三乘二”):两列分别记录两个二维基向量在三维输出空间中的三维落点坐标。

用上一章的术语审视这个 $3\times 2$ 矩阵:它的列空间(所有可能输出落点的集合)是三维空间中穿过原点的一张斜二维平面。然而它依然被称为满秩(full rank)矩阵——因为列空间的维数($2$)恰好等于输入空间的维数(也是列数 $2$),空间并未坍缩。

💡 一眼看穿 3×2 矩阵维度密码
以后在野外遇到任意一个 $3\times 2$ 矩阵(如视频里的 $\begin{bmatrix}3&1\\4&1\\5&9\end{bmatrix}$):$2$ 列表明输入空间有 $2$ 个基向量(从二维出发),$3$ 行表明每个基向量的落点需要用 $3$ 个坐标描述(落入三维空间)。因此 $3\times 2$ 必然代表 $2\mathrm{D}\to 3\mathrm{D}$ 变换。
跨维度变换概念:2D 向量输入映射到 3D 向量输出 00:50
跨维度变换概念:2D 向量输入映射到 3D 向量输出画面重点:二维列向量 [2;7] 经 L(v) 映为三维列向量 [1;8;2]
双视图分离:左侧 2D 输入空间与右侧 3D 输出空间 01:04
双视图分离:左侧 2D 输入空间与右侧 3D 输出空间画面重点:左右分屏强调输入输出属于完全独立的两套空间
3×2 矩阵构造示例:i-hat 落点与 j-hat 落点作列 01:42
3×2 矩阵构造示例:i-hat 落点与 j-hat 落点作列画面重点:第一列绿色 (2,-1,-2) 与第二列红色 (0,1,1) 构成三行两列矩阵
3×2 矩阵的列空间是三维中过原点的二维平面 02:02
3×2 矩阵的列空间是三维中过原点的二维平面画面重点:Span of columns 对应 Column space,矩阵仍为满秩
维度解码规则:2 列代表 2D 输入,3 行代表 3D 输出 02:28
维度解码规则:2 列代表 2D 输入,3 行代表 3D 输出画面重点:以 π 数字矩阵 [[3,1],[4,1],[5,9]] 演示行列的几何语义
[00:11] ↗
嘿 大家好! 今天我又带来了一个简短的补充说明视频
Hey everyone, I've got another quick footnote for you between chapters today.
[00:15] ↗
目前我所讨论的线性变换 要么是用2×2矩阵来表示的二维向量到二维向量的变换 要么是用3×3矩阵来表示的三维向量到三维向量的变换
When I've talked about linear transformations so far, I've only really talked about transformations from 2D vectors to other 2D vectors, represented with 2x2 matrices, or from 3D vectors to other 3D vectors, represented with 3x3 matrices.
[00:29] ↗
但是有评论询问关于非方阵的问题 所以我觉得我需要花些时间说说它们的几何含义
But several commenters have asked about non-square matrices, so I thought I'd take a moment to just show what those mean geometrically.
[00:35] ↗
就目前的进度而言,你实际上已经拥有大部分背景知识 能够独立思考类似的问题了 不过我还是讨论一下这部分内容,作为精神上的小小鼓励
By now in the series, you actually have most of the background you need to start pondering a question like this on your own, but I'll start talking through it just to give a little mental momentum.
[00:44] ↗
讨论不同维数之间的变换是完全合理的 比如一个二维向量到三维向量的变换
It's perfectly reasonable to talk about transformations between dimensions, such as one that takes 2D vectors to 3D vectors.
[00:52] ↗
同之前一样,如果网格线保持平行且等距分布,并且原点映射为自身,就称它是线性的
Again, what makes one of these linear is that gridlines remain parallel and evenly spaced, and that the origin maps to the origin.
[01:00] ↗
这里所展示的,左侧为输入空间,也就是二维空间 右侧为输出空间,也就是变换后的空间
What I have pictured here is the input space on the left, which is just 2D space, and the output of the transformation shown on the right.
[01:07] ↗
与往常不同的是,我没有展示输入移动至输出的过程 并不只是因为懒得做动画 值得强调一点,输入的二维向量与输出的三维向量是完全不同的“物种” 它们生活在没有任何关联的空间当中
The reason I'm not showing the inputs move over to the outputs like I usually do is not just animation laziness, it's worth emphasizing that 2D vector inputs are very different animals from these 3D vector outputs, living in a completely separate, unconnected space.
[01:22] ↗
用矩阵代表这样一个变换则和之前的方法相同
Encoding one of these transformations with a matrix is really just the same thing as what we've done before.
[01:27] ↗
找到每一个基向量变换后的位置 然后把变换后基向量的坐标作为矩阵的列
You look at where each basis vector lands, and write the coordinates of the landing spots as the columns of a matrix.
[01:34] ↗
比如说,你现在看到的是一个变换后的空间 这个变换将i帽变换到坐标(2, -1, -2),j帽变换到坐标(0, 1, 1)
For example, what you're looking at here is an output of a transformation that takes i-hat to the coordinates 2, negative 1, negative 2, and j-hat to the coordinates 0, 1, 1.
[01:48] ↗
注意一点,这意味着代表这个变换的矩阵是三行两列的 用术语来说,这是一个3×2矩阵
Notice, this means the matrix encoding our transformation has three rows and two columns, which, to use standard terminology, makes it a 3x2 matrix.
[01:58] ↗
用上期视频的语言来说,这个矩阵的列空间 是三维空间中一个过原点的二维平面
In the language of last video, the column space of this matrix, the place where all the vectors land, is a 2D plane slicing through the origin of 3D space.
[02:07] ↗
但是这个矩阵仍然是满秩的 因为列空间的维数与输入空间的维数相等
But the matrix is still full rank, since the number of dimensions in this column space is the same as the number of dimensions of the input space.
[02:17] ↗
所以当你看到一个3×2矩阵的时候 你就明白它的几何意义是将二维空间映射到三维空间上 因为矩阵有两列表明输入空间有两个基向量 有三行表明每一个基向量在变换后都用三个独立的坐标来描述
So if you see a 3x2 matrix out in the wild, you can know that it has the geometric interpretation of mapping two dimensions to three dimensions, since the two columns indicate that the input space has two basis vectors, and the three rows indicate that the landing spots for each of those basis vectors is described with three separate coordinates.

2×3 矩阵:从三维空间压入二维平面

⏱ 02:38 – 03:09

反过来,当你看到一个两行三列($2\times 3$)的矩阵,例如 $\begin{bmatrix} 3 & 1 & 4 \\ 1 & 5 & 9 \end{bmatrix}$ 时,如何解码它的几何动作?

  • $3$ 列:意味着输入空间有 $3$ 个基向量 $\hat{\imath}$、$\hat{\jmath}$、$\hat{k}$,即变换从三维空间出发。
  • $2$ 行:意味着那 $3$ 个基向量变换后的落点,每一个都只用 $2$ 个坐标来描述,说明它们全部落进了二维平面中。

因此,$2\times 3$ 矩阵编码的是从三维空间到二维平面的降维变换(由于完整三维网格压入二维会极其杂乱,画面通常只追踪 $L(\hat{\imath})$、$L(\hat{\jmath})$、$L(\hat{k})$ 这三个落点向量)。想象自己亲身经历从三维被拍扁成二维,绝对是一种令人非常“不舒服”的强烈挤压。

2×3 矩阵结构解码:3 个输入基向量与 2 维落点坐标 02:50
2×3 矩阵结构解码:3 个输入基向量与 2 维落点坐标画面重点:矩阵 [[3,1,4],[1,5,9]] 顶部标注“有三个基向量”
3D 到 2D 降维投影:三个基向量同时落入同一二维平面 03:08
3D 到 2D 降维投影:三个基向量同时落入同一二维平面画面重点:左侧三维基底与右侧二维输出平面上的 L(i), L(j), L(k)
[02:38] ↗
类似的,当你看到一个两行三列的2×3矩阵时,你觉得它代表什么?
Likewise, if you see a 2x3 matrix with two rows and three columns, what do you think that means?
[02:44] ↗
矩阵有三列表明原始空间有三个基向量 也就是说原始空间是三维的 有两行表明这三个基向量在变换后都仅用两个坐标来描述 所以它们一定落在二维空间中
Well, the three columns indicate that you're starting in a space that has three basis vectors, so we're starting in three dimensions, and the two rows indicate that the landing spot for each of those three basis vectors is described with only two coordinates, so they must be landing in two dimensions.
[03:01] ↗
因此这是一个从三维空间到二维空间的变换 想象一下,如果经历这个变换,你会觉得非常不舒服
So it's a transformation from 3D space onto the 2D plane, a transformation that should feel very uncomfortable if you imagine going through it.

1×2 矩阵:二维至一维数轴的变换与点积伏笔

⏱ 03:13 – 04:18

我们还可以把二维空间进一步压进一维空间。一维空间本质上就是一条数轴,所以从二维到一维的线性变换,就是一个接收二维向量、吐出单个实数的映射。

💡 高度压缩下的“线性”判据
把整张二维网格全压到一条数轴上时,“网格线保持平行且等距”的视觉图像会挤成一团。此时等价而清晰的线性判据是:如果你在二维输入平面上沿某条直线取一排等距分布的点,那么在映射到一维数轴之后,它们在数轴上仍然保持等距分布。
📐 1×2 矩阵与数轴落点
$$\begin{bmatrix} 1 & 2 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = 1\cdot x + 2\cdot y$$
该 1×2 矩阵共有两列,每列只有一个数,分别记录 i-hat(落到 1)与 j-hat(落到 2)在数轴上的标量位置。

这种把二维向量变为一维数字的 $1\times 2$ 矩阵变换具有极深远的数学意义,它与我们熟知的点积(dot product)存在紧密到令人惊叹的内在联系——下一章我们将正式揭示这一“对偶性”。同时不妨自行思索:跨维视角下的矩阵乘法(例如 $(2\times 3)$ 乘以 $(3\times 2)$)以及非方阵线性方程组(过定/欠定系统)又各自意味着什么?

2D → 1D 输出空间:一维空间就是一条实数轴 03:21
2D → 1D 输出空间:一维空间就是一条实数轴画面重点:画面呈现横向数轴 1d space (number line)
2D 至 1D 下的线性几何判据:共线等距点保距性 03:36
2D 至 1D 下的线性几何判据:共线等距点保距性画面重点:二维平面中一排黄色等距点在映射后仍保持等距
1×2 矩阵形式:两列各自仅包含单个实数条目 03:48
1×2 矩阵形式:两列各自仅包含单个实数条目画面重点:矩阵括号中含两列单元素,下方对应数轴位置
示例 [1  2] 与点积伏笔:i-hat 落 1,j-hat 落 2 04:03
示例 [1 2] 与点积伏笔:i-hat 落 1,j-hat 落 2画面重点:Transformation matrix [1 2] 揭示点积对偶性的前奏
[03:13] ↗
你还可以有二维空间到一维空间的变换
You could also have a transformation from two dimensions to one dimension.
[03:18] ↗
一维空间实际上就是数轴 所以这样的变换接收二维向量,然后产生一个数
One-dimensional space is really just the number line, so a transformation like this takes in 2D vectors and spits out numbers.
[03:26] ↗
因为空间的挤压,在这里考虑网格线保持平行且等距分布显得有些混乱 所以在这种情况下,形象理解线性性质的含义就是说 如果在一条直线上有一系列等距分布的点 在映射到数轴之后,它们将保持等距分布
Thinking about grid lines remaining parallel and evenly spaced is a little bit messy due to all of the squishification happening here, so in this case, the visual understanding for what linearity means is that if you have a line of evenly spaced dots, it would remain evenly spaced once they're mapped onto the number line.
[03:43] ↗
这样的变换由一个1×2矩阵表示 而这个矩阵的两列都只有一个数
One of these transformations is encoded with a 1x2 matrix, each of whose two columns has just a single entry.
[03:51] ↗
这两列分别代表了变换后的基向量 而它们都只需要一个数字,即变换后基向量在数轴上的位置
The two columns represent where the basis vectors land, and each one of those columns requires just one number, the number that that basis vector landed on.
[03:59] ↗
这实际上是一类非常有意义的变换,它与点积紧密相关 我会在下期视频中讨论这部分内容
This is actually a surprisingly meaningful type of transformation with close ties to the dot product, and I'll be talking about that next video.
[04:06] ↗
在此之前,我鼓励你自己用这些想法去大胆试验 在不同维度间线性变换的背景下,思考矩阵乘积和线性方程组等概念的意义 祝你玩得愉快!
Until then, I encourage you to play around with this idea on your own, contemplating the meanings of things like matrix multiplication and linear systems of equations in the context of transformations between different dimensions. Have fun!

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

Q1. 看到一个 $4\times 3$ 矩阵(4 行 3 列)时,不用做任何计算,你能直接读出它代表的几何映射方向吗?▼
能:$3$ 列说明输入空间有 $3$ 个基向量(三维输入 $\mathbb{R}^3$),$4$ 行说明每个基向量变换后由 $4$ 个坐标描述(四维输出 $\mathbb{R}^4$),因此它代表从三维空间到四维空间的线性变换。
Q2. 为什么一个把二维空间映到三维空间中过原点平面的 $3\times 2$ 矩阵仍然被称为“满秩”?▼
满秩的定义是“矩阵的秩(列空间维数)等于矩阵的列数”。对于 $3\times 2$ 矩阵,列数是 $2$(输入维数为 $2$),其列空间是一张二维平面(维数为 $2$),二者相等,说明没有发生维度信息丢失,故仍为满秩。
Q3. 为什么一个 $3\times 2$ 矩阵不可能对应传统意义上的“方阵行列式”?那 $1\times 2$ 矩阵是如何被检验“线性性”的?▼
行列式衡量的是同维输入空间与同维输出空间之间面积/体积的缩放比,而跨维映射的输入与输出是完全独立的异维空间(例如二维面积无法直接比作三维体积),因此非方阵没有行列式。对于高度压缩到数轴的 $1\times 2$ 变换,线性性的几何判据简化为:任意一条直线上的等距点列映射至数轴后仍保持等距分布(且原点映到 $0$)。
Q4. 按照 $1\times 2$ 矩阵 $\begin{bmatrix}1 & 2\end{bmatrix}$ 的几何规则,向量 $\begin{bmatrix}3 \\ -1\end{bmatrix}$ 会落在数轴上的哪一点?▼
$\hat{\imath}$ 落在数轴的 $1$ 处,$\hat{\jmath}$ 落在数轴的 $2$ 处,因此 $3\hat{\imath} - 1\hat{\jmath}$ 落在 $3\times 1 + (-1)\times 2 = 1$ 处(这恰好等于向量 $(1,2)$ 与 $(3,-1)$ 的点积!)。