This post is, strictly speaking, a follow up to part three of my series on stacks, on the 2-Yoneda lemma. The classical Yoneda lemma has built into it a naturality statement, while our 2-Yoneda lemma proved essentially only the fact of the isomorphism. Let’s fix that.

Theorem. (The 2-Yoneda Lemma) The functor  ⁣:Hom(X,D)D(X)\operatorname{よ}\colon \operatorname{Hom}(\underline{X},\mathsf{D}) \to \mathsf{D}(X) defined on objects as (F ⁣:XD)F(1X)(F\colon \underline{X} \to \mathsf{D}) \mapsto F(1_X) and on arrows as (α ⁣:FG)α(1X)(\alpha\colon F \Rightarrow G) \mapsto \alpha(1_X) is an equivalence of categories which is pseudonatural in both arguments.

We have proved all but the (pseudo)-naturality statement, which is a little convoluted for the following reason. You see, typically you think of the Yoneda lemma as being about, for instance, natural transformations from the hom-set functor C(X,)\mathsf{C}(\underline{X},\cdot) to a functor FF . Now, X\underline{X} is not the functor Top(X,)\mathbf{Top}(X,\cdot) , but rather the functor Top(,X)\mathbf{Top}(\cdot,X) which we think of as being valued not in sets, but in categories (groupoids, actually), where the category is the rather uninteresting discrete category comprising an object for each map YXY \to X and only the identity arrows. Given a map h ⁣:YZh \colon Y \to Z , we get a functor h ⁣:X(Z)X(Y)h^*\colon \underline{X}(Z) \to \underline{X}(Y) given by h(g ⁣:ZX)=gh ⁣:YXh^*(g\colon Z \to X) = gh \colon Y \to X . This is actually a functor (I say, just because I can anticipate that I’m about to write down a not-quite-a-functor). The only natural transformation between functors is the identity.

Anyway, the point is, we should be expecting to suddenly start thinking of an arbitrary category fibered in groupoids D\mathsf{D} as a contravariant functor from Top\mathsf{Top} to the category of categories (groupoids, actually), where the category is D(Y)\mathsf{D}(Y) . Given a map h ⁣:YZh \colon Y \to Z , we should get a functor h ⁣:D(Z)D(Y)h^*\colon \mathsf{D}(Z) \to \mathsf{D}(Y) given by h(ξ)=hξh^*(\xi) = h^*\xi and we do, actually. The problem, which we mumbled something about earlier, is that given g ⁣:XYg \colon X \to Y , we don’t necessarily have ghξ=(hg)ξg^*h^*\xi = (hg)^*\xi , merely that they’re canonically isomorphic. In other words, the operation ()(\cdot)^* is not a contravariant functor, just one up to canonical isomorphism. I super don’t actually want to learn what a pseudofunctor is, but I guess that’s what this is.

A digression: pseudofunctors

Let’s go slowly: for each object XX in Top\mathbf{Top} we have an object in the category of groupoids, namely the groupoid D(X)\mathsf{D}(X) . If we think of the hom-set Top(X,Y)\mathbf{Top}(X,Y) as a discrete groupoid, we get a covariant functor defined contravariantly on objects (which are maps!) as (f ⁣:XY)f ⁣:D(Y)D(X)(f\colon X\to Y) \mapsto f^*\colon \mathsf{D}(Y) \to \mathsf{D}(X) . We saw that this is in fact a functor, since given α ⁣:ξξ\alpha \colon \xi \to \xi' , there is a unique arrow fα ⁣:fξfξf^*\alpha \colon f^*\xi \to f^*\xi' . The arrows of the category Top(X,Y)\mathbf{Top}(X,Y) are the identity natural isomorphism, which must go to the identity natural transformation of ff^* . Now, I think we’ve insisted that 1Xξ=ξ1_X^*\xi = \xi , and indeed if you pull back a bundle along the identity map, I think it’s fair to say that you get the same bundle. This is secretly good, because it lets us ignore isomorphisms involving the identity, since they are equalities. Now for the hard part. Given f ⁣:XYf\colon X \to Y and g ⁣:YZg \colon Y \to Z , by the defining property of a category fibered in groupoids, for each ξD(Z)\xi \in \mathsf{D}(Z) , there is a unique isomorphism ηf,g(ξ)\eta{f,g}(\xi) making the following diagram commute

$$\require{AMScd}\begin{CD} f^*g^*\xi @>g_{\xi}f_{g^*\xi}>> \xi \\ @VV\eta{f,g}(\xi)V @| \\ (gf)^*\xi @>(gf)_{\xi}>> \xi. \end{CD}$$

