# The Stacks Project

## Tag 01KP

Lemma 25.21.8. Let $f : X \to S$ be a morphism of schemes.

1. If $f$ is separated then for every pair of affine opens $(U, V)$ of $X$ which map into a common affine open of $S$ we have
1. the intersection $U \cap V$ is affine.
2. the ring map $\mathcal{O}_X(U) \otimes_{\mathbf{Z}} \mathcal{O}_X(V) \to \mathcal{O}_X(U \cap V)$ is surjective.
2. If any pair of points $x_1, x_2 \in X$ lying over a common point $s \in S$ are contained in affine opens $x_1 \in U$, $x_2 \in V$ which map into a common affine open of $S$ such that (a), (b) hold, then $f$ is separated.

Proof. Assume $f$ separated. Suppose $(U, V)$ is a pair as in (1). Let $W = \mathop{\rm Spec}(R)$ be an affine open of $S$ containing both $f(U)$ and $f(V)$. Write $U = \mathop{\rm Spec}(A)$ and $V = \mathop{\rm Spec}(B)$ for $R$-algebras $A$ and $B$. By Lemma 25.17.3 we see that $U \times_S V = U \times_W V = \mathop{\rm Spec}(A \otimes_R B)$ is an affine open of $X \times_S X$. Hence, by Lemma 25.10.1 we see that $\Delta^{-1}(U \times_S V) \to U \times_S V$ can be identified with $\mathop{\rm Spec}(A \otimes_R B/J)$ for some ideal $J \subset A \otimes_R B$. Thus $U \cap V = \Delta^{-1}(U \times_S V)$ is affine. Assertion (1)(b) holds because $A \otimes_{\mathbf{Z}} B \to (A \otimes_R B)/J$ is surjective.

Assume the hypothesis formulated in (2) holds. Clearly the collection of affine opens $U \times_S V$ for pairs $(U, V)$ as in (2) form an affine open covering of $X \times_S X$ (see e.g. Lemma 25.17.4). Hence it suffices to show that each morphism $U \cap V = \Delta_{X/S}^{-1}(U \times_S V) \to U \times_S V$ is a closed immersion, see Lemma 25.4.2. By assumption (a) we have $U \cap V = \mathop{\rm Spec}(C)$ for some ring $C$. After choosing an affine open $W = \mathop{\rm Spec}(R)$ of $S$ into which both $U$ and $V$ map and writing $U = \mathop{\rm Spec}(A)$, $V = \mathop{\rm Spec}(B)$ we see that the assumption (b) means that the composition $$A \otimes_{\mathbf{Z}} B \to A \otimes_R B \to C$$ is surjective. Hence $A \otimes_R B \to C$ is surjective and we conclude that $\mathop{\rm Spec}(C) \to \mathop{\rm Spec}(A \otimes_R B)$ is a closed immersion. $\square$

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

\begin{lemma}
\label{lemma-characterize-separated}
Let $f : X \to S$ be a morphism of schemes.
\begin{enumerate}
\item If $f$ is separated then for every pair of affine
opens $(U, V)$ of $X$ which map into a
common affine open of $S$ we have
\begin{enumerate}
\item the intersection $U \cap V$ is affine.
\item the ring map
$\mathcal{O}_X(U) \otimes_{\mathbf{Z}} \mathcal{O}_X(V) \to \mathcal{O}_X(U \cap V)$
is surjective.
\end{enumerate}
\item If any pair of points $x_1, x_2 \in X$ lying over a common
point $s \in S$ are contained in affine opens $x_1 \in U$,
$x_2 \in V$ which map into a common affine open of $S$ such
that (a), (b) hold, then $f$ is separated.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume $f$ separated. Suppose $(U, V)$ is a pair as in (1).
Let $W = \Spec(R)$ be an affine open of $S$ containing
both $f(U)$ and $f(V)$. Write $U = \Spec(A)$ and
$V = \Spec(B)$ for $R$-algebras $A$ and $B$.
By Lemma \ref{lemma-open-fibre-product} we see that
$U \times_S V = U \times_W V = \Spec(A \otimes_R B)$
is an affine open of $X \times_S X$. Hence, by
Lemma \ref{lemma-closed-subspace-scheme} we see that
$\Delta^{-1}(U \times_S V) \to U \times_S V$
can be identified with $\Spec(A \otimes_R B/J)$
for some ideal $J \subset A \otimes_R B$.
Thus $U \cap V = \Delta^{-1}(U \times_S V)$ is affine.
Assertion (1)(b) holds because
$A \otimes_{\mathbf{Z}} B \to (A \otimes_R B)/J$ is surjective.

\medskip\noindent
Assume the hypothesis formulated in (2) holds.
Clearly the collection of affine opens $U \times_S V$
for pairs $(U, V)$ as in (2) form an affine open covering
of $X \times_S X$ (see e.g.\ Lemma \ref{lemma-affine-covering-fibre-product}).
Hence it suffices to show that each morphism
$U \cap V = \Delta_{X/S}^{-1}(U \times_S V) \to U \times_S V$
is a closed immersion, see Lemma \ref{lemma-closed-local-target}.
By assumption (a) we have $U \cap V = \Spec(C)$ for some ring $C$.
After choosing an affine open $W = \Spec(R)$ of $S$
into which both $U$ and $V$ map and writing $U = \Spec(A)$,
$V = \Spec(B)$ we see that the assumption (b) means
that the composition
$$A \otimes_{\mathbf{Z}} B \to A \otimes_R B \to C$$
is surjective. Hence $A \otimes_R B \to C$ is surjective and
we conclude that $\Spec(C) \to \Spec(A \otimes_R B)$
is a closed immersion.
\end{proof}

Comment #2680 by sdf on August 1, 2017 a 10:44 am UTC

Perhaps this is a stupid question, but how does one construct $W$ in the first line of the proof? Actually, I thought in general if $f\colon X\operatorname{Spec} R \rightarrow Y$ is an arbitrary morphism then in general there does not exist affine $U\subset Y$ with $f(X)\subset U$? I know how to construct $U$ say when $R$ is a local ring, but in general not?

Comment #2681 by sdf on August 1, 2017 a 10:46 am UTC

Erratum: the morphism is $f\colon X=\operatorname{Spec} R \rightarrow Y$.

Comment #2682 by Johan (site) on August 1, 2017 a 6:34 pm UTC

In condition (1) we assume $U$ and $V$ map into a common affine open of $S$. Thus the existence of $W$ is simply assumed to be tryue. OK?

Comment #2768 by sdf on August 11, 2017 a 5:06 pm UTC

Yes I didn't read it properly, apologies.

There are also 6 comments on Section 25.21: Schemes.

## Add a comment on tag 01KP

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