# The Stacks Project

## Tag 01JO

### 25.17. Fibre products of schemes

Here is a review of the general definition, even though we have already shown that fibre products of schemes exist.

Definition 25.17.1. Given morphisms of schemes $f : X \to S$ and $g : Y \to S$ the fibre product is a scheme $X \times_S Y$ together with projection morphisms $p : X \times_S Y \to X$ and $q : X \times_S Y \to Y$ sitting into the following commutative diagram $$\xymatrix{ X \times_S Y \ar[r]_q \ar[d]_p & Y \ar[d]^g \\ X \ar[r]^f & S }$$ which is universal among all diagrams of this sort, see Categories, Definition 4.6.1.

In other words, given any solid commutative diagram of morphisms of schemes $$\xymatrix{ T \ar[rrrd] \ar@{-->}[rrd] \ar[rrdd] & & \\ & & X \times_S Y \ar[d] \ar[r] & Y \ar[d] \\ & & X \ar[r] & S }$$ there exists a unique dotted arrow making the diagram commute. We will prove some lemmas which will tell us how to think about fibre products.

Lemma 25.17.2. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes with the same target. If $X, Y, S$ are all affine then $X \times_S Y$ is affine.

Proof. Suppose that $X = \mathop{\mathrm{Spec}}(A)$, $Y = \mathop{\mathrm{Spec}}(B)$ and $S = \mathop{\mathrm{Spec}}(R)$. By Lemma 25.6.7 the affine scheme $\mathop{\mathrm{Spec}}(A \otimes_R B)$ is the fibre product $X \times_S Y$ in the category of locally ringed spaces. Hence it is a fortiori the fibre product in the category of schemes. $\square$

Lemma 25.17.3. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes with the same target. Let $X \times_S Y$, $p$, $q$ be the fibre product. Suppose that $U \subset S$, $V \subset X$, $W \subset Y$ are open subschemes such that $f(V) \subset U$ and $g(W) \subset U$. Then the canonical morphism $V \times_U W \to X \times_S Y$ is an open immersion which identifies $V \times_U W$ with $p^{-1}(V) \cap q^{-1}(W)$.

Proof. Let $T$ be a scheme Suppose $a : T \to V$ and $b : T \to W$ are morphisms such that $f \circ a = g \circ b$ as morphisms into $U$. Then they agree as morphisms into $S$. By the universal property of the fibre product we get a unique morphism $T \to X \times_S Y$. Of course this morphism has image contained in the open $p^{-1}(V) \cap q^{-1}(W)$. Thus $p^{-1}(V) \cap q^{-1}(W)$ is a fibre product of $V$ and $W$ over $U$. The result follows from the uniqueness of fibre products, see Categories, Section 4.6. $\square$

In particular this shows that $V \times_U W = V \times_S W$ in the situation of the lemma. Moreover, if $U, V, W$ are all affine, then we know that $V \times_U W$ is affine. And of course we may cover $X \times_S Y$ by such affine opens $V \times_U W$. We formulate this as a lemma.

Lemma 25.17.4. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes with the same target. Let $S = \bigcup U_i$ be any affine open covering of $S$. For each $i \in I$, let $f^{-1}(U_i) = \bigcup_{j \in J_i} V_j$ be an affine open covering of $f^{-1}(U_i)$ and let $g^{-1}(U_i) = \bigcup_{k \in K_i} W_k$ be an affine open covering of $g^{-1}(U_i)$. Then $$X \times_S Y = \bigcup\nolimits_{i \in I} \bigcup\nolimits_{j \in J_i, ~k \in K_i} V_j \times_{U_i} W_k$$ is an affine open covering of $X \times_S Y$.

Proof. See discussion above the lemma. $\square$

In other words, we might have used the previous lemma as a way of construction the fibre product directly by glueing the affine schemes. (Which is of course exactly what we did in the proof of Lemma 25.16.1 anyway.) Here is a way to describe the set of points of a fibre product of schemes.

Lemma 25.17.5. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes with the same target. Points $z$ of $X \times_S Y$ are in bijective correspondence to quadruples $$(x, y, s, \mathfrak p)$$ where $x \in X$, $y \in Y$, $s \in S$ are points with $f(x) = s$, $g(y) = s$ and $\mathfrak p$ is a prime ideal of the ring $\kappa(x) \otimes_{\kappa(s)} \kappa(y)$. The residue field of $z$ corresponds to the residue field of the prime $\mathfrak p$.

