Yoneda引理

本文最后更新于:2022年4月4日 上午

Yoneda 引理是范畴论中一个颇具哲学色彩的定理.Dan Piponi 称它为“数学中最难的平凡之物”,Emily Riehl 则直言“可以说是范畴论中最重要的结果”.在 nLab 上,它被认为是“基本的,但是深刻且核心的”.本文尝试用清晰明了、符合动机、图文并茂的方式叙述并证明 Yoneda 引理,同时介绍它的重要推论 Yoneda 嵌入和可表函子.

预层范畴

给定两个范畴 \(\mathsf{C}_1,\mathsf{C}_2\),我们可以定义函子范畴 \(\mathrm{Fct}(\mathsf{C}_1,\mathsf{C}_2)\),其对象为 \(\mathsf{C}_1\)\(\mathsf{C}_2\) 的函子,态射为函子间的自然变换.函子范畴 \(\mathrm{Fct}(\mathsf{C}_1,\mathsf{C}_2)\) 也可记作 \([\mathsf{C}_1,\mathsf{C}_2]\).设 \(F,G\in[\mathsf{C}_1,\mathsf{C}_2]\)\(F,G\) 之间的态射集可记作

\[ \mathrm{Nat}(F,G):=\mathrm{Hom}_{[\mathsf{C}_1,\mathsf{C}_2]}(F,G). \]

给定范畴 \(\mathsf{C}\),其上的 预层范畴 定义为

\[ \mathsf{C}^{\wedge}:=[\mathsf{C}^{\mathrm{op}},\mathsf{Set}]. \]

预层范畴中的一个对象称为一个 预层,它是 \(\mathsf{C}^{\mathrm{op}}\)\(\mathsf{Set}\) 的一个函子.

\(\mathrm{Hom}\) 函子

\(\mathrm{Hom}_{\mathsf{C}}(-,-)\) 函子

\(\mathsf{C}\) 是一个范畴,它到集合范畴 \(\mathsf{Set}\) 的二元函子

\[ \mathrm{Hom}_{\mathsf{C}}(-,-): \mathsf{C}^{\mathrm{op}} \times \mathsf{C} \rightarrow \mathsf{Set}. \]

定义如下:其对象映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(-,-):\mathrm{Ob}(\mathsf{C})&\longrightarrow \mathrm{Ob}(\mathsf{Set})\\ (X,Y)&\longmapsto \mathrm{Hom}_{\mathsf{C}}(X,Y), \end{aligned} \]

态射映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(-,-):\mathrm{Hom}_{\mathsf{C}}((X_1,Y_1),(X_2,Y_2))&\longrightarrow \mathrm{Hom}_{\mathsf{Set}}(\mathrm{Hom}_{\mathsf{C}}(X_1,Y_1),\mathrm{Hom}_{\mathsf{C}}(X_2,Y_2))\\ (f^{\mathrm{op}}:X_1\to X_2,\,g:Y_1\to Y_2)& \longmapsto g_*f^*:(\phi:X_1\to Y_1 \longmapsto g\phi f:X_2\to Y_2), \end{aligned} \]

用图表可以表示为


\(\mathrm{Hom}_{\mathsf{C}}(X,-)\) 函子

对于 \(\mathrm{Hom}_{\mathsf{C}}(-,-)\) 函子,将第一个分量固定为 \(X\in \mathrm{Ob}(\mathsf{C})\),就得到 \(\mathrm{Hom}_{\mathsf{C}}(X,-)\) 函子

\[ \mathrm{Hom}_{\mathsf{C}}(X,-): \mathsf{C} \rightarrow \mathsf{Set}. \]

其对象映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(X,-):\mathrm{Ob}(\mathsf{C})&\longrightarrow \mathrm{Ob}(\mathsf{Set})\\ Y&\longmapsto \mathrm{Hom}_{\mathsf{C}}(X,Y), \end{aligned} \]

态射映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(X,-):\mathrm{Hom}_{\mathsf{C}}(Y_2,Y_1)&\longrightarrow \mathrm{Hom}_{\mathsf{Set}}(\mathrm{Hom}_{\mathsf{C}}(X,Y_1),\mathrm{Hom}_{\mathsf{C}}(X,Y_2))\\ (g:Y_1\to Y_2)& \longmapsto g_*:(\phi:X\to Y_1 \longmapsto g\phi:X\to Y_2), \end{aligned} \]

