Yoneda 引理与泛性质(Yoneda Lemma & Universal Properties)

阶段3.5 · 范畴论基础 · 第3章 | 预计学习时间: 5小时 | 难度: 🔴 困难

📋 前置知识

本章是范畴论第一座顶峰。我们要证明一条乍看玄秘、实则贯穿现代数学的引理:

"一个对象由它'看上去像什么'完全决定。"
— Yoneda 引理 (米田引理), 1954

换成数学语言:$A$ 这个对象的全部信息,等价于一切对象 $X$ 与 $A$ 之间的态射集 $\mathrm{Hom}(X, A)$ 加上它们的相互关系。如果两个对象在所有 Hom 上看起来一样,那它们就是同构。

Yoneda 的伟大之处在于:它给了我们一种用"测试 / 探针"代替"内部结构"的视角。Grothendieck 把这条引理用到极致,重写了整套代数几何——概形被定义为它对所有环表现出来的样子

1. 可表函子 $h^A, h_A$

可表函子(Representable Functor)

固定 $A\in\mathcal{C}$。回忆第2章的两个 Hom 函子:

凡形如 $h^A$ 或 $h_A$ 的函子称为可表函子,$A$ 称为表示对象(representing object)。

换言之,每个对象 $A$ 给出两个"探针函子":站在 $A$ 这一侧观察整个范畴。

2. Yoneda 引理(声明)

Yoneda 引理(核心定理)

设 $\mathcal{C}$ 是局部小范畴,$A\in\mathcal{C}$,$F: \mathcal{C}\to \mathbf{Set}$ 是任意函子。则存在自然双射 $$ \boxed{\;\mathrm{Nat}(h^A,\, F)\;\;\xrightarrow{\;\cong\;}\;\;F(A)\;} $$ 由 $\alpha\mapsto \alpha_A(\mathrm{id}_A)$ 给出。其逆映射把 $a\in F(A)$ 送到自然变换 $\hat a$,分量为 $$ \hat a_X: h^A(X) = \mathrm{Hom}(A, X)\to F(X),\quad f\mapsto F(f)(a). $$ 反变版本:$\mathrm{Nat}(h_A, G)\cong G(A)$ 对反变 $G$ 成立。

这是令人惊讶的压缩:左侧是一族 $\{\alpha_X\}_{X}$(关于所有对象),右侧只是 $F(A)$ 中的一个元素

图解 1:Yoneda 引理 = 一族箭头被一个元素决定

一个 $\textcolor{5d6d7e}{\alpha\in\mathrm{Nat}(h^A, F)}$ 看似有无穷多分量,其实只由 $\textcolor{5d6d7e}{\alpha_A(\mathrm{id}_A)\in F(A)}$ 唯一决定
$\textcolor{1e5fa8}{\mathrm{Nat}(h^A, F)}$ — 一族分量
$\textcolor{1e5fa8}{\alpha_{X_1}: \mathrm{Hom}(A, X_1)\to F(X_1)}$
$\textcolor{1e5fa8}{\alpha_{X_2}: \mathrm{Hom}(A, X_2)\to F(X_2)}$
$\textcolor{b85c10}{\alpha_{A}: \mathrm{Hom}(A, A)\to F(A)}$ ⭐
$\textcolor{1e5fa8}{\alpha_{X_3}: \mathrm{Hom}(A, X_3)\to F(X_3)}$
$\textcolor{1e5fa8}{\alpha_{X_4}, \alpha_{X_5}, \dots}$(无穷多)
取 $\textcolor{c0392b}{\mathrm{id}_A}$ 处的值
$\textcolor{1d7a45}{F(A)}$ — 单个元素
$\textcolor{1d7a45}{F(A)}$
$\textcolor{b85c10}{a := \alpha_A \mathrm{id}_A}$
重建公式:$\textcolor{5d6d7e}{\alpha_X(f) = F(f)(a)}$,对一切 $\textcolor{5d6d7e}{f: A\to X}$

证明(双向构造)

$\Rightarrow$ 方向:给定 $\alpha\in\mathrm{Nat}(h^A, F)$,定义 $\Phi(\alpha) := \alpha_A(\mathrm{id}_A)\in F(A)$。

$\Leftarrow$ 方向:给定 $a\in F(A)$,定义 $\hat a_X(f) := F(f)(a)$ 对所有 $f: A\to X$。验证它确实是自然变换:对 $g: X\to Y$,需证 $F(g)\circ \hat a_X = \hat a_Y\circ h^A(g)$。两侧作用于 $f\in\mathrm{Hom}(A, X)$: $$ F(g)(\hat a_X(f)) = F(g)(F(f)(a)) = F(g\circ f)(a),\qquad \hat a_Y(g\circ f) = F(g\circ f)(a). $$ 相等!✓

