TITLE: Decomposing a (co)limit by decomposing the indexing diagram
QUESTION [9 upvotes]: Let $D: I \to \mathcal C$ be a diagram, and suppose we have a colimit decomposition $I = \varinjlim_{j \in J} I_j$ in $Cat$. Then under certain conditions, we can decompose the colimit of $D$ as $\varinjlim_{i \in I} D_i = \varinjlim_{j \in J} \varinjlim_{i \in I_j} D_i$. But I've never seen general conditions along these lines spelled out for 1-categories.
Question 1: Is there some place where conditions making the above true are given in the 1-categorical setting?
For $\infty$-categories, there is Corollary 4.2.3.10 of Higher Topos Theory. Unfortunately, the formulation of the result is somewhat abstruse, being expressed in terms of the bespoke simplicial set denoted $K_F$ there (defined using 4 conditions in Notation 4.2.3.1).
As a result, I'm having the following problem: it seems to me that for any cocone of $\infty$-categories $(I_j \to I)_{j \in J}$, one should be able to construct a natural map $\varinjlim_{j \in J} \varinjlim_{i \in I_j} D_i \to \varinjlim_{i \in I} D_i$, and one would expect HTT 4.2.3.10 to imply that under the appropriate conditions, this map is an equivalence. But the formulation doesn't seem to easily lend itself to confirming this.
Question 2: Is the natural map $\varinjlim_{j \in J} \varinjlim_{i \in I_j} D_i \to \varinjlim_{i \in I} D_i$ constructed somewhere in reasonable generality? (Or else is it easy to construct from general machinery given somewhere?)
Question 3: Is there written somewhere an account of conditions (perhaps analogous to those of HTT 4.2.3.10) which ensure that this map is an equivalence?

REPLY [9 votes]: Let $p \colon E \to J$ be the cocartesian fibration for the diagram $j \mapsto I_j$. Then the colimit over $E$ of $F \colon E \to C$ can always (assuming the appropriate colimits exist in $C$)  be written as an iterated colimit:
$$ \mathrm{colim}_E \, F \simeq \mathrm{colim}_J \, p_! F \simeq \mathrm{colim}_{j \in J} \, \mathrm{colim}_{I_j} \, F|_{I_j}  $$
by first doing the colimit in two steps using the left Kan extension along $p$ and then that the inclusion $E_j \to E \times_J J_{/j}$ is cofinal since $p$ is cocartesian.
Now the colimit $I$ can be described as the localization of $E$ at the cocartesian morphisms. Since any localization is cofinal, this means there is a cofinal functor $q \colon E \to I$. For a functor $D \colon I \to C$, this means we have equivalences
$$ \mathrm{colim}_I \, D \simeq \mathrm{colim}_E \, Dq \simeq \mathrm{colim}_{j \in J} \, \mathrm{colim}_{I_j} \,D|_{I_j}. $$

REPLY [5 votes]: The way I always remember this stuff is as follows:

Given a map $J \to \mathsf{Cat}$ form the associated cocartesian fibration $E \to J$.
By assumption, $I$ is the actual colimit (as opposed to the left lax one) so we have a (weak) localization $E \to I$. Weak localizations are final (and initial, in fact) so, to compute the colimit over $I$ is the same as computing it over $E$.
To compute the colimit over $E$ we may first left Kan extend to $J$.
Since $E \to J$ is cocartesian, the map $E_x \to E_{/x}$ is final, and we may replace $E_{/x}$ with $E_x=I_x$ in the formula for left Kan extensions.

That gives the result.

REPLY [4 votes]: I assume $\varinjlim_{j : \mathcal{J}} \mathcal{I}_j = \mathcal{I}$ is meant in the strict sense of 1-categories. Since $\textbf{Cat}$ is cartesian closed,
$$\textstyle [\mathcal{I}, \mathcal{C}] \cong \varprojlim_{j : \mathcal{J}} [\mathcal{I}_j, \mathcal{C}]$$
where the limit on the RHS is also meant in the strict sense of 1-categories. Let $\lambda_j : \mathcal{I} j \to \mathcal{I}$ be the component of the colimit cocone in $\textbf{Cat}$. Then, we also get a limit formula for the hom-sets of $[\mathcal{I}, \mathcal{C}]$, namely,
$$\textstyle [\mathcal{I}, \mathcal{C}](D, \Delta T) \cong \varprojlim_{j : \mathcal{J}} [\mathcal{I}_j, \mathcal{C}](D \lambda_j, \Delta T)$$
so if the relevant colimits exist in $\mathcal{C}$,
$$\textstyle \mathcal{C} \left( \varinjlim_\mathcal{I} D, T \right) \cong \varprojlim_{j : \mathcal{J}} \mathcal{C} \left( \varinjlim_{\mathcal{I}_j} D \lambda_j, T \right) \cong \mathcal{C} \left( \varinjlim_\mathcal{J} \varinjlim_{\mathcal{I}_j} D \lambda_j, T \right)$$
as desired.