用图表可以表示为



映射 \(g_*\) 常被称作推出.

\(\mathrm{Hom}_{\mathsf{C}}(-,Y)\) 函子

对于 \(\mathrm{Hom}_{\mathsf{C}}(-,-)\) 函子,将第二个分量固定为 \(Y\in \mathrm{Ob}(\mathsf{C})\),就得到 \(\mathrm{Hom}_{\mathsf{C}}(-,Y)\) 函子

\[ \mathrm{Hom}_{\mathsf{C}}(-,Y): \mathsf{C}^{\mathrm{op}} \rightarrow \mathsf{Set}. \]

其对象映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(-,Y):\mathrm{Ob}(\mathsf{C})&\longrightarrow \mathrm{Ob}(\mathsf{Set})\\ X&\longmapsto \mathrm{Hom}_{\mathsf{C}}(X,Y), \end{aligned} \]

态射映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(-,Y):\mathrm{Hom}_{\mathsf{C}}(X_1,X_2)&\longrightarrow \mathrm{Hom}_{\mathsf{Set}}(\mathrm{Hom}_{\mathsf{C}}(X_1,Y),\mathrm{Hom}_{\mathsf{C}}(X_2,Y))\\ (f^{\mathrm{op}}:X_1\to X_2)& \longmapsto f^*:(\phi:X_1\to Y \longmapsto \phi f:X_2\to Y), \end{aligned} \]

用图表可以表示为



映射 \(f^*\) 常被称作拉回.

\(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\) 函子

可以看出,\(\mathrm{Hom}_{\mathsf{C}}(-,Y)\) 函子是 \(\mathsf{C}\) 上的一个预层,即 \(\mathrm{Hom}_{\mathsf{C}}(-,Y)\in [\mathsf{C}^{\mathrm{op}},\mathsf{Set}]\).而且每给定一个 \(\mathsf{C}\) 中的对象 \(Y\),就能得到一个对应的预层 \(\mathrm{Hom}_{\mathsf{C}}(-,Y)\in [\mathsf{C}^{\mathrm{op}},\mathsf{Set}]\).事实上,这种映射关系可以拓展为 \(\mathsf{C}\) 到预层范畴 \([\mathsf{C}^{\mathrm{op}},\mathsf{Set}]\) 的一个函子

\[ \mathrm{Hom}_{\mathsf{C}}(\cdot\,,-):\mathsf{C}\longrightarrow [\mathsf{C}^{\mathrm{op}},\mathsf{Set}]. \]

其对象映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(\cdot\,,-):\mathrm{Ob}(\mathsf{C})&\longrightarrow\mathrm{Ob}([\mathsf{C}^{\mathrm{op}},\mathsf{Set}])\\ Y& \longmapsto \mathrm{Hom}_{\mathsf{C}}(-,Y), \end{aligned} \]

态射映射为

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(\cdot\,,-):\mathrm{Hom}_{\mathsf{C}}(Y_1,Y_2)&\longrightarrow\mathrm{Hom}_{\mathsf{C}^\wedge}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),\mathrm{Hom}_{\mathsf{C}}(-,Y_2))\\ g& \longmapsto \theta_{g_*}, \end{aligned} \]

用图表可以表示为



其中 \(\theta_{g_*}\)\(\mathrm{Hom}_{\mathsf{C}}(-,Y_1)\)\(\mathrm{Hom}_{\mathsf{C}}(-,Y_2)\) 的自然变换,定义为

\[ \begin{aligned} \theta_{g_*}:\mathrm{Ob}(\mathsf{C})&\longrightarrow \mathrm{Mor}(\mathsf{Set})\\ X&\longmapsto g_*\in \mathrm{Hom}_{\mathsf{Set}}(\mathrm{Hom}_{\mathsf{C}}(X,Y_1),\mathrm{Hom}_{\mathsf{C}}(X,Y_2)).\\ \end{aligned} \]

\(\theta_{g_*}\) 的自然性由如下交换图保证


Yoneda引理

Yoneda引理:同构的证明

命题

\(\mathsf{C}\) 是一个范畴,\(Y\)\(\mathsf{C}\) 中一个对象,\(\mathrm{Hom}_{\mathsf{C}}(-,Y)\) 就是 \(\mathsf{C}\) 上的一个预层.又设 \(F\in \mathsf{C}^\wedge\) 也是 \(\mathsf{C}\) 上的预层.一方面,

