Apparently it's 'well known' that if $P$ is a presheaf on $C$ then there is an equivalence $\widehat{C}/P \simeq \widehat{\int P}$, where $\int P$ is the usual category of elements and $\widehat{C} = [C^{\rm op},{\rm Set}]$. (I've seen a reference to Johnstone's *Topos Theory* for this, but I don't have easy access to the book. It's also Exercise III.8(a) in Mac Lane--Moerdijk)


Now, I've come across comma categories $\widehat{C}/H$ for functors $H \colon D \to \widehat{C}$ (mainly when $H = D(F-,-)$ for $F \colon C \to D$), and I'd like to have a similarly useful/interesting result for them. The equivalence doesn't generalize to $\widehat{C}/H \simeq \widehat{\int H}$, or at least I can't see any way to make that work. So I want to understand the first equivalence from a more abstract-nonsensical point of view, to figure out what's really going on.


Is there a way to see the above equivalence as living in a fibrational cosmos or something similar? If not, is there any other kind of machinery that might help me understand categories of the form $\widehat{C}/H$?



Slices of presheaf categories
Yes, you can see this as happening in a "fibrational cosmos." I'll describe how it goes, but then we'll see that the description of $\widehat{C}/H$ that comes out could also be deduced pretty naively.


The universal property of $\widehat{C}$ is that the category of functors $A\to \widehat{C}$ is equivalent to the category of discrete fibrations from $A$ to $C$, via pullback of the universal such. (A discrete fibration from $A$ to $C$ is a span $A\leftarrow E \to C$ such that $E\to C$ is a fibration, $E\to A$ is an opfibration, the two structures are compatible, and $E$ is discrete in the slice 2-category over $A\times C$.)


Now the slice category $\widehat{C}/P$, for $P\in\widehat{C}$, also has a universal property: it is the comma object of $\mathrm{Id}\_{\widehat{C}}$ over $P:1\to \widehat{C}$. Thus a functor $A\to \widehat{C}/P$ is equivalent to a functor $A\to \widehat{C}$ and a natural transformation from it to the composite $A \to 1 \overset{P}{\to} \widehat{C}$. By the universal property of $\widehat{C}$, this is the same as giving a discrete fibration $A\leftarrow E \rightarrow C$ together with a map to the discrete fibration classified by $P:1\to \widehat{C}$, which is just $1\leftarrow \int P \rightarrow C$.


Next, (discrete) fibrations have the special property that not only is the composite of two (discrete) fibrations again a (discrete) fibration, but if $g$ is a discrete fibration and $g\circ f$ is a fibration, then $f$ is a fibration. Therefore, given a discrete fibration from $A$ to $C$ together with a map $E\to \int P$ over $C$, the map $E\to \int P$ is itself a fibration, and we can actually show that $A\leftarrow E \to \int P$ is itself a discrete fibration from $A$ to $\int P$, and that this is an equivalence. Hence, the slice category $\widehat{C}/P$ has the same universal property as $\widehat{\int P}$, so they are equivalent.


Now we can ask about replacing $P:1\to \widehat{C}$ with a more general functor $H:D\to \widehat{C}$. Here the fibrational-cosmos argument fails, because in the discrete fibration $D \leftarrow \int H \to C$ it is no longer true that the solitary map $\int H \to C$ is itself a *discrete* fibration, so cancellability no longer holds and $E\to \int H$ is no longer necessarily a fibration. However, at least in the 2-category $Cat$, we can still use it to figure out what $\widehat{C}/H$ should look like, by looking at the case $A=1$. In this case, to give a map $1 \to \widehat{C}/H$ means to give a map $d:1\to D$ (i.e. an object of $D$) along with a discrete fibration $E\to C$ and a map from $E$ to $D \leftarrow \int H \to C$ over $d$ and $\mathrm{Id}\_C$. This is the same as a map from $E$ to $d^\*(\int H) = \int H(d)$ over $C$, and we can then apply the previous argument here since both are discrete fibrations over $C$.


Thus, an object of $\widehat{C}/H$ consists of an object $d\in D$ together with a presheaf on $\int H(d)$. This is not a surprise, though, since we're just applying the original fact $\widehat{C}/P \simeq \widehat{\int P}$ objectwise. Since $d$ can vary between objects, what we're saying is really that $\widehat{C}/H$ is the category of elements of the functor $D\to Cat$ defined by $d\mapsto \widehat{\int H(d)}$, or more evocatively
$$ \widehat{C}/H = \int\_d \widehat{\int H(d)} $$
as a "double integral".