Notice that given an arrow α ⁣:ξξ\alpha\colon \xi \to \xi' , the following diagram commutes

fgξηf,g(ξ)(gf)ξfgα(gf)αfgξηf,g(ξ)(gf)ξ.\begin{CD} f^*g^*\xi @>\eta_{f,g}(\xi)>> (gf)^*\xi \\ @VVf^*g^*\alpha V @VV(gf)^*\alpha V \\ f^*g^*\xi' @>\eta_{f,g}(\xi')>> (gf)^*\xi'. \end{CD}

This is because of the defining property of categories fibered in groupoids: both paths around the square make the following diagram commute

fgξαgξfgξξ(gf)ξ(gf)ξξ;\begin{CD} f^*g^*\xi @>\alpha g_\xi f_{g^*\xi}>> \xi' \\ @VVV @| \\ (gf)^*\xi' @>(gf)_{\xi'}>> \xi'; \end{CD}

indeed we calculate

αgξfgξ=gξgαfgξ=gξfgξfgα=(gf)ξηf,g(ξ)fgα\alpha g_\xi f_{g^*\xi} = g_{\xi'} g^*\alpha f_{g^*\xi} = g_{\xi'} f_{g^*\xi'} f^*g^*\alpha = (gf)_{\xi'} \eta_{f,g}(\xi') f^*g^*\alpha

and

αgξfgξ=α(gf)ξηf,g(ξ)=(gf)ξ(gf)αηf,g(ξ).\alpha g_\xi f_{g^*\xi} = \alpha (gf)_\xi \eta_{f,g}(\xi) = (gf)_{\xi'} (gf)^*\alpha \eta_{f,g}(\xi).

My source (nLab, gulp) suggests that the isomorphism ηf,g\eta_{f,g} should be natural in ff and gg . Notice that if fff \ne f' , then there are no natural transformations (isomorphisms) fff^* \Rightarrow f'^* . On the other hand, a family of arrows α(ξ) ⁣:fξfξ\alpha(\xi) \colon f^*\xi \to f^*\xi , define a natural isomorphism α ⁣:ff\alpha \colon f^*\Rightarrow f^* if for each β ⁣:ξξ\beta \colon \xi \to \xi' in the fiber over Y\mathsf{Y} , we have α(ξ)fβ=fβα(ξ)\alpha(\xi')f^*\beta = f^*\beta\alpha(\xi) . Naturality in ff , then, is the statement that given α ⁣:ff\alpha\colon f^* \Rightarrow f^* , the following diagram commutes

fgξηf,g(ξ)(gf)ξα(gξ)fgξηf,g(ξ)(gf)ξ\begin{CD} f^*g^*\xi @>\eta_{f,g}(\xi)>> (gf)^*\xi \\ @VV\alpha(g^*\xi)V @VVV \\ f^*g^*\xi @>\eta_{f,g}(\xi)>> (gf)^*\xi \end{CD}

which can only hold if the righthand arrow is ηf,g(ξ)α(gξ)ηf,g(ξ)1\eta_{f,g}(\xi)\alpha(g^*\xi)\eta_{f,g}(\xi)^{-1} , and indeed, I see no other sensible way to define an arrow (gf)ξ(gf)ξ(gf)^*\xi \to (gf)^*\xi out of one from fξfξf^*\xi \to f^*\xi . Naturality in gg should be similarly silly; I’ll leave it to you.

Since function composition is strictly associative (phew) we just need to check that the following diagram commutes for each ξD(W)\xi \in \mathsf{D}(W) and each triple of maps f ⁣:XYf\colon X \to Y , g ⁣:YZg\colon Y \to Z and h ⁣:ZWh\colon Z \to W

fghξf(ηg,h(ξ))f(hg)ξηf,g(hξ)ηf,gh(ξ)(gf)hξηgf,h(ξ)(hgf)ξ.\begin{CD} f^*g^*h^*\xi @>f^*(\eta_{g,h}(\xi))>> f^*(hg)^* \xi \\ @VV\eta_{f,g}(h^*\xi)V @VV\eta_{f,gh}(\xi)V \\ (gf)^*h^*\xi @>\eta_{gf,h}(\xi)>> (hgf)^*\xi. \end{CD}

This will use our only trick: consider the diagram

fghξhξghξfghξξ(hgf)ξ(hgf)ξξ.\begin{CD} f^*g^*h^*\xi @>h_{\xi}g_{h^*\xi}f_{g^*h^*\xi}>> \xi \\ @VVV @| \\ (hgf)^*\xi @>(hgf)_\xi>> \xi. \end{CD}

We calculate:

hξghξfghξ=(hg)ξηg,h(ξ)fghξ=(hg)ξf(hg)ξf(ηg,h(ξ))=(hgf)ξηf,gh(ξ)f(ηg,h(ξ))h_\xi g_{h^*\xi} f_{g^*h^*\xi} = (hg)_\xi \eta_{g,h}(\xi) f_{g^*h^*\xi} = (hg)_\xi f_{(hg)^*\xi} f^*(\eta_{g,h}(\xi)) = (hgf)_\xi \eta_{f,gh}(\xi) f^*(\eta_{g,h}(\xi))

and

hξghξfghξ=hξ(gf)hξηf,g(hξ)=(hgf)ξηgf,h(ξ)ηf,g(hξ).h_\xi g_{h^*\xi} f_{g^*h^*\xi} = h_\xi (gf)_{h^*\xi} \eta_{f,g}(h^*\xi) = (hgf)_\xi \eta_{gf,h}(\xi) \eta_{f,g}(h^*\xi).

Therefore by the defining property of categories fibered in groupoids, we have the coherence of the associating isomorphism. The argument above is summarized in the commuting cube below, where the unlabeled arrows are the “obvious” ones, for instance hξ ⁣:hξξh_\xi \colon h^*\xi \to \xi .

The commuting cube demonstrating the coherence of isomorphisms.

Pseudonaturality in X\underline{X}

Okay enough about pseudofunctors. We already saw in a previous post that functors YX\underline{Y} \to \underline{X} are maps f ⁣:YXf\colon Y \to X . (Indeed, the proof uses the first part of the 2-Yoneda lemma.) Such a functor gives us a functor

f ⁣:Hom(X,D)Hom(Y,D)f^*\colon \operatorname{Hom}(\underline{X},\mathsf{D}) \to \operatorname{Hom}(\underline{Y},\mathsf{D})
defined on objects (functors) as fF=Fff^*F = Ff and on arrows (natural transformations) as f(α ⁣:FG)=αf ⁣:FfGff^*(\alpha \colon F \Rightarrow G) = \alpha f \colon Ff \Rightarrow Gf . On the other side of the equation, we have the functor f ⁣:D(X)D(Y)f^*\colon \mathsf{D}(X) \to \mathsf{D}(Y) defined extensively above. Pseudonaturality in XX then is the claim that the following diagram commutes

Hom(X,D)XD(X)ffHom(Y,D)YD(Y).\begin{CD} \operatorname{Hom}(\underline{X},\mathsf{D}) @>\operatorname{よ}_X>> \mathsf{D}(X) \\ @VVf^*V @VVf^*V \\ \operatorname{Hom}(\underline{Y},\mathsf{D}) @>\operatorname{よ}_Y>> \mathsf{D}(Y). \end{CD}

up to a natural transformation. And indeed, if F(1X)=ξD(X)F(1_X) = \xi \in \mathsf{D}(X) , we have fX(F)=fξf^*\operatorname{よ}_X(F) = f^*\xi and Y(fF)=(fF)(1Y)=F(f ⁣:YX)\operatorname{よ}_Y(f^*F) = (f^*F)(1_Y) = F(f\colon Y \to X) . Now, recall from part three that we write F(Y)F(Y) , since f ⁣:YXf\colon Y \to X is understood and we’d like to consider the arrow F(f) ⁣:F(Y)ξF(f) \colon F(Y) \to \xi . By the definition of categories fibered in groupoids, there is a unique isomorphism σF,f ⁣:F(Y)fξ\sigma_{F,f}\colon F(Y) \to f^*\xi satisfying fξσF,f=F(f)f_\xi \sigma_{F,f} = F(f) . We claim that σF,f\sigma_{F,f} defines a natural transformation making the diagram above commute. This is the claim that for every natural transformation α ⁣:FG\alpha\colon F\Rightarrow G in Hom(X,D)\operatorname{Hom}(\underline{X},\mathsf{D}) , the following diagram commutes in D(Y)\mathsf{D}(Y) :

Y(fF)σF,ffX(F)Y(fα)fX(α)Y(fG)σG,ffX(G).\begin{CD} \operatorname{よ}_Y(f^*F) @>\sigma_{F,f}>> f^*\operatorname{よ}_X(F) \\ @VV\operatorname{よ}_Y(f^*\alpha)V @VVf^*\operatorname{よ}_X(\alpha)V \\ \operatorname{よ}_Y(f^*G) @>\sigma_{G,f}>> f^*\operatorname{よ}_X(G). \end{CD}

Unwound slightly, if we write G(X)=ξG(X) = \xi' and α ⁣:ξξ\alpha \colon \xi \to \xi' , this is the same diagram as

F(Y)σF,ffξα(Y)fαG(Y)σF,ffξ.\begin{CD} F(Y) @>\sigma_{F,f}>> f^*\xi \\ @VV\alpha(Y)V @VVf^*\alpha V \\ G(Y) @>\sigma_{F,f}>> f^*\xi'. \end{CD}

The commutativity of this diagram uses our only trick, namely the unique way of filling this diagram:

F(Y)αF(f)ξfξfξξ.\begin{CD} F(Y) @>\alpha F(f)>> \xi' \\ @VVV @| \\ f^*\xi' @>f_{\xi'}>> \xi'. \end{CD}

We check

αF(f)=αfξσF,f=fξfασF,f \alpha F(f) = \alpha f_\xi \sigma_{F,f} = f_{\xi'} f^*\alpha \sigma_{F,f}

and

αF(f)=G(f)α(Y)=fξσG,fα(Y).\alpha F(f) = G(f)\alpha(Y) = f_{\xi'} \sigma_{G,f} \alpha(Y).

A loose end from part six

I think this proves a claim from part six. Let’s test it out. An object ξD(Y)\xi \in \mathsf{D}(Y) is a map f ⁣:YDf\colon \underline{Y} \to \mathsf{D} . Similarly ξD(X)\xi' \in \mathsf{D}(X) is a map g ⁣:XDg\colon \underline{X} \to \mathsf{D} . An arrow h~ ⁣:ξξ\tilde h \colon \xi \to \xi' over a map h ⁣:YXh\colon Y \to X should be the map h ⁣:YXh \colon Y \to X together with a natural transformation α ⁣:fgh\alpha\colon f \Rightarrow gh .

Let me write things a little more like the above. So we have ξD(Y)\xi \in \mathsf{D}(Y) equal under Y\operatorname{よ}_Y to F ⁣:YDF\colon \underline{Y} \to \mathsf{D} , and similarly ξ=X(G)\xi' = \operatorname{よ}_X(G) . We have the functor D(h)=h ⁣:D(X)D(Y)\mathsf{D}(h) = h^*\colon \mathsf{D}(X) \to \mathsf{D}(Y) which corresponds up to natural transformation to precomposition by h ⁣:YXh\colon Y \to X . There is a unique isomorphism β\beta making the following diagram commute

ξh~ξβhξhξξσG,hGh(1Y)G(h)ξ\begin{CD} \xi @>\tilde h>> \xi' \\ @VV\beta V @| \\ h^*\xi' @>h_{\xi'}>> \xi' \\ @AA\sigma_{G,h}A @| \\ Gh(1_Y) @>G(h)>> \xi' \end{CD}

We claim that σG,h1β\sigma_{G,h}^{-1}\beta comes from (or defines) a unique natural transformation α ⁣:FGh\alpha \colon F \Rightarrow Gh (we write GhGh to avoid confusion with the functor hh^* ). At an object k ⁣:ZYk \colon Z \to Y of Y\underline{Y} , define α(Z)=σG,hk1ηk,h(ξ)kβσF,k\alpha(Z) = \sigma_{G,hk}^{-1} \eta_{k,h}(\xi') k^*\beta \sigma_{F,k} , where ηk,h(ξ) ⁣:khξ(hk)ξ\eta_{k,h}(\xi') \colon k^*h^*\xi' \to (hk)^*\xi' is the isomorphism defined in the previous section. Given another object  ⁣:WY\ell \colon W \to Y and an arrow m ⁣:ZWm \colon Z \to W , we need the following diagram to commute

F(Z)α(Z)Gh(Z)F(m)Gh(m)F(W)α(W)Gh(W).\begin{CD} F(Z) @>\alpha(Z)>> Gh(Z) \\ @VVF(m)V @VVGh(m)V \\ F(W) @>\alpha(W)>> Gh(W). \end{CD}

Let’s try putting both paths around the square into the diagram

F(Z)h~F(k)ξGh(W)G(h)Gh()ξ.\begin{CD} F(Z) @>\tilde h F(k)>> \xi' \\ @VVV @| \\ Gh(W) @>G(h)Gh(\ell)>> \xi'. \end{CD}

We calculate

G(h)Gh()Gh(m)α(Z)=G(h)Gh(k)α(Z)=G(hk)α(Z)=(hk)ξσG,hkα(Z)=(hk)ξηk,h(ξ)kβσF,k=hξkhξkβσF,k=hξβkξσF,k=hξβF(k)=h~F(k)\begin{gather*} G(h)Gh(\ell)Gh(m) \alpha(Z) = G(h)Gh(k)\alpha(Z) = G(hk)\alpha(Z) \\ = (hk)_{\xi'} \sigma_{G,hk} \alpha(Z) = (hk)_{\xi'} \eta_{k,h}(\xi') k^*\beta \sigma_{F,k} \\ = h_{\xi'}k_{h^*\xi'} k^*\beta \sigma_{F,k} = h_{\xi'} \beta k_\xi \sigma_{F,k} = h_{\xi'}\beta F(k) = \tilde h F(k) \end{gather*}

and

G(h)Gh()α(W)F(m)=G(h)α(W)F(m)=(h)ξσG,hα(W)F(m)=(h)ξη,h(ξ)βσF,F(m)=hξhξβσF,F(m)=hξβξσF,F(m)=hξβF()F(m)=hξβF(k)=h~F(k).\begin{gather*} G(h)Gh(\ell)\alpha(W)F(m) = G(h\ell)\alpha(W)F(m) = (h\ell)_{\xi'}\sigma_{G,h\ell}\alpha(W)F(m) \\ = (h\ell)_{\xi'} \eta_{\ell,h}(\xi') \ell^*\beta \sigma_{F,\ell} F(m) = h_{\xi'}\ell_{h^*\xi'} \ell^*\beta \sigma_{F,\ell} F(m) \\ = h_{\xi'}\beta \ell_\xi \sigma_{F,\ell} F(m) = h_{\xi'} \beta F(\ell)F(m) = h_{\xi'}\beta F(k) = \tilde h F(k). \end{gather*}

The argument is summarized in the following interesting commutative diagram.

The argument above in commutative diagram form

Conversely it is clear that given such an α ⁣:FGh\alpha \colon F \Rightarrow Gh , we get a map h~ ⁣:ξξ\tilde h \colon \xi \to \xi' defined by G(h)α(Y)G(h)\alpha(Y) .

Pseudonaturality in D\mathsf{D}

Now suppose we have a map of categories fibered in groupoids f ⁣:CDf\colon \mathsf{C} \to \mathsf{D} . This is by definition a functor f ⁣:CDf\colon \mathsf{C} \to \mathsf{D} such that πf=π\pi f = \pi . For each ξC(X)\xi \in \mathsf{C}(X) , we get an object f(ξ)D(X)f(\xi) \in \mathsf{D}(X) , and for each arrow α ⁣:ξξ\alpha \colon \xi \to \xi' in the fiber, we get an arrow f(α) ⁣:f(ξ)f(ξ)f(\alpha)\colon f(\xi) \to f(\xi') in the fiber. In other words, we get a functor fX ⁣:C(X)D(X)f|_X \colon \mathsf{C}(X) \to \mathsf{D}(X) . Given a functor F ⁣:XCF\colon \underline{X} \to \mathsf{C} , postcomposition with ff yields a functor fF=fF ⁣:XDf_*F = fF \colon \underline{X} \to \mathsf{D} . Similarly given a natural transformation α ⁣:FG\alpha\colon F\Rightarrow G , we get fα ⁣:fFfGf_*\alpha \colon f_*F\Rightarrow f_*G . Pseudonaturality in D\mathsf{D} is the claim that the following diagram commutes

Hom(X,C)CC(X)ffXHom(X,D)DD(X)\begin{CD} \operatorname{Hom}(\underline{X},\mathsf{C}) @>\operatorname{よ}_{\mathsf{C}}>> \mathsf{C}(X) \\ @VVf_*V @VVf|_XV \\ \operatorname{Hom}(\underline{X},\mathsf{D}) @>\operatorname{よ}_{\mathsf{D}}>> \mathsf{D}(X) \end{CD}

up to a natural transformation. And indeed, if we write F(1X)=ξF(1_X) = \xi , G(1X)=ξG(1_X) = \xi' and α(1X)=α ⁣:ξξ\alpha(1_X) = \alpha \colon \xi \to \xi' , we actually have

fXC(F)=fX(ξ)=f(ξ)=fF(1X)=D(fF)f|_X\operatorname{よ}_{\mathsf{C}}(F) = f|_X(\xi) = f(\xi) = f_*F(1_X) = \operatorname{よ}_{\mathsf{D}}(f_*F)

and

fXC(α)=fX(α)=f(α)=fα(1X)=D(fα),f|_X\operatorname{よ}_{\mathsf{C}}(\alpha) = f|_X(\alpha) = f(\alpha) = f_*\alpha(1_X) = \operatorname{よ}_{\mathsf{D}}(f_*\alpha),

so the diagram actually commutes on the nose.