\[ \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F) \]

\(\mathrm{Hom}_{\mathsf{C}}(-,Y)\)\(F\) 这两个预层之间的自然变换构成的集合.另一方面,

\[ F(Y) \]

是预层 \(F\)\(Y\) 处的取值,它也是一个集合.Yoneda引理断言,这两个集合之间存在一个双射,即

\[ \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)\cong F(Y). \]

证明

如果 \(\phi\in\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)\),我们可以在 \(\mathsf{C}\) 中任取一个从 \(X\)\(Y\) 的态射

\[ X \xrightarrow{f} Y, \]

利用 \(\phi\) 的自然性得到如下交换图



从交换图可以导出如下关系式

\[ \phi_X(f)=F(f)(\phi_Y(\mathrm{id}_Y)) \]

注意到 \(X\)\(f\) 的选取是任意的,我们知道 \(\phi\)\(\phi_Y\)\(\mathrm{id}_Y\) 上的像 \(\phi_Y(\mathrm{id}_Y)\) 唯一确定.

于是,定义映射

\[ \begin{aligned} \mathcal{A}:\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)&\longrightarrow F(Y),\\ \phi&\longmapsto \phi_Y(\mathrm{id}_Y). \end{aligned} \]

\[ \begin{aligned} \mathcal{B}:F(Y)&\longrightarrow \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F),\\ u&\longmapsto \phi:\phi_X(f)=F(f)(u),\forall X\in\mathrm{Ob}(\mathsf{C}),f\in\mathrm{Hom}_\mathsf{C}(X,Y) . \end{aligned} \]

可以验证,\(\mathcal{B}\) 是良定义的.事实上,任取 \(\mathsf{C}\) 中态射

\[ X_1 \xrightarrow{h} X_2, \]

我们有如下交换图



所以 \(\mathcal{B}(u)\) 确实是 \(\mathrm{Hom}_{\mathsf{C}}(-,Y)\)\(F\) 的自然变换.

因为对任意 \(\phi\in\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)\)

\[ (\mathcal{B}(\mathcal{A}(\phi)))_Y(\mathrm{id}_Y)=(\mathcal{B}(\phi_Y(\mathrm{id}_Y)))_Y(\mathrm{id}_Y)=F(\mathrm{id}_Y)(\phi_Y(\mathrm{id}_Y))=\mathrm{id}_{F(Y)}(\phi_Y(\mathrm{id}_Y))=\phi_Y(\mathrm{id}_Y), \]

由前面的结论可知

\[ \mathcal{B}(\mathcal{A}(\phi))=\phi, \]

\[ \mathcal{B}\circ\mathcal{A}=\mathrm{id}_{\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)}. \]

因为对任意 \(u\in F(Y)\)

\[ \mathcal{A}(\mathcal{B}(u))=F(\mathrm{id}_Y)(u)=\mathrm{id}_{F(Y)}(u)=u, \]

所以

\[ \mathcal{A}\circ\mathcal{B}=\mathrm{id}_{F(Y)}. \]

综上所述,我们证明了

\[ \begin{aligned} \mathcal{A}:\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)&\longrightarrow F(Y),\\ \phi&\longmapsto \phi_Y(\mathrm{id}_Y). \end{aligned} \]

是一个双射.

Yoneda引理:自然同构的证明

Yoneda引理不仅指出了映射 \(\mathcal{A}\) 给出以下同构

\[ \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F)\cong F(Y), \]

还进一步断言该同构关于 \(Y\)\(F\) 是自然的.

具体来说,我们可以定义二元函子

\[ \begin{aligned} \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(\cdot,-),-):\mathsf{C}^{\mathrm{op}}\times \mathsf{C}^\wedge&\longrightarrow\mathsf{Set} \end{aligned} \]

其对象映射为

\[ \begin{aligned} \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(\cdot,-),-):\mathrm{Ob}(\mathsf{C}^{\mathrm{op}}\times \mathsf{C}^\wedge)&\longrightarrow\mathrm{Ob}(\mathsf{Set}),\\ (Y,F)&\longmapsto \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y),F), \end{aligned} \]

态射映射为

\[ \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(\cdot,-),-):(g^{\mathrm{op}},\eta)\longmapsto s \]

用图表可以表示为



其中 \(s\) 的定义为

