$yX\left (Y\xleftarrow{f}Z\right )=\mathbf{C}(Y,X)\xrightarrow{\lambda g.g\circ f}\mathbf{C}(Z,X)$

Yoneda Lemma: For each small category $\mathbf{C}$, each object $X\in\mathbf{C}$ and each presheaf $F\in\textbf{Set}^{\mathbf{C}^{op}}$, there is a bijection of sets:

$\eta_{X,F}:\textbf{Set}^{\mathbf{C}^{op}}(yX,F)\cong F(X)$

which is natural in both $X$ and $F$.

$F(X)\xrightarrow{F(f)}F(Y)\in\textbf{Set}$

$\left (\eta_{X,F}^{-1}(x)\right )_Y:yX(Y)\rightarrow F(Y)=\mathbf{C}(Y,X)\rightarrow F(Y)$

$\left (\eta_{X,F}^{-1}(x)\right )_Y\triangleq\lambda f. F(f)(x)$

\begin{aligned} \eta_{X,F}(\eta_{X,F}^{-1}(x))&=\left (\eta_{X,F}^{-1}(x)\right )_X(\text{id}_X)\\ &=(\lambda f.F(f)(x))(\text{id}_X)\\ &=F(\text{id}_X)(x)\\ &=\text{id}_{F(X)}(x)\\ &=x \end{aligned}

\begin{aligned} \left (\eta_{X,F}^{-1}(\eta_{X,F}(\theta))\right )=\theta:yX\Rightarrow F \end{aligned}

\begin{aligned} \left (\eta_{X,F}^{-1}(\eta_{X,F}(\theta))\right )_Yf&=\left (\eta_{X,F}^{-1}(\theta_X(\text{id}_X))\right )_Yf\\ &=F(f)(\theta_X(\text{id}_X))\\ \end{aligned}

$F(f)\circ \theta_X=\theta_Y\circ (\lambda g.g\circ f)$

\begin{aligned} \left (\eta_{X,F}^{-1}(\eta_{X,F}(\theta))\right )_Yf&=F(f)(\theta_X(\text{id}_X))\\ &=\theta_Y(\lambda g.g\circ f)(\text{id}_X)\\ &=\theta_Y(f) \end{aligned}

$\varphi^*(\theta)_Z:\mathbf{C}(Z,X)\rightarrow G(Z)$

$\varphi^*(\theta)_Z=\varphi_Z\circ\theta_Z$。（这里 naturality 体现在给了$F\xRightarrow{\varphi}G$ 后，自然引导出的$\textbf{Set}^{\mathbf{C}^{op}}(yX,F)\rightarrow\textbf{Set}^{\mathbf{C}^{op}}(yX,G)$ 的函数$\varphi^*$

\begin{aligned} \varphi_X(\eta_{X,F}(\theta))&=\varphi_X(\theta_X(\text{id}_X))\\ &=(\varphi\circ\theta)_X(\text{id}_X)\\ &=\eta_{X,G}(\varphi\circ\theta)\\ &=\eta_{X,G}(\varphi^*(\theta)) \end{aligned}

$(yf)^*(\theta)_Z=\theta_Z\circ(yf)_Z:\mathbf{C}(Z,Y)\rightarrow F(Z)$

\begin{aligned} F(f)(\eta_{X,F}(\theta))&=F(f)(\theta_X(\text{id}_X))\\ &=\theta_Y((\lambda g.g\circ f)(\text{id}_X))\\ &=\theta_Y(f)\\ &=\theta_Y((yf)_Y(\text{id}_Y))\\ &=(\theta\circ yf)_Y(\text{id}_Y)\\ &=\eta_{Y,F}(\theta\circ yf)\\ &=\eta_{Y,F}(yf^*(\theta)) \end{aligned}

# # 理解和解释

$\textbf{Nat}(\text{Hom}(-,X),F)\cong F(X)$

$\text{Hom}(-,X):\mathbf{C}^{op}\rightarrow \textbf{Set}$ 是一个 Functor，$F$ 也是$\mathbf{C}^{op}\rightarrow \textbf{Set}$ 的 Functor。其中

$\text{Hom}(-,X)\left (Y\xleftarrow{f}Z\right )=\text{Hom}(Y,X)\xrightarrow{f^*=\lambda g.g\circ f}\text{Hom}(Z,X)$

Collaroy 1. 如果$F=\text{Hom}(-,Y)$ 也是一个$\mathbf{C}^{op}\rightarrow\textbf{Set}$，那么代入可以直接得到：

$\text{Hom}(X,Y)\cong\textbf{Nat}(\text{Hom}(-,X),\text{Hom}(-,Y))$

\begin{aligned} X&\mapsto \text{Hom}(-,X)\\ \text{Hom}(X,Y)&\mapsto\textbf{Nat}(\text{Hom}(-,X),\text{Hom}(-,Y)) \end{aligned}

$\theta_Z=\lambda g.f\circ g$

Collaroy 2. $X\cong Y$ if and only if $\text{Hom}(-,X)\cong\text{Hom}(-,Y)$

：考虑同构$\eta:\text{Hom}(Z,X)\cong\text{Hom}(Z,Y)$，那么$\eta$ natural in $Z$ 的含义是，对于任意$Z_1\xleftarrow{f}Z_2\in\mathbf{C}$，有：

$\text{Hom}(f,Y)\circ\eta_{Z_1}=\eta_{Z_2}\circ\text{Hom}(f,X)$

Edited on Views times