Lemma 8.11.3. Let $\mathcal{C}$ be a site. Let $p : \mathcal{X} \to \mathcal{C}$ and $q : \mathcal{Y} \to \mathcal{C}$ be stacks in groupoids. Let $F : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism of categories over $\mathcal{C}$. The following are equivalent

1. For some (equivalently any) factorization $F = F' \circ a$ where $a : \mathcal{X} \to \mathcal{X}'$ is an equivalence of categories over $\mathcal{C}$ and $F'$ is fibred in groupoids, the map $F' : \mathcal{X}' \to \mathcal{Y}$ is a gerbe (with the topology on $\mathcal{Y}$ inherited from $\mathcal{C}$).

2. The following two conditions are satisfied

1. for $y \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{Y})$ lying over $U \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$ there exists a covering $\{ U_ i \to U\}$ in $\mathcal{C}$ and objects $x_ i$ of $\mathcal{X}$ over $U_ i$ such that $F(x_ i) \cong y|_{U_ i}$ in $\mathcal{Y}_{U_ i}$, and

2. for $U \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$, $x, x' \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{X}_ U)$, and $b : F(x) \to F(x')$ in $\mathcal{Y}_ U$ there exists a covering $\{ U_ i \to U\}$ in $\mathcal{C}$ and morphisms $a_ i : x|_{U_ i} \to x'|_{U_ i}$ in $\mathcal{X}_{U_ i}$ with $F(a_ i) = b|_{U_ i}$.

Proof. By Categories, Lemma 4.35.15 there exists a factorization $F = F' \circ a$ where $a : \mathcal{X} \to \mathcal{X}'$ is an equivalence of categories over $\mathcal{C}$ and $F'$ is fibred in groupoids. By Categories, Lemma 4.35.16 given any two such factorizations $F = F' \circ a = F'' \circ b$ we have that $\mathcal{X}'$ is equivalent to $\mathcal{X}''$ as categories over $\mathcal{Y}$. Hence Lemma 8.11.2 guarantees that the condition (1) is independent of the choice of the factorization. Moreover, this means that we may assume $\mathcal{X}' = \mathcal{X} \times _{F, \mathcal{Y}, \text{id}} \mathcal{Y}$ as in the proof of Categories, Lemma 4.35.15

Let us prove that (a) and (b) imply that $\mathcal{X}' \to \mathcal{Y}$ is a gerbe. First of all, by Lemma 8.10.5 we see that $\mathcal{X}' \to \mathcal{Y}$ is a stack in groupoids. Next, let $y$ be an object of $\mathcal{Y}$ lying over $U \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$. By (a) we can find a covering $\{ U_ i \to U\}$ in $\mathcal{C}$ and objects $x_ i$ of $\mathcal{X}$ over $U_ i$ and isomorphisms $f_ i : F(x_ i) \to y|_{U_ i}$ in $\mathcal{Y}_{U_ i}$. Then $(U_ i, x_ i, y|_{U_ i}, f_ i)$ are objects of $\mathcal{X}'_{U_ i}$, i.e., the second condition of Definition 8.11.1 holds. Finally, let $(U, x, y, f)$ and $(U, x', y, f')$ be objects of $\mathcal{X}'$ lying over the same object $y \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{Y})$. Set $b = (f')^{-1} \circ f$. By condition (b) we can find a covering $\{ U_ i \to U\}$ and isomorphisms $a_ i : x|_{U_ i} \to x'|_{U_ i}$ in $\mathcal{X}_{U_ i}$ with $F(a_ i) = b|_{U_ i}$. Then

$(a_ i, \text{id}) : (U, x, y, f)|_{U_ i} \to (U, x', y, f')|_{U_ i}$

is a morphism in $\mathcal{X}'_{U_ i}$ as desired. This proves that (2) implies (1).

To prove that (1) implies (2) one reads the arguments in the preceding paragraph backwards. Details omitted. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).