互逆:$\Phi(\hat a) = \hat a_A(\mathrm{id}_A) = F(\mathrm{id}_A)(a) = \mathrm{id}_{F(A)}(a) = a$。反过来:由自然性,对任意 $f: A\to X$, $$ \alpha_X(f) = \alpha_X(h^A(f)(\mathrm{id}_A)) = F(f)(\alpha_A(\mathrm{id}_A)) = F(f)(\Phi(\alpha)) = \widehat{\Phi(\alpha)}_X(f). \;\;\square $$

3. Yoneda 嵌入:每个对象都有"画像"

Yoneda 嵌入

函子 $h_{(-)}: \mathcal{C}\to [\mathcal{C}^{\mathrm{op}}, \mathbf{Set}]$,$A\mapsto h_A$,是全忠实的(fully faithful)。即对每对 $A, B\in\mathcal{C}$, $$ \mathrm{Hom}_{\mathcal{C}}(A, B)\;\;\xrightarrow{\;\cong\;}\;\;\mathrm{Nat}(h_A, h_B). $$

推论:$A\cong B$ $\Leftrightarrow$ $h_A\cong h_B$

一个对象由它的"探针视图"完全决定(直到同构)。

图解 2:Yoneda 嵌入 $\mathcal{C}\hookrightarrow [\mathcal{C}^{\mathrm{op}}, \mathbf{Set}]$

把 $\textcolor{5d6d7e}{\mathcal{C}}$ 的每个对象 $\textcolor{5d6d7e}{A}$ 画成它的"探针函子" $\textcolor{5d6d7e}{h_A}$;嵌入是全忠实
范畴 $\textcolor{1e5fa8}{\mathcal{C}}$
$\textcolor{1e5fa8}{A}$
$\textcolor{1e5fa8}{B}$
$\textcolor{1e5fa8}{C}$
$\textcolor{1e5fa8}{f}$
$\textcolor{b85c10}{h_{(-)}: A\mapsto h_A}$
全忠实嵌入
$\textcolor{6a2e8b}{[\mathcal{C}^{\mathrm{op}}, \mathbf{Set}]}$ — "预层之海"
$\textcolor{6a2e8b}{h_A}$
$\textcolor{6a2e8b}{h_B}$
$\textcolor{6a2e8b}{h_C}$
$\textcolor{6a2e8b}{f_*}$
"全忠实" = 不丢失也不创造态射: $\textcolor{5d6d7e}{\mathrm{Hom}_{\mathcal{C}}(A, B)\cong \mathrm{Nat}(h_A, h_B)}$
$\textcolor{5d6d7e}{\mathcal{C}}$ 干净地坐在更大的预层范畴里

4. 实算:在 $\mathbf{FinSet}$ 中验证 Yoneda

抽象证明已经完成,下面用一个具体的小例子把双射"打开"看,每一步都数清楚。

例 1:$\mathrm{Nat}(\mathrm{Hom}(\{*\}, -), \mathcal{P})\cong \mathcal{P}(\{*\})$

取 $\mathcal{C} = \mathbf{FinSet}$(有限集范畴),$A = \{*\}$(单点集),$F = \mathcal{P}$(协变幂集函子,$f\mapsto f_*$ 像)。Yoneda 引理给出 $$ \mathrm{Nat}(h^{\{*\}}, \mathcal{P}) \;\cong\; \mathcal{P}(\{*\}) = \{\emptyset, \{*\}\}. $$ 左侧本来是个无穷无尽的对象(一族遍历所有有限集 $X$ 的函数 $\alpha_X$),右侧只是 2 个元素的集合。让我们逐步验证:

图解 3:双射的两个具体情形

