\section{Introduction}

The starting point of the work \cite{CMMV17} was to study from a fibrational point of view the notion of \emph{regular span}, introduced by Yoneda in \cite{Y60} as a formal categorical setting in order to reformulate the classical theory of $\ensuremath{\mathsf{Ext}}^n$ functors. The results in \cite{CMMV17} reveal that a regular span $S$
is nothing but a cartesian functor with codomain a product projection:
\[
\xymatrix@!=4ex{
X \ar[dr]_{S_2} \ar[rr]^S & & A \times B \ar[dl]^{pr_2} \\
& B
}
\]
which is in addition an internal opfibration in $\ensuremath{\mathsf{Cat}}/B$ (i.e.~a \emph{fibrewise opfibration}---see Definition \ref{def:fw}). This enlights also the difference between regular spans and two-sided fibrations, which in turn were characterized in \cite{BournPenon} as internal opfibrations, with codomain a product projection, in the 2-category $\ensuremath{\mathsf{Fib}}(B)$ of fibrations over $B$.

This fibrational interpretation makes it possible to reformulate Yoneda's Classification Theorem of \cite{Y60} as the result of a canonical factorization, yielding a reflection of regular spans into profunctors, i.e.\ two-sided \emph{discrete} fibrations. Actually, in \cite{CMMV17} it is shown that such a factorization exists not only for regular spans, but for any fibrewise opfibration $p$ with codomain a split fibration. Moreover, it turns out that this factorization, performed via a coidentifier (Lemma 3.12 in [\emph{loc.~cit.}]), is the internal version in $\ensuremath{\mathsf{Fib}}(B)$ of the \emph{comprehensive factorization} introduced in \cite{StW} for \ensuremath{\mathsf{Cat}}. In other words, $p$ is the composite of an initial morphism in $\ensuremath{\mathsf{Fib}}(B)$ with an internal discrete opfibration, which is the same as a fibrewise opfibration whose fibres are discrete (Corollary 2.9 in \cite{CMMV17}).

It is natural to ask if, for fibrewise opfibrations, replacing the coidentifier with a coinverter in the construction above, we get as a comparison a fibrewise opfibration whose fibres are groupoids. To this end, we need first to detect some sufficient conditions to transfer the construction of coidentifiers and coinverters from a 2-category \ensuremath{\mathcal{C}}\ to the 2-category $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ of internal fibrations over a fixed object $B$ (see Proposition \ref{prop:coinv} and Proposition \ref{prop:coid}). This happens when the 2-monad $R\colon\ensuremath{\mathcal{C}}/B\to\ensuremath{\mathcal{C}}/B$, whose pseudo-algebras define internal fibrations (in the sense of Street \cite{Street74}), preserves coidentifiers and coinverters of identees. Under this assumption $(\dagger)$, the coinverter (coidentifier) $q$ of the identee $\kappa$ of a fibration $f$
\begin{equation} \label{fact}
\xymatrix@!=5ex{
K \ar@/^2ex/[r]^{d_0}_{}="1" \ar@/_2ex/[r]_{d_1}^{}="2" \ar@{=>}"1";"2"^{\kappa} & A \ar[d]_{f} \ar[r]^{q} & Q \ar[dl]^{s} \\
& B
}
\end{equation}
induces a  comparison morphism $s$, which is still a fibration in \ensuremath{\mathcal{C}}\  (see Corollary \ref{cor:fib.to.frac} and Corollary \ref{cor:fib.to.sfrac}).

It is important to point out that, for such an $s$, as for any other isofibration, having groupoidal fibres is the same as being conservative, as we show in Corollary \ref{cor:isofib.cons=gpd(isofib)} in the general context of a finitely complete 2-category.

