# The Stacks Project

## Tag 04SX

### 84.9. Morphisms representable by algebraic spaces

In analogy with Categories, Definition 4.40.5 we make the following definition.

Definition 84.9.1. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. A $1$-morphism $f : \mathcal{X} \to \mathcal{Y}$ of categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$ is called representable by algebraic spaces if for any $U \in \mathop{\rm Ob}\nolimits((\textit{Sch}/S)_{fppf})$ and any $y : (\textit{Sch}/U)_{fppf} \to \mathcal{Y}$ the category fibred in groupoids $$(\textit{Sch}/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$$ over $(\textit{Sch}/U)_{fppf}$ is representable by an algebraic space over $U$.

Choose an algebraic space $F_y$ over $U$ which represents $(\textit{Sch}/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$. We may think of $F_y$ as an algebraic space over $S$ which comes equipped with a canonical morphism $f_y : F_y \to U$ over $S$, see Spaces, Section 56.16. Here is the diagram $$\tag{84.9.1.1} \vcenter{ \xymatrix{ F_y \ar[d]_{f_y} & (\textit{Sch}/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X} \ar@{~>}[l] \ar[d]_{\text{pr}_0} \ar[r]_-{\text{pr}_1} & \mathcal{X} \ar[d]^f \\ U & (\textit{Sch}/U)_{fppf} \ar@{~>}[l] \ar[r]^-y & \mathcal{Y} } }$$ where the squiggly arrows represent the construction which associates to a stack fibred in setoids its associated sheaf of isomorphism classes of objects. The right square is $2$-commutative, and is a $2$-fibre product square.

Here is the analogue of Categories, Lemma 4.40.7.

Lemma 84.9.2. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism of categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$. The following are necessary and sufficient conditions for $f$ to be representable by algebraic spaces:

1. for each scheme $U/S$ the functor $f_U : \mathcal{X}_U \longrightarrow \mathcal{Y}_U$ between fibre categories is faithful, and
2. for each $U$ and each $y \in \mathop{\rm Ob}\nolimits(\mathcal{Y}_U)$ the presheaf $$(h : V \to U) \longmapsto \{(x, \phi) \mid x \in \mathop{\rm Ob}\nolimits(\mathcal{X}_V), \phi : h^*y \to f(x)\}/\cong$$ is an algebraic space over $U$.

Here we have made a choice of pullbacks for $\mathcal{Y}$.

Proof. This follows from the description of fibre categories of the $2$-fibre products $(\textit{Sch}/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$ in Categories, Lemma 4.40.3 combined with Lemma 84.8.2. $\square$

Lemma 84.9.3. Let $S$ be an object of $\textit{Sch}_{fppf}$. Consider a $2$-commutative diagram $$\xymatrix{ \mathcal{X}' \ar[r] \ar[d]_{f'} & \mathcal{X} \ar[d]^f \\ \mathcal{Y}' \ar[r] & \mathcal{Y} }$$ of $1$-morphisms of categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$. Assume the horizontal arrows are equivalences. Then $f$ is representable by algebraic spaces if and only if $f'$ is representable by algebraic spaces.

Proof. Omitted. $\square$

Lemma 84.9.4. Let $S$ be an object of $\textit{Sch}_{fppf}$. Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism of categories fibred in groupoids over $S$. If $\mathcal{X}$ and $\mathcal{Y}$ are representable by algebraic spaces over $S$, then the $1$-morphism $f$ is representable by algebraic spaces.

Proof. Omitted. This relies only on the fact that the category of algebraic spaces over $S$ has fibre products, see Spaces, Lemma 56.7.3. $\square$

Lemma 84.9.5. Let $S$ be an object of $\textit{Sch}_{fppf}$. Let $a : F \to G$ be a map of presheaves of sets on $(\textit{Sch}/S)_{fppf}$. Denote $a' : \mathcal{S}_F \to \mathcal{S}_G$ the associated map of categories fibred in sets. Then $a$ is representable by algebraic spaces (see Bootstrap, Definition 71.3.1) if and only if $a'$ is representable by algebraic spaces.

Proof. Omitted. $\square$

Lemma 84.9.6. Let $S$ be an object of $\textit{Sch}_{fppf}$. Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism of categories fibred in setoids over $(\textit{Sch}/S)_{fppf}$. Let $F$, resp. $G$ be the presheaf which to $T$ associates the set of isomorphism classes of objects of $\mathcal{X}_T$, resp. $\mathcal{Y}_T$. Let $a : F \to G$ be the map of presheaves corresponding to $f$. Then $a$ is representable by algebraic spaces (see Bootstrap, Definition 71.3.1) if and only if $f$ is representable by algebraic spaces.

Proof. Omitted. Hint: Combine Lemmas 84.9.3 and 84.9.5. $\square$

Lemma 84.9.7. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$ be categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$. Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism representable by algebraic spaces. Let $g : \mathcal{Z} \to \mathcal{Y}$ be any $1$-morphism. Consider the fibre product diagram $$\xymatrix{ \mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \ar[r]_-{g'} \ar[d]_{f'} & \mathcal{X} \ar[d]^f \\ \mathcal{Z} \ar[r]^g & \mathcal{Y} }$$ Then the base change $f'$ is a $1$-morphism representable by algebraic spaces.

Proof. This is formal. $\square$

Lemma 84.9.8. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$ be categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$ Let $f : \mathcal{X} \to \mathcal{Y}$, $g : \mathcal{Z} \to \mathcal{Y}$ be $1$-morphisms. Assume

1. $f$ is representable by algebraic spaces, and
2. $\mathcal{Z}$ is representable by an algebraic space over $S$.

Then the $2$-fibre product $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$ is representable by an algebraic space.

Proof. This is a reformulation of Bootstrap, Lemma 71.3.6. First note that $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$ is fibred in setoids over $(\textit{Sch}/S)_{fppf}$. Hence it is equivalent to $\mathcal{S}_F$ for some presheaf $F$ on $(\textit{Sch}/S)_{fppf}$, see Categories, Lemma 4.38.5. Moreover, let $G$ be an algebraic space which represents $\mathcal{Z}$. The $1$-morphism $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$ is representable by algebraic spaces by Lemma 84.9.7. And $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$ corresponds to a morphism $F \to G$ by Categories, Lemma 4.38.6. Then $F \to G$ is representable by algebraic spaces by Lemma 84.9.6. Hence Bootstrap, Lemma 71.3.6 implies that $F$ is an algebraic space as desired. $\square$

Let $S$, $\mathcal{X}$, $\mathcal{Y}$, $\mathcal{Z}$, $f$, $g$ be as in Lemma 84.9.8. Let $F$ and $G$ be algebraic spaces over $S$ such that $F$ represents $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$ and $G$ represents $\mathcal{Z}$. The $1$-morphism $f' : \mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$ corresponds to a morphism $f' : F \to G$ of algebraic spaces by (84.8.2.1). Thus we have the following diagram $$\tag{84.9.8.1} \vcenter{ \xymatrix{ F \ar[d]_{f'} & \mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \ar@{~>}[l] \ar[d] \ar[r] & \mathcal{X} \ar[d]^f \\ G & \mathcal{Z} \ar@{~>}[l] \ar[r]^-g & \mathcal{Y} } }$$ where the squiggly arrows represent the construction which associates to a stack fibred in setoids its associated sheaf of isomorphism classes of objects.

Lemma 84.9.9. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$ be categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$. If $f : \mathcal{X} \to \mathcal{Y}$, $g : \mathcal{Y} \to \mathcal{Z}$ are $1$-morphisms representable by algebraic spaces, then $$g \circ f : \mathcal{X} \longrightarrow \mathcal{Z}$$ is a $1$-morphism representable by algebraic spaces.

Proof. This follows from Lemma 84.9.8. Details omitted. $\square$

Lemma 84.9.10. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $\mathcal{X}_i, \mathcal{Y}_i$ be categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$, $i = 1, 2$. Let $f_i : \mathcal{X}_i \to \mathcal{Y}_i$, $i = 1, 2$ be $1$-morphisms representable by algebraic spaces. Then $$f_1 \times f_2 : \mathcal{X}_1 \times \mathcal{X}_2 \longrightarrow \mathcal{Y}_1 \times \mathcal{Y}_2$$ is a $1$-morphism representable by algebraic spaces.

Proof. Write $f_1 \times f_2$ as the composition $\mathcal{X}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1 \times \mathcal{Y}_2$. The first arrow is the base change of $f_1$ by the map $\mathcal{Y}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1$, and the second arrow is the base change of $f_2$ by the map $\mathcal{Y}_1 \times \mathcal{Y}_2 \to \mathcal{Y}_2$. Hence this lemma is a formal consequence of Lemmas 84.9.9 and 84.9.7. $\square$

Lemma 84.9.11. Let $S$ be a scheme contained in $\textit{Sch}_{fppf}$. Let $\mathcal{X} \to \mathcal{Z}$ and $\mathcal{Y} \to \mathcal{Z}$ be $1$-morphisms of categories fibred in groupoids over $(\textit{Sch}/S)_{fppf}$. If $\mathcal{X} \to \mathcal{Z}$ is representable by algebraic spaces and $\mathcal{Y}$ is a stack in groupoids, then $\mathcal{X} \times_\mathcal{Z} \mathcal{Y}$ is a stack in groupoids.

Proof. The property of a morphism being representable by algebraic spaces is preserved under base-change (Lemma 84.9.8), and so, passing to the base-change $\mathcal{X} \times_\mathcal{Z} \mathcal{Y}$ over $\mathcal{Y}$, we may reduce to the case of a morphism of categories fibred in groupoids $\mathcal{X} \to \mathcal{Y}$ which is representable by algebraic spaces, and whose target is a stack in groupoids; our goal is then to prove that $\mathcal{X}$ is also a stack in groupoids. This follows from Stacks, Lemma 8.6.11 whose assumptions are satisfied as a result of Lemma 84.9.2. $\square$

The code snippet corresponding to this tag is a part of the file algebraic.tex and is located in lines 495–835 (see updates for more information).

\section{Morphisms representable by algebraic spaces}
\label{section-morphisms-representable-by-algebraic-spaces}

\noindent
In analogy with Categories, Definition
\ref{categories-definition-representable-map-categories-fibred-in-groupoids}
we make the following definition.

\begin{definition}
\label{definition-representable-by-algebraic-spaces}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
A $1$-morphism $f : \mathcal{X} \to \mathcal{Y}$ of
categories fibred in groupoids over $(\Sch/S)_{fppf}$
is called {\it representable by algebraic spaces} if
for any $U \in \Ob((\Sch/S)_{fppf})$
and any $y : (\Sch/U)_{fppf} \to \mathcal{Y}$
the category fibred in groupoids
$$(\Sch/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$$
over $(\Sch/U)_{fppf}$
is representable by an algebraic space over $U$.
\end{definition}

\noindent
Choose an algebraic space $F_y$ over $U$ which represents
$(\Sch/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$.
We may think of $F_y$ as an algebraic space over $S$
which comes equipped with a canonical morphism $f_y : F_y \to U$
over $S$, see
Spaces, Section \ref{spaces-section-change-base-scheme}.
Here is the diagram

\label{equation-representable-by-algebraic-spaces}
\vcenter{
\xymatrix{
F_y \ar[d]_{f_y} &
(\Sch/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}
\ar@{~>}[l] \ar[d]_{\text{pr}_0} \ar[r]_-{\text{pr}_1} &
\mathcal{X} \ar[d]^f \\
U &
(\Sch/U)_{fppf} \ar@{~>}[l] \ar[r]^-y &
\mathcal{Y}
}
}

where the squiggly arrows represent the construction which associates
to a stack fibred in setoids its associated sheaf of isomorphism classes
of objects. The right square is
$2$-commutative, and is a $2$-fibre product square.

\medskip\noindent
Here is the analogue of Categories,
Lemma \ref{categories-lemma-criterion-representable-map-stack-in-groupoids}.

\begin{lemma}
\label{lemma-criterion-map-representable-spaces-fibred-in-groupoids}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism
of categories fibred in groupoids over $(\Sch/S)_{fppf}$.
The following are necessary and sufficient conditions for
$f$ to be representable by algebraic spaces:
\begin{enumerate}
\item for each scheme $U/S$ the
functor $f_U : \mathcal{X}_U \longrightarrow \mathcal{Y}_U$
between fibre categories is faithful, and
\item for each $U$ and each $y \in \Ob(\mathcal{Y}_U)$ the presheaf
$$(h : V \to U) \longmapsto \{(x, \phi) \mid x \in \Ob(\mathcal{X}_V), \phi : h^*y \to f(x)\}/\cong$$
is an algebraic space over $U$.
\end{enumerate}
Here we have made a choice of pullbacks for $\mathcal{Y}$.
\end{lemma}

\begin{proof}
This follows from the description of fibre categories of the $2$-fibre products
$(\Sch/U)_{fppf} \times_{y, \mathcal{Y}} \mathcal{X}$ in
Categories, Lemma \ref{categories-lemma-identify-fibre-product}
combined with
Lemma \ref{lemma-characterize-representable-by-space}.
\end{proof}

\noindent

\begin{lemma}
\label{lemma-representable-by-spaces-morphism-equivalent}
Let $S$ be an object of $\Sch_{fppf}$.
Consider a $2$-commutative diagram
$$\xymatrix{ \mathcal{X}' \ar[r] \ar[d]_{f'} & \mathcal{X} \ar[d]^f \\ \mathcal{Y}' \ar[r] & \mathcal{Y} }$$
of $1$-morphisms of categories fibred in groupoids over
$(\Sch/S)_{fppf}$.
Assume the horizontal arrows are equivalences.
Then $f$ is representable by algebraic spaces
if and only if $f'$ is representable by algebraic spaces.
\end{lemma}

\begin{proof}
Omitted.
\end{proof}

\begin{lemma}
\label{lemma-morphism-spaces-gives-representable-by-spaces}
Let $S$ be an object of $\Sch_{fppf}$.
Let $f : \mathcal{X} \to \mathcal{Y}$
be a $1$-morphism of categories fibred in groupoids over $S$.
If $\mathcal{X}$ and $\mathcal{Y}$ are representable by
algebraic spaces over $S$, then the $1$-morphism $f$
is representable by algebraic spaces.
\end{lemma}

\begin{proof}
Omitted. This relies only on the fact that
the category of algebraic spaces over $S$ has fibre products,
see Spaces, Lemma \ref{spaces-lemma-fibre-product-spaces}.
\end{proof}

\begin{lemma}
\label{lemma-map-presheaves-representable-by-algebraic-spaces}
Let $S$ be an object of $\Sch_{fppf}$.
Let $a : F \to G$ be a map of presheaves of sets on $(\Sch/S)_{fppf}$.
Denote $a' : \mathcal{S}_F \to \mathcal{S}_G$ the associated
map of categories fibred in sets.
Then $a$ is representable by algebraic spaces (see
Bootstrap,
Definition \ref{bootstrap-definition-morphism-representable-by-spaces})
if and only if $a'$ is representable by algebraic spaces.
\end{lemma}

\begin{proof}
Omitted.
\end{proof}

\begin{lemma}
\label{lemma-map-fibred-setoids-representable-algebraic-spaces}
Let $S$ be an object of $\Sch_{fppf}$.
Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism of
categories fibred in setoids over $(\Sch/S)_{fppf}$.
Let $F$, resp.\ $G$ be the presheaf which to $T$ associates
the set of isomorphism classes of objects of
$\mathcal{X}_T$, resp.\ $\mathcal{Y}_T$.
Let $a : F \to G$ be the map of presheaves corresponding to $f$.
Then $a$ is representable by algebraic spaces (see
Bootstrap,
Definition \ref{bootstrap-definition-morphism-representable-by-spaces})
if and only if $f$ is representable by algebraic spaces.
\end{lemma}

\begin{proof}
Omitted. Hint: Combine
Lemmas \ref{lemma-representable-by-spaces-morphism-equivalent}
and \ref{lemma-map-presheaves-representable-by-algebraic-spaces}.
\end{proof}

\begin{lemma}
\label{lemma-base-change-representable-by-spaces}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$
be categories fibred in groupoids over $(\Sch/S)_{fppf}$.
Let $f : \mathcal{X} \to \mathcal{Y}$ be a $1$-morphism
representable by algebraic spaces.
Let $g : \mathcal{Z} \to \mathcal{Y}$ be any $1$-morphism.
Consider the fibre product diagram
$$\xymatrix{ \mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \ar[r]_-{g'} \ar[d]_{f'} & \mathcal{X} \ar[d]^f \\ \mathcal{Z} \ar[r]^g & \mathcal{Y} }$$
Then the base change $f'$ is a $1$-morphism representable by
algebraic spaces.
\end{lemma}

\begin{proof}
This is formal.
\end{proof}

\begin{lemma}
\label{lemma-base-change-by-space-representable-by-space}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$
be categories fibred in groupoids over $(\Sch/S)_{fppf}$
Let $f : \mathcal{X} \to \mathcal{Y}$,
$g : \mathcal{Z} \to \mathcal{Y}$ be $1$-morphisms.
Assume
\begin{enumerate}
\item $f$ is representable by algebraic spaces, and
\item $\mathcal{Z}$ is representable by an algebraic space over $S$.
\end{enumerate}
Then the $2$-fibre product
$\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$
is representable by an algebraic space.
\end{lemma}

\begin{proof}
This is a reformulation of
Bootstrap, Lemma \ref{bootstrap-lemma-representable-by-spaces-over-space}.
First note that
$\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$
is fibred in setoids over $(\Sch/S)_{fppf}$.
Hence it is equivalent to $\mathcal{S}_F$ for some presheaf
$F$ on $(\Sch/S)_{fppf}$, see
Categories, Lemma \ref{categories-lemma-setoid-fibres}.
Moreover, let $G$ be an algebraic space which represents
$\mathcal{Z}$. The $1$-morphism
$\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$
is representable by algebraic spaces by
Lemma \ref{lemma-base-change-representable-by-spaces}.
And $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$
corresponds to a morphism $F \to G$ by
Categories, Lemma \ref{categories-lemma-2-category-fibred-setoids}.
Then $F \to G$ is representable by algebraic spaces by
Lemma \ref{lemma-map-fibred-setoids-representable-algebraic-spaces}.
Hence
Bootstrap, Lemma \ref{bootstrap-lemma-representable-by-spaces-over-space}
implies that $F$ is an algebraic space as desired.
\end{proof}

\noindent
Let $S$, $\mathcal{X}$, $\mathcal{Y}$, $\mathcal{Z}$, $f$, $g$ be as in
Lemma \ref{lemma-base-change-by-space-representable-by-space}.
Let $F$ and $G$ be algebraic spaces over $S$ such that
$F$ represents $\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}$
and $G$ represents $\mathcal{Z}$. The $1$-morphism
$f' : \mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X} \to \mathcal{Z}$
corresponds to a morphism $f' : F \to G$ of algebraic spaces
by (\ref{equation-morphisms-spaces}).
Thus we have the following diagram

\label{equation-representable-by-algebraic-spaces-on-space}
\vcenter{
\xymatrix{
F \ar[d]_{f'} &
\mathcal{Z} \times_{g, \mathcal{Y}, f} \mathcal{X}
\ar@{~>}[l] \ar[d] \ar[r] &
\mathcal{X} \ar[d]^f \\
G &
\mathcal{Z} \ar@{~>}[l] \ar[r]^-g &
\mathcal{Y}
}
}

where the squiggly arrows represent the construction which associates
to a stack fibred in setoids its associated sheaf of isomorphism classes
of objects.

\begin{lemma}
\label{lemma-composition-representable-by-spaces}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $\mathcal{X}, \mathcal{Y}, \mathcal{Z}$
be categories fibred in groupoids over $(\Sch/S)_{fppf}$.
If $f : \mathcal{X} \to \mathcal{Y}$, $g : \mathcal{Y} \to \mathcal{Z}$
are $1$-morphisms representable by algebraic spaces, then
$$g \circ f : \mathcal{X} \longrightarrow \mathcal{Z}$$
is a $1$-morphism representable by algebraic spaces.
\end{lemma}

\begin{proof}
This follows from
Lemma \ref{lemma-base-change-by-space-representable-by-space}.
Details omitted.
\end{proof}

\begin{lemma}
\label{lemma-product-representable-by-spaces}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $\mathcal{X}_i, \mathcal{Y}_i$ be categories fibred in groupoids over
$(\Sch/S)_{fppf}$, $i = 1, 2$.
Let $f_i : \mathcal{X}_i \to \mathcal{Y}_i$, $i = 1, 2$
be $1$-morphisms representable by algebraic spaces.
Then
$$f_1 \times f_2 : \mathcal{X}_1 \times \mathcal{X}_2 \longrightarrow \mathcal{Y}_1 \times \mathcal{Y}_2$$
is a $1$-morphism representable by algebraic spaces.
\end{lemma}

\begin{proof}
Write $f_1 \times f_2$ as the composition
$\mathcal{X}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1 \times \mathcal{Y}_2$.
The first arrow is the base change of $f_1$ by the map
$\mathcal{Y}_1 \times \mathcal{X}_2 \to \mathcal{Y}_1$, and the second arrow
is the base change of $f_2$ by the map
$\mathcal{Y}_1 \times \mathcal{Y}_2 \to \mathcal{Y}_2$.
Hence this lemma is a formal
consequence of Lemmas \ref{lemma-composition-representable-by-spaces}
and \ref{lemma-base-change-representable-by-spaces}.
\end{proof}

\begin{lemma}
\label{lemma-get-a-stack}
\begin{reference}
Lemma in an email of Matthew Emerton dated June 15, 2016
\end{reference}
Let $S$ be a scheme contained in $\Sch_{fppf}$.
Let $\mathcal{X} \to \mathcal{Z}$ and $\mathcal{Y} \to \mathcal{Z}$
be $1$-morphisms of categories fibred in groupoids over $(\Sch/S)_{fppf}$.
If $\mathcal{X} \to \mathcal{Z}$ is representable by algebraic spaces
and $\mathcal{Y}$ is a stack in groupoids, then
$\mathcal{X} \times_\mathcal{Z} \mathcal{Y}$ is a stack in groupoids.
\end{lemma}

\begin{proof}
The property of a morphism being representable by algebraic spaces
is preserved under base-change
(Lemma \ref{lemma-base-change-by-space-representable-by-space}),
and so, passing to the base-change
$\mathcal{X} \times_\mathcal{Z} \mathcal{Y}$ over $\mathcal{Y}$,
we may reduce to the case of a morphism of categories
fibred in groupoids $\mathcal{X} \to \mathcal{Y}$
which is representable by algebraic spaces, and
whose target is a stack in groupoids; our goal is then to prove
that $\mathcal{X}$ is also a stack in groupoids.
This follows from Stacks, Lemma
\ref{stacks-lemma-relative-sheaf-over-stack-is-stack}
whose assumptions are satisfied as a result of
Lemma \ref{lemma-criterion-map-representable-spaces-fibred-in-groupoids}.
\end{proof}

Comment #2248 by David Hansen on October 6, 2016 a 3:18 pm UTC

The use of "middle square" in reference to part of diagram 77.9.8.1 is confusing (cf. second line below the diagram) - I only see left and right squares. :)

Comment #2282 by Johan (site) on November 3, 2016 a 6:41 pm UTC

Dear David Hansen, indeed! Fixed.

## Add a comment on tag 04SX

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 lower-right corner).