注意 $\textcolor{5d6d7e}{h^{\{*\}}(X) = \mathrm{Hom}(\{*\}, X)\cong X}$(指出一个元素),所以 $\textcolor{5d6d7e}{\alpha_X: X\to \mathcal{P}(X)}$
情形 ①:$\textcolor{1d7a45}{a = \{*\}\in \mathcal{P}(\{*\})}$
恢复公式:$\textcolor{1d7a45}{\hat a_X(x) = \mathcal{P}(x)(\{*\}) = \{x\}}$
($\textcolor{2c3e50}{x: \{*\}\to X}$ 把 $\textcolor{2c3e50}{*\mapsto x}$,像是 $\textcolor{2c3e50}{\{x\}}$)
⇒ $\textcolor{1d7a45}{\hat a_X = }$ "把每个点变成它自己的单点子集"
$\textcolor{2c3e50}{\hat a_{\{1,2\}}: 1\mapsto \{1\},\ 2\mapsto\{2\}}$
$\textcolor{2c3e50}{\hat a_{\{1,2,3\}}: 1\mapsto \{1\},\ 2\mapsto\{2\},\ 3\mapsto\{3\}}$
情形 ②:$\textcolor{c0392b}{a = \emptyset\in \mathcal{P}(\{*\})}$
恢复公式:$\textcolor{c0392b}{\hat a_X(x) = \mathcal{P}(x)(\emptyset) = \emptyset}$
(空集的像还是空集)
⇒ $\textcolor{c0392b}{\hat a_X = }$ 常值映射 "$\textcolor{c0392b}{x\mapsto \emptyset}$"
$\textcolor{2c3e50}{\hat a_{\{1,2\}}: 1\mapsto \emptyset,\ 2\mapsto\emptyset}$
$\textcolor{2c3e50}{\hat a_{\{1,2,3\}}: 1\mapsto\emptyset,\ 2\mapsto\emptyset,\ 3\mapsto\emptyset}$
反方向:从任意 $\textcolor{1e5fa8}{\alpha}$ 取出 $\textcolor{1e5fa8}{a := \alpha_{\{*\}}(\mathrm{id}_{\{*\}})}$
$\textcolor{2c3e50}{\alpha_{\{*\}}: \mathrm{Hom}(\{*\},\{*\})\to \mathcal{P}(\{*\})}$, 只有 1 个输入 $\textcolor{2c3e50}{\mathrm{id}_{\{*\}}}$
输出只能是 $\textcolor{2c3e50}{\emptyset}$ 或 $\textcolor{2c3e50}{\{*\}}$ —— 这恰好是 $\textcolor{2c3e50}{\mathcal{P}(\{*\})}$ 中两种选择
⇒ $\textcolor{b85c10}{\mathrm{Nat}(h^{\{*\}}, \mathcal{P})}$ 恰有 2 个元素,与 $\textcolor{b85c10}{\mathcal{P}(\{*\})}$ 一一对应 ✓

5. 泛性质:用 Yoneda 的眼睛看世界

Yoneda 给我们一种强大方法来定义对象:与其描述对象的内部结构,不如描述它对所有"测试对象"看上去什么样。这就是泛性质(universal property)

积(Product)的泛性质

范畴 $\mathcal{C}$ 中两对象 $A, B$ 的是一个对象 $A\times B$ 配两个投影 $\pi_1: A\times B\to A,\ \pi_2: A\times B\to B$,使得对任意对象 $C$ 与态射 $f: C\to A,\ g: C\to B$,存在唯一 $h: C\to A\times B$ 满足 $$ \pi_1\circ h = f,\qquad \pi_2\circ h = g. $$

图解 4:积 $A\times B$ 的泛性质

"对任何 $\textcolor{5d6d7e}{C}$ 都存在唯一箭头 $\textcolor{5d6d7e}{h}$"——这种"$\textcolor{5d6d7e}{\exists !}$"是泛性质的特征签名
$\textcolor{b85c10}{A\times B}$
$\textcolor{1e5fa8}{A}$
$\textcolor{1e5fa8}{B}$
$\textcolor{b85c10}{\pi_1}$
$\textcolor{b85c10}{\pi_2}$
$\textcolor{c0392b}{C}$
$\textcolor{1e5fa8}{f}$
$\textcolor{1e5fa8}{g}$
$\textcolor{c0392b}{\exists ! h}$
泛性质等价于:函子 $\textcolor{5d6d7e}{h_{A\times B}\;\cong\; h_A\times h_B}$(在 $\textcolor{5d6d7e}{\mathbf{Set}}$ 值预层范畴中的积)

例 2:积在不同范畴中的样子

同一条泛性质,在不同范畴中具体化为不同的熟悉结构—— 这就是范畴论的"统一力"。

6. 自由对象的泛性质

自由群 $F(S)$ 的泛性质

固定集合 $S$。自由群 $F(S)$ 配单射 $\eta: S\hookrightarrow U(F(S))$ 满足:对任意群 $G$ 与函数 $f: S\to U(G)$,存在唯一群同态 $\bar f: F(S)\to G$ 使 $$ U(\bar f)\circ \eta = f. $$

图解 5:自由群的泛性质

