text:
\begin{document}

\numberwithin{equation}{subsection}
\renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textrm{#1}}
\title{Bounded complexes on Deligne-Mumford stacks}
\author{Weizhe Zheng}
\date{June 2010}
\maketitle

\begin{abstract}
  Laszlo and Olsson constructed Grothendieck's six operations for unbounded complexes on Artin stacks under an assumption of finite cohomological dimension. In this article we construct a formalism of six operations for bounded complexes on Deligne-Mumford stacks without this assumption. We develop a theory of gluing of pseudo-functors, which allows us to prove base-change theorems in derived categories.
\end{abstract}

\section*{Introduction}
Let $S$ be a regular scheme of dimension $\le 1$, $\ell$ a prime number invertible on~$S$. In \cite{LO1}, \cite{LO2}, Laszlo and Olsson construct a formalism of Grothendieck's six operations for unbounded complexes of $\ell$-power torsion and $\ell$-adic lisse-\'etale sheaves on finite type Artin $S$-stacks, under the assumption that the $\ell$-cohomological dimension of every finite type $S$-scheme is finite. Note that a field does not satisfy this assumption in general.

In this article, we construct a formalism of six operations for \emph{bounded} complexes of torsion and $\ell$-adic \'etale sheaves on finite type Deligne-Mumford $S$-stacks without the above assumption. This formalism generalizes that of \cite[Th.\ finitude]{SGA4d} and \cite[6.3]{Ekedahl}.

Let $\Lambda$ be a Gorenstein ring of dimension $0$ annihilated by an integer $m$ invertible on~$S$. We construct, in \S~2, for every morphism $f\colon \cX\to \cY$ of Deligne-Mumford $S$-stacks of finite type, functors
\begin{equation}\label{e.fu}
f^*, Rf^! \colon \Dbc(\cY,\Lambda)\to \Dbc(\cX,\Lambda),
\end{equation}
and, if $f$ is of prime to $m$ inertia (\ref{d.inert}), functors
\begin{equation}\label{e.fd}
Rf_*, Rf_! \colon \Dbc(\cX,\Lambda)\to \Dbc(\cY,\Lambda).
\end{equation}
As in \cite{LO1}, $Rf^!$ and $Rf_!$ are constructed by duality and the key point is the gluing of the dualizing complex.

If $f$ is of prime to $m$ inertia, under the additional assumptions that $f$ is separated and that $\cX$ and $\cY$ are of finite inertia, which are satisfied if $\cX$ and $\cY$ are separated, $Rf^!$ and $Rf_!$ are restrictions of more general functors
\[Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda), \quad Rf_!\colon D(\cX,\Lambda)\to D(\cY,\Lambda),\]
which we construct in \S~1 by applying Nagata compactification \cite{CLO} to the coarse spaces. This more direct approach allows us to construct the base change isomorphism (\ref{p.bcc}) in the derived category, which was constructed on the level of sheaves in \cite[\S~5]{LO1}. We also construct the support-forgetting morphism $Rf_!\Rightarrow Rf_*$, which was constructed in several cases by Olsson \cite[5.1, 5.17]{OlssonFuji}.

The construction does not depend on the choice of the compactification. In \cite[XVII]{SGA4} Deligne checked this for schemes by gluing \emph{two} fibered categories. The case of stacks is more complicated, because $f$ is isomorphic to a composition of \emph{three} morphisms (\ref{p.comp}). We set up the necessary framework of gluing in an appendix (\S~7).

In \S~3, we develop an $\ell$-adic formalism for a general topos. We closely follow the methods of \cite{LO2}. In \S~4, we apply this formalism to Deligne-Mumford stacks and construct analogues of \eqref{e.fu} and \eqref{e.fd} with $\Lambda$ replaced by a complete discrete valuation ring $\cO$ with fraction field $E$ of characteristic $0$ and residue field $F$ of characteristic~$\ell$. Again, we are able to construct the base change isomorphism (\ref{p.dagO}) and the support-forgetting morphism. In \S~5, we show that the restriction on the inertia of $f$ disappears when we pass from $\cO$ to $E$.

Our formalism is used in \cite[\S~2]{Illusie-Zheng} to give a generalization of Laumon's theorem on Euler-Poincar\'e characteristics. In \emph{loc.\ cit.}, the cases of $E$-coefficients and $F$-coefficients are treated separately. In \S~6, we use Brauer theory to prove that the case of $F$-coefficients follows from the case of $E$-coefficients.

We have largely ignored logical problems that are usually solved by choosing a universe~$\mathfrak{U}$.

By a regular scheme, we mean a Noetherian regular scheme.

It is a pleasure to thank Luc Illusie for the numerous comments he made on drafts of this paper. Part of this work was done during a stay at Morningside Center of Mathematics, Beijing. The author thanks the center for its hospitality.

\section{Operations on $D(\cX,\Lambda)$}
\begin{ssect}\label{s.top}
  Let $\Lambda$ be a commutative ring with unity. Let $f\colon \cX\to \cY$ be a morphism of toposes. The exact functor $f^*\colon \Mod(\cY,\Lambda) \to \Mod(\cX,\Lambda)$ induces a triangulated functor
\[f^*\colon D(\cY,\Lambda) \to D(\cX, \Lambda).\]
The left exact functor $f_*\colon \Mod(\cX, \Lambda) \to \Mod(\cY, \Lambda)$ has a right derived functor \cite[18.6]{KSCat}
\[Rf_*\colon D(\cX,\Lambda)\to D(\cY,\Lambda).\]
For $M\in D(\cX,\Lambda)$ and $N\in D(\cY,\Lambda)$, the projection formula map
\begin{equation}\label{e.pf}
  N\otimes_\Lambda^L Rf_* M \to Rf_* (f^*N \otimes_\Lambda^L M)
\end{equation}
is adjoint to the composition
\[f^*(N\otimes_\Lambda^L Rf_*M)\xrightarrow{\sim} f^*N\otimes_\Lambda^L f^*Rf_* M \to f^*N \otimes_\Lambda^L M,\]
where the second map is induced by the adjunction $f^* Rf_* M\to M$.

If $\cX$ is algebraic, $\cY$ is locally coherent \cite[VI 2.3]{SGA4} and $f$ is coherent \cite[VI 3.1]{SGA4}, then $R^qf_*$ commutes with small filtrant inductive limits for all $q$ \cite[VI 5.1]{SGA4}. Thus, in this case, $f_*$-acyclic sheaves on $\cX$ are stable under small filtrant inductive limits. If, moreover, $f_*$ is of finite cohomological dimension, then $Rf_*$ commutes with small direct sums \cite[14.3.4 (ii)]{KSCat}.
\end{ssect}

\begin{ssect}\label{s.stack}
Let $S$ be a quasi-separated scheme. All algebraic $S$-spaces are assumed to be quasi-separated. We use a more general notion of Deligne-Mumford stacks than that used in \cite{LMB}. By a \emph{Deligne-Mumford $S$-stack}, we mean an $S$-stack $\cX$ such that the diagonal $\Delta\colon \cX\to \cX\times_S\cX$ is representable, quasi-compact and quasi-separated, and such that there exists an algebraic $S$-space $X$ and an \'etale surjective morphism $X\to \cX$. The base scheme does not play much role, in the sense that if $S'\to S$ is a morphism of quasi-separated schemes, the 2-category of Deligne-Mumford $S'$-stacks is 2-equivalent \cite[1.2.10 (i)]{GabberR} to the 2-category of Deligne-Mumford $S$-stacks over $S'$. By a \emph{Deligne-Mumford stack}, we mean a Deligne-Mumford $\Spec(\Z)$-stack.

Let $\cX$ be a Deligne-Mumford $S$-stack. The 2-category of Deligne-Mumford $S$-stacks representable over $\cX$ is 2-equivalent to the 1-category $\Rep(\cX)$ obtained by identifying isomorphic 1-cells. The objects of $\Rep(\cX)$ are pairs $(\cY,f)$, where $\cY$ is a Deligne-Mumford $S$-stack and $f\colon \cY\to \cX$ is a representable morphism. A morphism of $\Rep(\cX)$ from $(\cY,f)$ to $(\cZ,g)$ is an equivalence class of pairs $(h,\alpha)$, where $h\colon \cY\to \cZ$ is a morphism of Deligne-Mumford $S$-stacks and $\alpha\colon f\to g h$ is a 2-cell. In such a pair, $h$ is necessarily a representable \'etale morphism. Two such pairs $(h,\alpha)$ and $(i,\beta)$ are equivalent if there exists a 2-cell $\gamma\colon h\Rightarrow i$ such that $\beta=(g \gamma) \alpha$, or, in other words, that $\beta$ is equal to the composition of the following $2$-cells

\[\xymatrix{\cY\ruppertwocell^i{^\gamma}\drlowertwocell_f{^\alpha} \ar[r]_h & \cZ\ar[d]^{g} \\
& \cX}\]
We define the \'etale site $\Et(\cX)$ of $\cX$ to be the full subcategory $\Et(\cX)$ of $\Rep(\cX)$ consisting of Deligne-Mumford $S$-stacks representable and \'etale over $\cX$, endowed with the \'etale topology.
The category $\Et(\cX)$ admits finite projective limits. The corresponding topos $\cX_\et$ is algebraic. The full subcategory of $\Et(\cX)$ consisting of affine $S$-schemes \'etale over~$\cX$, endowed with the \'etale topology, gives the same topos \cite[III 4.1]{SGA4}. If $\cX$ is quasi-compact, then $\cX_\et$ is coherent.

Let $f\colon \cX\to \cY$ be a morphism of Deligne-Mumford $S$-stacks. The functor
\[f^{-1}\colon \Et(\cY)\to \Et(\cX), \quad \cU\mapsto \cU\times_{\cY} \cX\]
is left exact and continuous \cite[III 1.6]{SGA4}.
Hence it induces a morphism of toposes $(f_*, f^*)\colon \cX_\et \to \cY_\et$ \cite[III 1.3]{SGA4}. If $f$ is quasi-compact, then this morphism of toposes is coherent.
If $g\colon\cX\to \cY$ is also a morphism and $\alpha\colon f\Rightarrow g$ is a 2-cell, $\alpha$ induces a natural transformation $g^{-1}\Rightarrow f^{-1}$, and hence a 2-cell $(f_*,f^*)\Rightarrow(g_*,g^*)$.

A surjective smooth morphism of Deligne-Mumford stacks is of cohomological descent, because \'etale locally it has a section.
\end{ssect}

\begin{ssect}\label{d.jt}
Let $\cX$ be a topos and $U$ be an object of $\cX$. Let $\cU=\cX/U$ and consider the morphism of toposes $j\colon \cU\to \cX$. The restriction functor $j^*\colon \Mod(\cX,\Lambda)
\to \Mod(\cU,\Lambda)$ admits a left adjoint
\[j_{!}\colon \Mod(\cU,\Lambda)\to \Mod(\cX,\Lambda)\]
\cite[IV 11.3.2]{SGA4}. We denote $j_!\Lambda_\cU$ by $\Lambda_{\cU,\cX}$. The functor $j_!$ is exact and induces a triangulated functor
\[j_!\colon D(\cU,\Lambda)\to D(\cX,\Lambda).\]

For $M\in D(\cU,\Lambda)$, $N\in D(\cX,\Lambda)$, the adjunction morphisms
\begin{equation}\label{e.jshradj}
R\Hom_\cX(j_! M, N) \to R\Hom_\cU(M,j^* N)
\end{equation}
and
\begin{equation}\label{e.jshradju}
R\cHom_\cX(j_! M, N) \to Rj_* R\cHom_\cU(M,j^* N)
\end{equation}
are isomorphisms. They are
induced by
\[\Hom^\bullet_\cX(j_! M, N') \simto \Hom^\bullet_\cU(M,j^* N'),\]
and
\[\cHom^\bullet_\cX(j_! M', N') \simto j_* \cHom^\bullet_\cU(M',j^* N'),\]
where $N'$ is homotopically injective and equipped with a quasi-isomorphism $N\to N'$, $M'$ belongs to $\tilde\cP_\cU$ and is equipped with a quasi-isomorphism $M'\to M$. Here $\tilde\cP_\cU$ is the smallest full triangulated subcategory of $K(\Mod(\cU,\Lambda))$ closed under small direct sums and containing $K^{-}(\cP_\cU)$, where $\cP_\cU$ is the full additive subcategory of $\Mod(\cU,\Lambda)$ consisting of flat sheaves. Note that $j^*$ preserves homotopically injective complexes.

The map \eqref{e.jshradju} is adjoint to the composition
\[j^*R\cHom_\cX(j_! M, N) \xrightarrow{\sim} R\cHom_\cU(j^*j_!M,j^* N) \to R\cHom_\cU(M,j^* N),\]
where the second map is deduced from the adjunction $M\to j^* j_! M$.

The projection formula map
\begin{equation}\label{e.jpf}
j_!(j^* N\otimes_\Lambda^L M)\to N\otimes_\Lambda^L j_! M,
\end{equation}
adjoint to the composition
\[j^* N\otimes^L_\Lambda M \to j^*N\otimes^L_\Lambda j^*j_! M \simeq j^*(N\otimes^L_\Lambda j_! M),\]
where the first map is deduced from the adjunction $M\to j^* j_! M$, is an isomorphism. In fact,
\eqref{e.jpf} is induced by the isomorphism of complexes \cite[18.2.5]{KSCat}
\[j_!\tot_\oplus(j^* N'\otimes_\Lambda M) \simto \tot_\oplus( N'\otimes_\Lambda j_! M)\]
where $N'$ belongs to $\tilde\cP_\cX$ and is equipped with a quasi-isomorphism $N'\to N$.
\end{ssect}

\begin{ssect}\label{s.jD}
  Let $f\colon \cY\to \cX$ be a morphism of toposes. Let $V=f^{-1}(U)$, $\cV=\cY/V$ and consider the following 2-commutative square $D$ of toposes
  \[\xymatrix{\cV\ar[r]^{j'}\ar[d]^{g} & \cY\ar[d]^f\\
\cU\ar[r]^j & \cX}\]
The base change map \eqref{e.bc}, natural transformation of functors $D(\cY,\Lambda)\to D(\cU,\Lambda)$
\[B_D\colon j^* Rf_* \Rightarrow Rg_* j'{}^*,\]
is a natural equivalence. By \ref{s.GD},
the base change map \eqref{e.bc'} is a natural equivalence of functors $D(\cU,\Lambda)\to D(\cY,\Lambda)$
\begin{equation}\label{e.shrbc}
A_D\colon j'_!g^* \Rightarrow f^* j_!,
\end{equation}
and $B_D^{-1}$ and $A_D^{-1}$ induce by adjunction the same natural transformation of functors $D(\cV,\Lambda)\to D(\cX,\Lambda)$
\begin{equation}\label{e.shrstar}
G_D\colon j_! Rg_* \Rightarrow Rf_* j'_!.
\end{equation}
\end{ssect}

\begin{ssect}\label{d.j}
Let $j\colon \cU\to \cX$ be a representable \'etale morphism of Deligne-Mumford $S$-stacks. Then \ref{d.jt} applies to $j$. If $j$ is an open immersion, the adjunction map $j^*Rj_*\Rightarrow \one_{D(\cU,\Lambda)}$ is invertible and we have, by \ref{s.rho}, a natural transformation of functors $D(\cU,\Lambda)\to D(\cX,\Lambda)$
\begin{equation}\label{e.rho}
  j_!\Rightarrow Rj_*,
\end{equation}
compatible with composition of open immersions.

If
\[\xymatrix{\cV\ar[r]^{j'}\ar[d]^{g} & \cY\ar[d]^f\\
\cU\ar[r]^j & \cX}\]
is a 2-Cartesian \cite[1.2.12]{GabberR} square of Deligne-Mumford $S$-stacks with $j$ representable and \'etale, then \ref{s.jD} applies.
\end{ssect}

\begin{ssect}\label{d.dist}
Let $i\colon \cY\to\cX$ be a closed immersion of Deligne-Mumford $S$-stacks. Then
\[i_*\colon \Mod(\cY,\Lambda)\to \Mod(\cX,\Lambda)\]
is exact.
Define  $i^!\colon \Mod(\cX,\Lambda)\to \Mod(\cY,\Lambda)$ by $i^!\cF=i^*\Ker(\cF \to j_*j^* \cF)$. Then $i^!$ is a right adjoint of $i_*$ and thus is left exact and has a right derived functor $Ri^!\colon D(\cX,\Lambda)\to D(\cY,\Lambda)$. Let $j\colon \cU \to \cX$ be the complementary open immersion.

For any complex $M$ of $\Lambda$-modules on $\cX$, we have a natural short exact sequence
\[0 \to j_!j^* M \to M \to i_* i^* M \to 0,\]
hence a distinguished triangle in $D(\cX,\Lambda)$
\begin{equation}\label{e.dist1}
j_!j^* M \to M \to i_* i^* M \to.
\end{equation}

For any complex $N$ of injective $\Lambda$-modules on $\cX$, we have a natural short exact sequence
\[0\to i_* i^! N \to N \to j_*j^* N \to 0.\]
It follows that, for any $N\in D(\cX,\Lambda)$, we have a distinguished triangle
\begin{equation}\label{e.dist2}
i_*Ri^!N \to N \to Rj_* j^* N \to.
\end{equation}
In fact, it suffices to take a quasi-isomorphism $N'\to N$, where $N'$ is homotopically injective with injective components \cite[14.1.6, 14.1.7]{KSCat}.

For $M\in D(\cX,\Lambda)$, $N\in D(\cX,\Lambda)$, the morphism
\begin{equation}\label{e.dist4}
R\cHom_\cY(i^* M, Ri^! N) \to Ri^! R\cHom_\cX(M,N),
\end{equation}
adjoint to the composition
\[i_* R\cHom_\cY(i^* M, Ri^! N) \xrightarrow{\sim} R\cHom_\cX(i_*i^*M, N)\to R\cHom_\cX(M,N),\]
where the second map is deduced from the adjunction $M\to i_* i^* M$, is an isomorphism. In fact, we have an isomorphism of distinguished triangles
\[\xymatrix{R\cHom_{\cX}(i_*i^* M, N)\ar[r]\ar[d] & R\cHom_\cX(M,N) \ar[r]\ar@{=}[d] & R\cHom_{\cX}(j_!j^* M, N)\ar[r]\ar[d] &\\
i_* Ri^! R\cHom_\cX(M,N) \ar[r] & R\cHom_\cX(M,N) \ar[r] & Rj_* j^* R\cHom_\cX(M,N) \ar[r] &}\]
\end{ssect}

\begin{Proposition}[Smooth base change]\label{p.sbc}
Let
\[\xymatrix{\cX'\ar[r]^{h}\ar[d]^{f'} & \cX\ar[d]^{f}\\
\cY'\ar[r]^{g} & \cY}\]
be a 2-Cartesian square of Deligne-Mumford $S$-stacks, $M\in D(\cX,\Lambda)$. Assume either
 \begin{description}
 \item[(a)] $g$ is \'etale, or
 \item[(b)] $g$ is smooth, $f$ is quasi-compact, $\Lambda$ is annihilated by an integer $m\in \Z$ invertible on~$S$, and $M\in D^{+}(\cX,\Lambda)$.
 \end{description}
 Then the base change map
\[g^* Rf_* M \to Rf'_* h^* M\]
is an isomorphism.
\end{Proposition}

\begin{proof}
This is standard. We give a proof for the sake of completeness.

Consider the diagram with 2-Cartesian square
\[\xymatrix{Y''\ar[r]^{\beta}& Y'\ar[r]^{g'}\ar[d]^{\alpha'} & Y\ar[d]^{\alpha}\\
&\cY'\ar[r]^{g} & \cY}\]
where $\alpha$ and $\beta$ are \'etale presentations with $Y$ and $Y''$ disjoint unions of quasi-compact schemes.
Since base change by $\alpha$ and $\alpha'\beta$ holds trivially, up to replacing $g$ by $g' \beta$, we may assume that $\cY$ and $\cY'$ are quasi-compact schemes. Case (a) is then trivial.
In case (b), take a quasi-compact \'etale presentation $\gamma\colon X\to \cX$ with $X$ an algebraic $S$-space. Let $X_\bullet=\cosk_0\gamma$ and let $\gamma_\bullet\colon X_\bullet\to \cX$ be the projection. Then $X_n=(X/\cX)^{n+1}$ is an algebraic $S$-space (even if we had taken $X$ to be an $S$-scheme). Take $X'_\bullet=\cX'\times_\cX X_\bullet$ (2-fiber product) and consider the square
\[\xymatrix{X'_\bullet\ar[r]^{h_\bullet}\ar[d]^{\gamma'_\bullet} & X_\bullet\ar[d]^{\gamma_\bullet}\\
\cX'\ar[r]^{h} & \cX}\]
By cohomological descent, the adjunction $M\to R\gamma_{\bullet*}\gamma_\bullet^*M$ is an isomorphism. It follows that it suffices to show that the base change maps
\[g^* R(f\gamma_\bullet)_* M_\bullet \to R(f'\gamma'_\bullet)_*h^* M_\bullet, \quad h^* R\gamma_{\bullet*} M_\bullet\to R\gamma'_{\bullet*} h_\bullet^* M_\bullet\]
are isomorphisms, where $M_\bullet = \gamma_\bullet^* M$. For the second map, repeating the first reduction of this proof, we may assume that $\cX$ and $\cX'$ are quasi-compact schemes. Therefore, we are reduced to proving the theorem under the additional hypotheses that $\cY$, $\cY'$ are quasi-compact schemes and $\cX$ is an algebraic $S$-space.
In this case, take an \'etale presentation $X\to \cX$ with $X$ a quasi-compact scheme and repeat the preceding reduction. We may then assume that $\cX$ is also an $S$-scheme. In this case, the result is classical \cite[XVI 1.2]{SGA4}.
\end{proof}

\begin{Proposition}\label{p.Homsm}
  Assume that $\Lambda$ is annihilated by an integer invertible on $S$. Let $f\colon \cX\to \cY$ be a smooth morphism of Deligne-Mumford $S$-stacks, $M,L\in D(\cY,\Lambda)$. Then the map
  \begin{equation}\label{e.Homsm}
  f^* R\cHom_\cY(M,L)\to R\cHom(f^* M,f^* L)
  \end{equation}
  is an isomorphism.
\end{Proposition}

\begin{proof}
  The problem is local for the \'etale topology on $\cX$ and on $\cY$. We may assume that $\cX$ and $\cY$ are quasi-compact schemes and $f$ is separated. Then $f$ is compactifiable and \eqref{e.Homsm} becomes the inverse of the trivial duality \cite[XVIII 3.1.12.2]{SGA4} via the isomorphism $f^*(d)[2d]\simto Rf^!$ \cite[XVIII 3.2.5]{SGA4}, where $d$ is the relative dimension of $f$. Note that the trivial duality holds in fact for unbounded complexes: the proof of \eqref{e.shradj2} applies.
\end{proof}

\begin{ssect}\label{s.uh}
  We say that a morphism $f$ of Deligne-Mumford $S$-stacks is a \emph{universal homeomorphism} if it is a homeomorphism and remains so after every 2-base change of Deligne-Mumford $S$-stacks. Note that we do not assume $f$ to be representable. A universal homeomorphism is universally injective, hence separated. Unlike the case of schemes, a universal homeomorphism does not induce an equivalence of \'etale toposes in general.
\end{ssect}

Assume in the rest of this section that $S$ is a Noetherian scheme.

\begin{Proposition}\label{p.comp}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia. Then $f$ is isomorphic to the composition of morphisms of Deligne-Mumford stacks
  \[\cX\xrightarrow{\pi}\cX'\xrightarrow{j} \cZ \xrightarrow{p} \cY,\]
  where $\pi$ is a proper homeomorphism, $j$ is an open immersion, $p$ is proper and representable.
  Moreover, if $f$ is quasi-finite, we can take $p$ to be finite.
\end{Proposition}

\begin{proof}
  Let $g\colon X\to Y$ be the morphism of coarse spaces \cite[1.1]{Conrad} associated to~$f$. Then $g$ is a separated morphism of algebraic $S$-spaces of finite type. Applying Nagata compactification \cite[1.2.1]{CLO} to $g$, we get $g=qk$, where $q\colon Z\to Y$ is a proper morphism of algebraic spaces and $k\colon X\to Z$ is an open immersion. It then suffices to take $p$ to be the base change of $q$ and $j$ to be the base change of~$k$.
  If $f$ is quasi-finite, so is $g$, and it suffices to apply Zariski's Main Theorem \cite[16.5]{LMB} to~$g$.
\end{proof}

Let $\cC$ be a 2-category. The \emph{inertia} of a 1-cell $f\colon X\to Y$ is defined to be
\[I_f=X\times_{\Delta_f,Y,\Delta_f} X.\]
The following is an immediate consequence of \cite[2.11]{Illusie-Zheng}.

\begin{Lemma}\label{p.I}
  Let
  \[\xymatrix{U'\ar[rr]\ar[dd]\ar[rd] && X'\ar[dd]|\hole \ar[rd]\\
  & U\ar[rr]\ar[dd] && X\ar[dd]\\
  V' \ar[rr]|\hole\ar[rd] && Y' \ar[rd]\\
  & V\ar[rr] && Y }\]
  be a 2-commutative cube in $\cC$ with 2-Cartesian bottom and top squares. Then the square
  \[\xymatrix{I_{U'/V'}\ar[r]\ar[d] & I_{X'/Y'}\ar[d]\\
  I_{U/V}\ar[r] & I_{X/Y}}\]
  is 2-Cartesian.
\end{Lemma}

It follows that Deligne-Mumford $S$-stacks of finite inertia are stable under 2-fiber products.

\begin{ssect}\label{d.inert}
Let $m$ be an integer. Following \cite[2.9]{Illusie-Zheng}, we say that a morphism $f\colon \cX\to \cY$ of Deligne-Mumford $S$-stacks is \emph{of prime to $m$ inertia} if

for every algebraically closed field~$\Omega$ and every point $x\in
\cX(\Omega)$, the order of the group
\[\Aut_{\cX_y}(x)\simeq \Ker(\Aut_{\cX}(x)\to \Aut_{\cY}(y))\]
is prime to $m$, where $y\in \cY(\Omega)$ is the image of $x$ under~$f$.

Note that morphisms of prime to $m$ inertia are closed under composition and base change.
\end{ssect}

\begin{Proposition}\label{p.gluestack}
  Let $m$ be an integer, $\cC$ be the 2-category of Deligne-Mumford $S$-stacks of finite type and finite inertia whose 1-cells are the separated morphisms of prime to~$m$ inertia. Let $\cX$ be an object of $\cC$, $\cA_\cX$ be the 2-faithful subcategory (\ref{s.faith}) of $\cC/\cX$ whose 1-cells are the open immersions, $\cB_\cX$ be the 2-faithful subcategory of $\cC/\cX$ whose 1-cells are the proper morphisms, $\cD$ be a 2-category. Then the 2-functor \eqref{e.glue}
  \begin{equation}\label{e.gluestack}
  \PsFun(\cC/\cX,\cD)\to \GD_{\cA_\cX,\cB_\cX}(\cC/\cX,\cD)
  \end{equation}
  is a $\twoFun(\Ob(\cC/\cX),\cD)$-equivalence (\ref{s.faith}).
\end{Proposition}

\begin{proof}
  To simplify notations, let $\cC'=\cC/\cX$, $\cA=\cA_\cX$, $\cB=\cB_\cX$ and let $\cA_1$, $\cA_2$, $\cB_1$, $\cB_2$ be the 2-faithful subcategories of $\cC'$ whose 1-cells are respectively the quasi-finite, representable and quasi-finite, quasi-finite and proper, finite morphisms. Then the functor \eqref{e.gluestack} is a composition of functors
  \begin{multline*}
    \PsFun(\cC',\cD)\xrightarrow{E_1} \GD_{\cA_1,\cB}(\cC',\cD) \xrightarrow{E_2} \GD_{\cB_1,\cA_2,\cB}(\cC',\cD)\\
    \xrightarrow{P_1} \GD_{\cA_2,\cB}(\cC',\cD) \xrightarrow{E_3} \GD_{\cA,\cB_2,\cB}(\cC',\cD) \xrightarrow{P_2} \GD_{\cA,\cB}(\cC',\cD),
  \end{multline*}
  where $P_1$ and $P_2$ are equivalences of categories by \ref{p.gluet} since $\cB_1,\cB_2\subset \cB$, and $E_1$, $E_2$ and $E_3$ are equivalences by \ref{p.glue'}: $E_1$ and $E_2$ satisfy condition (i) of \ref{p.glue'} by \ref{p.comp}, $E_3$ satisfies (i) by Zariski's Main Theorem, $E_2$ satisfies (vi') since $\cA_1\cap \cB=\cB_1$ by definition, $E_3$ satisfies (vi') since $\cA_2\cap \cB=\cB_2$ by Zariski's Main Theorem.
\end{proof}

Assume in the rest of this section that $\Lambda$ is annihilated by an integer $m\ne 0$. Unless otherwise stated, we do not assume that $m$ is invertible on $S$. We say that a morphism $f\colon \cX\to \cY$ of Deligne-Mumford $S$-stacks is \emph{$S$-proper}, if $f$ is the 2-base change of some proper morphism $f_0\colon \cX_0\to \cY_0$ of Deligne-Mumford $S$-stacks with $\cY_0$ locally of finite type over $S$. Recall that Chow's lemma \cite[16.6]{LMB} implies base change for $S$-proper morphisms and $D^+$. For morphisms of prime to $m$ inertia, this can be generalized to unbounded complexes as follows.

\begin{Lemma}\label{p.cd}
  Let $f\colon \cX\to \cY$ be an $S$-proper morphism of Deligne-Mumford $S$-stacks. Assume that $f$ is of prime to $m$ inertia and the fibers have dimension $\le d$. Then $f_*$ has cohomological dimension $\le 2d$.
\end{Lemma}

\begin{proof}
  Up to replacing $\cY$ by an \'etale presentation and $\cX$ be the corresponding 2-pull back, we may assume that $\cY$ is a separated scheme. Then $f$ factorizes through the coarse space of $\cX$, and we are reduced to two cases: (a) $f$ is a universal homeomorphism; (b) $f$ is representable. By proper base change for $D^+$, we may assume that $\cY$ is the spectrum of an algebraically closed field. In case (a), $\cX^\red=BG$, $G$ of order prime to $m$. In this case, $f_*$ can be identified with the functor of taking $G$-invariants, which is exact. Case (b) follows from \cite[6.4]{Illusie-Zheng}. We give a proof that does not make use of cohomology with proper support. We proceed by induction on $d$. By Chow's lemma \cite[IV.3.1]{Knutson}, there exists $\pi\colon X\to \cX$ proper and birational such that $X$ is a scheme. For any $\cF\in \Mod(\cX,\Lambda)$, complete the adjunction $\cF\to R\pi_* \pi^*\cF$ into a distinguished triangle
  \[\cF\to R\pi_* \pi^*\cF\to M \to.\]
  By the case of schemes of this lemma \cite[X 4.3, 5.2]{SGA4}, $Rf_* R\pi_* \pi^*\cF \simeq R(f\pi)_* \pi^* \cF\in D^{\le 2d}$ and, for any $i$, the support of $\fH^i M$ has dimension $\le d-1-i/2$. By induction hypothesis, $Rf_* M \in D^{\le 2d-2}$. Thus $Rf_* \cF\in D^{\le 2d}$.
\end{proof}

\begin{Proposition}\label{p.pbc}
(i) (Proper base change) Let
\[\xymatrix{\cX'\ar[r]^{h}\ar[d]^{f'} & \cX\ar[d]^{f}\\
\cY'\ar[r]^{g} & \cY}\]
be a 2-Cartesian square of Deligne-Mumford $S$-stacks where $f$ is $S$-proper and of prime to $m$ inertia, $M\in D(\cX,\Lambda)$. Then the base change map \[g^* Rf_* M \to Rf'_* h^* M\]
is an isomorphism.

(ii) (Projection formula) Let $f\colon X\to Y$ be an $S$-proper morphism of Deligne-Mumford $S$-stacks, $M\in D(\cX,\Lambda)$, $N\in D(\cY,\Lambda)$. Assume that $f$ is of prime to $m$ inertia. Then the map \eqref{e.pf}
\[N\otimes^L_\Lambda Rf_* M\to Rf_*(f^* N \otimes^L_\Lambda M)\]
is an isomorphism.
\end{Proposition}

\begin{proof}
  (i) We may assume $\cY$ quasi-compact. By \ref{p.cd}, we are then reduced to the known case when $M\in D^+$.

  (ii) By (i), we may assume that $\cY$ is the spectrum of a separably closed field. Since $Rf_*$ commutes with small direct sums (\ref{s.top}), we may assume $M\in D^-(\cX,\Lambda)$, and $N$ is represented by a complex bounded above with flat components. Then we may assume $M\in \Mod(\cX,\Lambda)$, and $N$ is a flat $\Lambda$-module. Then $N$ is a filtrant inductive limit of finite free $\Lambda$-modules. Since $R^q f_*$ commutes with such limits (\ref{s.top}), we may assume that $N$ is a finite free $\Lambda$-module. In this case \eqref{e.pf} is obviously an isomorphism.
\end{proof}

\begin{Proposition}\label{p.uhmp}
  Let
  \[\xymatrix{\cX\ar[r]^f\ar[d] & \cY\ar[d]\\
  \cX_0 \ar[r]^{f_0} & \cY_0}\]
  be a 2-Cartesian square of Deligne-Mumford $S$-stacks where $f_0$ is a proper universal homeomorphism (\ref{s.uh}) of prime to $m$ inertia, $\cY_0$ is locally of finite type over $S$. Let $M\in D(\cY,\Lambda)$. Then the adjunction map $M\to Rf_* f^* M$ is an isomorphism.
\end{Proposition}

\begin{proof}
  By proper base change (\ref{p.pbc}), we may assume that $\cY$ is the spectrum of an algebraically closed field. Then $\cX^\red=BG$, $G$ of order prime to $m$. In this case the assertion is trivial.
\end{proof}

\begin{ssect}\label{s.fshr}
  We use the gluing result \ref{p.gluestack} to give a first construction of $Rf_!$. Let $\cC$, $\cA=\cA_S$, $\cB=\cB_S$ be as in \ref{p.gluestack}, $\cD$ be the 2-category of triangulated categories.  Define an object $(F_\cA,F_\cB,G,\rho)$ of $\GD'_{\cA,\cB}(\cC,\cD)$ (\ref{s.gdp}) as follows. Let $F_\cA\colon \cA\to \cD$ be the pseudo-functor given by \ref{d.j}:
  \[\cX\mapsto D(\cX,\Lambda),\quad j\mapsto j_!, \quad \alpha\mapsto \alpha_!,\]
  and let $F_\cB\colon \cB\to \cD$ be the pseudo-functor given by
  \[\cX\mapsto D(\cX,\Lambda),\quad p\mapsto Rp_*, \quad \alpha\mapsto R\alpha_*.\] If $f$ is a proper open immersion, the 2-cell \eqref{e.rho} $f_!\Rightarrow Rf_*$ is invertible and let $\rho(f)$ be its inverse. If $D$ is a 2-Cartesian square \eqref{e.2}, let $G_D\colon i_! Rq_* \Rightarrow Rp_* j_!$ be the 2-cell as in \eqref{e.shrstar}. Then $i^* G_D$ can be identified with $\one_{Rq_*}$, hence is an isomorphism. Consider the complementary square
  \[\xymatrix{Y-X\ar[r]^{j'}\ar[d]^{q'} & Y\ar[d]^p\\
  W-Z\ar[r]^{i'} & W}\]
  The proper base change map
  \begin{equation}\label{e.fshr}
  i'^*Rp_* \Rightarrow Rq'_*j'{}^*
  \end{equation}
  is an isomorphism by \ref{p.pbc} (i), hence $i'{}^* G_D$ is $0\Rightarrow 0$. It follows that $G_D$ is an isomorphism. Axioms (b), (b'), (c), (c') follow from \ref{p.ax}. By \ref{p.gdp} and \ref{p.gluestack}, this defines a pseudo-functor $F\colon \cC\to\cD$. For any 1-cell of~$\cC$, namely, any separated morphism $f\colon \cX\to \cY$ of prime to~$m$ inertia of Deligne-Mumford $S$-stacks of finite type and finite inertia, we define
  \[Rf_!\colon D(\cX,\Lambda)\to D(\cY,\Lambda)\]
  to be $F(f)$.

  The gluing formalism also enables us to construct the following natural transformations.

  (i) \emph{Support-forgetting map.} Let $F'\colon \cC\to \cD$ be the pseudo-functor given by
  \[\cX\mapsto D(\cX,\Lambda), \quad f\mapsto Rf_*,\quad \alpha\mapsto R\alpha_*.\]
  Let $\epsilon_\cA\colon F|\cA\Rightarrow F'|\cA$ be the pseudo-natural transformation given by \eqref{e.rho} and $\epsilon_\cB\colon F|\cB\Rightarrow F'|\cB$ be the identity. Then $(\epsilon_\cA,\epsilon_\cB)$ is a 1-cell of $\GD'_{\cA,\cB}(\cC,\cD)$ by \ref{p.ax} (iv), thus defines a pseudo-natural transformation $F\Rightarrow F'$. For any 1-cell $f\colon \cX\to \cY$ of $\cC$, this defines a natural transformation of functors $D(\cX,\Lambda)\to D(\cY,\Lambda)$
  \[f_!\Rightarrow Rf_*,\]
  which is a natural equivalence if $f$ is proper.

  (ii) \emph{Base change isomorphism.} Let $g\colon \cX'\to \cX$ be a morphism of Deligne-Mumford stacks, $\cX$ of finite type and finite inertia over $S$, $\cX'$ of finite type and finite inertia over some Noetherian scheme $S'$. For every object $\cY$ of $\cC/\cX$, fix a 2-base change $\cY'\to \cY$ of $g$. Then $\cY'$ is of finite inertia over $S'$ by \ref{p.I}. For every 1-cell $\cZ\to \cY$ of $\cC/\cX$, fix a 2-Cartesian square of $S$-stacks obtained by 2-base change by $g$
  \[\xymatrix{\cZ'\ar[r]^{g''}\ar[d]^{f'} & \cZ\ar[d]^f\\
  \cY'\ar[r]^{g'} & \cY}\]
  In this way, we have defined a functor $\cC/\cX\to \cC_{S'}$.
  Let $F_1$ be the composition $\cC/\cX\to \cC\xrightarrow{F} \cD$ and $F_2$ be the composition $\cC/\cX\to \cC_{S'}\xrightarrow{F_{S'}} \cD$, $\epsilon_0\colon \lvert F_1 \rvert \to \lvert F_2 \rvert$ be given by $\epsilon_0(\cY)=g'{}^*$.  Let $\epsilon_\cA\colon F_1|\cA_\cX \Rightarrow F_2|\cA_\cX$ be the pseudo-natural transformation with $\lvert \epsilon_\cA \rvert=\epsilon_0$ given by the inverse of the base change map \eqref{e.shrbc}, $\epsilon_\cB\colon F_1|\cB_\cX \Rightarrow F_2|\cB_\cX$ be pseudo-natural transformation with $\lvert \epsilon_\cB \rvert=\epsilon_0$ given by proper base change. It follows from \ref{p.rhoAB} and \ref{p.GAB} that $(\epsilon_\cA,\epsilon_\cB)$ is a 1-cell of $\GD'_{\cA_\cX,\cB_\cX}(\cC/\cX,\cD)$. Thus it induces a pseudo-natural transformation $\epsilon \colon F_1\Rightarrow F_2$ with $\lvert \epsilon \rvert = \epsilon_0$. For any 1-cell $f\colon \cZ\to \cY$ of $\cC/\cX$, $\epsilon(f)$ is a natural equivalence
  \[g'{}^* Rf_!\Rightarrow Rf'_! g''{}^*.\]

  (iii) \emph{Projection formula isomorphism.} Let $\cX$ be a Deligne-Mumford $S$-stack of finite type and finite inertia, $N\in D(\cX,\Lambda)$. Let $F_1$ be the composition $\cC/\cX\to \cC \xrightarrow{F} \cD$ as in (ii) and let $\epsilon_0\colon \lvert F_1\rvert \to \lvert F_1 \rvert$ be given by $\epsilon_0(\cY)=N_\cY\otimes^L_\Lambda -$, where $N_\cY$ is the pull back of $N$ to $\cY$. Let $\epsilon_\cA\colon F_1|\cA_\cX \Rightarrow F_1|\cA_\cX$ be the pseudo-natural transformation with $\lvert \epsilon_\cA\lvert = \epsilon_0$ given by the inverse of  the projection formula \eqref{e.jpf}, $\epsilon_\cB\colon F_1|\cB_\cX \Rightarrow F_1|\cB_\cX$ be pseudo-natural transformation with $\lvert \epsilon_\cA\lvert = \epsilon_0$ given by the projection formula \ref{p.pbc} (ii).  Let $\cE$ be the category whose objects are $1$ and $2$ and whose morphisms are $\one_1$, $\one_2$ and $s\colon 1\to 2$. Consider the pseudo-functor $\cC/\cX\times \cE\to \cD$ given by
  \[(\cY,i)\mapsto D(\cY,\Lambda), \quad (\one_\cY,s)\mapsto N_\cY\otimes^L_\Lambda-, \quad (f,\one_i)\mapsto f^*-,\]
  where $i=1,2$. Then \eqref{e.jpf} and \ref{p.pbc} (ii) are respectively the base change maps \ref{s.bcA} and \ref{s.bc}. Hence \ref{p.rhoAB} and \ref{p.GAB} imply that $(\epsilon_\cA,\epsilon_\cB)$ is a 1-cell of $\GD'_{\cA_\cX,\cB_\cX}(\cC/\cX,\cD)$.  Thus it induces a pseudo-natural transformation $\epsilon \colon F_1\Rightarrow F_1$ with $\lvert \epsilon \rvert= \epsilon_0$. For any 1-cell $f\colon \cZ\to \cY$ of $\cC/\cX$, $\epsilon(f)$ is a natural equivalence
  \[N_\cY\otimes^L_\Lambda Rf_! - \Rightarrow Rf_!(N_\cZ\otimes^L_\Lambda -).\]

  We have obtained the following.
\end{ssect}

\begin{Theorem}\label{p.bcc}
  (i) (Base change) For any 2-Cartesian square of Deligne-Mumford stacks
  \[\xymatrix{\cX'\ar[r]^{h}\ar[d]^{f'} & \cX\ar[d]^{f}\\
  \cY'\ar[r]^{g} & \cY}\]
  with $\cX$ and $\cY$ of finite type and finite inertia over $S$, $\cY'$ of finite type and finite inertia over some Noetherian scheme $S'$, $f$ separated of prime to $m$ inertia, the base change map
  \[g^* Rf_! M \to Rf'_! h^* M\]
  is an isomorphism for all $M\in D(\cX,\Lambda)$.

  (ii) (Projection formula) Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford stacks of finite type and finite inertia over $S$, $M\in D(\cX,\Lambda)$, $N\in D(\cY,\Lambda)$. Assume that $f$ has prime to $m$ inertia. Then the projection formula map
  \[N\otimes^L_\Lambda Rf_! M \to Rf_!(f^* N \otimes^L_\Lambda M)\]
  is an isomorphism.
\end{Theorem}

\begin{Corollary}
 Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford stacks of finite type and finite inertia over $S$. Assume that $f$ has prime to $m$ inertia and the fibers of $f$ have dimension $\le d$. Then the cohomological amplitude of $Rf_!\colon D(\cX,\Lambda)\to D(\cY,\Lambda)$ is contained in $[0,2d]$.
\end{Corollary}

\begin{proof}
  By \ref{p.bcc} (i), we may assume that $\cY$ is the spectrum of a field. If we decompose $f\simeq pj\pi$ as in \ref{p.comp} with $j$ dominant, then $j_!$ is exact, $\pi_*$ is exact and $p_*$ has cohomological dimension $\le 2d$ by \ref{p.cd}, because the source of $p$ has dimension $\le d$.
\end{proof}

\begin{Proposition}\label{p.trace}
  There exists a unique way to define, for every separated quasi-finite flat representable morphism $f\colon \cX\to \cY$ of Deligne-Mumford stacks of finite type and finite inertia over some Noetherian scheme $T$ and every sheaf of $\Lambda$-modules $\cF$ on $\cY$, a trace map
  \[\Tr_f(\cF)\colon Rf_!f^* \cF\to \cF\]
  satisfying the following conditions:
  \begin{description}
    \item[(a)] (Compatibility with base change) For every 2-Cartesian square of Deligne-Mumford stacks
    \[\xymatrix{\cX'\ar[r]^h\ar[d]^{f'}&\cX\ar[d]^f\\
    \cY'\ar[r]^g & \cY}\]
    with $\cX$ and $\cY$ of finite type and finite inertia over some Noetherian scheme $T$, $\cX'$ and $\cY'$ of finite type and finite inertia over some Noetherian scheme $T'$, $f$ separated quasi-finite flat representable, and every $\cF\in \Mod(\cY,\Lambda)$, the following diagram commutes
    \[\xymatrix{g^*Rf_! f^* \cF\ar[r]^-{g^*\Tr_f(\cF)}\ar[d]^c & g^*\cF\\
    Rf'_! h^* f^* \cF \ar[r]^\simeq & Rf'_! f'{}^* g^* \cF\ar[u]^{\Tr_{f'}(g^*\cF)}}\]
    where $c$ is the base change isomorphism.
    \item{(b)} (Compatibility with composition) For every pair of composable separated quasi-finite flat representable morphisms
        \[\cX\xrightarrow{f}  \cY \xrightarrow{g}  \cZ \]
        of Deligne-Mumford stacks of finite type and finite inertia over some Noetherian scheme $T$ and every $\cF\in \Mod(\cZ,\Lambda)$, the following diagram commutes
        \[\xymatrix@C=4em{R(gf)_!(gf)^* \cF \ar[r]^-{\Tr_{gf}(\cF)}\ar[d]^{\simeq} & \cF\\
        Rg_!Rf_!f^*g^*\cF \ar[r]_-{Rg_!\Tr_f(g^*\cF)} & Rf_!f^* \cF\ar[u]^{\Tr_f(\cF)}}\]
    \item{(c)} (Normalization) If $f$ is finite flat of constant degree $d$, the composition
    \[\xymatrix{\cF\ar[r]^-a & f_* f^* \cF \ar[r]^{\simeq} & Rf_! f^* \cF \ar[r]^-{\Tr_f(\cF)} & \cF}, \]
    where $a$ is the adjunction, is multiplication by $d$.
  \end{description}
  Moreover, $\Tr_f(\cF)$ is functorial in $\cF$.
\end{Proposition}

Note that $Rf_!$ has cohomological dimension $0$ and is the derived functor of $R^0 f_!$. Since the construction of $\Tr_f$ is local for the \'etale topology on $\cY$, \eqref{p.trace} follows from \cite[XVII 6.2.3]{SGA4}.

In a different setting, Olsson \cite[4.1]{OlssonFuji} constructed trace maps for morphisms that are not necessarily representable.

\begin{ssect}\label{s.Rshr=shr}
  Let $j\colon \cX\to \cY$ be a separated \'etale representable morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia. Then the composition of natural transformations of functors $\Mod(\cX,\Lambda)\to \Mod(\cY,\Lambda)$
  \[\xymatrix{Rj_!\ar@{=>}[r]^-{Rj_! a} & Rj_!j^*j_! \ar@{=>}[r]^-{\Tr_j j_!} & j_!},\]
  where $a\colon \one\Rightarrow j^* j_!$ is the adjunction (\ref{d.j}), is a natural equivalence. In fact, by base change, we are reduced to the trivial case where $\cY$ is the spectrum of a separably closed field. More generally, we have a natural equivalence $Rj_!\simeq j_!$ of functors $D(\cX,\Lambda)\to D(\cY,\Lambda)$.
\end{ssect}

\begin{Proposition}\label{p.shradj}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia. Assume that $f$ is of prime to $m$ inertia. Then $Rf_!$ admits a right adjoint $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$. In particular, for $K\in D(\cX,\Lambda)$ and $L\in D(\cY,\Lambda)$, we have an isomorphism
  \begin{equation}\label{e.shradj}
  \Hom_\cY(Rf_!K,L)\to \Hom_\cX(K,Rf^! L),
  \end{equation}
  functorial in $K$ and $L$.
\end{Proposition}

If $f$ is a closed immersion, $Rf^!$ is isomorphic to the functor defined in \ref{d.dist}. If $f$ is \'etale and representable, \ref{s.Rshr=shr} induces a natural equivalence $f^*\simeq Rf^!$.

\begin{proof}
  This is a formal consequence of the fact that $Rf_!$ commutes with small direct sums \cite[14.3.1 (ix)]{KSCat}.  We may also repeat the construction of $Rf^!$ in \cite[XVIII 3.1.4]{SGA4} as follows, at least when $\Lambda$ is a Noetherian ring. Choose a decomposition $f\simeq pj\pi$ as in \ref{p.comp} and an integer $d$, upper bound of the dimensions of the fibers of $f$. For $\cF\in \Mod(\cX,\Lambda)$, define
  \[f_!^\bullet\cF=p_* \tau_{\le 2d}\cC_\ell^\bullet(j_!\pi_*\cF),\]
  where $\cC_\ell^\bullet$ is the modified Godement resolution (\ref{s.God}).
  Then $f_!^\bullet\cF$ computes $Rf_! \cF$. For every $q$, the functor $f_!^q\colon \Mod(\cX,\Lambda)\to \Mod(\cY,\Lambda)$ is exact and commutes with small inductive limits, hence admits a right adjoint \cite[XVIII 3.1.3]{SGA4}
  \[f^!_q\colon \Mod(\cY,\Lambda)\to \Mod(\cX,\Lambda)\]
  that preserves injectives. The functor
  \[\tot f^!_\bullet\colon C(\Mod(\cY,\Lambda))\to C(\Mod(\cX,\Lambda))\]
  passes through a functor of homotopy categories, which has a right localization \cite[14.3.1 (vi)]{KSCat}
  \[Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda).\]
  For $K\in C(\Mod(\cX,\Lambda))$ and $M\in C(\Mod(\cY,\Lambda))$, adjunction induces an
  isomorphism of complexes
  \begin{equation}\label{e.shradj0}
  \Hom^\bullet_\cY(\tot f_!^\bullet K, M)\to \Hom^\bullet_\cX(K,\tot f^!_\bullet M).
  \end{equation}
  It follows that $\tot f^!_\bullet$ preserves homotopically injective complexes.
  The isomorphism \eqref{e.shradj} is induced by \eqref{e.shradj0},
  where $M$ is a homotopically injective resolution of $L$.
\end{proof}

\newcommand{\oldshradj}{
Let $K$ be in $D(\cX,\Lambda)$, $L$ be in $D(\cX,\Lambda)$. Construct
\begin{equation}\label{e.shradj1}
  Rf_*R\cHom_{\cX}(K,L) \to R\cHom_{\cY}(Rf_! K, Rf_! L)
\end{equation}
as follows. Choose quasi-isomorphisms $K'\to K$ and $L\to L'$, where $L'$ is homotopically injective, $K'$ is a small direct sum of complexes bounded above with flat components. Then the left hand side of \eqref{e.shradj1} is computed by $f_*\cHom^\bullet_\cX(K',L')$. Choose a decomposition $f\simeq pj\pi$ as in \ref{p.comp}. For any \'etale representable morphism $b\colon \cV\to \cY$ of finite type with $\cV$ of finite inertia, form the diagram with 2-Cartesian squares
\[\xymatrix{\cU\ar[r]_{\pi_\cV}\ar@/^1.5pc/[rrr]^{f_\cV}\ar[d]^{a}& \cU'\ar[r]^{j_\cV}\ar[d] & \cW\ar[r]_{p_{\cV}}\ar[d] & \cV\ar[d]^{b}\\
\cX\ar[r]^{\pi}\ar@/_1.5pc/[rrr]^{f} & \cX'\ar[r]^j & \cZ\ar[r]^p & \cY}\]
This defines a morphism of complexes
\begin{multline*}
\Hom^\bullet_\cU(a^*K',a^*L')\to \Hom^\bullet_\cV(p_{\cV*}j_{\cV!}\pi_{\cV*}a^*K',p_{\cV*}j_{\cV!}\pi_{\cV*}a^*L')\\
\simeq \Hom^\bullet_\cU(b^* p_*j_!\pi_* K', b^* p_*j_!\pi_* L'),
\end{multline*}
and, in turn,
\[f_*\cHom^\bullet_\cX(K',L')\to \cHom_\cY^\bullet(p_*j_!\pi_*K',p_*j_!\pi_*L').\]
\begin{Proposition}
  Let $f\colon \cX\to \cY$ be as before, $K$ be in $D(\cX,\Lambda)$, $L$ be in $D(\cY,\Lambda)$. The composition
\begin{equation}\label{e.shradj2}
  Rf_* R\cHom_{\cX}(K, Rf^! L)\xrightarrow{\eqref{e.shradj1}} R\cHom_{\cY}(Rf_! K, Rf_! Rf^! L) \xrightarrow{R\cHom(Rf_! K, a)} R\cHom_{\cY}(Rf_! K, L),
\end{equation}
where $a\colon Rf_!Rf^! L\to L$ is the adjunction, is an isomorphism.
\end{Proposition}

\begin{proof}
  For any separated \'etale representable morphism $b\colon \cV\to \cY$ of finite type with $\cV$ of finite inertia, form the 2-Cartesian square
  \[\xymatrix{\cU\ar[r]^{f_\cV}\ar[d]^a& \cV\ar[d]^b\\
  \cX\ar[r]^f & \cY}\]
  Then $R\Gamma(\cV,b^*-)$ of \eqref{e.shradj2} can be identified with $\alpha \delta \epsilon ^{-1}\beta$ in the commutative diagram
  \[\xymatrix{&R\Hom_\cV(b^* Rf_! K, b^* Rf_! Rf^! L)\ar[r]^-{\alpha} &R\Hom_{\cV}(b^*Rf_! K, b^* L)\\
  & R\Hom_\cV(Rf_{\cV!}a^*K, b^* Rf_!Rf^! L)\ar[r]\ar[u]^{\delta}_{\simeq}\ar[d]^{\epsilon}_{\simeq} & R\Hom_{\cV}(Rf_{\cV!}a^*K,b^* L)\ar[u]_{\simeq}\\
  R\Hom_{\cU}(a^*K,a^* Rf^! L)\ar[r]^-\beta\ar[d]_\simeq & R\Hom_{\cV}(Rf_{\cV!} a^* K, Rf_{\cV!} a^* Rf^!L)\ar[d]_\simeq\\
  R\Hom_{\cU}(a^*K,Rf_\cV^! b^* L)\ar[r]^-{\beta'} & R\Hom_{\cV}(Rf_{\cV!}a^* K, Rf_{\cV!}Rf_\cV^! b^*L\ar@/_/[ruu]_{\alpha'})}\]
  where $\beta'\alpha'$ is the inverse of \eqref{e.shradj}.
\end{proof}
}

\begin{Proposition}
  Let $f\colon \cX\to \cY$ be as in \ref{p.shradj}, $K$ be in $D(\cX,\Lambda)$, $L$ and $M$ be in $D(\cY,\Lambda)$. We have natural isomorphisms
\begin{gather}\label{e.shradj1}
  R\cHom_{\cY}(Rf_! K, L) \to Rf_* R\cHom_{\cX}(K, Rf^! L),\\
  R\cHom_\cX(f^* M, Rf^! L) \to Rf^!R\cHom_\cY(M,L),\label{e.shradj2}
\end{gather}
functorial in $K$, $L$ and $M$.
\end{Proposition}

\begin{proof}
  These are induced by the following isomorphisms
  \begin{multline*}
    \Hom_\cY(M,R\cHom_\cY(Rf_!K,L)) \simeq \Hom_\cY(M\otimes^L_\Lambda Rf_!K,L)\\
    \xrightarrow{A^{-1}} \Hom_\cY(Rf_!(f^*M\otimes^L_\Lambda K),L)\simeq \Hom_\cX(f^*M\otimes^L_\Lambda K,Rf^!L) \\
    \shoveright{\simeq \Hom_\cX(f^*M,\cHom_\cX(K,Rf^!L))\simeq \Hom_\cY(M,Rf_*R\cHom_\cX(K,Rf^!L)),}\\
    \shoveleft{\Hom_\cX(K,R\cHom_\cX(f^*M,Rf^!L))\simeq \Hom_\cX(f^*M\otimes^L_\Lambda K,Rf^!L) }\\
    \simeq\Hom_\cY( Rf_!(f^*M\otimes^L_\Lambda K),L)\xrightarrow{A} \Hom_\cY(M\otimes^L_\Lambda Rf_!K,L)\\
    \simeq\Hom_\cY(Rf_!K,R\cHom_\cY(M,L)) \simeq \Hom_\cX(K,Rf^!R\cHom_\cY(M,L)),
  \end{multline*}
  where $A$ is induced by projection formula $M\otimes^L_\Lambda Rf_! K \to Rf_!(f^* \otimes^L_\Lambda K)$ (\ref{p.bcc} (ii)).
\end{proof}

The base change isomorphism \ref{s.fshr} (ii) induces the following by adjunction.

\begin{Proposition}\label{p.usbc}
  Let
    \[\xymatrix{\cX'\ar[r]^h \ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^g & \cY}\]
  be a 2-Cartesian square of Deligne-Mumford $S$-stacks of finite type and finite inertia, $g$ separated of prime to $m$ inertia. Let $M\in D(\cX,\Lambda)$. Then the map
  \[Rf'_*Rh^! M \to Rg^! Rf_* M\]
  is an isomorphism.
\end{Proposition}

\begin{ssect}\label{s.dag}
  The construction of $Rf_!$ in \ref{s.fshr} works without assumption on the inertia of $f$ if we restrict to $D^+$. More precisely, let $\cC_1$ be the 2-category of Deligne-Mumford $S$-stacks of finite type and finite inertia whose 1-cells are the separated morphisms, $\cA$ be the 2-faithful subcategory of $\cC_1$ whose 1-cells are the open immersions, $\cB_1$ be the 2-faithful subcategory of $\cC_1$ whose 1-cells are the proper morphisms, $\cD$ be the 2-category of triangulated categories. Let $F_\cA\colon \cA\to \cD$ be the pseudo-functor given by \ref{d.j}:
  \[\cX\mapsto D^+(\cX,\Lambda), \quad j\mapsto j_!, \quad \alpha\mapsto \alpha_!,\]
  and let $F_{\cB_1}\colon \cB_1\to \cD$ be the pseudo-functor given by
  \[\cX\mapsto D^+(\cX,\Lambda), \quad p\mapsto Rf_*, \quad \alpha\mapsto R\alpha_*.\]
  We define $G$ and $\rho$ as before. Note that the proper base change map \eqref{e.fshr} is an isomorphism because we work over $D^+$. This defines an object of $\GD'_{\cA,\cB_1}(\cC_1,\cD)$ and let $F\colon \cC_1\to \cD$ be a corresponding pseudo-functor. For any 1-cell $f\colon \cX\to \cY$ of $\cC_1$, we define
  \[Rf_\dag \colon D^+(\cX,\Lambda)\to D^+(\cY,\Lambda)\]
  to be $F(f)$. If $f$ is of prime to $m$ to inertia, this is the same as $Rf_!$. In general, $Rf_\dag$ is not the correct definition of $Rf_!$, but in \S~5 we will use it to give the correct definition of $Rf_!$ for coefficients of characteristic $0$.

  For any 1-cell $f\colon \cX\to \cY$ of $\cC_1$, we have the support-forgetting natural transformation of functors $D^+(\cX,\Lambda)\to D^+(\cY,\Lambda)$
  \[Rf_\dag\Rightarrow Rf_*,\]
  which is a natural equivalence if $f$ is proper. Base change isomorphisms are also constructed as before.
\end{ssect}

\begin{Proposition}\label{p.dagbc}
  For any 2-Cartesian square of Deligne-Mumford stacks
  \[\xymatrix{\cX'\ar[r]^{h}\ar[d]^{f'} & \cX\ar[d]^{f}\\
  \cY'\ar[r]^{g} & \cY}\]
  with $\cX$ and $\cY$ of finite type and finite inertia over $S$, $\cY'$ of finite type and finite inertia over some Noetherian scheme $S'$, $f$ separated, the base change map
  \[g^* Rf_\dag M \to Rf'_\dag h^* M\]
  is an isomorphism for all $M\in D^+(\cX,\Lambda)$.
\end{Proposition}

\newcommand{\uhsone}{
Assume in the rest of this section that $\Lambda$ is annihilated by an integer $m$ invertible on $S$.

\begin{Proposition}\label{p.usGD}
  Let
  \[\xymatrix{\cX'\ar[r]^h\ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^g & \cY}\]
  be a 2-Cartesian square of Deligne-Mumford $S$-stacks of finite type and finite inertia. Assume that $f$ is separated of prime to $m$ inertia and that either (a) $f$ is smooth or (b) $g$ is a universal homeomorphism. Let $M\in D^+(\cY,\Lambda)$. Then the map
  \[h^* Rf^! M \to Rf'{}^! g^* M\]
  induced from the inverse of \ref{p.bcc} (i) by adjunction is an isomorphism.
\end{Proposition}

\begin{proof}
  (a) The problem being local for the \'etale topology on $\cX$, $\cY$ and $\cY'$, we are reduced to case of schemes and we may assume that $f$ is purely of dimension $d$. Then the assertion is a consequence of the commutation of the trace map with base change. In fact, if $\alpha\colon h^* Rf^! \Rightarrow Rf'{}^! g^*$ and $\beta$ denotes the base change map, then the following diagram commutes
  \[\xymatrix{h^*f^*(d)[2d]\ar@=[ddd]^{\simeq}\ar@=[rdd]^{\eta_{f'}}\ar@=[r]^-{\eta_f} & h^*Rf^!Rf_!f^*(d)[2d] \ar@=[d]^\alpha\ar@=[r]^-{\Tr_f}
  & h^*Rf^! \ar[ddd]^\alpha\\
  & Rf'{}^! g^* Rf_! f^*(d)[2d] \ar@=[d]^{\beta}\ar@=[rdd]^{\Tr_f} \\
  & Rf'{}^!Rf'_! h^* f^*(d)[2d]\ar@=[d]^{\simeq} \\
  f'{}^*g^*(d)[2d] \ar@=[r]^-{\eta_{f'}} & Rf'{}^! Rf'_! f'{}^* g^*(d)[2d] \ar@=[r]^-{\Tr_{f'}} & Rf'{}^! g^* }\]

  (b) The problem being local for the \'etale topology on $\cX$ and $\cY$, and case (a) already known, we may assume that $f$ is a closed immersion. Consider the complementary square
  \[\xymatrix{\cZ'\ar[r]^k \ar[d]^{j'} & \cZ\ar[d]^j\\
  \cY'\ar[r]^g & \cY}\]
  Then we have the following isomorphism of distinguished triangles
  \[\xymatrix{h^*Rf^! M \ar[r]\ar[d] & h^*f^* M \ar[r]\ar[d]^\simeq & h^*f^*Rj_*j^*M\ar[r]\ar[d]^B &\\
  Rf'{}^! g^* M \ar[r] & f'{}^* g^*M \ar[r] & f'{}^* Rj'_* j'{}^* g^* M\ar[r] &}\]
  Here $B$ is induced by homeomorphic base change (\ref{p.uhbc})
  \[f'{}^* g^* Rj_* j^* M \to f'{}^* Rj'_* k^* j^* M .\]
\end{proof}

\begin{Proposition}\label{p.usrho}
  Let $f\colon \cX\to \cY$ be a universal homeomorphism of prime to $m$ inertia of Deligne-Mumford $S$-stacks of finite type and finite inertia, $M\in D^+(\cY,\Lambda)$. Then the map $f^* M \to Rf^! M$ induced from the inverse of \label{p.uhmp} by adjunction is an isomorphism.
\end{Proposition}

\begin{proof}
  By \ref{p.usGD}, we may assume that $\cY$ is the spectrum of an algebraically closed field. Then $\cX^\red\simeq BG$, $G$ or order prime to $m$. In this case the assertion is clear.
\end{proof}

\begin{ssect}\label{s.us}
  We extend the definition of $Rf^!\colon D^+\to D^+$ to cases without assumption on the inertia of $f$ as follows. Let $\cC_1$ be the 2-category of Deligne-Mumford $S$-stacks of finite type and finite inertia whose 1-cells are the separated morphisms, $\cC$ be the 2-faithful subcategory of $\cC_1$ whose 1-cells are the morphisms of prime to $m$ inertia, $\cU$ be the 2-faithful subcategory of $\cC_1$ whose 1-cells are the morphisms of universal homeomorphisms. Then, by \ref{p.comp} and \ref{p.glue},
  \[\PsFun(\cC_1,\cD)\to \GD_{\cU,\cC}(\cC_1,\cD)\]
  is a $\twoFun(\Ob(\cC),\cD)$-equivalence for any 2-category $\cD$. Let $\cD$ be the 2-category of triangulated categories. Let $F_\cU\colon \cU\to \cD^\op$ be the pseudo-functor
  \[\cX\mapsto D^+(\cX,\Lambda), \quad f\mapsto f^*, \quad \alpha \mapsto \alpha^*,\]
  and let $F_{\cC}\colon \cC\to \cD^\op$ be the pseudo-functor
  \[\cX\mapsto D^+(\cX,\Lambda), \quad f\mapsto Rf^!, \quad \alpha \mapsto R\alpha^!.\]
  For any 2-Cartesian square $D$ in \ref{p.usGD}, let $G_D$ be the invertible 2-cell $h^* Rf^!\Rightarrow Rf'{}^! g^*$. For any 1-cell $f$ of $\cU\cap \cC$, let $\rho(f)$ be the invertible 2-cell $f^* \Rightarrow Rf^!$ as in \ref{p.usrho}. Applying \ref{p.ax} with the help of $Rf_\dag$ (\ref{s.dag}),  we see that $(F_\cU,F_\cC,G,\rho)$ is an object of $\GD'_{\cU,\cC}(\cC_1,\cD)$. Let $F\colon \cC_1\to\cD^\op$ be a pseudo-functor corresponding to this gluing datum. For any 1-cell $f\colon \cX\to \cY$ of $\cC_1$, define
  \[Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)\]
  to be $F(f)$.

  We define the base change isomorphism by gluing the adjoint of \ref{p.bcc} (i) and the inverse of the homeomorphic base change (\ref{p.uhbc}. This is possible by \ref{p.rhoAB} and \ref{p.GAB}.
\end{ssect}

\begin{Theorem}
  Let
  \[\xymatrix{\cX'\ar[r]^h\ar[d]^{f'} & \cX\ar[d]\\
  \cY'\ar[r]^g & \cY}\]
  be a 2-Cartesian square of Deligne-Mumford stacks, $\cX$ and $\cX'$ of finite type and finite inertia over $S$, $\cY$ of finite type and finite inertia over some Noetherian scheme $T$, $g$ separated. Let $M\in D^+(\cX,\lambda)$. Then the base change map
  \[Rf'_* Rh^!M \to Rg^! Rf_* M\]
  is an isomorphism.
\end{Theorem}

If $S$ has finite dimension, the construction of $Rf^!$ (\ref{s.us}) can be extended to unbounded complexes. In fact, \ref{p.cdim} ensures that homeomorphic base change (\ref{p.uhbc}) works for unbounded complexes. Note that although \ref{p.ax} (i) and (ii) no longer apply, axioms (b) and (b') can be checked similarly to the proof of \ref{p.ax} (i) and (ii).

\begin{Proposition}\label{p.fucd}
  Assume that $S$ has finite dimension. Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia. Then $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$ has finite cohomological amplitude.
\end{Proposition}

\begin{proof}
  We easily reduce to two cases: (a) $f$ is a smooth morphism of schemes; (b) $f$ is a closed immersion. In case (a), $Rf^!\simeq f^*(d)[2d]$, where $d$ is the relative dimension. Case (b) is an instance of \ref{p.cdim} (ii).
\end{proof}
}

\begin{Proposition}\label{p.cdim}
  Assume that $S$ has finite dimension. Let $f\colon \cX\to \cY$ be a morphism of prime to $m$ inertia of Deligne-Mumford $S$-stacks of finite type.

  (i) $f_*\colon \Mod(\cX,\Lambda)\to \Mod(\cY,\Lambda)$ has finite cohomological dimension.

  (ii) If $f$ is a closed immersion, $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$ has finite cohomological amplitude.

  (iii) Assume that $\Lambda$ is annihilated by an integer $m$ invertible on $S$. If $f$ is separated of prime to $m$ inertia, then $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$ has finite cohomological amplitude.
\end{Proposition}

\begin{proof}
  (i) Up to replacing $\cY$ be an \'etale presentation and $\cX$ by the corresponding 2-pull-back, we may assume that $\cY$ is a scheme. In particular, if $f$ is an open immersion, then the result follows from the case of schemes, which is a recent result of Gabber \cite{Gabbercd}. This implies (ii) by the distinguished triangle \eqref{e.dist2}. In the general case, we proceed by induction. Let $j\colon\cU\to \cX$ be a dominant open immersion with $\cU$ separated over $S$ and let $i$ be a complementary closed immersion. Applying $Rf_*$ to \eqref{e.dist2} and induction hypothesis to $fi$, we are reduced to prove that $(fj)_*$ has finite cohomological dimension. In other words, we may assume $\cX$ separated over $S$. By the factorization \ref{p.comp}, we are then reduced to two cases: (a) $f$ is an open immersion; (b) $f$ is proper. Case (a) is known and (b) follows from \ref{p.cd}.

  (ii) Already proved.

  (iii) We easily reduce to two cases: (a) $f$ is a smooth morphism of schemes; (b) $f$ is a closed immersion. In case (a), $Rf^!\simeq f^*(d)[2d]$, where $d$ is the relative dimension. Case (b) is an instance of (ii).
\end{proof}

\section{Operations on $D^b_c(\cX,\Lambda)$}

In \ref{s.constr} through \ref{p.cN}, let $S$ be a quasi-separated scheme and $\Lambda$ be a Noetherian ring.

\begin{ssect}\label{s.constr}
  On a Deligne-Mumford $S$-stack $\cX$, we say a sheaf $\cF\in \Mod(\cX,\Lambda)$ is \emph{constructible} if $\alpha^* \cF\in \Mod(X,\Lambda)$ is constructible for some (or, equivalently, for every) \'etale presentation $\alpha\colon X\to\cX$ where $X$ an $S$-scheme.

  We say that a full subcategory of an abelian category is \emph{thick} \cite[8.3.21 (iv)]{KSCat} if it is closed under kernels, cokernels and extensions. The full subcategory $\Mod_c(\cX,\Lambda)$ of $\Mod(\cX,\Lambda)$  consisting of constructible sheaves $\Lambda$-modules is thick. Let $D_c(\cX,\Lambda)$ be the triangulated subcategory of $D(\cX,\Lambda)$ consisting of complexes with constructible cohomology sheaves.
\end{ssect}

\begin{Proposition}\label{p.c}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack. Denote by $\Etqc(\cX)$ the full subcategory of $\Et(\cX)$ consisting of Deligne-Mumford $S$-stacks representable, \'etale and quasi-compact over $\cX$. Let $\cF$ be a sheaf of $\Lambda$-modules $\cF$ on $\cX$. Then the following conditions are equivalent:
  \begin{description}
   \item[(a)] $\cF$ is constructible;
   \item[(b)] For any epimorphism $\alpha\colon \cF_I=\oplus_{i\in I}\Lambda_{\cU_i,\cX}\to \cG$, where $\cU_i$ is an object of $\Etqc(\cX)$ for every $i\in I$, $\cG$ is either $\cF$ or the kernel of a map $\Lambda_{\cV,\cX}\to \cF$, $\cV$ is an object of $\Etqc(\cX)$, there exists a finite subset $J\subset I$ such that $\cF_J\hookrightarrow \cF_I \xrightarrow{\alpha} \cG$ is an epimorphism, where $\cF_J=\oplus_{j\in J}\Lambda_{\cU_j,\cX}$;
   \item[(c)] $\cF$ is isomorphic to the cokernel of a map $\Lambda_{\cU,\cX} \to \Lambda_{\cV,\cX}$, where $\cU$ and $\cV$ are  objects of $\Etqc(\cX)$;
   \end{description}
\end{Proposition}

Here $\Lambda_{\cU,\cX}$ is the sheaf defined in \ref{d.jt}.

\begin{proof}
  Let $f\colon X\to \cX$ be a quasi-compact \'etale presentation where $X$ is a scheme.

  (c)$\implies$(a). Since  $f^*\Lambda_{\cU,\cX}$ is constructible,
  so is $\Lambda_{\cU,\cX}$.

  (a)$\implies$(b). By the above, $\cG$ is constructible. Since $f^*\alpha \colon f^*\cF_I\to f^* \cG$ is an epimorphism, there exists a finite subset $J\subset I$ such that $f^*\cF_J\to f^*\cG$ is an epimorphism by the proof of \cite[IX 2.7]{SGA4}. Then $\cF_J\to \cG$ is an epimorphism.

  (b)$\implies$(c). Note that $(\Lambda_{\cU,\cX})_{\cU\in \Etqc(\cX)}$ is a system of generators of $\Mod(\cX,\Lambda)$.
  Thus there exists an epimorphism $\cF_I\to \cF$.  By (b), we may assume that $I$ is finite. Then $\cF_I\simeq\Lambda_{\cV,\cX}$, where $\cV=\coprod_{i\in J} \cU_i \in \Etqc(\cX)$. Applying the above argument to $\cG=\Ker(\Lambda_{\cV,\cX}\to \cF)$, we get an epimorphism $\Lambda_{\cU,\cX}\to \cG$, $\cU\in \Etqc(\cX)$.
\end{proof}

\begin{Corollary}\label{p.c1}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack, $\cF$ be a constructible $\Lambda$-module on~$\cX$. The functor $\Hom_\cX(\cF,-)\colon \Mod(\cX,\Lambda)\to \Lambda$ commutes with small inductive limits.
\end{Corollary}

This follows from \ref{p.c} and \cite[VI 1.23]{SGA4}.

\begin{Corollary}\label{p.c2}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack. Any $\Lambda$-module $\cF$ on $\cX$ is a filtrant inductive limit of constructible $\Lambda$-modules on $\cX$.
\end{Corollary}

\begin{proof}
  Fix an epimorphism $\cF_I=\oplus_{i\in I}\Lambda_{\cU_i,\cX}\to \cF$, where $\cU_i$ is an object of $\Etqc(\cX)$, $i\in I$. For every $i\in I$, fix a surjection $\cF_{J_i}\to \Ker(\cF_i\to \cF)$. Then $\cF$ is the inductive limit of $\Coker(\cF_B\to \cF_A)$, where $(A,B)$ runs over pairs of finite subsets $A\subset I$, $B\subset \coprod_{i\in I}J_i$. The pairs are ordered by inclusion.
\end{proof}

\begin{Corollary}\label{p.c3}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack. The functor
  \[\varinjlim\colon \Ind\Mod_c(\cX,\Lambda)\to \Mod(\cX,\Lambda)\]
  is an equivalence of categories.
\end{Corollary}

This follows from \ref{p.c1} and \ref{p.c2}.

\begin{ssect}\label{s.God}
  As in \cite[XVIII 3.1.2]{SGA4}, \ref{p.c3} allows us to construct the modified Godement resolution. Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack. For any sheaf $\cF$ of $\Lambda$-modules on $\cX$, denote the Godement resolution of $\cF$ by $\cC^\bullet(\cF)$. Define the modified Godement resolution to be \[\cC_\ell^\bullet(\cF)=\varinjlim_{i\in I}\cC^\bullet(\cF_i),\]
  where $(\cF_i)_{i\in I}$ is a system of constructible $\Lambda$-modules such that $\cF\simeq \varinjlim_{i\in I}\cF_i$. This is a flasque resolution of $\cF$, independent up to isomorphisms of the choice of $(\cF_i)_{i\in I}$. For all $q$, the functor $\cC_\ell^q(\cF)$ is exact and commutes with small inductive limits and \'etale localization.
\end{ssect}

\begin{Proposition}\label{p.cN}
  Let $\cX$ be a Noetherian Deligne-Mumford $S$-stack. A sheaf of $\Lambda$-modules $\cF$ on $\cX$ is constructible if and only if it is Noetherian.
\end{Proposition}

In particular, constructible sheaves on $\cX$ are closed by subobjects and quotients.

\begin{proof}
  Let $f\colon X\to \cX$ be a quasi-compact \'etale presentation where $X$ is an $S$-scheme. If $\cF$ is constructible, then $f^*\cF$ is constructible, hence Noetherian \cite[2.9 (ii)]{SGA4}. It follows that $\cF$ is Noetherian. If $\cF$ is Noetherian, then the sheaf $\cG$ in \ref{p.c} (b) is Noetherian by the above, thus $\cF$ is constructible by \ref{p.c} (b)$\implies$(a).
\end{proof}

\newcommand{\wrongproof}{
Recall the following construction \cite[14.4.1]{KSCat} in homological algebra.

\begin{Lemma}
  Let $\cC$ be an abelian category admitting small direct sums and small direct sums are exact in $\cC$. Let $M\in C(\cC)$. Let
  \[p_n\colon P_n\to \tau^{\le n} M, \quad Q_n\to \Cone(P_n\oplus P_{n+1} \xrightarrow{(p_n,-p_{n+1})} \tau^{n+1}X)[-1],\]
  $n\in \Z$, be families of quasi-isomorphisms in $C(\cC)$. Then the map $\Cone(Q\xrightarrow{w} P)\to M$  is a quasi-isomorphism. Here $P=\oplus_{n\in \Z} P_n$, $Q=\oplus_{n\in \Z} Q_n$, $w$ is induced by $u-v$, where $u\colon Q_n\to P_n$, $v\colon Q_n\to P_{n+1}$.
\end{Lemma}

\begin{Lemma}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack and $M\in C^{\le b}(\Mod(\cX,\Lambda))$ be a complex such that $\fH^iM\in \Mod_c(\cX,\Lambda)$ for all $i$. Then there exists a quasi-isomorphism $M'\to M$ in $C(\cC)$ with $M'\in C^{\le b}(\Mod_c(\cX,\Lambda))$. Moreover, if $M\in C^{[a,b]}$, we can take $M'\in C^{[a,b]}$.
\end{Lemma}

\begin{proof}
  For the first assertion, applying \cite[13.2.1 (ii)]{KSCat} with arrows reverted, it suffices to show that for any epimorphism $\cF_2\to \cF_1$ in $\Mod(\cX,\Lambda)$ with $\cF_1\in \Mod_c$, there exists $\cF_3\to \cF_2$ with $\cF_3\in \Mod_c$ such that the composition $\cF_3\to \cF_1$ is an epimorphism, which follows from \ref{p.c}. For the second assertion, it suffices to apply $\tau^{\ge a}$ to the quasi=isomorphism obtained from the first assertion.
\end{proof}

The above lemmas imply the following.

\begin{Proposition}\label{p.resc}
  Let $\cX$ be a quasi-compact Deligne-Mumford $S$-stack and $M\in C(\Mod(\cX,\Lambda))$ be a complex such that $\fH^iM\in \Mod_c(\cX,\Lambda)$ for all $i$ and $\fH^iM=0$ for $i<a$. Then there exists a map $f\colon Q\to P$ and a quasi-isomorphism $\Cone(f)\to X$ in $C(\Mod(\cX,\Lambda))$, where $P$ and $Q$ are countable direct sums of objects of $C^{\ge a, -}(\Mod_c(\cX,\Lambda))$.
\end{Proposition}

Note that $\Cone(f)$ belongs to $C^{\ge a-1}$.

The following is a variant of \cite[I 1.4]{SGA5}.

\begin{Definition}
  Let $\cX$ be a Deligne-Mumford $S$-stack, $M\in D^+(\cX,\Lambda)$. We say that $M$ has \emph{quasi-injective amplitude $\le b$} if $R\cHom(\cF,M)\in D^{\le b}(\cX,\Lambda)$ for all $\cF\in \Mod_c(\cX,\Lambda)$.
\end{Definition}

This property is clearly local for the Zariski topology. The following gives a positive answer to \cite[1.3.1]{SGA5}.

\begin{Proposition}
  Let $\cX$ be a Deligne-Mumford $S$-stack, $M\in D^+(\cX,\Lambda)$ be of quasi-injective amplitude $\le b$. Then the functor
  \[R\cHom_\cX(-,M)\colon (D_c(\cX,\Lambda))^\op \to D(\cX,\Lambda)\]
  has cohomological amplitude $\le b$. In other words, for all $L\in D^{\ge a}_c(\cX,\Lambda)$, $R\cHom_\cX(L,M)$ belongs to $D^{\le b-a}(\cX,\Lambda)$.
\end{Proposition}

\begin{proof}
  We may assume $\cX$ quasi-compact.
\end{proof}
}

In the rest of this section, let $S$ be a regular scheme of dimension $\le 1$. See \ref{s.Gabber} for a remark on this assumption. In \ref{p.cX} and \ref{p.cf}, let $\Lambda$ be a Noetherian ring annihilated by an integer $m$ invertible on $S$.

\begin{Proposition}\label{p.cX}
  Let $\cX$ be a Deligne-Mumford $S$-stack of finite type. The functor
  \[-\otimes-\colon D(\cX,\Lambda)\times D(\cX,\Lambda) \to D(\cX,\Lambda)\]
  sends $D^-_c\times D^-_c$ to $D^-_c$ and
  \[R\cHom_{\cX}\colon D(\cX,\Lambda)^\op\times D(\cX,\Lambda) \to D(\cX,\Lambda)\]
  sends $(D^-_c)^\op \times D^+_c$ to $D^+_c$.
\end{Proposition}

\begin{proof}
  Take an \'etale presentation $X\to \cX$ with $X$ a separated finite type $S$-scheme. It suffices to verify the assertions for $X$, which are classical \cite[Th.\ fin.\ 1.6]{SGA4d}.
\end{proof}

\begin{Proposition}\label{p.cf}
Let $f\colon\cX\to \cY$ be a morphism of Deligne-Mumford $S$-stacks of finite type.

(i) $f^*$ sends $D_c(\cY,\Lambda)$ to $D_c(\cX,\Lambda)$, $Rf_*$ sends $D^+_c(\cX,\Lambda)$ to $D^+_c(\cY,\Lambda)$. If $f$ is of prime to $m$ inertia, then $Rf_*$ sends $D_c(\cX,\Lambda)$ to $D_c(\cY,\Lambda)$.

(ii) If $f$ is a representable and \'etale, then $f_!$ (\ref{d.j}) sends $D_c(\cX,\Lambda)$ to $D_c(\cY,\Lambda)$.

(iii) If $f$ is a closed immersion, then $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$ (\ref{d.dist}) sends $D_c(\cY,\Lambda)$ to $D_c(\cX,\Lambda)$.

(iv) Assume $f$ is separated, $\cX$ and $\cY$ are of finite inertia. Then $Rf_\dag$ sends $D^+_c(\cX,\Lambda)$ to $D^+_c(\cY,\Lambda)$. If, moreover, $f$ has prime to $m$ inertia, then $Rf_!$ sends $D_c(\cX,\Lambda)$ to $D_c(\cY,\Lambda)$ and $Rf^!$ sends $D_c(\cY,\Lambda)$ to $D_c(\cX,\Lambda)$.
\end{Proposition}

\begin{proof}
  (i) The result for $f^*$ is trivial. For $Rf_*$, up to replacing $\cY$ by an \'etale presentation and $\cX$ by the corresponding pull-back, we may assume that $\cY$ is a scheme. In particular, if $f$ is an open immersion, then the result follows from the case of schemes, which is classical \cite[Th.\ fin.\ 1.3]{SGA4d}. This implies (iii) by the distinguished triangle \eqref{e.dist2}. In the general case, we reduce by Chow's lemma and cohomological descent to the known case where $\cX$ is also a scheme.

  (iii) This has been proved in the proof of (i).

  (iv) For $Rf^!$, we reduce to (iii) and the case of a smooth morphism of schemes. In this case, $Rf^!\simeq f^*(d)[2d]$, where $d$ is the relative dimension of $f$. For $Rf_\dag$ and $Rf_!$, by construction we are reduced to two cases: (a) $f$ is an open immersion; (b) $f$ is proper. Case (a) is clear while (b) is a special case of (i).

  (ii) Replacing $\cY$ by an open covering, we may assume $\cY$ separated over $S$. If $\{\cU_1,\cU_2\}$ is an open covering of $\cX$, we have the Mayer-Vietoris distinguished triangle
  \[j_{0!} j_0^* K \to j_{1!}j_1^* K \oplus j_{2!}j_2^* K \to K\to,\]
  where $j_i\colon \cU_i\to \cX$ is the open immersion, $i=0,1,2$, $\cU_0=\cU_1\cap \cU_2$, for any $K\in D(\cX,\Lambda)$. Thus we may assume $\cX$ separated over $S$. It then suffices to apply (iv) and the comparison \ref{s.Rshr=shr}.
\end{proof}

\newcommand{\oldpfin}{
\begin{Proposition}\label{p.fin}
Let $f\colon\cX\to \cY$ be as in \ref{p.cf}. Assume that $f$ is of prime to $m$ inertia. Then $Rf_*$ sends $\Dbc(\cX,\Lambda)$ to $\Dbc(\cY,\Lambda)$. Moreover, there exists an integer $N$, depending only on $f$, such that $R^q f_* M=0$ for any constructible sheaf of $\Lambda$-modules $M$ on $X$ and any $q\ge N$.
\end{Proposition}

\begin{proof}
We proceed by induction on $\dim \cX$. Up to replacing $\cY$ by an \'etale presentation, we may assume that $\cY$ is an $S$-scheme. In particular, the proposition holds if $f$ is an open immersion \cite[Th.\ fin.\ 1.3]{SGA4d}.

Let $M\in \Dbc(\cX,\Lambda)$. We may assume that $\cX$ is reduced. By \cite[6.1.1]{LMB}, there exists a dense open substack of $\cX$ of the form $[X/G]$, where $X$ is an affine scheme and $G$ is a finite group acting on it by $S$-automorphisms. Shrinking $X$ if necessary, we may assume that $G/G_0$ acts freely on $X$, where $G_0=\Ker(G\to \Aut(X))$. Let $\cX'$ be the complement of $[X/G]$ in $\cX$, endowed with the reduced structure, $i\colon\cX'\to \cX$ and $j\colon [X/G]\to \cX$ be the inclusions. The distinguished triangle \eqref{e.dist2}

induces a distinguished triangle
\[Rf_*i_*Ri^!M \to M \to Rf_*Rj_* j^* M \to.\]
Applying the proposition to $j$, we get $Rj_* j^* M\in \Dbc(\cX,\Lambda)$, hence we have $i_*Ri^!M\in \Dbc(\cX,\Lambda)$ and, in turn, $Rf_*i_*Ri^!M \simeq R(fi)_* Ri^! M \in \Dbc(\cY,\Lambda)$ by induction hypothesis. Therefore, it suffices to show $R(fj)_* M \simeq Rf_*Rj_* j^* M \in \Dbc(\cY,\Lambda)$. Note that $fj$ is the composite map
\[[X/G]\xrightarrow{q} [X/(G/G_0)] \simto X/G \xrightarrow{g} \cY.\]
As $f$ is of prime to $m$ inertia, for any geometric point $x$ of $X$, $G_0$, which is a normal subgroup of ${\rm Aut}_\cX(x)$, is of order prime to $m$. Thus $Rq_*$ has cohomological amplitude $0$. We conclude by applying the theorem for $g$, which is classical \cite[Th.\ fin.\ 1.3]{SGA4d}.
\end{proof}

\begin{Proposition}\label{p.Homuh}
  Let $f\colon \cX\to \cY$ be a universal homeomorphism (\ref{s.uh}) of Deligne-Mumford $S$-stacks of finite type. Let $M\in D^-_c(\cY,\Lambda)$, $L\in D(\cY,\Lambda)$. Assume either $M\in D^b_c$ or $L\in D^+$. Then the map
  \[f^* R\cHom_\cY(M,L)\to R\cHom(f^*M,f^*L)\]
  is an isomorphism.
\end{Proposition}

\begin{proof}
  We may assume that $\cX$ and $\cY$ are separated, hence of finite inertia. By d\'evissage, we may assume $M=Rj_!\cF$, where $j\colon \cY'\to \cY$ is an immersion, $\cF\in \Mod_c(\cY',\Lambda)$ is locally constant. Consider the 2-Cartesian square
  \[\xymatrix{\cX'\ar[r]^k\ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^j & \cY}\]
  Then the following diagram commutes
  \[\xymatrix{f^*R\cHom_\cY(Rj_!\cF,L)\ar[d]^{A_1}\ar[r] & R\cHom_\cX(f^*Rj_!\cF,f^*L)\ar[d]^{B_2}\\
  f^*Rj_*R\cHom_{\cY'}(\cF,Rj^! L)\ar[d]^{B_1} & R\cHom_{\cX}(Rk_! f'{}^* \cF,f^*L)\ar[d]^{A_2}\\
  Rk_*f'{}^* R\cHom_{\cY'}(\cF,Rj^!L)\ar[rd] & Rk_*R\cHom_{\cX'}(f'{}^* \cF,Rk^! f^*L)\ar[d]^\simeq\\
  & Rk_* R\cHom_{\cY'}(f'{}^*\cF,f'{}^* Rj^! L) }\]
  Here $A_1$ and $A_2$ are \eqref{e.shradj1}, $B_1$ is homeomorphic base change (\ref{p.uhbc}), $B_2$ is induced by the inverse of \ref{p.bcc} (i). Thus we may assume $M$ is a locally constant constructible sheaf. In this case, the assertion is trivial.
\end{proof}

Gluing \eqref{e.shradj2} and the inverse of the above, we obtain the following.

\begin{Proposition}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia, $M\in D^-_c(\cY,\Lambda)$, $L\in D(\cY,\Lambda)$. Assume either $M\in \Dbc$ or $L\in D^+$. Then we have a natural isomorphism
  \begin{equation}\label{e.shradj2'}
  R\cHom_\cX(f^*M,Rf^!L) \to Rf^! R\cHom_\cY(M,L),
  \end{equation}
  functorial in $M$ and $L$.
\end{Proposition}
}

\begin{ssect}\label{d.D}
In the rest of this section let $\Lambda$ be a Gorenstein ring of dimension $0$ annihilated by an integer $m$ invertible on $S$. The case of main interest is $\Lambda=\cO/\fm^{n+1}$, where $\cO$ a complete discrete valuation ring of mixed characteristic and $\fm$ is the maximal ideal of~$\cO$.

Let $\Omega_S\in D^b_c(S,\Lambda)$ be the object such that $\Omega_S|T=\Lambda(d_T)[2d_T]$ for every connected component $T$ of $S$, where $d_T=\dim T$. For any finite type and separated morphism $a\colon X\to S$ of schemes, let $\Omega_X=Ra^! \Omega_S \in D^b_c(X,\Lambda)$. Define a triangulated functor
\[D_X\colon D(X,\Lambda)^\op \to D(X,\Lambda)\]
by $D_X M = R\cHom_\Lambda(M,\Omega_X)$. Let $d_X=\max_{s\in S} (\dim X_s +d_s)$, where $d_s$ is the dimension of the closure of $s$ in $S$.

\begin{Lemma}\label{p.Dscheme}
  (i) The functor $D_X$ induces a functor $(D^-_c)^\op \to D^+_c$, whose cohomological amplitude is contained in $[-2d_X,0]$. In particular, $\Omega_X\in D^{[-2d_X,0]}_c(X,\Lambda)$ and $D_\cX$ sends $(\Dbc)^\op$ to $\Dbc$.

  (ii) $\Omega_X$ is a dualizing complex for $X$ \cite[I 1.7]{SGA5}.
\end{Lemma}

In particular, $\Ext^i(\Omega_X, \Omega_X) = H^i(X, D_X \Omega_X) \simeq H^i(X,\Lambda) =0$ for all $i<0$.

\begin{proof}
  (i) It follows from \ref{p.cX} that $D_X$ sends $(D^-_c)^\op$ to $D^+_c$. The bound can be obtained similarly to the proof of \cite[Fin.\ 1.6]{SGA4d}. In fact, for $\cF\in \Mod_c(X,\cF)$, to show $D_X\cF$ belongs to $D^{[-2d_X,0]}$, we may assume $\cF=j_! \cG$, where $j\colon Y\to X$ is an immersion, $Y$ is regular and connected and $\cG$ is a lisse sheaf on $Y$. Then $D_X j_! \cG\simeq Rj_* D_Y \cG$ by \eqref{e.jshradju} and
  \[(D_Y \cG)_{\bar{y}} = R\cHom_\Lambda(\cG_{\bar{y}}, \Lambda(d_Y)[2d_Y])\]
  for any geometric point $\bar{y}\to Y$. We then apply the fact that $Rj_*$ has cohomological dimension $\le 2d_Y$.

  (ii) It remains to show that for $M\in \Dbc(X,\Lambda)$, the map $M\to D_XD_XM$ is an isomorphism. The proof is identical to the proof of \cite[Fin.\ 4.3]{SGA4d}.
\end{proof}

Let $\cX$ be a finite type Deligne-Mumford $S$-stack. We apply the ``BBD gluing lemma'' \cite[3.2.4]{BBD} to define a dualizing complex $\Omega_\cX$. For every \'etale morphism $\alpha\colon X\to \cX$ with $X$ a separated finite type $S$-scheme, we associate $\Omega_X$. For any morphism $f\colon X\to Y$ between such morphisms, there is a canonical isomorphism $f^* \Omega_Y \simto \Omega_X$. Since, for all~$X$, $\Omega_X$ belongs to $D^{[-2d_\cX,0]}(X,\Lambda)$, where $d_\cX=\max_{s\in S}(\dim \cX_s+d_s)$, there exists a unique $\Omega_\cX\in D^{[-2d_\cX,0]}(\cX,\Lambda)$ such that, for every \'etale morphism $\alpha\colon X\to \cX$ with $X$ a separated finite type $S$-scheme, we have $\alpha^*\Omega_\cX \simeq \Omega_X$. It follows that $\Omega_\cX$ belongs to $D_c^{[-2d_\cX,0]}$. Define a triangulated functor
\[D_\cX\colon D(\cX,\Lambda)^\op \to D(\cX,\Lambda)\]
by $D_\cX M = R\cHom_\Lambda(M,\Omega_\cX)$.
\end{ssect}

\begin{Proposition}\label{p.D}
(i) The functor $D_\cX$ induces a functor $(D_c^-)^\op \to D_c^+$ whose cohomological amplitude is contained in $[-2d_\cX, 0]$. In particular $D_\cX$ sends $(D^b_c)^\op$ to $D^b_c$.

(ii) For $M\in \Dbc(\cX, \Lambda)$, the natural map $M\to D_\cX D_\cX M$ is an isomorphism.
\end{Proposition}

\begin{proof}
Take an \'etale presentation $X\to \cX$ with $X$ a separated finite type $S$-scheme. It suffices to verify the proposition for $X$, which is classical (\ref{p.Dscheme}).
\end{proof}

\begin{ssect}\label{s.fushr}
Let $f\colon \cX\to \cY$ be a separated morphism of prime to $m$ inertia of Deligne-Mumford $S$-stacks of finite type. Assume either $f$ is a closed immersion, or $\cX$ and $\cY$ are of finite inertia. The functor $Rf^!\colon D(\cY,\Lambda)\to D(\cX,\Lambda)$ as defined in \ref{d.dist} and \ref{p.shradj} preserves $\Dbc$. The isomorphisms \eqref{e.dist4} and \eqref{e.shradj2} give an isomorphism $D_\cX f^* \simto R f^! D_\cY $ of functors $D(\cY,\Lambda)\to D(\cX,\Lambda)$. Using biduality  (\ref{p.D} (ii)), we obtain an isomorphism of functors $\Dbc(\cY,\Lambda)\to \Dbc(\cX,\Lambda)$:
\[R f^! \simeq R f^! D_\cY D_\cY \simeq D_\cX f^* D_\cX.\]
\end{ssect}

\begin{ssect}\label{d.fushriek}
Let $f\colon \cX\to\cY$ be a morphism of finite type Deligne-Mumford $S$-stacks. Thanks to \ref{p.D}, we can  define a triangulated functor
\[Rf^!\colon \Dbc(\cY,\Lambda)\to \Dbc(\cX,\Lambda), \quad N \mapsto D_\cX f^* D_\cY N.\]
By \ref{s.fushr}, this definition is compatible with \ref{d.dist} and \ref{p.shradj}.
If $f\colon \cX\to \cY$ and $g\colon \cY\to \cZ$ are two such morphisms, then, by biduality, we have an isomorphism of functors $\Dbc(\cZ,\Lambda)\to \Dbc(\cX,\Lambda)$:
\[
R(gf)^! = D_\cX (gf)^* D_\cZ  \simeq D_\cX f^* g^* D_\cZ
 \simeq D_\cX f^* D_\cY D_\cY g^* D_\cZ  = Rf^! Rg^!.
\]

If $f$ is smooth, it follows from the construction of $\Omega_\cX$ and $\Omega_\cY$ that $\Omega_\cX\simeq f^*\Omega_\cY(d)[2d]$, where $d$ is the relative dimension of $f$. It follows that \eqref{e.Homsm} induces an isomorphism $f^*(D_\cY N)(d)[2d]\simeq D_\cX f^*N$ for all $N\in D(\cX,\Lambda)$. Thus
\[Rf^!=D_\cX f^* D_\cY \simeq f^*(d)[2d].\]

\end{ssect}

\begin{ssect}\label{s.flshr}
Let $f\colon\cX\to \cY$ be a morphism of prime to $m$ inertia of Deligne-Mumford $S$-stacks of finite type. Assume either (a) $f$ is representable and \'etale, or (b) $f$ is separated and $\cX$ and $\cY$ are of finite inertia. The functor $Rf_!\colon D(\cX, \Lambda) \to D(\cY,\Lambda)$ as defined in \ref{d.j} and \ref{s.fshr} preserves $\Dbc$. The isomorphisms \eqref{e.jshradju} and \eqref{e.shradj1} give an isomorphism $D_\cY Rf_! \simto Rf_* D_\cX$ of functors $D(\cX,\Lambda)\to D(\cY,\Lambda)$. Using biduality (\ref{p.D} (ii)), we obtain an isomorphism of functors $\Dbc(\cX,\Lambda)\to \Dbc(\cY,\Lambda)$:
\[Rf_!\simeq D_\cY D_\cY Rf_! \simeq D_\cY Rf_* D_\cX.\]
\end{ssect}

\begin{ssect}\label{d.flshriek}
Let $f\colon \cX\to \cY$ be a morphism of prime to $m$ inertia between Deligne-Mumford $S$-stacks of finite type. Thanks to \ref{p.D}, we can define a triangulated functor
\[Rf_!\colon \Dbc(\cX,\Lambda)\to \Dbc(\cY,\Lambda), \quad M \mapsto D_\cY Rf_* D_\cX M.\]
By \ref{s.flshr}, this definition is compatible with both \ref{d.j} and \ref{s.fshr}.
If $f\colon \cX\to \cY$ and $g\colon \cY\to \cZ$ are two such morphisms, then, by biduality, we have an isomorphism of functors $\Dbc(\cX,\Lambda)\to \Dbc(\cY,\Lambda)$:
\[
  R(gf)_! = D_\cZ R(gf)_* D_\cX \simeq D_\cZ Rg_* Rf_* D_\cX
  \simeq D_\cZ Rg_* D_\cY D_\cY Rf_* D_\cX \simeq Rg_! Rf_!.
\]
\end{ssect}

\section{Construction of $D_c(\cX,\cO)$}
In this section we fix a complete discrete valuation ring $\cO$. Let $\fm=\lambda\cO$ be the maximal ideal of $\cO$ and $\Lambda_n=\cO/\fm^{n+1}$.

\begin{ssect}\label{s.null}
Let $\cX$ be a topos. Consider the topos $\cX^\N$ of projective systems $(M_\bullet = (M_n)_{n\in \N})$ of sheaves on $\cX$ and the ring $\Lambda_\bullet=(\Lambda_n)_{n\in \N}\in \cX^\N$ whose transition maps $\Lambda_{n+1}\to\Lambda_n$ are induced by the identity map on $\cO$. Let $(\pi_*, \pi^*)\colon (\cX^\N,\Lambda_\bullet) \to (\cX,\cO)$ be the morphism of ringed toposes defined by $\pi_*(F_\bullet)=\varprojlim_n F_n$ and $\pi^*G=(\Lambda_n\otimes_{\cO} G)_{n\in \N}$.

For all $n$, let $e_n\colon \cX \to \cX_\et^\N$ be the morphism of toposes defined by $e_n^{-1}(G_\bullet) = G_n$, $(e_{n*} F)_q=F$ for $q\ge n$, and $(e_{n*}F)_q=\{*\}$ for $q<n$. It induces a flat morphism of ringed toposes $(\cX, \Lambda_n)\to (\cX_\et^\N,\Lambda_\bullet)$. Note that $e_{n*}\colon \Mod(\cX,\Lambda_n)\to \Mod(\cX^\N,\Lambda_\bullet)$ is exact and $e_n^{-1}e_{n*}=\one$. For $M\in D(\cX_\et^\N, \Lambda_\bullet)$, we denote $e_n^{-1}M$ by $M_n$. The functor $e_n^{-1}\colon \Mod(\cX^\N,\Lambda_\bullet)\to \Mod(\cX,\Lambda_n)$ admits a left adjoint $e_{n!}$ given by $(e_{n!}F)_q=\Lambda_q\otimes_{\Lambda_n} F$ for $q\le n$ and $(e_{n!}F)_m=0$ for $q>n$. The composition $\pi e_n\colon (\cX,\Lambda_n) \to (\cX,\cO)$ is the ring change morphism and we often omit $(\pi e_n)_*$ to simplify notations.

We say that $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{essentially zero} if for every $n\ge 0$, there exists $r\ge 0$ such that the transition map $M_{n+r}\to M_n$ is zero. We say that $M$ is \emph{AR-null} \cite[V 2.2.1]{SGA5} if, moreover, $r$ can be chosen independently of $n$.

The full subcategory
\[\cN \subset \Mod(\cX^\N,\Lambda_\bullet)\]
consisting of AR-null modules is a thick subcategory closed by subobjects and quotients.  We say that $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{preadic} (``$\fm$-adic'' in the terminology of \cite[V 3.1.1]{SGA5}) if, for all $n$, the natural map $\Lambda_n \otimes_{\Lambda_{n+1}} M_{n+1} \to M_n$ is an isomorphism; $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{AR-preadic} (``AR-$\fm$-adic'' in the terminology of \cite[V 3.2.2]{SGA5}) if there exists a preadic module $N\in \Mod(\cX^\N,\Lambda_\bullet)$ and a homomorphism $N\to M$ with AR-null kernel and cokernel.

\begin{Lemma}\label{p.pread}
Let $L,M\in \Mod(\cX^\N,\Lambda_\bullet)$, $L$ preadic. Then the localization map
\[\Hom_{\Mod(\cX^\N,\Lambda_\bullet)}(L,M)\to \Hom_{\Mod(\cX^\N,\Lambda_\bullet)/\cN}(L,M)\]
is an isomorphism.
\end{Lemma}

It follows that $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is AR-preadic if and only if there exists a preadic module $L\in \Mod(\cX^\N,\Lambda_\bullet)$, isomorphic to $M$ in $\Mod(\cX^\N,\Lambda_\bullet)/\cN$.

\begin{proof}
  Let $\cN'$ be the full subcategory of $\Mod(\cX^\N,\pi^{-1}\cO)$ consisting of AR-null systems in that category \cite[V 2.2.1]{SGA5}. The functor
  \[\Mod(\cX^\N,\Lambda_\bullet)/\cN\to \Mod(\cX^\N,\pi^{-1}\cO)/\cN'\]
  induced by the inclusion functor is faithful. Thus it suffices to show that the localization map
  \[\Hom_{\Mod(\cX^\N,\Lambda_\bullet)}(L,M)\to \Hom_{\Mod(\cX^\N,\pi^{-1}\cO)/\cN'}(L,M)\]
  is an isomorphism. By \cite[V 2.4.4 (iv)]{SGA5}, we have
  \[\Hom_{\Mod(\cX^\N,\pi^{-1}\cO)/\cN'}(L,M) \simeq \varinjlim_{r\in \N} \Hom_{\Mod(\cX^\N,\pi^{-1}\cO)}(L(r),M),\]
  where $L(r)$ is the translation of $L$ given by $L(r)_n=L_{n+r}$. Since $L$ is preadic and $M$ is a $\Lambda_\bullet$-module, the map
  \[\Hom_{\Mod(\cX^\N,\pi^{-1}\cO)}(L,M)\to \Hom_{\Mod(\cX^\N,\pi^{-1}\cO)}(L(r),M)\]
  induced by the transition map $L(r)\to L$ is an isomorphism for every $r$.
\end{proof}

\begin{ssect}\label{s.DN}
We say that $M\in D(\cX^\N, \Lambda_\bullet)$ is \emph{essentially zero} (resp.\ \emph{AR-null}) if $\fH^i M$ is essentially zero (resp.\ AR-null) for all $i$.

Let $D_\cN$ be the full subcategory of $D(\cX^\N, \Lambda_\bullet)$ consisting of AR-null complexes. It is a thick triangulated subcategory \cite[1.3]{Rickard}.
\end{ssect}

\end{ssect}

\begin{Lemma}\label{p.Lpi}
  (a) For $M\in \Mod(\cX,\cO)$, $\pi^* M$ is preadic, $\fH^{-1} L\pi^* M$ is essentially zero, and $\fH^{-q}L\pi^*M=0$ for $q>1$.

  (b) For $N\in D(\cX,\Lambda_n)$, the natural map $L\pi^* N \to e_{n*}N$ has AR-null cone. In particular, for $N\in \Mod(\cX,\Lambda_n)$, $\fH^{-1}L\pi^*N$ is AR-null.
\end{Lemma}

For $M\in D(\cX,\cO)$, the distinguished triangle
\[L\pi^* \tau^{\le q} M \to L\pi^* M \to L\pi^* \tau^{\ge q+1} M \to\]
induces the short exact sequence
\begin{equation}\label{e.Lpi}
0\to \pi^* \fH^q M \to \fH^q L\pi^* M \to \fH^{-1}L\pi^* \fH^{q+1} M \to 0
\end{equation}

By (a), $\pi^* \fH^q M$ is preadic and $\fH^{-1}L\pi^* \fH^{q+1} M$ is essentially zero.

\begin{proof}
  (a) The first assertion follows from the isomorphism $\Lambda_n\otimes_{\Lambda_{n+1}}\Lambda_{n+1}\otimes_{\Lambda_\bullet} M \simeq \Lambda_n\otimes_{\Lambda_\bullet} M$. The last assertion holds because $e_n^{-1} \fH^{-q} L\pi^*M \simeq\cTor_q^\cO(\Lambda_n,M)=0$ for $q>1$. Consider the short exact sequence of $\pi^{-1}\cO$-modules $0\to F\to \pi^{-1}\cO\to \Lambda_\bullet\to 0$, where $F=(\cO)_{m \in\N}$ has transition maps $F_{m+1}\to F_{m}$ given by $\cO\xrightarrow{\times \lambda} \cO$, $F_n\to (\pi^{-1}\cO)_n$ is given by $\cO\xrightarrow{\times \lambda^{n+1}} \cO$. This sequence gives a $\pi^{-1}\cO$-flat resolution of $\Lambda_\bullet$. So $\fH^{-1}L\pi^*M$ is a sub-$\pi^{-1}\cO$-module of $F\otimes_{\pi^{-1}\cO} \pi^{-1} M$, hence is essentially zero.

  (b) For $N\in \Mod(\cX,\Lambda_n)$, $\fH^{-1}L\pi^*N$ is a sub-$\pi^{-1}\cO$-module of $F\otimes_{\pi^{-1}\cO} \pi^{-1} N$, hence is AR-null. For the first assertion, by (a) we may assume $N\in \Mod(\cX,\Lambda_n)$. In this case $\pi^*N \to e_{n*}N$ is an epimorphism with AR-null kernel.
\end{proof}

The following is a variant of \cite[1.4]{Ekedahl}.

\begin{Lemma}\label{p.null}
  Let $M\in D^-(\cX^\N,\Lambda_\bullet)$ be AR-null, $N\in D(\cX^\N,\Lambda_\bullet)$. Assume either $M\in D^b$ or $N\in D^-$. Then $M\otimes^L_{\Lambda_\bullet} N$ is AR-null.
\end{Lemma}

\begin{proof}
  We may assume $M\in \Mod(\cX^\N,\Lambda_\bullet)$. It then suffices to take a quasi-isomorphism $N'\to N$, where $N'$ belongs to the smallest triangulated subcategory of $K(\Mod(\cX^\N,\Lambda_\bullet))$ stable under small direct sums and containing complexes bounded above with flat components.
\end{proof}

\begin{Lemma}\label{p.enpf}
  Suppose that $\cX$ has enough points. Let $M\in D(\cX,\Lambda_n)$ and $N\in D(\cX,\cO)$. Then the projection formula map
  \[e_{n*}M\otimes^L_{\Lambda_\bullet} L\pi^* N \to e_{n*}(M\otimes^L_{\Lambda_n} e_n^{-1}L\pi^* N)\]
  is an isomorphism.
\end{Lemma}

\begin{proof}
  We may assume that $\cX$ is the punctual topos. Since $e_{n*}\colon \Mod(\cX,\Lambda_n)\to \Mod(\cX^\N,\Lambda_\bullet)$ commutes with small direct limits, we may repeat the arguments in the proof of \ref{p.pbc} (ii).
\end{proof}

Let $f\colon \cX\to \cY$ be a morphism of toposes. It induces a flat morphism of ringed toposes
\[(f^\N_*, f^{\N*})\colon (\cX^\N,\Lambda_\bullet) \to (\cY^\N,\Lambda_\bullet).\]
The base change map $Le_{n!} f^* \Rightarrow f^{\N*}Le_{n!}$ is a natural equivalence of functors $D(\cY,\Lambda_n)\to D(\cX^\N,\Lambda_\bullet)$. By adjunction (\ref{s.GD}), we have the following.

\begin{Lemma}\label{p.en}
  For all $M\in D(\cX^\N,\Lambda_\bullet)$, the base change map
  \begin{equation}\label{e.en}
  e_n^{-1} Rf_*^\N M \to Rf_* e_n^{-1} M
  \end{equation}
  is an isomorphism.
\end{Lemma}

The case $M\in D^+$ is a particular case of \cite[V$^\text{bis}$ 1.3.12]{SGA4}. It follows also from the fact that the full subcategory $I_\cX$ of $\Mod(\cX^\N,\Lambda_\bullet)$ consisting of modules of the form $\prod_n e_{n*} I_{(n)}$, where $I_{(n)}$ is an injective $\Lambda_n$-module, is $f_*^\N$-injective. For $I\in I_\cX$, $I$ is injective and $e_n^{-1}I$ is injective for all~$n$.

The lemma implies that $Rf^{\N}_*$ preserves essentially zero complexes in $D^+$ and AR-null complexes in $D^+$.

The base change maps induce a natural transformation of functors $D(\cX,\Lambda_n)\to D(\cY^\N,\Lambda_\bullet)$
\begin{equation}\label{e.enshr}
  Le_{n!} Rf_* \Rightarrow Rf^\N_*Le_{n!}.
\end{equation}

\begin{Lemma}\label{p.Rpi}
(a) If $M\in D^+(\cX^\N, \Lambda_\bullet)$ is essentially zero, we have $R\pi_*M = 0$.

(b) For $N\in D^+(\cX,\Lambda_n)$, the adjunction map $N\to R\pi_* L\pi^* N$ is an isomorphism.
\end{Lemma}

Part (a) is a particular case of \cite[1.1]{Ekedahl}.

\begin{proof}
(a) Note that $R^q \pi_* M$ is the sheaf associated to the presheaf $(U\mapsto H^q(U^\N,M))$, where $U$ runs over objects of $\cX$. Let $a\colon U\to \mathrm{pt}$ be the morphism of toposes from $U$ to the punctual topos. Since $Ra_*^{\N} M$ is essentially zero, $R\Gamma(U^\N, M)\simeq R\varprojlim Ra^\N_* M=0$.

(b)
By (a) and \ref{p.Lpi} (b), it suffices to show that the natural map $N\to R\pi_* e_{n*} N$ is an isomorphism, which is trivial.

\end{proof}

\begin{ssect}
We define a functor
\begin{equation}\label{e.Mhat}
D(\cX^\N,\Lambda_\bullet) \to D(\cX^\N,\Lambda_\bullet), \quad M\mapsto \hat{M}=L\pi^* R\pi_* M.
\end{equation}
Following Ekedahl \cite[2.1 (iii)]{Ekedahl} we say that a complex $M\in D(\cX^\N,\Lambda_\bullet)$ is \emph{normalized} if the adjunction map $\hat{M} \to M$ is an isomorphism in $D(\cX^\N,\Lambda_\bullet)$.

The following criterion is a variant of \cite[2.2 (ii)]{Ekedahl} and plays an essential role in what follows.
\end{ssect}

\begin{Lemma}\label{p.Eke}
Let $M\in D(\cX^\N,\Lambda_\bullet)$. Consider the following conditions:
\begin{description}
\item[(a)] $M$ is normalized;
\item[(b)] $M\simeq L\pi^* N$ for some $N\in D(\cX,\cO)$;
\item[(c)] For all $n$, the natural map
\begin{equation}\label{e.Eke}
\Lambda_n\otimes^L_{\Lambda_{n+1}}M_{n+1} \to M_n
\end{equation}
is an isomorphism.
\end{description}
Then (a)$\implies$(b)$\implies$(c). Moreover, if $M\in D^+$, then they are equivalent.
\end{Lemma}

In particular, for $M\in D^+(\cX^\N,\Lambda_\bullet)$, $\hat{M}$ is normalized.

\begin{proof}
  (a)$\implies$(b) By definition, $M\simeq L\pi^* R\pi_* M$.

  (b)$\implies$(c) We have $M_n\simeq \Lambda_n\otimes^L_\cO N$ and \eqref{e.Eke} is induced by the isomorphism
  \[\Lambda_{n}\otimes^L_{\Lambda_{n+1}}\Lambda_{n+1}\otimes^L_\cO N \simto \Lambda_n\otimes^L_\cO N.\]

  (c)$\implies$(a) assuming $M\in D^+$. To prove that $M$ is normalized, it suffices to show that the map $e_n^{-1} \hat{M}\to M_n$ is an isomorphism for all $n$. This map is the composition
  \begin{equation}\label{e.Eke1}
  e_n^{-1}\hat{M}\simto \Lambda_n\otimes^L_\cO R\pi_* M \xrightarrow{\alpha} R\pi_*(L\pi^* \Lambda_n\otimes^L_{\Lambda_\bullet} M)
  \xrightarrow{\beta} R\pi_* e_{n*} M_n \simeq M_n,
  \end{equation}
  where $\alpha$ is the projection formula map and $\beta$ is induced by the composition of
  \begin{equation}\label{e.Eke2}
  L\pi^* \Lambda_n\otimes^L_{\Lambda_\bullet} M \to \pi^* \Lambda_n\otimes^L_{\Lambda_\bullet} M
  \end{equation}
  and the adjunction map
  \begin{equation}\label{e.Eke3}
  \pi^* \Lambda_n\otimes^L_{\Lambda_\bullet} M \to e_{n*} e_n^{-1} (\pi^* \Lambda_n\otimes^L_{\Lambda_\bullet} M) \simeq e_{n*} M_n.
  \end{equation}
  Taking
  the resolution $F\to \Lambda_n$, where $F$ is the complex $\cO\xrightarrow{\times \lambda^{n+1}}\cO$ concentrated in degrees $-1$ and $0$,

  we see that $\alpha$ is an isomorphism.
  By \ref{p.Lpi} (b) and \ref{p.null}, \eqref{e.Eke2} has AR-null cone. By (c),
  \[\Lambda_n\otimes^L_{\Lambda_m} M_m \to M_n\]
  is an isomorphism for all $m\ge n$. It follows that
  \eqref{e.Eke3} has AR-null cone.  Note that $L\pi^*\Lambda_n\otimes^L_{\Lambda_\bullet} M$ and $e_{n*}M_n$ are both in $D^+$. Hence $\beta$ is an isomorphism by \ref{p.Rpi} (a).
\end{proof}

\begin{Lemma}\label{p.tau}
  Let $M\in D(\cX^\N,\Lambda_\bullet)$ be normalized. Then the map
\[L\pi^* \tau^{\ge a} R\pi_* M \to \widehat{\tau^{\ge a} M}\]
is an isomorphism.
\end{Lemma}

\begin{proof}
By \ref{p.Lpi} (a), the map
\[L\pi^* \tau^{\ge a} R\pi_* M \to \tau^{\ge a} L\pi^* R\pi_* M\simeq \tau^{\ge a} M\]
has essentially zero cone. By \ref{p.Eke} and \ref{p.Rpi} (a), the maps
\[L\pi^* \tau^{\ge a} R\pi_* M  \to (L\pi^* \tau^{\ge a} R\pi_* M)\sphat \to\widehat{\tau^{\ge a} M}  \]
are isomorphisms.
\end{proof}

\begin{Proposition}\label{p.tensornorm}
 Let $M, N\in D^+(\cX^\N,\Lambda_\bullet)$ be normalized. Then $M\otimes^L_{\Lambda_\bullet} N$ is normalized.
\end{Proposition}

\begin{proof}
  By assumption, $M\simeq L\pi^* M'$, $N\simeq L\pi^* N'$ for some $M', N' \in D^+(\cX,\cO)$. Thus
  \[M\otimes^L_{\Lambda_\bullet} N \simeq L\pi^*M' \otimes_{\Lambda_\bullet}^L L\pi^* N' \simeq L\pi^*(M'\otimes_{\cO}^L N').\]
\end{proof}

\begin{Proposition}\label{p.tensornull}
  Suppose $\cX$ has enough points. Let $N\in D^{\ge a}(\cX^\N,\Lambda_\bullet)$ be normalized. Then

  (i) $-\otimes_{\Lambda_\bullet} N$ has cohomological amplitude $\ge a-1$.

  (ii) For all $M\in D^+(\cX^\N,\Lambda_\bullet)$ AR-null, $M\otimes_{\Lambda_\bullet} N$ is AR-null.
\end{Proposition}

\begin{proof}
  By assumption, $N\simeq L\pi^* N'$ for some $N'\in D^{\ge a}(\cX,\cO)$. Then $M\otimes_{\Lambda_\bullet}^L N \simeq M\otimes^L_{\pi^{-1} \cO} \pi^{-1} N'$. Then (i) follows from the fact that $-\otimes_{\pi^{-1}\cO}^L-$ has cohomological amplitude $\ge -1$. For (ii), we are then reduced to the case $M\in D^b$, which is covered by \ref{p.null}.
\end{proof}

\begin{Proposition}\label{p.RcHomfiber}
Let $M\in D(\cX^\N,\Lambda_\bullet)$, $N\in D(\cX^\N,\Lambda_\bullet)$. Suppose that either
\begin{description}
\item[(a)] $M$ is normalized; or
\item[(b)] the cohomology sheaves of $M$ are preadic, $M\in D^-$ and $N\in D^+$.
\end{description}
Then the natural map
\[e_n^{-1} R\cHom_{\Lambda_\bullet}(M,N) \to R\cHom_{\Lambda_n} (M_n, N_n) \]
is an isomorphism.
\end{Proposition}

This is a variant of \cite[3.1.2]{LO2}.

\begin{proof}
Let $j_n\colon \cX^{\le n} \to \cX^\N$ be the morphism of toposes defined by $j_n^{-1}M=(M_m)_{m\le n}$, $(j_{n*} N)_m = N_m$ for $m\le n$, $(j_{n*}N)_m=N_n$ for $m\ge n$. Let $e'_n\colon \cX\to \cX^{\le n}$ be the morphism of toposes defined by ${e'_n}^{-1} N = N_n$, $(e'_{n*} F)_m = \{*\}$ for $m<n$, $(e'_{n*} F)_n=F$. Then $e_n = j_n e'_n$. Let $\pi_n\colon(\cX^{\le n},\Lambda_{\le n})\to (\cX,\Lambda_n)$ be the morphism of ringed toposes given by $\pi_{n*}=e'_n{}^{-1}$, $(\pi_n^*F)_m=\Lambda_m\otimes_{\Lambda_n} F$.

In case (b), we may assume $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is preadic, then $\pi_n^* M_n \simto j_n^{-1} M$. As observed in the remark following \ref{p.en}, there is a quasi-isomorphism $N\to I$ such that $I^k$ and $e_n^{-1}I^k$ are injective for all $k$ and $n$. Hence it suffices to show that for any $N\in \Mod(\cX^\N,\Lambda_\bullet)$, $e_n^{-1}\cHom_{\Lambda_\bullet}(M,N)\to \cHom_{\Lambda_n}(M_n,N_n)$ is an isomorphism. This is clear because the map is the composition
\begin{multline*}
e_n^{-1}\cHom_{\Lambda_\bullet}(M,N) = {e'_n}^{-1} j_n^{-1} \cHom_{\Lambda_\bullet}(M,N) \simto {e'_n}^{-1}\cHom_{j_n^{-1}\Lambda_\bullet}(j_n^{-1}M, j_n^{-1}N)\\
\simto \pi_{n*}\cHom_{\Lambda_{\le n}}(\pi_n^* M_n,j_n^{-1} N) \simeq \cHom_{\Lambda_n}(M_n, \pi_{n*} j_n^{-1} N)\simeq \cHom_{\Lambda_n}(M_n,N_n).
\end{multline*}

In case (a), $L\pi_n^* M_n \simto j_n^{-1} M$ by \ref{p.Eke}. Hence
\begin{multline*}
e_n^{-1}R\cHom_{\Lambda_\bullet}(M,N) = {e'_n}^{-1} j_n^{-1} R\cHom_{\Lambda_\bullet}(M,N) \simto {e'_n}^{-1}R\cHom_{j_n^{-1}\Lambda_\bullet}(j_n^{-1}M, j_n^{-1}N)\\
\simto \pi_{n*}R\cHom_{\Lambda_{\le n}}(L\pi_n^* M_n,j_n^{-1} N) \simeq R\cHom_{\Lambda_n}(M_n, \pi_{n*} j_n^{-1} N)\simeq R\cHom_{\Lambda_n}(M_n,N_n).
\end{multline*}

\end{proof}

\begin{Corollary}\label{p.RcHomnorm}
  Let $M\in D^-(\cX^\N,\Lambda_\bullet)$ and $N\in D^+(\cX^\N,\Lambda_\bullet)$ be normalized. Then \[R\cHom_{\Lambda_\bullet}(M,N)\in D^+(\cX^\N,\Lambda_\bullet)\]
  is normalized.
\end{Corollary}

\begin{proof}
  By \ref{p.Eke} and \ref{p.RcHomfiber}, we need to show that
  \begin{equation}\label{e.RcHomnorm0}
  \Lambda_n \otimes^L_{\Lambda_{n+1}} R\cHom_{\Lambda_{n+1}}(M_{n+1}, N_{n+1})  \to R\cHom_{\Lambda_n}(M_n, N_n)
  \end{equation}
  is an isomorphism.  By assumption,
  $\Lambda_n\otimes^L_{\cO} M' \simto M_n$, $\Lambda_{n}\otimes^L_{\cO}N' \simto N_{n}$, where $M'=R\pi_* M$ and $N'=R\pi_*N \in D(\cX,\cO)$. Thus \eqref{e.RcHomnorm0} is isomorphic to
  \[\Lambda_n \otimes^L_{\Lambda_{n+1}} R\cHom_{\Lambda_{n+1}}(\Lambda_{n+1}\otimes^L_{\cO} M', \Lambda_{n+1}\otimes^L_{\cO} N')
  \to R\cHom_{\Lambda_n}(\Lambda_n\otimes^L_{\cO} M', \Lambda_n\otimes^L_{\cO}N').
  \]
  Therefore, it suffices to show that
  \[\Lambda_n \otimes^L_{\cO} R\cHom_{\cO}(M', N') \to R\cHom_{\Lambda_n}(\Lambda_n\otimes^L_{\cO} M', \Lambda_n\otimes^L_{\cO}N')\]
  is an isomorphism. This map is the composition of the map
  \begin{equation}\label{e.RcHomnorm}
    \Lambda_n \otimes^L_{\cO} R\cHom_{\cO}(M', N')\to R\cHom_\cO(M',\Lambda_n\otimes^L_{\cO}N')
  \end{equation}
  and the adjunction isomorphism
  \[R\cHom_\cO(M',\Lambda_n\otimes^L_{\cO}N')\simto R\cHom_{\Lambda_n}(\Lambda_n\otimes^L_{\cO} M', \Lambda_n\otimes^L_{\cO}N').\]
  Taking
  the resolution $F\to \Lambda_n$, where $F$ is the complex $\cO\xrightarrow{\times \lambda^{n+1}} \cO$ concentrated in degrees $-1$ and $0$,

  we conclude that \eqref{e.RcHomnorm} is an isomorphism.
\end{proof}

\begin{Proposition}\label{p.RcHomnull}
  Let $N\in D^+(\cX^\N,\Lambda_\bullet)$ be AR-null and $M\in D(\cX^\N,\Lambda_\bullet)$. Assume that one of the following conditions holds:
  \begin{description}
  \item[(a)] $M\in D^-$ is normalized;
  \item[(a')] $M$ is normalized and $N\in D^b$;
  \item[(b)] $M\in D^-$ is of preadic cohomology sheaves.
  \end{description}
  Then $R\cHom_{\Lambda_\bullet}(M,N)$ is AR-null. Moreover, if (a) or (b) holds, then \[R\Hom_{\Lambda_\bullet}(M,N)=0.\]
\end{Proposition}

\begin{proof}
We may assume $N\in \Mod(\cX^\N,\Lambda_\bullet)$. In case (b), we may assume $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is preadic. In all cases,

by \ref{p.RcHomfiber},
\[e_n^{-1} R\cHom_{\Lambda_\bullet}(M,N) \simeq R\cHom_{\Lambda_n}(M_n,N_n),\]
hence $e_n^{-1} \cExt^q_{\Lambda_\bullet}(M,N) \simeq \cExt^q_{\Lambda_n}(M_n,N_n)$. The transition maps of $\cExt^q_{\Lambda_\bullet}(M,N)$ are induced by the canonical maps
\[  R\cHom_{\Lambda_{m}}(M_{m},N_{m})\to R\cHom_{\Lambda_{m}}(M_{m},N_{n})
   \xto{\alpha} R\cHom_{\Lambda_n}(M_n, N_n)
\]
for $m\ge n$. In cases (a) and (a'), $\alpha$ is the composition
\[R\cHom_{\Lambda_{m}}(M_{m},N_{n}) \simto R\cHom_{\Lambda_{n}}(\Lambda_{n}\otimes^L_{\Lambda_{m}} M_{m},N_{n})\simto R\cHom_{\Lambda_n}(M_n, N_n).\]
In case (b), $\alpha$ is the composition
\[\cHom^\bullet_{\Lambda_{m}}(M_{m},N') \simto \cHom^\bullet_{\Lambda_{n}}(\Lambda_{n}\otimes_{\Lambda_{m}} M_{m},N')\simto \cHom^\bullet_{\Lambda_n}(M_n, N'),\]
where $N'$ is an injective resolution of $N_n$.
In all cases, since $N$ is AR-null, $\cExt^q_{\Lambda_\bullet}(M,N)$ is AR-null for all $q$, hence $R\cHom_{\Lambda_\bullet}(M,N)$ is AR-null. Therefore, if $M\in D^-$, then
\[R\Hom_{\Lambda_\bullet}(M,N) \simeq R\Gamma(\cX,R\pi_* R\cHom_{\Lambda_\bullet}(M,N)) =0\]
by \ref{p.Rpi} (a).
\end{proof}

\begin{Corollary}\label{p.DN}
  Let $M\in D^b(\cX^\N,\Lambda_\bullet)$, $N\in D^+(\cX^\N,\Lambda_\bullet)$, $M$ either normalized or of preadic cohomology sheaves. Let $D_\cN^+=D_\cN\cap D^+(\cX^\N,\Lambda_\bullet)$, where $D_\cN$ is as in \ref{s.DN}. Then the localization map
  \[\Hom_{D^+(\cX^\N,\Lambda_\bullet)}(M,N)\to \Hom_{D^+(\cX^\N,\Lambda_\bullet)/D^+_\cN}(M,N)\]
  is an isomorphism.
\end{Corollary}

\begin{proof}
  We have
  \[\Hom_{D^+(\cX,\Lambda_\bullet)/D^+_\cN}(M,N)\simeq \varinjlim_{s\colon N\to N'}\Hom_{D^+(\cX^\N,\Lambda_\bullet)}(M,N'),\]
  where $s$ runs over maps in $D^+(\cX^\N,\Lambda_\bullet)$ with cone in $D^+_\cN$. For every such $s$, it follows from \ref{p.RcHomnull} that the map
  \[\Hom_{D^+(\cX^\N,\Lambda_\bullet)}(M,N) \to \Hom_{D^+(\cX^\N,\Lambda_\bullet)}(M,N')\]
  induced by $s$ is an isomorphism.
\end{proof}

\begin{Proposition}\label{p.fnorm}
Let $f\colon \cX\to \cY$ be a morphism of toposes. The functors
\[f^{\N*}\colon D^+(\cY^\N,\Lambda_\bullet) \to D^+(\cX^\N, \Lambda_\bullet), \quad Rf_*^\N\colon D(\cX^\N,\Lambda_\bullet) \to D(\cY^\N,\Lambda_\bullet)\]
preserve normalized complexes.
\end{Proposition}

\begin{proof}
  The assertion for $f^*$ follows trivially from \ref{p.Eke}. For $Rf_*$, consider the square
  of ringed toposes
  \[\xymatrix{(\cX^\N,\Lambda_\bullet) \ar[r]^{\pi_\cX}\ar[d]^{f^{\N}} &(\cX,\cO)\ar[d]^{f}\\
  (\cY^\N,\Lambda_\bullet) \ar[r]^{\pi_\cY}& (\cY,\cO)}
  \]
  By \ref{p.Eke}, it suffices to show that, for all $M\in D(\cX,\cO)$, the base change map
  \[L\pi_\cY^* Rf_* M \to Rf^\N_* L\pi_\cX^* M\]
  is an isomorphism. By \ref{p.en}, it suffices to show that the projection formula map of $D(X,\Lambda_n)$
  \begin{equation}\label{e.fO}
  \Lambda_n \otimes_\cO^L Rf_* M \to Rf_* (\Lambda_n \otimes_\cO^L M)
  \end{equation}
  is an isomorphism.
  It then suffices to take the resolution $F\to \Lambda_n$, where $F$ is the complex $\cO\xrightarrow{\times \lambda^{n+1}} \cO$ concentrated in degrees $-1$ and $0$.

\end{proof}

\begin{ssect}\label{s.jO}
  Let $U$ be an object of $\cX$ and $\cU=\cX/U$. Then $\cU^\N$ can be identified with $\cX^\N/U^\N$. Consider the morphism of toposes $j\colon \cU\to \cX$. The functor $j_!^{\N}\colon \Mod(\cU^\N,\Lambda_\bullet) \to \Mod(\cX^\N, \Lambda_\bullet)$ is a left adjoint of $j^{\N*}$ and is exact. It induces a triangulated functor $j_!^{\N}\colon D(\cU^\N,\Lambda_\bullet) \to D(\cX^\N, \Lambda_\bullet)$. The base change map
  \begin{equation}\label{e.jen}
  j_!e_n^{-1} \Rightarrow e_n^{-1}j_!^\N
  \end{equation}
  is a natural equivalence of functors $D(\cU^\N,\Lambda_\bullet)\to D(\cX,\Lambda_n)$.  In particular, $j_!^\N$ preserves AR-null complexes. Moreover, we have a natural equivalence of functors $D(\cU,\Lambda_n)\to D(\cX^\N,\Lambda_\bullet)$
  \begin{equation}\label{e.jLen}
    j_!^\N Le_{n!} \Rightarrow Le_{n!}j_!.
  \end{equation}
  It follows from \ref{p.Eke} and projection formula \eqref{e.jpf} that $j^\N_!$ preserves normalized complexes in $D^+$.
\end{ssect}

\begin{Proposition}\label{p.ARpreadic}
  Let $0\to L\to M\to N \to 0$ be a short exact sequence in $\Mod(\cX^\N,\Lambda_\bullet)$ with $L$ and $N$ AR-preadic. Then $M$ is AR-preadic.
\end{Proposition}

This is a variant of \cite[V 5.2.4]{SGA5}. In \emph{loc.\ cit.}, one assumes moreover that $L_n$ is Artinian for all~$n$. This condition is seldom satisfied. Indeed, if there exists a nonzero Artinian $\Lambda_n$-module for some $n$ on a scheme $X$ of finite type over a field, then $X$ is necessarily an Artinian scheme.

\begin{proof}
As in \emph{loc.\ cit.}, we use the reductions in the proof of \cite[V 3.2.4 (ii)]{SGA5} as follows. Let $M'$ and $N'$ be the universal image systems of $M$ and $N$, respectively. Since $L$ and $N$ satisfy the Mittag-Leffler-Artin-Rees condition \cite[V 3.2.3]{SGA5}, $M$ satisfies this condition too \cite[V 2.1.2 (ii)]{SGA5}. So the monomorphisms $M'\to M$ and $N'\to N$ have AR-null cokernels. Let $L'=\Ker(M'\to N')$. Applying the snake lemma to the diagram
\[\xymatrix{0\ar[r] &L'\ar[r]\ar[d] & M'\ar[r]\ar[d]& N'\ar[r]\ar[d]& 0\\
0\ar[r]& L\ar[r] & M\ar[r] & N\ar[r]& 0}\]
we see that $L'\to L$ is a monomorphism with AR-null cokernel. Therefore, we may assume that $M$ and $N$ are strict.

For $r\ge 0$, consider the functor $T_r\colon \Mod(\cX^\N,\Lambda_\bullet)\to\Mod(\cX^\N,\Lambda_\bullet)$ defined by $(T_rF)_n=\Lambda_{n} \otimes_{\Lambda_{n+r}} F_{n+r}$. For $F$ strict, the epimorphism $T_r F \to F$ has AR-null kernel. Since $N$ is AR-preadic, there exists an $r\ge 0$ such that $T_r N$ is preadic \cite[V 3.2.3]{SGA5}. Let $L''=\Ker(T_r M\to T_r N)$. Applying the snake lemma to the diagram
\[\xymatrix{0\ar[r] &L''\ar[r]\ar[d] & T_r M\ar[r]\ar[d]& T_r N\ar[r]\ar[d]& 0\\
0\ar[r]& L\ar[r] & M\ar[r] & N\ar[r]& 0}\]
we see that $L''\to L$ has AR-null kernel and cokernel. Therefore, we may assume that $M$ is strict and $N$ is preadic.

In this case, $L$ is strict \cite[V 3.1.3 (ii)]{SGA5}. Choose $r\ge 0$ such that $T_r L$ is preadic. Then we have an exact sequence
\[0\to T \to T_r L \to M \to N \to 0,\]
where $T=\Ker(T_r L\to L)$ is AR-null. We are therefore reduced to the following lemma.
\end{proof}

\begin{Lemma}\label{p.preadic}
  Let $0\to T\to L\to M\to N \to 0$ be an exact sequence in $\Mod(\cX^\N,\Lambda_\bullet)$ with $T$ AR-null, $L$ and $N$ preadic. Then $M$ is AR-preadic.
\end{Lemma}

\begin{proof}

  We decompose the exact sequence into two short exact sequences
  \begin{equation}\label{e.preadic1}
    0\to T\to L\to Q\to 0
  \end{equation}
  and
  \begin{equation}\label{e.preadic2}
    0\to Q\to M\to N\to 0.
  \end{equation}
  Using \eqref{e.preadic1} and \ref{p.RcHomnull} (b), we obtain an isomorphism $\Ext^1_{\Lambda_\bullet}(N,L) \simto \Ext^1_{\Lambda_\bullet}(N,Q)$. Taking a representative of the preimage of the class of \eqref{e.preadic2}, we get the 9-diagram
  \[\xymatrix{&0\ar[d]&0\ar[d]\\
  &T\ar[d]\ar@{=}[r]&T\ar[d] \\
  0\ar[r]&L\ar[d]\ar[r]& M'\ar[r]\ar[d] & N\ar[r]\ar@{=}[d]&0\\
  0\ar[r]&Q\ar[r]\ar[d]& M \ar[r]\ar[d] & N\ar[r]& 0\\
  &0&0}\]
  Since $L$ and $N$ are preadic, $M'$ is also preadic \cite[V 3.1.3]{SGA5}.
\end{proof}

\begin{ssect}

We say that $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{adic} (``Noetherian $\fm$-adic'' in the terminology of \cite[V 5.1.1]{SGA5}) if $M$ is preadic and, for all $n$ or, equivalently, for some $n$, $M_n$ is Noetherian; $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{AR-adic} if there exists an adic module $N\in \Mod(\cX^\N,\Lambda_\bullet)$ and a homomorphism $N\to M$ with AR-null kernel and cokernel. By \ref{p.pread}, $M$ is AR-adic if and only if there exists an adic module $N\in \Mod(\cX^\N,\Lambda_\bullet)$, isomorphic to $M$ in $\Mod(\cX^\N,\Lambda_\bullet)/\cN$.
Note that we do not assume $M_n$ to be Noetherian, hence our notion of AR-adic modules is more general than the notion of ``Noetherian AR-$\fm$-adic projective systems'' in \cite[V 5.1.3]{SGA5}. Let $\Mod_{a}(\cX^\N,\Lambda_\bullet)$ (resp.\ $\Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$) be the full subcategory of $\Mod(\cX^\N,\Lambda_\bullet)$ consisting of adic (resp.\ AR-adic) modules.
\end{ssect}

\begin{Proposition}\label{p.thick}
  The category $\Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$ is a thick subcategory (\ref{s.constr}) of $\Mod(\cX^\N,\Lambda_\bullet)$, that is, a full subcategory closed by kernel, cokernel and extension.
\end{Proposition}

\begin{proof}
Using the same methods as in \cite[V 5.2.1]{SGA5}, one shows that $\Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$ is stable by kernel and cokernel. Using the same reductions as in the proof of \ref{p.ARpreadic}, one deduces from \ref{p.preadic} that this subcategory is also stable by extension.
\end{proof}

Define $\Mod_c(\cX,\cO)$ to be the quotient
\[\Mod_c(\cX,\cO) = \Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet) / \cN.\]
By \ref{p.pread}, the composition
\[\Mod_a(\cX^\N,\Lambda_\bullet)\xto{\iota} \Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet) \xto{\psi} \Mod_c(\cX,\cO)\]
of the inclusion functor $\iota$ and the localization functor $\psi$ is an equivalence of categories. Let
\[\phi\colon \Mod_c(\cX,\cO) \to \Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)\]
be the composition of $\iota$ and a quasi-inverse of $\psi\iota$. By \ref{p.pread}, $\phi$
is a left adjoint of $\psi$. Note that $\phi$ is not left exact unless $\cX$ is empty. By \cite[V 5.2.3]{SGA5}, $\Mod_c(\cX,\cO)$ is a Noetherian category.

Denote the category of Noetherian $\Lambda_n$-modules on $\cX$ by $\Mod_c(\cX,\Lambda_n)$. For $M\in \Mod_c(\cX,\cO)$, $N\in \Mod_c(\cX,\Lambda_n)$, we have
\[\Hom_{\Mod_c(\cX,\Lambda_n)}(e_n^{-1} \phi M,N) \simeq \Hom_{\Mod_c(\cX,\cO)}(M,e_{n*}N).\]
Moreover, $e_n^{-1}\phi e_{n*}\simeq e_n^{-1}\pi^* \simeq \one$. Thus $e_{n*}\colon \Mod_c(\cX,\Lambda_n)\to \Mod_c(\cX,\cO)$ is fully faithful.
Define $\Lambda_n\otimes_\cO M= e_n^{-1}\phi M$. The family of functors
\[\left(\Lambda_n\otimes_\cO-\colon \Mod_c(\cX,\cO)\to \Mod_c(\cX,\Lambda_n)\right)_{n\in \N}\]
is conservative.

We say $M\in \Mod_a(\cX^\N,\Lambda_\bullet)$ is \emph{locally constant} if $M_n$ is locally constant for all $n$. We say $M\in \Mod_c(\cX,\cO)$ is \emph{lisse} if it is in the essential image of locally constant adic modules. For any $n$, this is equivalent to $\Lambda_n\otimes_\cO M$ being locally constant.

\newcommand{\oldthick}{
\begin{proof}
  It remains to show the stability by extension: if
  \begin{equation}\label{e.thick1}
  0\to L\to M\to N \to 0
  \end{equation}
  is a short exact sequence with $L$ and $N$ AR-adic, then $M$ is AR-adic. We say $N\in\Mod(\cX^\N,\Lambda_\bullet)$ is \emph{good} if for every short exact sequence \eqref{e.thick1} with $L$ AR-adic, $M$ is AR-adic. Note that good modules are AR-adic. We first establish three properties of this notion.

  (i) Good modules are stable by extension. In fact, if $N$ sits in a short exact sequence $0\to N'\to N\to N'' \to 0$ with $N'$ and $N''$ good, then, putting $M'=M\times_N N'$, we obtain a 9-diagram
  \[\xymatrix{&&0\ar[d]&0\ar[d]\\
  0\ar[r]& L\ar@{=}[d]\ar[r] &M'\ar[r]\ar[d] & N'\ar[r]\ar[d] & 0\\
  0\ar[r]& L\ar[r] & M\ar[r]\ar[d] & N\ar[r]\ar[d]& 0\\
  && N''\ar@{=}[r]\ar[d] & N''\ar[d]\\
  &&0&0}\]
  Then $M'$ and, in turn, $M$ are AR-adic.

  (ii) If $N$ is AR-adic and is a quotient of a good module $N'$, then $N$ is good. In fact, if we put $N''=\Ker( N'\to N)$, then $N''$ is AR-adic. Putting $M'=M\times_N N'$, we obtain a 9-diagram
  \[\xymatrix{&&0\ar[d]&0\ar[d]\\
  && N''\ar@{=}[r]\ar[d] & N''\ar[d]\\
  0\ar[r]& L\ar@{=}[d]\ar[r] &M'\ar[r]\ar[d] & N'\ar[r]\ar[d] & 0\\
  0\ar[r]& L\ar[r] & M\ar[r]\ar[d] & N\ar[r]\ar[d]& 0\\
  &&0&0}\]
  Then $M'$ is AR-adic.

  (iii) If $N'\to N$ has AR-null kernel and cokernel with $N'$ adic such that for every exact sequence $0\to T\to L\to M\to N'\to 0$ with $T$ AR-null, $L$ adic, we have that $M$ is AR-adic, then $N$ is good. In fact, this follows from d\'evissage similar to the proof of \cite[3.2.4 (ii)]{SGA5}.

  To prove the proposition, we need to show that every AR-adic $N\in\Mod_c(\cX^\N,\Lambda_\bullet)$ is good. From the fact that $\Mod_c(\cX,\cO)$ is Noetherian
  \cite[V 5.2.3]{SGA5}, one deduces that there exists $n\ge 0$ such that $\Img (N\xrightarrow{\times\lambda^n} N)$ is AR-torsion-free. Since $N$ sits in the short exact sequence $0\to N'\to N \to N''\to 0$, where $N'=\Ker(N\xrightarrow{\times\lambda^n} N)$, $N''$ is AR-torsion-free, we are therefore reduced by (i) to the following cases

  (a) $N$ is AR-torsion-free. This case follows from (iii), \ref{p.tfflat} and \ref{p.preadic}.

  (b) $N$ is annihilated by $\lambda^{n}$ for some $n\ge 0$. By (iii), we may assume $N$ adic. Then $N=\pi^*N'$, where $N'\in \Mod_c(\cX,\cO)$ is annihilated by $\lambda^{n}$. Moreover, we may assume that $\cX$ is a scheme. There exists a finite stratification of $\cX$ such that $N'$ is locally constant on each stratum. Up to replacing $\cX$ by an \'etale cover of a stratum, we may assume that $N'$ is constant. Using (i) again, we may assume that $N=\pi^*\Lambda_0$. Since $\pi^*\Lambda_0$ is a quotient of $\pi^*\cO$, which is good by (a), it suffices to apply (ii).
\end{proof}
}

\begin{ssect}
We say that $M\in D(\cX^\N, \Lambda_\bullet)$ is \emph{AR-adic} if $\fH^i M$ is AR-adic for all $i$. Let $D_{AR\text{-}a}(\cX^\N, \Lambda_\bullet)$ be the full subcategory of $D(\cX^\N, \Lambda_\bullet)$ consisting of  AR-adic complexes,
which is a thick triangulated subcategory \cite[1.3]{Rickard}. Define $D_c^*(\cX,\cO)$ to be the quotient
\[D_c^*(\cX,\cO) = D_{AR\text{-}a}^*(\cX^\N, \Lambda_\bullet) / D^*_\cN,\]
where $*\in\{\emptyset, +, b\}$, $D_{AR\text{-}a}^* = D_{AR\text{-}a}\cap D^*$, $D_\cN^* = D_\cN\cap D^*$, $D_\cN$ as in \ref{s.DN}. The inclusion functor induces a faithful functor $D^+_c(\cX,\cO)\to D_c(\cX,\cO)$ and a fully faithful functor $D^b_c(\cX,\cO) \to D^+_c(\cX,\cO)$ \cite[10.2.6]{KSCat}. The  functor $\Mod_c(\cX,\cO)\to \Dbc(\cX,\cO)$ induced by the inclusion functor
$\Mod_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)\to D^b_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$
is fully faithful by \ref{p.pread} and \ref{p.DN}.

By \ref{p.Rpi} (a), the restriction of the functor \eqref{e.Mhat} $M\mapsto \hat{M}$ to $D^+$ factors to give a functor $D^+_c(\cX,\cO)\to D^+(\cX^\N, \Lambda_\bullet)$, called the \emph{normalization functor}, that we still denote by $M\mapsto \hat{M}$.
\end{ssect}

In the rest of this section, assume that $\cX$ has enough points. We say that $M\in \Mod(\cX^\N,\Lambda_\bullet)$ is \emph{AR-torsion-free} if $\Ker(M\xrightarrow{\times\lambda} M)$ is AR-null.

\begin{Lemma}\label{p.tfflat}
 Let $M\in \Mod(\cX^\N,\Lambda_\bullet)$ be preadic and AR-torsion-free. Then $M$ is flat.
\end{Lemma}

\begin{proof}
  We may assume that $\cX$ is the punctual topos. Then $M'=\varprojlim_n M_n$ is a torsion-free, hence flat $\cO$-module and $M_n\simeq \Lambda_n\otimes_\Lambda M'$.
\end{proof}

\begin{Proposition}\label{p.Mhat}
  Let $M\in D^+(\cX^\N, \Lambda_\bullet)$ be AR-adic. Then the cone of $\hat{M}\to M$ is AR-null and $\fH^q \hat{M}_n \in \Mod(\cX,\Lambda_n)$ is Noetherian for all $q$ and $n$. In particular, $\hat{M}$ is AR-adic. If, moreover, $M\in D^{[a,b]}(\cX^\N, \Lambda_\bullet)$, then $\hat{M}$ belongs to $D^{[a-1,b]}(\cX^\N, \Lambda_\bullet)$.
\end{Proposition}

This is similar to \cite[3.0.14]{LO2}.

\begin{proof}
  We may assume $M\in \Mod(\cX^\N,\Lambda_\bullet)$ AR-adic. From the fact that $\Mod_c(\cX,\cO)$ is Noetherian, one deduces that there exists $n\ge 0$ such that $M'=\Img (M\xrightarrow{\times\lambda^n} M)$ is AR-torsion-free. Since $M$ sits in the short exact sequence $0\to M''\to M \to M'\to 0$, where $M''=\Ker(M\xrightarrow{\times\lambda^n} M)$, we are reduced to the following cases
  \begin{description}
  \item[(a)] $M$ is AR-torsion-free.
  \item[(b)] $M$ is annihilated by $\lambda^{n+1}$ for some $n\ge 0$.
  \end{description}
  In both cases, let $F\to M$ be a homomorphism of AR-null kernel and cokernel with $F$ adic. Then the induced map $\hat{F} \to \hat{M}$ is an isomorphism. Therefore, to see that $\hat{M}\to M$ has AR-null cone, that $\fH^q \hat{M}_n$ is Noetherian for all $q$ and $n$, and that $\hat{M}$ belongs to $D^{[-1,0]}$, we may assume moreover that $M$ is adic.

  In case (a), $M$ is flat by \ref{p.tfflat}, hence normalized by \ref{p.Eke}, that is $\hat{M}\simto M$. In case (b), $M\simeq\pi^*N$, where $N=M_n\in \Mod(\cX,\Lambda_n)$ is Noetherian. By \ref{p.Lpi} (b), the cone $C$ of $L\pi^*N \to \pi^* N$ is AR-null. Hence, by \ref{p.Rpi}, the composition $N\to R\pi_* L\pi^* N \to R\pi_* \pi^* N$, where the first map is the adjunction map, is an isomorphism. Applying $L\pi^*$ on both sides, we obtain $L\pi^* N\simto \hat{M}$. Note that $L\pi^* N$ belongs to $D^{[-1,0]}$ and, by the proof of \ref{p.Lpi}, $e_n ^{-1} \fH^q L\pi^* N$ is a subquotient of $N$, hence is Noetherian, for all $q$ and $n$. Hence $\hat{M}$ belongs to $D^{[-1,0]}(\cX^\N,\Lambda_\bullet)$ and $\fH^q \hat{M}_n \in \Mod(\cX,\Lambda_n)$ is Noetherian for all $q$ and $n$. The cone of $\hat{M}\to M$ is isomorphic to $C$, which is AR-null.
\end{proof}

\begin{Corollary}\label{p.normadic}
  Let $M\in D^+(\cX^\N, \Lambda_\bullet)$ be normalized. Then, for any $n$, $M$ is AR-adic if and only if $\fH^q M_n$ is Noetherian for all $q$ and $n$.
\end{Corollary}

\begin{proof}
  If $M$ is AR-adic, then $\fH^q M_n \simeq \fH^q \hat{M}_n$ is Noetherian by \ref{p.Mhat}. Conversely, if $\fH^q M_n$ is Noetherian for all $q$, we first show that $\widehat{\fH^q M}$ belongs to $D^{[-1,0]}$ and is AR-adic for all $q$. The short exact sequence \eqref{e.Lpi} for $R\pi_* M$ induces a short exact sequence
  \[ 0\to M'\to \fH^q M\to M'' \to 0,\]
  where $M'$ is preadic and $M''$ is essentially zero. Since $M'_n$ is Noetherian, $M'$ is adic. By \ref{p.Rpi} (a), $\widehat{\fH^q M} \simeq \widehat{M'}$. The latter belongs to $D^{[-1,0]}$ and is AR-adic by \ref{p.Mhat}.

  The distinguished triangle
  \[\widehat{\tau^{\le q} M} \to M \to \widehat{\tau^{\ge q+1} M }\to\]
  induces a short exact sequence
  \[0\to \fH^0 \widehat{\fH^q M}\to \fH^q M \to \fH^{-1} \widehat{\fH^{q+1}M}\to 0.\]
  Thus $\fH^q M$ is AR-adic.
\end{proof}

\begin{ssect}\label{s.endthree}
Let $D_{\norm}^+$ be the full subcategory of $D^+_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$ consisting of normalized complexes and let $D^b_\norm=D^+_\norm \cap D^b$. By \ref{p.Mhat}, the normalization functor
\[D^+_c(\cX,\cO)\to D^+_\norm, \quad M \mapsto \hat M\]
is a quasi-section of the composition
\[D^+_\norm \to D^+_{AR\text{-}a}(\cX^\N,\Lambda_\bullet) \to D^+_c(\cX,\cO)\]
of the inclusion and localization functors. In particular $D^+_c(\cX,\cO)$ is a $\mathfrak{U}$-category, where $\mathfrak{U}$ is the fixed universe. Thus, by \ref{p.DN}, the composition
\[D^b_\norm \xto{\iota} D^b_{AR\text{-}a}(\cX^\N,\Lambda_\bullet) \xto{\psi} D^b_c(\cX,\cO)\]
is an equivalence of categories, and the normalization functor is a quasi-inverse. Moreover, the composition of the localization functor and $\iota$ is  a left adjoint of $\psi$.

Let $D^{+,\le a}_c(\cX,\cO)$ (resp.\ $D^{\ge a}_c(\cX,\cO)$) be the essential image of $D^{+,\le a}_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$ (resp.\ $D^{\ge a}_{AR\text{-}a}(\cX^\N,\Lambda_\bullet)$) in $D^+_c(\cX,\cO)$. Then $M\in D^+_c(\cX,\cO)$ belongs to $D^{+,\le a}_c(\cX,\cO)$ if and only if $\hat M \in D^{\le a}(\cX^\N,\Lambda_\bullet)$. For $M\in D^{+,\le a}_c(\cX,\cO)$ and $N\in D^{\ge a+1}_c(\cX,\cO)$, \[\Hom_{D^+_c(\cX,\cO)}(M,N)=0.\]
In fact, we may replace $M$ by $\hat M$ and $N$ by $N'\in D^{\ge a+1}(\cX^\N,\Lambda_\bullet)$. It then suffices to apply \ref{p.DN}. Thus $(D_c^{+,\le 0}, D_c^{\ge 0})$ is a t-structure. The cohomological amplitude of  the normalization functor $M\mapsto \hat M$ is contained in $[-1,0]$ and is not $0$ unless $\cX$ is empty.

For $M\in \Dbc(\cX,\cO)$ and $N\in D_c^+(\cX,\cO)$, define $R\Hom_{\cO}(M,N)=R\Hom_{\Lambda_\bullet}(\hat M, N)$. By \ref{p.RcHomnull}, this gives a functor
\[R\Hom_\cO(-,-) \colon \Dbc(\cX,\cO)^\op \times D_c^+(\cX,\cO)\to D^+(\cO),\]
where $D^+(\cO)$ is the derived category of $\cO$-modules.
By \ref{p.DN}, for $M\in \Dbc(\cX,\cO)$ and $N\in D^+_c(\cX,\cO)$, we have
\[H^0R\Hom_\cO(M,N)\simeq \Hom_{D^+_c(\cX,\cO)}(M,N).\]

Let $D^+_c(\cX,\Lambda_n)$ be the full subcategory of $D^+(\cX,\Lambda_n)$ consisting of complexes with Noetherian cohomology sheaves. For $M\in \Dbc(\cX,\cO)$, $N\in D^+_c(\cX,\Lambda_n)$, we have
\[\Hom_{D^+_c(\cX,\Lambda_n)}(e_n^{-1}\hat M,N)\simeq \Hom_{D_c^+(\cX,\cO)}(M,e_{n*}N).\]
For $N\in \Dbc(\cX,\Lambda_n)$, $e^{-1}_n \widehat{e_{n*} N} \simeq e_n^{-1} L\pi^* N \simeq N$. Thus $e_{n*}\colon \Dbc(\cX,\Lambda_n)\to \Dbc(\cX,\cO)$ is fully faithful. For $N\in D_c^+(\cX,\cO)$, define $\Lambda_n\otimes^L_\cO N = e_n^{-1} \hat N$. The functor
\[\Lambda_n\otimes^L_\cO - \colon D_c^+(\cX,\cO)\to D_c^+(\cX,\Lambda_n)\]
is conservative.
\end{ssect}

\section{Operations on $\Dbc(\cX,\cO)$}
In this section, let $S$ be a regular scheme of dimension $\le 1$, $\cO$ be a complete discrete valuation ring of residue characteristic $\ell$ invertible on $S$. See \ref{s.Gabber} for a remark on the assumption on $S$. As in \S~3, let $\Lambda_n=\cO/\fm^n$, where $\fm$ is the maximal ideal of $\cO$. Let $\cX$ be a finite type Deligne-Mumford $S$-stack. We apply the formalism of \S~3 to $\cX_\et$. Recall (\ref{p.cN}) that, for any $n$, $M\in \Mod(\cX,\Lambda_n)$ is Noetherian if and only if $M$ is constructible.

\begin{Proposition}\label{p.tensoradic}
  Let $M, N \in D^+(\cX^\N,\Lambda_\bullet)$ be AR-adic. Suppose that $N$ is normalized. Then $M\otimes^L_{\Lambda_\bullet} N$ is AR-adic.
\end{Proposition}

\begin{proof}
By \ref{p.Mhat} and \ref{p.tensornull} (ii), we may assume $M$ normalized.

Then, by \ref{p.tensornorm} and \ref{p.tensornull} (i), $M\otimes^L_{\Lambda_\bullet} N$ belongs to $D^+$ and is normalized. By \ref{p.normadic}, $M_n$ and $N_n$ belongs to $D_c$ for all $n$. Hence, by \ref{p.cX}, $e_n^{-1}(M\otimes^L_{\Lambda_\bullet} N) \simeq M_n\otimes^L_{\Lambda_n} N_n$ belongs to $D_c$ for all $n$. Therefore $M\otimes^L_{\Lambda_\bullet} N$ is AR-adic by \ref{p.normadic}.
\end{proof}

For $M\in D^+(\cX^\N,\Lambda_\bullet)$ AR-adic and $N\in D^+_c(\cX,\cO)$, define
\[M\otimes^L_{\cO} N = M\otimes^L_{\Lambda_\bullet} \hat{N}.\]
By \ref{p.tensoradic} and \ref{p.tensornull}, this gives a functor
\[-\otimes^L_{\cO}-\colon D^+_c(\cX,\cO)\times D^+_c(\cX,\cO) \to D^+_c(\cX,\cO).\]

Using this definition, for $N\in D^+_c(\cX,\cO)$, the projection formula \ref{p.enpf} \[(e_{n*}\Lambda_n)\otimes^L_{\Lambda_\bullet} \hat{N}\simto e_{n*} e_{n}^{-1}\hat{N}\]
can be reformulated as
\[(e_{n*}\Lambda_n)\otimes^L_{\cO} N \simto e_{n*}(\Lambda_n\otimes^L_\cO N). \]

\begin{Proposition}\label{p.RcHomadic}
  Let $M\in D^-(\cX^\N,\Lambda_\bullet)$ be normalized and AR-adic, $N\in D^+(\cX^\N,\Lambda_\bullet)$ be AR-adic. Then $R\cHom_{\Lambda_\bullet}(M,N)\in D^+(\cX^\N,\Lambda_\bullet)$ is AR-adic.
\end{Proposition}

\begin{proof}
Up to replacing $M$ by $\widehat{\tau^{\ge a} M}\simeq L\pi^* \tau^{\ge a} R\pi_* M$ (\ref{p.tau}), we may assume $M\in D^b$.  By \ref{p.Mhat} and \ref{p.RcHomnull}, we may assume $N$ normalized. Then, by \ref{p.RcHomnorm}, $R\cHom_{\Lambda_\bullet}(M,N)$ is normalized. By \ref{p.normadic}, $M_n$ and $N_n$ belongs to $D_c$ for all $n$. Hence, by \ref{p.RcHomfiber} and \ref{p.cX}, $e_n^{-1}R\cHom_{\Lambda_\bullet}(M,N) \simeq R\cHom_{\Lambda_n} (M_n, N_n)$ belongs to $D_c$. Therefore $R\cHom_{\Lambda_\bullet}(M,N)$ is AR-adic by \ref{p.normadic}.
\end{proof}

For $M\in D^b_c(\cX,\cO)$ and $N\in D^+(\cX^\N,\Lambda_\bullet)$ AR-adic, define
\[R\cHom_{\cO}(M, N) = R\cHom_{\Lambda_\bullet}(\hat{M}, N).\]
By \ref{p.RcHomadic} and \ref{p.RcHomnull}, this gives a functor
\[R\cHom_\cO(-,-)\colon D^b_c(\cX,\cO)^\op \times D^+_c(\cX,\cO) \to D^+_c(\cX,\cO).\]

\begin{Proposition}\label{p.RcHomO}
(i) For all $M,N\in D^+_c(\cX,\cO)$, the map
\[\Lambda_n\otimes^L_\cO(M\otimes^L_\cO N)\simeq(\Lambda_n \otimes_\cO^L M)\otimes_{\Lambda_n}(\Lambda_n\otimes^L_\cO N)\]
is an isomorphism.

(ii) For all $M\in D^b_c(\cX,\cO)$, $N\in D^+_c(\cX,\cO)$, the map
  \[\Lambda_n \otimes^L_\cO R\cHom_\cO(M,N) \to R\cHom_{\Lambda_n}(\Lambda_n\otimes^L_\cO M,\Lambda_n\otimes^L_\cO N)\]
  is an isomorphism.
\end{Proposition}

\begin{proof}
(i) By \ref{p.Mhat}, we may assume that $M,N\in D^+(\cX^\N,\Lambda_\bullet)$ are normalized. Then $M\otimes^L_{\Lambda_\bullet} N$ is normalized by \ref{p.tensornorm} and the assertion is trivial.

(ii) By \ref{p.Mhat}, we may assume that $M\in D^b(\cX^\N,\Lambda_\bullet)$ and $N\in D^+(\cX^\N,\Lambda_\bullet)$ are normalized. Then, by \ref{p.RcHomnorm}, $R\cHom_{\Lambda_\bullet}(M,N)$ is normalized. Hence the assertion follows from \ref{p.RcHomfiber}.
\end{proof}

Let $f\colon\cX\to \cY$ be a morphism of Deligne-Mumford stacks, $\cY$ of finite type over $S$, $\cX$ of finite type over a regular scheme $S'$ of dimension $\le 1$. It induces a flat morphism of ringed toposes $(f^\N_*, f^{\N*})\colon (\cX_\et^\N,\Lambda_\bullet) \to (\cY_\et^\N,\Lambda_\bullet)$. The functor $f^{\N*}\colon D(\cY^\N,\Lambda_\bullet) \to D(\cX^\N, \Lambda_\bullet)$ preserves AR-null complexes and AR-adic complexes. It induces $f^*\colon D^+_c(\cY,\cO)\to D^+_c(\cX,\cO)$ of cohomological dimension $0$. For $N\in D^+_c(\cY,\cO)$, the map
\[f^*(\Lambda_n\otimes^L_\cO N)\to \Lambda_n\otimes^L_\cO f^* N\]
is an isomorphism. In fact, the map $f^{\N*}\hat N \to \widehat{f^* N}$ is an isomorphism.

Assume $S'=S$.
The functor $Rf^\N_*\colon D(\cX^\N,\Lambda_\bullet) \to D(\cY^\N,\Lambda_\bullet)$ preserves AR-null complexes in $D^+$ by \ref{p.en}.

\begin{Proposition}\label{p.fadic}
The functor $Rf_*$ preserves AR-adic complexes in $D^+$. If $f$ has prime to $\ell$ inertia, then $f_*^\N$ has finite cohomological dimension.

\end{Proposition}

In particular, $Rf_*^\N$ induces $Rf_*\colon D^+_c(\cX,\cO)\to D^+_c(\cY,\cO)$. If $f$ has prime to $\ell$ inertia, then $Rf_*^\N$ preserves small direct sums \cite[14.3.4 (ii)]{KSCat} and $Rf_*$ sends $\Dbc(\cX,\cO)$ to $\Dbc(\cX,\cO)$.

\begin{proof}
  Let $M\in D^+(\cX^\N,\Lambda_\bullet)$ be AR-adic. To prove that $Rf_* M$ is AR-adic, we may assume $M$ normalized. Then $Rf^\N_* M$ is normalized by \ref{p.fnorm}. By \ref{p.normadic}, $M_n$ belongs to $D_c$ for all $n$. Hence, by \ref{p.en} and \ref{p.cf} (i), $e_n^{-1} Rf^\N_* M \simeq Rf_* M_n$ belongs to $D_c$ for all $n$. Therefore $Rf^\N_* M$ is AR-adic by \ref{p.normadic}. The last assertion follows from \ref{p.en} and the fact that the cohomological dimension of $f_*\colon \Mod(\cX,\Lambda_n)\to \Mod(\cY,\Lambda_n)$ does not depend on~$ n$.
\end{proof}

\begin{Proposition}\label{p.fO}
  For all $M\in D_c^+(\cX,\cO)$, the map
  \[
    \Lambda_n\otimes^L_\cO Rf_* M \to Rf_*(\Lambda_n\otimes^L_\cO M)
  \]
  is an isomorphism.
\end{Proposition}

\begin{proof}
  By \ref{p.Mhat}, we may assume that $M\in D^+(\cX^\N,\Lambda_\bullet)$ is normalized. Then, by \ref{p.fnorm}, $Rf_*M$ is normalized. Hence the assertion follows from \ref{p.en}.
\end{proof}

\begin{Proposition}\label{p.sbcO}
(i) (Base change) Let
\[\xymatrix{\cX'\ar[r]^{h}\ar[d]^{f'} & \cX\ar[d]^{f}\\
\cY'\ar[r]^{g} & \cY}\]
be a 2-Cartesian square of Deligne-Mumford stacks with $\cX$ and $\cY$ of finite type over $S$. Assume that one of the following conditions holds:
\begin{description}
  \item[(a)] $f$ is proper and $\cY'$ is of finite type over a regular scheme $S'$ of dimension $\le 1$.
  \item[(b)] $g$ is smooth and of finite type.
\end{description}
Then the base change map
\[g^* Rf_* M \to Rf'_* h^* M\]
is an isomorphism for all $M\in D_c^+(\cX,\cO)$.

(ii) (Projection formula) Let $f\colon \cX\to \cY$ be a proper morphism of Deligne-Mumford $S$-stacks of finite type, $M\in D^+_c(\cX,\cO)$, $N\in D^+_c(\cY,\cO)$. Then the map
\[N\otimes_\cO^L Rf_* M \to Rf_* (f^* N\otimes^L_\cO M)\]
is an isomorphism.
\end{Proposition}

\begin{proof}
  (i) By \ref{p.en}, the proper or smooth (\ref{p.sbc}) base change map $g^{\N*} Rf^\N_* M \to Rf^{'\N}_* h^{\N*} M$ is an isomorphism.

  (ii) By (i), we may assume that $\cY$ is the spectrum of a separably closed field.
  As in the proof of \ref{p.Mhat}, we may assume $\hat N\simeq L\pi^* K$, where $K$ is a finite $\cO$-module. Replacing $K$ by a finite free resolution, the assertion becomes clear.
\end{proof}

\begin{Proposition}\label{p.fuO}
  Let $f\colon \cX\to \cY$ be a morphism of Deligne-Mumford stacks, $\cY$ of finite type over $S$. Let $M\in \Dbc(\cY,\cO)$, $L\in D^+_c(\cY,\cO)$. Assume that one of the following conditions holds:
  \begin{description}
    \item[(a)] The cohomology sheaves of $M$ are lisse (\ref{p.thick}) and $\cX$ is of finite type over some regular scheme $S'$ of dimension $\le 1$.
    \item[(b)] $f$ is smooth and of finite type.
  \end{description}
  Then the map
  \[f^* R\cHom_\cY(M,L)\to R\cHom_\cX(f^*M,f^*L)\]
  is an isomorphism.
\end{Proposition}

\begin{proof}
  (a)
  As in the proof of \ref{p.Mhat}, we may assume that $M=\hat F$, where $F\in \Mod(\cX^\N,\Lambda_\bullet)$ is adic and either flat or annihilated by $\lambda^{n+1}$ for some $n$. In both cases, $F$ is locally constant and it follows that the cohomology sheaves of $e_m^{-1}M$ are locally constant. The assertion then follows from \ref{p.RcHomfiber}.

  (b) We may assume $M$ and $L$ normalized. The assertion then follows from \ref{p.RcHomfiber} and \ref{p.Homsm}.
\end{proof}

Let $p\colon \cX\to \cY$ be a proper morphism of Deligne-Mumford $S$-stacks of inertia type. If $p$ has prime to $\ell$ inertia and the fibers of $p$ have dimension $\le d$, then $p_*^\N$ has cohomological dimension $\le 2d$.

\begin{Lemma}\label{p.enshr}
  Let $p\colon \cX\to \cY$ be a proper morphism of prime to $\ell$ inertia of Deligne-Mumford $S$-stacks of finite type. For all $M\in D(\cX,\Lambda_n)$, the map \eqref{e.enshr}
  \[Le_{n!}Rp_*M \to Rp_*^\N Le_{n!}M\]
  is an isomorphism.
\end{Lemma}

\begin{proof}

By \ref{p.en}, it suffices to show that the map
\[\Lambda_q\otimes_{\Lambda_n}^L Rp_* M \to Rp_*(\Lambda_q\otimes^L_{\Lambda_n} M)\]
is an isomorphism for $q\le n$, which is projection formula \ref{p.pbc} (ii).
\end{proof}

\begin{ssect}\label{d.jO}
  Let $j\colon \cU\to \cX$ be an \'etale representable morphism of finite type Deligne-Mumford $S$-stacks. Then \ref{s.jO} applies and we have $j_!^\N\colon D(\cU^\N,\Lambda_\bullet)\to D(\cX^\N,\Lambda_\bullet)$. It follows from \eqref{e.jen} and projection formula \eqref{e.jpf} that $j_!^\N$ preserves AR-null and normalized complexes.
\end{ssect}

\begin{ssect}\label{s.lsO}
  We construct $Rf_!^\N$ by gluing as in \ref{s.fshr}. Let $\cC$ be the 2-category of Deligne-Mumford $S$-stacks of finite type and finite inertia whose 1-cells are the separated morphisms of prime to $\ell$ inertia, $\cA$ be the 2-faithful subcategory whose 1-cells are the open immersions, $\cB$ be the 2-faithful subcategory whose 1-cells are the proper morphisms, $\cD$ be the 2-category of triangulated categories. Let $F_\cA\colon \cA\to \cD$ be the pseudo-functor
  \[\cX\mapsto D(\cX^\N,\Lambda_\bullet), \quad j\mapsto j_!^\N, \quad \alpha\mapsto \alpha_!^\N,\]
  and $F_\cB\colon \cB\to \cD$ be the pseudo-functor
  \[\cX\mapsto D(\cX^\N,\Lambda_\bullet), \quad p\mapsto Rp_*^\N, \quad \alpha\mapsto R\alpha_*^\N.\]
  If $f$ is a proper open immersion, let $\rho(f)$ be the inverse of the 2-cell \eqref{e.rho}
  $f_!^\N\Rightarrow Rf_*^\N$. If $D$ is a 2-Cartesian square \eqref{e.2}, let $G_D\colon i_!^\N Rq_*^\N\Rightarrow Rp_*^\N j_!^\N$ be the 2-cell as in \eqref{e.shrstar}. By \ref{p.ax}, $(F_\cA,F_\cB,G,\rho)$ is an object of $\GD'_{\cA,\cB}(\cC,\cD)$. By \ref{p.gluestack}, it defines a pseudo-functor $F\colon \cC\to \cD$. For any 1-cell of $\cC$, define
  \[Rf_!^\N\colon D(\cX^\N,\Lambda_\bullet)\to D(\cY^\N,\Lambda_\bullet)\]
  to be $F(f)$. If the fibers of $f$ have dimension $\le d$, then $Rf_!^\N$ has cohomological amplitude contained in $[0,2d]$. If $f$ is representable and \'etale, then $Rf_!^\N$ coincides with $f_!^\N$ (\ref{d.jO}) as in \ref{s.Rshr=shr}.

  We construct the support-forgetting map $Rf_!^\N\Rightarrow Rf_*^\N$, the base change isomorphism and the projection formula isomorphism by gluing as before. We construct two more isomorphisms by gluing. We define a pseudo-natural transformation $\epsilon\colon F\to F_n$ with $\epsilon(\cX)=e_n^*$ by gluing the inverse of \eqref{e.jen} for $\cA$ and \eqref{e.en} for $\cB$, which is possible by \ref{p.rhoAB} and \ref{p.GAB}. We define a pseudo-natural transformation $\eta\colon F_n\to F$ with $\eta(\cX)=Le_{n!}$ by gluing the inverse of \eqref{e.jLen} for $\cA$ and \ref{p.enshr} for $\cB$, which is possible by \ref{p.ax}. We have obtained the following.
\end{ssect}

\begin{Lemma}\label{p.shren}
  Let $f\colon \cX\to \cY$ be a separated morphism of prime to $\ell$ inertia of Deligne-Mumford stacks of finite type and finite inertia. Let $M\in D(\cX^\N,\Lambda_\bullet)$, $N\in D(\cY^\N,\Lambda_\bullet)$. Then the maps
  \begin{gather}
    \label{e.shren} e_n^{-1}Rf_!^\N M\to Rf_!^\N e_{n}^{-1} M,\\
    \label{e.shrLen} Le_{n!}Rf_! N\to Rf_!^\N Le_{n!} N
  \end{gather}
  are isomorphisms.
\end{Lemma}

It follows from \eqref{e.shren} that $Rf_!^\N$ preserves AR-null complexes. It follows from \eqref{e.shren} and projection formula \ref{p.bcc} (ii) that $Rf_!^\N$ preserves normalized complexes in $D^+$. It also follows from \eqref{e.shren} that $Rf_!^\N$ commutes with small direct sums, hence, by \cite[14.3.1 (ix)]{KSCat}, admits a right adjoint
\[Rf^{\N!}\colon D(\cY^\N,\Lambda_\bullet)\to D(\cX^\N,\Lambda_\bullet).\]

\begin{ssect}\label{p.shrO}
  Let $f\colon \cX\to \cY$ be a morphism of prime to $\ell$ inertia of Deligne-Mumford $S$-stacks of finite type. Assume either (a) $f$ is representable and \'etale; or (b) $f$ is separated and $\cX$, $\cY$ are of finite inertia. Then $Rf_!^\N$ is defined in \ref{d.jO} and \ref{s.lsO}. We prove as in \ref{p.fadic} that it preserves AR-adic complexes. It induces
  \[Rf_!\colon D^+_c(\cX,\cO)\to D^+_c(\cY,\cO),\]
  which sends $\Dbc$ to $\Dbc$.
\end{ssect}

\begin{ssect}\label{s.dagO}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia. We define
  \[Rf_\dag^\N\colon D^+(\cY^\N,\Lambda_\bullet)\to D^+(\cX^\N,\Lambda_\bullet)\]
  by gluing $j_!^\N$ for $j$ an open immersion and $Rp_*^\N$ for $p$ proper as in \ref{s.dag}. If $f$ is of prime to $\ell$ inertia, then we obtain the restriction of $Rf_!^\N$ to $D^+$. We construct the support-forgetting map $Rf_\dag^\N \Rightarrow Rf_*^\N$ and the base change isomorphism by gluing as before. Moreover, we glue \eqref{e.en} and the inverse of \eqref{e.jen} and obtain the following.
\end{ssect}

\begin{Lemma}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia, $M\in D^+(\cX^\N,\Lambda_\bullet)$. Then the map
  \[e_n^{-1}Rf_\dag^\N M \to Rf_\dag^\N e_n^{-1} M\]
  is an isomorphism.
\end{Lemma}

In particular, $Rf_\dag^\N$ preserves AR-null complexes. It follows from \ref{p.fnorm} and projection formula \eqref{e.jpf} that $Rf_\dag^\N$ preserves normalized complexes. One checks as in \ref{p.fadic} that it preserves AR-adic complexes. Thus it induces
\[Rf_\dag \colon D^+_c(\cX,\cO)\to D^+_c(\cY,\cO),\]
endowed with a support-forgetting map $Rf_\dag \Rightarrow Rf_*$ which is a natural equivalence if $f$ is proper. If $f$ is of prime to $\ell$ inertia, then $Rf_\dag$ is simply $Rf_!$.

\begin{ssect}
  Let $i\colon \cY \to \cX$ be a closed immersion of finite type Deligne-Mumford $S$-stacks. The functor $i^{\N!}\colon \Mod(\cX^\N,\Lambda_\bullet)\to \Mod(\cY^\N,\Lambda_\bullet)$ is a right adjoint of $i_*^\N$, and thus is left exact. Let $Ri^{\N!}\colon D(\cX^\N,\Lambda_\bullet) \to D(\cY^\N,\Lambda_\bullet)$ be its right derived functor. This is compatible with the definition following \ref{p.shren}.

  Let $j\colon \cU\to \cX$ be the complementary open immersion. For any complex $M$ of $\Lambda_\bullet$-modules on $\cX^\N$, we have a natural short exact sequence
  \[0 \to j^\N_!j^{\N*} M \to M \to i^\N_* i^{\N*} M \to 0,\]
  hence a distinguished triangle in $D(\cX^\N,\Lambda_\bullet)$
  \begin{equation}\label{e.distO1}
  j_!^\N j^{\N*} M \to M \to i^\N_* i^{\N*} M \to.
  \end{equation}

  For any complex $N$ of injective $\Lambda_\bullet$-modules on $\cX^\N$, we have a natural short exact sequence
  \[0\to i_*^\N i^{!\N} N \to N \to j_*^\N j^{\N*} N \to 0,\]
  hence, for any $N\in D(\cX^\N,\Lambda_\bullet)$, a distinguished triangle
  \begin{equation}\label{e.distO2}
  i^\N_*Ri^{\N!}N \to N \to Rj^\N_* j^{\N*} N \to.
  \end{equation}
\end{ssect}

Combining the isomorphisms induced from \ref{p.enshr} and \eqref{e.shrLen} by adjunction, we have the following.

\begin{Lemma}\label{p.enus}
  Let $f\colon \cX\to \cY$ be a separated morphism of prime to $\ell$ inertia of Deligne-Mumford $S$-stacks of finite type. Assume either $f$ is a closed immersion, or $\cX$ and $\cY$ are of finite inertia. Then, for all $M\in D(\cY^\N,\Lambda_\bullet)$, the map
  \[e_n^{-1}Rf^{\N!} M\to Rf^! e_n^{-1}M\]
  is an isomorphism.
\end{Lemma}

It follows that $Rf^{\N!}$ preserves AR-null complexes.

\begin{Proposition}
  In the situation of \ref{p.enus}, $Rf^{\N!}$ preserves normalized complexes in $D^+$.
\end{Proposition}

\begin{proof}
  The problem being local for the \'etale topology on $\cX$ and $\cY$, we reduce to two cases: (a) $f$ is a closed immersion; (b) $f$ is a smooth morphism of schemes. Case (a) follows from the distinguished triangle \eqref{e.distO2}. Case (b) follows from the fact that $Rf^{\N!}\simeq f^{\N*}(d)[2d]$, where $d$ is the relative dimension of $f$.
\end{proof}

One checks as in \ref{p.fadic} that $Rf^{\N!}$ preserves AR-adic complexes. It induces
\[Rf^!\colon D^+_c(\cY,\cO)\to D^+_c(\cX,\cO),\]
which sends $\Dbc$ to $\Dbc$.

As in \ref{p.fO}, we have the following.

\begin{Proposition}
  Let $f$ be a morphism of Deligne-Mumford $S$-stacks of finite type, $M\in D^+_c(\cX,\cO)$, $N\in D^+_c(\cY,\cO)$.

  (i) If $f$ is representable and \'etale, then the map
  \[\Lambda_n\otimes^L_\cO Rf_! M \to Rf_!(\Lambda_n\otimes^L_\cO M)\]
  is an isomorphism.

  (ii) If $f$ is separated, $\cX$ and $\cY$ are of finite inertia, then the map
  \[\Lambda_n\otimes^L_\cO Rf_\dag M \to Rf_\dag(\Lambda_n\otimes^L_\cO M)\]
  is an isomorphism.

  (iii) If $f$ is as in \ref{p.enus}, then the map
  \[\Lambda_n\otimes^L_\cO Rf^! N \to Rf^! (\Lambda_n \otimes^L_\cO N)\]
  is an isomorphism.
\end{Proposition}

\begin{ssect}\label{d.distO}
Let $i\colon\cY \to \cX$ be a closed immersion of Deligne-Mumford $S$-stacks of finite type,

$j\colon \cU \to \cX$ be the complementary open immersion. For $M\in D^+_c(\cX,\cO)$, \eqref{e.distO1} and \eqref{e.distO2} induce distinguished triangles
\begin{gather*}
  j_!j^* M \to M \to i_* i^* M \to,\\
  i_*Ri^!M \to M \to Rj_* j^* M \to.
\end{gather*}
\end{ssect}

\begin{Theorem}\label{p.dagO}
  (i) (Base change) Let
  \[\xymatrix{\cX'\ar[r]^h \ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^g & \cY}\]
  be a 2-Cartesian square of Deligne-Mumford stacks, $f$ separated, $\cX$ and $\cY$ of finite type and finite inertia over $S$, $\cY'$ of finite type and finite inertia over some regular scheme $S'$ of dimension $\le 1$. Then, for all $M\in D^+_c(\cX,\cO)$, the map
  \[g^* Rf_\dag M \to Rf'_\dag h^* M\]
  is an isomorphism.

  (ii) (Projection formula) Let $f\colon \cX\to \cY$ be a separated morphism  of Deligne-Mumford $S$-stacks of finite type and finite inertia, $M\in D^+_c(\cX,\cO)$, $N\in D^+_c(\cY,\cO)$. Then the map
  \[N\otimes^L_\cO Rf_\dag M \to Rf_\dag(f^*N\otimes^L_\cO M)\]
  is an isomorphism.
\end{Theorem}

\begin{proof}
  (i) This follows from the construction \ref{s.dagO}.

  (ii) By (i) we may assume that $\cY$ the spectrum of a separably closed field. We may assume furthermore $N=L\pi^* F$, $F$ an $\cO$-module of finite type. It then suffices to take a finite free resolution of~$F$.
\end{proof}

The base change isomorphism constructed in \ref{s.lsO} induces the following by adjunction.

\begin{Proposition}\label{p.usbcO}
  Let
    \[\xymatrix{\cX'\ar[r]^h \ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^g & \cY}\]
  be a 2-Cartesian square of Deligne-Mumford $S$-stacks of finite type and finite inertia, $g$ separated of prime to $\ell$ inertia. Let $M\in D^+_c(\cX,\cO)$. Then the map
  \[Rf'_*Rh^! M \to Rg^! Rf_* M\]
  is an isomorphism.
\end{Proposition}

The isomorphisms \eqref{e.jshradju}, \eqref{e.shradj1}, \eqref{e.dist4} and \eqref{e.shradj2} induce the following.

\begin{Proposition}\label{p.shradjO}
  Let $f$ be a morphism of Deligne-Mumford $S$-stacks of finite type, $K\in \Dbc(\cX,\cO)$, $L\in D^+_c(\cY,\cO)$, $M\in \Dbc(\cY,\cO)$.

  (i) If $f$ is representable and \'etale, then the map
  \[R\cHom_\cY(Rf_!K,L)\to Rf_*R\cHom_\cX(K,f^* L)\]
  is an isomorphism.

  (ii) If $f$ is separated of prime to $\ell$ inertia, and $\cX$ and $\cY$ are of finite inertia, then the map
  \[R\cHom_\cY(Rf_!K,L)\to Rf_*R\cHom_\cX(K,Rf^! L)\]
  is an isomorphism.

  (iii) If $f$ is as in \ref{p.enus}, then the map
  \[R\cHom_\cX(f^*M,Rf^!L)\to Rf^!R\cHom_\cY(M,L)\]
  is an isomorphism.
\end{Proposition}

\begin{ssect}
Let $\Omega_S\in D^b_{AR\text{-}a}(S^\N,\Lambda_\bullet)$ be the object such that $\Omega_S|T=\Lambda_\bullet(d_T)[2d_T]$ for every connected component $T$ of $S$, where $d_T=\dim T$. Then $\Omega_S$ is clearly normalized. For any scheme $X$ separated of finite type over $S$, let $\Omega_X=Ra^{\N!}\Omega_S\in D^b(\cX^\N,\Lambda_\bullet)$, where $a\colon X\to S$ is the structural morphism. Then $\Omega_X$ is AR-adic and normalized. It follows that $R\cHom_{\Lambda_\bullet}(\Omega_X,\Omega_X)\in D^{\ge 0}$ and $\Ext^i_{\Lambda_\bullet}(\Omega_X,\Omega_X)=0$ for $i<0$.

Let $\cX$ be a Deligne-Mumford $S$-stack of finite type. For every \'etale morphism $\alpha\colon X\to \cX$ with $X$ a scheme separated of finite type over $S$, let $h_\alpha\in \cX_\et$ be the sheaf represented by $\alpha$ and $h_{\alpha,\bullet}\in \cX_\et^\N$ be the constant projective system. Then $\cX_\et^\N/h_{\alpha,\bullet}$ can be identified with $X_\et^\N$. For such $\alpha\colon X\to \cX$, we associate $\Omega_X$. For any morphism $f\colon X\to Y$ between such morphisms, there is a canonical isomorphism $f^* \Omega_Y \simto \Omega_X$. Since any finite product of $h_{\alpha,\bullet}$'s can be covered by a family of $h_{\beta,\bullet}$'s, we obtain an object of $D^{[-2d_\cX,0]}$ given $C$-locally, where $C$ is the sieve generated by the $h_{\alpha,\bullet}$'s, $d_\cX=\max_{s\in S}(\dim \cX_s+d_s)$, $d_s$ is the dimension of the closure of $s$ in $S$. By the ``BBD gluing lemma'' \cite[3.2.4]{BBD}, there exists a unique $\Omega_\cX\in D^b(\cX^\N,\Lambda_\bullet)$ such that, for all \'etale morphism $\alpha\colon X\to \cX$ with $X$ a separated finite type $S$-scheme, we have $\alpha^*\Omega_\cX \simeq \Omega_X$. It follows that $\Omega_\cX$ is AR-adic and normalized.

Thus
\[\Lambda_n\otimes^L_\cO \Omega_\cX \simeq e_n^{-1} \Omega_\cX \simeq \Omega_{\cX,n}.\]
Define a triangulated functor $D_\cX\colon \Dbc(\cX,\cO) \to D^+_c(\cX,\cO)$ by $D_\cX M = R\cHom_{\cO}(M,\Omega_\cX)$.
\end{ssect}

\begin{Proposition}\label{p.DO}
  Let $\cX$ be a finite type Deligne-Mumford $S$-stack.
  The functor $D_\cX$ induces a reflexive functor $\Dbc(\cX,\cO)^\op \to \Dbc(\cX,\cO)$ of cohomological amplitude contained in $[-2d_\cX,1]$.
  Moreover, for $M\in \Dbc(\cX,\cO)$, the morphism
  \[\Lambda_n\otimes^L_\cO D_\cX M \to D_{\cX, n} (\Lambda_n\otimes^L_{\cO} M)\]
  is an isomorphism.
\end{Proposition}

\begin{proof}
  The last assertion follows from \ref{p.RcHomO}. For $M\in D^{[a,b]}_c(\cX,\cO)$, $\Lambda_n\otimes^L_\cO M\in D^{[a-1,b]}_c(\cX,\Lambda_n)$.
  By the last assertion and \ref{p.D} (i),
  $\Lambda_n\otimes^L_\cO D_\cX M$ belongs to $D^{[-b-2d_\cX,-a+1]}$ for all $n$. Hence $D_\cX M$ belongs to $D^{[-b-2d_\cX,-a+1]}_c(\cX,\cO)$. Moreover, for all $n$, the following diagram commutes
  \[\xymatrix{\Lambda_n\otimes^L_\cO M\ar[r]\ar[d] & D_{\cX,n}D_{\cX,n} (\Lambda_n\otimes^L_\cO M)\ar[d]^\simeq\\
  \Lambda_n\otimes^L_\cO D_\cX D_\cX M \ar[r]^\simeq & D_{\cX,n} (\Lambda_n\otimes^L_\cO D_\cX M)} \]
  By \ref{p.D} (ii), the top arrow is an isomorphism. Therefore, the map $M \to D_{\cX}D_{\cX} M$ is an isomorphism.
\end{proof}

\begin{ssect}\label{s.fushrO}
Let $f\colon \cX\to \cY$ be a separated morphism of prime to $\ell$ inertia of Deligne-Mumford $S$-stacks of finite type. Assume either $f$ is a closed immersion, or $\cX$ and $\cY$ are of finite inertia.

The isomorphism \ref{p.shradjO} (iii) gives an isomorphism $D_\cX f^* \simto R f^! D_\cY $ of functors $D^b_c(\cY,\cO)\to \Dbc(\cX,\cO)$. Using biduality (\ref{p.DO}), we obtain an isomorphism of functors $\Dbc(\cY,\cO)\to \Dbc(\cX,\cO)$:
\[R f^! \simeq R f^! D_\cY D_\cY \simeq D_\cX f^* D_\cX.\]
\end{ssect}

\begin{ssect}\label{d.fushriekO}
Let $f\colon \cX\to\cY$ be a morphism of finite type Deligne-Mumford $S$-stacks. Thanks to \ref{p.DO}, we can define a triangulated functor
\[Rf^!\colon \Dbc(\cY,\cO)\to \Dbc(\cX,\cO), \quad N \mapsto D_\cX f^* D_\cY N.\]
By \ref{s.fushrO}, this definition is compatible with previous definitions.
For any $N\in \Dbc(\cY,\cO)$, \ref{p.fO} and \ref{p.DO} induce an isomorphism
  \[\Lambda_n\otimes^L_\cO Rf^! N \to Rf^!(\Lambda_n\otimes^L_\cO N).\]
If $f\colon \cX\to \cY$ and $g\colon \cY\to \cZ$ are two such morphisms, then we have an isomorphism of functors $\Dbc(\cZ,\cO)\to \Dbc(\cX,\cO)$:
\[
R(gf)^! = D_\cX (gf)^* D_\cZ  \simeq D_\cX f^* g^* D_\cZ
 \simeq D_\cX f^* D_\cY D_\cY g^* D_\cZ  = Rf^! Rg^!.
\]

If $f$ is smooth, it follows from the construction of $\Omega_\cX$ and $\Omega_\cY$ that $\Omega_\cX\simeq f^*\Omega_\cY(d)[2d]$, where $d$ is the relative dimension of $f$. It follows that \ref{p.fuO} induces an isomorphism of functors $f^*(D_\cY N)(d)[2d]\simeq D_\cX f^*N$ for all $N\in \Dbc(\cY,\cO)$. Thus
\[Rf^!=D_\cX f^* D_\cY \simeq f^*(d)[2d].\]
\end{ssect}

\begin{ssect}\label{s.flshrO}
Let $f\colon\cX\to \cY$ be a morphism of prime to $\ell$ inertia between Deligne-Mumford $S$-stacks of finite type. Assume either (a) $f$ is representable and \'etale, or (b) $f$ is separated and $\cX$ and $\cY$ are of finite inertia.

The isomorphisms \ref{p.shradjO} (i) and (ii) give an isomorphism $D_\cY Rf_! \simto Rf_* D_\cX$ of functors $\Dbc(\cX,\cO)\to \Dbc(\cY,\cO)$. Using biduality (\ref{p.DO}), we obtain an isomorphism of functors $\Dbc(\cX,\cO)\to \Dbc(\cY,\cO)$:
\[Rf_!\simeq D_\cY D_\cY Rf_! \simeq D_\cY Rf_* D_\cX.\]
\end{ssect}

\begin{ssect}\label{d.flshriekO}
Let $f\colon \cX\to \cY$ be a morphism of prime to $m$ inertia between Deligne-Mumford $S$-stacks of finite type. Thanks to \ref{p.DO}, we can define a triangulated functor
\[Rf_!\colon \Dbc(\cX,\cO)\to \Dbc(\cY,\cO), \quad M \mapsto D_\cY Rf_* D_\cX M.\]
By \ref{s.flshrO}, this definition is compatible with previous definitions.
For $M\in D_c^b(\cX,\cO)$, \ref{p.fO} and \ref{p.DO} induce an isomorphism
  \[\Lambda_n\otimes^L_{\cO} Rf_!M \to Rf_! (\Lambda_n\otimes^L_\cO M).\]
If $f\colon \cX\to \cY$ and $g\colon \cY\to \cZ$ are two such morphisms, then we have an isomorphism of functors $\Dbc(\cX,\cO)\to \Dbc(\cY,\cO)$:
\[
  R(gf)_! = D_\cZ R(gf)_* D_\cX \simeq D_\cZ Rg_* Rf_* D_\cX
  \simeq D_\cZ Rg_* D_\cY D_\cY Rf_* D_\cX = Rg_! Rf_!.
\]
\end{ssect}

\section{Variants and complements}
In \ref{d.E} through \ref{s.Eke}, let $S$ be a regular scheme of dimension $\le 1$.

\begin{ssect}\label{d.E}
Let $E$ be a discrete valuation field of characteristic $0$ and residue characteristic $\ell$ invertible on $S$, let $\cO$ be its ring of integers. For $\cX$ a finite type Deligne-Mumford $S$-stack, let $\cT$ be the full subcategory of $\Mod_c(\cX,\cO)$ consisting of sheaves annihilated by some power of $\ell$. Then $\cT$ is a thick subcategory and we define $\Mod_c(\cX, E)$ to be the quotient $\Mod_c(\cX,\cO)/\cT$. We have $\Mod_c(\cX, E)\simeq \Mod_c(\cX,\cO)\otimes_\cO E$. Let $D^+_\cT$ be the full subcategory of $D^+_c(\cX,\cO)$ consisting of complexes whose cohomology sheaves belong to $\cT$. Then $D^+_\cT$ is a thick triangulated subcategory and we define $D^+_c(\cX,E)$ to be the quotient $D^+_c(\cX,\cO)/D^+_\cT$. The canonical t-structure on $D^+_c(\cX,\cO)$ induces a canonical t-structure on $D^+_c(\cX,E)$, which has heart $\Mod_c(\cX,E)$ and enables us to define $D^b(\cX,E)$. We have $D^b_c(\cX,E)\simeq D^b_c(\cX,\cO)\otimes_\cO E$. We denote the image of $M$ under the canonical functor $D^+_c(\cX,\cO)\to D^+_c(\cX,E)$ by $E\otimes_\cO M$.

The functors $-\otimes_\cO -$, $R\cHom_\cO(-,-)$, $D_\cX$ in \S~4 induce functors
\begin{gather*}
-\otimes_E-\colon D^+_c(\cX,E) \times D^+_c(\cX,E) \to D^+_c(\cX,E),\\
R\cHom_E(-,-)\colon D^b_c(\cX,E)^\op \times D^+_c(\cX,E) \to D^+_c(\cX,E),
\end{gather*}
and a reflexive triangulated functor
\[D_\cX\colon \Dbc(\cX,E)^\op \to \Dbc(\cX,E).\]
Let $f\colon \cX\to \cY$ be a morphism of finite type Deligne-Mumford $S$-stacks. The functors $f^*$ and $Rf_*$ in \S~4 induce functors
\[f^*\colon D^+_c(\cY,E)\to D^+_c(\cX,E), \quad Rf_*\colon D^+_c(\cX,E)\to D^+_c(\cY,E).\]
If $f$ is separated and $\cX$ and $\cY$ are of finite inertia, then the functor $Rf_\dag$ in \S~4 induces a functor
\[Rf_\dag\colon D^+_c(\cX,E)\to D^+_c(\cY,E).\]

\end{ssect}

\begin{Proposition}\label{p.finE}
  Let $f\colon \cX\to \cY$ be a morphism of finite type Deligne-Mumford $S$-stacks. Assume that the fibers of $f$ have dimension $\le d$. Then

  (i) $Rf_*$ sends $\Dbc(\cX,E)$ to $\Dbc(\cY,E)$. Moreover, if $f$ is proper, then the cohomological amplitude of $Rf_*$ is contained in $[0,2d]$.

  (ii) If $f$ is separated and $\cX$ and $\cY$ are of finite inertia, then $Rf_\dag$ sends $\Dbc(\cX,E)$ to $\Dbc(\cY,E)$ and has cohomological amplitude contained in $[0,2d]$.
\end{Proposition}

\begin{proof}
(i) We may assume $\cY$ is a scheme. For the first assertion, using reductions as in \ref{p.cdim} (i), we may assume $\cX$ separated over $S$. Then, for both assertions, since $f$ factors through the coarse space of $\cX$, we are reduced to two cases: (a) $f$ is a universal homeomorphism; (b) $f$ is representable. Case (b) is known. In case (a), by proper base change, we may assume that $\cY$ is the spectrum of an algebraically closes field. Then $\cX^\red\simeq BG$ and the assertions are clear.

(ii) By base change (\ref{p.dagO} (i)), we may assume that $\cY$ is the spectrum of a field. The assertion then follows from the decomposition \ref{p.comp} and (i).
\newcommand{\oldprooffinE}{The proof is similar to the proof of \ref{p.fin}. We proceed by induction on $\dim \cX$. Up to replacing $\cY$ by an \'etale presentation, we may assume that $\cY$ is an $S$-scheme. Moreover, we may assume that $\cX$ is reduced. Let $M\in \Dbc(\cX,E)$. By \cite[6.1.1]{LMB}, there exists a dense open substack of $\cX$ of the form $[X/G]$, where $X$ is an affine scheme and $G$ is a finite group acting on it. Shrinking $X$ if necessary, we may assume that $G/G_0$ acts freely on $X$, where $G_0=\Ker(G\to \Aut(X))$. Let $\cX'$ be the complement of $[X/G]$ in $\cX$, endowed with the reduced structure, $i\colon \cX'\to \cX$ and $j\colon [X/G]\to \cX$ be the inclusions. The distinguished triangle \eqref{e.distO2}
\[i_*Ri^!M \to M \to Rj_* j^* M \to\]
induces a distinguished triangle
\[Rf_*i_*Ri^!M \to M \to Rf_*Rj_* j^* M \to.\]
Applying \ref{p.finO} to $j$, we get $Rj_* j^* M\in \Dbc(\cX,E)$, hence we have $i_*Ri^!M\in \Dbc(\cX,E)$ and, in turn, $Rf_*i_*Ri^!M \simeq R(fi)_* Ri^! M \in \Dbc(\cY,E)$ by induction hypothesis. Therefore, it suffices to show $R(fj)_* M \simeq Rf_*Rj_* j^* M \in \Dbc(\cY,\Lambda)$. Note that $fj$ is the composite map
\[[X/G]\xrightarrow{q} [X/(G/G_0)] \simto X/G \xrightarrow{g} \cY.\]
Since $E$ has characteristic $0$, $Rq_*$ has cohomological amplitude $0$. We conclude by applying \ref{p.finO} to $Rg_*$.}
\end{proof}

\begin{Proposition}\label{p.luE}
  Let $f\colon \cX\to \cY$ be a universal homeomorphism (\ref{s.uh}) of Deligne-Mumford $S$-stacks of finite type, $L\in D^+_c(\cY,E)$. Then the adjunction map $L\to Rf_*f^* L$ is an isomorphism.
\end{Proposition}

\begin{proof}
  By proper base change, we may assume that $\cY$ is the spectrum of an algebraically closed field. Then $\cX^\red\simeq BG$ and the assertion is clear.
\end{proof}

\newcommand{\uhsfive}{
For $N\in D^+_c(\cX,E)$ and $L$ as above, this allows us to define the map
\[\Hom_\cX(N,f^*L)\to \Hom_\cY(Rf_* N,Rf_* f^* L)\simeq \Hom_\cY(Rf_*N, L).\]
Gluing with the inverse of \ref{p.shradjO} (ii), we get, for every separated morphism $f\colon \cX\to \cY$ of Deligne-Mumford $S$-stacks of finite type and finite inertia, a map
\begin{equation}\label{e.shradjx}
\Hom_\cX(N,Rf^! L)\to \Hom_\cY(Rf_! N,L).
\end{equation}

\begin{Proposition}\label{p.shradjE}
  Let $f\colon \cX\to \cY$ be a separated morphism of Deligne-Mumford $S$-stacks of finite type and finite inertia, $K\in \Dbc(\cX,E)$, $L,M\in \Dbc(\cY,E)$. Then the map
  \[Rf_*R\cHom_\cX(K,Rf^! L) \to R\cHom_\cY(Rf_! K,L)\]
  induced from \eqref{e.shradjx} by adjunction and projection formula \ref{p.dagO} (ii) as in the proof of \eqref{e.shradj1}, is an isomorphism.
\end{Proposition}

\begin{proof}
  By \eqref{e.shradj1}, we may assume that $f$ is a universal homeomorphism. We may assume furthermore that $K=Rk_! \cF$, where $k$ sits in the 2-Cartesian square
  \[\xymatrix{\cX'\ar[r]^k\ar[d]^{f'} & \cX\ar[d]^f\\
  \cY'\ar[r]^j & \cY}\]
  $j$ a an immersion, $\cF\in Mod_c(\cX',E)$ is lisse and $Rj_! \cF$ is lisse. Then the following diagram commutes
  \[\xymatrix{Rf_*R\cHom_\cX(Rk_! \cF,f^*L)\ar[d]^{A_1}\ar[r] & R\cHom_\cY(Rf_*Rk_! \cF, L)\ar[d]^{\simeq}\\
  Rf_* Rk_* R\cHom_{\cX'}(\cF,k^*f^* L)\ar[d]^{\simeq} & R\cHom_\cY(Rj_!Rf'_* \cF,L)\ar[d]^{A_2}\\
  Rj_*Rf'_*R\cHom_{\cX'}(\cF,f'{}^*j^* L)\ar[r] & Rj_*R\cHom_{\cY'}(Rf'_* \cF,j^* L)}\]
  Here $A_1$ and $A_2$ are \eqref{p.shradjO} (ii). Thus we may assume $K\in \Mod_c(\cX,E)$ lisse and $Rf_* K$ lisse. In this case, let $j\colon \cY'\to \cY$ be a geometric point of $\cY$ and form a 2-Cartesian square as above. Then the following diagram commutes
  \[\xymatrix{j^*Rf_*R\cHom_{\cX}(K,f^*L)\ar[r]\ar[d]^{B_1} & j^* R\cHom_\cY(Rf_! K,L)\ar[d]^{C_2}\\
  Rf'_*k^*R\cHom_\cX(K,f^* L)\ar[d]^{C_1} & R\cHom_{\cY'}(j^*Rf_!K,j^* L)\\
  Rf'_*R\cHom_{\cX'}(k^*,k^*f^* L)\ar[d]^\simeq & R\cHom_{\cY'}(Rf'_! k^* K,j^*L)\\
  Rf'_*R\cHom_{\cX'}(k*K,f'{}^*j^*L)\ar[ru]}\]
  Here $B_1$ and $B_2$ are proper base change, $C_1$ and $C_2$ are \ref{p.fuO}. Thus we may assume that $\cY$ is the spectrum of an algebraically closed field. Then $\cX^\red=BG$ and may assume $L=E$. Then the map in question is $F\colon (K\spcheck)^G \to (K^G)\spcheck$. Let $T\colon (K^G)\spcheck \to (K\spcheck)^G$ be the trace map induced by $\sum_{g\in G} g$. Then $FT=TF=n$, where $n$ is the order of $G$ and is invertible in $E$. Therefore, $F$ is an isomorphism.
\end{proof}

\begin{ssect}\label{s.shradjE}
In the situation of \ref{p.shradjE}, we have an isomorphisms of functors $\Dbc(\cX,E)\to \Dbc(\cY,E)$: $Rf_* D_\cX \simeq D_\cY Rf_!$ and
\[Rf_!\simeq D_\cY D_\cY Rf_! \simeq D_\cY Rf_* D_\cX.\]
\end{ssect}
}

\begin{ssect}
Let $f$ be a morphism of Deligne-Mumford $S$-stacks of finite type. The functor $Rf^!$ in \ref{d.fushriekO} induces a functor
\[Rf^!\colon \Dbc(\cY,E) \to \Dbc(\cX,E).\]
The finiteness of $Rf_*$ (\ref{p.finE}) enables us to define a functor
\[Rf_!\colon \Dbc(\cX,E)\to \Dbc(\cY,E), \quad M \mapsto D_\cY Rf_* D_\cX M.\]

If $f\colon \cX\to \cY$ and $g\colon \cY\to \cZ$ are two such morphisms, then
\[
R(gf)_! = D_\cZ R(gf)_* D_\cX \simeq D_\cZ Rg_* Rf_* D_\cX
\simeq D_\cZ Rg_* D_\cY D_\cY Rf_* D_\cX = Rg_! Rf_!.
\]

If $f$ is separated and $\cX$ and $\cY$ are of finite inertia, then $Rf_!$ is the restriction of $Rf_\dag$ to $\Dbc$. In fact, using the decomposition \ref{p.comp} of $f$, we are reduced to two cases: (a) $f$ proper and quasi-finite, (b) $f$ representable. In case (a), one can repeat the argument of \cite[5.15]{OlssonFuji}. Case (b) follows from \ref{s.flshrO}.
\end{ssect}

\begin{ssect}\label{d.Eplus}
  Finally let $E'$ be an algebraic extension of $E$. Define $\Mod_c(\cX,E')$ to be the 2-inductive limit of $\Mod_c(\cX,E'')$, $D^+_c(\cX,E')$ to be the 2-inductive limit of $D^+_c(\cX,E'')$, where $E''$ runs over all finite extensions of $E$ contained in $E'$. Then $D^+_c(\cX,E')$ admits the same operations as $D^+_c(\cX,E)$.
\end{ssect}

\begin{ssect}\label{s.Eke}
  Let $\cO$ be as in \S~4, $X$ be a scheme separated of finite type over $S$. In \cite[\S~6]{Ekedahl}, Ekedahl constructs a category $\Dbc(X,\cO)_{\mathrm{Ek}}$ and the six operations on it. By \ref{s.endthree} and \cite[2.7 ii)]{Ekedahl}, the normalization functor induces an equivalence of categories $\Dbc(X,\cO)\to \Dbc(X,\cO)_{\mathrm{Ek}}$. The six operations in \S~4 and the six operations of Ekedahl are compatible via this equivalence.
\end{ssect}

\begin{ssect}\label{s.Gabber}
  Let $S$ be a Noetherian quasi-excellent scheme of finite dimension. By Gabber's finiteness theorem \cite{Gabberfin}, the direct construction of the six operations in \ref{p.tensoradic} through \ref{p.shradjO} and \ref{d.E} through \ref{p.luE} can be carried out over $S$. Moreover, if $S$ is excellent and admits a global dimension function, then Gabber's duality theorem allows one to carry out the construction by duality in \S\S~2, 4 and~5.
\end{ssect}

\section{Application to Brauer theory}

Let $\cO$ be a complete discrete valuation ring with fraction field $E$ of characteristic $0$ and residue field $F$ of characteristic $\ell >0$, $\fm$ be the maximal ideal of $\cO$. Note that for any field $F$ of characteristic $\ell>0$, any Cohen ring of $F$ satisfies the condition for~$\cO$. For any $\F$-module (resp.\ $\cO$-module, resp.\ $E$-module) $M$ of finite type, we endow $M$ with the unique Hausdorff topology such that $M$ is a topological module. For a profinite group~$G$, we define a \emph{coherent $F[G]$-module} (resp.\ \emph{$\cO[G]$-module}, resp.\ \emph{$E[G]$-module}) to be an $\F$-module (resp.\ $\cO$-module, resp.\ $E$-module) of finite type endowed with a continuous $\F$-linear (resp.\ $\cO$-linear, resp.\ $E$-linear) action of $G$, and we denote by $K(G, \F)$ (resp.\ $K(G,\cO)$, resp.\ $K(G,E)$) the Grothendieck group of the category of such modules. Let $i\colon \Spec \F\to \Spec \cO$, $j\colon \Spec E\to \Spec \cO$. Then we have homomorphisms $i_*\colon K(G,\F)\to K(G,\cO)$ defined by restriction of scalars, and $j^*\colon K(G, \cO)\to K(G,E)$ defined by extension of scalars $[M]\mapsto [E\otimes_\cO M]$.

\begin{Lemma}\label{p.Brauer}
We have $i_*=0$ and $j^*$ is an isomorphism.
\end{Lemma}

\begin{proof}
We claim that the localization sequence
\[K(G,\F)\xrightarrow{i_*} K(G,\cO)\xrightarrow{j^*} K(G,E) \to 0 \]
is exact.  It is clear that $j^* i_* = 0$. Define a homomorphism $s\colon K(G,E)\to K(G,\cO)/\Img i_*$ by sending the class of an $E[G]$-module $M$ to the class of any $G$-stable $\cO$-lattice $L$ of $M$. If $L_1$ and $L_2$ are two $G$-stable lattices of $M$, then $[L_1]-[L_2]$ belongs to $\Img i_*$. Indeed, we may assume $L_1\subset L_2$, in which case $L_1/L_2$ is killed by a power of $\fm$, hence its class belongs to $\Img i_*$. If $0\to M' \xrightarrow{f} M \xrightarrow{g} M''\to 0$ is a short exact sequence of $E[G]$-modules, $L$ is a $G$-stable $\cO$-lattice of $M$, then $f^{-1}(L)$ is a lattice of $M$ and $g(L)$ is a lattice of $M''$. Hence $s$ is well-defined. It is clearly an inverse of the map $K(G,\cO)/\Img i_* \to K(G,E)$ induced by $j^*$.

It remains to show $i_*=0$. By \cite[chap.~16, th.~33]{Serre}, the decomposition map $d\colon K(G,E) \to K(G,\F)$, characterized by $d[j^*M]=[i^* M]$ for $M$ torsion-free, is surjective. Hence it suffices to verify that for any torsion-free coherent $\cO[G]$-module $M$, we have $i_*[M/\fm M]=0$, which is trivial.
\end{proof}

Let $S$ be a regular scheme of dimension $\le 1$ on which $\ell$ is invertible, $\cX$ be a finite type Deligne-Mumford $S$-stack $\cX$. We denote by $K(\cX, \F)$ (resp.\ $K(\cX,\cO)$, resp.\ $K(\cX,E)$) the Grothendieck group of $\Mod_c(\cX,F)$ (resp.\ $\Mod_c(\cX,\cO)$, resp.\ $\Mod_c(\cX,E)$). We denote by $i_*\colon K(\cX,F)\to K(\cX,\cO)$ the homomorphism induced by the exact restriction of scalars functor $e_{0*}\colon \Mod_c(\cX,F)\to\Mod_c(\cX,\cO)$, by $j^*\colon K(\cX,\cO)\to K(\cX,E)$ the homomorphism induced by the exact functor (\ref{d.E})
\[\Mod_c(\cX,\cO)\to \Mod_c(\cX,E), \quad M\mapsto E\otimes_\cO M,\]
and by $i^*\colon K(\cX,\cO)\to K(\cX,F)$ the homomorphism induced by the triangulated functor (\ref{s.endthree})
\[\Dbc(\cX,\cO)\to \Dbc(\cX,\F), \quad M\mapsto F\otimes^L_\cO M.\]

\begin{Proposition}\label{p.BrauerX}
(a) $i_*=0$ and $j^*$ is an isomorphism.

(b) $i^*$ is a surjection.
\end{Proposition}

\begin{proof}
(a) We claim that the localization sequence
\[K(\cX,\F)\xrightarrow{i_*} K(\cX,\cO)\xrightarrow{j^*} K(\cX,E) \to 0 \]
is exact. Since $E\otimes_\cO (e_{0*}M) =0$ for all $M\in \Mod_c(\cX,F)$, we have $j^*i_* = 0$. Define a homomorphism
\[s\colon K(\cX,E)\to K(\cX,\cO)/\Img i_*, \quad [E\otimes_\cO M] \mapsto [M].\]
Note that if $M\in \Mod_c(\cX,\cO)$ satisfies $E\otimes_\cO M= 0$ in $\Mod_c(\cX,E)$, then its class in $K(\cX,\cO)$ belongs to $\Img i_*$. If
\[0\to E\otimes_\cO M'\xrightarrow{f} E\otimes_\cO M \xrightarrow{g} E\otimes_\cO M''\to 0\]
is a short exact sequence in $\Mod_c(\cX,E)$, then there exists an integer $n\ge 0$, $f_\cO\colon M'\to M$ and $g_\cO\colon M\to M''$ such that $\ell^n f=E\otimes_\cO f_\cO$ and $\ell^n g=E\otimes_\cO g_\cO$. Since $E\otimes_\cO \Ker f_\cO$, $E\otimes_\cO (\Img f_\cO/\Img f_\cO \cap \Ker g_\cO)$, $E\otimes_\cO (\Ker g_\cO/\Img f_\cO \cap \Ker g_\cO)$ and $E\otimes_\cO \Coker g_\cO$ are all zero objects of $\Mod_c(\cX,E)$, it follows that $[M']-[M]+[M'']$ belongs to $\Img v$. Hence $s$ is well defined. It is clearly an inverse of the map $K(\cX,\cO)/\Img i_* \to K(\cX,E)$ induced by $j^*$.

It remains to show $i_*=0$. Note that the abelian group $K(\cX,F)$ is generated by elements of the form $[f_! M]$, where $f\colon \cY\to \cX$ is an immersion, $\cY$ is integral, $M\in \Mod_c(\cY,F)$ is lisse. For such $f$, we have a 2-commutative diagram
\[\xymatrix{\Mod_\lisse(\cY,F)\ar[r]^{i_*}\ar[d]^{f_!}& \Mod_\lisse(\cY,\cO)\ar[d]^{f_!}\\
\Mod_c(\cX,F)\ar[r]^{i_*}& \Mod_c(\cX,\cO)}\]
which induces a commutative diagram
\[\xymatrix{K(G,F)\ar[r]^{i_*}\ar[d] & K(G,\cO)\ar[d]\\
K(\cX,F)\ar[r]^{i_*}& K(\cX,\cO)}\]
where $G$ is a fundamental group of $\cY$. We conclude by applying the fact $i_*=0$ from Brauer theory (\ref{p.Brauer}).

(b) For $f$ and $G$ as before, we have a commutative diagram
\[\xymatrix{K(G,\cO)\ar[r]^{j^*}_\sim \ar[d] & K(G,E)\ar[r]^d & K(G,F)\ar[d]\\
K(\cX,\cO)\ar[rr]^{i^*}&& K(\cX,F)}\]
where the vertical maps are induced by $f_!$.

It then suffices to apply the fact that $d$ is surjective from Brauer theory.
\end{proof}

\begin{ssect}
Let us recall Laumon's theorem on Euler-Poincar\'e characteristics \cite[\S~2]{Illusie-Zheng}. We denote by $\Kt(\cX,E)$ the quotient
of $K(\cX,E)$ by the ideal generated by $[E(1)]-[E]$, and by $x\sptilde{}$
the image in $\Kt(\cX, E)$ of an element $x$ of $K(\cX, E)$. We denote by $\Kt(\cX,F)$ the quotient
of $K(\cX,F)$ by the ideal generated by $[F(1)]-[F]$, and by $x\sptilde{}$
the image in $\Kt(\cX, F)$ of an element $x$ of $K(\cX, F)$.

Let $f\colon \cX \to \cY$ be a morphism of Deligne-Mumford $S$-stacks of finite type, the triangulated functors
\[Rf_*, Rf_! \colon \Dbc(\cX,E) \to \Dbc(\cY,E) \]
induce homomorphisms
\[f_*, f_! \colon K(\cX,E) \to K(\cY, E) \]
and
\[f_*, f_! \colon \Kt(\cX,E) \to \Kt(\cY, E) \]
by passing to quotients.

If $f$ is of prime to $\ell$ inertia, then
the triangulated functors
\[Rf_*, Rf_! \colon \Dbc(\cX,F) \to \Dbc(\cY,F) \]
induce homomorphisms
\[f_*, f_! \colon K(\cX,F) \to K(\cY, F) \]
and
\[f_*, f_! \colon \Kt(\cX,F) \to \Kt(\cY, F) \]
by passing to quotients.
\end{ssect}

\begin{Theorem}
(a) For any $x\in K(\cX,E)$, we have $f_*(x\sptilde{}) = f_!(x\sptilde{})$ in $\Kt(\cY,E)$.

(b) Assume $f$ has prime to $\ell$ inertia. Then, for any $x\in K(\cX,F)$, we have $f_*(x\sptilde{}) = f_!(x\sptilde{})$ in $\Kt(\cY,F)$.
\end{Theorem}

In \emph{loc.\ cit.}, the two assertions are proven using similar methods. With the help of \ref{p.BrauerX}, we can deduce (b) from (a) as follows. Let $f$ be as in (b). We have a 2-commutative diagram of triangulated categories and triangulated functors (\ref{p.fO})
\[\xymatrix{\Dbc(\cX,E)\ar[d]^{Rf_*} & \Dbc(\cX,\cO)\ar[l]^{E\otimes_\cO -} \ar[r]^{F\otimes^L_\cO-} \ar[d]^{Rf_*} & \Dbc(\cX,\F)\ar[d]^{Rf_*}\\
  \Dbc(\cY,E) & \Dbc(\cY,\cO)\ar[l]^{E\otimes_\cO -} \ar[r]^{F\otimes^L_\cO-} & \Dbc(\cY,\F)}\]
which induces a commutative diagram of abelian groups and homomorphisms
\[\xymatrix{K(\cX,E)\ar[d]^{f_*} & K(\cX,\cO)\ar[l]^{j^*}_\sim \ar[r]^{i^*}\ar[d]^{f_*} & K(\cX,\F)\ar[d]^{f_*}\\
  K(\cY,E) & K(\cY,\cO)\ar[l]^{j^*}_\sim \ar[r]^{i^*} & K(\cY,\F) }\]
and a similar one for $K\sptilde{}$. Similar statements hold for $Rf_!$. Therefore, by \ref{p.BrauerX}, (a) implies (b).

\section{Appendix: Compactification and gluing}

In \cite[XVII]{SGA4}, Deligne studied the gluing of two fibered categories in order to define $Rf_!$ for a compactifiable morphism $f$ of schemes. Two issues prevent us from applying this formalism to Deligne-Mumford stacks: stacks form a 2-category; compactification of coarse spaces only allow us to decompose a morphism into three morphisms (\ref{p.comp}).

To address the first issue, we use the language of pseudo-functors between 2-categories. Since a cofibered category over a category $\cC$ can be seen as a pseudo-functor from $\cC$ to the 2-category of categories by means of a cleavage, this gives a natural generalization of Deligne's formalism. In fact, we show in \ref{p.glue} that the gluing of two pseudo-functors works as in \cite[XVII 3.3.2]{SGA4} without much modification.

To address the second issue, we study the gluing of a finite number of pseudo-functors (\ref{s.gdn}). The main result of this appendix is the gluing theorem \ref{p.glue'}, which generalizes \ref{p.glue} to more than two pseudo-functors. The key ingredient of the proof is an alternative set of gluing data (\ref{d.gdp}, \ref{d.gdp'}) which only makes use of 2-Cartesian squares.

At the end of this appendix (\ref{s.adj} through \ref{p.GAB}), we show that certain maps defined by adjunction satisfy the axioms for gluing data.

We work systematically with 2-categories. For basic notions of 2-categories, see \cite[Ch.~7]{Borceux}. As in the main text of this article, for 2-fiber products in a 2-category, we use the convention of \cite[1.2.12]{GabberR} for 2-limits, which are called pseudo-bilimits in \cite[7.7]{Borceux}.

\begin{ssect}\label{s.faith}
  Let $\cC$ and $\cD$ be 2-categories and $F\colon \cC\to \cD$ be a 2-functor. We say that $F$ is \emph{pseudo-faithful} (resp.\ \emph{2-faithful}, resp.\ \emph{2-fully faithful}) if for every pair of objects $X$ and $Y$ of $\cC$, the functor
  \[  F_{XY}\colon\cC(X,Y)\to \cD(X,Y) \]
  is fully faithful (resp.\ fully faithful and injective on objects, resp.\ an isomorphism of categories).  We say that a 2-subcategory of a 2-category is 2-faithful if the inclusion 2-functor is 2-faithful.

  Let $\cD$ be a 2-category. A \emph{$\cD$-category} is a pair $(\cC,F)$ consisting of a 2-category $\cC$ and a 2-functor $F\colon \cC\to \cD$. If $(\cB,E)$ and $(\cC,F)$ are $\cD$-categories, a \emph{$\cD$-functor} $(\cB,E)\to(\cC,F)$ is a 2-functor $G\colon \cB\to \cC$  such that $E=FG$. If $G,H\colon \cB\to \cC$ are $\cD$-functors, a \emph{$\cD$-natural transformation} is a 2-natural transformation $\alpha\colon G\Rightarrow H$ such that $F\alpha\colon FG\to FH$ is $\one_E$. A \emph{$\cD$-natural equivalence} is a $\cD$-natural transformation $\alpha$ that is a 2-natural equivalence. In this case $\alpha^{-1}$ is automatically a $\cD$-natural equivalence. We say that a $\cD$-functor $G\colon \cB\to \cC$ is a \emph{$\cD$-equivalence} if there exist a $\cD$-functor $H\colon \cC\to \cB$ and $\cD$-natural equivalences $\one_\cC\Rightarrow GH$ and $HG\Rightarrow \one_\cB$. In this case we say that $G$ and $H$ are \emph{$\cD$-quasi-inverse} to each other.

  A $\cD$-functor $G\colon \cB\to \cC$ is a $\cD$-equivalence if and only if it is 2-fully faithful and every object $Y$ of $\cC$ is in the $\cD$-essential image of $G$, namely, there exists an object $X$ of $\cB$ and an invertible 1-cell $GX\to Y$ of $\cC$ whose image in $\cD$ is an identity.
\end{ssect}

\begin{ssect}
  Let $C$ be a set and $\cD$ be a 2-category. We view $C$ as a discrete 2-category and denote by $\twoFun(C,\cD)$ the 2-category of 2-functors $C\to \cD$. An object of this category is a map $C\to \Ob(\cD)$. A 1-cell $\alpha\colon F\to F'$ is a family
  \[\left(\alpha(X)\colon FX \to F'X\right)_{X\in C}\]
  of 1-cells of $\cD$. A 2-cell $\Xi\colon \alpha \Rightarrow \beta$ is a family
  \[\left(\Xi(X)\colon \alpha(X) \Rightarrow \beta(X)\right)_{X\in C}\]
  of 2-cells of $\cD$.

  Let $\cC$ and $\cD$ be 2-categories. We denote by $\PsFun(\cC,\cD)$ the 2-category of pseudo-functors $\cC \to \cD$ and view it as a $\twoFun(\Ob(\cC),\cD)$-category via the forgetful functor
  \[\lvert -\rvert\colon \PsFun(\cC,\cD)\to \twoFun(\Ob(\cC),\cD)\]
  The strict fiber 2-categories are 1-categories, that is, 2-categories whose only 2-cells are identities.

  A \emph{$(2,1)$-category} is a 2-category whose 2-cells are invertible.
\end{ssect}

\begin{Definition}\label{s.gd}
  Let $\cC$ be a $(2,1)$-category, $\cA$ and $\cB$ be two 2-faithful subcategories of $\cC$ with $\Ob(\cA)=\Ob(\cB)=\Ob(\cC)$, $\cD$ be a 2-category. Define the 2-category $\GD_{\cA,\cB}(\cC,\cD)$ of \emph{gluing data} from $\cC$ to $\cD$ relative to $\cA$ and $\cB$ as follows. An object of this category is a triple $\left(F_\cA,F_\cB,(G_D)\right)$ consisting of an object $F_\cA$ of $\PsFun(\cA,\cD)$, an object $F_\cB$ of $\PsFun(\cB,\cD)$ satisfying $\lvert F_\cA \rvert = \lvert F_\cB \rvert$, and a family of invertible 2-cells of~$\cD$
  \[G_D\colon F_\cA(i)F_\cB(q) \Rightarrow F_\cB(p)F_\cA(j),\]
  $D$ running over squares in $\cC$ of the form
  \begin{equation}\label{e.2}
  \xymatrix{X\ar[r]^j\ar[d]^q\drtwocell\omit{^\alpha} & Y \ar[d]^p\\
  Z\ar[r]^i & W}
  \end{equation}
  where $i,j$ are 1-cells of $\cA$ and $p,q$ are 1-cells of $\cB$. The triple is subject to the following conditions:
  \begin{description}
    \item[(a)]
    If $D$ is the square
  \[
  \xymatrix{X\ar@{=}[d]\ar[r]^j\drtwocell\omit{^\alpha} & Y \ar@{=}[d]\\
  X\ar[r]^i & Y}
  \]
  then the following square commutes
  \[\xymatrix{F_\cA(i)\ar@=[r]^{F_\cA(\alpha)}\ar@=[d] & F_\cA(j)\ar@=[d]\\
  F_\cA(i)F_\cB(\one_X)\ar@=[r]^{G_D} & F_\cB(\one_Y)F_\cA(j)}\]
    \item[(a')]
    If $D$ is the square
  \[\xymatrix{X\ar@{=}[r]\ar[d]^q\drtwocell\omit{^\alpha} & X \ar[d]^p\\
  Y\ar@{=}[r] & Y}\]
  then the following square commutes
  \[\xymatrix{F_\cB(q)\ar@=[r]^{F_\cB(\alpha)}\ar@=[d] & F_\cB(p)\ar@=[d]\\
  F_\cA(\one_Y)F_\cB(q)\ar@=[r]^{G_D} & F_\cB(p)F_\cA(\one_X)}\]
    \item[(b)]
    If $D$, $D'$, $D''$ are respectively the upper, lower and outer squares of the diagram
  \[\xymatrix{X_1\ar[r]^{i_1}\ar[d]^{q}\drtwocell\omit{^\alpha} &  Y_1\ar[d]^{p}\\
  X_2\ar[r]^{i_2}\drtwocell\omit{^\alpha'}\ar[d]^{q'} & Y_2\ar[d]^{p'}\\
  X_3\ar[r]^{i_3} & Y_3}\]
    then the following pentagon commutes
    \[\xymatrix{F_{\cA}(i_3)F_\cB(q')F_\cB(q)\ar@=[r]^{G_{D'}}\ar@=[d]& F_\cB(p')F_\cA(i_2)F_\cB(q)\ar@=[r]^{G_{D}}& F_\cB(p')F_\cB(p)F_\cA(i_1)\ar@=[d]\\
    F_\cA(i_3)F_\cB(q'q)\ar@=[rr]^{G_{D''}} & & F_\cB(p'p)F_\cA(i_1)}\]
    \item[(b')]
    If $D$, $D'$, $D''$ are respectively the left, right and outer squares of the diagram
  \[\xymatrix{X_1\ar[r]^j\ar[d]^{p_1}\drtwocell\omit{^\alpha} &  X_2\ar[d]^{p_2}\ar[r]^{j'}\drtwocell\omit{^\alpha'} & X_3\ar[d]^{p_3}\\
  Y_1\ar[r]^i & Y_2\ar[r]^{i'} &Y_3}\]
    then the following pentagon commutes
    \[\xymatrix{F_{\cA}(i')F_\cA(i)F_\cB(p_1)\ar@=[r]^{G_D}\ar@=[d]& F_\cA(i')F_\cB(p_2)F_\cA(j)\ar@=[r]^{G_{D'}}& F_\cB(p_3)F_\cA(j')F_\cA(j)\ar@=[d]\\
    F_\cA(i'i)F_\cB(p)\ar@=[rr]^{G_{D''}} & & F_\cB(p_3)F_\cA(j'j)}\]
  \end{description}

  A 1-cell $(F_\cA,F_\cB,G)\to (F'_\cA,F'_\cB,G')$ of $\GD_{\cA,\cB}(\cC,\cD)$ is a pair
  $(\alpha_\cA,\alpha_\cB)$ consisting of a 1-cell $\alpha_\cA\colon F_\cA \to F'_\cA$ of $\PsFun(\cA,\cD)$ and a 1-cell $\alpha_\cB\colon F_\cB \to F'_\cB$ of $\PsFun(\cB,\cD)$ such that $\lvert \alpha_\cA\rvert = \lvert \alpha_\cB \rvert$  and that for any square $D$ \eqref{e.2}, the following hexagon commutes
  \begin{equation}\label{e.gdmor}
  \xymatrix{\alpha_0(W)F_\cA(i)F_\cB(q)\ar@=[d]^{G_D}\ar@=[r]^{\alpha_\cA(i)}
  & F'_\cA(i)\alpha_0(Z)F_\cB(q)\ar@=[r]^{\alpha_\cB(q)}
  & F'_\cA(i)F'_\cB(q)\alpha_0(X)\ar@=[d]^{G'_D}\\
  \alpha_0(W)F_\cB(p)F_\cA(j)\ar@=[r]^{\alpha_\cB(p)}
  & F'_\cB(p)\alpha_0(Y)F_\cA(j)\ar@=[r]^{\alpha_\cA(j)}
  & F'_\cB(p)F'_\cA(j)\alpha_0(X)}
  \end{equation}
  where $\alpha_0=\lvert \alpha_\cA\rvert = \lvert \alpha_\cB \rvert$.

  A 2-cell of $\GD_{\cA,\cB}(\cC,\cD)$ is a pair $(\Xi_\cA,\Xi_\cB)\colon (\alpha_\cA,\alpha_\cB)\Rightarrow (\alpha'_\cA,\alpha'_\cB)$ consisting of a 2-cell $\Xi_\cA
  \colon \alpha_\cA\Rightarrow \alpha'_\cA$ of $\PsFun(\cA,\cD)$ and a 2-cell $\Xi_\cB\colon \alpha_\cB\Rightarrow \alpha'_\cB$ of $\PsFun(\cB,\cD)$ such that $\lvert \Xi_\cA \rvert = \lvert \Xi_\cB \rvert$.
\end{Definition}

  We view $\GD_{\cA,\cB}(\cC,\cD)$ as a $\twoFun(\Ob(\cC),\cD)$-category via the functor given by
  \begin{gather*}
  (F_\cA,F_\cB,G)\mapsto \lvert F_\cA \rvert=\lvert F_\cB \rvert,\\
  (\alpha_\cA,\alpha_\cB)\mapsto \lvert \alpha_\cA\rvert = \lvert \alpha_\cB \rvert,\quad (\Xi_\cA,\Xi_\cB)\mapsto \lvert \Xi_\cA \rvert = \lvert \Xi_\cB\rvert.
  \end{gather*}

  Let $(F_\cA,F_\cB,G)$ be an object of $\GD_{\cA,\cB}(\cC,\cD)$. For every square $D$ \eqref{e.2}, let $G^*_{D'}=G_D^{-1}$, where $D'$ is the square obtained from $D$ by inverting $\alpha$. Then $(F_\cB,F_\cA,G^*)$ is an object of $\GD_{\cB,\cA}(\cC,\cD)$. If $(\alpha_\cA,\alpha_\cB)\colon (F_\cA,F_\cB,G)\to (F'_\cA,F'_\cB,G')$ is a 1-cell of $\GD_{\cA,\cB}(\cC,\cD)$, then
  \[(\alpha_\cB,\alpha_\cA)\colon (F_\cB,F_\cA,G^*)\to (F'_\cB,F'_\cA,G'{}^*)\]
  is a 1-cell of $\GD_{\cB,\cA}(\cC,\cD)$. If $(\Xi_\cA,\Xi_\cB)\colon (\alpha_\cA,\alpha_\cB)\Rightarrow (\alpha'_\cA,\alpha'_\cB)$ is a 2-cell of $\GD_{\cA,\cB}(\cC,\cD)$, then
  \[(\Xi_\cB,\Xi_\cA)\colon (\alpha_\cB,\alpha_\cA)\Rightarrow (\alpha'_\cB,\alpha'_\cA)\]
  is a 2-cell of $\GD_{\cB,\cA}(\cC,\cD)$. This defines an isomorphism of $\twoFun(\Ob(\cC),\cD)$-categories
  \[\GD_{\cA,\cB}(\cC,\cD) \simto \GD_{\cB,\cA}(\cC,\cD).\]

  Let $F$ be an object of $\PsFun(\cC,\cD)$. For every square $D$ \eqref{e.2}, define $G_D$ to be the composition
  \[\xymatrix{F(i)F(q)\ar@=[r]& F(iq)\ar@=[r]^{F(\alpha)} & F(pj)\ar@=[r] & F(p) F(j).}\]
  Then $(F|\cA,F|\cB,G)$ is an object of $\GD_{\cA,\cB}(\cC,\cD)$. If $\alpha\colon F\to F'$ is a 1-cell of $\PsFun(\cC,\cD)$, then
  \[(\alpha|\cA,\alpha|\cB)\colon(F|\cA,F|\cB,G)\to (F'|\cA,F'|\cB,G')\]
  is a 1-cell of $\GD_{\cA,\cB}(\cC,\cD)$. If $\Xi\colon \alpha\Rightarrow \alpha'$ is a 2-cell of $\PsFun(\cA,\cB)$, then
  \[(\Xi|\cA,\Xi_\cB)\colon (\alpha|\cA,\alpha|\cB)\Rightarrow (\alpha'|\cA,\alpha'|\cB)\]
  is a 2-cell of $\GD_{\cA,\cB}(\cC,\cD)$. This defines a $\twoFun(\Ob(\cC),\cD)$-functor
  \begin{equation}\label{e.glue}
  \PsFun(\cC,\cD)\to \GD_{\cA,\cB}(\cC,\cD).
  \end{equation}

\begin{ssect}\label{s.gen}
  We say that $\cA$ and $\cB$ \emph{generate} $\cC$ if every 1-cell of $\cC$ is isomorphic to a composition $p_1 i_1 \dots p_n i_n$, where $i_1,\dots, i_n$ are 1-cells of $\cA$ and $p_1,\dots, p_n$ are 1-cells of $\cB$. In this case, \eqref{e.glue} is 2-faithful since the restriction 2-functor
  \[\PsFun(\cC,\cD)\to \PsFun(\cA,\cD)\times_{\twoFun(\Ob(\cC),\cD)} \PsFun(\cB,\cD)\]
  is 2-faithful. Here the fiber product is strict. To see the 2-faithfulness,
  let $\alpha\colon F\to F'$ be a 1-cell of $\PsFun(\cC,\cD)$.
  If $f\colon X\to Y$ is a 1-cell of $\cC$ and
  \[\gamma\colon p_1i_1 \dots p_n i_n \Rightarrow f\]
  is a 2-cell of $\cC$, where $i_1,\dots, i_n$ are 1-cells of $\cA$ and $p_1,\dots, p_n$ are 1-cells of $\cB$.
  then the following diagram commutes
  \[\xymatrix{\alpha(Y) F(p_1)F(i_1)\dots F(p_n)F(i_n)\ar@=[r]\ar@=[d]^{\alpha(p_1)\alpha(i_1)\dots\alpha(p_n)\alpha(i_n)}
  & \alpha(Y)F(p_1 i_1 \dots p_n i_n)\ar@=[r]^-{F(\gamma)}\ar@=[d]^{\alpha(p_1 i_1 \dots p_n i_n)}
  & \alpha(Y)F(f)\ar@=[d]^{\alpha(f)}\\
  F'(p_1)F'(i_1)\dots F'(p_n)F'(i_n)\alpha(X)\ar@=[r]
  & F'(p_1 i_1 \dots p_n i_n)\alpha(X)\ar@=[r]^-{F'(\gamma)}
  & F'(f)\alpha(X)}\]
  Hence $\alpha$ is determined by $\alpha|\cA$ and $\alpha|\cB$. Let $\alpha,\beta\colon F\to F'$ be 1-cells of $\PsFun(\cC,\cD)$ and $\Xi\colon \alpha \Rightarrow \beta$ be a 2-cell of $\twoFun(\Ob(\cC),\cD)$. For any triangle in $\cC$
  \[\xymatrix{X\ar[d]^f\druppertwocell^h{^\gamma} \\
  Y\ar[r]^g & Z}\]
  the leftmost and the rightmost inner squares of the following diagram commute
  \[\xymatrix{\alpha(Z)F(h)\ar@=[r]_-{F(\gamma^{-1})} \ar@=[d]^{\Xi_Z}\ar@=@/^1.5pc/[rrrr]^{\alpha(h)}
  & \alpha(Z)F(g)F(f)\ar@=[r]^{\alpha(g)} \ar@=[d]^{\Xi_Z}
  & F'(g)\alpha(Y)F(f)\ar@=[r]^{\alpha(f)}\ar@=[d]^{\Xi_Y}
  & F'(g)F'(f)\alpha(X)\ar@=[r]_-{F'(\gamma)}\ar@=[d]^{\Xi_X}
  & F'(h)\alpha(X)\ar@=[d]^{\Xi_X}\\
  \beta(Z) F(h) \ar@=[r]^-{F(\gamma^{-1})}\ar@=@/_1.5pc/[rrrr]^{\beta(h)}
  & \beta(Z) F(g)F(f)\ar@=[r]^{\beta(g)}
  & F'(g) \beta(Y) F(f)\ar@=[r]^{\beta(f)}
  & F'(g) F'(f)\beta(X)\ar@=[r]^-{F'(\gamma)}
  & F'(h)\beta(X)}\]
  Hence $\Xi$ is a 2-cell of $\PsFun(\cC,\cD)$ if and only if it is both a 2-cell of $\PsFun(\cA,\cD)$ and a 2-cell of $\PsFun(\cB,\cD)$.
\end{ssect}

The following is a generalization of \cite[XVII 3.3.2]{SGA4} to 2-categories.

\begin{Proposition}\label{p.glue}
  Let $\cC$ be a $(2,1)$-category, $\cA$ and $\cB$ be two 2-faithful subcategories (\ref{s.faith}) of $\cC$ with $\Ob(\cA)=\Ob(\cB)=\Ob(\cC)$, $\cD$ be a 2-category.
  Assume the following:
  \begin{description}
    \item[(i)] Every 1-cell of $\cC$ is isomorphic to $pi$ for some 1-cell $i$ of $\cA$ and some 1-cell $p$ of $\cB$.
    \item[(ii)] 2-fiber products exist in $\cB$ and are 2-fiber products in $\cC$.
  \end{description}
  Then \eqref{e.glue} is a $\twoFun(\Ob(\cC),\cD)$-equivalence (\ref{s.faith}).
\end{Proposition}

\begin{proof}
The 2-functor is 2-faithful since (i) implies that $\cA$ and $\cB$ generate $\cC$.

For any 1-cell $f$ of $\cC$, consider the 2-category of \emph{compactifications of $f$}. An object of this 2-category is a quadruple $(Z,i,p,\alpha)$ consisting of an object $Z$ of $\cC$, a 1-cell $i\colon X\to Z$ of~$\cA$, a 1-cell $p\colon Z\to Y$ of~$\cB$, and a 2-cell $\alpha\colon f\Rightarrow pi$ of $\cC$ corresponding to the diagram
\[\xymatrix{X\ar[r]^i\ar[d]_f & Z\ar[dl]^p\\
Y\utwocell\omit{<1.5>\alpha} &}\]
A 1-cell $(Z,i,p,\alpha)\to (W,j,q,\beta)$ is a triple $(r, \gamma, \delta)$ consisting of a 1-cell $r\colon Z\to W$ of~$\cB$, and 2-cells $\gamma\colon ri\Rightarrow j$ and $\delta\colon p\Rightarrow qr$ of $\cC$, fitting in the diagram
\[\xymatrix{X\ar[d]_i\ar[rd]^j\ddlowertwocell_f{^\alpha}\\
Z\utwocell\omit{<1.5>\gamma} \ar[r]^r\ar[d]_p & W\ar[ld]^q\\
Y\utwocell\omit{<1.5>\delta}}\]
where the outer triangle is $\beta$. A 2-cell $(r,\gamma,\delta)\Rightarrow (r',\gamma',\delta')$ is a 2-cell $\epsilon \colon r\Rightarrow r'$ of $\cB$ such that $\gamma=\gamma'(\epsilon i)$ and $\delta'=\delta(q\epsilon)$. We denote by $\Comp(f)$ the 1-category obtained by identifying isomorphic 1-cells.
Under the assumptions of \ref{p.glue}, one shows as in \cite[XVII 3.2.6]{SGA4} that $\Comp(f)^\op$ is a filtrant category.

Let $F$ and $F'$ be objects of $\PsFun(\cC,\cD)$ and
\[(\epsilon_\cA, \epsilon_\cB)\colon (F|\cA,F|\cB,G)\to (F'|\cA,F'|\cB,G')\]
be a 1-cell of $\GD_{\cA,\cB}(\cC,\cD)$ whose source and target are respectively the images of $F$ and $F'$ under \eqref{e.glue}. Define a 1-cell $\epsilon \colon F\to F'$ of $\PsFun(\cC,\cD)$ as follows. For any object $X$ of $\cC$, let $\epsilon(X) =\epsilon_\cA(X)=\epsilon_\cB(X)$. For any 1-cell $f\colon X\to Y $ of $\cC$, let $\epsilon(f)$ be the unique 2-cell in $\cD$ making the following diagram commute
\[\xymatrix{\epsilon(Y) F(p)F(i)\ar@=[r]\ar@=[d]^{\epsilon_\cB(p)\epsilon_\cA(i)}
& \epsilon (Y) F(pi)\ar@=[r]^{F(\alpha^{-1})}
& \epsilon (Y) F(f)\ar@=[d]^{\epsilon(f)}\\
F'(p)F'(i)\epsilon(X)\ar@=[r]
& F'(pi)\epsilon(X)\ar@=[r]^{F'(\alpha^{-1})}
& F'(f)\epsilon(X)}\]
where $(Z,i,p,\alpha)$ is a compactification of $f$. This does not depend on the choice of the compactification, because, if $(r, \gamma, \delta)\colon (Z,i,p,\alpha)\to (W,j,q,\beta)$ is a 1-cell of compactifications, then the following diagram commutes
\[\xymatrix{\epsilon(Y)F(f)\ar@=[r]_-{F(\alpha)}\ar@/^1.5pc/@=[rrr]^{F(\beta)}
& \epsilon(Y)F(p)F(i)\ar@=[r]^-{F(\delta)}\ar@=[d]^{\epsilon_\cB(p)\epsilon_\cA(i)}
& \epsilon(Y)F(q)F(r)F(i)\ar@=[r]_-{G_D^{-1}}\ar@=[d]^{\epsilon_\cB(q)\epsilon_\cB(r)\epsilon_\cA(i)}
& \epsilon(Y)F(q)F(j)\ar@=[d]^{\epsilon_\cB(q)\epsilon_\cA(j)}\\
F'(f)\epsilon(X)\ar@=[r]^-{F'(\alpha)}\ar@/_1.5pc/@=[rrr]^{F'(\beta)}
& F'(p)F'(i)\epsilon(X)\ar@=[r]^-{F'(\delta)}
& F'(q)F'(r)F'(i)\epsilon(X)\ar@=[r]^-{G'_D{}^{-1}}
& F'(q)F'(j)\epsilon(X)}\]
where $D$ is the square
  \begin{equation}\label{e.gammainv}
  \xymatrix{X\ar[r]^i\ar@{=}[d]\drtwocell\omit{^\gamma^{-1}} & Z \ar[d]^r\\
  X\ar[r]^j & W}
  \end{equation}
For any object $X$ of $\cC$, $(X,\one_X,\one_X,\one_{\one_X})$ is a compactification of $X$, so the following diagram commutes
  \[\xymatrix{\epsilon(X)\ar@=[rd]\ar@=[r]
  & \epsilon(X)F(\one_X) F(\one_X)\ar@=[d]^{\epsilon_\cA(\one_X)\epsilon_\cB(\one_X)}\ar@=[r]
  & \epsilon(X)F(\one_X)\ar@=[d]^{\epsilon(\one_X)}\\
  & F'(\one_X)F'(\one_X)\epsilon(X)\ar@=[r]
  & F'(\one_X)\epsilon(X)}\]
For any composable pair of 1-cells $X\xrightarrow{f} Y\xrightarrow{g} Z$, choose a diagram
  \begin{equation}\label{e.gf}
  \xymatrix{X\ar[r]^i\ar[d]_f& X'\ar[r]^k\ar[ld]^p & X''\ar[dl]^r\\
  Y\ar[d]_g\ar[r]^j\utwocell\omit{<1.5>\alpha} & Y'\ar[dl]^q\utwocell\omit{\gamma}\\
  Z\utwocell\omit{<1.5>\beta} }
  \end{equation}
such that $i,j,k$ are 1-cells of $\cA$ and $p,q,r$ are 1-cells of $\cB$. If we denote by $D$ the square containing $\gamma$ and by $\delta\colon qrki\Rightarrow gf$ the 2-cell represented by the outer triangle,  then the following diagram commutes
  \[\xymatrix{\epsilon(Z)F(g)F(f)\ar@=[r]^-{F(\beta)F(\alpha)}\ar@=[d]^{\epsilon(f)\epsilon(g)}
  & \epsilon(Z)F(q)F(j)F(p)F(i)\ar@=[r]^{G_D}\ar@=[d]^{\epsilon_\cB(q)\epsilon_\cA(j)\epsilon_\cB(p)\epsilon_\cA(i)}
  & \epsilon(Z)F(q) F(r) F(k) F(i)\ar@=[d]^{\epsilon_\cB(q)\epsilon_\cB(r)\epsilon_\cA(k)\epsilon_\cA(i)}
  & \epsilon(Z)F(gf)\ar@=[d]^{\epsilon(gf)}\ar@=[l]^-{F(\delta)}\\
  F'(g)F'(f)\epsilon(X)\ar@=[r]^-{F'(\beta)F'(\alpha)}
  & F'(q)F'(j)F'(p)F'(i)\epsilon(X)\ar@=[r]^{G'_D}
  & F'(q)F'(r)F'(k)F'(i)\epsilon(X)
  & F'(gf)\epsilon(X)\ar@=[l]^-{F'(\delta)}}\]
Hence $\epsilon$ is a pseudo-natural transformation. Its image under \eqref{e.glue} is clearly $(\epsilon_\cA,\epsilon_\cB)$. Therefore \eqref{e.glue} is 2-fully faithful.

It remains to show that every gluing datum $(F_\cA,F_\cB,G)$ is in the $\twoFun(\Ob(\cC),\cD)$-essential image of \eqref{e.glue}. The proof is similar to that of \cite[XVII 3.3.2]{SGA4}. We give a brief sketch. We construct an object $F$ of $\PsFun(\cC,\cD)$ as follows. For any object $X$ of $\cC$, let $FX=F_\cA X=F_\cB X$. For any 1-cell $f\colon X\to Y$ of $\cC$, consider the functor $F_f\colon \Comp(f)\to \cD(FX,FY)$ which, to a compactification $(Z,i,p,\alpha)$ of $f$, associates the 1-cell $F_\cB(p)F_\cA(i)\colon FX\to FY$ of $\cD$, and, to a morphism of compactifications $(r,\gamma,\delta)\colon (Z,i,p,\alpha)\to(W,j,q,\beta)$, associate the invertible 2-cell
\[\xymatrix{F_\cB(p)F_\cA(i)\ar@=[r]^-{F_\cB(\delta)} & F_\cB(q)F_\cB(r)F_\cA(i)\ar@=[r]^-{G_D^{-1}} & F_\cB(q)F_\cA(j) },\]
where $D$ is the square \eqref{e.gammainv}. Since $\Comp(f)^\op$ is filtrant, $F_f$ defines, for every pair of compactifications $(Z,i,p,\alpha),(W,j,q,\beta)$ of $f$, an invertible 2-cell
\[F_\cB(p)F_\cA(i)\Rightarrow F_\cB(q)F_\cA(j).\]
Choose one compactification $(Z,i,p,\alpha)$ of $f$ and let $Ff=F_\cB(p)F_\cA(i)$. For any 2-cell
\[\xymatrix{X\rtwocell^f_g{\phi} & Y,}\]
in~$\cC$, choose a decomposition of $\phi$
\[\xymatrix{&X\ar[d]^k \xlowertwocell[ddl]{}_i{^\gamma}\xuppertwocell[ddr]{}^j{^\delta^{-1}}
\xtwocell[ddd]{}<30>^g_f{\omit}\\
& X'\ar[dl]^r\ar[dr]_s\ddtwocell\omit{^\epsilon}\\
Z\ar[dr]^p&&W\ar[ld]_q\\
&Y\xtwocell[uuu]{}\omit{<12>\beta^{-1}}\xtwocell[uuu]{}\omit{<-12>\alpha}}\]
where $(Z,i,p,\alpha)$ and $(W,j,q,\beta)$ are the chosen compactifications of $f$ and $g$, respectively, $k$ is a 1-cell of $\cA$ and $r,s$ are 1-cells of $\cB$. Let $F\phi\colon Ff\Rightarrow Fg$ be the composition
\[\xymatrix{F_\cB(p)F_\cA(i)\ar@=[r]^-{G_D} & F_\cB(p)F_\cB(r)F_\cA(k)\ar@=[r]^{F_\cB(\epsilon)} & F_\cB(q)F_\cB(s)F_\cA(k)\ar@=[r]^-{G_{D'}^{-1}} & F_\cB(q)F_\cA(j)},\]
where $D$ and $D'$ are respectively the squares
\[\xymatrix{X\ar[r]^k\ar@{=}[d]\drtwocell\omit{^\gamma} & X'\ar[d]^r & X\ar[r]^k\ar@{=}[d]\drtwocell\omit{^\delta}&X'\ar[d]^s\\
X\ar[r]^i&Z & X\ar[r]^j & W}\]
This does not depend on the choice of the decomposition of $\phi$. For any object $X$ of~$\cC$, $(X,\one_X,\one_X,\one_{\one_X})$ is a compactification of $\one_X$ and induces an invertible 2-cell \[\xymatrix{\one_{FX}\ar@=[r] &F_\cB(\one_X)F_\cA(\one_X)\ar@=[r]^-{F_{\one_X}} & F(\one_X)}.\]
For any composable pair of 1-cells $X\xrightarrow{f} Y\xrightarrow{g} Z$, choose a diagram \eqref{e.gf}
where $(Z,i,p,\alpha)$ and $(W,j,q,\beta)$ are the chosen compactifications of $f$ and $g$, respectively.

Associate the following invertible 2-cell $F(g)F(f)\Rightarrow F(gf)$:
\[\xymatrix{F_\cB(q)F_\cA(j)F_\cB(p)F_\cA(i)\ar@=[r]^{G_D} & F_\cB(q)F_\cB(r)F_\cA(k)F_\cA(i)\ar@=[r]& F_\cB(qr)F_\cA(ki)\ar@=[r]^-{F_{gf}} & F(gf)},\]
where $D$ is the square in \eqref{e.gf} containing $\gamma$. One verifies that this does not depend on the choice of \eqref{e.gf} and $F$ is a pseudo-functor. Define invertible 1-cells $\epsilon_\cA\colon F_\cA \to F|\cA$ of $\PsFun(\cA,\cD)$ and $\epsilon_\cB\colon F_\cB \to F|\cB$ of $\PsFun(\cB,\cD)$ as follows. For any object $X$ of $\cC$, let $\epsilon_\cA(X)=\epsilon_\cB(X)=\one_{FX}$. For any 1-cell $i\colon X\to Y$ of $\cA$, $(Y,i,\one_Y,\one_i)$ is a compactification of $i$. Let $\epsilon_\cA(i)\colon F_\cA(i)\Rightarrow F(i)$ be the 2-cell induced by $F_i$. For any 1-cell $p\colon X\to Y$ of $\cB$, $(X,\one_X,p,\one_p)$ is a compactification of $p$. Let $\epsilon_\cB(p)\colon F_\cB(p)\Rightarrow F(p)$ be the 2-cell induced by $F_p$. Then $(\epsilon_\cA,\epsilon_\cB)$ gives an isomorphism from $(F_\cA,F_\cB,G_D)$ to the image of $F$ under \eqref{e.glue}.
\end{proof}

\begin{ssect}\label{s.gdp}
  Let $\cC,\cA,\cB,\cD$ be as in \ref{s.gd}. Let $(F_\cA,F_\cB,G)$ be an object of $\GD_{\cA,\cB}(\cC,\cD)$, $F_0=\lvert F_\cA\rvert = \lvert F_\cB \rvert$. Define an invertible 1-cell $\rho\colon F_\cB|\cA\cap \cB \to F_\cA|\cA\cap \cB$ of $\PsFun(\cA\cap\cB,\cD)$ with $\lvert \rho \rvert = \one_{F_0}$ as follows. For any 1-cell $f\colon X\to Y$ of $\cA\cap \cB$, let $\rho(f)$ be the composition
  \[\xymatrix{F_\cB(f)\ar@=[r] & F_\cA(\one_Y) F_\cB(f)\ar@=[r]^{G_D} & F_\cB(\one_Y) F_\cA(f)\ar@=[r]& F_\cA(f)},\]
  where $D$ is left square in the diagram
  \[\xymatrix{X\ar@{=}[r]\drtwocell\omit{=}\ar@{=}[d] &X\ar[d]^f\ar[r]^f\drtwocell\omit{=} & Y\ar@{=}[d]\\
  X\ar[r]^f & Y\ar@{=}[r] & Y}\]
  Denote the right square by $D'$. Applying axiom (a) in \ref{s.gd} to the outer square and axiom (b') to the above diagram, one sees that $\rho(f)$ is the inverse of the composition
  \[\xymatrix{F_\cA(f)\ar@=[r] & F_\cA(f)F_\cB(\one_X) \ar@=[r]^{G_{D'}} & F_\cB(f) F_\cA(\one_X)\ar@=[r] & F_\cB(f)}.\]
  For any object $X$ of $\cC$, applying axiom (a) to the commutative square consisting of $X$ and $\one_X$, one finds that the following diagram commutes
  \[\xymatrix{\one_{F_0 X}\ar@=[d]\ar@=[dr]\\
  F_\cB(\one_X)\ar@=[r]^{\rho(\one_X)} & F_\cA(\one_X)}\]
  For any composable pair of 1-cells $X\xrightarrow{f} Y\xrightarrow{g} Z$, applying axioms (a), (b), (b') to
  \[\xymatrix{X\ar[r]^f\ar[d]^f\drtwocell\omit{=} & Y\ar[r]^g\ar@{=}[d]\drtwocell\omit{=} & Z\ar@{=}[d]\\
  Y\ar[d]^g\ar@{=}[r]\xtwocell[rrd]{}\omit{=} & Y\ar[r]^{g} & Z\ar@{=}[d]\\
  Z\ar@[=][rr] && Z}\]
  one finds that the following diagram commutes
  \[\xymatrix{F_\cB(g)F_\cB(f)\ar@=[r]^{\rho(g)\rho(f)}\ar@=[d] & F_\cA(g)F_\cA(f)\ar@=[d]\\
  F_\cB(gf)\ar@=[r]^{\rho(gf)} & F_\cA(gf)}\]
  Hence $\rho$ is a pseudo-natural equivalence.

  We claim that $\rho$ has the following properties:
    \begin{description}
    \item[(c)] If $D$ is a square \eqref{e.2} such that $p,q$ are 1-cells of $\cA\cap \cB$, then the following hexagon commutes
    \[\xymatrix{F_\cA(i)F_\cB(q)\ar@=[d]^{G_D} \ar@=[r]^{\rho(q)} & F_\cA(i)F_\cA(q)\ar@=[r] & F_\cA(iq)\ar@=[d]^{F_\cA(\alpha)}\\
    F_\cB(p)F_\cA(j) \ar@=[r]^{\rho(p)} & F_\cA(p)F_\cA(j)\ar@=[r] &F_\cA(pj)}\]
    \item[(c')] If $D$ is a square \eqref{e.2} such that $i,j$ are 1-cells of $\cA\cap \cB$, then the following hexagon commutes
    \[\xymatrix{F_\cA(i)F_\cB(q)\ar@=[d]^{G_D} \ar@=[r]^{\rho(i)^{-1}} & F_\cB(i)F_\cB(q)\ar@=[r] & F_\cB(iq)\ar@=[d]^{F_\cB(\alpha)}\\
    F_\cB(p)F_\cA(j) \ar@=[r]^{\rho(j)^{-1}} & F_\cB(p)F_\cB(j)\ar@=[r] &F_\cB(pj)}\]
  \end{description}
  In fact, any square $D$ in (c) can be decomposed as
  \[\xymatrix{X\ar[r]^j\ar@{=}[d]\drtwocell\omit{=} & Y\ar@{=}[r]\ar@{=}[d]\drtwocell\omit{=} & Y\ar[d]^p\\
  X\ar[r]^j\ar@{=}[d]\xtwocell[rrd]{}\omit{^\alpha} & Y\ar[r]^p & W\ar@{=}[d]\\
  X\ar[r]^q\ar[d]^q\drtwocell\omit{=} & Z\ar[r]^i\ar@{=}[d]\drtwocell\omit{=} & W\ar@{=}[d]\\
  Z\ar@{=}[r] & Z\ar[r]^i & W}\]
  Denote the upper left, upper right, middle, lower left, lower right squares by $D_1$, $D_2$, $D_3$, $D_4$ and $D_5$, respectively. Then $G_{D_2}$ can be identified with $\rho(p)^{-1}$ and $G_{D_4}$ can be identified with $\rho(q)$. By axiom (a), $G_{D_1}$ and $G_{D_5}$ can be identified with identities and $G_{D_3}$ can be identified with $F_\cA(\alpha)$.  Hence axioms (b) and (b') imply that the hexagon in (c) commutes. Similarly, axioms (a'), (b) and (b') imply (c').
\end{ssect}

\begin{Definition}\label{d.gdp}
  Define a category $\GD'_{\cA,\cB}(\cC,\cD)$ as follows. An object of this category is a quadruple $\left(F_\cA,F_\cB,(G_D), \rho\right)$ consisting of an object  $F_\cA$ of $\PsFun(\cA,\cD)$, an object $F_\cB$ of $\PsFun(\cB,\cD)$, a family of invertible 2-cells of $\cD$
  \[G_D\colon F_\cA(i)F_\cB(q) \Rightarrow F_\cB(p)F_\cA(j),\]
  $D$ running over \emph{2-Cartesian} squares in $\cC$ of the form \eqref{e.2},

  and an invertible 1-cell $\rho\colon F_\cB|\cA\cap \cB\to F_\cA|\cA\cap \cB$ of $\PsFun(\cA\cap\cB,\cD)$, such that $\lvert \rho\rvert = \one_{F_0}$, where $F_0=\lvert F_\cA\rvert = \lvert F_\cB \rvert$, and satisfying conditions (b), (b') in \ref{s.gd} and conditions (c), (c') above for 2-Cartesian squares.

  A 1-cell $(F_\cA,F_\cB,G,\rho)\to (F'_\cA,F'_\cB,G',\rho')$ of $\GD'_{\cA,\cB}(\cC,\cD)$ is a pair
  $(\alpha_\cA,\alpha_\cB)$
  consisting of a 1-cell $\alpha_\cA\colon F_\cA \to F'_\cA$ of $\PsFun(\cA,\cD)$ and a 1-cell $\alpha_\cB\colon F_\cB \to F'_\cB$ of $\PsFun(\cB,\cD)$, such that $\lvert \alpha_\cA\rvert = \lvert \alpha_\cB \rvert$, that for any 2-Cartesian square $D$ \eqref{e.2}, the diagram \eqref{e.gdmor} commutes, and that the following square commutes
  \[\xymatrix{F_\cB|\cA\cap \cB\ar[r]^{\rho}\ar[d]^{\alpha_\cB|\cA\cap\cB} & F_\cA|\cA\cap\cB\ar[d]^{\alpha_\cA|\cA\cap \cB}\\
  F'_\cB|\cA\cap \cB\ar[r]^{\rho'} & F'_\cA|\cA\cap\cB}\]

  A 2-cell of $\GD'_{\cA,\cB}(\cC,\cD)$ is a pair $(\Xi_\cA,\Xi_\cB)\colon (\alpha_\cA,\alpha_\cB)\Rightarrow (\alpha'_\cA,\alpha'_\cB)$ consisting of a 2-cell $\Xi_\cA\colon \alpha_\cA\Rightarrow \alpha'_\cA$ of $\PsFun(\cA,\cD)$ and a 2-cell $\Xi_\cB\colon \alpha_\cB\Rightarrow \alpha'_\cB$ of $\PsFun(\cB,\cD)$ such that $\lvert \Xi_\cA\rvert = \lvert \Xi_\cB \rvert$.
\end{Definition}

We view $\GD'_{\cA,\cB}(\cC,\cD)$ as a $\twoFun(\Ob(\cC),\cD)$-category via the functor given by
\begin{gather*}
  (F_\cA,F_\cB,G,\rho)\mapsto \lvert F_\cA \rvert = \lvert F_\cB \rvert,\\
  (\alpha_\cA,\alpha_\cB)\mapsto \lvert \alpha_\cA\rvert =\lvert \alpha_\cB\rvert,\quad
  (\Xi_\cA,\Xi_\cB)\mapsto \lvert \Xi_\cA \rvert =\lvert \Xi_\cB \rvert.
\end{gather*}

The construction \ref{s.gdp} defines a $\twoFun(\Ob(\cC),\cD)$-functor
  \begin{equation}\label{e.gdp}
  \GD_{\cA,\cB}(\cC,\cD) \to \GD'_{\cA,\cB}(\cC,\cD),
  \end{equation}
  which is clearly 2-faithful.

\begin{ssect}\label{s.square}

  We say that $\cA$ and $\cB$ are \emph{squaring} in $\cC$ if every square \eqref{e.2} can be decomposed as
  \begin{equation}\label{e.square}
  \xymatrix{X\ar[rd]^f\xuppertwocell[rrd]{}^j{^\delta}\xlowertwocell[rdd]{}_q{^\gamma}\\
  &X'\ar[r]^k\ar[d]^r\drtwocell\omit{^\beta} & Y\ar[d]^p\\
  &Z\ar[r]^i & W}
  \end{equation}
  where $k$ is a 1-cell of~$\cA$, $r$ is a 1-cell of $\cB$, $f$ is a 1-cell of $\cA\cap \cB$, and the inner square is 2-Cartesian in $\cC$. If $\cA=\cB$, a sufficient condition for $\cA$ and $\cA$ to be squaring in $\cC$ is that 2-fiber products exist in $\cA$ and are 2-fiber products in $\cC$. In general, a sufficient condition for $\cA$ and $\cB$ to be squaring is that 2-fiber products exist in $\cC$, and $\cA$ and $\cB$ are closed under 2-base change in $\cC$ and taking the diagonal in $\cC$.

  If $\cA$ and $\cB$ are squaring, then \eqref{e.gdp} is 2-fully faithful. In fact, for objects $(F_\cA,F_\cB,G)$, $(F'_\cA,F'_\cB,G')$ of $\GD_{\cA,\cB}(\cC,\cD)$ and any morphism
  \[(\epsilon_A,\epsilon_B)\colon (F_\cA,F_\cB,G,\rho)\to (F'_\cA,F'_\cB,G',\rho')\]
  of $\GD'_{\cA,\cB}(\cC,\cD)$ whose source and target are respectively the images of $(F_\cA,F_\cB,G)$ and $(F'_\cA,F'_\cB,G')$ under \eqref{e.gdp}, $(\epsilon_\cA,\epsilon_\cB)\colon (F_\cA,F_\cB,G)\to(F'_\cA,F'_\cB,G')$ is a morphism of $\GD_{\cA,\cB}(\cC,\cD)$. Indeed, for any square $D$ \eqref{e.2}, decomposing it as \eqref{e.square}, we see that the following diagram commutes \[\xymatrix{\epsilon_0(W)F_\cA(i)F_\cB(q)\ar@=[r]_-{F_\cB(\gamma)}\ar@/^1.5pc/@=[rrr]^{G_D}\ar@=[d]^{\epsilon_{\cA}(i)\epsilon_\cB(q)}
  & \epsilon_0(W)F_\cA(i)F_\cB(r)F_\cB(f)\ar@=[r]^{G_{D'}\rho(f)}\ar@=[d]^{\epsilon_\cA(i)\epsilon_{\cB}(r)\epsilon_\cB(f)}
  & \epsilon_0(W)F_\cB(p)F_\cA(k)F_\cA(f)\ar@=[r]_-{F_{\cA}(\delta)}\ar@=[d]^{\epsilon_\cB(p)\epsilon_\cA(k)\epsilon_\cA(f)}
  & \epsilon_0(W)F_\cB(p)F_\cA(j)\ar@=[d]^{\epsilon_{\cB}(p)\epsilon_\cA(j)}\\
  F'_\cA(i)F'_\cB(q)\epsilon_0(X)\ar@=[r]^-{F'_\cB(\gamma)}\ar@/_1.5pc/@=[rrr]_{G'_D}
  & F'_\cA(i)F'_\cB(r)F'_\cB(f)\epsilon_0(X)\ar@=[r]^{G'_{D'}\rho'(f)}
  & F'_\cB(p)F'_\cA(k)F'_\cA(f)\epsilon_0(X)\ar@=[r]^-{F'_{\cA}(\delta)}
  & F'_\cB(p)F'_\cA(j)\epsilon_0(X)}\]
where $\epsilon_0=\lvert \epsilon_\cA \rvert = \lvert \epsilon_\cB \rvert$.
\end{ssect}

\begin{Proposition}\label{p.gdp}
    Let $\cC$ be a $(2,1)$-category, $\cA$ and $\cB$ be two 2-faithful subcategories of~$\cC$ with $\Ob(\cA)=\Ob(\cB)=\Ob(\cC)$, $\cD$ be a 2-category.  Assume that every 1-cell of $\cC$ that is an equivalence is contained in $\cA\cap\cB$, $\cA$ and $\cB$ are squaring in $\cC$, $\cA$ and $\cA\cap \cB$ are squaring in $\cC$, and $\cB$ and $\cA\cap \cB$ are squaring in $\cC$. Then \eqref{e.gdp} is an isomorphism of 2-categories.
\end{Proposition}

\begin{proof}
  We construct the inverse as follows. Let $(F_\cA,F_\cB,G,\rho)$ be an object of $\GD'_{\cA,\cB}(\cC,\cD)$. For any square $D$ \eqref{e.2}, decompose it as \eqref{e.square},
  and denote the inner square by $D'$. Let $\bar{G}_D$ be the composition
  \[\xymatrix{F_\cA(i)F_\cB(q)\ar@=[r]^-{F_\cB(\gamma)}
  & F_\cA(i)F_\cB(r)F_\cB(f)\ar@=[r]^{G_{D'}\rho(f)}
  & F_\cB(p)F_\cA(k)F_\cA(f)\ar@=[r]^-{F_{\cA}(\delta)}
  & F_\cB(p)F_\cA(j)}\]
  This does not depend on the choice of the decomposition. In fact, if
  \[
  \xymatrix{X\ar[rd]^g\xuppertwocell[rrd]{}^j{^\zeta}\xlowertwocell[rdd]{}_q{^\epsilon}\\
  &X''\ar[r]^l\ar[d]^s\ar@{}[rd]|{D''} & Y\ar[d]^p\\
  &Z\ar[r]^i & W}
  \]
  is another decomposition with $l$ in $\cA$, $s$ in $\cB$, $g$ in $\cA\cap \cB$, $D''$ 2-Cartesian in $\cC$, then they can be combined into
  \[\xymatrix{X\ar[rd]^{g}\xlowertwocell[rrdd]{}_f{^\omega}\xuppertwocell[rrrdd]{}<12>^j{^\zeta}\xlowertwocell[dddrr]{}<-12>_q{^\epsilon} \\
  &X''\ar[rd]^h\xuppertwocell[rrd]{}^l{^\psi} \xlowertwocell[ddr]{}_s{^\phi}\\
  &&X'\ar[r]^k\ar[d]^r\ar@{}[rd]|{D'} & Y\ar[d]^p\\
  &&Z\ar[r]^i & W }\]
  where $h$ is an equivalence. Applying the axioms to the decomposition of $D''$
  \[\xymatrix{X''\ar[rr]^l\ar@{=}[d]\xtwocell[rrd]{}\omit{^\psi} && Y\ar@{=}[d]\\
  X''\ar[r]^h\ar[d]^s\drtwocell\omit{^\phi} & X'\ar[r]^k\ar[d]^r\ar@{}[rd]|{D'} & Y\ar[d]^p\\
  Z\ar@{=}[r] & Z\ar[r]^i &W}\]
  we obtain the following commutative diagram
  \[\xymatrix{F_\cA(i)F_\cB(s)\ar@=[rr]^{G_{D''}}_{(b),(c)}\ar@=[rrd]_{(b')}\ar@=[rd]_{(c)}\ar@=[d]_{F_\cB(\phi)}
  && F_\cB(p)F_\cA(l)\\
  F_\cA(i)F_\cB(r)F_\cB(h)\ar@=[r]_{\rho(h)} & F_\cA(i)F_\cB(r)F_\cA(h)\ar@=[r]_{G_{D'}} & F_\cB(p)F_\cA(k)F_\cA(h)\ar@=[u]_{F_\cA(\psi)}}\]
  Hence the following diagram commutes
  \[\xymatrix{F_\cA(i)F_\cB(q)\ar@=[d]^{F_\cB(\epsilon)}\ar@=[rrd]^{F_\cB(\gamma)}\\
  F_\cA(i)F_\cB(s)F_\cB(g)\ar@=[d]^{\rho(g)}\ar@=[r]^-{F_\cB(\phi)}
  & F_\cA(i)F_\cB(r)F_\cB(h)F_\cB(g)\ar@=[d]^{\rho(g)}\ar@=@/^5pc/[dd]^{\rho(hg)}
  & F_\cA(r)F_\cB(r)F_\cB(f)\ar@=[dd]^{\rho(f)}\ar@=[l]^-{F_\cB(\omega)}\\
  F_\cA(i)F_\cB(s)F_\cA(g)\ar@=[dd]^{G_{D''}}\ar@=[r]^-{F_\cB(\phi)}
  & F_\cA(i)F_\cB(r)F_\cB(h)F_\cA(g)\ar@=[d]^{\rho(h)}\\
  & F_\cA(i)F_\cB(r)F_\cA(h)F_\cA(g)\ar@=[d]^{G_{D'}}
  & F_\cA(i)F_\cB(r)F_\cA(f)\ar@=[d]^{G_{D'}}\ar@=[l]^-{F_\cA(\omega)}\\
  F_\cB(p)F_\cA(l)F_\cA(g)\ar@=[d]^{F_\cA(\zeta)}
  & F_\cB(p)F_\cA(k)F_\cA(h)F_\cA(g)\ar@=[l]_-{F_\cA(\psi)}
  & F_\cB(p)F_\cA(k)F_\cA(f)\ar@=[l]_-{F_\cA(\omega)}\ar@=[lld]^{F_\cA(\delta)}\\
  F_\cB(p)F_\cA(j)}\]

  Next we show that $(F_\cA,F_\cB,\bar{G})$ is an object of $\GD_{\cA,\cB}(\cC,\cD)$. Axioms (a) and (a') for $\bar{G}$ follow from axioms (c) and (c'). Let $D$, $D'$ and $D''$ be squares as in axiom (b') for~$\bar{G}$. Decompose it as
  \[\xymatrix{X_1\xuppertwocell[rrrd]{}^j{^\epsilon}\ar[dr]^f\xlowertwocell[dddrr]{}<-12>_{p_1}{^\delta}\\
  &W\xtwocell[rrrd]{}\omit{^\eta} \ar[rr]^l\ar[dr]^g & & X_2\ar[rd]^h\xuppertwocell[rrd]{}^{j'}{^\gamma}\xlowertwocell[ddr]{}_{p_2}{^\beta}\\
  && Z_1\ar[rr]^(.4)k\ar[d]^{q_1}\ar@{}[rrd]|E && Z_2\ar[r]^{k'}\ar[d]^{q_2}\ar@{}[dr]|{E'} & X_3\ar[d]^{p_3}\\
  && Y_1\ar[rr]^i && Y_2\ar[r]^{i'} & Y_3}\]
  where $k,k',l$ are 1-cells of $\cA$, $q_1,q_2$ are 1-cells of $\cB$, $f,g,h$ are 1-cells of $\cA\cap \cB$, the squares $E$, $E'$ and the square $H$ containing $\eta$ are 2-Cartesian in $\cC$. Let $E''$ be the square obtained by combining $E$ and $E'$, $I$ be the square obtained by combining $H$ and $E$. Since $I$ is the outer square of the diagram

  \[\xymatrix{W\ar[r]^l\ar[d]_{q_1 g}\ar@{}[rd]|J & X_2\ar@{=}[r]\ar[d]^{p_2}\drtwocell\omit{^\beta} & X_2\ar[d]^{q_2 h}\\
  Y_1\ar[r]^i & Y_1\ar@{=}[r] & Y_2}\]
  axioms (b') and (c') imply the commutativity of the following triangle
  \[\xymatrix{F_\cA(i)F_\cB(q_1 g)\ar@=[d]^{G_J} \ar@=[rd]^{G_I}\\
  F_\cB(p_2)F_\cA(l)\ar@=[r]^{F_\cB(\beta)} & F_\cB(q_2 h) F_\cA(l)}\]
  It follows that the following diagram commutes
  {\tiny\[\rotatebox{-90}{
  \xymatrix{F_\cA(i')F_\cA(i)F_\cB(p_1)\ar@=[d]^{F_\cB(\delta)}\ar@=@/_6pc/[dddd]^{\bar{G}_D}\ar@=@/^9.5pc/[rrrrdddd]^{\bar{G}_{D''}}\\

  F_\cA(i')F_\cA(i)F_\cB(q_1)F_\cB(g)F_\cB(f)\ar@=[rr]^{G_{E''}}\ar@=[d]^{\rho(f)}

  &&F_\cB(p_3)F_\cA(k')F_\cA(k)F_\cB(g)F_\cB(f)
  \ar@=[d]^{\rho(f)}\\
  F_\cA(i')F_\cA(i)F_\cB(q_1)F_\cB(g)F_\cA(f)\ar@=[d]^{G_J}\ar@=[r]^{G_E}\ar@=[rd]_{G_I}^{(b)}\ar@=@/^1.5pc/[rr]^{G_{E''}}_{(b')}
  &F_\cA(i')F_\cB(q_2)F_\cA(k)F_\cB(g)F_\cA(f)\ar@=[d]^{G_H}\ar@=[r]^{G_{E'}} &
  F_\cB(p_3)F_\cA(k')F_\cA(k)F_\cB(g)F_\cA(f)\ar@=[d]^{G_H}\ar@=[r]^{\rho(g)}\ar@{}[rd]|{(c)} &
  F_\cB(p_3)F_\cA(k')F_\cA(k)F_\cA(g)F_\cA(f)\ar@=[d]^{F_\cA(\eta)}\\
  F_\cA(i')F_\cB(p_2)F_\cA(l)F_\cA(f)\ar@=[d]^{F_\cA(\epsilon)}\ar@=[r]^{F_\cB(\beta')} &
  F_\cA(i')F_\cB(q_2)F_\cB(h)F_\cA(l)F_\cA(f)\ar@=[r]^{G_{E'}}
  &F_\cB(p_3)F_\cA(k')F_\cB(h)F_\cA(l)F_\cA(f)\ar@=[r]^{\rho(h)}
  &F_\cB(p_3)F_\cA(k')F_\cA(h)F_\cA(l)F_\cA(f) \ar@=[d]^{F_\cA(\epsilon)}\\
  F_\cA(i')F_\cB(p_2)F_\cA(j)\ar@=[r]^{F_\cB(\beta')}\ar@=@/_2pc/[rrrr]^{\bar{G}_{D'}}
  & F_\cA(i')F_\cB(q_2)F_\cB(h)F_\cA(j)\ar@=[r]^{G_{E'}}
  & F_\cB(p_3)F_\cA(k')F_\cB(h)F_\cA(j)\ar@=[r]^{\rho(h)}
  & F_\cB(p_3)F_\cA(k')F_\cA(h)F_\cA(j)\ar@=[r]^{F_\cA(\gamma)} & F_\cB(p_3)F_\cA(j')F_\cA(j)}
  }
  \]
  }One establishes axiom (b) for $\bar{G}$ in a similar way.

  Let $(\epsilon_\cA,\epsilon_\cB)\colon (F_\cA,F_\cB,G,\rho)\to (F'_\cA,F'_\cB,G',\rho')$
  be a 1-cell of $\GD'_{\cA,\cB}(\cC,\cD)$. Then $(\epsilon_\cA,\epsilon_\cB)\colon (F_\cA,F_\cB,\bar{G})\to (F'_\cA,F'_\cB,\bar{G}')$ is a 1-cell of $\GD_{\cA,\cB}(\cC,\cD)$ by \ref{s.square}. Let
  \[(\Xi_\cA,\Xi_\cB)\colon (\epsilon_\cA,\epsilon_\cB)\Rightarrow (\epsilon'_\cA,\epsilon'_\cB)\]
  be a 2-cell of $\GD'_{\cA,\cB}(\cC,\cD)$. Then $(\Xi_\cA,\Xi_\cB)$ is a 2-cell of $\GD_{\cA,\cB}(\cC,\cD)$.

  It is clear that the 2-functor defined in this way is the inverse of \eqref{e.gdp}.
\end{proof}

\begin{Definition}\label{s.gdn}
  Let $\cC$ be a $(2,1)$-category, $\cA_1,\dots, \cA_n$ be 2-faithful subcategories of $\cC$ with $\Ob(\cA_1)=\dots=\Ob(\cA_n)=\Ob(\cC)$, $\cD$ be a 2-category. Define the category $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ of \emph{gluing data} from $\cC$ to~$\cD$, relative to $\cA_1,\dots,\cA_n$ as follows. An object of this category is a pair
  \[\left((F_i)_{1\le i\le n},(G_{ij})_{1\le i<j\le n}\right),\]
  where $F_i\colon \cA_i\to \cD$ is an object of $\PsFun(\cA_i,\cD)$, and $(F_i,F_j,G_{ij})$ is an object of $\GD_{\cA_i,\cA_j}(\cC,\cD)$, satisfying the following condition:
  \begin{description}
     \item[(D)] For $1\le i<j<k\le n$ and any 2-commutative cube of the form
     \begin{equation}\label{e.3}
    \xymatrix{X'\ar[dd]^{x}\ar[dr]^{q'}\ar[rr]^{b'} && Y'\ar[dd]^(.3){y}|\hole \ar[dr]^{p'}\\
    & Z'\ar[dd]^(.3){z}\ar[rr]^(.3){a'} && W'\ar[dd]^w \\
    X\ar[dr]^q\ar[rr]^(.3){b}|\hole && Y\ar[dr]^p\\
    & Z\ar[rr]^a && W }
     \end{equation}
    where $a,b,a',b'$ are 1-cells of $\cA_i$, $p,q,p',q'$ are 1-cells of $\cA_j$ and $x,y,z,w$ are 1-cells of $\cA_k$, the following hexagon commutes
    \[\xymatrix{F_i(a)F_j(q)F_k(x)\ar@=[r]^{G_{jkI'}}\ar@=[d]^{G_{ijK}} & F_i(a)F_k(z)F_j(q')\ar@=[r]^{G_{ikJ}}
    & F_k(w)F_i(a')F_j(q')\ar@=[d]^{G_{ijK'}}\\
    F_j(p)F_i(b)F_k(x)\ar@=[r]^{G_{ijJ'}} & F_j(p)F_k(y)F_i(b')\ar@=[r]^{G_{jkI}} & F_k(w)F_j(p')F_i(b')}\]
    where $I,I',J,J',K,K'$ are respectively the right, left, front, back, bottom, top faces of the cube.
  \end{description}

  A 1-cell $\left((F_i),(G_{ij})\right)\to ((F'_i),(G'_{ij}))$ of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a collection
  $(\alpha_i)_{1\le i\le n}$
  of 1-cells $\alpha_i\colon F_i\to F'_i$ of $\PsFun(\cA_i,\cD)$, such that for $1\le i<j\le n$,
  \[(\alpha_i,\alpha_j)\colon (F_i,F_j,G_{ij})\to(F'_i,F'_j,G'_{ij})\]
  is a 1-cell of $\GD_{\cA_i,\cA_j}(\cC,\cD)$.

  A 2-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a collection
  \[(\Xi_i)_{1\le i \le n}\colon (\alpha_i)_{1\le i\le n}\Rightarrow (\alpha'_i)_{1\le i \le n}\]
  of 2-cells $\Xi_i\colon \alpha_i\Rightarrow \alpha'_i$ of $\PsFun(\cA_i,\cD)$ such that $\lvert \Xi_i \rvert = \dots =\lvert \Xi_n \rvert$.
\end{Definition}

  We view $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ as a $\twoFun(\Ob(\cC),\cD)$-category via the functor given by
  \begin{gather*}
    ((F_i),G)\mapsto \lvert F_1\rvert = \dots =\lvert F_n \rvert,\\
    (\alpha_i)\mapsto \lvert \alpha_1 \rvert = \dots=\lvert \alpha_n \rvert, \quad (\Xi_i)\mapsto \lvert \Xi_1 \rvert = \dots = \lvert \Xi_n \rvert.
  \end{gather*}

  If $n=1$, $\GD_{\cA}(\cC,\cD)=\PsFun(\cA,\cD)$. If $n=2$, $\GD_{\cA_1,\cA_2}(\cC,\cD)$ coincides with the one defined in \ref{s.gd}.

  In general, this category can be described more directly as follows. An object of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a pair $((F_i)_{1\le i\le n},(G_{ijD})_{1\le i,j\le n})$ (here we do \emph{not} assume $i<j$), where $F_i\colon \cA_i\to \cD$ is an object of $\PsFun(\cA_i,\cD)$ such that $\lvert F_1\rvert = \dots = \lvert F_n \rvert$,
  \[G_{ijD}\colon F_i(a)F_j(q) \Rightarrow F_j(p)F_i(b)\]
  is an invertible 2-cell of $\cD$, $D$ running over squares in $\cC$ of the form
  \begin{equation}\label{e.2'}
  \xymatrix{X\ar[r]^b\ar[d]^q\drtwocell\omit{^\alpha} & Y \ar[d]^p\\
  Z\ar[r]^a & W}
  \end{equation}
  where $a,b$ are 1-cells of $\cA_i$ and $p,q$ are 1-cells of $\cA_j$, satisfying condition (D) above for all $1\le i,j,k\le n$ and the following conditions:
  \begin{description}
    \item[(A)] For $1\le i,j\le n$ and any square $D$ of the form
  \[
  \xymatrix{X\ar[r]^b\ar@{=}[d]\drtwocell\omit{^\alpha} & Y \ar@{=}[d]\\
  X\ar[r]^a & Y}
  \]
  where $a$ and $b$ are 1-cells of $\cA_i$, the following square commutes
  \[\xymatrix{F_i(a)\ar@=[r]^{F_i(\alpha)}\ar@=[d] &F_i(b)\ar@=[d]\\
  F_i(a)F_j(\one_X)\ar@=[r]^{G_{ijD}} &F_j(\one_Y)F_i(b)}\]
    \item[(O)] For any square $D$ \eqref{e.2'} with $i=j$, the following square commutes
    \[\xymatrix{F_i(a)F_i(q)\ar@=[r]^{G_{iiD}}\ar@=[d] & F_i(p)F_i(b)\ar@=[d]\\
    F_i(aq)\ar@=[r]^{F_i(\alpha)} & F_i(pb)}\]
  \end{description}
  In fact, given $(G_{ij})_{1\le i < j\le n}$, it suffices to take (O) as a definition of $G_{ii}$, and to put $G_{ji}=G^*_{ij}$ (\ref{s.gd}) for $1\le i<j\le n$.

  A 1-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a collection
  \[(\alpha_i)_{1\le i\le n}\colon ((F_i),(G_{ij}))\to ((F'_i),(G'_{ij}))\]
  of 1-cells $\alpha_i\colon F_i\to F'_i$ of $\PsFun(\cA_i,\cD)$ such that for any square $D$ \eqref{e.2'}, the following square commutes
  \[\xymatrix{\alpha_0(W)F_i(a)F_j(q)\ar@=[r]^{G_{ijD}}\ar@=[d]^{\alpha_i(a)\alpha_j(q)} & \alpha_0(W)F_j(p)F_i(b)\ar@=[d]^{\alpha_j(p)\alpha_i(b)}\\
  F_i'(a)F'_j(q)\alpha_0(X) \ar@=[r]^{G'_{ijD}} & F'_j(p)F'_i(b)\alpha_0(X)}\]
  where $\alpha_0=\lvert \alpha_1\rvert = \dots=\lvert \alpha_n \rvert$.

  It follows from this description that if $\sigma$ is a permutation of $\{1,\dots, n\}$,
  \[((F_i),(G_{ij}))\mapsto ((F_{\sigma(i)}),(G_{\sigma(i)\sigma(j)})),\quad (\alpha_i)\mapsto (\alpha_{\sigma(i)}), \quad (\Xi_i)\mapsto (\Xi_{\sigma(i)})\]
  defines an isomorphism of $\twoFun(\Ob(\cC),\cD)$-categories
  \[\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)\xrightarrow{\sim} \GD_{\cA_{\sigma(1)},\dots,\cA_{\sigma(n)}}(\cC,\cD).\]

\begin{ssect}\label{s.gdp'}
  Let $((F_i),G)$ be an object of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$. For $1\le i,j\le n$, $(F_i,F_j,G_{ij})$ is an object of $\GD_{\cA_i,\cA_j}(\cC,\cD)$. Let
  \[\rho_{ij}\colon F_j|\cA_i\cap\cA_j \to F_i|\cA_i\cap \cA_j\]
  be the 1-cell of $\PsFun(\cA_i\cap \cA_j,\cD)$ associated to it by \eqref{e.gdp}. Then $\rho_{ii}=\one_{F_i}$ and $\rho_{ji}=\rho_{ij}^{-1}$. We claim that $\rho_{ij}$ has the following properties:
  \begin{description}
    \item[(E)] For $1\le i,j,k\le n$ and any square $D$ \eqref{e.2'} where $a,b$ are 1-cells of $\cA_i$ and $p, q$ are 1-cells of $\cA_j\cap \cA_k$, the following square commutes
    \[\xymatrix{F_i(a)F_k(q)\ar@=[r]^{\rho_{jk}(q)}\ar@=[d]^{G_{ikD}} & F_i(a)F_j(q)\ar@=[d]^{G_{ijD}}\\
    F_k(p)F_i(b)\ar@=[r]^{\rho_{jk}(p)} & F_j(p)F_i(b)}\]
    \item[(F)] (cocycle condition) For $1\le i,j,k\le n$, the following triangle commutes
    \[\xymatrix{F_k|\cA_{ijk} \ar[r]^{\rho_{jk}|\cA_{ijk}}\ar[rd]_{\rho_{ik}|\cA_{ijk}} & F_j|\cA_{ijk}\ar[d]^{\rho_{ij}|\cA_{ijk}}\\
    &F_i|\cA_{ijk}}\]
    where $\cA_{ijk}=\cA_i\cap\cA_j\cap\cA_k$.
  \end{description}
  In fact, (E) follows from (D) applied to the cube
  \[\xymatrix{X\ar[rr]^b\ar[rd]^q\ar[dd]^q && Y\ar[rd]^p\ar[dd]^(.3)p|\hole\\
  &Z\ar@{=}[dd]\ar[rr]^(.3)a && W\ar@{=}[dd]\\
  Z\ar[rr]^(.3)a|\hole\ar@{=}[rd] && W\ar@{=}[rd]\\
  &Z\ar[rr]^a&& W}\]
  whose top and back faces are $D$ and whose other faces have identity 2-cells. Condition (F) follows from (E) applied to the square
  \[\xymatrix{X\ar[r]^f \ar[d]^f\drtwocell\omit{=} & Y\ar@{=}[d]\\
  Y\ar@{=}[r] & Y}\]
  for every 1-cell $f$ of $\cA_{ijk}$.
\end{ssect}

\begin{Definition}\label{d.gdp'}
  We define a 2-category $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$ as follows. An object of this 2-category is a triple $\left((F_i)_{1\le i \le n},(G_{ij})_{1\le i<j\le n},(\rho_{ij})_{1\le i<j\le n}\right)$, where $F_i\colon \cA_i\to \cD$ is an object of $\PsFun(\cA_i,\cD)$, and $(F_i,F_j,G_{ij},\rho_{ij})$ is an object of $\GD'_{\cA_i,\cA_j}(\cC,\cD)$, satisfying conditions (D) for cubes with 2-Cartesian faces, (E) for pairwise distinct numbers $1\le i,j,k\le n$ and 2-Cartesian squares, if we put $G_{ji}=G_{ij}^*$ and $\rho_{ji}=\rho_{ij}^{-1}$ for $1\le i<j\le n$, and (F) for $1\le i<j<k\le n$.

  A 1-cell $\left((F_i),G,\rho\right)\to \left((F'_i),G',\rho'\right)$ of $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a collection
  $(\alpha_i)_{1\le i\le n}$
  of 1-cells $\alpha_i\colon F_i\to F'_i$ of $\PsFun(\cA_i,\cD)$, such that for $1\le i<j\le n$,
  \[(\alpha_i,\alpha_j)\colon (F_i,F_j,G_{ij},\rho_{ij})\to(F'_i,F'_j,G'_{ij},\rho'_{ij})\]
  is a 1-cell of $\GD'_{\cA_i,\cA_j}(\cC,\cD)$.

  A 2-cell of $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a collection
  \[(\Xi_i)_{1\le i\le n}\colon (\alpha_i)_{1\le i \le n}\Rightarrow (\alpha'_i)_{1\le i \le n}\]
  of 2-cells $\Xi_i\colon \alpha_i\Rightarrow \alpha'_i$ of $\PsFun(\cA_i,\cD)$ such that $\lvert \Xi_1 \rvert =\dots = \lvert \Xi_n \rvert$.
\end{Definition}

  We view $\GD'_{\cA_1,\dots, \cA_n}(\cC,\cD)$ as a $\twoFun(\Ob(\cC),\cD)$-category via the 2-functor given by
  \begin{gather*}
    ((F_i),G,\rho)\mapsto \lvert F_1\rvert =\dots=\lvert F_n\rvert,\\
    (\alpha_i)\mapsto \lvert \alpha_1\rvert = \dots=\lvert \alpha_n\rvert , \quad (\Xi_i)\mapsto \lvert \Xi_1\rvert = \dots = \lvert \Xi_n \rvert.
  \end{gather*}

  This $\twoFun(\Ob(\cC),\cD)$-category coincides with the one defined in \ref{s.gdp} if $n=2$.

  The construction \ref{s.gdp'} defines a $\twoFun(\Ob(\cC),\cD)$-functor
  \begin{equation}\label{e.gdp'}
    \GD_{\cA_1,\dots,\cA_n}(\cC,\cD)\to \GD'_{\cA_1,\dots,\cA_n}(\cC,\cD),
  \end{equation}
  which is clearly 2-faithful. If, for all $1\le i<j\le n$, $\cA_i$ and $\cA_j$ are squaring in $\cC$ (\ref{s.gdp}), then \eqref{e.gdp'} is 2-fully faithful.

\begin{ssect}\label{s.cube}
  We say that $\cA_1,\dots,\cA_n$ are \emph{cubing} in $\cC$ if, for $1\le i,j\le n$, $i\ne j$, $\cA_i$ and $\cA_j$ are squaring in $\cC$, $\cA_i$ and $\cA_i\cap \cA_j$ are squaring in $\cC$, and for pairwise distinct numbers $1\le i,j,k\le n$, every cube \eqref{e.3} can be decomposed as
  \begin{equation}\label{e.cube}
  \xymatrix{X'\ar[rrd]^{f'} \xlowertwocell[rrrdd]{}_{q'}{^\gamma'}\xuppertwocell[rrrrd]{}^{b'}{^\delta'}\ar[dd]^x \\
  &&V'\ar[rr]^(.3){c'}\ar[rd]^{r'}\ar[dd]^(.25)v && Y'\ar[rd]^{p'}\ar[dd]^(.3)y|\hole\\
  X\xlowertwocell[rrrdd]{}_{q}{^\gamma}\ar[rrd]_{f}\ar@/^/[rrrrd]^(.3){b} \xtwocell[rrrd]{}\omit{^\delta} &&& Z'\ar[rr]^(.3){a'}\ar[dd]^(.7)z && W'\ar[dd]^w\\
  && V\ar[rr]^(.3){c}|\hole \ar[dr]^r&& Y\ar[dr]^p\\
  &&& Z\ar[rr]^a && W}
  \end{equation}
  where $c,c'$ are 1-cells of $\cA_i$, $r,r'$ are 1-cells of $\cA_j$, $f,f'$ are 1-cells of $\cA_i\cap \cA_j$, $v$ is a 1-cell of $\cA_k$, the bottom face $L$ and the top face $L'$ of the inner cube are 2-Cartesian. Note that if the right face $I$ (resp.\ the front face $J$) of the inner cube is 2-Cartesian, so is the left face $I''$ (resp.\ the back face $J''$) by \cite[2.12]{Illusie-Zheng}. If $n=1$, $\cA$ is always cubing in $\cC$. If $n=2$, $\cA_1$ and $\cA_2$ are cubing if and only if $\cA_1$ and $\cA_2$ are squaring in $\cC$, $\cA_1$ and $\cA_1\cap\cA_2$ are squaring in $\cC$, and $\cA_2$ and $\cA_1\cap \cA_2$ are squaring in $\cC$. In general, one sufficient condition for $\cA_1,\dots,\cA_n$ to be cubing is that $\cC$ admits 2-fiber products, and $\cA_i$ is stable under 2-base change in $\cC$ and taking the diagonal in $\cC$ for $1\le i\le n$.
\end{ssect}

The following generalizes \ref{p.gdp}.

\begin{Proposition}\label{p.gdp'}
  Let $\cC$ be a $(2,1)$-category, $\cA_1,\dots, \cA_n$ be 2-faithful subcategories of $\cC$ with $\Ob(\cA_1)=\dots=\Ob(\cA_n)=\Ob(\cC)$, $\cD$ be a 2-category. Assume that every 1-cell of $\cC$ that is an equivalence is contained in $\cA_1\cap \dots \cA_n$ and that $\cA_1,\dots, \cA_n$ are cubing. Then \eqref{e.gdp'} is an isomorphism of 2-categories.
\end{Proposition}

\begin{proof}
  We construct the inverse as follows. Let $((F_i),G,\rho)$  be an object of $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$. For $1\le i,j\le n$, $i\neq j$, let $(F_i,F_j,\bar{G}_{ij})$ be the image of $(F_i,F_j,G_{ij},\rho_{ij})$ under the inverse of \eqref{e.gdp}. First note that for pairwise distinct numbers $1\le i,j,k \le n$, $G$ satisfies (D) for cubes with 2-Cartesian faces and $\rho$ satisfies (F).

  Next we show that $\bar{G}$ satisfies (E) for pairwise distinct numbers $1\le i,j,k \le n$. Let $D$ be a square \eqref{e.2'} where $a,b$ are 1-cells of $\cA_i$ and $p,q$ are 1-cells of $\cA_j\cap \cA_k$, as in (E). Decompose it as
  \[\xymatrix{X\ar[rd]^f\xuppertwocell[rrd]{}^b{^\delta}\xlowertwocell[rdd]{}_q{^\gamma}\\
  &X'\ar[r]^c\ar[d]^r\drtwocell\omit{^\beta} & Y\ar[d]^p\\
  &Z\ar[r]^a & W}\]
  where $c$ is a 1-cell of $\cA_i$, $r$ is a 1-cell of $\cA_j\cap \cA_k$, $f$ is a 1-cell of $\cA_i\cap\cA_j\cap \cA_k$, and the inner square $D'$ is 2-Cartesian. Then the following diagram commutes
  \[\xymatrix{F_i(a)F_k(q)\ar@=[d]^{\rho_{jk}(q)}\ar@=[r]_-{F_k(\gamma)}\ar@=@/^2pc/[rrrr]^{\bar{G}_{ikD}} & F_i(a)F_k(r)F_k(f)\ar@=[d]_{\rho_{jk}(r)\rho_{jk}(f)}\ar@=[r]^{\rho_{ik}(f)}\ar@{}[rd]|{(F)} & F_i(a)F_k(r)F_i(f)\ar@=[r]^{G_{ikD'}}\ar@=[d]^{\rho_{jk}(r)}\ar@{}[rd]|{(E)} & F_k(p)F_i(c)F_i(f)\ar@=[d]^{\rho_{jk}(p)}\ar@=[r]_-{F_i(\delta)} & F_k(p)F_i(b)\ar@=[d]^{\rho_{jk}(p)}\\
  F_i(a)F_j(q)\ar@=[r]^-{F_j(\gamma)}\ar@=@/_2pc/[rrrr]^{\bar{G}_{ijD}} & F_i(a)F_j(r)F_j(f)\ar@=[r]^{\rho_{ik}(f)} & F_i(a)F_j(r)F_i(f)\ar@=[r]^{G_{ijD'}} & F_j(p)F_i(c)F_i(f)\ar@=[r]^-{F_i(\delta)} & F_j(p)F_i(b)}\]

  For pairwise distinct numbers $1\le i,j,k \le n$, we show (D) for $\bar{G}$ by descending induction on the number $m$ of pairs of 2-Cartesian opposite faces in the cube \eqref{e.3}. If $m=3$, all the faces of the cube are 2-Cartesian, so (D) for $\bar{G}$ is identical to (D) for $G$. If $m<3$, by symmetry, we may assume that either the bottom face $K$ or the top face $K'$ is not 2-Cartesian. Decompose the cube as \eqref{e.cube}. The inner cube has more than $m$ pairs of 2-Cartesian opposite faces, hence (D) for $\bar{G}$ holds for the inner cube. Therefore, the following diagram commutes
  {\tiny\[\xymatrix{F_i(a)F_j(q)F_k(x)\ar@=[rr]^{\bar{G}_{jkI'}}\ar@=[d]^{F_j(\gamma)}\ar@=@/_5pc/[dddd]^{\bar{G}_{ijK}}
  && F_i(a)F_k(z)F_j(q') \ar@=[r]^{\bar{G}_{ikJ}}\ar@=[d]^{F_j(\gamma')}
  & F_k(w)F_i(a')F_j(q')\ar@=[d]_{F_j(\gamma')}\ar@=@/^5pc/[dddd]^{\bar{G}_{ijK'}} \\
  F_i(a)F_j(r)F_j(f)F_k(x) \ar@=[r]^{\bar{G}_{jkM}}\ar@=[d]^{\rho_{ij}(f)}\ar@{}[rd]|{(E)}
  & F_i(a)F_j(r)F_k(v)F_j(f') \ar@=[r]^{\bar{G}_{jkI''}}\ar@=[d]^{\rho_{ij}(f')}
  & F_i(a)F_k(z)F_j(r')F_j(f') \ar@=[r]^{\bar{G}_{ikJ}}
  & F_k(w)F_i(a')F_j(r')F_j(f')\ar@=[d]^{\rho_{ij}(f')}\\
  F_i(a)F_j(r)F_i(f)F_k(x) \ar@=[r]^{\bar{G}_{ikM}}\ar@=[d]^{G_{ijL}}
  & F_i(a)F_j(r)F_k(v)F_i(f')\ar@=[r]^{\bar{G}_{jkI''}}\ar@=[d]^{G_{ijL}}\ar@{}[rrd]|{(D)}
  & F_i(a)F_k(z)F_j(r')F_i(f')\ar@=[r]^{\bar{G}_{ikJ}}
  & F_k(w)F_i(a')F_j(r')F_i(f') \ar@=[d]^{G_{ijL'}}\\
  F_j(p)F_i(c)F_i(f')F_k(x)\ar@=[d]^{F_i(\delta)}\ar@=[r]^{\bar{G}_{ikM}}
  & F_j(p)F_i(c)F_k(v)F_i(f')\ar@=[r]^{\bar{G}_{ikJ''}}
  & F_j(p)F_k(y)F_i(c')F_i(f')\ar@=[r]^{\bar{G}_{jkI}}\ar@=[d]^{F_i(\delta')}
  & F_k(w)F_j(p')F_i(c')F_i(f')\ar@=[d]_{F_i(\delta')}\\
  F_j(p)F_i(b)F_k(x)\ar@=[rr]^{\bar{G}_{ikJ'}}
  && F_j(p)F_k(y)F_i(b')\ar@=[r]^{\bar{G}_{jkI}}
  & F_k(w)F_j(p')F_i(b')}\]
  }where $M$ is the square $X'V'XV$.

  Any 1-cell
  \[(\alpha_i)\colon ((F_i),G,\rho)\to ((F'_i),G',\rho')\]
  of $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a 1-cell $((F_i),\bar{G})\to ((F'_i),\bar{G}')$ of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$. Any 2-cell $(\Xi_i)\colon (\alpha_i)\Rightarrow (\alpha'_i)$ of $\GD'_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is a 2-cell of $\GD_{\cA_n,\dots,\cA_n}(\cC,\cD)$.

  It is clear that the 2-functor defined in this way is the inverse of \eqref{e.gdp'}.
\end{proof}

If $n\ge 2$ and $\cB$ is a 2-faithful subcategory of $\cC$ containing $\cA_1$ and $\cA_2$, the $\twoFun(\Ob(\cC),\cD)$-functor \eqref{e.glue}
\begin{equation}\label{e.glueB}
  \PsFun(\cB,\cD)\to \GD_{\cA_1,\cA_2}(\cB,\cD)
\end{equation}
induces a $\twoFun(\Ob(\cC),\cD)$-functor
  \begin{equation}\label{e.glue'}
    \GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)\to \GD_{\cA_1,\dots,\cA_n}(\cC,\cD)
  \end{equation}
as follows. For any object $(F_\cB,(F_i)_{3\le i\le n},(G_{\cB j})_{3\le j\le n},(G_{ij})_{3\le i<j\le n})$ of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$, let $(F_1,F_2,G_{12})$ be the image of $F_\cB$ under \eqref{e.glueB}. Then $F_1=F_\cB|\cA_1$ and $F_2=F_\cB|\cA_2$. For $i=1,2$ and $3\le j\le n$, let $G_{ij}$ be the restriction of $G_{\cB j}$. Then $((F_i)_{1\le i\le n}, (G_{ij})_{1\le i<j\le n})$ is an object of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$.
For any 1-cell $(\alpha_\cB,(\alpha_i)_{3\le i\le n})$ of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$, let $(\alpha_1,\alpha_2)=(\alpha_\cB|\cA_1,\alpha_\cB|\cA_2)$ be the image of $\alpha_\cB$ under \eqref{e.glueB}. Then $(\alpha_i)_{1\le i\le n}$ is a 1-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$. For any 2-cell $(\Xi_\cB,(\Xi_i)_{3\le i\le n})$ of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$, let $(\Xi_1,\Xi_2)=(\Xi_\cB|\cA_1, \Xi_\cB|\cA_2)$ be the image of $\Xi_\cB$ under \eqref{e.glueB}. Then $(\Xi_i)_{1\le i \le n}$ is a 2-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$. The 2-functor \eqref{e.glue'} is 2-faithful if $\cA$ and $\cB$ generate $\cC$ (\ref{s.gen}).

The case $\cB=\cA_2$ is simple:

\begin{Proposition}\label{p.gluet}
  Let $\cC$ be a $(2,1)$-category, $n\ge 2$, $\cA_1,\dots, \cA_n$ be 2-faithful subcategories of $\cC$ with $\Ob(\cA_1)=\dots=\Ob(\cA_n)=\Ob(\cC)$, $\cA_1\subset \cA_2$, $\cD$ be a 2-category. Then the 2-functor \eqref{e.glue'}
  \[Q\colon \GD_{\cA_2,\dots,\cA_n}(\cC,\cD)\to \GD_{\cA_1,\dots,\cA_n}(\cC,\cD)\]
  is a $\twoFun(\Ob(\cC),\cD)$-quasi-inverse to the projection 2-functor $P$.
\end{Proposition}

\begin{proof}
  It is clear that $PQ$ is the identity functor. For any object $((F_i),(G_{ij}))$ of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$, $\rho_{12}\colon F_2|\cA_1\to F_1$ defines an invertible 1-cell
  \[(\rho_{12},\one_{F_2},\dots,\one_{F_n})\colon QP((F_i),(G_{ij})) \to ((F_i),(G_{ij})).\]
  This gives a $\twoFun(\Ob(\cC),\cD)$-natural equivalence $QP\Rightarrow \one$.
\end{proof}

The following generalizes \ref{p.glue}.

\begin{Theorem}\label{p.glue'}
  Let $\cC$ be a $(2,1)$-category, $n\ge 2$, $\cA_1,\dots, \cA_n,\cB$ be 2-faithful subcategories (\ref{s.faith}) of $\cC$ with $\Ob(\cA_1)=\dots=\Ob(\cA_n)=\Ob(\cB)=\Ob(\cC)$, $\cA_1,\cA_2\subset \cB$, $\cD$ be a 2-category. Assume the following
  \begin{description}
    \item[(i)] Every 1-cell of $\cB$ is isomorphic to $pa$ for some 1-cell $a$ of $\cA_1$ and some 1-cell $p$ of $\cA_2$.
    \item[(ii)] 2-fiber products exist in $\cA_2$ and are 2-fiber products in $\cB$.
    \item[(iii)] For $3\le i \le n$, 2-base changes of 1-cells of $\cA_i$ by 1-cells of $\cA_2$ in $\cC$ exist and are 1-cells of $\cA_i$.
    \item[(iv)] For $i=1,2$ and $3\le j\le n$, 1-cells of $\cA_i$ are stable under 2-base change by 1-cells of $\cA_j$ in $\cC$, whenever the 2-base change exists.
    \item[(v)] For any $3\le i\le n$, $\cB$ and $\cA_i$ are squaring in $\cC$ (\ref{s.square}).
    \item[(vi)] For any $3\le i\le n$, $\cA_1\cap \cA_i$ and $\cA_2\cap \cA_i$ generate $\cB\cap \cA_i$.
  \end{description}
  Then \eqref{e.glue'} is 2-fully faithful. Moreover, \eqref{e.glue'} is a $\twoFun(\Ob(\cC),\cD)$-equivalence (\ref{s.faith}) under the following additional assumptions
  \begin{description}
    \item[(iv')] For $i=1,2$ and $3\le j\le n$, $\cA_i$ and $\cA_j$ are squaring.
    \item[(v')] $\cB, \cA_3, \dots, \cA_n$ are cubing in $\cC$ (\ref{s.cube}).
    \item[(vi')] For any $3\le i\le n$, every 1-cell of $\cB\cap \cA_i$ is isomorphic to $pa$ for some 1-cell $a$ of $\cA_1\cap \cA_i$ and some 1-cell $p$ of $\cA_2\cap \cA_i$.
    \item[(vii)] For any $3\le i\le n$, 2-fiber products exist in $\cA_2\cap \cA_i$ and are 2-fiber products in $\cB\cap \cA_i$.
    \item[(viii)] For $3\le i \le n$, 2-base changes of 1-cells of $\cA_2\cap\cA_i$ by 1-cells of $\cA_1$ in $\cC$ exist.
    \item[(ix)] For $i=1,2$ and $3\le j\le n$, 1-cells of $\cA_i\cap \cA_j$ are stable under 2-base change by 1-cells of $\cB$ and by 1-cells of $\cA_j$ in $\cC$, whenever the 2-base change exists.
    \item[(x)] For $3\le i<j\le n$, $\cA_1\cap\cA_i\cap\cA_j$ and $\cA_2\cap\cA_i\cap\cA_j$ generate $\cB\cap \cA_i\cap \cA_j$.
  \end{description}
\end{Theorem}

Note that (v') implies (v), (vi') implies (vi). If $\cC$ admits 2-fiber products, and $\cA_i$, $1\le i\le n$ and $\cB$ are stable under 2-base change in $\cC$ and taking the diagonal in $\cC$, then all the conditions, except (i), (vi), (vi') and (x), are automatic.

\begin{proof}
  The case $n=2$ is \ref{p.glue}. In the sequel we assume $n\ge 3$. Then (iii) and (iv) imply that $\cA_1\cap\dots\cap\cA_n$ contains all 1-cells of $\cC$ that are equivalences.

  Since $\cA_1$ and $\cA_2$ generate $\cB$ by (i), \eqref{e.glue'} is 2-faithful. Let $(F_\cB,(F_i),(G_{\cB j}),(G_{ij}))$ and $(F'_\cB,(F'_i),(G'_{\cB j}),(G'_{ij}))$ be objects of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$ and
  \[(\epsilon_i)\colon ((F_i),G)\to ((F'_i),G')\]
  be a 1-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ whose source and target are respectively the images of $(F_\cB,(F_i),(G_{\cB j}),(G_{ij}))$ and $(F'_\cB,(F'_i),(G'_{\cB j}),(G'_{ij}))$ under \eqref{e.glue'}. By (i), (ii) and \ref{p.glue}, $(\epsilon_1,\epsilon_2)$ has a unique inverse image $\epsilon_\cB\colon F_\cB\to F'_\cB$ in $\PsFun(\cB,\cD)$. We claim that
  \[(\epsilon_\cB,(\epsilon_i))\colon (F_\cB,(F_i),G)\to (F'_\cB,(F'_i),G')\]
  is a 1-cell of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$. By (v), it suffices to check the compatibility with $G_{\cB iD}$ for 2-Cartesian diagrams $D$, and with $\rho_{\cB i}$, $3\le i\le n$. By (vi), the square
  \[\xymatrix{F_{i}|\cB\cap\cA_i \ar[r]^{\rho_{\cB i}}\ar[d]^{\epsilon_i|\cB\cap\cA_i} & F_{\cB}|\cB\cap\cA_i\ar[d]^{\epsilon_\cB|\cB\cap\cA_i}\\
  F'_i|\cB\cap\cA_i \ar[r]^{\rho'_{\cB i}} & F'_\cB|\cB\cap\cA_i}\]
  commutes because it commutes after restriction to $\cA_1\cap \cA_i$ and to $\cA_2\cap \cA_i$. By (i) and (iii), any 2-Cartesian square $D$ \eqref{e.2'} with $a,b$ in $\cB$ and $p,q$ in $\cA_i$ can be completed into a commutative prism with 2-Cartesian joining faces
  \begin{equation}\label{e.prism}
  \xymatrix{&U\ar[dd]^(.3){r}|\hole \ar[rd]^{b_2}\ar@{}[rddd]|{D_2}\ar@{}[lddd]|{D_1}\\
  X\ar[ru]^{b_1}\ar[dd]^q\ar[rr]_(.3)b & {}\ltwocell\omit{<2>\delta}& Y\ar[dd]^p\\
  & V\ar[rd]^{a_2} \\
  Z\ar[ru]^{a_1}\ar[rr]_(.3)a & {}\ltwocell\omit{<2>\gamma}& W}
  \end{equation}

  with $a_1$ in $\cA_1$ and $a_2$ in $\cA_2$. By (iii), $r$ is in $\cA_i$. By (iv), $b_1$ is in $\cA_1$ and $b_2$ is in $\cA_2$.
  Then the following diagram commutes
  \[\xymatrix@C=5em{\epsilon_0(W)F_\cB(a)F_i(q)\ar@=[d]^{F'_\cB(\gamma)}\ar@=@/_7.5pc/[dddd]_{G_{\cB iD}}\ar@=[r]^{\epsilon_\cB(a)\epsilon_i(q)}
  & F'_\cB(a)F'_i(q)\epsilon_0(X)\ar@=[d]_{F_\cB(\gamma)}\ar@=@/^7.5pc/[dddd]^{G'_{\cB iD}}\\
  \epsilon_0(W)F_2(a_2)F_1(a_1)F_i(q)\ar@=[d]^{G_{1iD_1}}\ar@=[r]^{\epsilon_2(a_2)\epsilon_1(a_1)\epsilon_i(q)}
  & F'_2(a_2)F'_1(a_1)F'_i(q)\epsilon_0(X)\ar@=[d]^{G'_{1iD_1}}\\
  \epsilon_0(W)F_2(a_2)F_i(r)F_1(b_1)\ar@=[d]^{G_{2iD_2}}\ar@=[r]^{\epsilon_2(a_2)\epsilon_i(r)\epsilon_1(b_1)}
  & F'_2(a_2)F'_i(r)F'_1(b_1)\epsilon_0(X)\ar@=[d]^{G'_{2iD_2}}\\
  \epsilon_0(W)F_i(p)F_2(b_2)F_1(b_1)\ar@=[d]^{F_\cB(\delta)^{-1}}\ar@=[r]^{\epsilon_i(p)\epsilon_2(b_2)\epsilon_1(b_1)}
  & F'_i(p)F'_2(b_2)F'_1(b_1)\epsilon_0(X)\ar@=[d]_{F'_\cB(\delta)^{-1}}\\
  \epsilon_0(W)F_i(p)F_\cB(b)\ar@=[r]^{\epsilon_i(p)\epsilon_\cB(b)}
  & F'_i(p)F'_\cB(b)\epsilon_0(X)}\]
  Here $\epsilon_0=\lvert \epsilon_1\rvert = \dots =\lvert \epsilon_n\rvert$. The image of $(\epsilon_\cB,(\epsilon_i))$ under \eqref{e.glue'} is $(\epsilon_i)$. Therefore \eqref{e.glue'} is 2-fully faithful.

  It remains to show that, under the additional assumptions, every object $((F_i),G)$ of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$ is in the $\twoFun(\Ob(\cC),\cD)$-essential image of \eqref{e.glue'}. We construct an object
  \[(F_\cB,(F_i),(G_{\cB j}),(G_{ij}),(\rho_{\cB j}), (\rho_{ij}))\]
  of $\GD'_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$ as follows. By \ref{p.glue}, there exists an object $F_\cB$ of $\PsFun(\cB,\cD)$ with $\lvert F_\cB \rvert = \lvert F_1\rvert=\lvert F_2\rvert$ equipped with an invertible 1-cell $(\epsilon_1,\epsilon_2)\colon (F_1,F_2,G_{12})\to(F_\cB|\cA_1,F_\cB|\cA_2,F_\cB)$, where the target is the image of $F_\cB$ under \eqref{e.glueB}, with $\lvert \epsilon_1\rvert =\lvert \epsilon_2\rvert = \one_{\lvert F_\cB\rvert}$. For $3\le i \le n$, by (vi'), (vii) and \ref{p.glue}, the 2-functor
  \[\PsFun(\cB\cap\cA_i,\cD)\to \GD_{\cA_1\cap\cA_i,\cA_2\cap\cA_i}(\cB\cap\cA_i,\cD)\]
  is a $\twoFun(\Ob(\cC),\cD)$-equivalence. For any square $D$ \eqref{e.2'} with $a,b$ in $\cA_1\cap \cA_i$ and $p,q$ in $\cA_2\cap \cA_i$, the following diagram commutes
  \[\xymatrix{F_i(a)F_i(q)\ar@=[d]^{F_i(\alpha)} \ar@=[r]^{\rho_{i1}(a)}\ar@{}[rd]|{(c')}
  &F_1(a)F_i(q)\ar@=[r]^{\rho_{i2}(q)}\ar@=[d]^{G_{1iD}}\ar@{}[rd]|{(E)}
  & F_1(a)F_2(q)\ar@=[d]^{G_{12D}}\\
  F_i(p)F_i(b)\ar@=[r]^{\rho_{i1}(b)} & F_i(p)F_1(b)\ar@=[r]^{\rho_{i2}(q)} & F_2(p)F_1(b)
  }\]
  In other words,
  \[(\rho_{i1},\rho_{i2})\colon (F_i|\cA_1\cap\cA_i,F_i|\cA_2\cap\cA_i,F_i|\cB\cap\cA_i)\to (F_1|\cA_1\cap \cA_i,F_2|\cA_2\cap \cA_i,G_{12})\]
  is a 1-cell of $\GD_{\cA_1\cap\cA_i,\cA_2\cap\cA_i}(\cB\cap\cA_i,\cD)$. Composing it with \[(\epsilon_1|\cA_1\cap\cA_i,\epsilon_2|\cA_2\cap\cA_i),\]
  we obtain a 1-cell $\rho_{\cB i}\colon F_i|\cB\cap\cA_i\to F_\cB|\cB\cap\cA_i$ of $\PsFun(\cB\cap\cA_i,\cD)$. For any 2-Cartesian square $D$ \eqref{e.2'} with $a,b$ in $\cB$ and $p,q$ in $\cA_i$, complete it as \eqref{e.prism} and define $G_{\cB iD}$ to be the unique invertible 2-cell making the following diagram commute
  \[\xymatrix{F_\cB(a)F_i(q)\ar@=[d]^{F_\cB(\gamma)}\ar@=[rr]^{G_{\cB iD}} && F_i(p)F_\cB(b)\ar@=[d]^{F_\cB(\delta)}\\
  F_2(a_2)F_1(a_1)F_i(q)\ar@=[r]^{G_{1iD_1}}
  & F_2(a_2)F_i(r)F_1(b_1)\ar@=[r]^{G_{2iD_2}}
  & F_i(p)F_2(b_2)F_1(b_1)}\]
  This does not depend on the choice of the prism. To see this, let
  \[\xymatrix{&U'\ar[dd]^(.3){r'}|\hole \ar[rd]^{b_2'}\ar@{}[rddd]|{D_2'}\ar@{}[lddd]|{D_1'}\\
  X\ar[ru]^{b_1'}\ar[dd]^q\ar[rr]_(.3)b & {}\ltwocell\omit{<2>\delta'}& Y\ar[dd]^p\\
  & V'\ar[rd]^{a_2'} \\
  Z\ar[ru]^{a_1'}\ar[rr]_(.3)a & {}\ltwocell\omit{<2>\gamma'}& W}
  \]
  be another prism with $a'_1$ in $\cA_1$, $a'_2$ in $\cA_2$, $D_1'$ and $D'_2$ 2-Cartesian. As in the proof of \ref{p.glue}, we may assume that there exists a 1-cell of compactifications
  \[(c,\zeta_1,\zeta_2)\colon (V,a_1,a_2,\gamma)\to (V',a_1',a_2',\gamma'),\]
  $c$ in $\cA_2$. Then the second prism can be decomposed into the first prism and the following
  \[\xymatrix{&U'\ar[drr]^{b_2'}\ar@{}[dddr]|E\ar[dd]^(.7){r'}|\hole \\
  X\ar[ru]^{b_1'}\ar[rr]_(.3){b_1}\ar[dd]^q & {}\ltwocell\omit{<1.5>\eta_1} & U\ar[r]_{b_2}\ar[dd]^{r}\ar[ul]^d & Y\ar[dd]^p\xtwocell[llu]{}\omit{<-1.5>\eta_2}\\
  &V'\ar[drr]^(.7){a_2'}|\hole \\
  Z\ar[ru]^{a'_1}\ar[rr]_{a_1} & {}\ltwocell\omit{<1.5>\zeta_1} & V\ar[r]_{a_2}\ar[ul]^c & W\xtwocell[llu]{}\omit{<-1.5>\zeta_2}}\]
  Then the following diagram commutes
  {\scriptsize\[\xymatrix{F_\cB(a)F_i(q)\ar@=[d]^{F_\cB(\gamma)}\ar@=@/_5pc/[ddd]^{F_\cB(\gamma')} &&& F_i(p)F_\cB(b)\ar@=[d]^{F_\cB(\delta)}\ar@=@/^5pc/[ddd]_{F_\cB(\delta')}\\
  F_2(a_2)F_1(a_1)F_i(q)\ar@=[r]^{G_{1iD_1}}\ar@=[d]^{F_2(\zeta_2)}
  & F_2(a_2)F_i(r)F_1(b_1)\ar@=[rr]^{G_{2iD_2}}\ar@=[d]^{F_2(\zeta_2)}
  && F_i(p)F_2(b_2)F_1(b_1)\ar@=[d]^{F_2(\eta_2)}\\
  F_2(a_2')F_2(c)F_1(a_1)F_i(q)\ar@=[r]^{G_{1iD_1}}\ar@=[d]^{F_1(\zeta_1)}\ar@{}[rrd]|{(D)}
  & F_2(a_2')F_2(c)F_i(r)F_1(b_1)\ar@=[r]^{G_{2iE}}
  & F_2(a_2')F_i(r')F_2(d)F_1(b_1)\ar@=[r]^{G_{2iD'_2}}\ar@=[d]^{F_1(\eta_1)}
  & F_i(p)F_2(b_2')F_2(d)F_1(b_1)\ar@=[d]^{F_1(\eta_1)}\\
  F_2(a_2')F_1(a'_1)F_i(q) \ar@=[rr]^{G_{1iD'_1}} && F_2(a_2')F_i(r')F_1(b_1')\ar@=[r]^{G_{2iD'_2}} & F_i(p)F_2(b'_2)F_1(b'_1)}\]}

  Let $3\le i\le n$. We first check axioms (b), (b'), (c) and (c') for $(F_\cB,F_i,G_{\cB i},\rho_{\cB i})$ and 2-Cartesian squares. To check (b), let $H$ be the outer square of the diagram with 2-Cartesian squares
  \[\xymatrix{X\ar[r]^a\ar[d]^q\ar@{}[dr]|D & U\ar[d]^p\\
  Y\ar[r]^b\ar[d]^s\ar@{}[rd]|E & V\ar[d]^r\\
  Z\ar[r]^c & W}\]
  whose horizontal 1-cells are in $\cB$ and vertical 1-cells are in $\cA_i$. It can be completed into a diagram with 2-Cartesian squares
  \[\xymatrix{&\bar{U}\ar[rd]^{a_2}\ar[dd]^(.3){\bar{p}}|\hole\ar@{}[dddl]|{D_1}\ar@{}[dddr]|{D_2}\\
  X\ar[rr]_(.3)a \ar[ru]^{a_1}\ar[dd]^q &{}\ltwocell\omit{<1.5>\alpha}& U\ar[dd]^p\\
  &\bar{V}\ar[rd]^{b_2}\ar[dd]^(.3){\bar{r}}|\hole \ar@{}[dddl]|{E_1}\ar@{}[dddr]|{E_2}\\
  Y\ar[rr]_(.3)b\ar[ru]^{b_1}\ar[dd]^s &{}\ltwocell\omit{<1.5>\beta}& V\ar[dd]^r\\
  &\bar{W}\ar[dr]^{c_2}\\
  Z\ar[rr]^c\ar[ru]^{c_1}&{}\ltwocell\omit{<1.5>\gamma}& W}\]
  with $c_1$ in $\cA_1$, $c_2$ in $\cA_2$.
  Then the following diagram commutes
  \[\xymatrix{F_\cB(c)F_i(s)F_i(q)\ar@=[d]^{F_\cB(\gamma)}\ar@=[rr]^{G_{\cB iE}}\ar@{=}@/_5pc/[dd]
  &&F_i(r)F_\cB(b)F_i(q)\ar@=[d]^{F_\cB(\beta)}\ar@=@/^7.5pc/[dddd]_{G_{\cB i D}}\\
  F_2(c_2)F_1(c_1)F_i(s)F_i(q)\ar@=[r]^{G_{1iE_1}}\ar@=[rd]^{G_{1iH_1}}
  & F_2(c_2)F_i(\bar{r})F_1(b_1)F_i(q)\ar@=[r]^{G_{2iE_2}}\ar@=[d]^{G_{1iD_1}}
  & F_i(r)F_2(b_2)F_1(b_1)F_i(q)\ar@=[d]^{G_{1iD_1}}\\
  *{}\ar@=[rrdd]^{G_{\cB i H}} & F_2(c)F_i(\bar{r})F_i(\bar{p})F_1(a_1)\ar@=[r]^{G_{2iE_2}}\ar@=[rd]^{G_{2iH_2}}
  & F_i(r)F_2(b_2)F_i(\bar{p})F_1(a_1)\ar@=[d]^{G_{1iD_1}}\\
  && F_i(r)F_i(p)F_2(a_2)F_1(a_1)\\
  && F_i(r)F_i(p)F_\cB(a)\ar@=[u]^{F_\cB(\alpha)}}\]
  Here $H_j$ is the square obtained by combining $D_j$ and $E_j$, $j=1,2$. To check (b'), let $I$ be the outer square of the diagram with 2-Cartesian squares
  \[\xymatrix{X\ar[r]^b\ar[d]^p\ar@{}[rd]|D & Y\ar[r]^d\ar[d]^q\ar@{}[rd]|E & Z \ar[d]^{r}\\
  U\ar[r]^a & V\ar[r]^c & W}\]
  whose horizontal 1-cells are in $\cB$ and vertical 1-cells are in $\cA_i$. It can be completed into a diagram with 2-Cartesian squares
  \[\xymatrix{X\ar[r]^{b_1}\xlowertwocell[rrd]{}_b{^\beta}\ar[dd]^p
  & Y'\ar[rr]^{f_1}\ar[rd]^{b_2}\ar[dd]^(.7){q'} \xtwocell[rrrd]{}\omit{^\phi}
  && Z''\ar[rd]^{f_2}\ar[dd]^(.3){r''}|\hole \\
  && Y\ar[rr]^(.3){d_1}\xlowertwocell[rrrd]{}_d{^\delta}\ar[dd]^(.3)q & & Z'\ar[dd]^(.7){r'}\ar[rd]^{d_2}\\
  U\ar[r]^{a_1}\xlowertwocell[rrd]{}_a{^\alpha} & V'\ar[rr]^(.3){e_1}|\hole\ar[rd]^{a_2}\xtwocell[rrrd]{}\omit{^\eta} && W''\ar[rd]^{e_2} && Z\ar[dd]^r\\
  && V\ar[rr]^{c_1}\xlowertwocell[rrrd]{}_c{^\gamma}&&W'\ar[rd]^{c_2}\\
  &&&&& W}\]
  where $a_1,c_1,e_1$ are 1-cells of $\cA_1$, $a_2,c_2,e_2$ are 1-cells of $\cA_2$. Let $D_1=XY'UV'$, $E_2=Z'ZW'W$, and let $D_2$, $E_1$, $H_1$,  $H_2$ be respectively the left, front, back, right faces of the cube. Then the following diagram commutes
  {\tiny\[\rotatebox{-90}{\xymatrix@=5ex{F_\cB(c)F_\cA(a)F_i(p)\ar@=[r]_{F_\cB(\alpha)}\ar@{=}@/_5pc/[dddd]\ar@=@/^2pc/[rrrr]^{G_{\cB i D}}
  & F_\cB(c)F_2(a_2)F_1(a_1)F_i(p)\ar@=[d]^{F_\cB(\gamma)}\ar@=[r]^{G_{1i D_1}}
  & F_\cB(c)F_2(a_2)F_i(q')F_1(b_1)\ar@=[r]^{G_{2i D_2}}
  & F_\cB(c)F_i(q)F_2(b_2)F_2(b_1)\ar@=[d]^{F_\cB(\gamma)}
  & F_\cB(c)F_i(q)F_\cB(b)\ar@=[l]^-{F_\cB(\beta)}\ar@=[d]^{F_\cB(\gamma)}\ar@=@/^6pc/[dddd]_{G_{\cB i E}}\\
  & F_2(c_2)F_1(c_1)F_2(a_1)F_1(a_1)F_i(p) \ar@=[dl]_{F_\cB(\eta)} \ar@=[r]^{G_{1iD_1}}
  & F_2(c_2)F_1(c_1)F_2(a_1)F_i(q')F_1(b_1) \ar@=[r]^{G_{2iD_2}}\ar@=[dl]^{F_\cB(\eta)}
  & F_2(c_2)F_1(c_1)F_i(q)F_2(b_2)F_1(b_1) \ar@=[d]^{G_{1iE_1}}
  & F_2(c_2)F_1(c_1)F_i(q)F_cB(b) \ar@=[l]^-{F_\cB(\beta)}\ar@=[d]^{G_{1iE_1}}\\
  F_2(c_2)F_2(e_2)F_1(e_1)F_1(a_1)F_i(p) \ar@=[r]_{G_{1iD_1}}
  & F_2(c_2)F_2(e_2)F_1(e_1)F_i(q')F_1(b_1)\ar@=[d]^{G_{1iH_1}}\ar@{}[rr]|{(D)}
  && F_2(c_2)F_i(r')F_1(d_1)F_2(b_2)F_1(b_1)\ar@=[d]^{G_{2iE_2}}\ar@=[ld]^{F_\cB(\phi)}
  & F_2(c_2)F_i(r')F_1(d_1)F_\cB(b)\ar@=[d]^{G_{2iE_2}}\\
  & F_2(c_2)F_2(e_2)F_i(r'')F_1(f_1)F_1(b_1)\ar@=[r]^{G_{2iH_2}}
  & F_2(c_2)F_i(r')F_2(f_2)F_1(f_1)F_1(b_1)\ar@=[d]^{G_{2iE_2}}
  & F_i(r)F_2(d_2)F_1(d_1)F_2(b_2)F_1(b_1)\ar@=[ld]^{F_\cB(\phi)}
  & F_i(r)F_2(d_2)F_1(d_1)F_\cB(b)\ar@=[l]^-{F_\cB(\beta)}\\
  *{}\ar@=@/_2pc/[rrrr]^{G_{\cB i I}} && F_i(r)F_2(d_2)F_2(f_2)F_1(f_1)F_1(b_1)
  && F_i(r)F_\cB(d)F_\cB(b)\ar@=[u]^{F_\cB(\delta)}}}\]
  }To check (c) and (c'), we may replace any 1-cell in the square by a 1-cell isomorphic to it in the same category, because of (b) and (b'). If the square is a composition of two squares, it suffices to check (c) and (c') for the two squares, again by (b) and (b'). By (vi'), (viii) and (ix), we are then reduced to the same axioms for $G_{1i}$ and $G_{2i}$.

  To check (D) for cubes with 2-Cartesian faces, let $3\le i<j\le n$ and \eqref{e.3} be such a cube with $a,b,a',b'$ in $\cB$, $p,q,p',q'$ in $\cA_i$, $x,y,z,w$ in $\cA_j$. By (b) and (b'), we may replace any 1-cell in the cube by a 1-cell isomorphic to it in the same category. Thus we may assume that the cube can be decomposed into the following diagram with 2-Cartesian squares
  \[\xymatrix{X'\ar[rr]^{b_1'}\ar[dd]^x\ar[rd]^{q'}
  && \bar{Y}'\ar[rr]^{b_2'}\ar[dd]^(.3){\bar{y}}|\hole \ar[dr]^{\bar{p}'}
  && Y'\ar[rd]^{p'}\ar[dd]^(.3)y|\hole\\
  & Z'\ar[rr]^(.3){a_1'}\ar[dd]^(.3){z} && \bar{W}'\ar[rr]^(.3){a_2'}\ar[dd]^(.3){\bar{w}} && W'\ar[dd]^w\\
  X\ar[rd]^q\ar[rr]^(.3){b_1}|\hole && \bar{Y}\ar[rd]^{\bar{p}}\ar[rr]^(.3){b_2}|\hole && Y\ar[rd]^p\\
  & Z\ar[rr]^{a_1} && \bar{W}\ar[rr]^{a_2} && W}\]
  where $a_1$ is in $\cA_1$ and $a_2$ is in $\cA_2$.
  Denote the bottom, top, front, back faces of the left (resp.\ right) cube by $K_k,K'_k,J_k,J'_k$, $k=1$ (resp.\ $k=2$), and the common face of the two cubes by $\bar{I}$. Then the following diagram commutes
  \[\xymatrix{F_2(a_2)F_1(a_1)F_i(p)F_j(x)\ar@=[r]_{G_{1 i K_1}}\ar@=@/^1.5pc/[rr]^{G_{\cB i K}}\ar@=[d]^{G_{ij I'}}
  & F_2(a_2)F_i(\bar{p})F_1(b_1)F_j(x)\ar@=[r]_{G_{2iK_2}} \ar@=[d]^{G_{1jJ_1'}}
  & F_i(p)F_2(b_2)F_1(b_1)F_j(x)\ar@=[d]_{G_{1jJ_1'}}\ar@=@/^5.5pc/[dd]_(.8){G_{\cB j J'}}\\
  F_2(a_2)F_1(a_1)F_j(z)F_i(q')\ar@=[d]^{G_{1jJ_1}}\ar@=@/_5.5pc/[dd]^(.2){G_{\cB j J}}
  & F_2(a_2)F_i(\bar{p})F_j(\bar{y})F_1(b_1')\ar@=[r]^{G_{2iK_2}}\ar@=[d]^{G_{ij \bar{I}}}
  & F_i(p)F_2(b_2)F_j(\bar{y})F_1(b'_1)\ar@=[d]_{G_{2jJ'_2}}\\
  F_2(a_2)F_j(\bar{w})F_1(a'_1)F_i(q')\ar@=[d]^{G_{2jJ_2}}\ar@=[r]^{G_{1iK'_1}}
  & F_2(a_2)F_j(\bar{w})F_i(\bar{p}')F_1(b_1')\ar@=[d]^{G_{2jJ_2}}
  & F_i(p)F_j(y)F_2(b'_2)F_1(b'_1)\ar@=[d]_{G_{ijI}}\\
  F_j(w)F_2(a'_2)F_1(a'_1)F_i(q')\ar@=[r]^{G_{1iK'_1}}\ar@=@/_1.5pc/[rr]^{G_{\cB i K'}}
  & F_j(w)F_2(a_2')F_i(\bar{p}')F_1(b_1')\ar@=[r]^{G_{2iK'_2}}
  & F_j(w)F_i(p')F_2(b_2')F_1(b_1')}\]
  The proof of (E) for 2-Cartesian squares is similar to the proof of (c) and (c'). By (x), to check (F), it suffices to do so after restriction to $\cA_1\cap \cA_i\cap \cA_j$ and to $\cA_2\cap \cA_i\cap \cA_j$, which follows from (F) for $(\rho_{ij})_{1\le i<j \le n}$.

  By (v') and \ref{p.gdp'}, the object of $\GD'_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$ we constructed defines an object $(F_\cB,(F_i),(G_{\cB j}),(G_{ij}))$ of $\GD_{\cB,\cA_3,\dots,\cA_n}(\cC,\cD)$. It remains to show that \[(\epsilon_1,\epsilon_2,\one_{F_3},\dots,\one_{F_n})\colon (F_1,\dots,F_n,G)\to (F_\cB|\cA_1,F_\cB|\cA_2,F_3,\dots, F_n,G)\]
  is an invertible 1-cell of $\GD_{\cA_1,\dots,\cA_n}(\cC,\cD)$. By (iv'), it suffices to check the compatibility with  $\rho$ and with $G$ for 2-Cartesian squares, which is clear from the construction.
\end{proof}

\begin{ssect}\label{s.adj}
  Let $\cD$ be a 2-category. We denote by $\cD^\op$ the 2-category obtained by reversing 1-cells and 2-cells. In other words, $\Ob(\cD^\op)=\Ob(\cD)$ and, for any pair of objects $X$ and $Y$ of $\cD$, $\cD^\op(Y,X)=\cD(X,Y)^\op$.

  Define a 2-category $\cD^\adj$ with $\Ob(\cD^\adj)=\Ob(\cD)$ as follows. For any pair of objects $X$ and $Y$ of~$\cD$, let $\cD^\adj(X,Y)$ be the category of adjoint pairs from $X$ to $Y$. Hence a 1-cell $X\to Y$ in $\cD^\adj$ is a quadruple $(f,g,\eta,\epsilon)$ consisting of 1-cells $f\colon X\to Y$, $g\colon Y\to X$ and 2-cells $\eta\colon \one_Y\Rightarrow fg$, $\epsilon\colon gf\Rightarrow \one_X$ of~$\cD$ such that the following triangles commute
  \[\xymatrix{f\ar@=[r]^\eta\ar@=[rd]_{\one_f} & fgf\ar@=[d]^{\epsilon} & g\ar@=[r]^\eta\ar@=[rd]_{\one_g} & gfg\ar@=[d]^\epsilon \\
  & f & & g}\]
  The composition of $(f_1,g_1,\eta_1,\epsilon_1)\colon X\to Y$ and $(f_2,g_2,\eta_2,\epsilon_2)\colon Y\to Z$ is
  \[(f_2f_1, g_1g_2,\eta_1\eta_2,\epsilon_1\epsilon_2)\colon X\to Z,\]
  where $\eta_1\eta_2$ is the composition
  \[\xymatrix{\one_Z\ar@=[r]^{\eta_2} & f_2g_2\ar@=[r]^-{\eta_1} & f_2f_1g_1g_2}\]
  and $\epsilon_1\epsilon_2$ is the composition
  \[\xymatrix{g_1g_2f_1f_2\ar@=[r]^-{\epsilon_2} & g_1f_1\ar@=[r]^{\epsilon_1} & \one_X}.\]
  The identity 1-cell of an object $X$ is $(\one_X,\one_X,\one_{\one_X},\one_{\one_X})$. A 2-cell $(f,g,\eta,\epsilon)\Rightarrow (f',g',\eta',\epsilon')$ of $\cD^\adj$ is a pair $(\alpha,\beta)$ of 2-cells $\alpha\colon f\Rightarrow f'$ and $\beta\colon g'\Rightarrow g$ of $\cD$ such that the following squares commute
  \[\xymatrix{\one_Y\ar@=[r]^{\eta}\ar@=[d]^{\eta'} & fg\ar@=[d]^{\alpha} & g'f\ar@=[d]^{\beta}\ar@=[r]^\alpha & g'f'\ar@=[d]^{\epsilon'}\\
  f'g'\ar@=[r]^{\beta} & f'g & gf \ar@=[r]^\epsilon & \one_X}\]
  The projection 2-functors $P_1\colon \cD^\adj\to \cD$ and $P_2\colon \cD^\adj\to \cD^\op$ are pseudo-faithful (\ref{s.faith}).

  Let $\cC$ be a 2-category. We do not assume that $\cC$ is a $(2,1)$-category. Then $P_1$ and $P_2$ induce pseudo-faithful 2-functors
  \[P_1\colon \PsFun(\cC,\cD^\adj)\to \PsFun(\cC,\cD), \quad P_2\colon \PsFun(\cC,\cD^\adj)\to \PsFun(\cC,\cD^\op).\]
  An object $F$ of $\PsFun(\cC,\cD)$ (resp.\ $\PsFun(\cC,\cD^\op)$) is in the image of $P_1$ (resp.\ $P_2$) if and only if for every 1-cell $a$ of $\cC$, $F(a)$ can be completed into an adjoint pair $(F(a), g, \eta, \epsilon)$ (resp. $(f,F(a),\eta,\epsilon)$).
\end{ssect}

\begin{ssect}\label{s.bc}
  Fix a pseudo-functor $F\colon \cC\to \cD^\op$, a 2-faithful subcategory $\cB$ of $\cC$ and a pseudo-functor $B\colon \cB\to \cD^\adj$ such that $P_2(B)=F|\cB$. We denote $F$ by
  \[f\mapsto f^*, \quad \alpha\mapsto \alpha^*,\]
  and the pseudo-functor $R=P_1(B)\colon \cB\to \cD$ by
  \[p\mapsto p_*, \quad \alpha\mapsto \alpha_*.\]

  Let $D$ be a square in $\cC$
  \begin{equation}\label{e.-2}
  \xymatrix{X\ar[r]^j\ar[d]^q\drtwocell\omit{\alpha} & Y\ar[d]^p\\
  Z\ar[r]^i & W}
  \end{equation}
  where $p$ and $q$ are 1-cells of $\cB$. The base change map $B_D$ is by definition the following 2-cell of $\cD$
  \begin{equation}\label{e.bc}
  \xymatrix{i^* p_* \ar@=[r]^-{\eta_q} & q_*q^*i^*p_* \ar@=[r] & q_* (iq)^* p_* \ar@=[r]^{\alpha^*} & q_* (pj)^* p_* \ar@=[r] & q_* j^* p^*p_* \ar@=[r]^-{\epsilon_p} & q_* j^*}.
  \end{equation}

  If $i$ and $j$ are also 1-cells of $\cB$, then $B_D$ is also the composition
  \[\xymatrix{i^*p_*\ar@=[r]^-{\eta_j} & i^*p_*j_*j^*\ar@=[r] & i^* (pj)_* j^* \ar@=[r]^{\alpha_*} & i^* (iq)_* j^* \ar@=[r] & i^* i_* q_* j^* \ar@=[r]^-{\epsilon_i} & q_*j^*}.\]
  In fact, the following diagram commutes
  \[\xymatrix{& i^*p_* \ar@=[rr]^{\eta_q} && q_*q^*i^*p_* \ar@=[dd]^{\alpha^*} \\
  i^* p_*\ar@=[r]^{\eta_i}\ar@=[d]^{\eta_p}\ar@=[ru]^{\one}\ar@=@/_3pc/[dd]_{\one} &i^*i_*i^*p_*\ar@=[u]^{\epsilon_i}\ar@=[r]^{\eta_q}
  & i^* i_* q_* q^* i^* p_* \ar@=[d]^{\alpha^*} \\
  i^*p_*p^*p_*\ar@=[d]^{\epsilon_p}\ar@=[r]^{\eta_j} & i^*p_*j_*j^*p^*p_* \ar@=[r]^{\alpha_*} & i^*i_* q_* j^* p^* p_*\ar@=[d]^{\epsilon_p}\ar@=[r]^{\epsilon_i} & q_* j^* p^* p_*\ar@=[d]^{\epsilon_p}\\
  i^* p_* \ar@=[r]^{\eta_j}& i^*p_*j_*j^*\ar@=[r]^{\alpha_*} & i^*i_*q_*j^*\ar@=[r]^{\epsilon_i} & q_* j^*}\]
\end{ssect}

\begin{Proposition}\label{p.bc}
  (i) Let $D$, $D'$, $D''$ be respectively the upper, lower and outer squares of the diagram in $\cC$
  \[\xymatrix{X_1\ar[r]^{i_1}\ar[d]^{q}\drtwocell\omit{\alpha} &  Y_1\ar[d]^{p}\\
  X_2\ar[r]^{i_2}\drtwocell\omit{\alpha'}\ar[d]^{q'} & Y_2\ar[d]^{p'}\\
  X_3\ar[r]^{i_3} & Y_3}\]
  where the vertical arrows are 1-cells of $\cB$. Then the following diagram commutes
    \[\xymatrix{i_3^* p'_* p_*\ar@=[r]^{B_{D'}}\ar@=[d]& q'_*i_2^* p_*\ar@=[r]^{B_{D}}& q'_*q_*i_1^*\ar@=[d]\\
    i_3^*(p'p)_*\ar@=[rr]^{B_{D''}} & & (q'q)_*i_1^*}\]

  (ii) Let $D$, $D'$, $D''$ be respectively the left, right and outer squares of the diagram in~$\cC$
  \[\xymatrix{X_1\ar[r]^j\ar[d]^{p_1}\drtwocell\omit{\alpha} &  X_2\ar[d]^{p_2}\ar[r]^{j'}\drtwocell\omit{\alpha'} & X_3\ar[d]^{p_3}\\
  Y_1\ar[r]^i & Y_2\ar[r]^{i'} &Y_3}\]
  where the vertical arrows are 1-cells of $\cB$.
    Then the following diagram commutes
    \[\xymatrix{j^*j'{}^*p_{3*}\ar@=[r]^{B_D}& j^*p_{2*}a'{}^*\ar@=[r]^{B_{D'}}& p_{1*}i^*i'{}^*\\
    (j'j)^*p_{3*}\ar@=[rr]^{B_{D''}}\ar@=[u] & & p_{1*}(i'i)^*\ar@=[u]}\]
\end{Proposition}

\begin{proof}
  (i) The following diagram commutes
  \[\xymatrix{i_3^*p'_*p_*\ar@=[r]_{\eta_{q'}} \ar@=@/^1.5pc/[rrr]^{B_{D'}}\ar@=@/_4pc/[rrrddd]^{B_{D''}}
  &q'_*q'{}^*i_3^* p'_* p_* \ar@=[r]^{\alpha'{}^*}\ar@=[d]^{\eta_q}
  & q'_*i_2^* p'{}^* p'_* p_* \ar@=[r]_{\epsilon_{p'}}\ar@=[d]^{\eta_q}
  & q'_*i_2^* p_* \ar@=[d]_{\eta_q}\ar@=@/^3pc/[ddd]^{B_D} \\
  & q'_*q_*q^*q'{}^* i_3^* p'_*p_* \ar@=[r]^{\alpha'{}^*}
  & q'_*q_*q^*i_2^*p'{}^*p'_*p_* \ar@=[r]^{\epsilon_{p'}}\ar@=[d]^{\alpha^*}
  & q'_* q_* q^* i_2^* p_*\ar@=[d]^{\alpha^*}\\
  && q'_*q_*i_1^* p^*p'{}^* p'_* p_* \ar@=[r]^{\epsilon_{p'}} & q'_*q_*i_1^* p^*p_* \ar@=[d]^{\epsilon_p}\\
  &&& q'_* q_* i_1^*}\]

  (ii) Similar to (i).
\end{proof}

\begin{ssect}\label{s.bcA}
  Fix a 2-faithful subcategory $\cA$ of $\cC$ and a pseudo-functor $A\colon \cA\to (\cD^\op)^\adj$ with $P_1(A)=F$. We denote the pseudo-functor $L\colon \cA\to \cD$, composition of $P_2(A)\colon \cA\to (\cD^\op)^\op$ and the isomorphism $(\cD^\op)^\op \to \cD$, by
  \[i\mapsto i_!, \quad \alpha\mapsto \alpha_!.\]

  Let $D$ be a square \eqref{e.-2} in $\cC$ where $i$ and $j$ are 1-cells of $\cA$. The base change map $A_D$ is by definition the following 2-cell in $\cD$
  \begin{equation}\label{e.bc'}
  \xymatrix{j_! q^* \ar@=[r]^-{\eta_i} & j_! q^* i^* i_! \ar@=[r] & j_!(iq)^* i_! \ar@=[r]^{\alpha^*} & j_! (pj)^* i_! \ar@=[r] & j_! j^* p^* i_! \ar@=[r]^-{\epsilon_j} & p^* i_! }.
  \end{equation}
  If $p$ and $q$ are also 1-cells of $\cA$, then $A_D$ is also the composition
  \[\xymatrix{j_!q^* \ar@=[r]^-{\eta_p} & p^*p_! j_! q^* \ar@=[r] & p^* (pj)_! q^* \ar@=[r]^{\alpha_!} & p^* (iq)_! q^*\ar@=[r] & p^*i_!q_!q^*\ar@=[r]^-{\epsilon_q} & p^* i_!}.\]
  We have an analogue of \ref{p.bc} for $A_D$.
\end{ssect}

\begin{ssect}\label{s.GD}
  Let $D$ be a square \eqref{e.-2} in $\cC$ where $i$ and $j$ are 1-cells of $\cA$, $p$ and $q$ are 1-cells of $\cB$. Then
  \[(B_D,A_D)\colon (i^*p_*,p^*i_!,\eta_p\eta_i,\epsilon_p\epsilon_i)\Rightarrow (q_*j^*, j_!q^*,\eta_q\eta_j,\epsilon_q\epsilon_j)\]
  is a 2-cell of $\cD^\adj$. In fact, the following diagrams commute
  \[
  \xymatrix{\one_Z\ar@=[r]^{\eta_i}\ar@=[d]^{\eta_q} &i^* i_!\ar@=[r]^{\eta_p}\ar@=[d]^{\eta_q}
  & i^*p_*p^* i_!\ar@=[d]^{\eta_q}\ar@{=}[rd]\\
  q_*q^* \ar@=[r]^{\eta_i}\ar@=[d]^{\eta_j} & q_* q^* i^* i_!\ar@=[rd]^{\alpha^*} & q_* q^* i^* p_*p^* i_!\ar@=[rd]^{\alpha^*} & *{}\ar@=@/^3pc/[dd]^{B_D}\\
  q_*j^*j_!q^*\ar@=[r]^{\eta_i}\ar@=@/_3pc/[rrrd]^{A_D} & q_*j^*j_!q^*i^*i_!\ar@=[rd]^{\alpha^*}
  & q_*j^*p^* i_! \ar@=[r]^{\eta_p}\ar@=[d]^{\eta_j}\ar@=[rd]^{\one} & q_*j^*p^*p_*p^* i_!\ar@=[d]^{\epsilon_p}\\
  && q_*j^* j_!j^*p^* i_! \ar@=[r]^{\epsilon_j} & q_* j^* p^* i_!}
  \]
  \[
  \xymatrix{
  j_!q^*i^*p_*\ar@=@/^3pc/[rrrd]_{B_D}\ar@=[r]^{\eta_q}\ar@=[rd]^{\one}\ar@=[d]^{\eta_i}\ar@{=}@/_3pc/[dd]_{A_D} & j_!q^*q_*q^*i^*p_*\ar@=[d]^{\epsilon_q}\ar@=[rd]^{\alpha^*}\\
  j_!q^*i^*i_!i^*p_*\ar@=[r]^{\epsilon_i}\ar@=[rd]^{\alpha^*} & j_!q^*i^*p_*\ar@=[rd]^{\alpha^*} & j_!q^*q_*j^*p^*p_*\ar@=[r]^{\epsilon_p}
  & j_!q^*q_*j^*\ar@=[d]^{\epsilon_q}\\
  *{}\ar@=[rd] & j_!j^*p^*i_!i^*p_*\ar@=[d]^{\epsilon_j} & j_!j^*p^*p_*\ar@=[r]^{\epsilon_p}\ar@=[d]^{\epsilon_j} & j_!j^*\ar@=[d]^{\epsilon_j}\\
  & p^*i_!i^*p_*\ar@=[r]^{\epsilon_i} & p^*p_*\ar@=[r]^{\epsilon_p} & \one_X}
  \]

  It follows that $B_D$ is invertible if and only if $A_D$ is. In this case, the following diagram commutes
  \[\xymatrix{i_! q_* \ar@=[r]^{\eta_j}\ar@=[d]^{\eta_p} & i_!q_*j^*j_!\ar@=[r]^{B_D^{-1}} & i_!i^*p_*j_!\ar@=[d]^{\epsilon_i} \\
  p_*p^*i_!q_*\ar@=[r]^{A_D^{-1}} & p_*j_!q^*q_*\ar@=[r]^{\epsilon_q} & p_*j_!}\]
  and we define $G_D\colon i_!q_*\Rightarrow p_* j_!$ to be the composition. In fact, the following diagram commutes
  \[\xymatrix{& i_! q_*\ar@=[rr]^{\eta_j} && i_!q_*j^*j_!\ar@=[dd]^{B_D^{-1}}\\
  i_!q_*\ar@=[ur]^{\one}\ar@=[r]^{\eta_q}\ar@=@/_2pc/[dd]_{\one}\ar@=[d]^{\eta_i} & i_!q_*q^*q_*\ar@=[r]^{\eta_j}\ar@=[u]^{\epsilon_q}
  & i_!q_*j^*j_!q^*q_* \ar@=[d]^{B_D^{-1}}\\
  i_!i^*i_!q_*\ar@=[r]^{\eta_p}\ar@=[d]^{\epsilon_i} & i_!i^*p_*p^*i_!q_*\ar@=[r]^{A_D^{-1}}
  & i_!i^*p_*j_!q^*q_*\ar@=[r]^{\epsilon_p}\ar@=[d]^{\epsilon_i} & i_!i^*p_*j_!\ar@=[d]^{\epsilon_i}\\
  i_!q_*\ar@=[r]^{\eta_p} & p_*p^*a_!q_*\ar@=[r]^{A_D^{-1}} & p_*j_!q^*q_* \ar@=[r]^{\epsilon_q} & p_*j_!}\]
  where the hexagon commutes because the following diagram commutes
  \[\xymatrix{& q_*q^*\ar@=[r]^{\eta_j} & q_* j^*j_!q^* \ar@=[rd]^{B_D^{-1}} \ar@=[dl]^{A_D}\\
  \one_Z\ar@=[ru]^{\eta_q}\ar@=[rd]^{\eta_i} &q_*j^*p^*i_!\ar@=[rd]^{B_D^{-1}} && i^*p_*j_!q^* \ar@=[ld]^{A_D}\\
  & i^*i_! \ar@=[r]^{\eta_p} & i^*p_*p^*i_!}\]
\end{ssect}

\begin{ssect}\label{s.rho}
  Let $f\colon X\to Y$ be a 1-cell of $\cA\cap \cB$. Then
  \[(\epsilon_f^B,\eta^A_f)\colon (f^*f_*,f^*f_!,\eta_f^B\eta_f^A,\epsilon_f^B\epsilon_f^A)\Rightarrow (\one_X,\one_X,\one_{\one_X},\one_{\one_X})\]
  is a 2-cell of $\cD^\adj$. It follows that $\epsilon_f^B$ is invertible if and only if $\eta_f^A$ is. In this case, the following diagram commutes
  \[\xymatrix{f_!\ar@=[r]^{\eta_f^B}\ar@=[d]^{(\epsilon_f^B)^{-1}} & f_*f^*f_!\ar@=[d]^{(\eta_f^A)^{-1}}\\
  f_!f^*f_*\ar@=[r]^{\epsilon_f^A} & f_*}\]
  and we define $\rho_f\colon f_!\Rightarrow f_*$ to be the composition. In fact, the following diagram commutes
  \[\xymatrix{&& f_*\ar@=[rd]^{\eta^A}\\
  & f_!f^*f_*\ar@=[r]^{\eta^A}\ar@=[d]^{\eta^B}\ar@=[ur]^{\epsilon^A}\ar@=[ld]_{\epsilon^B} & f_!f^*f_*f^*f_!\ar@=[r]^{\epsilon^A}\ar@=[d] & f_*f^*f_!\ar@=[d]^{\eta^B} \ar@=@/^3pc/[dd]^{\one}\\
  f_!\ar@=[rd]_{\eta^B} & f_*f^*f_!f^*f_*\ar@=[r]\ar@=[d]^{\epsilon^B} & f_*f^*f_!f^*f_*f^*f_! \ar@=[r]\ar@=[d]
  & f_*f^*f_*f^*f_!\ar@=[d]^{\epsilon^B}\\
  & f_*f^* f_! \ar@=[r]^{\eta^A} \ar@=@/_1.5pc/[rr]^{\one} & f_*f^*f_!f^*f_!\ar@=[r]^{\epsilon^A} & f_* f^*f_!}\]

  Let $X\xrightarrow{f}Y\xrightarrow{g} Z$ be a pair of composable 1-cells of $\cA\cap \cB$ with $\epsilon_f^B$ and $\epsilon_g^B$ invertible. Then the following diagram commutes
  \[\xymatrix{g_!f_!\ar@=[r]_{\eta_f^B}\ar@=@/^1.5pc/[rr]^{\rho_a}\ar@=@/_3pc/[rrdd]^{\rho_{gf}} & g_!f_*f^*f_!\ar@=[r]_-{(\eta_f^A)^{-1}}\ar@=[d]^{\eta_g^B} & g_!f_*\ar@=[d]^{\eta_g^B}\ar@=@/^3pc/[dd]^{\rho_g}\\
  & g_*g^*g_!f_*f^*f_! \ar@=[r]^-{(\eta_f^A)^{-1}} & g_*g^*g_!f_*\ar@=[d]_{(\eta_g^A)^{-1}}\\
  && g_*f_*}\]
\end{ssect}

The following properties of $G_D$ and $\rho_f$ are similar to axioms (b), (b') of \ref{s.gd} and (c), (c') of \ref{s.gdp}.

\begin{Proposition}\label{p.ax}
  (i) In the situation of \ref{p.bc} (i), if the horizontal arrows are 1-cells of $\cA$, the vertical arrows are 1-cells of $\cB$, and if $B_D$ and $B_{D'}$ are invertible, then the following diagram commutes
  \[\xymatrix{i_{3!}q'_* q_* \ar@=[r]^{G_{D'}}\ar@=[d] & p_*i_{2!}q_* \ar@=[r]^{G_{D}} & p'_*p_*i_{1!}\ar@=[d]\\
  i_{3!}(q'q)_* \ar@=[rr]^{G_{D''}} & & (p'p)_* i_{1!}}\]

  (ii) In the situation of \ref{p.bc} (ii), if the horizontal arrows are 1-cells of $\cA$, the vertical arrows are 1-cells of $\cB$, and if $B_D$ and $B_{D'}$ are invertible, then the following diagram commutes
  \[\xymatrix{i'_!i_!p_{1*}\ar@=[d]\ar@=[r]^{G_D} & i'_!p_{2*}j_! \ar@=[r]^{G_{D'}} & p_{3*}j'_!j_!\ar@=[d]\\
  (i'i)_!p_{1*}\ar@=[rr]^{G_{D''}} && p_{3*}(j'j)_!}\]

  (iii) Let $D$ be a square \eqref{e.-2} in $\cC$ where $i$ and $j$ are 1-cells of $\cA$, $p$ and $q$ are 1-cells of $\cA\cap \cB$, $\epsilon_p^B$, $\epsilon_q^B$ and $B_D$ are invertible. Then the following diagram commutes
  \[\xymatrix{i_!q_*\ar@=[d]^{G_D} & i_!q_!\ar@=[l]^{\rho_q} & (iq)_!\ar@=[l]\\
  p_*j_! & p_!j_!\ar@=[l]^{\rho_p} & (pj)_!\ar@=[l]\ar@=[u]^{\alpha_!}}\]

  (iv) Let $D$ be a square \eqref{e.-2} in $\cC$ where $i$ and $j$ are 1-cells of $\cA\cap \cB$, $p$ and $q$ are 1-cells of $\cB$, $\epsilon_i^B$, $\epsilon_j^B$ and $B_D$ are invertible. Then the following diagram commutes
  \[\xymatrix{i_!q_* \ar@=[r]^{\rho_i}\ar@=[d]^{G_D} & i_*q_* \ar@=[r] & (iq)_*\\
  p_*j_!\ar@=[r]^{\rho_j} & p_*j_* \ar@=[r] & (pj)_* \ar@=[u]^{\alpha_*}}\]
\end{Proposition}

\begin{proof}
  (i) Similar to (ii).

  (ii) The following diagram commutes
  \[\xymatrix{i'_!i_!p_{1*}\ar@=[r]_{\eta_j}\ar@=@/^1.5pc/[rrr]^{G_D}\ar@=@/_3.5pc/[rrrddd]^{G_{D''}}
  &i'_!i_!p_{1*}j^*j_!\ar@=[r]^{B_{D}^{-1}}\ar@=[d]^{\eta_{j'}}
  & i'_!i_*i^*p_{2*}j_!\ar@=[r]_{\epsilon_i}\ar@=[d]^{\eta_{j'}}
  & i'_! p_{2*} j_!\ar@=[d]^{\eta_{j'}} \ar@=@/^3pc/[ddd]^{G_{D'}}\\
  & i'_!i_!p_{1*}j^*j'{}^{*}j'_!j_! \ar@=[r]^{B_D^{-1}}
  & i'_!i_!i^*p_{2*}j'{}^*j'_!j_! \ar@=[r]^{\epsilon_i} \ar@=[d]^{B_{D'}^{-1}}
  & i'_!p_{2*}j'{}^*j'_!j_!\ar@=[d]^{B_{D'}^{-1}}\\
  && i'_!i_!i^*i'{}^*p_{3*}j'_!j_*\ar@=[r]^{\epsilon_i}
  & i'_1i'{}^*p_{3*}j'_!j_! \ar@=[d]^{\epsilon_{i'}}\\
  &&& p_{3*}j'_!j_!}\]

  (iii) Similar to (iv).

  (iv) The following diagram commutes
  \[\xymatrix{i_!q_*\ar@=[r]_{\eta_i^B}\ar@=[d]^{\eta_j^A}\ar@=@/^1.5pc/[rr]^{\rho_i}\ar@=@/_3pc/[ddd]^{G_D}
  & i_*i^*i_!q_*\ar@=[r]_{(\eta_i^A)^{-1}}\ar@=[d] & i_*q_*\ar@=[d]_{\eta_j^A}^{\simeq}\\
  i_!q_*j^*j_!\ar@=[r]\ar@=[d]^{B_D^{-1}} & i_*i^*i_!q_*j^*j_!\ar@=[r]\ar@=[d] & i_*q_*j^*j_!\ar@=[d]_{B_D^{-1}}^\simeq\\
  i_!i^*p_*j_!\ar@=[r]^{\eta_i^B}\ar@=[d]^{\epsilon_i^A}
  & i_*i^*i_!i^*p_*j_! \ar@=[r]^{(\eta_f^A)^{-1}}\ar@=[d]^{\epsilon_i^A} & i_*i^*p_*j_!\\
  p_*j_!\ar@=[r]^{\eta_i^B}\ar@=@/_1.5pc/[rr]_(.7){\eta_j^B}\ar@=@/_3pc/[rrr]_{\rho_j}
  & i_*i^*p_*j_!\ar@=[ur]^{\one} & p_*j_*j^*j_!\ar@=@/_3pc/[uu]^{\alpha_*}\ar@=[r]^-{(\eta_j^A)^{-1}}
  & p_*j_*\ar@=@/_1.5pc/[uuul]_{\alpha_*}}\]
  where the pentagon commutes because the following diagram commutes
  \[\xymatrix{p_*\ar@=[r]^{\eta_i^B}\ar@=[d]^{\eta_p}\ar@=@/_3pc/[dd]_{\one_{p_*}}
  & i_*i^*p_*\ar@=[r]^{\eta_q}\ar@{=}@/^2pc/[rr] &  i_* q_*q^*i^*p_*\ar@=[d]^{\alpha^*} & *{}\ar@=@/^2pc/[ddl]_{B_D}\\
  p_*p^*p_*\ar@=[r]^{\eta_j^B}\ar@=[d]^{\epsilon_p} & p_*j_*j^*p^*p_*\ar@=[r]^{\alpha^*}
  & i_*q_*j^*p^*p_*\ar@=[d]^{\epsilon_p}\\
  p_*\ar@=[r]^{\eta_j^B} & p_*j_*j^*\ar@=[r]^{\alpha_*} & i_*q_*b^*}\]
\end{proof}

\begin{Proposition}\label{p.rhoAB}
  Let $D$ be a square \eqref{e.-2} in $\cC$ where $i$ and $j$ are 1-cells of  $\cA\cap \cB$, $\epsilon_i^B$, $\epsilon_j^B$ and $\alpha$ are invertible, and let $D'$  be the square obtained by inverting $\alpha$. Then the following diagram commutes
  \[\xymatrix{j_!q^*\ar@=[r]^{A_D}\ar@=[d]^{\rho_j} & p^* i_!\ar@=[d]^{\rho_i}\\
  j_*q^* & p^*i_*\ar@=[l]^{B_{D'}}}\]
\end{Proposition}

\begin{proof}
  The following diagram commutes
  \[\xymatrix{j_!q^*\ar@=[r]_{\eta_j^B}\ar@=@/^1.5pc/[rr]^{\rho_j}\ar@=[d]^{\eta_i^A}\ar@=@/_3pc/[ddd]^{A_D}
  & j_!j^*j_*q^*\ar@=[r]_{(\eta_j^A)^{-1}} & j_*q^*\ar@=[d]^{\eta_i^A}\\
  j_!q^*i^*i_!\ar@=[d]^{\alpha^*} && j_*q^*i^*i_!\ar@=[d]^{\alpha^*}\ar@=@/^3pc/[ddd]_{\eta_i^B}\ar@=@/^1.5pc/[dddr]^{\one}\\
  j_!j^*p^*i_!\ar@=[r]^{\eta_j^B}\ar@=[d]^{\epsilon_j^A}
  & j_!j^*j_*j^*p^*i_!\ar@=[d]^{\epsilon_j^A}\ar@=[r]^{(\eta_j^A)^{-1}}
  & j_*j^*p^*i_!\ar@=[dl]^{\one}\\
  p^*i_!\ar@=[d]^{\eta_i^B}\ar@=@/_3pc/[dd]^{\rho_i} & j_*j^*p^*i_!\ar@=[d]^{\eta_i^B}\\
  p^*i_*i^*i_!\ar@=[d]^{(\eta_i^A)^{-1}}\ar@=[r]^{\eta_j^B}
  & j_*j^*p^*i_*i^*i_!\ar@=[r]^{(\alpha^{-1})^*}\ar@=[d]^{(\eta_i^A)^{-1}}
  & j_*q^*i^*i_*i^*i_!\ar@=[r]^{\epsilon_i^B}
  & j_*q^*i^*i_! \ar@=[d]^{(\eta_i^A)^{-1}}\\
  p^*i_*\ar@=[r]^{\eta_j^B}\ar@=@/_1.5pc/[rrr]^{B_{D'}}
  & j_*j^*p^*i_*\ar@=[r]^{(\alpha^{-1})^*} & j_* q^*i^*i_*\ar@=[r]^{\epsilon_i^B} & j_*q^*}\]
\end{proof}

\begin{Proposition}\label{p.GAB}
Let
     \begin{equation}
    \xymatrix{X'\ar[dd]^{x}\ar[dr]^{q'}\ar[rr]^{j'} && Y'\ar[dd]^(.3){y}|\hole \ar[dr]^{p'}\\
    & Z'\ar[dd]^(.3){z}\ar[rr]^(.3){i'} && W'\ar[dd]^w \\
    X\ar[dr]^q\ar[rr]^(.3){j}|\hole && Y\ar[dr]^p\\
    & Z\ar[rr]^i && W }
     \end{equation}
be a cube in $\cC$, where $i,j,i',j'$ are 1-cells of $\cA$, $p,q,p',q'$ are 1-cells of $\cB$, and the 2-cells of the right, left, front, back, bottom, top faces, $I,I',J,J',K,K'$, are  respectively
\[py\Rightarrow wp', \quad qx \Rightarrow zq', \quad \beta\colon wi'\Rightarrow iz, \quad \beta' \colon yj'\Rightarrow jx,\quad pj\Rightarrow iq, \quad p'j'\Rightarrow i'q'.\]
Assume that $B_K$ and $B_{K'}$ are invertible.
Then the following diagram commutes
    \[\xymatrix{i'_!z^*q_*\ar@=[r]^{B_{I'}}\ar@=[d]^{A_J} & i'_!q'_*x^*\ar@=[r]^{G_{K'}} & p'_*j'_!x^*\ar@=[d]^{A_{J'}}\\
    w^*i_!q_*\ar@=[r]^{G_K} & w^* p_* j_!\ar@=[r]^{B_I} & p'_*y^* j_!}\]
\end{Proposition}

\begin{proof}
  The following diagram commutes
  \[\xymatrix{&i'_!z^*q_*\ar@=[r]_{\eta_i}\ar@=[ddl]^{B_{I'}}\ar@=@/^1.5pc/[rrr]^{A_J}\ar@=[d]^{\eta_j}
  & i'_! z^* i^*i_!q_*\ar@=[r]^{\beta^*}
  & i'_!i'{}^* w^*i_! q_*\ar@=[r]_{\epsilon_{i'}} \ar@=[d]^{\eta_j}
  & w^*i_!q_*\ar@=[d]^{\eta_j}\ar@=@/^3pc/[ddd]_{G_K}\\
  & i'_!q^*q_*j^*j_!\ar@=[d]^{B_{I'}}\ar@=[r]^{\eta_i}
  & i'_!z^*i^*i_!q_*j^*j_!\ar@=[r]^{\beta^*}
  & i'_!i'{}^*w^*i_!q_*j^*j_!\ar@=[r]^{\epsilon_{i'}}\ar@=[d]^{B_{K}^{-1}}
  & w^*i_!q_*j^*j_!\ar@=[d]_{B_K^{-1}}\\
  i'_!q'_*x^*\ar@=[r]^{\eta_j}\ar@=[d]^{\eta_{j'}}\ar@=@/_3pc/[ddd]^{G_{K'}} & i'_!q'_*x^*j^*j_!\ar@=[d]^{\eta_{j'}}
  && i'_!i'{}^*w^*i_!i^*p_*j_!\ar@=[d]^{\epsilon_i} & w^*i_!i^*p_*j_!\ar@=[d]^{\epsilon_i}\\
  i'_!q'_*j'{}^*j'_!x^*\ar@=[d]^{B_{K'}^{-1}} & i'_!q'_*j'{}^*j'_!x^*j^*j_!\ar@=[d]^{B_{K'}^{-1}}
  && i'_!i'{}^*w^*p_*j_!\ar@=[r]^{\epsilon_{i'}}\ar@=[d]^{B_I} & w^*p_*j_!\ar@=[ddl]^{B_I}\\
  i'_!i'{}^*p'_*j'_!x^*\ar@=[r]^{\eta_j}\ar@=[d]^{\epsilon_{i'}}
  & i'_!i'{}^*p'_*j'_!x^*j^*j_!\ar@=[r]^{\beta'{}^*}\ar@=[d]^{\epsilon_{i'}}
  & i'_!i'{}^*p'_*j'_!j'{}^*y^*j_!\ar@=[r]^{\epsilon_{j'}}
  & i'_!i'{}^*p'_*y^*j_!\ar@=[d]^{\epsilon_{i'}}\\
  p'_*j'_!x^*\ar@=[r]^{\eta_j}\ar@=@/_1.5pc/[rrr]^{A_{J'}}
  & p'_*j'_!x^*j^*j_!\ar@=[r]^{\beta'{}^*} & p'_*j'_!j'{}^*y^*j_!\ar@=[r]^{\epsilon_{j'}}
  & p'_*y^*j_!}\]
  where the decagon is the outline of the following commutative diagram
  \[\xymatrix{&&q'_*x^*j^*\ar@=[r]^{\eta_{j'}}\ar@=[d]^{\beta'{}^*} & q'_*j'{}^*j'_!x^*j^*\ar@=[r]^{B_{K'}^{-1}}\ar@=[d]^{\beta'{}^*}
  & i'{}^*p'_*j'_!x^*j^*\ar@=[d]^{\beta'{}^*}\\
  z^*q_*j^*\ar@=[r]_{B_K^{-1}}\ar@=[d]^{\eta_i}\ar@=[urr]^{B_{I'}}
  & z^*i^*p_*\ar@=[d]^{\eta_i}\ar@=[rd]^{\one}
  & q'_*j'{}^*y^*\ar@=[rd]^{\one} \ar@=[r]^{\eta_{j'}}
  & q'_*j'{}^*j'_!j'{}^*y^*\ar@=[d]^{\epsilon_{j'}}\ar@=[r]^{B_{K'}^{-1}}
  & i'{}^*p'_*j'_*j'{}^*y^*\ar@=[d]^{\epsilon_{j'}}\\
  z^*i^*i_!q_*j^*\ar@=[r]^{B_K^{-1}}\ar@=[d]^{\beta^*}
  & z^*i^*i_!i^*p_*\ar@=[d]^{\beta^*}\ar@=[r]^{\epsilon_i}
  & z^*i^*p_*\ar@=[d]^{\beta^*}
  & q'_*j'{}^*y^*\ar@=[r]^{B_{K'}^{-1}}
  & i'{}^*p'_*y^*j_!\\
  i'{}^*w^*i_!q_*j^*\ar@=[r]^{B_K^{-1}}
  & i'{}^*w^*i_!i^*p_*\ar@=[r]^{\epsilon_i}
  & i'{}^*w^*p_*\ar@=[urr]^{B_I}}\]
  where the octagon commutes by \ref{p.bc}.
\end{proof}

\bibliographystyle{alphaabbrv}
\bibliography{sixop}

Weizhe Zheng, Columbia University, Department of Mathematics, 2990
Broadway, New York, NY 10027, USA; email: \texttt{zheng@math.columbia.edu}

\end{document}

config: arxiv