\[ \begin{aligned} s:\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),F_1)&\longrightarrow\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y_2),F_2)),\\ \phi&\longmapsto \widetilde{\phi}:\widetilde{\phi}_X(f)=\eta_X(\phi_X(gf)),\forall X\in\mathrm{Ob}(\mathsf{C}),f\in\mathrm{Hom}_\mathsf{C}(X,Y_2). \end{aligned} \]

同样,我们可以定义二元求值函子

\[ \begin{aligned} \mathrm{ev}^\wedge:\mathsf{C}^{\mathrm{op}}\times \mathsf{C}^\wedge&\longrightarrow\mathsf{Set},\\ (Y,F)&\longmapsto F(Y), \end{aligned} \]

用图表可以表示为



其中

\[ v:=F_2(g)\circ\eta_{Y_1}=\eta_{Y_2}\circ F_1(g). \]

因为

\[ \begin{aligned} \mathcal{A}_{Y_2,F_2}(s(\phi))=&\; \mathcal{A}_{Y_2,F_2}(\widetilde{\phi})\\ =&\;\widetilde{\phi}_{Y_2}(\mathrm{id}_{Y_2})\\ =&\;\eta_{Y_2}(\phi_{Y_2}(g\;\mathrm{id}_{Y_2}))\\ =&\;\eta_{Y_2}(\phi_{Y_2}(g))\\ =&\;\eta_{Y_2}(F_1(g)(\phi_{Y_1}(\mathrm{id}_{Y_1})))\\ =&\;v(\phi_{Y_1}(\mathrm{id}_{Y_1}))\\ =&\;v(\mathcal{A}_{Y_2,F_2}(\phi)) \end{aligned} \]

所以下图交换



因此,映射 \(\mathcal{A}\) 是从函子 \(\mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(\cdot,-),-)\) 到函子 \(\mathrm{ev}^\wedge\) 的自然同构.

Yoneda嵌入

Yoneda 引理可以导出一个有用的推论.

推论\(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\) 是一个全忠实函子.

证明.在 Yoneda 引理中取 \(Y=Y_1\), \(F=\mathrm{Hom}_{\mathsf{C}}(-,Y_2)\) 就得到

\[ \mathrm{Nat}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),\mathrm{Hom}_{\mathsf{C}}(-,Y_2))\cong \mathrm{Hom}_{\mathsf{C}}(Y_1,Y_2), \]

\[ \mathrm{Hom}_{\mathsf{C}}(Y_1,Y_2)\cong\mathrm{Hom}_{\mathsf{C}^\wedge}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),\mathrm{Hom}_{\mathsf{C}}(-,Y_2)). \]

此时,映射 \(\mathcal{B}\) 可化为

\[ \begin{aligned} \mathcal{B}:\mathrm{Hom}_{\mathsf{C}}(Y_1,Y_2)&\longrightarrow \mathrm{Hom}_{\mathsf{C}^\wedge}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),\mathrm{Hom}_{\mathsf{C}}(-,Y_2))\\ g&\longmapsto \phi:\phi_X(f)=f^*g=g_*f,\forall X\in\mathrm{Ob}(\mathsf{C}),f\in\mathrm{Hom}_\mathsf{C}(X,Y) . \end{aligned} \]

\[ \begin{aligned} \mathcal{B}:\mathrm{Hom}_{\mathsf{C}}(Y_1,Y_2)&\longrightarrow \mathrm{Hom}_{\mathsf{C}^\wedge}(\mathrm{Hom}_{\mathsf{C}}(-,Y_1),\mathrm{Hom}_{\mathsf{C}}(-,Y_2))\\ g&\longmapsto \phi:\phi_X=g_*,\forall X\in\mathrm{Ob}(\mathsf{C}), \end{aligned} \]

这正是函子

\[ \mathrm{Hom}_{\mathsf{C}}(\cdot\,,-):\mathsf{C}\longrightarrow [\mathsf{C}^{\mathrm{op}},\mathsf{Set}] \]

的态射映射.因为 \(\mathcal{B}\) 是双射,所以 \(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\) 是一个全忠实函子.\(\square\)

注意到 \(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\) 的对象映射是一个单射,函子 \(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\)\(\mathsf{C}\) 作为一个全子范畴嵌入到 \(\mathsf{C}\) 的预层范畴 \([\mathsf{C}^{\mathrm{op}},\mathsf{Set}]\) 中.这个嵌入被称作 Yoneda 嵌入.由全忠实函子的性质可知,