Proof. Let $z$ be a point of $X \times_S Y$ and let us construct a triple as above. Recall that we may think of $z$ as a morphism $\mathop{\mathrm{Spec}}(\kappa(z)) \to X \times_S Y$, see Lemma 25.13.3. This morphism corresponds to morphisms $a : \mathop{\mathrm{Spec}}(\kappa(z)) \to X$ and $b : \mathop{\mathrm{Spec}}(\kappa(z)) \to Y$ such that $f \circ a = g \circ b$. By the same lemma again we get points $x \in X$, $y \in Y$ lying over the same point $s \in S$ as well as field maps $\kappa(x) \to \kappa(z)$, $\kappa(y) \to \kappa(z)$ such that the compositions $\kappa(s) \to \kappa(x) \to \kappa(z)$ and $\kappa(s) \to \kappa(y) \to \kappa(z)$ are the same. In other words we get a ring map $\kappa(x) \otimes_{\kappa(s)} \kappa(y) \to \kappa(z)$. We let $\mathfrak p$ be the kernel of this map.

Conversely, given a quadruple $(x, y, s, \mathfrak p)$ we get a commutative solid diagram $$\xymatrix{ X \times_S Y \ar@/_/[dddr] \ar@/^/[rrrd] & & & \\ & \mathop{\mathrm{Spec}}(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p) \ar[r] \ar[d] \ar@{-->}[lu] & \mathop{\mathrm{Spec}}(\kappa(y)) \ar[d] \ar[r] & Y \ar[dd] \\ & \mathop{\mathrm{Spec}}(\kappa(x)) \ar[r] \ar[d] & \mathop{\mathrm{Spec}}(\kappa(s)) \ar[rd] & \\ & X \ar[rr] & & S }$$ see the discussion in Section 25.13. Thus we get the dotted arrow. The corresponding point $z$ of $X \times_S Y$ is the image of the generic point of $\mathop{\mathrm{Spec}}(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p)$. We omit the verification that the two constructions are inverse to each other. $\square$

Lemma 25.17.6. Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes with the same target.

1. If $f : X \to S$ is a closed immersion, then $X \times_S Y \to Y$ is a closed immersion. Moreover, if $X \to S$ corresponds to the quasi-coherent sheaf of ideals $\mathcal{I} \subset \mathcal{O}_S$, then $X \times_S Y \to Y$ corresponds to the sheaf of ideals $\mathop{\mathrm{Im}}(g^*\mathcal{I} \to \mathcal{O}_Y)$.
2. If $f : X \to S$ is an open immersion, then $X \times_S Y \to Y$ is an open immersion.
3. If $f : X \to S$ is an immersion, then $X \times_S Y \to Y$ is an immersion.

Proof. Assume that $X \to S$ is a closed immersion corresponding to the quasi-coherent sheaf of ideals $\mathcal{I} \subset \mathcal{O}_S$. By Lemma 25.4.7 the closed subspace $Z \subset Y$ defined by the sheaf of ideals $\mathop{\mathrm{Im}}(g^*\mathcal{I} \to \mathcal{O}_Y)$ is the fibre product in the category of locally ringed spaces. By Lemma 25.10.1 $Z$ is a scheme. Hence $Z = X \times_S Y$ and the first statement follows. The second follows from Lemma 25.17.3 for example. The third is a combination of the first two. $\square$

Definition 25.17.7. Let $f : X \to Y$ be a morphism of schemes. Let $Z \subset Y$ be a closed subscheme of $Y$. The inverse image $f^{-1}(Z)$ of the closed subscheme $Z$ is the closed subscheme $Z \times_Y X$ of $X$. See Lemma 25.17.6 above.

We may occasionally also use this terminology with locally closed and open subschemes.

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

\section{Fibre products of schemes}
\label{section-fibre-products}

\noindent
Here is a review of the general definition, even though
we have already shown that fibre products of schemes exist.

\begin{definition}
\label{definition-fibre-product}
Given morphisms of schemes $f : X \to S$ and $g : Y \to S$
the {\it fibre product} is a scheme $X \times_S Y$ together
with projection morphisms $p : X \times_S Y \to X$
and $q : X \times_S Y \to Y$ sitting into the following
commutative diagram
$$\xymatrix{ X \times_S Y \ar[r]_q \ar[d]_p & Y \ar[d]^g \\ X \ar[r]^f & S }$$
which is universal among all diagrams of this sort,
see Categories, Definition \ref{categories-definition-fibre-products}.
\end{definition}