"在生成元上选定取值 = 唯一确定群同态"——自由群的核心
$\textcolor{1e5fa8}{\mathbf{Set}}$
$\textcolor{1e5fa8}{S}$
$\textcolor{1e5fa8}{U(G)}$
$\textcolor{1e5fa8}{f}$
$\textcolor{1e5fa8}{\eta:\;\eta(s) = s}$
$\textcolor{1d7a45}{\mathbf{Grp}}$
$\textcolor{1d7a45}{F(S)}$
$\textcolor{1d7a45}{G}$
$\textcolor{c0392b}{\exists !\,\bar f}$
$\textcolor{5d6d7e}{\bar f(s_1^{\pm 1}\cdots s_n^{\pm 1}) := f(s_1)^{\pm 1}\cdots f(s_n)^{\pm 1}}$
"把 $\textcolor{5d6d7e}{f}$ 在生成元上的赋值,沿群结构唯一延拓"

例 3:泛性质构造的"自由家族"

所有"自由 / 商"构造都是某个伴随的左 / 右伴随。Yoneda 引理告诉我们:若伴随存在,必由泛性质唯一确定

泛性质 ⇒ 同构唯一

满足同一条泛性质的两个对象必通过唯一同构对应。证明:把 Yoneda 引理用到 $\mathrm{id}$ 上。

这就是为什么数学家说"积是那个"——尽管表达式可以千变万化,本质上只有一个。

练习 1(Yoneda 在群上的解读)

把群 $G$ 看作单对象范畴 $\mathbf{B}G$。证明:协变函子 $F: \mathbf{B}G\to \mathbf{Set}$ = 带 $G$-作用的集合 $X$;自然变换 = $G$-等变映射。这时 $h^{\bullet} = G$($G$ 通过左乘作用于自身),Yoneda 给出 $\mathrm{Nat}(h^{\bullet}, F)\cong F(\bullet) = X$ —— 即$G$-等变映射 $G\to X$ 等同于 $X$ 中元素的选择

提示

一个等变映射 $\varphi: G\to X$ 完全由 $\varphi(e)\in X$ 决定($\varphi(g) = g\cdot\varphi(e)$)。这是 Yoneda 的"群论翻译"。

练习 2(余积 = 余泛对象)

写出余积(coproduct)$A\sqcup B$ 的泛性质(提示:把积的图所有箭头反过来)。 然后验证:$\mathbf{Set}$ 中余积 = 不交并,$\mathbf{Grp}$ 中余积 = 自由积,$\mathbf{Ab}$ 中余积 = 直和,$\mathbf{CRing}$ 中余积 = 张量积 $R\otimes_{\mathbb{Z}} S$。

提示

余积配两个余投影 $\iota_1: A\to A\sqcup B,\ \iota_2: B\to A\sqcup B$,满足:对任意 $C$ 与 $f: A\to C, g: B\to C$,存在唯一 $h: A\sqcup B\to C$ 使 $h\circ\iota_1 = f, h\circ\iota_2 = g$。代入各范畴验证。

练习 3(Spec 的泛性质)

代数几何中关键事实:仿射概形 $\mathrm{Spec}\,\mathbb{Z}[x]$ 在 $\mathbf{Aff} = \mathbf{CRing}^{\mathrm{op}}$ 中"代表"函子 $h_{\mathbb{Z}[x]} = \mathrm{Hom}_{\mathbf{CRing}}(\mathbb{Z}[x], -)$。问:这个函子赋给环 $R$ 什么集合?

提示

$\mathrm{Hom}(\mathbb{Z}[x], R)\cong R$(环同态 $\varphi$ 由 $\varphi(x)\in R$ 唯一决定)。所以 $\mathrm{Spec}\,\mathbb{Z}[x]$ 的"几何点"集合在 $R$ 上 = $R$ 本身 — 即仿射直线 $\mathbb{A}^1_R$。这就是为什么$\mathrm{Spec}\,\mathbb{Z}[x]$ = "通用的直线"

练习 4(极限是泛锥)

范畴 $\mathcal{J}$ 上的图(diagram)= 函子 $D: \mathcal{J}\to\mathcal{C}$。极限 $\lim D$ 是带"泛锥"的对象。请用泛性质语言写出 $\lim D$ 的定义,并指出积 $A\times B$ 是它的最简单情形。

提示

锥 $C\to D$ = 一族 $\{f_j: C\to D(j)\}_j$ 与 $\mathcal{J}$ 中所有箭头兼容。$\lim D$ 是锥:对任何锥 $C\to D$ 存在唯一 $h: C\to \lim D$ 与之兼容。当 $\mathcal{J}$ = "两个无关对象"时退化为积。

7. 收束:范畴论的核心思维方式

Yoneda 引理是整个范畴论的旋转门

Saunders Mac Lane:"全部范畴论都不过是 Yoneda 引理的若干推论"(半开玩笑地说,但不算太偏)。

下一阶段(Phase 8)我们将把 Yoneda 与"层"结合,进入 Grothendieck 的概形世界——代数几何真正开始。