For $C,D$ small categories, and $f : C \to D$ a functor between them, there is a precomposition, or "inverse image", functor $f^* = () \circ f : Set^D \to Set^C$. It has a left and a right adjoint. What are their definitions, and in particular what is the right adjoint $f_*$? I couldn't find a definition in terms of functor categories, just "topological" ones.

1$\begingroup$ If I remember right, there's a good section or two on this in the Mac Lane and Moerdijk book: gen.lib.rus.ec/… Unfortunately I'm in a rush at the moment — hopefully someone else can provide chapter and verse and perhaps a digest... $\endgroup$ – Peter LeFanu Lumsdaine Jul 21 '10 at 13:15

$\begingroup$ Pietro: I might be wrong here, but $f^*$ seems to be covariant, with $f^*(F : Set^D) = F\circ f$ and $f^*(\gamma : F \to G)_{c : C} = \gamma_{fc} : Ffc \to Gfc$. $\endgroup$ – vincenzoml Jul 21 '10 at 14:09

1$\begingroup$ The adjoints (left and right) to such a precomposition functor are called Kan extensions. They're the subject of the last chapter of Mac Lane's "Categories for the Working Mathematician." $\endgroup$ – Andreas Blass Jul 21 '10 at 14:09

$\begingroup$ Peter: Mac Lane and Moerdijk define $f_*$ in the "topological" way, that is (p. 68 of the copy you linked) $(f_*F)V=F(f^{−1})V$. But it is not clear to me how this definition gives us (from a presheaf $F : Set^C$) a presheaf $f_*F: Set^D$. That is: 1) What is now $F(f^{−1})(V)$? f may be noninjective on objects. 2) What is the action of $f_*F$ on arrows? $C$ may even be a discrete category, so $f^{−1}$ of a arrow in $D$ may be undefined. $\endgroup$ – vincenzoml Jul 21 '10 at 14:23

$\begingroup$ vincenzo: sorry you're right. Not concentrated! $\endgroup$ – Pietro Majer Jul 21 '10 at 18:37
Given a functor $f:\mathcal{C}\to\mathcal{D}$ and any complete category $\mathcal{A}$ (e.g., take $\mathcal{A}=\text{Sets}$ to get the case you are asking about), there exists a rightadjoint $f_{\*}:[\mathcal{C},\mathcal{A}]\to[\mathcal{D},\mathcal{A}]$ to the "inverse image functor" $f^{*}$ and this is given by taking right Kan extension.
Explicitly, given a functor $X:\mathcal{C}\to\mathcal{A}$, the functor $f_{*}(X):\mathcal{D}\to\mathcal{A}$ is the right Kan extension of $X$ along $f$. This can be described explicitly using the limit formula $$f_{\*}(X)(d)=\text{lim}_{d\to f(c)}X(c)$$ for $d$ an object of $\mathcal{D}$ (the action on arrows of $\mathcal{D}$ is then induced by the universal property of limits). The indexing category of the limit here is of course the comma category $(d\downarrow f)$.
When $\mathcal{A}$ is cocomplete there is a corresponding leftadjoint $f_{!}\dashv f^{*}$ which is given by taking left Kan extension along $f$. This can be explicitly described by the colimit formula dual to the limit formula given above.
(I should say that all of this is described very nicely in Mac Lane's book Categories for the Working Mathematician.)

$\begingroup$ Michael, thanks! This helped me understand the definition in MacLane. But reading p. 237238 (in the second edition) that is, the definition you spell out above, and having made calculations, it seems to me that there's a typo above: the index category of the limit is $(d \downarrow f)$ and the limit is indexed over $d \to f(c)$. For the rest, a very clear explanation. $\endgroup$ – vincenzoml Jul 22 '10 at 12:00

$\begingroup$ You're quite right about the typo. I'm so used to using this formula when dealing with presheaves $[\mathcal{C}^{\text{op}},\textbf{Sets}]$ that I mixed up the variance, doh! $\endgroup$ – Michael A Warren Jul 22 '10 at 15:04