\noindent
In other words, given any solid commutative diagram of
morphisms of schemes
$$\xymatrix{ T \ar[rrrd] \ar@{-->}[rrd] \ar[rrdd] & & \\ & & X \times_S Y \ar[d] \ar[r] & Y \ar[d] \\ & & X \ar[r] & S }$$
there exists a unique dotted arrow making the diagram commute.
We will prove some lemmas which will tell us how to think about
fibre products.

\begin{lemma}
\label{lemma-fibre-product-affines}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes
with the same target. If $X, Y, S$ are all affine then
$X \times_S Y$ is affine.
\end{lemma}

\begin{proof}
Suppose that $X = \Spec(A)$, $Y = \Spec(B)$
and $S = \Spec(R)$. By Lemma \ref{lemma-fibre-product-affine-schemes}
the affine scheme $\Spec(A \otimes_R B)$
is the fibre product $X \times_S Y$ in the category
of locally ringed spaces. Hence it is a fortiori the
fibre product in the category of schemes.
\end{proof}

\begin{lemma}
\label{lemma-open-fibre-product}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes
with the same target. Let $X \times_S Y$, $p$, $q$ be the fibre product.
Suppose that $U \subset S$,
$V \subset X$, $W \subset Y$ are open subschemes
such that $f(V) \subset U$ and $g(W) \subset U$.
Then the canonical morphism
$V \times_U W \to X \times_S Y$ is an open immersion
which identifies $V \times_U W$ with $p^{-1}(V) \cap q^{-1}(W)$.
\end{lemma}

\begin{proof}
Let $T$ be a scheme
Suppose $a : T \to V$ and $b : T \to W$ are morphisms
such that $f \circ a = g \circ b$ as morphisms into $U$.
Then they agree as morphisms into $S$.
By the universal property of the fibre product we get
a unique morphism $T \to X \times_S Y$. Of course this morphism
has image contained in the open $p^{-1}(V) \cap q^{-1}(W)$.
Thus $p^{-1}(V) \cap q^{-1}(W)$ is a fibre product of
$V$ and $W$ over $U$. The result follows from the uniqueness
of fibre products, see Categories, Section
\ref{categories-section-fibre-products}.
\end{proof}

\noindent
In particular this shows that $V \times_U W = V \times_S W$
in the situation of the lemma. Moreover, if $U, V, W$ are all
affine, then we know that $V \times_U W$ is affine. And of course
we may cover $X \times_S Y$ by such affine opens $V \times_U W$.
We formulate this as a lemma.

\begin{lemma}
\label{lemma-affine-covering-fibre-product}
\begin{slogan}
Bare-hands construction of fiber products: an affine open cover of a
fiber product of schemes can be assembled from compatible
affine open covers of the pieces.
\end{slogan}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes
with the same target. Let $S = \bigcup U_i$ be any affine open
covering of $S$. For each $i \in I$, let
$f^{-1}(U_i) = \bigcup_{j \in J_i} V_j$ be an affine open covering
of $f^{-1}(U_i)$ and let
$g^{-1}(U_i) = \bigcup_{k \in K_i} W_k$ be an affine open covering
of $g^{-1}(U_i)$. Then
$$X \times_S Y = \bigcup\nolimits_{i \in I} \bigcup\nolimits_{j \in J_i, \ k \in K_i} V_j \times_{U_i} W_k$$
is an affine open covering of $X \times_S Y$.
\end{lemma}

\begin{proof}
See discussion above the lemma.
\end{proof}

\noindent
In other words, we might have used the previous lemma
as a way of construction the fibre product directly by
glueing the affine schemes. (Which is of course exactly
what we did in the proof of Lemma \ref{lemma-fibre-products} anyway.)
Here is a way to describe the set of points of a fibre product of schemes.

\begin{lemma}
\label{lemma-points-fibre-product}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes
with the same target. Points $z$ of $X \times_S Y$ are in bijective
$$(x, y, s, \mathfrak p)$$
where $x \in X$, $y \in Y$, $s \in S$ are points with
$f(x) = s$, $g(y) = s$ and $\mathfrak p$ is a prime ideal
of the ring $\kappa(x) \otimes_{\kappa(s)} \kappa(y)$.
The residue field of $z$ corresponds to
the residue field of the prime $\mathfrak p$.
\end{lemma}