\[ Y_1\cong Y_2\iff \mathrm{Hom}_{\mathsf{C}}(-,Y_1)\cong\mathrm{Hom}_{\mathsf{C}}(-,Y_2). \]

从范畴同构的意义上来讲,我们可以将 \(Y\)\(\mathrm{Hom}_{\mathsf{C}}(-,Y)\) 等同.范畴中的某个对象,就等于指向该对象所有箭头的总和.换言之,在范畴同构的思想下,我们关心的信息就是一个对象自己和其它对象和会给该对象打上哪些箭头,对象内部则完全被视为一个黑箱.而范畴中对象之间的箭头,就等于指向对象的箭头集之间的转换.具体来说,假如 \(f\) 是对象 \(A\) 到对象 \(B\) 的一个箭头,那么任何打到 \(A\) 上的箭头,都可以通过接上一个 \(f\),转换成打到 \(B\) 上的箭头.反过来,如果有一种方式能将所有打到 \(A\) 上的箭头自然地转换成打到 \(B\) 上的箭头,那么这种转换必然是通过接上一个 \(A, B\) 间的箭头来实现的.

可表函子

范畴 \(\mathsf{C}\) 上的一个预层 \(F:\mathsf{C}^{\mathrm{op}}\to\mathsf{Set}\) 被称作 可表函子,如果存在 \(\mathsf{C}\) 中的一个对象 \(Z\),使得 \(\mathrm{Hom}_{\mathsf{C}}(-,Z)\)\(F\) 自然同构.对象 \(A\) 与自然同构

\[ \phi:\mathrm{Hom}_{\mathsf{C}}(-,Z)\longrightarrow F \]

构成的二元组 \((Z,\phi)\),称作 \(F\) 的一个 表示

根据 Yoneda 引理,\(\phi\)\(F(Z)\) 中的一个元素 \(c:=\phi_Z(\mathrm{id}_Z)\in F(Z)\) 唯一确定.基于这个原因,\((Z,c)\) 被称作 \(F\) 的一个代表元,其中的 \(Z\) 被称作 \(F\)表示对象(representing object)或 泛对象(universal object),而 \(c\) 被称作 \(F\)泛元(universal element).

关于可表函子,我们有如下命题.

命题.如果函子 \(F\) 是可表的,那么它的表示在同构意义下是唯一的.

更具体地说,考虑函子

对应的逗号范畴 \(\mathrm{Hom}_{\mathsf{C}}(\cdot,-)/j_Z\),其中 \(\mathsf{1}\) 是恰有一个对象和一个态射的范畴,\(j_Z\)\(\mathsf{1}\) 中唯一的一个对象映成 \(\mathrm{Hom}_{\mathsf{C}}(-,Z)\).我们可以将上述命题重述如下.

命题.如果 \((Z,\phi)\) 是可表函子 \(F\) 的一个表示,那么 \((Z,\phi)\)\(\mathrm{Hom}_{\mathsf{C}}(\cdot,-)/j_Z\) 中的一个终对象.换言之,对于任意 \((Y,\psi)\in\mathrm{Hom}_{\mathsf{C}}(\cdot,-)/j_Z\),存在唯一的态射 \(g:Y\to Z\),使得下图在 \(\mathsf{C}^\wedge\) 中交换.


证明.事实上,因为 \(\phi\) 是同构,所以图表交换等价于

\[ \theta_{g_*}=\psi\circ\phi^{-1}. \]

又因为 \(\mathrm{Hom}_{\mathsf{C}}(\cdot\,,-)\) 函子是全忠实的,故

\[ \begin{aligned} \mathrm{Hom}_{\mathsf{C}}(\cdot\,,-):\mathrm{Hom}_{\mathsf{C}}(Y,Z)&\longrightarrow \mathrm{Hom}_{\mathsf{C}^\wedge}(\mathrm{Hom}_{\mathsf{C}}(-,Y),\mathrm{Hom}_{\mathsf{C}}(-,Z))\\ g&\longmapsto \theta_{g_*} \end{aligned} \]

是双射.于是,存在唯一的 \(g:Y\to Z\),使得

\[ \mathrm{Hom}_{\mathsf{C}}(-,g)=\theta_{g_*}=\psi\circ\phi^{-1}, \]

即图表交换.\(\square\)


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!