Now we have two facts. First, we prove that the above described behaviour of coinverters (coidentifiers) for  fibrations (and opfibrations) holds in \ensuremath{\mathsf{Cat}}\ and in $\ensuremath{\mathsf{Fib}}(B)$, for any  $B$, precisely because in these cases, condition $(\dagger)$ and its dual $(\dagger')$ are fulfilled (Corollary \ref{cor:cat.dag} and Proposition \ref{prop:dag.to.fib}).

On the other hand,  it is known that any functor can be factorized through a conservative functor, thanks to a factorization system for \ensuremath{\mathsf{Cat}}\ which is obtained by a (possibly transfinite) iteration of the invertee/coinverter construction. Actually, we show in Corollary \ref{cor:isofib.cons=gpd(isofib)} that for any isofibration, the coinverter of the invertee is the same as the coinverter of the identee, so that our factorization $f=sq$ in diagram (\ref{fact}) realizes the first step of the above mentioned  construction. Moreover, this first step is sufficient to produce the desired factorization for each fibration (respectively opfibration) $f$ in \ensuremath{\mathsf{Cat}}: considering the construction (\ref{fact}) for such an $f$, $s$ turns out to be a fibration (resp. opfibration)  in groupoids, i.e.\ conservative (Proposition \ref{prop:isocompr.cat}).

The same phenomenon occurs for the factorization system in \ensuremath{\mathsf{Cat}}\ given by (sequence of coidentifiers, discrete functor), which, when restricted to fibrations (opfibrations), reduces to a single application of the identee/coidentifier construction and it realizes the comprehensive factorization. This result is proved in Proposition  \ref{prop:comprehensive.cat} in the case of a 2-category $\ensuremath{\mathsf{Cat}}(\ensuremath{\mathcal{E}})$ of internal categories where the construction of the comprehensive factorization of any functor provided in \cite{StV} is still valid, as, for example, when \ensuremath{\mathcal{E}}\ is a finitely cocomplete locally cartesian closed category.

In the last part of the paper, we extend the above results to  fibrewise opfibrations in $\ensuremath{\mathsf{Fib}}(B)$, relying on the pseudo-functorial interpretation  of opfibrations in \ensuremath{\mathsf{Cat}}.
This way,  we prove in Proposition \ref{prop:refl.gpd.fib} that every fibrewise (resp.~internal) opfibration $p$ in $\ensuremath{\mathsf{Fib}}(B)$ admits a factorization
\[
\xymatrix@!=5ex{
A \ar@/^3ex/[rr]^{p} \ar[dr]_{f} \ar[r]_-{q'} & Q' \ar[d]_(.4){h'} \ar[r]_-{s'} & C \ar[dl]^{g} \\
& B
}
\]
where $q'$ is the coinverter of the identee of $p$ and $s'$ is a fibrewise (resp.~internal) opfibration in groupoids in $\ensuremath{\mathsf{Fib}}(B)$. Such a factorization coincides with the one given by (sequence of coinverters, conservative functor) in \ensuremath{\mathsf{Cat}}.

The analogous results hold when replacing coinverters with coidentifiers and opfibrations in groupoids with discrete opfibrations (Proposition \ref{prop:comprehensive.int}).

\section{Review of internal fibrations}

Let \ensuremath{\mathcal{C}}\ be a finitely complete 2-category \cite{Street76}. For a fixed object $B$ in \ensuremath{\mathcal{C}}, we shall denote by $\ensuremath{\mathcal{C}}/B$ the comma 2-category over $B$ and by $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ the pseudo-comma 2-category over $B$.

We shall denote as follows the (strict) comma objects in \ensuremath{\mathcal{C}}\ of identities, along identities on the left and on the right respectively, and iso-comma along identities:
\begin{equation} \label{diag:commas}
\begin{aligned}
\xymatrix@!=4ex{
B/B \ar[d]_{d_0} \ar[r]^-{d_1} & B \ar[d]^{1} & B/f \ar[r]^-{d_1} \ar[d]_{Rf} & A \ar[d]^f & f/B \ar[r]^-{Lf} \ar[d]_{d_0} & B \ar[d]^{1} & f/_{\cong} B \ar[r]^-{If} \ar[d]_{w_f} & B \ar[d]^1 \\
B \ar[r]_{1} \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"1";"2"_{\mu_B} & B & B \ar[r]_{1} \ar@{}[ur]|(.3){}="3" \ar@{}[ur]|(.7){}="4" \ar@{=>}"3";"4"_{\varphi_f} & B & A \ar[r]_{f} \ar@{}[ur]|(.3){}="5" \ar@{}[ur]|(.7){}="6" \ar@{=>}"5";"6"_{\psi_f} & B & A \ar[r]_{f} \ar@{}[ur]|(.3){}="7" \ar@{}[ur]|(.7){}="8" \ar@{=>}"7";"8"_{\omega_f}^{\sim} & B
}
\end{aligned}
\end{equation}
One can extend the assignment $f\mapsto Lf$ to 1-cells and 2-cells in $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ in the following way, yielding a 2-functor:
\begin{itemize}
 \item on 1-cells:
 \[
 \xymatrix@!=6ex{
 A \ar[dr]_f^{}="1" \ar[r]^t & A' \ar[d]^{f'} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"_{\theta}^{\sim} & \mapsto & f/B \ar[dr]_{Lf}^{}="1" \ar[r]^{Lt} & f'/B \ar[d]^{Lf'} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"_{1} \\
 & B & & & B
 }
 \]
 where $Lt$ is determined by the equations $d_0(Lt)=td_0$ and $\psi_{f'}(Lt)=\psi_f\cdot\theta d_0$;
 \item on 2-cells:
 \[
 \xymatrix@!=6ex{
 A \ar[dr]_f^{}="1" \ar@/^4ex/[r]^{t_1}_{}="3" \ar[r]_{t_2}^{}="4" \ar@{=>}"3";"4"^{\xi} & A' \ar[d]^{f'} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"^{\theta_2} & \mapsto & f/B \ar[dr]_{Lf}^{}="1" \ar@/^4ex/[r]^{Lt_1}_{}="3" \ar[r]_{Lt_2}^{}="4" \ar@{=>}"3";"4"^{L\xi}  & f'/B \ar[d]^{Lf'} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"^{1} \\
 & B & & & B
 }
 \]
 where $L\xi$ is determined by the equations $(Lf')(L\xi)=1$ and $d_0(L\xi)=\xi d_0$.
\end{itemize}

One can also define a pseudo 2-natural tranformation $u\colon 1_{\ensuremath{\mathcal{C}}\ensuremath{/\!/} B}\to L$ and a (strict) 2-natural transformation $m\colon L^2\to L$ as follows:
\begin{itemize}
 \item on objects: for each $f\colon A \to B$,
 \[
 \xymatrix@!=6ex{
 A \ar[dr]_f^{}="1" \ar[r]^-{u_f} & f/B \ar[d]^{Lf} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"_{1} & & Lf/B \ar[dr]_{L^2f}^{}="1" \ar[r]^-{m_f} & f/B \ar[d]^{Lf} \ar@{}[dl]|(.15){}="2" \ar@{=>}"2";"1"_{1} \\
 & B & & & B
 }
 \]
 where $u_f$ and $m_f$ are determined by the equations
\[
\left\{
\begin{array}{l}
d_0u_f=1 \\
\psi_fu_f=1
\end{array}
\right.
\quad\mbox{and}\quad
\left\{
\begin{array}{l}
d_0m_f=d_0d_0 \\
\psi_fm_f=\psi_{Lf}\cdot\psi_fd_0
\end{array}
\right.
\]
respectively.
 \item on 1-cells: for each $(t,\theta)$ as above,
\[
\xymatrix{
A \ar[d]_{t} \ar[r]^-{u_f} & f/B \ar[d]^{Lt} \\
A' \ar[r]_{u_{f'}} \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"2";"1"_{u_{(t,\theta)}}^{\sim} & f'/B
}
\]
is uniquely determined by the equations $d_0u_{(t,\theta)}=1$ and $(Lf')u_{(t,\theta)}=\theta$, while $m_{(t,\theta)}=1$.
\end{itemize}
One can check that these data satisfy the properties
\begin{enumerate}
 \item[M1] $m\ast uL=1=m\ast Lu$;
 \item[M2] $m\ast mL=m\ast Lm$.
\end{enumerate}
Hence the triple $(L,u,m)$ forms a 2-monad on $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$, which is not strict only because of the invertible 2-cells $u_{(t,\theta)}$ for each $(t,\theta)$.

Let us now consider, for each $f\colon A \to B$, the 2-cell $\kappa_f\colon u_fd_0\to 1_{f/B}$ determined by the equations $d_0\kappa_f=1$ and $(Lf)\kappa_f=\psi_f$, and define
\[
\xymatrix{
f/B \ar@/^3ex/[rr]^{Lu_f}_{}="1" \ar@/_3ex/[rr]_{u_{Lf}}^{}="2" \ar@{=>}"1";"2"_{\lambda_f} & & Lf/B
}
\]
as the unique 2-cell such that $d_0\lambda_f=\kappa_f$ and $(L^2f)\lambda_f=1$.

It is tedious but straightforward to check that the collection of all $\lambda_f$ for each $f$ gives rise to a modification $\lambda\colon Lu\to uL$ between natural tranformations in $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$. Moreover, $\lambda$ satisfies the following properties:
\begin{enumerate}
 \item[KZ1] $\lambda\ast u=1$;
 \item[KZ2] $m\ast\lambda=1$;
 \item[KZ3] $m\ast Lm\ast\lambda L=1$.
\end{enumerate}
Since M1 (=KZ0) already holds, the data $(L,u,m,\lambda)$ give rise to a KZ-doctrine in the sense of Definition 1.1 in \cite{Kock}. In other words, this structure provides a lax-idempotent 2-monad.

Let us observe that, in fact, $L\colon \ensuremath{\mathcal{C}}\ensuremath{/\!/} B \to \ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ factors through the inclusion of $\ensuremath{\mathcal{C}}/B$ in $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$, and the 1-cell components of $u$ are such that $u_{(t,1)}=1$, so that the above 2-monad on $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ restricts to a \emph{strict} 2-monad on $\ensuremath{\mathcal{C}}/B$, which is also part of a KZ-doctrine by the same $\lambda$. We will adopt the same notation for both monads as far as no confusion arises.
\medskip

Like $L$, also the 2-functors $R$ and $I$ on $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$, defined by the corresponding comma squares in (\ref{diag:commas}), can be endowed with a structure of 2-monad, which is colax-idempotent in the case of $R$ and pseudo-idempotent in the case of $I$. In both cases, these structures restrict to strict 2-monads $(R,v,n,\rho)$ and $(I,i,l,\iota)$ on $\ensuremath{\mathcal{C}}/B$.

One of the most important features of KZ-doctrines is that the corresponding (pseudo-)algebra structures are unique up to isomorphism for each object and they are characterized as right (pseudo-)inverse left adjoint to the unit component of the monad. Applying this observation and its dual to the special cases of the 2-functors $L$, $R$ and $I$ described above, one can characterize (pseudo-)fibrations (and dually opfibrations) and isofibrations in \ensuremath{\mathcal{C}}.

\begin{Proposition} \label{prop:fib}
For a morphism $f\colon A \to B$ in \ensuremath{\mathcal{C}}\ the following conditions are equivalent and define an internal \emph{fibration} (respectively \emph{pseudo-fibration}):
\begin{enumerate}
\item
\begin{itemize}
\item[(i)] For all $X$ in \ensuremath{\mathcal{C}}, $\ensuremath{\mathcal{C}}(X,f)\colon\ensuremath{\mathcal{C}}(X,A)\to\ensuremath{\mathcal{C}}(X,B)$ is a fibration (respectively pseudo-fibration) in \ensuremath{\mathsf{Cat}};
\item[(ii)] for all $g\colon Y \to X$, the commutative square below is a morphism of fibrations (respectively pseudo-fibrations) in \ensuremath{\mathsf{Cat}}:
\[
\xymatrix{
\ensuremath{\mathcal{C}}(X,A) \ar[r]^-{\ensuremath{\mathcal{C}}(g,A)} \ar[d]_{\ensuremath{\mathcal{C}}(X,f)} & \ensuremath{\mathcal{C}}(Y,A) \ar[d]^{\ensuremath{\mathcal{C}}(Y,f)} \\
\ensuremath{\mathcal{C}}(X,B) \ar[r]_-{\ensuremath{\mathcal{C}}(g,B)} & \ensuremath{\mathcal{C}}(Y,B)
}
\]
\end{itemize}
\item $f$ admits a structure of pseudo-algebra for the 2-monad $R\colon \ensuremath{\mathcal{C}}/ B\to\ensuremath{\mathcal{C}}/ B$ (respectively $R\colon \ensuremath{\mathcal{C}}\ensuremath{/\!/} B\to\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$);
\item The morphism $v_f\colon f \to Rf$ admits a right adjoint in $\ensuremath{\mathcal{C}}/ B$ (respectively $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$);
\item (Chevalley criterion) The morphism $f_1\colon A/A\to B/f$, determined by the equations
\[
\left\{
\begin{array}{l}
(Rf)f_1=fd_0 \\
d_1f_1=d_1 \\
\varphi_ff_1=f\mu_A
\end{array}
\right.
\]
admits a right adjoint in \ensuremath{\mathcal{C}}\ with counit an identity (respectively isomorphism).
\end{enumerate}
\end{Proposition}

In practice, given an internal fibration according to the above definition 2, it is convenient to fix a corresponding pseudo-algebra structure once and for all (which in \ensuremath{\mathsf{Cat}}\ means to fix a cleavage). Accordingly, throughout the paper, $\ensuremath{\mathsf{Fib}}_{\ensuremath{\mathcal{C}}}(B)$ will denote the 2-category whose objects are pseudo-algebras for the monad $R\colon\ensuremath{\mathcal{C}}/ B\to\ensuremath{\mathcal{C}}/ B$, whose 1-cells are strict pseudo-algebra morphisms, and with the obvious 2-cells (we shall write just $\ensuremath{\mathsf{Fib}}(B)$ for $\ensuremath{\mathcal{C}}=\ensuremath{\mathsf{Cat}}$).

\begin{Remark}
{\rm
The definition of internal fibration (resp. pseudo-fibration) in a representable 2-category appears in the form 2 of Proposition \ref{prop:fib} in the works of Street \cite{Street74,StreetBI}. The characterizations 1 and 3 in Proposition \ref{prop:fib} are well-known and already present in the literature (see, for example, \cite{Weber}). As for the Chevalley criterion, it was first proved by Gray \cite{Gray} for fibrations in \ensuremath{\mathsf{Cat}}, while an internal version of it (for opfibrations) appears in \cite[Proposition 9]{Street74}, asking for the unit to be an isomorphism. As the following example shows, such a condition does not characterize opfibrations. In fact, it characterizes pseudo-opfibrations (see 3.17 in \cite{StreetBI}). This is the reason why we consider the characterization 4.\ also for internal (strict) fibrations. Since we could not find a proof of the latter in the literature, we provide it in the appendix for the sake of completeness.
}
\end{Remark}

\begin{Example}{\em
Let $\ensuremath{\mathcal{C}}=\ensuremath{\mathsf{Cat}}$ and consider any functor $f\colon 1\to B$, where $1$ is the terminal category and $B$ is the groupoid with two objects and exactly one isomorphism between them. It is easy to see that $1/1\cong 1$, $f/B\cong B$, and these isomorphisms make the induced functor $f_1\colon 1/1\to f/B$ of the dual of Proposition \ref{prop:fib} 4.\ isomorphic to $f$. By uniqueness, the terminal functor $t\colon B \to 1$ is the only possible left adjoint to $f$, and $tf=1_1$, hence one can choose $1_{tf}$ as a counit. On the other hand, $ft$ is not equal, but isomorphic to $1_B$, so that $f$ and $t$ are actually adjoint with unit an isomorphism. But $f$  is not an opfibration, just a pseudo-opfibration.
}
\end{Example}

The equivalent conditions of Proposition \ref{prop:fib} may be easily adapted to define \emph{internal opfibrations} (respectively pseudo-opfibrations), for example replacing, in 2.~and 3., the monad $R$ with the monad $L$. For the reader's convenience, throughout the paper, most of the results are stated in terms of fibrations. The corresponding results for opfibrations can be obtained accordingly.

Before giving the characterization of isofibrations, we point out the following property which is specific for iso-comma squares and will be useful later on.

\begin{Lemma} \label{lemma:w_equiv}
For each $f\colon A \to B$ in \ensuremath{\mathcal{C}}, the 1-cells $i_f$ and $w_f$ form an adjoint equivalence with, in particular, $w_fi_f=1_A$. This yields also an equivalence in $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ with $(i_f,1)$ and $(w_f,\omega_f)$ as adjoint pair.
\end{Lemma}

\begin{proof}
$w_fi_f=1_A$ by definition of $i_f$. Then let $\epsilon_f\colon i_fw_f\to 1\colon f/_{\cong}B\to f/_{\cong}B$ be the unique 2-cell such that $(If)\epsilon_f=\omega_f$ and $w_f\epsilon_f=1_{w_f}$. It is easy to check that the inverse $\epsilon_f^{-1}$ can be defined by the equations $(If)\epsilon_f^{-1}=\omega_f^{-1}$ and $w_f\epsilon_f^{-1}=1_{w_f}$, and this completes the proof of the first assertion (triangle identities follow easily). For the second one it suffices to recall that $\omega_fi_f=1_f$ and use the first part of the Lemma.
\end{proof}

\begin{Proposition} \label{prop:isofib}
For morphism $f\colon A \to B$ in \ensuremath{\mathcal{C}}\ the following conditions are equivalent and define an internal \emph{isofibration}:
\begin{enumerate}
\item  For all $X$ in \ensuremath{\mathcal{C}}, $\ensuremath{\mathcal{C}}(X,f)\colon\ensuremath{\mathcal{C}}(X,A)\to\ensuremath{\mathcal{C}}(X,B)$ is an isofibration  in \ensuremath{\mathsf{Cat}};
\item $f$ admits a structure of pseudo-algebra for the 2-monad $I\colon \ensuremath{\mathcal{C}}/ B\to\ensuremath{\mathcal{C}}/ B$;
\item the morphism $i_f\colon f \to If$ admits a right adjoint in $\ensuremath{\mathcal{C}}/ B$.
\end{enumerate}
\end{Proposition}

\begin{Remark} \label{rem:monads}
{\em
\begin{enumerate}
\item The ``pseudo'' version of Proposition \ref{prop:isofib} does not make sense, of course. In fact, every functor is an isofibration up to isomorphism, so that the ``pseudo'' version of condition 1. is empty. This is reflected in the fact that, thanks to Lemma \ref{lemma:w_equiv}, each $f$ always admits a pseudo-algebra structure for $I\colon \ensuremath{\mathcal{C}}\ensuremath{/\!/} B \to \ensuremath{\mathcal{C}}\ensuremath{/\!/} B$, given by $(w_f,\omega_f)$. Condition 2.\ says that, when $f$ is an isofibration, one can replace $(w_f,\omega_f)$ with another left adjoint (the pseudo-algebra structure) to $(i_f,1)$, in order to obtain an adjoint equivalence which actually lives in $\ensuremath{\mathcal{C}}/B$.
\item By the general theory of monads, for each $f$ in \ensuremath{\mathcal{C}}, $Lf$, $Rf$ and $If$ are free algebras for the corresponding monads (whose structure is given by the multiplication component at $f$) and it is immediate to see that these are actually strict algebras, which represent split opfibrations (respectively fibrations and isofibrations) internally.
\end{enumerate}
}
\end{Remark}

We recall from \cite{Street74} the following properties, which will be used later on.

\begin{Lemma} \label{lem:pbfib}
Fibrations are pullback stable.
\end{Lemma}

\begin{Corollary} \label{cor:p0p1}
Given a comma square
\[
\xymatrix{
f/g \ar[d]_{\overline{g}} \ar[r]^-{\overline{f}} & C \ar[d]^{g} \\
A \ar[r]_-{f} \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"1";"2" & B
}
\]
then $\overline{f}$ is an opfibration and $\overline{g}$ is a fibration. In particular, the canonical morphisms $d_0$ and $d_1$ of diagram (\ref{diag:commas}) are a fibration and an opfibration respectively.
\end{Corollary}

Applying the observation 2.\ of Remark \ref{rem:monads} to the 2-functor $I$ we see that, for each $f\colon A \to B$, its image $If$ is actually an isofibration. Restricting to pseudo-fibrations, we get the following result.

\begin{Lemma} \label{lemma:pseudo.to.fib}
If $f\colon A \to B$ is an internal pseudo-fibration in \ensuremath{\mathcal{C}}, then $If$ is an internal fibration.
\end{Lemma}

\begin{proof}
First recall from Lemma \ref{lemma:w_equiv} that $f$ and $If$ are equivalent as objects in $\ensuremath{\mathcal{C}}\ensuremath{/\!/} B$, hence $If$ is a pseudo-fibration, since $f$ is. Moreover, $If$ is an isofibration, by Remark \ref{rem:monads} 2. Then, by the representability of the notions involved, i.e.\ point 1.\ in Propositions \ref{prop:fib} and \ref{prop:isofib}, the thesis follows from the well-known fact that, in \ensuremath{\mathsf{Cat}}, any pseudo-fibration which is also an isofibration is actually a fibration.
\end{proof}

In fact, $I$ sends also morphisms (and 2-cells) of pseudo-fibrations to morphisms (and 2-cells) of fibrations, so that the following result holds.

\begin{Proposition} \label{prop:I.pres.fib}
The restriction of $I\colon\ensuremath{\mathcal{C}}\ensuremath{/\!/} B\to \ensuremath{\mathcal{C}}\ensuremath{/\!/} B$ to the full sub-2-category of pseudo-fibrations can be factorized as
\[
\xymatrix{
\ensuremath{\mathsf{PsFib}}(B) \ar@{^{(}->}[rr] \ar[d] & & \ensuremath{\mathcal{C}}\ensuremath{/\!/} B \ar[d]^{I} \\
\ensuremath{\mathsf{Fib}}(B) \ar@{^{(}->}[r] & \ensuremath{\mathcal{C}}/B \ar[r] & \ensuremath{\mathcal{C}}\ensuremath{/\!/} B.
}
\]
\end{Proposition}

Let us observe that, when $f$ is a pseudo-fibration, the adjoint equivalence $(w_f,\omega_f)\dashv (i_f,1)$ actually lives in $\ensuremath{\mathsf{PsFib}}(B)$.

\section{Coinverters and coidentifiers in $\ensuremath{\mathsf{Fib}}(B)$}

From now on, let \ensuremath{\mathcal{C}}\ be a finitely complete 2-category with coidentifiers and (strict) coinverters of reflexive 2-cells, whose definition we recall for the sake of completeness (the reader may refer to \cite{Kelly} for example).

\begin{Definition}
The coidentifier (coinverter) of a 2-cell $\alpha$ is a 1-cell $q$ such that:
\begin{enumerate}
 \item $q\alpha$ is an identity (isomorphism);
 \item for any other 1-cell $f$ such that $f\alpha$ is an identity (isomorphism), there exists a unique 1-cell $t$ with $tq=f$;
 \item for any 2-cell $\beta\colon g \to h$ such that $g\alpha$ and $h\alpha$ are identities (isomorphisms), there exists a unique 2-cell $\gamma$ with $\gamma q=\beta$;
\end{enumerate}
\end{Definition}

In this paper we will consider in particular coidentifiers (coinverters) of identees (invertees). Given a 1-cell $f$, we denote with $(K,\kappa)$ its identee, where $\kappa$ is the 2-universal 2-cell making $f\kappa$ an identity. We denote with $(W,\omega)$ the invertee of $f$, where $\omega$ is the 2-universal 2-cell making $f\omega$ an isomorphism.

Later on, we will take advantage of the following results concerning isofibrations.
Recall that a morphism is called $f$-vertical if its image under $f$ is an identity.

\begin{Lemma} \label{lemma:psvert=vert}
Let $f$ be an isofibration and $\alpha$ a 2-cell such that $f\alpha$ is an isomorphism. Then $\alpha$ factorizes as $\alpha=\sigma\cdot\tau$, where $\tau$ is $f$-vertical and $\sigma$ is an isomorphism.
\end{Lemma}

\begin{proof}
Since $f$ is an isofibration, the isomorphism $f\alpha$ admits a cartesian lifting $\sigma$, which is an isomorphism, at the codomain of $\alpha$. $\tau$ is then the unique $f$-vertical factorization of $\alpha$ through $\sigma$.
\end{proof}

\begin{Corollary} \label{cor:isofib.cons=gpd(isofib)}
Let $f$ be an isofibration, then:
\begin{enumerate}
 \item $f$ is conservative if and only if its fibres are groupoids;
 \item the coinverter of the identee of $f$ coincides with the coinverter of its invertee.
\end{enumerate}
\end{Corollary}

\begin{proof}
Let $(W,\omega)$ and $(K,\omega c)$ be the invertee and the identee, respectively, of $f$:
\[
\xymatrix@C=6ex{
K \ar[r]^-c & W \ar@/_2ex/[r]_{w_1}^{}="1" \ar@/^2ex/[r]^{w_0}_{}="2" \ar@{=>}"2";"1"^{\omega} & A \ar[r]^-f & B\,.
}
\]
Since $f\omega$ is an isomorphism by definition, as in Lemma \ref{lemma:psvert=vert}, we can factorize $\omega$ as a composite $\omega=\sigma\cdot\tau$, where $\sigma$ is a cartesian lifting of $f\omega$, and $\tau$ the unique $f$-vertical comparison 2-cell. $\tau$ being vertical, there is a unique $c'\colon W\to I$ such that $\omega cc'=\tau$. So we have factorized $\omega$ as in the following diagram:
\[
\xymatrix@!=7ex{
W \ar[r]^-{c'} \ar@/_/[drr]_{w_1}^{}="3" & K \ar[r]^-c_{}="4"  \ar@{=>}"4";"3"^{\sigma} & W \ar@/_2ex/[d]_{w_1}^{}="1" \ar@/^2ex/[d]^{w_0}_{}="2" \ar@{=>}"2";"1"^{\omega} \\
& & A\,.
}
\]
It is now easy to see that $f$ is conservative, i.e.\ its invertee is an isomorphism, if and only if its fibres are groupoids, i.e.\ its identee is an isomorphism.

As for the second statement, it suffices to observe that the coinverter of the identee $\omega c$ coinverts also $\omega=\sigma\cdot\omega cc'$.
\end{proof}

Obviously the last result does not hold in general if $f$ is not an isofibration, as it is whitnessed by the non-constant functor from the arrow-category $\mathbf{2}$ to the groupoid $\mathbf{I}$ with two objects and two non-trivial arrows.

It is easy to check that identees and coidentifiers in $\ensuremath{\mathcal{C}}/B$ are computed in \ensuremath{\mathcal{C}}, and the same property holds for coinverters of identees.

\begin{Lemma} \label{lemma:inv/B}
The forgetful 2-functor $U\colon \ensuremath{\mathcal{C}}/B \to \ensuremath{\mathcal{C}}$ creates coinverters of identees.
\end{Lemma}

We are going to explore the behaviour of the monad $R$ with respect to these limits and colimits. Analogous results can be proved for the monad $L$.

\begin{Remark} \label{rem:R}
It is worth observing that the functor $R$ can be described by means of the following construction:
\[
\xymatrix@!=5ex{
B/f \ar[r]_{d_1^*f} \ar@/^3ex/[rr]^{Rf} \ar[d]_{d_1} & B/B \ar[r]_-{d_0} \ar[d]_{d_1} & B \ar@{=}[d] \\
A \ar[r]_-{f} & B \ar@{=}[r] \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"2";"1"^{\mu_B} & B.
}
\]
That is, $R=(d_0)_{!}d_1^*$, i.e.\ the composite of the change-of-base 2-functor along $d_1$ with the composition 2-functor with $d_0$, which is left 2-adjoint to $d_0^*$.
\end{Remark}

\begin{Lemma} \label{lemma:R.pres.id}
The monad $R\colon\ensuremath{\mathcal{C}}/B\to\ensuremath{\mathcal{C}}/B$ preserves identees.
\end{Lemma}

\begin{proof}
By rk \ref{rem:R}, the thesis follows from the fact that $d_1^*$ preserves limits, being a right adjoint, and $(d_0)_{!}$ preserves identees.
\end{proof}

\begin{Lemma}
The identee of a morphism $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ can be computed as in \ensuremath{\mathcal{C}}.
\end{Lemma}

\begin{proof}
Let
\begin{equation} \label{diag:identee}
\xymatrix@!=6ex{
K \ar@/_2ex/[dr]_{h} \ar@/^2ex/[r]^{k_0}_{}="1" \ar@/_2ex/[r]_{k_1}^{}="2" \ar@{=>}"1";"2"^{\kappa} & A \ar[d]_{f} \ar[r]^{p} & C \ar[dl]^{g} \\
& B
}
\end{equation}
be an identee diagram in $\ensuremath{\mathcal{C}}/B$ (which means that $\kappa$ is also the identee of $p$ in \ensuremath{\mathcal{C}}). Since $p$ is a morphism in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ and $R$ preserves identees by Lemma \ref{lemma:R.pres.id}, it is straightforward to prove that the adjunctions $v_f\dashv r_f$ and $v_g\dashv r_g$ in the diagram
\[
\xymatrix@!=6ex{
B/h \ar@{-->}@/^/[d]^{r_h} \ar@/^2ex/[r]^{Rk_0}_{}="1" \ar@/_2ex/[r]_{Rk_1}^{}="2" \ar@{=>}"1";"2"^{R\kappa} & B/f \ar@/^/[d]^{r_f} \ar[r]_-{Rp} & B/g \ar@/^/[d]^{r_g} \\
K \ar@{-->}@/^/[u]^{v_h}_{\dashv} \ar@/^2ex/[r]^{k_0}_{}="1" \ar@/_2ex/[r]_{k_1}^{}="2" \ar@{=>}"1";"2"^{\kappa} & A \ar[r]^-{p} \ar@/^/[u]_{\dashv}^{v_f} & C \ar@/^/[u]_{\dashv}^{v_g}
}
\]
induce an adjunction $v_h\dashv r_h$ by the universal property of the identees.
\end{proof}

Coinverters and coidentifiers may not be preserved by the monad $R$, however this happens to be true in some cases of interest which we will explore later on. So, for a given object $B$ in \ensuremath{\mathcal{C}}, we shall consider the property
\begin{itemize}
\item[($\dagger$)] The monad $R\colon \ensuremath{\mathcal{C}}/B\to \ensuremath{\mathcal{C}}/B$ preserves coinverters and coidentifiers of identees.
\end{itemize}

\begin{Proposition} \label{prop:coinv}
Let $B$ be an object in \ensuremath{\mathcal{C}}\ satisfying $(\dagger)$, $p\colon(A,f)\to(C,g)$ a morphism in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ and $\kappa$ its identee in \ensuremath{\mathcal{C}}. Then the coinverter $q\colon A\to Q$ of $\kappa$ in \ensuremath{\mathcal{C}}\ induces a factorization
\[
\xymatrix@!=6ex{
A \ar@/^3ex/[rr]^{p} \ar[dr]_{f} \ar[r]_-{q} & Q \ar[d]_(.4){gs} \ar[r]_-{s} & C \ar[dl]^{g} \\
& B
}
\]
of $p$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$, and $q\colon(A,f)\to(Q,gs)$ is the coinverter of $\kappa$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$.
\end{Proposition}

\begin{proof}
Recall that $\kappa$ is also the identee of $p$ in $\ensuremath{\mathcal{C}}/B$ and consider the corresponding identee diagram (\ref{diag:identee}) in $\ensuremath{\mathcal{C}}/B$. Since $p$ (and then $f$) coinverts $\kappa$, the morphisms $s$ and $gs$ in the factorization above are uniquely determined by the universal property of $q$, and this explains why $q$ is a coinverter of $\kappa$ in $\ensuremath{\mathcal{C}}/B$.

Since $f$ is a fibration, the unit component $v_f\colon (A,f) \to (B/f,Rf)$ admits a right adjoint $r_f$ in $\ensuremath{\mathcal{C}}/B$. We call $\eta_f$ and $\epsilon_f$ the corresponding unit and counit. Likewise, $v_g$ has a right adjoint $r_g$, and $pr_f=r_g(Rp)$ since $p$ is a morphism in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$. Let us consider the following diagram:
\[
\xymatrix@!=6ex{
B/h \ar@/^/[d]^{r_h} \ar@/^2ex/[r]^{Rk_0}_{}="1" \ar@/_2ex/[r]_{Rk_1}^{}="2" \ar@{=>}"1";"2"^{R\kappa} & B/f \ar@/^/[d]^{r_f} \ar@/^3ex/[rr]^{Rp} \ar[r]_-{Rq} & B/(gs) \ar@{-->}@/^/[d]^{r_{gs}} \ar[r]_-{Rs} & B/g \ar@/^/[d]^{r_g} \\
K \ar@/^/[u]_{\dashv}^{v_h} \ar@/^2ex/[r]^{k_0}_{}="1" \ar@/_2ex/[r]_{k_1}^{}="2" \ar@{=>}"1";"2"^{\kappa} & A \ar@/_3ex/[rr]_-{p} \ar[r]^-{q} \ar@/^/[u]_{\dashv}^{v_f} & Q \ar@/^/[u]_{\dashv}^{v_{gs}} \ar[r]^-{s} & C \ar@/^/[u]_{\dashv}^{v_g}
}
\]
Now, $pr_f(R\kappa)=r_g(Rp)(R\kappa)=1$, hence $r_f(R\kappa)$ factors through $\kappa$ and $qr_f(R\kappa)$ is an isomorphism. By the assumption $(\dagger)$, $Rq$ is the coinverter of $R\kappa$, so there exists a unique $r_{gs}\colon B/(gs)\to Q$ such that $r_{gs}(Rq)=qr_f$. By the 2-dimensional universal property of the coinverters $q$ and $Rq$, one can prove that a unit $\eta_{gs}$ and a counit $\epsilon_{gs}$ are induced by $\eta_f$ and $\epsilon_f$ respectively, making $v_{gs}\dashv r_{gs}$ an adjoint pair in $\ensuremath{\mathcal{C}}/B$, so that $gs$ is a fibration. As a consequence of this construction, $q$ turns out to be a morphism of fibrations over $B$.

It remains to show that for each $c\colon (A,f) \to (Y,y)$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ such that $c\kappa$ is an isomorphism, the unique comparison morphism $t$ in $\ensuremath{\mathcal{C}}/B$, induced by the coinverter $q$ and such that $tq=c$, is actually a morphism in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$. Let us denote by $r_{y}$ the $R$-pseudo-algebra structure on $y$, i.e.\ the right adjoint to $v_y$, and observe that the diagram
\[
\xymatrix@C=6ex{
B/(gs) \ar[d]_{r_{gs}} \ar[r]^-{Rt} & B/y \ar[d]^{r_{y}} \\
Q \ar[r]_-{t} & Y
}
\]
commutes since $Rq$ is a coinverter, then epimorphic, and precomposition with $Rq$ gives the commutative square presenting $c$ as a morphism of $R$-pseudo-algebras.

Finally, the fact that $s$ is in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ follows from the last argument, taking $c=p$.
\end{proof}

\begin{Corollary} \label{cor:fib.to.frac}
Let $B$ be an object in \ensuremath{\mathcal{C}}\ satisfying $(\dagger)$, $f\colon A \to B$ a fibration in \ensuremath{\mathcal{C}}, $\kappa$ its identee in \ensuremath{\mathcal{C}}, and $q\colon A \to Q$ its coinverter in \ensuremath{\mathcal{C}}. Then the unique comparison morphism $s\colon Q \to B$, such that $sq=f$, is a fibration and $q$ is the coinverter of $\kappa$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$.
\end{Corollary}

\begin{proof}
Apply Proposition \ref{prop:coinv} to the morphism $f\colon(A,f)\to(B,1_B)$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$.
\end{proof}

\begin{Proposition} \label{prop:coid}
Let $B$ be an object in \ensuremath{\mathcal{C}}\ satisfying $(\dagger)$, $p\colon(A,f)\to(C,g)$ a morphism in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ and $\kappa$ its identee in \ensuremath{\mathcal{C}}. Then the coidentifier $q'\colon A\to Q'$ of $\kappa$ in \ensuremath{\mathcal{C}}\ induces a factorization
\[
\xymatrix@!=6ex{
A \ar@/^3ex/[rr]^{p} \ar[dr]_{f} \ar[r]_-{q'} & Q' \ar[d]_(.4){gs'} \ar[r]_-{s'} & C \ar[dl]^{g} \\
& B
}
\]
of $p$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$, and $q'\colon(A,f)\to(Q',g's')$ is the coidentifier of $\kappa$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$.
\end{Proposition}

\begin{proof}
The proof is the same as for Proposition \ref{prop:coinv}, replacing coinverters by coidentifiers.
\end{proof}

\begin{Corollary} \label{cor:fib.to.sfrac}
Let $B$ be an object in \ensuremath{\mathcal{C}}\ satisfying $(\dagger)$, $f\colon A \to B$ a fibration in \ensuremath{\mathcal{C}}, $\kappa$ its identee in \ensuremath{\mathcal{C}}, and $q\colon A \to Q$ its coidentifier in \ensuremath{\mathcal{C}}. Then the unique comparison morphism $s\colon Q \to B$, such that $sq=f$, is a fibration and $q$ is the coidentifier of $\kappa$ in $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$.
\end{Corollary}

In the cases we are interested in, which will be studied in the next section \ref{sec:casestudy}, the property $(\dagger)$ relies upon the exponentiability of split opfibrations in \ensuremath{\mathcal{C}}. In this context, exponentiability is to be understood in a 2-categorical sense: a 1-cell $f$ is exponentiable if the change-of-base 2-functor along $f$ has a right 2-adjoint.

\begin{Lemma} \label{lem:exp.to.dag}
If for an object $B$ in \ensuremath{\mathcal{C}}, the comma projection $d_1$ in the diagram
\[
\xymatrix{
B/B \ar[r]^-{d_0} \ar[d]_{d_1} & B \ar@{=}[d] \\
B \ar@{=}[r] \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"2";"1"^{\mu_B} & B
}
\]
is exponentiable, then the functor
\[
R\colon \ensuremath{\mathcal{C}}/B \to \ensuremath{\mathcal{C}}/B
\]
has a right 2-adjoint. As a consequence, $B$ satisfies the condition $(\dagger)$. In particular, this holds for any $B$ when split opfibrations in \ensuremath{\mathcal{C}}\ are exponentiable.
\end{Lemma}

\begin{proof}
It is easy to see that the functor $R$ can be described by means of the following construction:
\[
\xymatrix@!=5ex{
B/f \ar[r]_{d_1^*f} \ar@/^3ex/[rr]^{Rf} \ar[d]_{d_1} & B/B \ar[r]_-{d_0} \ar[d]_{d_1} & B \ar@{=}[d] \\
A \ar[r]_-{f} & B \ar@{=}[r] \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"2";"1"^{\mu_B} & B.
}
\]
That is, $R=(d_0)_{!}d_1^*$, i.e.\ the composite of the change-of-base 2-functor along $d_1$ with the composition 2-functor with $d_0$, which is left 2-adjoint to $d_0^*$. Hence $R$ is left 2-adjoint to $\Pi_{d_1}d_0^*$, where $\Pi_{d_1}$ denotes the right 2-adjoint to $d_1^*$, which exists by assumption.
\end{proof}

\begin{Remark} \label{rem:dagger'}
{\rm
If instead of $(\dagger)$ we ask for
\begin{itemize}
 \item[($\dagger'$)] The monad $L\colon \ensuremath{\mathcal{C}}/B\to \ensuremath{\mathcal{C}}/B$ preserves coinverters and coidentifiers of identees,
\end{itemize}
then the results of \ref{prop:coinv} and \ref{prop:coid} hold with $\ensuremath{\mathsf{Fib}_\mathcal{C}}(B)$ replaced by $\ensuremath{\mathsf{OpFib}}_{\ensuremath{\mathcal{C}}}(B)$. Accordingly, if $d_0$ is exponentiable, and in particular when split fibrations are exponentiable in \ensuremath{\mathcal{C}}, then $L$ admits a right 2-adjoint and $(\dagger')$ holds for $B$.
}
\end{Remark}

\subsection{Case study: \ensuremath{\mathsf{Cat}}\ and $\ensuremath{\mathsf{Fib}}(B)$} \label{sec:casestudy}

It is well-known that fibrations in \ensuremath{\mathsf{Cat}}\ are exponentiable \cite{Giraud} in the classical 1-categorical sense. As observed by Johnstone in \cite{Johnstone}, this property holds also in the 2-categorical sense recalled above. As a consequence, by Lemma \ref{lem:exp.to.dag} and Remark \ref{rem:dagger'}, we have:

\begin{Corollary} \label{cor:cat.dag}
In the 2-category \ensuremath{\mathsf{Cat}}, each object $B$ satisfies the conditions $(\dagger)$ and $(\dagger')$.
\end{Corollary}

One can extend the last property from \ensuremath{\mathsf{Cat}}\ to $\ensuremath{\mathsf{Fib}}(B)$ for each $B$, by means of the pseudo-functorial interpretation of fibrations in \ensuremath{\mathsf{Cat}}.

\begin{Remark} \label{rem:coinv.pseudofunct}
{\rm
As far as coinverters and coidentifiers of identees in $\ensuremath{\mathsf{Fib}}(B)$ are concerned, whose existence is guaranteed by Proposition \ref{prop:coinv} and Corollary \ref{cor:cat.dag}, let us observe that their construction can be performed fibrewise. In fact, given an identee
\[
\xymatrix{
K \ar@/^2ex/[r]_{}="1" \ar@/_2ex/[r]^{}="2" \ar@{=>}"1";"2"^{\kappa} & A
}
\]
in $\ensuremath{\mathsf{Fib}}(B)$, the collection of the coinverters (respectively coidentifiers) $q_b$ of its restrictions $\kappa_b$ to the fibres
\[
\xymatrix@!=6ex{
K_b \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\kappa_b} \ar[d]_{\beta^*} & A_b \ar[r]^{q_b} \ar[d]^{\beta^*} & Q_b \ar@{-->}[d]^{\beta^*} \\
K_{b'} \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\kappa_{b'}} & A_{b'} \ar[r]_{q_{b'}} & Q_{b'}
}
\]
gives rise to a natural transformation between pseudo-functors (see Section \ref{sec:pseudo} for details). It is easy to check that the corresponding morphism in $\ensuremath{\mathsf{Fib}}(B)$ is the coinverter (resp. coidentifier) of $\kappa$.
}
\end{Remark}

\begin{Lemma} \label{lem:internal.fib.pres}
For each internal fibration $p\colon(E,e)\to(A,a)$ in $\ensuremath{\mathsf{Fib}}(B)$, the change of base 2-functor $p^*\colon\ensuremath{\mathsf{Fib}}(B)/(A,a)\to\ensuremath{\mathsf{Fib}}(B)/(E,e)$ preserves coinverters and coidentifiers of identees.
\end{Lemma}

\begin{proof}
We will prove the result concerning internal fibrations and coinverters, the variations involving opfibrations and coidentifiers are obtained analogously.

Let the arrow $q\colon((C,c),f)\to((D,d),g)$ in the diagram
\[
\xymatrix@!=1.5ex{
K \ar@/_2ex/[ddrr]_{k} \ar@/^2.5ex/[rr]^{u}_{}="1" \ar@/_2.5ex/[rr]_{v}^{}="2" \ar@{=>}"1";"2"^{\kappa} & & C \ar[dd]_{c} \ar[rrr]^{f} \ar[dr]^{q} & & & A \ar@/^3ex/[ddlll]^{a} \\
& & & D \ar[urr]_{g} \ar[dl]_{d} \\
& & B
}
\]
be the coinverter in $\ensuremath{\mathsf{Fib}}(B)/(A,a)$ of an identee $\kappa$, and consider its image under the change of base 2-functor $p^*$, i.e.\ the upper part of the next diagram (we omit all arrows over $B$, all pullbacks provide in fact fibrations over $B$):
\[
\xymatrix@R=3ex@C=5ex{
K \times_A E \ar[dd] \ar@/^2.5ex/[rr]^{p^*u}_{}="1" \ar@/_2.5ex/[rr]_{p^*v}^{}="2" \ar@{=>}"1";"2"^{p^*\kappa} & & C \times_A E \ar[dd] \ar[rr]^{p^*f} \ar[dr]_{p^*q} & & E \ar[dd]^{p} \\
& & & D \times_A E \ar[ur]_{p^*g} \ar[dd] \\
K \ar@/^2.5ex/[rr]^{u}_{}="1" \ar@/_2.5ex/[rr]_{v}^{}="2" \ar@{=>}"1";"2"^{\kappa} & & C \ar[rr]^(.35){f} \ar[dr]_{q} & & A. \\
& & & D \ar[ur]_{g}
}
\]
We would like to show that $p^*q$ is the coinverter of the identee $p^*\kappa$ in $\ensuremath{\mathsf{Fib}}(B)/(E,e)$. To this end, we consider the restriction of the above diagram to the fibres over any object $b$ in $B$. By limit commutation, the latter is the same as the corresponding change of base diagram in the fibres over $b$:
\[
\xymatrix@R=3ex@C=5ex{
K_b \times_{A_b} E_b \ar[dd] \ar@/^2.5ex/[rr]^{p_b^*u_b}_{}="1" \ar@/_2.5ex/[rr]_{p_b^*v_b}^{}="2" \ar@{=>}"1";"2"^{p_b^*\kappa_b} & & C_b \times_{A_b} E_b \ar[dd] \ar[rr]^{p_b^*f_b} \ar[dr]_{p_b^*q_b} & & E_b \ar[dd]^{p_b} \\
& & & D_b \times_{A_b} E_b \ar[ur]_{p_b^*g_b} \ar[dd] \\
K_b \ar@/^2.5ex/[rr]^{u_b}_{}="1" \ar@/_2.5ex/[rr]_{v_b}^{}="2" \ar@{=>}"1";"2"^{\kappa_b} & & C_b \ar[rr]^(.35){f_b} \ar[dr]_{q_b} & & A_b. \\
& & & D_b \ar[ur]_{g_b}
}
\]
Now observe that, by Remark \ref{rem:coinv.pseudofunct}, $q_b$ is the coinverter of $\kappa_b$. Moreover, since $p_b$ is a fibration in \ensuremath{\mathsf{Cat}}\ by assumption, it is exponentiable, hence $p_b^*$ is a left 2-adjoint and $p_b^*q_b$ is the coinverter of $p_b^*\kappa_b$. Finally, again by Remark \ref{rem:coinv.pseudofunct}, $p^*q$ is the coinverter of $p^*\kappa$ in $\ensuremath{\mathsf{Fib}}(B)$, and hence in $\ensuremath{\mathsf{Fib}}(B)/(A,a)$.
\end{proof}

\begin{Proposition} \label{prop:dag.to.fib}
In the 2-category $\ensuremath{\mathsf{Fib}}(B)$, each object satisfies the conditions $(\dagger)$ and $(\dagger')$.
\end{Proposition}

\begin{proof}
Let $a\colon A \to B$ be a fibration of categories, then by Corollary \ref{cor:p0p1} the projections $d_0$ and $d_1$ of the comma square in $\ensuremath{\mathsf{Fib}}(B)$
\[
\xymatrix{
(A,a)/(A,a) \ar[r]^-{d_0} \ar[d]_{d_1} & (A,a) \ar@{=}[d] \\
(A,a) \ar@{=}[r] \ar@{}[ur]|(.3){}="1" \ar@{}[ur]|(.7){}="2" \ar@{=>}"2";"1"^{\mu_{(A,a)}} & (A,a)
}
\]
are an internal fibration and opfibration respectively. As a consequence, by Lemma \ref{lem:internal.fib.pres}, the corresponding change of base 2-functors $d_0^*$ and $d_1^*$ preserve coinverters and coidentifiers of identees. Now likewise in the proof of Lemma \ref{lem:exp.to.dag}, the thesis follows from the fact that $R=(d_0)_{!}d_1^*$ and $(d_0)_{!}$ is a left adjoint (and similarly for $L$).
\end{proof}

\begin{Proposition}
Let $p\colon(A,f)\to(C,g)$ be an internal fibration in $\ensuremath{\mathsf{Fib}}(B)$. Then the morphism $s$ in the factorization of Proposition \ref{prop:coinv} is an internal fibration in $\ensuremath{\mathsf{Fib}}(B)$.
\end{Proposition}

\begin{proof}
By Proposition \ref{prop:dag.to.fib}, we can apply Corollary \ref{cor:fib.to.frac} to the fibration $p$ in $\ensuremath{\mathsf{Fib}}(B)$.
\end{proof}

\section{Two factorization systems for (fibrewise) opfibrations in $\ensuremath{\mathsf{Fib}}(B)$}

\subsection{Two factorization systems in \ensuremath{\mathsf{Cat}}}

Let us consider the diagram
\[
\xymatrix@!=6ex{
W \ar@/^2ex/[r]_{}="1" \ar@/_2ex/[r]^{}="2" \ar@{=>}"1";"2"^{\omega} & A \ar[d]_{f} \ar[r]^{q} & Q \ar[dl]^{s} \\
& B
}
\]
in \ensuremath{\mathsf{Cat}}, where $q$ is the coinverter of the invertee $\omega$ of $f$.

The comparison functor $s$ is not conservative in general. One has to repeat this ``invertee-coinverter'' procedure possibly infinitely many times in order to get a conservative comparison, and an actual factorization system in \ensuremath{\mathsf{Cat}}\ \cite[Theorem C.0.31]{Joyal}. A similar phenomenon occurs when taking the ``identee-coidentifier'' analogue of the previous procedure, which allows to factor any functor as a (possibly infinite) sequence of coidentifiers followed by a discrete functor, i.e.~a functor whose fibres are discrete, yielding another factorization system in \ensuremath{\mathsf{Cat}}.

We are going to show that if we restrict ourselves to fibrations, both factorization procedures above simplify to a single-step factorization. Let us start with the second one showing that, for fibrations, it coincides with the comprehensive factorization system introduced in \cite{StW}. This actually holds not only in \ensuremath{\mathsf{Cat}}, but in any 2-category $\ensuremath{\mathsf{Cat}}(\ensuremath{\mathcal{E}})$ of internal categories where the construction of the comprehensive factorization of any functor provided in \cite{StV} is still valid, as, for example, when \ensuremath{\mathcal{E}}\ is a finitely cocomplete locally cartesian closed category, like any topos \ensuremath{\mathcal{E}}.

\begin{Proposition} \label{prop:comprehensive.cat}
Let $f\colon A \to B$ be a fibration in $\ensuremath{\mathsf{Cat}}(\ensuremath{\mathcal{E}})$ as above. The coidentifier of the identee of $f$, together with the comparison functor, factorizes $f$ into a final functor followed by a discrete fibration, giving then the comprehensive factorization of $f$. Starting with $f$ opfibration, the same procedure yields the dual comprehensive factorization of $f$ given by an initial functor followed by a discrete opfibration.
\end{Proposition}

\begin{proof}
We consider just the case of fibrations.
Following the approach of Section 3 in \cite{StV}, we perform the comprehensive factorization of $f$ by taking the free $R$-algebra $Rf$, which is a split fibration, and then reflecting it into a discrete fibration $p$:
\[
\xymatrix@!=7ex{
K_f \ar@/_/[r]_{\bar v}^{\top} \ar@/_2ex/[d]^{}="1" \ar@/^2ex/[d]_{}="2" \ar@{=>}"1";"2"^{\kappa_f} & K_{Rf} \ar@/_/[l]_{\bar r} \ar@/_2ex/[d]^{}="1" \ar@/^2ex/[d]_{}="2" \ar@{=>}"1";"2"_{\kappa_{Rf}} & Q \\
A \ar@/_/[r]_{v}^{\top} \ar@/^/[rru]^(.75){q} \ar[d]_{f} & B/f \ar[d]_{Rf} \ar@/_/[l]_{r} \ar[r]_-d & \pi_{0B}(B/f) \ar[u]^{t} \ar[d]_{p} \\
B \ar@{=}[r] & B \ar@{=}[r] & B.
}
\]
By construction of the above reflection, $d$ is the coidentifier of the identee $\kappa_{Rf}$ of $Rf$. Considering the adjunction $v \dashv r$ provided by the fact that $f$ is a fibration, we get $dv\kappa_f=d\kappa_{Rf}\bar{v}=1$, where $\kappa_f$ is the identee of $f$. Let now $q$ be a functor such that $q\kappa_f=1$, and consider the unit $\eta\colon 1 \to rv$ of the adjunction $v\dashv r$ in $\ensuremath{\mathsf{Cat}}(\ensuremath{\mathcal{E}})/B$. Then $f\eta=1$ and $\eta$ is contained in $\kappa_f$, so that $q\eta=1$ as well, and $qrv=q$. On the other hand, the counit $\epsilon\colon vr\to 1$ is such that $(Rf)\epsilon=1$, so it is contained in $\kappa_{Rf}$ and hence $d\epsilon=1$ and $dvr=d$.

Now, $qr\kappa_{Rf}=q\kappa_f\bar{r}=1$, so by the universal property of the coidentifier $d$ there exists a unique $t$ such that $td=qr$. Hence $q=qrv=tdv$, and $t$ is unique with this last property. Indeed, if $t'dv=q$ for some $t'$, then $t'd=t'dvr=qr=td$ and hence $t'=t$ since $d$ is cancellable. This proves that $dv$ is the coidentifier of $\kappa_f$, and then it is final \cite{StV}.
\end{proof}

\begin{Remark}{\rm
The last result also shows that, when $f$ is a fibration, the factorization of $f$ given by (sequence of coidentifiers, discrete functor) reduces to a single coidentifier and coincides with the comprehensive factorization.
}
\end{Remark}

In the special case of \ensuremath{\mathsf{Cat}}, Proposition \ref{prop:comprehensive.cat} can be proved directly by means of the pseudo-functorial interpretation of fibrations. This indeed is what we are going to do in order to obtain the analogous result, where coidentifiers are replaced by coinverters and discrete fibrations are replaced by fibrations in groupoids (i.e.~fibrations whose identee is an isomorphism).

\begin{Proposition} \label{prop:isocompr.cat}
Each fibration (respectively opfibration) $f\colon A \to B$ in \ensuremath{\mathsf{Cat}}\ admits a factorization given by the coinverter of the identee of $f$ followed by a fibration (resp.~opfibration) in groupoids. This factorization of $f$ coincides with the one given by (sequence of coinverters, conservative functor).
\end{Proposition}

\begin{proof}
Let us denote by
\[
\xymatrix{
\ensuremath{\mathsf{Cat}} \ar@<1.2ex>[r]^{\pi}_{\bot} & \ensuremath{\mathsf{Gpd}} \ar@{_(->}@<1.2ex>[l]^{i}
}
\]
the reflection of categories in groupoids, where the left 2-adjoint $\pi$ can be obtained by taking as unit component, for each category $A$, the coinverter $\eta_A$ of the 2-cell $\mu_A$ associated with the comma category $A/A$:
\[
\xymatrix@C=6ex{
A/A \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\mu_A} & A \ar[r]^-{\eta_A} & \pi(A)\,.
}
\]
Consider now a fibration $f\colon A\to B$ and denote by $[f]\colon B^{\ensuremath{\mathrm{op}}}\to \ensuremath{\mathsf{Cat}}$ the corresponding pseudo-functor. The composite $\pi[f]\colon B^{\ensuremath{\mathrm{op}}}\to \ensuremath{\mathsf{Gpd}}$ gives rise to a fibration in groupoids $\overline{f}\colon\overline{A}\to B$. On the other hand, $\eta[f]$ corresponds to a morphism $q\colon (A,f) \to (\overline{A},\overline{f})$ in $\ensuremath{\mathsf{Fib}}(B)$:
\[
\xymatrix{
A \ar[dr]_f \ar[rr]^{q} & & \overline{A} \ar[dl]^{\overline{f}} \\
& B.
}
\]
The component $q_b$ of $\eta[f]$ at an object $b$ of $B$ is actually the coinverter $\eta_{A_b}$ of $\mu_{A_b}$:
\[
\xymatrix@C=6ex{
A_b/A_b \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\mu_{A_b}} & A_b \ar[r]^-{\eta_{A_b}} & \pi(A_b).
}
\]
It is not difficult to see that the pair $(A_b/A_b,\mu_{A_b})$ coincides with the restriction $(K_b,\kappa_b)$ of the identee $(K,\kappa)$ of $f$ to the fibre over $b$. Hence, as explained in Remark \ref{rem:coinv.pseudofunct}, $q$ turns out to be the coinverter of $\kappa$ in $\ensuremath{\mathsf{Fib}}(B)$. Thanks to Corollary \ref{cor:isofib.cons=gpd(isofib)}, $\overline{f}$ is conservative and we get the desired factorization of $f$.
\end{proof}

\subsection{From \ensuremath{\mathsf{Cat}}\ to $\ensuremath{\mathsf{Fib}}(B)$} \label{sec:pseudo}

We are going to use now the results of the previous section to produce analogous factorizations for (fibrewise) opfibrations in $\ensuremath{\mathsf{Fib}}(B)$. Our focus on this case is motivated by the study of cohomology theories provided in \cite{CMMV17}. Analogous results are still valid while considering (fibrewise) fibrations in $\ensuremath{\mathsf{Fib}}(B)$ or (fibrewise) opfibrations in $\ensuremath{\mathsf{OpFib}}(B)$. It is a well known result, due to B\'enabou, that fibrations in $\ensuremath{\mathsf{Fib}}(B)$ (opfibrations in $\ensuremath{\mathsf{OpFib}}(B)$) are just fibrations (opfibrations) in \ensuremath{\mathsf{Cat}}, so that this case reduces to Propositions \ref{prop:comprehensive.cat} and \ref{prop:isocompr.cat}, thanks to Propositions \ref{prop:coinv} and \ref{prop:coid}.

Let us recall from \cite{CMMV17} the following definitions and results.

\begin{Definition} \label{def:fw} {\rm(see \cite[Definition 2.1]{CMMV17})}
We say that a morphism $p\colon (A,f)\to (C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$ is a \emph{fibrewise (discrete) opfibration} if, for every object $b$ of $B$, the restriction $p_b\colon A_b\to C_b$ of $p$ to the $b$-fibres is a (discrete) opfibration.
\end{Definition}

From Theorem 2.8 in \cite{CMMV17} it follows that every internal opfibration in $\ensuremath{\mathsf{Fib}}(B)$ is a fibrewise opfibration, while the latter is exactly a morphism in $\ensuremath{\mathsf{Fib}}(B)$ which is an internal opfibration in $\ensuremath{\mathsf{Cat}}/B$ (see Proposition 2.5 and Proposition 2.7 in \cite{CMMV17}). By Corollary 2.9 in [\emph{loc.~cit.}] in the discrete case the two notions coincide. Recall also from [\emph{loc.~cit.}] that Yoneda's \emph{regular spans} and \emph{two-sided fibrations} are instances, respectively, of fibrewise opfibrations and internal opfibrations in $\ensuremath{\mathsf{Fib}}(B)$.
\medskip

Let us consider a fibrewise opfibration $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$ and focus our attention on its restriction $p_b$ to a single fibre over some $b$ in $B$. By the dual of Proposition \ref{prop:comprehensive.cat}, we can perform the comprehensive factorization of the opfibration $p_b\colon A_b \to C_b$ by means of the coidentifier $q_b$ of its identee:
\[
\xymatrix{
A_b \ar@/_3ex/[rr]_{p_b} \ar[r]^{q_b} & Q_b \ar[r]^{s_b} & C_b.
}
\]
Since $f$ and $g$ are fibrations, the assignments $b\mapsto A_b$ and $b\mapsto C_b$ are pseudo-functorial and the collection of the functors $p_b$ gives rise to a natural transformation of pseudo-functors from $B^{op}$ to \ensuremath{\mathsf{Cat}}. By the universal property of the coidentifiers $q_b$ for each $b$, the $Q_b$'s are also pseudo-functorial and the $q_b$'s and $s_b$'s organize in two natural transformations. Let us briefly show how this can be proved.

For each $b$ in $B$, we denote by $(K_b,\kappa_b)$ the identee of $p_b$. Let us observe that also the assignment $b\mapsto K_b$ is pseudo-functorial and together with the collection of the $\kappa_b$'s, it determines the identee $(K,\kappa)$ of the cartesian functor $p$. Given an arrow $\beta\colon b'\to b$ in $B$, we always denote by $\beta^*$ its associated change of base functor for any chosen fibration over $B$. Since $q_{b'}\beta^*\kappa_b=q_{b'}\kappa_{b'}\beta^*=1$, by the universal property of the coidentifier $q_b$ there is a unique functor $\beta^*\colon Q_b\to Q_b'$ such that $\beta^*q_b=q_{b'}\beta^*$:
\[
\xymatrix@!=6ex{
K_b \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\kappa_b} \ar[d]_{\beta^*} & A_b \ar[r]^{q_b} \ar[d]^{\beta^*} & Q_b \ar[r]^{s_b} \ar@{-->}[d]^{\beta^*} & C_b \ar[d]^{\beta^*} \\
K_{b'} \ar@/_2ex/[r]^{}="1" \ar@/^2ex/[r]_{}="2" \ar@{=>}"2";"1"^{\kappa_{b'}} & A_{b'} \ar[r]_{q_{b'}} & Q_{b'} \ar[r]_{s_{b'}} & C_{b'}.
}
\]
Given a composable pair of arrows
\[
\xymatrix{
b'' \ar[r]^{\beta'} & b' \ar[r]^{\beta} & b
}
\]
in $B$, let $\phi_{\beta,\beta'}\colon (\beta')^*\beta^*\to (\beta\beta')^*$ and $\gamma_{\beta,\beta'}\colon (\beta')^*\beta^*\to (\beta\beta')^*$ be the corresponding coherence isomorphisms induced by the fibrations $f$ and $g$ respectively. Since $q_{b''}\phi_{\beta,\beta'}$ is a 2-cell between $q_{b''}(\beta')^*\beta^*=(\beta')^*\beta^*q_b$ and $q_{b''}(\beta\beta')^*=(\beta\beta')^*q_b$, then by the universal property of the coidentifier $q_b$ there exists a unique invertible 2-cell $\psi_{\beta,\beta'}$ such that $\psi_{\beta,\beta'}q_b=q_{b''}\phi_{\beta,\beta'}$.
\[
\xymatrix@C=10ex@R=8ex{
A_b \ar[r]^{q_b} \ar[d]^{\beta^*}_(.8){}="1" \ar@/_6.5ex/[dd]_{(\beta\beta')^*}^(.4){}="2" \ar@{=>}"1";"2"_{\phi_{\beta,\beta'}}^\sim & Q_b \ar[r]^{s_b} \ar[d]_{\beta^*}^(.8){}="3" \ar@/^6.5ex/[dd]^(.25){(\beta\beta')^*}^(.4){}="4" \ar@{=>}"3";"4"^{\psi_{\beta,\beta'}}_\sim & C_b \ar[d]_{\beta^*}^(.8){}="5" \ar@/^6.5ex/[dd]^{(\beta\beta')^*}^(.4){}="6" \ar@{=>}"5";"6"^{\gamma_{\beta,\beta'}}_\sim \\
A_{b'} \ar[r]^{q_{b'}} \ar[d]^{(\beta')^*} & Q_{b'} \ar[r]|(.42)\hole^(.7){s_{b'}} \ar[d]_{(\beta')^*} & C_{b'} \ar[d]_{(\beta')^*} \\
A_{b''} \ar[r]_{q_{b''}} & Q_{b''} \ar[r]_{s_{b''}} & C_{b''}.
}
\]
Moreover, the equality $\gamma_{\beta,\beta'}s_bq_b=s_{b''}q_{b''}\phi_{\beta,\beta'}=s_{b''}\psi_{\beta,\beta'}q_b$ implies that $\gamma_{\beta,\beta'}s_b=s_{b''}\psi_{\beta,\beta'}$ since $q_b$ is right cancellable. Finally, the coherence conditions on the $\psi$'s making the assignment $b\mapsto Q_b$ into a pseudo-functor can be deduced once again by the universal property of the $q_b$'s. If $(K,\kappa)$ is the identee of $p$, since, for a morphism $t\colon(A,f)\to(Y,y)$ in $\ensuremath{\mathsf{Fib}}(B)$, $t\kappa=1$ if and only if $t_b\kappa_b=1$ for each $b$ in $B$, $q$ is actually the coidentifier of $\kappa$ in $\ensuremath{\mathsf{Fib}}(B)$. Recalling that, since each $s_b$ is a discrete opfibration, $s$ is an internal discrete opfibration, we have just proved the following result.

\begin{Proposition} \label{prop:comprehensive.int}
Every fibrewise opfibration $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$ admits a \emph{comprehensive factorization}
\[
\xymatrix@!=6ex{
A \ar@/^3ex/[rr]^{p} \ar[dr]_{f} \ar[r]_-{q} & Q \ar[d]_(.4){h} \ar[r]_-{s} & C \ar[dl]^{g} \\
& B
}
\]
where $q$ is the coidentifier of the identee of $p$ and $s$ is a discrete opfibration in $\ensuremath{\mathsf{Fib}}(B)$.
\end{Proposition}

The same result (with $g$ a split fibration) is obtained in Section 3.3 of \cite{CMMV17}, by providing an explicit construction of the discrete opfibration $s$ together with an ad hoc definition of $q$, which is later on proved to be the coidentifier of the identee of $p$.
\smallskip

As a corollary of Proposition \ref{prop:comprehensive.int}, we get an extension of Proposition \ref{prop:comprehensive.cat} in the case of \ensuremath{\mathsf{Cat}}.

\begin{Corollary}
For every fibrewise opfibration $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$, the factorization of Proposition \ref{prop:comprehensive.int} coincides with the one given by (sequence of coidentifiers, discrete functor) in \ensuremath{\mathsf{Cat}}.
\end{Corollary}

The present approach allows us to obtain an analogous result concerning the factorization given by (coinverter, opfibration in groupoids).

\begin{Proposition} \label{prop:refl.gpd.fib}
Every fibrewise (resp.~internal) opfibration $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$ admits a factorization
\[
\xymatrix@!=6ex{
A \ar@/^3ex/[rr]^{p} \ar[dr]_{f} \ar[r]_-{q'} & Q' \ar[d]_(.4){h'} \ar[r]_-{s'} & C \ar[dl]^{g} \\
& B
}
\]
where $q'$ is the coinverter of the identee of $p$ and $s'$ is a fibrewise (resp.~internal) opfibration in groupoids in $\ensuremath{\mathsf{Fib}}(B)$.
\end{Proposition}

\begin{proof}
Let us start with a fibrewise opfibration $p$. The coinverter $q'$ of the identee of $p$ in $\ensuremath{\mathsf{Fib}}(B)$ and the comparison arrow $s'$ can be constructed following the lines of the previous paragraph, by means of coinverters taken fibrewise. This means that for each $b$ in $B$, $(q'_b,s'_b)$ gives the factorization of $p_b$ into a coinverter followed by an opfibration in groupoids, thanks to Proposition \ref{prop:isocompr.cat}. Hence $s'$ is a fibrewise opfibration in groupoids.

If moreover $p$ is an internal opfibration, then $s'$ is also an internal opfibration by Corollary \ref{cor:fib.to.frac} applied to $\ensuremath{\mathsf{Fib}}(B)$, thanks to Proposition \ref{prop:dag.to.fib}.
\end{proof}

As a consequence, we get an extension of Proposition \ref{prop:isocompr.cat}.

\begin{Proposition} \label{prop:ultima}
For every fibrewise opfibration $p\colon(A,f)\to(C,g)$ in $\ensuremath{\mathsf{Fib}}(B)$, the factorization of Proposition \ref{prop:refl.gpd.fib} coincides with the one given by (sequence of coinverters, conservative functor) in \ensuremath{\mathsf{Cat}}.
\end{Proposition}

\begin{proof}
By Proposition \ref{prop:coinv}, the arrow $q'$ in the above factorization can be obtained as the coinverter of the identee $\kappa$ of $p$ in \ensuremath{\mathsf{Cat}}\ (which is also the identee in $\ensuremath{\mathsf{Cat}}/B$). Actually, $q'$ is also the coinverter of the invertee $\omega$ of $p$ in \ensuremath{\mathsf{Cat}}. Indeed, since $f\omega$ is an isomorphism, thanks to Lemma \ref{lemma:psvert=vert}, it factorizes as $\sigma\cdot\tau$, with $\sigma$ an isomorphism and $\tau$ an $f$-vertical 2-cell. Then $p\tau=p(\sigma^{-1}\cdot\omega)$ is an isomorphism, hence $\tau$ factorizes through the invertee $\omega'$ of $p$ in $\ensuremath{\mathsf{Cat}}/B$.
Since $p$ is an opfibration in $\ensuremath{\mathsf{Cat}}/B$, by Corollary \ref{cor:isofib.cons=gpd(isofib)}, the coinverter $q'$ of $\kappa$ in $\ensuremath{\mathsf{Cat}}/B$ is also the coinverter of $\omega'$ in $\ensuremath{\mathsf{Cat}}/B$, hence $q'\tau$ is an isomorphism. As a consequence $q'\omega$ is an isomorphism, and the universal property in \ensuremath{\mathsf{Cat}}~follows easily.

Using the same technique as before, considering now the invertee $\omega$ of $s'$ in \ensuremath{\mathsf{Cat}}, we get that $\omega=\sigma\cdot\tau$ with $\sigma$ an isomorphism and $\tau$ an $h'$-vertical 2-cell. As above, $\tau$ factorizes through the invertee $\omega'$ of $s'$ in $\ensuremath{\mathsf{Cat}}/B$, which is an isomorphism by Corollary \ref{cor:isofib.cons=gpd(isofib)}, because $s'$ is an opfibration in groupoids in $\ensuremath{\mathsf{Cat}}/B$. In conclusion, the factorization of $p$ in \ensuremath{\mathsf{Cat}}\ through a conservative functor is obtained by means of just one coinverter $q'$.
\end{proof}