\begin{proof}
Let $z$ be a point of $X \times_S Y$ and let us construct a
triple as above. Recall that we may think of $z$ as a morphism
$\Spec(\kappa(z)) \to X \times_S Y$, see
Lemma \ref{lemma-characterize-points}. This morphism corresponds
to morphisms $a : \Spec(\kappa(z)) \to X$
and $b : \Spec(\kappa(z)) \to Y$ such that
$f \circ a = g \circ b$. By the same lemma again
we get points $x \in X$, $y \in Y$ lying over the same point
$s \in S$ as well as field maps $\kappa(x) \to \kappa(z)$,
$\kappa(y) \to \kappa(z)$ such that the compositions
$\kappa(s) \to \kappa(x) \to \kappa(z)$
and
$\kappa(s) \to \kappa(y) \to \kappa(z)$
are the same. In other words we get a ring map
$\kappa(x) \otimes_{\kappa(s)} \kappa(y) \to \kappa(z)$.
We let $\mathfrak p$ be the kernel of this map.

\medskip\noindent
Conversely, given a quadruple $(x, y, s, \mathfrak p)$ we get a
commutative solid diagram
$$\xymatrix{ X \times_S Y \ar@/_/[dddr] \ar@/^/[rrrd] & & & \\ & \Spec(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p) \ar[r] \ar[d] \ar@{-->}[lu] & \Spec(\kappa(y)) \ar[d] \ar[r] & Y \ar[dd] \\ & \Spec(\kappa(x)) \ar[r] \ar[d] & \Spec(\kappa(s)) \ar[rd] & \\ & X \ar[rr] & & S }$$
see the discussion in Section \ref{section-points}. Thus we get the
dotted arrow. The corresponding point $z$ of $X \times_S Y$ is the
image of the generic point of
$\Spec(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p)$.
We omit the verification that the two constructions are inverse
to each other.
\end{proof}

\begin{lemma}
\label{lemma-fibre-product-immersion}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes
with the same target.
\begin{enumerate}
\item If $f : X \to S$ is a closed immersion,
then $X \times_S Y \to Y$ is a closed immersion.
Moreover, if $X \to S$ corresponds to the quasi-coherent
sheaf of ideals $\mathcal{I} \subset \mathcal{O}_S$, then
$X \times_S Y \to Y$ corresponds to the sheaf of ideals
$\Im(g^*\mathcal{I} \to \mathcal{O}_Y)$.
\item If $f : X \to S$ is an open immersion,
then $X \times_S Y \to Y$ is an open immersion.
\item If $f : X \to S$ is an immersion,
then $X \times_S Y \to Y$ is an immersion.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume that $X \to S$ is a closed immersion corresponding
to the quasi-coherent sheaf of ideals $\mathcal{I} \subset \mathcal{O}_S$.
By Lemma \ref{lemma-restrict-map-to-closed} the closed subspace
$Z \subset Y$ defined by the sheaf of ideals
$\Im(g^*\mathcal{I} \to \mathcal{O}_Y)$ is the fibre product
in the category of locally ringed spaces.
By Lemma \ref{lemma-closed-subspace-scheme} $Z$ is a scheme.
Hence $Z = X \times_S Y$ and the first statement follows.
The second follows from Lemma \ref{lemma-open-fibre-product}
for example. The third is a combination of
the first two.
\end{proof}

\begin{definition}
\label{definition-inverse-image-closed-subscheme}
Let $f : X \to Y$ be a morphism of schemes. Let $Z \subset Y$ be a
closed subscheme of $Y$. The {\it inverse image $f^{-1}(Z)$ of the
closed subscheme $Z$} is the closed subscheme $Z \times_Y X$ of
$X$. See Lemma \ref{lemma-fibre-product-immersion} above.
\end{definition}

\noindent
We may occasionally also use this terminology with locally closed and
open subschemes.

Comment #1388 by Jackson Morrow on April 2, 2015 a 9:35 pm UTC

In Lemma 25.17.4, the line above the displayed equation should say let $g^{-1}(U_i) = \bigcup_{k \in K_i}W_k$ be an affine open cover of $g^{-1}(U_i)$". At the moment it says, an affine open cover of $f^{-1}(U_i)$.

Comment #1410 by Johan (site) on April 15, 2015 a 6:17 pm UTC

Many thanks. See here.

## Add a comment on tag 01JO

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).