\input{preamble}

% OK, start here.
%
\begin{document}

\title{Divisors}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
In this chapter we study some very basic questions related
to defining divisors, etc. A basic reference is \cite{EGA}.



\section{Associated points}
\label{section-associated}

\noindent
Let $R$ be a ring and let $M$ be an $R$-module.
Recall that a prime $\mathfrak p \subset R$ is {\it associated} to $M$
if there exists an element of $M$ whose annihilator is $\mathfrak p$.
See Algebra, Definition \ref{algebra-definition-associated}.
Here is the definition of associated points
for quasi-coherent sheaves on schemes
as given in \cite[IV Definition 3.1.1]{EGA}.

\begin{definition}
\label{definition-associated}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
\begin{enumerate}
\item We say $x \in X$ is {\it associated} to $\mathcal{F}$
if the maximal ideal
$\mathfrak m_x$ is associated to the $\mathcal{O}_{X, x}$-module
$\mathcal{F}_x$.
\item We denote $\text{Ass}(\mathcal{F})$ or $\text{Ass}_X(\mathcal{F})$
the set of associated points of $\mathcal{F}$.
\item The {\it associated points of $X$} are the associated
points of $\mathcal{O}_X$.
\end{enumerate}
\end{definition}

\noindent
These definitions are most useful when $X$ is locally Noetherian
and $\mathcal{F}$ of finite type.
For example it may happen that a generic point of an irreducible
component of $X$ is not associated to $X$, see
Example \ref{example-no-associated-prime}.
In the non-Noetherian case it may be more convenient to use weakly
associated points, see
Section \ref{section-weakly-associated}.
Let us link the scheme theoretic notion with the algebraic notion
on affine opens; note that this correspondence works perfectly only
for locally Noetherian schemes.

\begin{lemma}
\label{lemma-associated-affine-open}
Let $X$ be a scheme. Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
Let $\Spec(A) = U \subset X$ be an affine open, and set
$M = \Gamma(U, \mathcal{F})$.
Let $x \in U$, and let $\mathfrak p \subset A$ be the corresponding prime.
\begin{enumerate}
\item If $\mathfrak p$ is associated to $M$, then $x$ is associated
to $\mathcal{F}$.
\item If $\mathfrak p$ is finitely generated, then the converse holds
as well.
\end{enumerate}
In particular, if $X$ is locally Noetherian, then the equivalence
$$
\mathfrak p \in \text{Ass}(M) \Leftrightarrow x \in \text{Ass}(\mathcal{F})
$$
holds for all pairs $(\mathfrak p, x)$ as above.
\end{lemma}

\begin{proof}
This follows from
Algebra, Lemma \ref{algebra-lemma-associated-primes-localize}.
But we can also argue directly as follows.
Suppose $\mathfrak p$ is associated to $M$.
Then there exists an $m \in M$ whose annihilator is $\mathfrak p$.
Since localization is exact we see that
$\mathfrak pA_{\mathfrak p}$ is the annihilator of
$m/1 \in M_{\mathfrak p}$. Since $M_{\mathfrak p} = \mathcal{F}_x$
(Schemes, Lemma \ref{schemes-lemma-spec-sheaves})
we conclude that $x$ is associated to $\mathcal{F}$.

\medskip\noindent
Conversely, assume that $x$ is associated to $\mathcal{F}$,
and $\mathfrak p$ is finitely generated.
As $x$ is associated to $\mathcal{F}$
there exists an element $m' \in M_{\mathfrak p}$ whose
annihilator is $\mathfrak pA_{\mathfrak p}$. Write
$m' = m/f$ for some $f \in A$, $f \not \in \mathfrak p$.
The annihilator $I$ of $m$ is an ideal of $A$ such that
$IA_{\mathfrak p} = \mathfrak pA_{\mathfrak p}$. Hence
$I \subset \mathfrak p$, and $(\mathfrak p/I)_{\mathfrak p} = 0$.
Since $\mathfrak p$ is finitely generated,
there exists a $g \in A$, $g \not \in \mathfrak p$ such that
$g(\mathfrak p/I) = 0$. Hence the annihilator of $gm$ is
$\mathfrak p$ and we win.

\medskip\noindent
If $X$ is locally Noetherian, then $A$ is Noetherian
(Properties, Lemma \ref{properties-lemma-locally-Noetherian})
and $\mathfrak p$ is always finitely generated.
\end{proof}

\begin{lemma}
\label{lemma-ass-support}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then $\text{Ass}(\mathcal{F}) \subset \text{Supp}(\mathcal{F})$.
\end{lemma}

\begin{proof}
This is immediate from the definitions.
\end{proof}

\begin{lemma}
\label{lemma-ses-ass}
Let $X$ be a scheme.
Let $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
be a short exact sequence of quasi-coherent sheaves on $X$.
Then
$\text{Ass}(\mathcal{F}_2) \subset
\text{Ass}(\mathcal{F}_1) \cup \text{Ass}(\mathcal{F}_3)$
and
$\text{Ass}(\mathcal{F}_1) \subset \text{Ass}(\mathcal{F}_2)$.
\end{lemma}

\begin{proof}
For every point $x \in X$ the sequence of stalks
$0 \to \mathcal{F}_{1, x} \to \mathcal{F}_{2, x} \to \mathcal{F}_{3, x} \to 0$
is a short exact sequence of $\mathcal{O}_{X, x}$-modules.
Hence the lemma follows from
Algebra, Lemma \ref{algebra-lemma-ass}.
\end{proof}

\begin{lemma}
\label{lemma-finite-ass}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
Then $\text{Ass}(\mathcal{F}) \cap U$ is finite for
every quasi-compact open $U \subset X$.
\end{lemma}

\begin{proof}
This is true because the set of associated primes of a finite module over
a Noetherian ring is finite, see
Algebra, Lemma \ref{algebra-lemma-finite-ass}.
To translate from schemes to algebra use that $U$ is a finite union of
affine opens, each of these opens is the spectrum of a Noetherian ring
(Properties, Lemma \ref{properties-lemma-locally-Noetherian}),
$\mathcal{F}$ corresponds to a finite module over this ring
(Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-Noetherian}),
and finally use
Lemma \ref{lemma-associated-affine-open}.
\end{proof}

\begin{lemma}
\label{lemma-ass-zero}
Let $X$ be a locally Noetherian scheme. Let $\mathcal{F}$ be a
quasi-coherent $\mathcal{O}_X$-module. Then
$$
\mathcal{F} = 0 \Leftrightarrow \text{Ass}(\mathcal{F}) = \emptyset.
$$
\end{lemma}

\begin{proof}
If $\mathcal{F} = 0$, then $\text{Ass}(\mathcal{F}) = \emptyset$
by definition. Conversely, if $\text{Ass}(\mathcal{F}) = \emptyset$,
then $\mathcal{F} = 0$ by
Algebra, Lemma \ref{algebra-lemma-ass-zero}.
To translate from schemes to algebra, restrict to any affine and use
Lemma \ref{lemma-associated-affine-open}.
\end{proof}

\begin{example}
\label{example-no-associated-prime}
Let $k$ be a field. The ring $R = k[x_1, x_2, x_3, \ldots]/(x_i^2)$
is local with locally nilpotent maximal ideal $\mathfrak m$.
There exists no element of $R$ which has annihilator $\mathfrak m$.
Hence $\text{Ass}(R) = \emptyset$, and $X = \Spec(R)$
is an example of a scheme which has no associated points.
\end{example}

\begin{lemma}
\label{lemma-restriction-injective-open-contains-ass}
Let $X$ be a locally Noetherian scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. If $U \subset X$ is open and
$\text{Ass}(\mathcal{F}) \subset U$, then
$\Gamma(X, \mathcal{F}) \to \Gamma(U, \mathcal{F})$ is injective.
\end{lemma}

\begin{proof}
Let $s \in \Gamma(X, \mathcal{F})$ be a section which restricts to zero on $U$.
Let $\mathcal{F}' \subset \mathcal{F}$ be the image of the map
$\mathcal{O}_X \to \mathcal{F}$ defined by $s$. Then
$\text{Supp}(\mathcal{F}') \cap U = \emptyset$. On the other hand,
$\text{Ass}(\mathcal{F}') \subset \text{Ass}(\mathcal{F})$
by Lemma \ref{lemma-ses-ass}. Since also
$\text{Ass}(\mathcal{F}') \subset \text{Supp}(\mathcal{F}')$
(Lemma \ref{lemma-ass-support}) we conclude
$\text{Ass}(\mathcal{F}') = \emptyset$.
Hence $\mathcal{F}' = 0$ by Lemma \ref{lemma-ass-zero}.
\end{proof}

\begin{lemma}
\label{lemma-minimal-support-in-ass}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $x \in \text{Supp}(\mathcal{F})$ be a point in the support
of $\mathcal{F}$ which is not a specialization of another point of
$\text{Supp}(\mathcal{F})$. Then $x \in \text{Ass}(\mathcal{F})$.
In particular, any generic point of an irreducible component of $X$
is an associated point of $X$.
\end{lemma}

\begin{proof}
Since $x \in \text{Supp}(\mathcal{F})$ the module $\mathcal{F}_x$
is not zero. Hence
$\text{Ass}(\mathcal{F}_x) \subset \Spec(\mathcal{O}_{X, x})$
is nonempty by
Algebra, Lemma \ref{algebra-lemma-ass-zero}.
On the other hand, by assumption
$\text{Supp}(\mathcal{F}_x) = \{\mathfrak m_x\}$.
Since
$\text{Ass}(\mathcal{F}_x) \subset \text{Supp}(\mathcal{F}_x)$
(Algebra, Lemma \ref{algebra-lemma-ass-support})
we see that $\mathfrak m_x$ is associated to $\mathcal{F}_x$
and we win.
\end{proof}

\noindent
The following lemma is the analogue of
More on Algebra, Lemma \ref{more-algebra-lemma-check-injective-on-ass}.

\begin{lemma}
\label{lemma-check-injective-on-ass}
Let $X$ be a locally Noetherian scheme. Let
$\varphi : \mathcal{F} \to \mathcal{G}$ be a map of
quasi-coherent $\mathcal{O}_X$-modules.
Assume that for every $x \in X$
at least one of the following happens
\begin{enumerate}
\item $\mathcal{F}_x \to \mathcal{G}_x$ is injective, or
\item $x \not \in \text{Ass}(\mathcal{F})$.
\end{enumerate}
Then $\varphi$ is injective.
\end{lemma}

\begin{proof}
The assumptions imply that $\text{Ass}(\Ker(\varphi)) = \emptyset$
and hence $\Ker(\varphi) = 0$ by Lemma \ref{lemma-ass-zero}.
\end{proof}

\begin{lemma}
\label{lemma-check-isomorphism-via-depth-and-ass}
Let $X$ be a locally Noetherian scheme. Let
$\varphi : \mathcal{F} \to \mathcal{G}$ be a map of
quasi-coherent $\mathcal{O}_X$-modules. Assume $\mathcal{F}$ is coherent
and that for every $x \in X$ one of the following happens
\begin{enumerate}
\item $\mathcal{F}_x \to \mathcal{G}_x$ is an isomorphism, or
\item $\text{depth}(\mathcal{F}_x) \geq 2$ and
$x \not \in \text{Ass}(\mathcal{G})$.
\end{enumerate}
Then $\varphi$ is an isomorphism.
\end{lemma}

\begin{proof}
This is a translation of More on Algebra, Lemma
\ref{more-algebra-lemma-check-isomorphism-via-depth-and-ass}
into the language of schemes.
\end{proof}




\section{Morphisms and associated points}
\label{section-morphisms-associated}

\noindent
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}_X$-modules.
If $s \in S$ is a point, then it is often convenient to
denote $\mathcal{F}_s$ the $\mathcal{O}_{X_s}$-module
one gets by pulling back $\mathcal{F}$ by the morphism
$i_s : X_s \to X$. Here $X_s$ is the scheme theoretic fibre of $f$ over $s$.
In a formula
$$
\mathcal{F}_s = i_s^*\mathcal{F}
$$
Of course, this notation clashes with the already existing notation
for the stalk of $\mathcal{F}$ at a point $x \in X$ if $f = \text{id}_X$.
However, the notation is often convenient, as in the formulation of
the following lemma.

\begin{lemma}
\label{lemma-bourbaki}
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$ which is flat over $S$.
Let $\mathcal{G}$ be a quasi-coherent sheaf on $S$.
Then we have
$$
\text{Ass}_X(\mathcal{F} \otimes_{\mathcal{O}_X} f^*\mathcal{G})
\supset
\bigcup\nolimits_{s \in \text{Ass}_S(\mathcal{G})}
\text{Ass}_{X_s}(\mathcal{F}_s)
$$
and equality holds if $S$ is locally Noetherian (for the notation
$\mathcal{F}_s$ see above).
\end{lemma}

\begin{proof}
Let $x \in X$ and let $s = f(x) \in S$.
Set $B = \mathcal{O}_{X, x}$, $A = \mathcal{O}_{S, s}$,
$N = \mathcal{F}_x$, and $M = \mathcal{G}_s$.
Note that the stalk of $\mathcal{F} \otimes_{\mathcal{O}_X} f^*\mathcal{G}$
at $x$ is equal to the $B$-module $M \otimes_A N$. Hence
$x \in \text{Ass}_X(\mathcal{F} \otimes_{\mathcal{O}_X} f^*\mathcal{G})$
if and only if $\mathfrak m_B$ is in $\text{Ass}_B(M \otimes_A N)$.
Similarly $s \in \text{Ass}_S(\mathcal{G})$ and
$x \in \text{Ass}_{X_s}(\mathcal{F}_s)$ if and only if
$\mathfrak m_A \in \text{Ass}_A(M)$ and
$\mathfrak m_B/\mathfrak m_A B \in
\text{Ass}_{B \otimes \kappa(\mathfrak m_A)}(N \otimes \kappa(\mathfrak m_A))$.
Thus the lemma follows from
Algebra, Lemma \ref{algebra-lemma-bourbaki-fibres}.
\end{proof}





\section{Embedded points}
\label{section-embedded}

\noindent
Let $R$ be a ring and let $M$ be an $R$-module.
Recall that a prime $\mathfrak p \subset R$ is an
{\it embedded associated prime} of $M$ if it is an associated prime of
$M$ which is not minimal among the associated primes of $M$. See
Algebra, Definition \ref{algebra-definition-embedded-primes}.
Here is the definition of embedded associated points
for quasi-coherent sheaves on schemes
as given in \cite[IV Definition 3.1.1]{EGA}.

\begin{definition}
\label{definition-embedded}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
\begin{enumerate}
\item An {\it embedded associated point} of $\mathcal{F}$
is an associated point which is not maximal among the
associated points of $\mathcal{F}$, i.e., it is the specialization
of another associated point of $\mathcal{F}$.
\item A point $x$ of $X$ is called an {\it embedded point}
if $x$ is an embedded associated point of $\mathcal{O}_X$.
\item An {\it embedded component} of $X$ is an irreducible
closed subset $Z = \overline{\{x\}}$ where $x$ is an embedded
point of $X$.
\end{enumerate}
\end{definition}

\noindent
In the Noetherian case when $\mathcal{F}$ is coherent we have
the following.

\begin{lemma}
\label{lemma-embedded}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
Then
\begin{enumerate}
\item the generic points of irreducible components of
$\text{Supp}(\mathcal{F})$ are associated points of $\mathcal{F}$, and
\item an associated point of $\mathcal{F}$ is embedded if and only
if it is not a generic point of an irreducible component
of $\text{Supp}(\mathcal{F})$.
\end{enumerate}
In particular an embedded point of $X$ is an associated point of $X$
which is not a generic point of an irreducible component of $X$.
\end{lemma}

\begin{proof}
Recall that in this case $Z = \text{Supp}(\mathcal{F})$ is closed, see
Morphisms, Lemma \ref{morphisms-lemma-support-finite-type}
and that the generic points of irreducible components of $Z$ are
associated points of $\mathcal{F}$, see
Lemma \ref{lemma-minimal-support-in-ass}.
Finally, we have $\text{Ass}(\mathcal{F}) \subset Z$, by
Lemma \ref{lemma-ass-support}.
These results, combined with the fact that $Z$ is a sober topological
space and hence every point of $Z$ is a specialization of a generic
point of $Z$, imply (1) and (2).
\end{proof}

\begin{lemma}
\label{lemma-S1-no-embedded}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent sheaf on $X$.
Then the following are equivalent:
\begin{enumerate}
\item $\mathcal{F}$ has no embedded associated points, and
\item $\mathcal{F}$ has property $(S_1)$.
\end{enumerate}
\end{lemma}

\begin{proof}
This is Algebra, Lemma \ref{algebra-lemma-criterion-no-embedded-primes},
combined with Lemma \ref{lemma-associated-affine-open} above.
\end{proof}

\begin{lemma}
\label{lemma-noetherian-dim-1-CM-no-embedded-points}
Let $X$ be a locally Noetherian scheme of dimension $\leq 1$.
The following are equivalent
\begin{enumerate}
\item $X$ is Cohen-Macaulay, and
\item $X$ has no embedded points.
\end{enumerate}
\end{lemma}

\begin{proof}
Follows from Lemma \ref{lemma-S1-no-embedded} and the definitions.
\end{proof}

\begin{lemma}
\label{lemma-scheme-theoretically-dense-contain-embedded-points}
Let $X$ be a locally Noetherian scheme. Let $U \subset X$ be an
open subscheme. The following are equivalent
\begin{enumerate}
\item $U$ is scheme theoretically dense in $X$
(Morphisms, Definition \ref{morphisms-definition-scheme-theoretically-dense}),
\item $U$ is dense in $X$ and $U$ contains all embedded points of $X$.
\end{enumerate}
\end{lemma}

\begin{proof}
The question is local on $X$, hence we may assume that $X = \Spec(A)$
where $A$ is a Noetherian ring. Then $U$ is quasi-compact
(Properties, Lemma \ref{properties-lemma-immersion-into-noetherian})
hence $U = D(f_1) \cup \ldots \cup D(f_n)$
(Algebra, Lemma \ref{algebra-lemma-qc-open}).
In this situation $U$ is scheme theoretically dense in $X$ if and only if
$A \to A_{f_1} \times \ldots \times A_{f_n}$ is injective, see
Morphisms, Example \ref{morphisms-example-scheme-theoretic-closure}.
Condition (2) translated into algebra means that for every associated
prime $\mathfrak p$ of $A$ there exists an $i$ with $f_i \not \in \mathfrak p$.

\medskip\noindent
Assume (1), i.e., $A \to A_{f_1} \times \ldots \times A_{f_n}$ is injective.
If $x \in A$ has annihilator a prime $\mathfrak p$, then $x$ maps
to a nonzero element of $A_{f_i}$ for some $i$ and hence
$f_i \not \in \mathfrak p$. Thus (2) holds.
Assume (2), i.e., every associated prime $\mathfrak p$ of $A$
corresponds to a prime of $A_{f_i}$ for some $i$. Then
$A \to A_{f_1} \times \ldots \times A_{f_n}$ is injective because
$A \to \prod_{\mathfrak p \in \text{Ass}(A)} A_\mathfrak p$ is injective
by Algebra, Lemma \ref{algebra-lemma-zero-at-ass-zero}.
\end{proof}

\begin{lemma}
\label{lemma-remove-embedded-points}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent sheaf on $X$.
The set of coherent subsheaves
$$
\{
\mathcal{K} \subset \mathcal{F}
\mid
\text{Supp}(\mathcal{K})\text{ is nowhere dense in }\text{Supp}(\mathcal{F})
\}
$$
has a maximal element $\mathcal{K}$.
Setting $\mathcal{F}' = \mathcal{F}/\mathcal{K}$ we have the
following
\begin{enumerate}
\item $\text{Supp}(\mathcal{F}') = \text{Supp}(\mathcal{F})$,
\item $\mathcal{F}'$ has no embedded associated points, and
\item there exists a dense open $U \subset X$ such that
$U \cap \text{Supp}(\mathcal{F})$ is dense in $\text{Supp}(\mathcal{F})$
and $\mathcal{F}'|_U \cong \mathcal{F}|_U$.
\end{enumerate}
\end{lemma}

\begin{proof}
This follows from
Algebra, Lemmas \ref{algebra-lemma-remove-embedded-primes} and
\ref{algebra-lemma-remove-embedded-primes-localize}.
Note that $U$ can be taken as the complement of the closure
of the set of embedded associated points of $\mathcal{F}$.
\end{proof}

\begin{lemma}
\label{lemma-no-embedded-points-endos}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module
without embedded associated points. Set
$$
\mathcal{I}
=
\Ker(\mathcal{O}_X
\longrightarrow
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{F})).
$$
This is a coherent sheaf of ideals which defines a closed
subscheme $Z \subset X$ without embedded points. Moreover
there exists a coherent sheaf $\mathcal{G}$ on $Z$
such that (a) $\mathcal{F} = (Z \to X)_*\mathcal{G}$,
(b) $\mathcal{G}$ has no associated embedded points, and
(c) $\text{Supp}(\mathcal{G}) = Z$ (as sets).
\end{lemma}

\begin{proof}
Some of the statements we have seen in the proof of
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-support-closed}.
The others follow from
Algebra, Lemma \ref{algebra-lemma-no-embedded-primes-endos}.
\end{proof}



\section{Weakly associated points}
\label{section-weakly-associated}

\noindent
Let $R$ be a ring and let $M$ be an $R$-module.
Recall that a prime $\mathfrak p \subset R$ is {\it weakly associated}
to $M$ if there exists an element $m$ of $M$ such that $\mathfrak p$ is
minimal among the primes containing the annihilator of $m$. See
Algebra, Definition \ref{algebra-definition-weakly-associated}.
If $R$ is a local ring with maximal ideal $\mathfrak m$, then
$\mathfrak m$ is weakly associated to $M$ if and only if there exists an
element $m \in M$ whose annihilator has radical $\mathfrak m$, see
Algebra, Lemma \ref{algebra-lemma-weakly-ass-local}.

\begin{definition}
\label{definition-weakly-associated}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
\begin{enumerate}
\item We say $x \in X$ is {\it weakly associated} to $\mathcal{F}$
if the maximal ideal $\mathfrak m_x$ is weakly associated to the
$\mathcal{O}_{X, x}$-module $\mathcal{F}_x$.
\item We denote $\text{WeakAss}(\mathcal{F})$ the set of weakly associated
points of $\mathcal{F}$.
\item The {\it weakly associated points of $X$} are the weakly associated
points of $\mathcal{O}_X$.
\end{enumerate}
\end{definition}

\noindent
In this case, on any affine open, this corresponds exactly to the
weakly associated primes as defined above. Here is the precise statement.

\begin{lemma}
\label{lemma-weakly-associated-affine-open}
Let $X$ be a scheme. Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
Let $\Spec(A) = U \subset X$ be an affine open, and set
$M = \Gamma(U, \mathcal{F})$.
Let $x \in U$, and let $\mathfrak p \subset A$ be the corresponding prime.
The following are equivalent
\begin{enumerate}
\item $\mathfrak p$ is weakly associated to $M$, and
\item $x$ is weakly associated to $\mathcal{F}$.
\end{enumerate}
\end{lemma}

\begin{proof}
This follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass-local}.
\end{proof}

\begin{lemma}
\label{lemma-weakly-ass-support}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then
$$
\text{Ass}(\mathcal{F}) \subset \text{WeakAss}(\mathcal{F}) \subset
\text{Supp}(\mathcal{F}).
$$
\end{lemma}

\begin{proof}
This is immediate from the definitions.
\end{proof}

\begin{lemma}
\label{lemma-ses-weakly-ass}
Let $X$ be a scheme.
Let $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
be a short exact sequence of quasi-coherent sheaves on $X$.
Then
$\text{WeakAss}(\mathcal{F}_2) \subset
\text{WeakAss}(\mathcal{F}_1) \cup \text{WeakAss}(\mathcal{F}_3)$
and
$\text{WeakAss}(\mathcal{F}_1) \subset \text{WeakAss}(\mathcal{F}_2)$.
\end{lemma}

\begin{proof}
For every point $x \in X$ the sequence of stalks
$0 \to \mathcal{F}_{1, x} \to \mathcal{F}_{2, x} \to \mathcal{F}_{3, x} \to 0$
is a short exact sequence of $\mathcal{O}_{X, x}$-modules.
Hence the lemma follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass}.
\end{proof}

\begin{lemma}
\label{lemma-weakly-ass-zero}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then
$$
\mathcal{F} = (0) \Leftrightarrow \text{WeakAss}(\mathcal{F}) = \emptyset
$$
\end{lemma}

\begin{proof}
Follows from
Lemma \ref{lemma-weakly-associated-affine-open}
and
Algebra, Lemma \ref{algebra-lemma-weakly-ass-zero}
\end{proof}

\begin{lemma}
\label{lemma-restriction-injective-open-contains-weakly-ass}
Let $X$ be a scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. If $U \subset X$ is open and
$\text{WeakAss}(\mathcal{F}) \subset U$, then
$\Gamma(X, \mathcal{F}) \to \Gamma(U, \mathcal{F})$
is injective.
\end{lemma}

\begin{proof}
Let $s \in \Gamma(X, \mathcal{F})$ be a section which restricts to zero on $U$.
Let $\mathcal{F}' \subset \mathcal{F}$ be the image of the map
$\mathcal{O}_X \to \mathcal{F}$ defined by $s$. Then
$\text{Supp}(\mathcal{F}') \cap U = \emptyset$. On the other hand,
$\text{WeakAss}(\mathcal{F}') \subset \text{WeakAss}(\mathcal{F})$
by Lemma \ref{lemma-ses-weakly-ass}. Since also
$\text{WeakAss}(\mathcal{F}') \subset \text{Supp}(\mathcal{F}')$
(Lemma \ref{lemma-weakly-ass-support}) we conclude
$\text{WeakAss}(\mathcal{F}') = \emptyset$.
Hence $\mathcal{F}' = 0$ by Lemma \ref{lemma-weakly-ass-zero}.
\end{proof}

\begin{lemma}
\label{lemma-minimal-support-in-weakly-ass}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $x \in \text{Supp}(\mathcal{F})$ be a point in the support
of $\mathcal{F}$ which is not a specialization of another point of
$\text{Supp}(\mathcal{F})$. Then
$x \in \text{WeakAss}(\mathcal{F})$.
In particular, any generic point of an irreducible component of $X$
is weakly associated to $\mathcal{O}_X$.
\end{lemma}

\begin{proof}
Since $x \in \text{Supp}(\mathcal{F})$ the module $\mathcal{F}_x$
is not zero. Hence
$\text{WeakAss}(\mathcal{F}_x) \subset \Spec(\mathcal{O}_{X, x})$
is nonempty by
Algebra, Lemma \ref{algebra-lemma-weakly-ass-zero}.
On the other hand, by assumption
$\text{Supp}(\mathcal{F}_x) = \{\mathfrak m_x\}$.
Since
$\text{WeakAss}(\mathcal{F}_x) \subset \text{Supp}(\mathcal{F}_x)$
(Algebra, Lemma \ref{algebra-lemma-weakly-ass-support})
we see that $\mathfrak m_x$ is weakly associated to $\mathcal{F}_x$
and we win.
\end{proof}

\begin{lemma}
\label{lemma-ass-weakly-ass}
Let $X$ be a scheme.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
If $\mathfrak m_x$ is a finitely generated ideal of $\mathcal{O}_{X, x}$,
then
$$
x \in \text{Ass}(\mathcal{F}) \Leftrightarrow
x \in \text{WeakAss}(\mathcal{F}).
$$
In particular, if $X$ is locally Noetherian, then
$\text{Ass}(\mathcal{F}) = \text{WeakAss}(\mathcal{F})$.
\end{lemma}

\begin{proof}
See
Algebra, Lemma \ref{algebra-lemma-ass-weakly-ass}.
\end{proof}

\begin{lemma}
\label{lemma-weakass-pushforward}
Let $f : X \to S$ be a quasi-compact and quasi-separated morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $s \in S$ be a point which is not in the image of $f$. Then
$s$ is not weakly associated to $f_*\mathcal{F}$.
\end{lemma}

\begin{proof}
Consider the base change $f' : X' \to \Spec(\mathcal{O}_{S, s})$
of $f$ by the morphism $g : \Spec(\mathcal{O}_{S, s}) \to S$
and denote $g' : X' \to X$ the other projection.
Then
$$
(f_*\mathcal{F})_s = (g^*f_*\mathcal{F})_s = (f'_*(g')^*\mathcal{F})_s
$$
The first equality because $g$ induces an isomorphism on local
rings at $s$ and the second by flat base change (Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology}). Of course
$s \in \Spec(\mathcal{O}_{S, s})$ is not in the image of $f'$.
Thus we may assume $S$ is the spectrum of a local ring
$(A, \mathfrak m)$ and $s$ corresponds to $\mathfrak m$.
By Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}
the sheaf $f_*\mathcal{F}$ is quasi-coherent, say corresponding
to the $A$-module $M$. As $s$ is not in the image of $f$ we see that
$X = \bigcup_{a \in \mathfrak m} f^{-1}D(a)$ is an open covering.
Since $X$ is quasi-compact we can find $a_1, \ldots, a_n \in \mathfrak m$
such that $X = f^{-1}D(a_1) \cup \ldots \cup f^{-1}D(a_n)$. It follows
that
$$
M \to M_{a_1} \oplus \ldots \oplus M_{a_r}
$$
is injective. Hence for any nonzero element $m$ of the stalk $M_\mathfrak p$
there exists an $i$ such that $a_i^n m$ is nonzero for all $n \geq 0$.
Thus $\mathfrak m$ is not weakly associated to $M$.
\end{proof}

\begin{lemma}
\label{lemma-check-injective-on-weakass}
Let $X$ be a scheme. Let $\varphi : \mathcal{F} \to \mathcal{G}$ be a map of
quasi-coherent $\mathcal{O}_X$-modules. Assume that for every $x \in X$
at least one of the following happens
\begin{enumerate}
\item $\mathcal{F}_x \to \mathcal{G}_x$ is injective, or
\item $x \not \in \text{WeakAss}(\mathcal{F})$.
\end{enumerate}
Then $\varphi$ is injective.
\end{lemma}

\begin{proof}
The assumptions imply that $\text{WeakAss}(\Ker(\varphi)) = \emptyset$
and hence $\Ker(\varphi) = 0$ by Lemma \ref{lemma-weakly-ass-zero}.
\end{proof}

\begin{lemma}
\label{lemma-depth-2-hartog}
Let $X$ be a locally Noetherian scheme. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module. Let $j : U \to X$
be an open subscheme such that for $x \in X \setminus U$
we have $\text{depth}(\mathcal{F}_x) \geq 2$. Then
$$
\mathcal{F} \longrightarrow j_*(\mathcal{F}|_U)
$$
is an isomorphism and consequently
$\Gamma(X, \mathcal{F}) \to \Gamma(U, \mathcal{F})$
is an isomorphism too.
\end{lemma}

\begin{proof}
We claim Lemma \ref{lemma-check-isomorphism-via-depth-and-ass}
applies to the map displayed in the lemma.
Let $x \in X$. If $x \in U$, then the map is an
isomorphism on stalks as $j_*(\mathcal{F}|_U)|_U = \mathcal{F}|_U$.
If $x \in X \setminus U$, then $x \not \in \text{Ass}(j_*(\mathcal{F}|_U))$
(Lemmas \ref{lemma-weakass-pushforward} and \ref{lemma-weakly-ass-support}).
Since we've assumed $\text{depth}(\mathcal{F}_x) \geq 2$
this finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-weakass-reduced}
Let $X$ be a reduced scheme. Then the weakly associated points of $X$
are exactly the generic points of the irreducible components of $X$.
\end{lemma}

\begin{proof}
Follows from Algebra, Lemma \ref{algebra-lemma-reduced-weakly-ass-minimal}.
\end{proof}



\section{Morphisms and weakly associated points}
\label{section-morphisms-weakly-associated}

\begin{lemma}
\label{lemma-weakly-ass-reverse-functorial}
Let $f : X \to S$ be an affine morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then we have
$$
\text{WeakAss}_S(f_*\mathcal{F}) \subset f(\text{WeakAss}_X(\mathcal{F}))
$$
\end{lemma}

\begin{proof}
We may assume $X$ and $S$ affine, so $X \to S$ comes from a ring map
$A \to B$. Then $\mathcal{F} = \widetilde M$ for some $B$-module $M$. By
Lemma \ref{lemma-weakly-associated-affine-open}
the weakly associated points of $\mathcal{F}$ correspond exactly to the
weakly associated primes of $M$. Similarly, the weakly associated points
of $f_*\mathcal{F}$ correspond exactly to the weakly associated primes
of $M$ as an $A$-module. Hence the lemma follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass-reverse-functorial}.
\end{proof}

\begin{lemma}
\label{lemma-ass-functorial-equal}
Let $f : X \to S$ be an affine morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
If $X$ is locally Noetherian, then we have
$$
f(\text{Ass}_X(\mathcal{F})) =
\text{Ass}_S(f_*\mathcal{F}) =
\text{WeakAss}_S(f_*\mathcal{F}) =
f(\text{WeakAss}_X(\mathcal{F}))
$$
\end{lemma}

\begin{proof}
We may assume $X$ and $S$ affine, so $X \to S$ comes from a ring map
$A \to B$. As $X$ is locally Noetherian the ring $B$ is Noetherian, see
Properties, Lemma \ref{properties-lemma-locally-Noetherian}.
Write $\mathcal{F} = \widetilde M$ for some $B$-module $M$. By
Lemma \ref{lemma-associated-affine-open}
the associated points of $\mathcal{F}$ correspond exactly to the associated
primes of $M$, and any associated prime of $M$ as an $A$-module is an
associated points of $f_*\mathcal{F}$.
Hence the inclusion
$$
f(\text{Ass}_X(\mathcal{F})) \subset \text{Ass}_S(f_*\mathcal{F})
$$
follows from
Algebra, Lemma \ref{algebra-lemma-ass-functorial-Noetherian}.
We have the inclusion
$$
\text{Ass}_S(f_*\mathcal{F}) \subset \text{WeakAss}_S(f_*\mathcal{F})
$$
by
Lemma \ref{lemma-weakly-ass-support}.
We have the inclusion
$$
\text{WeakAss}_S(f_*\mathcal{F}) \subset f(\text{WeakAss}_X(\mathcal{F}))
$$
by
Lemma \ref{lemma-weakly-ass-reverse-functorial}.
The outer sets are equal by
Lemma \ref{lemma-ass-weakly-ass}
hence we have equality everywhere.
\end{proof}

\begin{lemma}
\label{lemma-weakly-associated-finite}
Let $f : X \to S$ be a finite morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then $\text{WeakAss}(f_*\mathcal{F}) = f(\text{WeakAss}(\mathcal{F}))$.
\end{lemma}

\begin{proof}
We may assume $X$ and $S$ affine, so $X \to S$ comes from a finite ring map
$A \to B$. Write $\mathcal{F} = \widetilde M$ for some $B$-module $M$. By
Lemma \ref{lemma-weakly-associated-affine-open}
the weakly associated points of $\mathcal{F}$ correspond exactly to the
weakly associated primes of $M$. Similarly, the weakly associated points
of $f_*\mathcal{F}$ correspond exactly to the weakly associated primes
of $M$ as an $A$-module. Hence the lemma follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass-finite-ring-map}.
\end{proof}

\begin{lemma}
\label{lemma-weakly-ass-pullback}
Let $f : X \to S$ be a morphism of schemes. Let $\mathcal{G}$ be a
quasi-coherent $\mathcal{O}_S$-module. Let $x \in X$ with $s = f(x)$.
If $f$ is flat at $x$, the point $x$ is a generic point of the fibre $X_s$, and
$s \in \text{WeakAss}_S(\mathcal{G})$, then
$x \in \text{WeakAss}(f^*\mathcal{G})$.
\end{lemma}

\begin{proof}
Let $A = \mathcal{O}_{S, s}$, $B = \mathcal{O}_{X, x}$, and
$M = \mathcal{G}_s$. Let $m \in M$ be an element whose annihilator
$I = \{a \in A \mid am = 0\}$ has radical $\mathfrak m_A$. Then
$m \otimes 1$ has annihilator $I B$ as $A \to B$ is
faithfully flat. Thus it suffices to see that $\sqrt{I B} = \mathfrak m_B$.
This follows from the fact that the maximal ideal of $B/\mathfrak m_AB$
is locally nilpotent (see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring})
and the assumption that $\sqrt{I} = \mathfrak m_A$.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-weakly-ass-change-fields}
Let $K/k$ be a field extension. Let $X$ be a scheme over $k$.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $y \in X_K$ with image $x \in X$. If $y$ is a weakly
associated point of the pullback $\mathcal{F}_K$, then $x$
is a weakly associated point of $\mathcal{F}$.
\end{lemma}

\begin{proof}
This is the translation of
Algebra, Lemma \ref{algebra-lemma-weakly-ass-change-fields}
into the language of schemes.
\end{proof}

\noindent
Here is a simple lemma where we find that pushforwards often have
depth at least 2.

\begin{lemma}
\label{lemma-depth-pushforward}
Let $f : X \to S$ be a quasi-compact and quasi-separated morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $s \in S$.
\begin{enumerate}
\item If $s \not \in f(X)$, then $s$ is not weakly associated
to $f_*\mathcal{F}$.
\item If $s \not \in f(X)$ and $\mathcal{O}_{S, s}$ is Noetherian,
then $s$ is not associated to $f_*\mathcal{F}$.
\item If $s \not \in f(X)$, $(f_*\mathcal{F})_s$ is a finite
$\mathcal{O}_{S, s}$-module, and $\mathcal{O}_{S, s}$
is Noetherian, then $\text{depth}((f_*\mathcal{F})_s) \geq 2$.
\item If $\mathcal{F}$ is flat over $S$ and $a \in \mathfrak m_s$
is a nonzerodivisor, then $a$ is a nonzerodivisor on $(f_*\mathcal{F})_s$.
\item If $\mathcal{F}$ is flat over $S$ and $a, b \in \mathfrak m_s$
is a regular sequence, then $a$ is a nonzerodivisor on $(f_*\mathcal{F})_s$
and $b$ is a nonzerodivisor on $(f_*\mathcal{F})_s/a(f_*\mathcal{F})_s$.
\item If $\mathcal{F}$ is flat over $S$ and $(f_*\mathcal{F})_s$
is a finite $\mathcal{O}_{S, s}$-module, then
$\text{depth}((f_*\mathcal{F})_s) \geq
\min(2, \text{depth}(\mathcal{O}_{S, s}))$.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) is Lemma \ref{lemma-weakass-pushforward}.
Part (2) follows from (1) and Lemma \ref{lemma-ass-weakly-ass}.

\medskip\noindent
Proof of part (3). To show the depth is $\geq 2$ it suffices to show that
$\Hom_{\mathcal{O}_{S, s}}(\kappa(s), (f_*\mathcal{F})_s) = 0$ and
$\Ext^1_{\mathcal{O}_{S, s}}(\kappa(s), (f_*\mathcal{F})_s) = 0$, see
Algebra, Lemma \ref{algebra-lemma-depth-ext}.
Using the exact sequence
$0 \to \mathfrak m_s \to \mathcal{O}_{S, s} \to \kappa(s) \to 0$
it suffices to prove that the map
$$
\Hom_{\mathcal{O}_{S, s}}(\mathcal{O}_{S, s}, (f_*\mathcal{F})_s)
\to
\Hom_{\mathcal{O}_{S, s}}(\mathfrak m_s, (f_*\mathcal{F})_s)
$$
is an isomorphism. By flat base change (Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology})
we may replace $S$ by
$\Spec(\mathcal{O}_{S, s})$ and $X$ by $\Spec(\mathcal{O}_{S, s}) \times_S X$.
Denote $\mathfrak m \subset \mathcal{O}_S$ the ideal sheaf of $s$.
Then we see that
$$
\Hom_{\mathcal{O}_{S, s}}(\mathfrak m_s, (f_*\mathcal{F})_s) =
\Hom_{\mathcal{O}_S}(\mathfrak m, f_*\mathcal{F}) =
\Hom_{\mathcal{O}_X}(f^*\mathfrak m, \mathcal{F})
$$
the first equality because $S$ is local with closed point $s$
and the second equality
by adjunction for $f^*, f_*$ on quasi-coherent modules. However, since
$s \not \in f(X)$ we see that $f^*\mathfrak m = \mathcal{O}_X$.
Working backwards through the arguments we get the desired equality.

\medskip\noindent
For the proof of (4), (5), and (6) we use flat base change
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology})
to reduce to the case where $S$ is the spectrum of
$\mathcal{O}_{S, s}$.
Then a nonzerodivisor $a \in \mathcal{O}_{S, s}$
deterimines a short exact sequence
$$
0 \to \mathcal{O}_S \xrightarrow{a} \mathcal{O}_S \to
\mathcal{O}_S/a \mathcal{O}_S \to 0
$$
Since $\mathcal{F}$ is flat over $S$, we obtain an exact sequence
$$
0 \to \mathcal{F} \xrightarrow{a} \mathcal{F} \to
\mathcal{F}/a\mathcal{F} \to 0
$$
Pushing forward we obtain an exact sequence
$$
0 \to f_*\mathcal{F} \xrightarrow{a} f_*\mathcal{F} \to
f_*(\mathcal{F}/a\mathcal{F})
$$
This proves (4) and it shows that
$f_*\mathcal{F}/ af_*\mathcal{F} \subset f_*(\mathcal{F}/a\mathcal{F})$.
If $b$ is a nonzerodivisor on
$\mathcal{O}_{S, s}/a\mathcal{O}_{S, s}$, then the exact same argument shows
$b : \mathcal{F}/a\mathcal{F} \to \mathcal{F}/a\mathcal{F}$
is injective. Pushing forward we conclude
$$
b : f_*(\mathcal{F}/a\mathcal{F}) \to f_*(\mathcal{F}/a\mathcal{F})
$$
is injective and hence also
$b : f_*\mathcal{F}/ af_*\mathcal{F} \to f_*\mathcal{F}/ af_*\mathcal{F}$
is injective. This proves (5). Part (6) follows from
(4) and (5) and the definitions.
\end{proof}











\section{Relative assassin}
\label{section-relative-assassin}

\noindent
Let $A \to B$ be a ring map. Let $N$ be a $B$-module. Recall that
a prime $\mathfrak q \subset B$ is said to be in the relative assassin
of $N$ over $B/A$ if $\mathfrak q$ is an associated prime of
$N \otimes_A \kappa(\mathfrak p)$. Here $\mathfrak p = A \cap \mathfrak q$.
See Algebra, Definition \ref{algebra-definition-relative-assassin}.
Here is the definition of the relative assassin for quasi-coherent
sheaves over a morphism of schemes.

\begin{definition}
\label{definition-relative-assassin}
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
The {\it relative assassin of $\mathcal{F}$ in $X$ over $S$}
is the set
$$
\text{Ass}_{X/S}(\mathcal{F}) =
\bigcup\nolimits_{s \in S} \text{Ass}_{X_s}(\mathcal{F}_s)
$$
where $\mathcal{F}_s = (X_s \to X)^*\mathcal{F}$ is the restriction
of $\mathcal{F}$ to the fibre of $f$ at $s$.
\end{definition}

\noindent
Again there is a caveat that this is best used when the fibres of $f$
are locally Noetherian and $\mathcal{F}$ is of finite type. In the general
case we should probably use the relative weak assassin (defined in the next
section). Let us link the scheme theoretic notion with the algebraic notion
on affine opens; note that this correspondence works perfectly only
for morphisms of schemes whose fibres are locally Noetherian.

\begin{lemma}
\label{lemma-relative-assassin-affine-open}
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
Let $U \subset X$ and $V \subset S$ be affine opens
with $f(U) \subset V$. Write $U = \Spec(A)$, $V = \Spec(R)$, and set
$M = \Gamma(U, \mathcal{F})$.
Let $x \in U$, and let $\mathfrak p \subset A$ be the corresponding prime.
Then
$$
\mathfrak p \in \text{Ass}_{A/R}(M) \Rightarrow
x \in \text{Ass}_{X/S}(\mathcal{F})
$$
If all fibres $X_s$ of $f$ are locally Noetherian, then
$\mathfrak p \in \text{Ass}_{A/R}(M) \Leftrightarrow
x \in \text{Ass}_{X/S}(\mathcal{F})$
for all pairs $(\mathfrak p, x)$ as above.
\end{lemma}

\begin{proof}
The set $\text{Ass}_{A/R}(M)$ is defined in
Algebra, Definition \ref{algebra-definition-relative-assassin}.
Choose a pair $(\mathfrak p, x)$. Let $s = f(x)$.
Let $\mathfrak r \subset R$ be the prime lying under $\mathfrak p$,
i.e., the prime corresponding to $s$.
Let $\mathfrak p' \subset A \otimes_R \kappa(\mathfrak r)$
be the prime whose inverse image is $\mathfrak p$, i.e.,
the prime corresponding to $x$ viewed as a point of its fibre $X_s$.
Then $\mathfrak p \in \text{Ass}_{A/R}(M)$ if and only if
$\mathfrak p'$ is an associated prime of
$M \otimes_R \kappa(\mathfrak r)$, see
Algebra, Lemma \ref{algebra-lemma-compare-relative-assassins}.
Note that the ring $A \otimes_R \kappa(\mathfrak r)$ corresponds to $U_s$
and the module $M \otimes_R \kappa(\mathfrak r)$ corresponds to the
quasi-coherent sheaf $\mathcal{F}_s|_{U_s}$.
Hence $x$ is an associated point of $\mathcal{F}_s$
by Lemma \ref{lemma-associated-affine-open}.
The reverse implication holds if $\mathfrak p'$ is finitely generated
which is how the last sentence is seen to be true.
\end{proof}

\begin{lemma}
\label{lemma-base-change-relative-assassin}
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Let $g : S' \to S$ be a morphism of schemes.
Consider the base change diagram
$$
\xymatrix{
X' \ar[d] \ar[r]_{g'} & X \ar[d] \\
S' \ar[r]^g & S
}
$$
and set $\mathcal{F}' = (g')^*\mathcal{F}$. Let $x' \in X'$ be a point
with images $x \in X$, $s' \in S'$ and $s \in S$.
Assume $f$ locally of finite type.
Then $x' \in \text{Ass}_{X'/S'}(\mathcal{F}')$ if and only if
$x \in \text{Ass}_{X/S}(\mathcal{F})$ and $x'$ corresponds to
a generic point of an irreducible component of
$\Spec(\kappa(s') \otimes_{\kappa(s)} \kappa(x))$.
\end{lemma}

\begin{proof}
Consider the morphism $X'_{s'} \to X_s$ of fibres. As
$X_{s'} = X_s \times_{\Spec(\kappa(s))} \Spec(\kappa(s'))$
this is a flat morphism. Moreover $\mathcal{F}'_{s'}$ is the pullback
of $\mathcal{F}_s$ via this morphism. As $X_s$ is locally of finite
type over the Noetherian scheme $\Spec(\kappa(s))$ we have that
$X_s$ is locally Noetherian, see
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}.
Thus we may apply
Lemma \ref{lemma-bourbaki}
and we see that
$$
\text{Ass}_{X'_{s'}}(\mathcal{F}'_{s'}) =
\bigcup\nolimits_{x \in \text{Ass}(\mathcal{F}_s)} \text{Ass}((X'_{s'})_x).
$$
Thus to prove the lemma it suffices to show that the associated points
of the fibre $(X'_{s'})_x$ of the morphism $X'_{s'} \to X_s$ over $x$
are its generic points. Note that
$(X'_{s'})_x = \Spec(\kappa(s') \otimes_{\kappa(s)} \kappa(x))$
as schemes. By
Algebra, Lemma \ref{algebra-lemma-tensor-fields-CM}
the ring $\kappa(s') \otimes_{\kappa(s)} \kappa(x)$ is a Noetherian
Cohen-Macaulay ring. Hence its associated primes are its minimal primes, see
Algebra, Proposition \ref{algebra-proposition-minimal-primes-associated-primes}
(minimal primes are associated) and
Algebra, Lemma \ref{algebra-lemma-criterion-no-embedded-primes}
(no embedded primes).
\end{proof}

\begin{remark}
\label{remark-base-change-relative-assassin}
With notation and assumptions as in
Lemma \ref{lemma-base-change-relative-assassin}
we see that it is always the case that
$(g')^{-1}(\text{Ass}_{X/S}(\mathcal{F})) \supset
\text{Ass}_{X'/S'}(\mathcal{F}')$.
If the morphism $S' \to S$ is locally quasi-finite, then we actually have
$$
(g')^{-1}(\text{Ass}_{X/S}(\mathcal{F}))
=
\text{Ass}_{X'/S'}(\mathcal{F}')
$$
because in this case the field extensions $\kappa(s')/\kappa(s)$
are always finite. In fact, this holds more generally for any morphism
$g : S' \to S$ such that all the field extensions
$\kappa(s')/\kappa(s)$ are algebraic, because in this case all
prime ideals of $\kappa(s') \otimes_{\kappa(s)} \kappa(x)$ are
maximal (and minimal) primes, see
Algebra, Lemma \ref{algebra-lemma-integral-over-field}.
\end{remark}




\section{Relative weak assassin}
\label{section-relative-weak-assassin}

\begin{definition}
\label{definition-relative-weak-assassin}
Let $f : X \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
The {\it relative weak assassin of $\mathcal{F}$ in $X$ over $S$}
is the set
$$
\text{WeakAss}_{X/S}(\mathcal{F}) =
\bigcup\nolimits_{s \in S} \text{WeakAss}(\mathcal{F}_s)
$$
where $\mathcal{F}_s = (X_s \to X)^*\mathcal{F}$ is the restriction
of $\mathcal{F}$ to the fibre of $f$ at $s$.
\end{definition}

\begin{lemma}
\label{lemma-relative-weak-assassin-assassin-finite-type}
Let $f : X \to S$ be a morphism of schemes which is locally of finite type.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
Then $\text{WeakAss}_{X/S}(\mathcal{F}) = \text{Ass}_{X/S}(\mathcal{F})$.
\end{lemma}

\begin{proof}
This is true because the fibres of $f$ are locally Noetherian schemes,
and associated and weakly associated points agree on locally Noetherian
schemes, see
Lemma \ref{lemma-ass-weakly-ass}.
\end{proof}

\begin{lemma}
\label{lemma-relative-weak-assassin-finite}
Let $f : X \to S$ be a morphism of schemes.
Let $i : Z \to X$ be a finite morphism.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_Z$-module.
Then $\text{WeakAss}_{X/S}(i_*\mathcal{F}) =
i(\text{WeakAss}_{Z/S}(\mathcal{F}))$.
\end{lemma}

\begin{proof}
Let $i_s : Z_s \to X_s$ be the induced morphism between fibres.
Then $(i_*\mathcal{F})_s = i_{s, *}(\mathcal{F}_s)$ by
Cohomology of Schemes, Lemma \ref{coherent-lemma-affine-base-change}
and the fact that $i$ is affine. Hence
we may apply Lemma \ref{lemma-weakly-associated-finite} to conclude.
\end{proof}





\section{Fitting ideals}
\label{section-fitting-ideals}

\noindent
This section is the continuation of the discussion in
More on Algebra, Section \ref{more-algebra-section-fitting-ideals}.
Let $S$ be a scheme. Let $\mathcal{F}$ be a
finite type quasi-coherent $\mathcal{O}_S$-module.
In this situation we can construct the Fitting ideals
$$
0 = \text{Fit}_{-1}(\mathcal{F}) \subset \text{Fit}_0(\mathcal{F}) \subset
\text{Fit}_1(\mathcal{F}) \subset \ldots \subset \mathcal{O}_S
$$
as the sequence of quasi-coherent ideals characterized by the following
property: for every affine open $U = \Spec(A)$ of $S$ if $\mathcal{F}|_U$
corresponds to the $A$-module $M$, then $\text{Fit}_i(\mathcal{F})|_U$
corresponds to the ideal $\text{Fit}_i(M) \subset A$.
This is well defined and a quasi-coherent sheaf of ideals because
if $f \in A$, then the $i$th Fitting ideal of $M_f$ over $A_f$
is equal to $\text{Fit}_i(M) A_f$ by
More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideal-basics}.

\medskip\noindent
Alternatively, we can construct the Fitting ideals in terms of local
presentations of $\mathcal{F}$. Namely, if $U \subset X$ is open, and
$$
\bigoplus\nolimits_{i \in I} \mathcal{O}_U \to
\mathcal{O}_U^{\oplus n} \to \mathcal{F}|_U \to 0
$$
is a presentation of $\mathcal{F}$ over $U$, then
$\text{Fit}_r(\mathcal{F})|_U$ is generated by the
$(n - r) \times (n - r)$-minors
of the matrix defining the first arrow of the presentation.
This is compatible with the construction above because this
is how the Fitting ideal of a module over a ring is actually defined.
Some details omitted.

\begin{lemma}
\label{lemma-base-change-fitting-ideal}
Let $f : T \to S$ be a morphism of schemes.
Let $\mathcal{F}$ be a finite type quasi-coherent $\mathcal{O}_S$-module.
Then
$f^{-1}\text{Fit}_i(\mathcal{F}) \cdot \mathcal{O}_T =
\text{Fit}_i(f^*\mathcal{F})$.
\end{lemma}

\begin{proof}
Follows immediately from More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics} part (3).
\end{proof}

\begin{lemma}
\label{lemma-fitting-ideal-of-finitely-presented}
Let $S$ be a scheme.
Let $\mathcal{F}$ be a finitely presented $\mathcal{O}_S$-module.
Then $\text{Fit}_r(\mathcal{F})$ is a quasi-coherent ideal of finite type.
\end{lemma}

\begin{proof}
Follows immediately from More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics} part (4).
\end{proof}

\begin{lemma}
\label{lemma-on-subscheme-cut-out-by-Fit-0}
Let $S$ be a scheme.
Let $\mathcal{F}$ be a finite type, quasi-coherent $\mathcal{O}_S$-module.
Let $Z_0 \subset S$ be the closed subscheme cut out by
$\text{Fit}_0(\mathcal{F})$.
Let $Z \subset S$ be the scheme theoretic support of $\mathcal{F}$.
Then
\begin{enumerate}
\item $Z \subset Z_0 \subset S$ as closed subschemes,
\item $Z = Z_0 = \text{Supp}(\mathcal{F})$ as closed subsets,
\item there exists a finite type, quasi-coherent $\mathcal{O}_{Z_0}$-module
$\mathcal{G}_0$ with
$$
(Z_0 \to X)_*\mathcal{G}_0 = \mathcal{F}.
$$
\end{enumerate}
\end{lemma}

\begin{proof}
Recall that $Z$ is locally cut out by the annihilator of $\mathcal{F}$, see
Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-support}
(which uses Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-support}
to define $Z$). Hence we see that $Z \subset Z_0$ scheme theoretically
by More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics} part (6).
On the other hand we have $Z = \text{Supp}(\mathcal{F})$
set theoretically by
Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-support}
and we have $Z_0 = Z$ set theoretically by
More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics} part (7).
Finally, to get $\mathcal{G}_0$ as in part (3) we can either use
that we have $\mathcal{G}$ on $Z$ as in
Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-support}
and set $\mathcal{G}_0 = (Z \to Z_0)_*\mathcal{G}$
or we can use Morphisms, Lemma \ref{morphisms-lemma-i-star-equivalence}
and the fact that $\text{Fit}_0(\mathcal{F})$ annihilates
$\mathcal{F}$ by More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics} part (6).
\end{proof}

\begin{lemma}
\label{lemma-fitting-ideal-generate-locally}
Let $S$ be a scheme. Let $\mathcal{F}$ be a finite type, quasi-coherent
$\mathcal{O}_S$-module. Let $s \in S$. Then $\mathcal{F}$ can be
generated by $r$ elements in a neighbourhood of $s$ if and only
if $\text{Fit}_r(\mathcal{F})_s = \mathcal{O}_{S, s}$.
\end{lemma}

\begin{proof}
Follows immediately from
More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideal-generate-locally}.
\end{proof}

\begin{lemma}
\label{lemma-fitting-ideal-finite-locally-free}
Let $S$ be a scheme. Let $\mathcal{F}$ be a finite type, quasi-coherent
$\mathcal{O}_S$-module. Let $r \geq 0$. The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is finite locally free of rank $r$
\item $\text{Fit}_{r - 1}(\mathcal{F}) = 0$ and
$\text{Fit}_r(\mathcal{F}) = \mathcal{O}_S$, and
\item $\text{Fit}_k(\mathcal{F}) = 0$ for $k < r$ and
$\text{Fit}_k(\mathcal{F}) = \mathcal{O}_S$ for $k \geq r$.
\end{enumerate}
\end{lemma}

\begin{proof}
Follows immediately from
More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-finite-locally-free}.
\end{proof}

\begin{lemma}
\label{lemma-locally-free-rank-r-pullback}
Let $S$ be a scheme. Let $\mathcal{F}$ be a finite type, quasi-coherent
$\mathcal{O}_S$-module. The closed subschemes
$$
S = Z_{-1} \supset Z_0 \supset Z_1 \supset Z_2 \ldots
$$
defined by the Fitting ideals of $\mathcal{F}$ have the following
properties
\begin{enumerate}
\item The intersection $\bigcap Z_r$ is empty.
\item The functor $(\Sch/S)^{opp} \to \textit{Sets}$ defined by the rule
$$
T \longmapsto
\left\{
\begin{matrix}
\{*\} & \text{if }\mathcal{F}_T\text{ is locally generated by }
\leq r\text{ sections} \\
\emptyset & \text{otherwise}
\end{matrix}
\right.
$$
is representable by the open subscheme $S \setminus Z_r$.
\item The functor $F_r : (\Sch/S)^{opp} \to \textit{Sets}$ defined by the rule
$$
T \longmapsto
\left\{
\begin{matrix}
\{*\} & \text{if }\mathcal{F}_T\text{ locally free rank }r\\
\emptyset & \text{otherwise}
\end{matrix}
\right.
$$
is representable by the locally closed subscheme $Z_{r - 1} \setminus Z_r$
of $S$.
\end{enumerate}
If $\mathcal{F}$ is of finite presentation, then
$Z_r \to S$, $S \setminus Z_r \to S$, and $Z_{r - 1} \setminus Z_r \to S$
are of finite presentation.
\end{lemma}

\begin{proof}
Part (1) is true because over every affine open $U$ there is an integer $n$
such that $\text{Fit}_n(\mathcal{F})|_U = \mathcal{O}_U$. Namely, we can
take $n$ to be the number of generators of $\mathcal{F}$ over $U$, see
More on Algebra, Section \ref{more-algebra-section-fitting-ideals}.

\medskip\noindent
For any morphism $g : T \to S$ we see from
Lemmas \ref{lemma-base-change-fitting-ideal} and
\ref{lemma-fitting-ideal-generate-locally}
that $\mathcal{F}_T$ is locally generated by $\leq r$ sections if and only if
$\text{Fit}_r(\mathcal{F}) \cdot \mathcal{O}_T = \mathcal{O}_T$.
This proves (2).

\medskip\noindent
For any morphism $g : T \to S$ we see from
Lemmas \ref{lemma-base-change-fitting-ideal} and
\ref{lemma-fitting-ideal-finite-locally-free}
that $\mathcal{F}_T$ is free of rank $r$ if and only if
$\text{Fit}_r(\mathcal{F}) \cdot \mathcal{O}_T = \mathcal{O}_T$ and
$\text{Fit}_{r - 1}(\mathcal{F}) \cdot \mathcal{O}_T = 0$.
This proves (3).

\medskip\noindent
Part (4) follows from the fact that if
$\mathcal{F}$ is of finite presentation, then each of the morphisms
$Z_r \to S$ is of finite presentation as $\text{Fit}_r(\mathcal{F})$
is of finite type (Lemma \ref{lemma-fitting-ideal-of-finitely-presented} and
Morphisms, Lemma \ref{morphisms-lemma-closed-immersion-finite-presentation}).
This implies that $Z_{r - 1} \setminus Z_r$ is a retrocompact open in $Z_r$
(Properties, Lemma \ref{properties-lemma-quasi-coherent-finite-type-ideals})
and hence the morphism $Z_{r - 1} \setminus Z_r \to Z_r$
is of finite presentation as well.
\end{proof}

\noindent
Lemma \ref{lemma-locally-free-rank-r-pullback} notwithstanding
the following lemma does not hold if $\mathcal{F}$ is a finite type
quasi-coherent module. Namely, the stratification still exists but
it isn't true that it represents the functor $F_{flat}$ in general.

\begin{lemma}
\label{lemma-finite-presentation-module}
Let $S$ be a scheme. Let $\mathcal{F}$ be an $\mathcal{O}_S$-module
of finite presentation. Let $S = Z_{-1} \supset Z_0 \supset Z_1 \supset \ldots$
be as in Lemma \ref{lemma-locally-free-rank-r-pullback}.
Set $S_r = Z_{r - 1} \setminus Z_r$.
Then $S' = \coprod_{r \geq 0} S_r$ represents the functor
$$
F_{flat} : \Sch/S \longrightarrow \textit{Sets},\quad\quad
T \longmapsto
\left\{
\begin{matrix}
\{*\} & \text{if }\mathcal{F}_T\text{ flat over }T\\
\emptyset & \text{otherwise}
\end{matrix}
\right.
$$
Moreover, $\mathcal{F}|_{S_r}$ is locally free of rank $r$ and the
morphisms $S_r \to S$ and $S' \to S$ are of finite presentation.
\end{lemma}

\begin{proof}
Suppose that $g : T \to S$ is a morphism of schemes such that the pullback
$\mathcal{F}_T = g^*\mathcal{F}$ is flat. Then $\mathcal{F}_T$ is a flat
$\mathcal{O}_T$-module of finite presentation. Hence
$\mathcal{F}_T$ is finite locally free, see
Properties, Lemma \ref{properties-lemma-finite-locally-free}.
Thus $T = \coprod_{r \geq 0} T_r$, where $\mathcal{F}_T|_{T_r}$ is locally
free of rank $r$. This implies that
$$
F_{flat} = \coprod\nolimits_{r \geq 0} F_r
$$
in the category of Zariski sheaves on $\Sch/S$ where $F_r$ is as in
Lemma \ref{lemma-locally-free-rank-r-pullback}. It follows
that $F_{flat}$ is represented by
$\coprod_{r \geq 0} (Z_{r - 1} \setminus Z_r)$ where
$Z_r$ is as in
Lemma \ref{lemma-locally-free-rank-r-pullback}.
The other statements also follow from the lemma.
\end{proof}

\begin{example}
\label{example-not-fp-MB}
Let $R = \prod_{n \in \mathbf{N}} \mathbf{F}_2$. Let $I \subset R$
be the ideal of elements $a = (a_n)_{n \in \mathbf{N}}$ almost all of whose
components are zero. Let $\mathfrak m$ be a maximal ideal containing $I$. 
Then $M = R/\mathfrak m$ is a finite flat $R$-module, because $R$ is absolutely
flat (More on Algebra, Lemma
\ref{more-algebra-lemma-product-fields-absolutely-flat}).
Set $S = \Spec(R)$ and $\mathcal{F} = \widetilde{M}$.
The closed subschemes of Lemma \ref{lemma-locally-free-rank-r-pullback} are
$S = Z_{-1}$, $Z_0 = \Spec(R/\mathfrak m)$, and $Z_i = \emptyset$ for $i > 0$.
But $\text{id} : S \to S$ does not factor through
$(S \setminus Z_0) \amalg Z_0$ because $\mathfrak m$ is a nonisolated
point of $S$. Thus
Lemma \ref{lemma-finite-presentation-module}
does not hold for finite type modules.
\end{example}







\section{The singular locus of a morphism}
\label{section-singular-locus-morphism}

\noindent
Let $f : X \to S$ be a finite type morphism of schemes. The set $U$ of points
where $f$ is smooth is an open of $X$
(by Morphisms, Definition \ref{morphisms-definition-smooth}).
In many situations it is useful to have a canonical closed
subscheme $\text{Sing}(f) \subset X$ whose complement is $U$
and whose formation commutes with arbitrary change of base.

\medskip\noindent
If $f$ is of finite presentation, then one choice would be to consider the
closed subscheme $Z$ cut out by functions which are affine locally
``strictly standard'' in the sense of
Smoothing Ring Maps, Definition \ref{smoothing-definition-strictly-standard}.
It follows from
Smoothing Ring Maps, Lemma \ref{smoothing-lemma-strictly-standard-base-change}
that if $f' : X' \to S'$ is the base change of $f$ by a morphism
$S' \to S$, then $Z' \subset S' \times_S Z$ where $Z'$ is the
closed subscheme of $X'$ cut out by functions which are affine
locally strictly standard. However, equality isn't clear.
The notion of a strictly standard element was useful in the chapter on
Popescu's theorem. The closed subscheme defined by these elements is
(as far as we know) not used in the literature\footnote{If $f$ is a
local complete intersection morphism
(More on Morphisms, Definition \ref{more-morphisms-definition-lci})
then the closed subscheme cut out by the locally strictly standard
elements is the correct thing to look at.}.

\medskip\noindent
If $f$ is flat, of finite presentation, and the fibres of $f$
all are equidimensional of dimension $d$, then the $d$th fitting ideal
of $\Omega_{X/S}$ is used to get a good closed subscheme. For any
morphism of finite type the closed subschemes of $X$ defined by the
fitting ideals of $\Omega_{X/S}$ define a stratification of $X$
in terms of the rank of $\Omega_{X/S}$  whose formation commutes with
base change. This can be helpful; it is related to embedding dimensions of
fibres, see Varieties, Section \ref{varieties-section-embedding-dimension}.

\begin{lemma}
\label{lemma-base-change-and-fitting-ideal-omega}
Let $f : X \to S$ be a morphism of schemes which is locally of finite type.
Let $X = Z_{-1} \supset Z_0 \supset Z_1 \supset \ldots$
be the closed subschemes defined by the fitting ideals
of $\Omega_{X/S}$. Then the formation of $Z_i$ commutes
with arbitrary base change.
\end{lemma}

\begin{proof}
Observe that $\Omega_{X/S}$ is a finite type quasi-coherent
$\mathcal{O}_X$-module
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-differentials})
hence the fitting ideals are defined. If $f' : X' \to S'$
is the base change of $f$ by $g : S' \to S$, then
$\Omega_{X'/S'} = (g')^*\Omega_{X/S}$ where $g' : X' \to X$
is the projection
(Morphisms, Lemma \ref{morphisms-lemma-base-change-differentials}).
Hence $(g')^{-1}\text{Fit}_i(\Omega_{X/S}) \cdot \mathcal{O}_{X'} =
\text{Fit}_i(\Omega_{X'/S'})$. This means that
$$
Z'_i = (g')^{-1}(Z_i) = Z_i \times_X X'
$$
scheme theoretically and this is the meaning of the statement of
the lemma.
\end{proof}

\noindent
The $0$th fitting ideal of $\Omega$
cuts out the ``ramified locus'' of the morphism.

\begin{lemma}
\label{lemma-zero-fitting-ideal-omega-unramified}
Let $f : X \to S$ be a morphism of schemes which is locally of finite type.
The closed subscheme $Z \subset X$ cut out by the $0$th fitting ideal of
$\Omega_{X/S}$ is exactly the set of points where $f$ is not unramified.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-on-subscheme-cut-out-by-Fit-0} the complement of $Z$
is exactly the locus where $\Omega_{X/S}$ is zero. This is exactly
the set of points where $f$ is unramified by
Morphisms, Lemma \ref{morphisms-lemma-unramified-omega-zero}.
\end{proof}

\begin{lemma}
\label{lemma-d-fitting-ideal-omega-smooth}
Let $f : X \to S$ be a morphism of schemes. Let $d \geq 0$ be an integer.
Assume
\begin{enumerate}
\item $f$ is flat,
\item $f$ is locally of finite presentation, and
\item every nonempty fibre of $f$ is equidimensional of dimension $d$.
\end{enumerate}
Let $Z \subset X$ be the closed subscheme cut out by the $d$th fitting
ideal of $\Omega_{X/S}$. Then $Z$ is exactly the set of points
where $f$ is not smooth.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-locally-free-rank-r-pullback} the complement of $Z$
is exactly the locus where $\Omega_{X/S}$ can be generated by at most
$d$ elements. Hence the lemma follows from
Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point}.
\end{proof}







\section{Torsion free modules}
\label{section-torsion-free}

\noindent
This section is the analogue of
More on Algebra, Section \ref{more-algebra-section-torsion-flat}
for quasi-coherent modules.

\begin{lemma}
\label{lemma-torsion-sections}
Let $X$ be an integral scheme with generic point $\eta$. Let $\mathcal{F}$
be a quasi-coherent $\mathcal{O}_X$-module. Let $U \subset X$ be nonempty
open and $s \in \mathcal{F}(U)$. The following are equivalent
\begin{enumerate}
\item for some $x \in U$ the image of $s$ in $\mathcal{F}_x$ is torsion,
\item for all $x \in U$ the image of $s$ in $\mathcal{F}_x$ is torsion,
\item the image of $s$ in $\mathcal{F}_\eta$ is zero,
\item the image of $s$ in $j_*\mathcal{F}_\eta$ is zero, where $j : \eta \to X$
is the inclusion morphism.
\end{enumerate}
\end{lemma}

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

\begin{definition}
\label{definition-torsion}
Let $X$ be an integral scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module.
\begin{enumerate}
\item We say a local section of $\mathcal{F}$ is {\it torsion}
if it satisfies the equivalent conditions of Lemma \ref{lemma-torsion-sections}.
\item We say $\mathcal{F}$ is {\it torsion free} if every torsion section
of $\mathcal{F}$ is $0$.
\end{enumerate}
\end{definition}

\noindent
Here is the obligatory lemma comparing this to the usual algebraic notion.

\begin{lemma}
\label{lemma-check-torsion-on-affines}
Let $X$ be an integral scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is torsion free,
\item for $U \subset X$ affine open $\mathcal{F}(U)$
is a torsion free $\mathcal{O}(U)$-module.
\end{enumerate}
\end{lemma}

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

\begin{lemma}
\label{lemma-torsion}
Let $X$ be an integral scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. The torsion sections of $\mathcal{F}$ form
a quasi-coherent $\mathcal{O}_X$-submodule
$\mathcal{F}_{tors} \subset \mathcal{F}$.
The quotient module $\mathcal{F}/\mathcal{F}_{tors}$ is torsion free.
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma \ref{more-algebra-lemma-torsion}
for the algebraic analogue.
\end{proof}

\begin{lemma}
\label{lemma-flat-torsion-free}
Let $X$ be an integral scheme. Any flat quasi-coherent $\mathcal{O}_X$-module
is torsion free.
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma \ref{more-algebra-lemma-flat-torsion-free}.
\end{proof}

\begin{lemma}
\label{lemma-flat-pullback-torsion}
Let $f : X \to Y$ be a flat morphism of integral schemes.
Let $\mathcal{G}$ be a torsion free quasi-coherent $\mathcal{O}_Y$-module.
Then $f^*\mathcal{G}$ is a torsion free $\mathcal{O}_X$-module.
\end{lemma}

\begin{proof}
Omitted. See
More on Algebra, Lemma \ref{more-algebra-lemma-flat-pullback-reflexive}
for the algebraic analogue.
\end{proof}

\begin{lemma}
\label{lemma-flat-over-integral-integral-fibre}
Let $f : X \to Y$ be a flat morphism of schemes. If $Y$ is integral
and the generic fibre of $f$ is integral, then $X$ is integral.
\end{lemma}

\begin{proof}
The algebraic analogue is this: let $A$ be a domain with fraction
field $K$ and let $B$ be a flat $A$-algebra such that $B \otimes_A K$
is a domain. Then $B$ is a domain. This is true because $B$ is
torsion free by More on Algebra, Lemma
\ref{more-algebra-lemma-flat-torsion-free}
and hence $B \subset B \otimes_A K$.
\end{proof}

\begin{lemma}
\label{lemma-check-torsion}
Let $X$ be an integral scheme. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. Then $\mathcal{F}$ is torsion free if and only if
$\mathcal{F}_x$ is a torsion free $\mathcal{O}_{X, x}$-module for all $x \in X$.
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma
\ref{more-algebra-lemma-check-torsion}.
\end{proof}

\begin{lemma}
\label{lemma-extension-torsion-free}
Let $X$ be an integral scheme. Let
$0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$
be a short exact sequence of quasi-coherent $\mathcal{O}_X$-modules.
If $\mathcal{F}$ and $\mathcal{F}''$ are torsion free, then $\mathcal{F}'$
is torsion free.
\end{lemma}

\begin{proof}
Omitted. See
More on Algebra, Lemma \ref{more-algebra-lemma-extension-torsion-free}
for the algebraic analogue.
\end{proof}

\begin{lemma}
\label{lemma-torsion-free-finite-noetherian-domain}
Let $X$ be a locally Noetherian integral scheme with generic point $\eta$.
Let $\mathcal{F}$ be a nonzero coherent $\mathcal{O}_X$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is torsion free,
\item $\eta$ is the only associated prime of $\mathcal{F}$,
\item $\eta$ is in the support of $\mathcal{F}$ and $\mathcal{F}$
has property $(S_1)$, and
\item $\eta$ is in the support of $\mathcal{F}$ and $\mathcal{F}$
has no embedded associated prime.
\end{enumerate}
\end{lemma}

\begin{proof}
This is a translation of More on Algebra, Lemma
\ref{more-algebra-lemma-torsion-free-finite-noetherian-domain}
into the language of schemes. We omit the translation.
\end{proof}

\begin{lemma}
\label{lemma-torsion-free-over-regular-dim-1}
Let $X$ be an integral regular scheme of dimension $\leq 1$.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is torsion free,
\item $\mathcal{F}$ is finite locally free.
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that a finite locally free module is torsion free.
For the converse, we will show that if $\mathcal{F}$ is
torsion free, then $\mathcal{F}_x$ is a free $\mathcal{O}_{X, x}$-module
for all $x \in X$. This is enough by
Algebra, Lemma \ref{algebra-lemma-finite-projective}
and the fact that $\mathcal{F}$ is coherent.
If $\dim(\mathcal{O}_{X, x}) = 0$, then
$\mathcal{O}_{X, x}$ is a field and the statement is clear.
If $\dim(\mathcal{O}_{X, x}) = 1$, then $\mathcal{O}_{X, x}$
is a discrete valuation ring
(Algebra, Lemma \ref{algebra-lemma-characterize-dvr})
and $\mathcal{F}_x$ is torsion free.
Hence $\mathcal{F}_x$ is free by More on Algebra, Lemma
\ref{more-algebra-lemma-dedekind-torsion-free-flat}.
\end{proof}

\begin{lemma}
\label{lemma-hom-into-torsion-free}
Let $X$ be an integral scheme. Let $\mathcal{F}$, $\mathcal{G}$ be
quasi-coherent $\mathcal{O}_X$-modules.
If $\mathcal{G}$ is torsion free and $\mathcal{F}$ is of finite presentation,
then $\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})$ is torsion free.
\end{lemma}

\begin{proof}
The statement makes sense because
$\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})$
is quasi-coherent by Schemes, Section \ref{schemes-section-quasi-coherent}.
To see the statement is true, see
More on Algebra, Lemma \ref{more-algebra-lemma-hom-into-torsion-free}.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-isom-depth-2-torsion-free}
Let $X$ be an integral locally Noetherian scheme. Let
$\varphi : \mathcal{F} \to \mathcal{G}$ be a map of
quasi-coherent $\mathcal{O}_X$-modules. Assume $\mathcal{F}$ is coherent,
$\mathcal{G}$ is torsion free, and that for every $x \in X$ one of the
following happens
\begin{enumerate}
\item $\mathcal{F}_x \to \mathcal{G}_x$ is an isomorphism, or
\item $\text{depth}(\mathcal{F}_x) \geq 2$.
\end{enumerate}
Then $\varphi$ is an isomorphism.
\end{lemma}

\begin{proof}
This is a translation of More on Algebra, Lemma
\ref{more-algebra-lemma-isom-depth-2-torsion-free}
into the language of schemes.
\end{proof}








\section{Reflexive modules}
\label{section-reflexive}

\noindent
This section is the analogue of
More on Algebra, Section \ref{more-algebra-section-reflexive}
for coherent modules on locally Noetherian schemes. The reason for
working with coherent modules is that
$\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})$ is coherent
for every pair of coherent $\mathcal{O}_X$-modules $\mathcal{F}, \mathcal{G}$,
see Modules, Lemma \ref{modules-lemma-internal-hom-locally-kernel-direct-sum}.

\begin{definition}
\label{definition-reflexive}
Let $X$ be an integral locally Noetherian scheme. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module. The {\it reflexive hull}
of $\mathcal{F}$ is the $\mathcal{O}_X$-module
$$
\mathcal{F}^{**} = \SheafHom_{\mathcal{O}_X}(
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{O}_X), \mathcal{O}_X)
$$
We say $\mathcal{F}$ is {\it reflexive} if the natural map
$j : \mathcal{F} \longrightarrow \mathcal{F}^{**}$
is an isomorphism.
\end{definition}

\noindent
It follows from Lemma \ref{lemma-dual-reflexive} that the reflexive hull
is a reflexive $\mathcal{O}_X$-module.
You can use the same definition to define reflexive modules in more
general situations, but this does not seem to be very useful.
Here is the obligatory lemma comparing this to the usual algebraic notion.

\begin{lemma}
\label{lemma-check-reflexive-on-affines}
Let $X$ be an integral locally Noetherian scheme. Let $\mathcal{F}$ be a
coherent $\mathcal{O}_X$-module. The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is reflexive,
\item for $U \subset X$ affine open $\mathcal{F}(U)$
is a reflexive $\mathcal{O}(U)$-module.
\end{enumerate}
\end{lemma}

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

\begin{remark}
\label{remark-different-reflexive}
If $X$ is a scheme of finite type over a field, then sometimes a different
notion of reflexive modules is used (see for example
\cite[bottom of page 5 and Definition 1.1.9]{HL}).
This other notion uses $R\SheafHom$ into a dualizing complex
$\omega_X^\bullet$ instead of into $\mathcal{O}_X$ and
should probably have a different name because it can be different
when $X$ is not Gorenstein. For example, if
$X = \Spec(k[t^3, t^4, t^5])$, then a computation shows the dualizing
sheaf $\omega_X$ is not reflexive in our sense, but it is reflexive in the
other sense as
$\omega_X \to \SheafHom(\SheafHom(\omega_X, \omega_X), \omega_X)$
is an isomorphism.
\end{remark}

\begin{lemma}
\label{lemma-reflexive-torsion-free}
Let $X$ be an integral locally Noetherian scheme. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module.
\begin{enumerate}
\item If $\mathcal{F}$ is reflexive, then $\mathcal{F}$ is torsion free.
\item The map $j : \mathcal{F} \longrightarrow \mathcal{F}^{**}$
is injective if and only if $\mathcal{F}$ is torsion free.
\end{enumerate}
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma
\ref{more-algebra-lemma-reflexive-torsion-free}.
\end{proof}

\begin{lemma}
\label{lemma-check-reflexive}
Let $X$ be an integral locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is reflexive,
\item $\mathcal{F}_x$ is a reflexive $\mathcal{O}_{X, x}$-module
for all $x \in X$,
\item $\mathcal{F}_x$ is a reflexive $\mathcal{O}_{X, x}$-module
for all closed points $x \in X$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Modules, Lemma \ref{modules-lemma-stalk-internal-hom} we see that
(1) and (2) are equivalent. Since every point of $X$ specializes to
a closed point
(Properties, Lemma \ref{properties-lemma-locally-Noetherian-closed-point})
we see that (2) and (3) are equivalent.
\end{proof}

\begin{lemma}
\label{lemma-flat-pullback-reflexive}
Let $f : X \to Y$ be a flat morphism of integral locally Noetherian schemes.
Let $\mathcal{G}$ be a coherent reflexive $\mathcal{O}_Y$-module.
Then $f^*\mathcal{G}$ is a coherent reflexive $\mathcal{O}_X$-module.
\end{lemma}

\begin{proof}
Omitted. See
More on Algebra, Lemma \ref{more-algebra-lemma-flat-pullback-torsion}
for the algebraic analogue.
\end{proof}

\begin{lemma}
\label{lemma-sequence-reflexive}
Let $X$ be an integral locally Noetherian scheme.
Let $0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}''$ be
an exact sequence of coherent $\mathcal{O}_X$-modules.
If $\mathcal{F}'$ is reflexive and $\mathcal{F}''$ is torsion free,
then $\mathcal{F}$ is reflexive.
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma \ref{more-algebra-lemma-sequence-reflexive}.
\end{proof}

\begin{lemma}
\label{lemma-dual-reflexive}
Let $X$ be an integral locally Noetherian scheme.
Let $\mathcal{F}$, $\mathcal{G}$ be
coherent $\mathcal{O}_X$-modules.
If $\mathcal{G}$ is reflexive,
then $\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})$ is reflexive.
\end{lemma}

\begin{proof}
The statement makes sense because
$\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})$
is coherent by Cohomology of Schemes, Lemma
\ref{coherent-lemma-tensor-hom-coherent}.
To see the statement is true, see
More on Algebra, Lemma \ref{more-algebra-lemma-dual-reflexive}.
Some details omitted.
\end{proof}

\begin{remark}
\label{remark-tensor}
Let $X$ be an integral locally Noetherian scheme. Thanks to
Lemma \ref{lemma-dual-reflexive} we know that the reflexive
hull $\mathcal{F}^{**}$ of a coherent $\mathcal{O}_X$-module
is coherent reflexive. Consider the category $\mathcal{C}$
of coherent reflexive $\mathcal{O}_X$-modules. Taking
reflexive hulls gives a left adjoint to the inclusion functor
$\mathcal{C} \to \textit{Coh}(\mathcal{O}_X)$.
Observe that $\mathcal{C}$ is an additive category
with kernels and cokernels. Namely, given
$\varphi : \mathcal{F} \to \mathcal{G}$ in $\mathcal{C}$, the
usual kernel $\Ker(\varphi)$ is reflexive
(Lemma \ref{lemma-sequence-reflexive}) and the reflexive hull
$\Coker(\varphi)^{**}$ of the usual cokernel
is the cokernel in $\mathcal{C}$. Moreover $\mathcal{C}$ inherits
a tensor product
$$
\mathcal{F} \otimes_\mathcal{C} \mathcal{G} =
(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{G})^{**}
$$
which is associative and symmetric. There is an internal Hom
in the sense that for any three objects
$\mathcal{F}, \mathcal{G}, \mathcal{H}$ of
$\mathcal{C}$ we have the identity
$$
\Hom_\mathcal{C}(\mathcal{F} \otimes_\mathcal{C} \mathcal{G}, \mathcal{H}) =
\Hom_\mathcal{C}(\mathcal{F},
\SheafHom_{\mathcal{O}_X}(\mathcal{G}, \mathcal{H}))
$$
see Modules, Lemma \ref{modules-lemma-internal-hom}. In $\mathcal{C}$
every object $\mathcal{F}$ has a {\it dual object}
$\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{O}_X)$.
Without further conditions on $X$ it can happen that
$$
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G}) \not \cong
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{O}_X)
\otimes_\mathcal{C} \mathcal{G}
\quad\text{and}\quad
\mathcal{F} \otimes_\mathcal{C}
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{O}_X)
\not \cong \mathcal{O}_X
$$
for $\mathcal{F}, \mathcal{G}$ of rank $1$ in $\mathcal{C}$.
To make an example let $X = \Spec(R)$ where $R$ is as in
More on Algebra, Example \ref{more-algebra-example-ring-not-S2}
and let $\mathcal{F}, \mathcal{G}$ be the modules corresponding to $M$.
Computation omitted.
\end{remark}

\begin{lemma}
\label{lemma-reflexive-depth-2}
Let $X$ be an integral locally Noetherian scheme. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module. The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is reflexive,
\item for each $x \in X$ one of the following happens
\begin{enumerate}
\item $\mathcal{F}_x$ is a reflexive $\mathcal{O}_{X, x}$-module, or
\item $\text{depth}(\mathcal{F}_x) \geq 2$.
\end{enumerate}
\end{enumerate}
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma \ref{more-algebra-lemma-reflexive-depth-2}.
\end{proof}

\begin{lemma}
\label{lemma-reflexive-S2}
Let $X$ be an integral locally Noetherian scheme.
Let $\mathcal{F}$ be a coherent reflexive $\mathcal{O}_X$-module.
Let $x \in X$.
\begin{enumerate}
\item If $\text{depth}(\mathcal{O}_{X, x}) \geq 2$, then
$\text{depth}(\mathcal{F}_x) \geq 2$.
\item If $X$ is $(S_2)$, then $\mathcal{F}$ is $(S_2)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Omitted. See More on Algebra, Lemma \ref{more-algebra-lemma-reflexive-S2}.
\end{proof}

\begin{lemma}
\label{lemma-reflexive-S2-extend}
Let $X$ be an integral locally Noetherian scheme. Let $j : U \to X$
be an open subscheme with complement $Z$. Assume $\mathcal{O}_{X, z}$
has depth $\geq 2$ for all $z \in Z$. Then $j^*$ and $j_*$ define
an equivalence of categories between the category of coherent reflexive
$\mathcal{O}_X$-modules and the category of coherent reflexive
$\mathcal{O}_U$-modules.
\end{lemma}

\begin{proof}
Let $\mathcal{F}$ be a coherent reflexive $\mathcal{O}_X$-module. For $z \in Z$
the stalk $\mathcal{F}_z$ has depth $\geq 2$ by Lemma \ref{lemma-reflexive-S2}.
Thus $\mathcal{F} \to j_*j^*\mathcal{F}$ is an isomorphism by
Lemma \ref{lemma-depth-2-hartog}. Conversely, let $\mathcal{G}$
be a coherent reflexive $\mathcal{O}_U$-module. It suffices to show that
$j_*\mathcal{G}$ is a coherent reflexive $\mathcal{O}_X$-module.
To prove this we may assume $X$ is affine. By Properties, Lemma
\ref{properties-lemma-lift-finite-presentation}
there exists a coherent $\mathcal{O}_X$-module $\mathcal{F}$
with $\mathcal{G} = j^*\mathcal{F}$. After replacing $\mathcal{F}$
by its reflexive hull, we may assume $\mathcal{F}$ is reflexive
(see discussion above and in particular Lemma \ref{lemma-dual-reflexive}).
By the above $j_*\mathcal{G} = j_*j^*\mathcal{F} = \mathcal{F}$
as desired.
\end{proof}

\noindent
If the scheme is normal, then reflexive is the same thing as
torsion free and $(S_2)$.

\begin{lemma}
\label{lemma-reflexive-over-normal}
Let $X$ be an integral locally Noetherian normal scheme.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is reflexive,
\item $\mathcal{F}$ is torsion free and has property $(S_2)$, and
\item there exists an open subscheme $j : U \to X$ such that
\begin{enumerate}
\item every irreducible component of $X \setminus U$
has codimension $\geq 2$ in $X$,
\item $j^*\mathcal{F}$ is finite locally free, and
\item $\mathcal{F} = j_*j^*\mathcal{F}$.
\end{enumerate}
\end{enumerate}
\end{lemma}

\begin{proof}
Using Lemma \ref{lemma-check-reflexive-on-affines}
the equivalence of (1) and (2) follows from
More on Algebra, Lemma \ref{more-algebra-lemma-reflexive-over-normal}.
Let $U \subset X$ be as in (3). By
Properties, Lemma \ref{properties-lemma-criterion-normal}
we see that $\text{depth}(\mathcal{O}_{X, x}) \geq 2$
for $x \not \in U$. Since a finite locally free module is reflexive,
we conclude (3) implies (1) by Lemma \ref{lemma-reflexive-S2-extend}.

\medskip\noindent
Assume (1). Let $U \subset X$ be the maximal open subscheme such
that $j^*\mathcal{F} = \mathcal{F}|_U$
is finite locally free. So (3)(b) holds. Let $x \in X$ be a point.
If $\mathcal{F}_x$ is a free $\mathcal{O}_{X, x}$-module, then
$x \in U$, see
Modules, Lemma \ref{modules-lemma-finite-presentation-stalk-free}.
If $\dim(\mathcal{O}_{X, x}) \leq 1$, then $\mathcal{O}_{X, x}$
is either a field or a discrete valuation ring
(Properties, Lemma \ref{properties-lemma-criterion-normal})
and hence $\mathcal{F}_x$ is free (More on Algebra, Lemma
\ref{more-algebra-lemma-dedekind-torsion-free-flat}).
Thus $x \not \in U \Rightarrow \dim(\mathcal{O}_{X, x}) \geq 2$.
Then Properties, Lemma \ref{properties-lemma-codimension-local-ring}
shows (3)(a) holds. By the already used
Properties, Lemma \ref{properties-lemma-criterion-normal}
we also see that $\text{depth}(\mathcal{O}_{X, x}) \geq 2$
for $x \not \in U$ and hence (3)(c) follows from
Lemma \ref{lemma-reflexive-S2-extend}.
\end{proof}

\begin{lemma}
\label{lemma-describe-reflexive-hull}
Let $X$ be an integral locally Noetherian normal scheme with
generic point $\eta$. Let $\mathcal{F}$, $\mathcal{G}$ be coherent
$\mathcal{O}_X$-modules. Let $T : \mathcal{G}_\eta \to \mathcal{F}_\eta$
be a linear map. Then $T$ extends to a map
$\mathcal{G} \to \mathcal{F}^{**}$ of $\mathcal{O}_X$-modules
if and only if
\begin{itemize}
\item[(*)] for every $x \in X$ with $\dim(\mathcal{O}_{X, x}) = 1$
we have
$$
T\left(\Im(\mathcal{G}_x \to \mathcal{G}_\eta)\right) \subset
\Im(\mathcal{F}_x \to \mathcal{F}_\eta).
$$
\end{itemize}
\end{lemma}

\begin{proof}
Because $\mathcal{F}^{**}$ is torsion free and
$\mathcal{F}_\eta = \mathcal{F}^{**}_\eta$ an extension, if it exists,
is unique. Thus it suffices to prove the lemma over the members of an
open covering of $X$, i.e., we may assume $X$ is affine. In this case
we are asking the following algebra question: Let $R$ be a Noetherian
normal domain with fraction field $K$, let $M$, $N$ be finite $R$-modules,
let $T : M \otimes_R K \to N \otimes_R K$ be a $K$-linear map. When
does $T$ extend to a map $N \to M^{**}$? By More on Algebra, Lemma
\ref{more-algebra-lemma-describe-reflexive-hull}
this happens if and only if $N_\mathfrak p$ maps into
$(M/M_{tors})_\mathfrak p$ for every height $1$ prime $\mathfrak p$ of $R$.
This is exactly condition $(*)$ of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-reflexive-over-regular-dim-2}
Let $X$ be a regular scheme of dimension $\leq 2$.
Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is reflexive,
\item $\mathcal{F}$ is finite locally free.
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that a finite locally free module is reflexive.
For the converse, we will show that if $\mathcal{F}$ is
reflexive, then $\mathcal{F}_x$ is a free $\mathcal{O}_{X, x}$-module
for all $x \in X$. This is enough by
Algebra, Lemma \ref{algebra-lemma-finite-projective}
and the fact that $\mathcal{F}$ is coherent.
If $\dim(\mathcal{O}_{X, x}) = 0$, then
$\mathcal{O}_{X, x}$ is a field and the statement is clear.
If $\dim(\mathcal{O}_{X, x}) = 1$, then $\mathcal{O}_{X, x}$
is a discrete valuation ring
(Algebra, Lemma \ref{algebra-lemma-characterize-dvr})
and $\mathcal{F}_x$ is torsion free.
Hence $\mathcal{F}_x$ is free by More on Algebra, Lemma
\ref{more-algebra-lemma-dedekind-torsion-free-flat}.
If $\dim(\mathcal{O}_{X, x}) = 2$, then $\mathcal{O}_{X, x}$
is a regular local ring of dimension $2$. By
More on Algebra, Lemma \ref{more-algebra-lemma-reflexive-over-normal}
we see that $\mathcal{F}_x$ has depth $\geq 2$.
Hence $\mathcal{F}$ is free by
Algebra, Lemma \ref{algebra-lemma-regular-mcm-free}.
\end{proof}







\section{Effective Cartier divisors}
\label{section-effective-Cartier-divisors}

\noindent
We define the notion of an effective Cartier divisor before any other type
of divisor.

\begin{definition}
\label{definition-effective-Cartier-divisor}
Let $S$ be a scheme.
\begin{enumerate}
\item A {\it locally principal closed subscheme} of $S$ is a closed subscheme
whose sheaf of ideals is locally generated by a single element.
\item An {\it effective Cartier divisor} on $S$ is a closed subscheme
$D \subset S$ whose ideal sheaf $\mathcal{I}_D \subset \mathcal{O}_S$
is an invertible $\mathcal{O}_S$-module.
\end{enumerate}
\end{definition}

\noindent
Thus an effective Cartier divisor is a locally principal closed subscheme,
but the converse is not always true. Effective Cartier divisors are closed
subschemes of pure codimension $1$ in the strongest possible sense. Namely
they are locally cut out by a single element which is a nonzerodivisor.
In particular they are nowhere dense.

\begin{lemma}
\label{lemma-characterize-effective-Cartier-divisor}
Let $S$ be a scheme.
Let $D \subset S$ be a closed subscheme.
The following are equivalent:
\begin{enumerate}
\item The subscheme $D$ is an effective Cartier divisor on $S$.
\item For every $x \in D$ there exists an affine open neighbourhood
$\Spec(A) = U \subset S$ of $x$ such that
$U \cap D = \Spec(A/(f))$ with $f \in A$ a nonzerodivisor.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1).  For every $x \in D$ there exists an affine open neighbourhood
$\Spec(A) = U \subset S$ of $x$ such that
$\mathcal{I}_D|_U \cong \mathcal{O}_U$. In other words, there exists
a section $f \in \Gamma(U, \mathcal{I}_D)$ which freely generates the
restriction $\mathcal{I}_D|_U$. Hence $f \in A$, and the multiplication
map $f : A \to A$ is injective. Also, since $\mathcal{I}_D$ is
quasi-coherent we see that $D \cap U = \Spec(A/(f))$.

\medskip\noindent
Assume (2). Let $x \in D$. By assumption there exists an affine open
neighbourhood $\Spec(A) = U \subset S$ of $x$ such that
$U \cap D = \Spec(A/(f))$ with $f \in A$ a nonzerodivisor.
Then $\mathcal{I}_D|_U \cong \mathcal{O}_U$ since it is equal to
$\widetilde{(f)} \cong \widetilde{A} \cong \mathcal{O}_U$.
Of course $\mathcal{I}_D$ restricted to the open subscheme
$S \setminus D$ is isomorphic to $\mathcal{O}_{S \setminus D}$.
Hence $\mathcal{I}_D$ is an invertible $\mathcal{O}_S$-module.
\end{proof}

\begin{lemma}
\label{lemma-complement-locally-principal-closed-subscheme}
Let $S$ be a scheme. Let $Z \subset S$ be a locally principal closed
subscheme. Let $U = S \setminus Z$. Then $U \to S$ is an affine morphism.
\end{lemma}

\begin{proof}
The question is local on $S$, see
Morphisms, Lemmas \ref{morphisms-lemma-characterize-affine}.
Thus we may assume $S = \Spec(A)$ and $Z = V(f)$ for some $f \in A$.
In this case $U = D(f) = \Spec(A_f)$ is affine hence $U \to S$ is affine.
\end{proof}

\begin{lemma}
\label{lemma-complement-effective-Cartier-divisor}
Let $S$ be a scheme. Let $D \subset S$ be an effective Cartier divisor.
Let $U = S \setminus D$. Then $U \to S$ is an affine morphism and $U$
is scheme theoretically dense in $S$.
\end{lemma}

\begin{proof}
Affineness is Lemma \ref{lemma-complement-locally-principal-closed-subscheme}.
The density question is local on $S$, see
Morphisms, Lemma \ref{morphisms-lemma-characterize-scheme-theoretically-dense}.
Thus we may assume $S = \Spec(A)$ and $D$ corresponding to the
nonzerodivisor $f \in A$, see
Lemma \ref{lemma-characterize-effective-Cartier-divisor}.
Thus $A \subset A_f$ which implies that $U \subset S$ is
scheme theoretically dense, see
Morphisms, Example \ref{morphisms-example-scheme-theoretic-closure}.
\end{proof}

\begin{lemma}
\label{lemma-effective-Cartier-makes-dimension-drop}
Let $S$ be a scheme.
Let $D \subset S$ be an effective Cartier divisor.
Let $s \in D$.
If $\dim_s(S) < \infty$, then $\dim_s(D) < \dim_s(S)$.
\end{lemma}

\begin{proof}
Assume $\dim_s(S) < \infty$.
Let $U = \Spec(A) \subset S$ be an affine open neighbourhood
of $s$ such that $\dim(U) = \dim_s(S)$ and such that $D = V(f)$
for some nonzerodivisor $f \in A$ (see
Lemma \ref{lemma-characterize-effective-Cartier-divisor}).
Recall that $\dim(U)$ is the Krull dimension of the ring $A$
and that $\dim(U \cap D)$ is the Krull dimension of the ring $A/(f)$.
Then $f$ is not contained in any minimal prime of $A$.
Hence any maximal chain of primes in $A/(f)$, viewed as a chain
of primes in $A$, can be extended by adding a minimal prime.
\end{proof}

\begin{definition}
\label{definition-sum-effective-Cartier-divisors}
Let $S$ be a scheme. Given effective Cartier divisors
$D_1$, $D_2$ on $S$ we set $D = D_1 + D_2$ equal to the
closed subscheme of $S$ corresponding to the quasi-coherent
sheaf of ideals
$\mathcal{I}_{D_1}\mathcal{I}_{D_2} \subset \mathcal{O}_S$.
We call this the {\it sum of the effective Cartier divisors
$D_1$ and $D_2$}.
\end{definition}

\noindent
It is clear that we may define the sum $\sum n_iD_i$ given
finitely many effective Cartier divisors $D_i$ on $X$
and nonnegative integers $n_i$.

\begin{lemma}
\label{lemma-sum-effective-Cartier-divisors}
The sum of two effective Cartier divisors is an effective
Cartier divisor.
\end{lemma}

\begin{proof}
Omitted. Locally $f_1, f_2 \in A$ are nonzerodivisors, then also
$f_1f_2 \in A$ is a nonzerodivisor.
\end{proof}

\begin{lemma}
\label{lemma-difference-effective-Cartier-divisors}
Let $X$ be a scheme.
Let $D, D'$ be two effective Cartier divisors on $X$.
If $D \subset D'$ (as closed subschemes of $X$), then
there exists an effective Cartier divisor $D''$ such
that $D' = D + D''$.
\end{lemma}

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

\begin{lemma}
\label{lemma-sum-closed-subschemes-effective-Cartier}
Let $X$ be a scheme. Let $Z, Y$ be two closed subschemes of $X$
with ideal sheaves $\mathcal{I}$ and $\mathcal{J}$. If $\mathcal{I}\mathcal{J}$
defines an effective Cartier divisor $D \subset X$, then $Z$ and $Y$
are effective Cartier divisors and $D = Z + Y$.
\end{lemma}

\begin{proof}
Applying Lemma \ref{lemma-characterize-effective-Cartier-divisor} we obtain
the following algebra situation: $A$ is a ring, $I, J \subset A$
ideals and $f \in A$ a nonzerodivisor such that $IJ = (f)$.
Thus the result follows from
Algebra, Lemma \ref{algebra-lemma-product-ideals-principal}.
\end{proof}

\begin{lemma}
\label{lemma-sum-effective-Cartier-divisors-union}
Let $X$ be a scheme. Let $D, D' \subset X$ be effective Cartier divisors
such that the scheme theoretic intersection $D \cap D'$ is an effective
Cartier divisor on $D'$. Then $D + D'$ is the scheme theoretic
union of $D$ and $D'$.
\end{lemma}

\begin{proof}
See Morphisms, Definition
\ref{morphisms-definition-scheme-theoretic-intersection-union}
for the definition of scheme theoretic intersection and union.
To prove the lemma working locally
(using Lemma \ref{lemma-characterize-effective-Cartier-divisor})
we obtain the following algebra problem: Given a ring $A$
and nonzerodivisors $f_1, f_2 \in A$ such that $f_1$ maps
to a nonzerodivisor in $A/f_2A$, show that $f_1A \cap f_2A = f_1f_2A$.
We omit the straightforward argument.
\end{proof}

\noindent
Recall that we have defined the inverse image of a closed subscheme
under any morphism of schemes in
Schemes, Definition \ref{schemes-definition-inverse-image-closed-subscheme}.

\begin{lemma}
\label{lemma-pullback-locally-principal}
Let $f : S' \to S$ be a morphism of schemes. Let $Z \subset S$
be a locally principal closed subscheme. Then the inverse image
$f^{-1}(Z)$ is a locally principal closed subscheme of $S'$.
\end{lemma}

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

\begin{definition}
\label{definition-pullback-effective-Cartier-divisor}
Let $f : S' \to S$ be a morphism of schemes. Let $D \subset S$
be an effective Cartier divisor. We say the {\it pullback of
$D$ by $f$ is defined} if the closed subscheme $f^{-1}(D) \subset S'$
is an effective Cartier divisor. In this case we denote it either
$f^*D$ or $f^{-1}(D)$ and we call it the
{\it pullback of the effective Cartier divisor}.
\end{definition}

\noindent
The condition that $f^{-1}(D)$ is an effective Cartier divisor
is often satisfied in practice. Here is an example lemma.

\begin{lemma}
\label{lemma-pullback-effective-Cartier-defined}
Let $f : X \to Y$ be a morphism of schemes.
Let $D \subset Y$ be an effective Cartier divisor.
The pullback of $D$ by $f$ is defined in each of the following cases:
\begin{enumerate}
\item $f(x) \not \in D$ for any weakly associated point $x$ of $X$,
\item $X$, $Y$ integral and $f$ dominant,
\item $X$ reduced and $f(\xi) \not \in D$ for any generic point $\xi$ of any
irreducible component of $X$,
\item $X$ is locally Noetherian and $f(x) \not \in D$ for any associated point
$x$ of $X$,
\item $X$ is locally Noetherian, has no embedded points, and
$f(\xi) \not \in D$ for any generic point $\xi$ of an irreducible component of
$X$,
\item $f$ is flat, and
\item add more here as needed.
\end{enumerate}
\end{lemma}

\begin{proof}
The question is local on $X$, and hence we reduce to the case
where $X = \Spec(A)$, $Y = \Spec(R)$, $f$ is
given by $\varphi : R \to A$ and
$D = \Spec(R/(t))$ where $t \in R$ is a nonzerodivisor.
The goal in each case is to show that $\varphi(t) \in A$
is a nonzerodivisor.

\medskip\noindent
In case (1) this follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass-zero-divisors}.
Case (4) is a special case of (1) by Lemma \ref{lemma-ass-weakly-ass}.
Case (5) follows from (4) and the definitions.
Case (3) is a special case of (1) by
Lemma \ref{lemma-weakass-reduced}.
Case (2) is a special case of (3).
If $R \to A$ is flat, then $t : R \to R$ being injective
shows that $t : A \to A$ is injective. This proves (6).
\end{proof}

\begin{lemma}
\label{lemma-pullback-effective-Cartier-divisors-additive}
Let $f : S' \to S$ be a morphism of schemes.
Let $D_1$, $D_2$ be effective Cartier divisors on $S$.
If the pullbacks of $D_1$ and $D_2$ are defined then the
pullback of $D = D_1 + D_2$ is defined and
$f^*D = f^*D_1 + f^*D_2$.
\end{lemma}

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





\section{Effective Cartier divisors and invertible sheaves}
\label{section-effective-Cartier-invertible}

\noindent
Since an effective Cartier divisor has an invertible ideal sheaf
(Definition \ref{definition-effective-Cartier-divisor}) the
following definition makes sense.

\begin{definition}
\label{definition-invertible-sheaf-effective-Cartier-divisor}
Let $S$ be a scheme. Let $D \subset S$ be an effective Cartier divisor
with ideal sheaf $\mathcal{I}_D$.
\begin{enumerate}
\item The {\it invertible sheaf $\mathcal{O}_S(D)$ associated to $D$}
is defined by
$$
\mathcal{O}_S(D) =
\SheafHom_{\mathcal{O}_S}(\mathcal{I}_D, \mathcal{O}_S) =
\mathcal{I}_D^{\otimes -1}.
$$
\item The {\it canonical section}, usually denoted $1$ or $1_D$, is the
global section of $\mathcal{O}_S(D)$ corresponding to
the inclusion mapping $\mathcal{I}_D \to \mathcal{O}_S$.
\item We write
$\mathcal{O}_S(-D) = \mathcal{O}_S(D)^{\otimes -1} = \mathcal{I}_D$.
\item Given a second effective Cartier divisor $D' \subset S$ we define
$\mathcal{O}_S(D - D') =
\mathcal{O}_S(D) \otimes_{\mathcal{O}_S} \mathcal{O}_S(-D')$.
\end{enumerate}
\end{definition}

\noindent
Some comments. We will see below that the assignment
$D \mapsto \mathcal{O}_S(D)$ turns addition of effective Cartier
divisors (Definition \ref{definition-sum-effective-Cartier-divisors})
into addition in the Picard group of $S$
(Lemma \ref{lemma-invertible-sheaf-sum-effective-Cartier-divisors}).
However, the expression $D - D'$ in the definition above does not
have any geometric meaning. More precisely, we can think of the
set of effective Cartier divisors on $S$ as a commutative monoid
$\text{EffCart}(S)$ whose zero element is the empty effective Cartier divisor.
Then the assignment $(D, D') \mapsto \mathcal{O}_S(D - D')$ defines
a group homomorphism
$$
\text{EffCart}(S)^{gp} \longrightarrow \Pic(S)
$$
where the left hand side is the group completion of
$\text{EffCart}(S)$. In other words, when we write $\mathcal{O}_S(D - D')$
we may think of $D - D'$ as an element of $\text{EffCart}(S)^{gp}$.

\begin{lemma}
\label{lemma-conormal-effective-Cartier-divisor}
Let $S$ be a scheme and let $D \subset S$ be an effective Cartier divisor.
Then the conormal sheaf is $\mathcal{C}_{D/S} = \mathcal{I}_D|_D =
\mathcal{O}_S(-D)|_D$ and the normal sheaf is
$\mathcal{N}_{D/S} = \mathcal{O}_S(D)|_D$.
\end{lemma}

\begin{proof}
This follows from Morphisms, Lemma \ref{morphisms-lemma-affine-conormal}.
\end{proof}

\begin{lemma}
\label{lemma-ses-add-divisor}
Let $X$ be a scheme. Let $D, C \subset X$ be
effective Cartier divisors with $C \subset D$ and let $D' = D + C$.
Then there is a short exact sequence
$$
0 \to \mathcal{O}_X(-D)|_C \to \mathcal{O}_{D'} \to \mathcal{O}_D \to 0
$$
of $\mathcal{O}_X$-modules.
\end{lemma}

\begin{proof}
In the statement of the lemma and in the proof we use the equivalence of
Morphisms, Lemma \ref{morphisms-lemma-i-star-equivalence} to think of
quasi-coherent modules on closed subschemes of $X$
as quasi-coherent modules on $X$. Let $\mathcal{I}$ be the ideal
sheaf of $D$ in $D'$. Then there is a short exact sequence
$$
0 \to \mathcal{I} \to \mathcal{O}_{D'} \to \mathcal{O}_D \to 0
$$
because $D \to D'$ is a closed immersion. There is a
canonical surjection
$\mathcal{I} \to \mathcal{I}/\mathcal{I}^2 = \mathcal{C}_{D/D'}$.
We have $\mathcal{C}_{D/X} = \mathcal{O}_X(-D)|_D$ by
Lemma \ref{lemma-conormal-effective-Cartier-divisor}
and there is a canonical surjective map
$$
\mathcal{C}_{D/X} \longrightarrow \mathcal{C}_{D/D'}
$$
see Morphisms, Lemmas \ref{morphisms-lemma-conormal-functorial} and
\ref{morphisms-lemma-conormal-functorial-flat}.
Thus it suffices to show: (a) $\mathcal{I}^2 = 0$ and (b)
$\mathcal{I}$ is an invertible $\mathcal{O}_C$-module.
Both (a) and (b) can be checked locally, hence we may assume
$X = \Spec(A)$, $D = \Spec(A/fA)$ and $C = \Spec(A/gA)$ where
$f, g \in A$ are nonzerodivisors
(Lemma \ref{lemma-characterize-effective-Cartier-divisor}).
Since $C \subset D$ we see
that $f \in gA$. Then $I = fA/fgA$ has square zero and is invertible
as an $A/gA$-module as desired.
\end{proof}

\begin{lemma}
\label{lemma-invertible-sheaf-sum-effective-Cartier-divisors}
Let $S$ be a scheme.
Let $D_1$, $D_2$ be effective Cartier divisors on $S$.
Let $D = D_1 + D_2$.
Then there is a unique isomorphism
$$
\mathcal{O}_S(D_1) \otimes_{\mathcal{O}_S} \mathcal{O}_S(D_2)
\longrightarrow
\mathcal{O}_S(D)
$$
which maps $1_{D_1} \otimes 1_{D_2}$ to $1_D$.
\end{lemma}

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

\begin{lemma}
\label{lemma-pullback-effective-Cartier-divisors}
Let $f : S' \to S$ be a morphism of schemes.
Let $D$ be a effective Cartier divisors on $S$.
If the pullback of $D$ is defined then
$f^*\mathcal{O}_S(D) = \mathcal{O}_{S'}(f^*D)$
and the canonical section $1_D$ pulls back to
the canonical section $1_{f^*D}$.
\end{lemma}

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

\begin{definition}
\label{definition-regular-section}
Let $(X, \mathcal{O}_X)$ be a locally ringed space.
Let $\mathcal{L}$ be an invertible sheaf on $X$.
A global section $s \in \Gamma(X, \mathcal{L})$ is called a
{\it regular section} if the map $\mathcal{O}_X \to \mathcal{L}$,
$f \mapsto fs$ is injective.
\end{definition}

\begin{lemma}
\label{lemma-regular-section-structure-sheaf}
Let $X$ be a locally ringed space. Let $f \in \Gamma(X, \mathcal{O}_X)$.
The following are equivalent:
\begin{enumerate}
\item $f$ is a regular section, and
\item for any $x \in X$ the image $f \in \mathcal{O}_{X, x}$
is a nonzerodivisor.
\end{enumerate}
If $X$ is a scheme these are also equivalent to
\begin{enumerate}
\item[(3)] for any affine open $\Spec(A) = U \subset X$
the image $f \in A$ is a nonzerodivisor,
\item[(4)] there exists an affine open covering
$X = \bigcup \Spec(A_i)$ such that
the image of $f$ in $A_i$ is a nonzerodivisor for all $i$.
\end{enumerate}
\end{lemma}

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

\noindent
Note that a global section $s$ of an invertible $\mathcal{O}_X$-module
$\mathcal{L}$ may be seen as an $\mathcal{O}_X$-module map
$s : \mathcal{O}_X \to \mathcal{L}$. Its dual is therefore a
map $s : \mathcal{L}^{\otimes -1} \to \mathcal{O}_X$.
(See Modules, Definition \ref{modules-definition-powers}
for the definition of the dual invertible sheaf.)

\begin{definition}
\label{definition-zero-scheme-s}
Let $X$ be a scheme. Let $\mathcal{L}$ be an invertible sheaf.
Let $s \in \Gamma(X, \mathcal{L})$ be a global section.
The {\it zero scheme} of $s$ is the closed subscheme $Z(s) \subset X$
defined by the quasi-coherent sheaf of ideals
$\mathcal{I} \subset \mathcal{O}_X$ which is the image of the
map $s : \mathcal{L}^{\otimes -1} \to \mathcal{O}_X$.
\end{definition}

\begin{lemma}
\label{lemma-zero-scheme}
Let $X$ be a scheme.
Let $\mathcal{L}$ be an invertible sheaf.
Let $s \in \Gamma(X, \mathcal{L})$.
\begin{enumerate}
\item Consider closed immersions $i : Z \to X$ such that
$i^*s \in \Gamma(Z, i^*\mathcal{L})$ is zero
ordered by inclusion. The zero scheme $Z(s)$ is the
maximal element of this ordered set.
\item For any morphism of schemes $f : Y \to X$ we have
$f^*s = 0$ in $\Gamma(Y, f^*\mathcal{L})$ if and only if
$f$ factors through $Z(s)$.
\item The zero scheme $Z(s)$ is a locally principal closed subscheme.
\item The zero scheme $Z(s)$ is an effective Cartier divisor
if and only if $s$ is a regular section of $\mathcal{L}$.
\end{enumerate}
\end{lemma}

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

\begin{lemma}
\label{lemma-characterize-OD}
\begin{slogan}
Effective Cartier divisors on a scheme are the same as invertible sheaves
with fixed regular global section.
\end{slogan}
Let $X$ be a scheme.
\begin{enumerate}
\item If $D \subset X$ is an effective Cartier divisor, then
the canonical section $1_D$ of $\mathcal{O}_X(D)$ is regular.
\item Conversely, if $s$ is a regular section of the invertible
sheaf $\mathcal{L}$, then there exists a unique effective
Cartier divisor $D = Z(s) \subset X$ and a unique isomorphism
$\mathcal{O}_X(D) \to \mathcal{L}$ which maps $1_D$ to $s$.
\end{enumerate}
The constructions
$D \mapsto (\mathcal{O}_X(D), 1_D)$ and $(\mathcal{L}, s) \mapsto Z(s)$
give mutually inverse maps
$$
\left\{
\begin{matrix}
\text{effective Cartier divisors on }X
\end{matrix}
\right\}
\leftrightarrow
\left\{
\begin{matrix}
\text{isomorphism classes of pairs }(\mathcal{L}, s)\\
\text{consisting of an invertible }
\mathcal{O}_X\text{-module}\\
\mathcal{L}\text{ and a regular global section }s
\end{matrix}
\right\}
$$
\end{lemma}

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

\begin{remark}
\label{remark-ses-regular-section}
Let $X$ be a scheme, $\mathcal{L}$ an invertible $\mathcal{O}_X$-module,
and $s$ a regular section of $\mathcal{L}$. Then the zero scheme
$D = Z(s)$ is an effective Cartier divisor on $X$ and there are
short exact sequences
$$
0 \to \mathcal{O}_X \to \mathcal{L} \to i_*(\mathcal{L}|_D) \to 0
\quad\text{and}\quad
0 \to \mathcal{L}^{\otimes -1} \to \mathcal{O}_X \to i_*\mathcal{O}_D \to 0.
$$
Given an effective Cartier divisor $D \subset X$ using
Lemmas \ref{lemma-characterize-OD} and
\ref{lemma-conormal-effective-Cartier-divisor}
we get
$$
0 \to \mathcal{O}_X \to \mathcal{O}_X(D) \to i_*(\mathcal{N}_{D/X}) \to 0
\quad\text{and}\quad
0 \to \mathcal{O}_X(-D) \to \mathcal{O}_X \to i_*(\mathcal{O}_D) \to 0
$$
\end{remark}






\section{Effective Cartier divisors on Noetherian schemes}
\label{section-Noetherian-effective-Cartier}

\noindent
In the locally Noetherian setting most of the discussion of
effective Cartier divisors and regular sections simplifies somewhat.

\begin{lemma}
\label{lemma-regular-section-associated-points}
Let $X$ be a locally Noetherian scheme. Let $\mathcal{L}$ be an invertible
$\mathcal{O}_X$-module. Let $s \in \Gamma(X, \mathcal{L})$. Then $s$
is a regular section if and only if $s$ does not vanish in the associated
points of $X$.
\end{lemma}

\begin{proof}
Omitted. Hint: reduce to the affine case and $\mathcal{L}$ trivial
and then use Lemma \ref{lemma-regular-section-structure-sheaf} and
Algebra, Lemma \ref{algebra-lemma-ass-zero-divisors}.
\end{proof}

\begin{lemma}
\label{lemma-effective-Cartier-in-points}
Let $X$ be a locally Noetherian scheme. Let $D \subset X$ be a closed subscheme
corresponding to the quasi-coherent ideal sheaf
$\mathcal{I} \subset \mathcal{O}_X$.
\begin{enumerate}
\item If for every $x \in D$ the ideal
$\mathcal{I}_x \subset \mathcal{O}_{X, x}$
can be generated by one element, then $D$ is locally principal.
\item If for every $x \in D$ the ideal
$\mathcal{I}_x \subset \mathcal{O}_{X, x}$
can be generated by a single nonzerodivisor, then $D$ is an
effective Cartier divisor.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $\Spec(A)$ be an affine neighbourhood of a point $x \in D$.
Let $\mathfrak p \subset A$ be the prime corresponding to $x$.
Let $I \subset A$ be the ideal defining the trace of $D$ on
$\Spec(A)$. Since $A$ is Noetherian (as $X$ is locally Noetherian)
the ideal $I$ is generated by finitely many elements, say
$I = (f_1, \ldots, f_r)$. Under the assumption of (1) we have
$I_\mathfrak p = (f)$ for some $f \in A_\mathfrak p$.
Then $f_i = g_i f$ for some $g_i \in A_\mathfrak p$.
Write $g_i = a_i/h_i$ and $f = f'/h$ for some
$a_i, h_i, f', h \in A$, $h_i, h \not \in \mathfrak p$.
Then $I_{h_1 \ldots h_r h} \subset A_{h_1 \ldots h_r h}$ is
principal, because it is generated by $f'$. This proves (1).
For (2) we may assume $I = (f)$. The assumption implies
that the image of $f$ in $A_\mathfrak p$ is a nonzerodivisor.
Then $f$ is a nonzerodivisor on a neighbourhood of $x$ by
Algebra, Lemma \ref{algebra-lemma-regular-sequence-in-neighbourhood}.
This proves (2).
\end{proof}

\begin{lemma}
\label{lemma-effective-Cartier-codimension-1}
Let $X$ be a locally Noetherian scheme.
\begin{enumerate}
\item Let $D \subset X$ be a locally principal closed subscheme.
Let $\xi \in D$ be a generic point of an irreducible component of $D$.
Then $\dim(\mathcal{O}_{X, \xi}) \leq 1$.
\item Let $D \subset X$ be an effective Cartier divisor.
Let $\xi \in D$ be a generic point of an irreducible component of $D$.
Then $\dim(\mathcal{O}_{X, \xi}) = 1$.
\end{enumerate}
\end{lemma}

\begin{proof}
Proof of (1). By assumption we may assume $X = \Spec(A)$ and
$D = \Spec(A/(f))$ where $A$ is a Noetherian ring and $f \in A$.
Let $\xi$ correspond to the prime ideal $\mathfrak p \subset A$.
The assumption that $\xi$ is a generic point of an irreducible
component of $D$ signifies $\mathfrak p$ is minimal over $(f)$.
Thus $\dim(A_\mathfrak p) \leq 1$ by
Algebra, Lemma \ref{algebra-lemma-minimal-over-1}.

\medskip\noindent
Proof of (2). By part (1) we see that $\dim(\mathcal{O}_{X, \xi}) \leq 1$.
On the other hand, the local equation $f$ is a nonzerodivisor in
$A_\mathfrak p$ by Lemma \ref{lemma-characterize-effective-Cartier-divisor}
which implies the dimension is at least $1$ (because there must be a
prime in $A_\mathfrak p$ not containing $f$ by the elementary
Algebra, Lemma \ref{algebra-lemma-Zariski-topology}).
\end{proof}

\begin{lemma}
\label{lemma-integral-effective-Cartier-divisor-dvr}
Let $X$ be a Noetherian scheme. Let $D \subset X$ be an
integral closed subscheme which is also an
effective Cartier divisor. Then the local ring of $X$
at the generic point of $D$ is a discrete valuation ring.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-characterize-effective-Cartier-divisor}
we may assume $X = \Spec(A)$ and $D = \Spec(A/(f))$
where $A$ is a Noetherian ring and $f \in A$ is a nonzerodivisor.
The assumption that $D$ is integral signifies that $(f)$ is prime.
Hence the local ring of $X$ at the generic point is $A_{(f)}$
which is a Noetherian local ring whose maximal ideal is generated by
a nonzerodivisor. Thus it is a discrete valuation ring by
Algebra, Lemma \ref{algebra-lemma-characterize-dvr}.
\end{proof}

\begin{lemma}
\label{lemma-effective-Cartier-divisor-Sk}
Let $X$ be a locally Noetherian scheme. Let $D \subset X$ be an
effective Cartier divisor. If $X$ is $(S_k)$, then $D$ is $(S_{k - 1})$.
\end{lemma}

\begin{proof}
Let $x \in D$. Then $\mathcal{O}_{D, x} = \mathcal{O}_{X, x}/(f)$ where
$f \in \mathcal{O}_{X, x}$ is a nonzerodivisor. By assumption we have
$\text{depth}(\mathcal{O}_{X, x}) \geq \min(\dim(\mathcal{O}_{X, x}), k)$.
By Algebra, Lemma \ref{algebra-lemma-depth-drops-by-one} we have
$\text{depth}(\mathcal{O}_{D, x}) = \text{depth}(\mathcal{O}_{X, x}) - 1$
and by Algebra, Lemma \ref{algebra-lemma-one-equation}
$\dim(\mathcal{O}_{D, x}) = \dim(\mathcal{O}_{X, x}) - 1$.
It follows that
$\text{depth}(\mathcal{O}_{D, x}) \geq \min(\dim(\mathcal{O}_{D, x}), k - 1)$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-normal-effective-Cartier-divisor-S1}
Let $X$ be a locally Noetherian normal scheme. Let $D \subset X$ be an
effective Cartier divisor. Then $D$ is $(S_1)$.
\end{lemma}

\begin{proof}
By Properties, Lemma \ref{properties-lemma-criterion-normal}
we see that $X$ is $(S_2)$. Thus we conclude by
Lemma \ref{lemma-effective-Cartier-divisor-Sk}.
\end{proof}

\begin{lemma}
\label{lemma-weil-divisor-is-cartier-UFD}
Let $X$ be a Noetherian scheme. Let $D \subset X$ be an integral
closed subscheme. Assume that
\begin{enumerate}
\item $D$ has codimension $1$ in $X$, and
\item $\mathcal{O}_{X, x}$ is a UFD for all $x \in D$.
\end{enumerate}
Then $D$ is an effective Cartier divisor.
\end{lemma}

\begin{proof}
Let $x \in D$ and set $A = \mathcal{O}_{X, x}$. Let $\mathfrak p \subset A$
correspond to the generic point of $D$. Then $A_\mathfrak p$ has dimension
$1$ by assumption (1). Thus $\mathfrak p$ is a prime ideal of height $1$.
Since $A$ is a UFD this implies that $\mathfrak p = (f)$ for some $f \in A$.
Of course $f$ is a nonzerodivisor and we conclude by
Lemma \ref{lemma-effective-Cartier-in-points}.
\end{proof}

\begin{lemma}
\label{lemma-codim-1-part}
Let $X$ be a Noetherian scheme. Let $Z \subset X$ be a closed subscheme.
Assume there exist integral effective Cartier divisors $D_i \subset X$
and a closed subset $Z' \subset X$ of codimension $\geq 2$ such that
$Z \subset Z' \cup \bigcup D_i$ set-theoretically.
Then there exists an effective Cartier divisor of the form
$$
D = \sum a_i D_i \subset Z
$$
such that $D \to Z$ is an isomorphism away from codimension $2$ in $X$.
The existence of the $D_i$ is guaranteed if $\mathcal{O}_{X, x}$
is a UFD for all $x \in Z$ or if $X$ is regular.
\end{lemma}

\begin{proof}
Let $\xi_i \in D_i$ be the generic point and let
$\mathcal{O}_i = \mathcal{O}_{X, \xi_i}$ be the local ring
which is a discrete valuation ring by
Lemma \ref{lemma-integral-effective-Cartier-divisor-dvr}.
Let $a_i \geq 0$ be the minimal valuation of an element of
$\mathcal{I}_{Z, \xi_i} \subset \mathcal{O}_i$.
We claim that the effective Cartier divisor $D = \sum a_i D_i$ works.

\medskip\noindent
Namely, suppose that $x \in X$. Let $A = \mathcal{O}_{X, x}$.
Let $D_1, \ldots, D_n$ be the pairwise distinct divisors
$D_i$ such that $x \in D_i$.
For $1 \leq i \leq n$ let $f_i \in A$ be a local equation for $D_i$.
Then $f_i$ is a prime element of $A$ and $\mathcal{O}_i = A_{(f_i)}$. Let
$I = \mathcal{I}_{Z, x} \subset A$ be the stalk of the
ideal sheaf of $Z$. By our choice of $a_i$ we have
$I A_{(f_i)} = f_i^{a_i}A_{(f_i)}$. We claim that
$I \subset (\prod_{i = 1, \ldots, n} f_i^{a_i})$.

\medskip\noindent
Proof of the claim. The localization map
$\varphi : A/(f_i) \to A_{(f_i)}/f_iA_{(f_i)}$ is injective as
the prime ideal $(f_i)$ is the inverse image of the maximal ideal
$f_iA_{(f_i)}$. By induction on $n$ we deduce that
$\varphi_n : A/(f_i^n)\to A_{(f_i)}/f_i^nA_{(f_i)}$ is also injective.
Since $\varphi_{a_i}(I) = 0$, we have $I \subset (f_i^{a_i})$.
Thus, for any $x \in I$, we may write $x = f_1^{a_1}x_1$
for some $x_1 \in A$. Since $D_1, \ldots, D_n$ are pairwise
distinct, $f_i$ is a unit in $A_{(f_j)}$ for $i \not = j$.
Comparing $x$ and $x_1$ at $A_{(f_i)}$
for $n \geq i > 1$, we still have $x_1 \in (f_i^{a_i})$.
Repeating the previous process, we inductively write
$x_i = f_{i + 1}^{a_{i + 1}}x_{i + 1}$ for any $n > i \geq 1$.
In conclusion, $x \in (\prod_{i = 1, \ldots n} f_i^{a_i})$
for any $x \in I$ as desired.

\medskip\noindent
The claim shows that $\mathcal{I}_Z \subset \mathcal{I}_D$, i.e., that
$D \subset Z$. Moreover, we also see that $D$ and $Z$ agree at the $\xi_i$,
which proves that $D \to Z$ is an isomorphism away from codimension $2$ on $X$.

\medskip\noindent
To see the final statements we argue as follows. A regular local
ring is a UFD (More on Algebra, Lemma
\ref{more-algebra-lemma-regular-local-UFD}) hence it suffices
to argue in the UFD case. In that case, let
$D_i$ be the irreducible components of $Z$
which have codimension $1$ in $X$.
By Lemma \ref{lemma-weil-divisor-is-cartier-UFD} each $D_i$
is an effective Cartier divisor.
\end{proof}

\begin{lemma}
\label{lemma-codimension-1-is-effective-Cartier}
Let $Z \subset X$ be a closed subscheme of a Noetherian scheme. Assume
\begin{enumerate}
\item $Z$ has no embedded points,
\item every irreducible component of $Z$ has codimension $1$ in $X$,
\item every local ring $\mathcal{O}_{X, x}$, $x \in Z$ is
a UFD or $X$ is regular.
\end{enumerate}
Then $Z$ is an effective Cartier divisor.
\end{lemma}

\begin{proof}
Let $D = \sum a_i D_i$ be as in Lemma \ref{lemma-codim-1-part}
where $D_i \subset Z$ are the irreducible components of $Z$.
If $D \to Z$ is not an isomorphism, then $\mathcal{O}_Z \to \mathcal{O}_D$
has a nonzero kernel sitting in codimension $\geq 2$. This
would mean that $Z$ has embedded points, which is forbidden
by assumption (1). Hence $D \cong Z$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-UFD-one-equation-CM}
Let $R$ be a Noetherian UFD. Let $I \subset R$ be an ideal
such that $R/I$ has no embedded primes and such that
every minimal prime over $I$ has height $1$.
Then $I = (f)$ for some $f \in R$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-codimension-1-is-effective-Cartier}
the ideal sheaf $\tilde I$ is invertible on $\Spec(R)$.
By More on Algebra, Lemma \ref{more-algebra-lemma-UFD-Pic-trivial}
it is generated by a single element.
\end{proof}

\begin{lemma}
\label{lemma-effective-Cartier-divisor-is-a-sum}
Let $X$ be a Noetherian scheme. Let $D \subset X$ be an effective
Cartier divisor. Assume that there exist integral effective Cartier
divisors $D_i \subset X$ such that $D \subset \bigcup D_i$
set theoretically. Then $D = \sum a_i D_i$ for some $a_i \geq 0$.
The existence of the $D_i$ is guaranteed if $\mathcal{O}_{X, x}$
is a UFD for all $x \in D$ or if $X$ is regular.
\end{lemma}

\begin{proof}
Choose $a_i$ as in Lemma \ref{lemma-codim-1-part} and set $D' = \sum a_i D_i$.
Then $D' \to D$ is an inclusion of effective Cartier divisors which
is an isomorphism away from codimension $2$ on $X$. Pick $x \in X$.
Set $A = \mathcal{O}_{X, x}$ and let $f, f' \in A$ be the nonzerodivisor
generating the ideal of $D, D'$ in $A$. Then $f = gf'$ for some $g \in A$.
Moreover, for every prime $\mathfrak p$ of height $\leq 1$ of $A$ we see
that $g$ maps to a unit of $A_\mathfrak p$. This implies that $g$ is
a unit because the minimal primes over $(g)$ have height $1$
(Algebra, Lemma \ref{algebra-lemma-minimal-over-1}).
\end{proof}

\begin{lemma}
\label{lemma-quasi-projective-Noetherian-pic-effective-Cartier}
\begin{slogan}
On a projective scheme, every line bundle has a regular meromorphic section.
\end{slogan}
Let $X$ be a Noetherian scheme which has an ample invertible sheaf.
Then every invertible $\mathcal{O}_X$-module is isomorphic to
$$
\mathcal{O}_X(D - D') =
\mathcal{O}_X(D) \otimes_{\mathcal{O}_X} \mathcal{O}_X(D')^{\otimes -1}
$$
for some effective Cartier divisors $D, D'$ in $X$. Moreover, given a
finite subset $E \subset X$ we may choose $D, D'$ such that
$E \cap D = \emptyset$ and $E \cap D' = \emptyset$. If
$X$ is quasi-affine, then we may choose $D' = \emptyset$.
\end{lemma}

\begin{proof}
Let $x_1, \ldots, x_n$ be the associated points of $X$
(Lemma \ref{lemma-finite-ass}).

\medskip\noindent
If $X$ is quasi-affine and $\mathcal{N}$ is any invertible
$\mathcal{O}_X$-module, then we can pick a section $t$ of
$\mathcal{N}$ which does not vanish at any of the points
of $E \cup \{x_1, \ldots, x_n\}$, see Properties, Lemma
\ref{properties-lemma-quasi-affine-invertible-nonvanishing-section}.
Then $t$ is a regular section of $\mathcal{N}$ by
Lemma \ref{lemma-regular-section-associated-points}.
Hence $\mathcal{N} \cong \mathcal{O}_X(D)$ where
$D = Z(t)$ is the effective Cartier divisor corresponding to $t$, see
Lemma \ref{lemma-characterize-OD}. Since $E \cap D = \emptyset$
by construction we are done in this case.

\medskip\noindent
Returning to the general case, let $\mathcal{L}$ be an ample invertible sheaf
on $X$. There exists an $n > 0$ and a section
$s \in \Gamma(X, \mathcal{L}^{\otimes n})$ such that $X_s$
is affine and such that $E \cup \{x_1, \ldots, x_n\} \subset X_s$
(Properties, Lemma \ref{properties-lemma-ample-finite-set-in-principal-affine}).

\medskip\noindent
Let $\mathcal{N}$ be an arbitrary invertible $\mathcal{O}_X$-module.
By the quasi-affine case, we can find a section
$t \in \mathcal{N}(X_s)$ which does not vanish at any point
of $E \cup \{x_1, \ldots, x_n\}$.
By Properties, Lemma \ref{properties-lemma-invert-s-sections}
we see that for some $e \geq 0$ the section $s^e|_{X_s} t$ extends to
a global section $\tau$ of $\mathcal{L}^{\otimes e} \otimes \mathcal{N}$.
Thus both $\mathcal{L}^{\otimes e} \otimes \mathcal{N}$ and
$\mathcal{L}^{\otimes e}$ are invertible sheaves which have global sections
which do not vanish at any point of $E \cup \{x_1, \ldots, x_n\}$.
Thus these are regular sections by
Lemma \ref{lemma-regular-section-associated-points}.
Hence $\mathcal{L}^{\otimes e} \otimes \mathcal{N} \cong \mathcal{O}_X(D)$
and $\mathcal{L}^{\otimes e} \cong \mathcal{O}_X(D')$ for some
effective Cartier divisors $D$ and $D'$, see Lemma \ref{lemma-characterize-OD}.
By construction $E \cap D = \emptyset$ and $E \cap D' = \emptyset$
and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-wedge-product-ses}
Let $X$ be an integral regular scheme of dimension $2$.
Let $i : D \to X$ be the immersion of an effective Cartier divisor.
Let $\mathcal{F} \to \mathcal{F}' \to i_*\mathcal{G} \to 0$
be an exact sequence of coherent $\mathcal{O}_X$-modules.
Assume
\begin{enumerate}
\item $\mathcal{F}, \mathcal{F}'$ are locally free of rank $r$ on a nonempty
open of $X$,
\item $D$ is an integral scheme,
\item $\mathcal{G}$ is a finite locally free $\mathcal{O}_D$-module
of rank $s$.
\end{enumerate}
Then $\mathcal{L} = (\wedge^r\mathcal{F})^{**}$ and
$\mathcal{L}' = (\wedge^r \mathcal{F}')^{**}$
are invertible $\mathcal{O}_X$-modules and
$\mathcal{L}' \cong \mathcal{L}(k D)$ for some
$k \in \{0, \ldots, \min(s, r)\}$.
\end{lemma}

\begin{proof}
The first statement follows from Lemma \ref{lemma-reflexive-over-regular-dim-2}
as assumption (1) implies that $\mathcal{L}$ and $\mathcal{L}'$
have rank $1$. Taking $\wedge^r$ and double duals are functors, hence
we obtain a canonical map $\sigma : \mathcal{L} \to \mathcal{L}'$
which is an isomorphism over the nonempty open of (1), hence
nonzero. To finish the proof, it suffices to see that
$\sigma$ viewed as a global section of
$\mathcal{L}' \otimes \mathcal{L}^{\otimes -1}$ does not
vanish at any codimension point of $X$, except at the generic
point of $D$ and there with vanishing order at most $\min(s, r)$.

\medskip\noindent
Translated into algebra, we arrive at the following problem:
Let $(A, \mathfrak m, \kappa)$ be a discrete valuation ring
with fraction field $K$. Let $M \to M' \to N \to 0$ be an exact sequence
of finite $A$-modules with $\dim_K(M \otimes K) = \dim_K(M' \otimes K) = r$
and with $N \cong \kappa^{\oplus s}$. Show that the induced map
$L = \wedge^r(M)^{**} \to L' = \wedge^r(M')^{**}$ vanishes to
order at most $\min(s, r)$. We will use the structure theorem for
modules over $A$, see
More on Algebra, Lemma
\ref{more-algebra-lemma-generalized-valuation-ring-modules} or
\ref{more-algebra-lemma-modules-PID}.
Dividing out a finite $A$-module by a torsion submodule does not
change the double dual.
Thus we may replace $M$ by $M/M_{tors}$ and $M'$ by
$M'/\Im(M_{tors} \to M')$ and assume that $M$ is torsion free.
Then $M \to M'$ is injective and $M'_{tors} \to N$ is injective.
Hence we may replace $M'$ by $M'/M'_{tors}$ and $N$ by $N/M'_{tors}$.
Thus we reduce to the case where $M$ and $M'$ are free of rank $r$
and $N \cong \kappa^{\oplus s}$. In this case $\sigma$
is the determinant of $M \to M'$ and vanishes to order $s$
for example by Algebra, Lemma \ref{algebra-lemma-order-vanishing-determinant}.
\end{proof}









\section{Complements of affine opens}
\label{section-complement-affine-open}

\noindent
In this section we discuss the result that the complement of an
affine open in a variety has pure codimension $1$.

\begin{lemma}
\label{lemma-affine-punctured-spec}
Let $(A, \mathfrak m)$ be a Noetherian local ring.
The punctured spectrum $U = \Spec(A) \setminus \{\mathfrak m\}$
of $A$ is affine if and only if $\dim(A) \leq 1$.
\end{lemma}

\begin{proof}
If $\dim(A) = 0$, then $U$ is empty hence affine (equal to the spectrum of
the $0$ ring). If $\dim(A) = 1$, then we can choose an element
$f \in \mathfrak m$ not contained in any of the finite number of minimal
primes of $A$
(Algebra, Lemmas \ref{algebra-lemma-Noetherian-irreducible-components} and
\ref{algebra-lemma-silly}). Then $U = \Spec(A_f)$
is affine.

\medskip\noindent
The converse is more interesting. We will give a somewhat nonstandard proof
and discuss the standard argument in a remark below.
Assume $U = \Spec(B)$ is affine. Since affineness and dimension are not
affecting by going to the reduction we may replace $A$ by the quotient by
its ideal of nilpotent elements and assume $A$ is reduced.
Set $Q = B/A$ viewed as an $A$-module.
The support of $Q$ is $\{\mathfrak m\}$ as $A_\mathfrak p = B_\mathfrak p$
for all nonmaximal primes $\mathfrak p$ of $A$.
We may assume $\dim(A) \geq 1$, hence as above we can pick
$f \in \mathfrak m$ not contained in any of the minimal ideals of $A$.
Since $A$ is reduced this implies that $f$ is a nonzerodivisor.
In particular $\dim(A/fA) = \dim(A) - 1$, see
Algebra, Lemma \ref{algebra-lemma-one-equation}.
Applying the snake lemma to multiplication by $f$ on the short
exact sequence $0 \to A \to B \to Q \to 0$ we obtain
$$
0 \to Q[f] \to A/fA \to B/fB \to Q/fQ \to 0
$$
where $Q[f] = \Ker(f : Q \to Q)$.
This implies that $Q[f]$ is a finite $A$-module. Since the support of
$Q[f]$ is $\{\mathfrak m\}$ we see $l = \text{length}_A(Q[f]) < \infty$
(Algebra, Lemma \ref{algebra-lemma-support-point}).
Set $l_n = \text{length}_A(Q[f^n])$. The exact sequence
$$
0 \to Q[f^n] \to Q[f^{n + 1}] \xrightarrow{f^n} Q[f]
$$
shows inductively that $l_n < \infty$ and that $l_n \leq l_{n + 1}$.
Considering the exact sequence
$$
0 \to Q[f] \to Q[f^{n + 1}] \xrightarrow{f} Q[f^n] \to Q/fQ
$$
and we see that the image of $Q[f^n]$ in $Q/fQ$ has length
$l_n - l_{n + 1} + l \leq l$. Since $Q = \bigcup Q[f^n]$ we
find that the length of $Q/fQ$ is at most $l$, i.e., bounded.
Thus $Q/fQ$ is a finite $A$-module. Hence $A/fA \to B/fB$ is a
finite ring map, in particular induces a closed map on spectra
(Algebra, Lemmas \ref{algebra-lemma-integral-going-up} and
\ref{algebra-lemma-going-up-closed}).
On the other hand $\Spec(B/fB)$ is the punctured spectrum of $\Spec(A/fA)$.
This is a contradiction unless $\Spec(B/fB) = \emptyset$ which
means that $\dim(A/fA) = 0$ as desired.
\end{proof}

\begin{remark}
\label{remark-affine-punctured-spectrum-standard-proof}
If $(A, \mathfrak m)$ is a Noetherian local normal domain of
dimension $\geq 2$ and $U$
is the punctured spectrum of $A$, then $\Gamma(U, \mathcal{O}_U) = A$.
This algebraic version of Hartogs's theorem follows from the fact that
$A = \bigcap_{\text{height}(\mathfrak p) = 1} A_\mathfrak p$
we've seen in Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}.
Thus in this case $U$ cannot be affine (since it would force $\mathfrak m$
to be a point of $U$). This is often used as the starting point of
the proof of Lemma \ref{lemma-affine-punctured-spec}.
To reduce the case of a general Noetherian local ring to this case,
we first complete (to get a Nagata local ring),
then replace $A$ by $A/\mathfrak q$ for a suitable minimal prime,
and then normalize. Each of these steps does not change the
dimension and we obtain a contradiction.
You can skip the completion step, but then the normalization in
general is not a Noetherian domain. However, it is still a
Krull domain of the same dimension (this is proved using
Krull-Akizuki) and one can apply the same argument.
\end{remark}

\begin{remark}
\label{remark-affine-puctured-spectrum-general}
It is not clear how to characterize the non-Noetherian local
rings $(A, \mathfrak m)$ whose punctured spectrum is affine.
Such a ring has a finitely generated ideal $I$ with
$\mathfrak m = \sqrt{I}$. Of course if we can take $I$
generated by $1$ element, then $A$ has an affine puncture
spectrum; this gives lots of non-Noetherian examples.
Conversely, it follows from the argument in the proof of
Lemma \ref{lemma-affine-punctured-spec}
that such a ring cannot possess a nonzerodivisor $f \in \mathfrak m$
with $H^0_I(A/fA) = 0$ (so $A$ cannot have a regular sequence
of length $2$). Moreover, the same holds for any ring $A'$ which is
the target of a local homomorphism of local rings $A \to A'$ such that
$\mathfrak m_{A'} = \sqrt{\mathfrak mA'}$.
\end{remark}

\begin{lemma}
\label{lemma-complement-affine-open-immersion}
\begin{reference}
\cite[EGA IV, Corollaire 21.12.7]{EGA4}
\end{reference}
Let $X$ be a locally Noetherian scheme. Let $U \subset X$ be an open subscheme
such that the inclusion morphism $U \to X$ is affine.
For every generic point $\xi$ of an irreducible component of
$X \setminus U$ the local ring $\mathcal{O}_{X, \xi}$
has dimension $\leq 1$. If $U$ is dense or if $\xi$ is in the closure
of $U$, then $\dim(\mathcal{O}_{X, \xi}) = 1$.
\end{lemma}

\begin{proof}
Since $\xi$ is a generic point of $X \setminus U$, we see that
$$
U_\xi = U \times_X \Spec(\mathcal{O}_{X, \xi}) \subset
\Spec(\mathcal{O}_{X, \xi})
$$
is the punctured spectrum of $\mathcal{O}_{X, \xi}$ (hint: use
Schemes, Lemma \ref{schemes-lemma-specialize-points}).
As $U \to X$ is affine, we see that $U_\xi \to \Spec(\mathcal{O}_{X, \xi})$
is affine (Morphisms, Lemma \ref{morphisms-lemma-base-change-affine})
and we conclude that $U_\xi$ is affine.
Hence $\dim(\mathcal{O}_{X, \xi}) \leq 1$ by
Lemma \ref{lemma-affine-punctured-spec}.
If $\xi \in \overline{U}$, then there is a specialization
$\eta \to \xi$ where $\eta \in U$ (just take $\eta$ a generic
point of an irreducible component of $\overline{U}$ which
contains $\xi$; since $\overline{U}$ is locally Noetherian,
hence locally has finitely many irreducible components, we see that
$\eta \in U$). Then $\eta \in \Spec(\mathcal{O}_{X, \xi})$ and
we see that the dimension cannot be $0$.
\end{proof}

\begin{lemma}
\label{lemma-complement-affine-open}
Let $X$ be a separated locally Noetherian scheme. Let $U \subset X$ be an
affine open. For every generic point $\xi$ of an irreducible component of
$X \setminus U$ the local ring $\mathcal{O}_{X, \xi}$
has dimension $\leq 1$. If $U$ is dense or if $\xi$ is in the closure
of $U$, then $\dim(\mathcal{O}_{X, \xi}) = 1$.
\end{lemma}

\begin{proof}
This follows from Lemma \ref{lemma-complement-affine-open-immersion}
because the morphism $U \to X$ is affine by
Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}.
\end{proof}

\noindent
The following lemma can sometimes be used to produce effective
Cartier divisors.

\begin{lemma}
\label{lemma-complement-open-affine-effective-cartier-divisor}
Let $X$ be a Noetherian separated scheme. Let $U \subset X$ be
a dense affine open. If $\mathcal{O}_{X, x}$ is a UFD for all
$x \in X \setminus U$, then there exists an effective Cartier
divisor $D \subset X$ with $U = X \setminus D$.
\end{lemma}

\begin{proof}
Since $X$ is Noetherian, the complement $X \setminus U$ has finitely
many irreducible components $D_1, \ldots, D_r$
(Properties, Lemma \ref{properties-lemma-Noetherian-irreducible-components}
applied to the reduced induced subscheme structure on $X \setminus U$).
Each $D_i \subset X$ has codimension $1$ by
Lemma \ref{lemma-complement-affine-open}
(and Properties, Lemma \ref{properties-lemma-codimension-local-ring}).
Thus $D_i$ is an effective Cartier divisor by
Lemma \ref{lemma-weil-divisor-is-cartier-UFD}.
Hence we can take $D = D_1 + \ldots + D_r$.
\end{proof}

\begin{lemma}
\label{lemma-complement-open-affine-effective-cartier-divisor-bis}
Let $X$ be a Noetherian scheme with affine diagonal. Let $U \subset X$ be
a dense affine open. If $\mathcal{O}_{X, x}$ is a UFD for all
$x \in X \setminus U$, then there exists an effective Cartier
divisor $D \subset X$ with $U = X \setminus D$.
\end{lemma}

\begin{proof}
Since $X$ is Noetherian, the complement $X \setminus U$ has finitely
many irreducible components $D_1, \ldots, D_r$
(Properties, Lemma \ref{properties-lemma-Noetherian-irreducible-components}
applied to the reduced induced subscheme structure on $X \setminus U$).
We view $D_i$ as a reduced closed subscheme of $X$.
Let $X = \bigcup_{j \in J} X_j$ be an affine open covering of $X$. For all
$j$ in $J$, set $U_j = U \cap X_j$. Since $X$ has affine diagonal,
the scheme
$$
U_j = X \times_{(X \times X)} (U \times X_j)
$$
is affine. Therefore, as $X_j$ is separated, it follows from
Lemma \ref{lemma-complement-open-affine-effective-cartier-divisor}
and its proof that for all $j \in J$ and $1 \leq i \leq r$ the
intersection $D_i \cap X_j$ is either empty or an
effective Cartier divisor in $X_j$.
Thus $D_i \subset X$ is an effective Cartier divisor (as this is
a local property). Hence we can take $D = D_1 + \ldots + D_r$.
\end{proof}

\begin{lemma}
\label{lemma-regular-ample-family}
Let $X$ be a quasi-compact, regular scheme with affine diagonal.
Then $X$ has an ample family of invertible modules
(Morphisms, Definition
\ref{morphisms-definition-family-ample-invertible-modules}.
\end{lemma}

\begin{proof}
Observe that $X$ is a finite disjoint union of integral schemes
(Properties, Lemmas
\ref{properties-lemma-regular-normal} and
\ref{properties-lemma-normal-Noetherian}).
Thus we may assume that $X$ is integral as well as Noetherian,
regular, and having affine diagonal. Let $x \in X$.
Choose an affine open neighbourhood $U \subset X$ of $x$.
Since $X$ is integral, $U$ is dense in $X$.
By More on Algebra, Lemma \ref{more-algebra-lemma-regular-local-UFD}
the local rings of $X$ are UFDs. Hence by Lemma
\ref{lemma-complement-open-affine-effective-cartier-divisor-bis}
we can find an effective Cartier divisor $D \subset X$
whose complement is $U$. Then the canonical section
$s = 1_D$ of $\mathcal{L} = \mathcal{O}_X(D)$,
see Definition \ref{definition-invertible-sheaf-effective-Cartier-divisor},
vanishes exactly along $D$ hence $U = X_s$.
Thus both conditions in Morphisms, Definition
\ref{morphisms-definition-family-ample-invertible-modules}
hold and we are done.
\end{proof}




\section{Norms}
\label{section-norms}

\noindent
Let $\pi : X \to Y$ be a finite morphism of schemes and let $d \geq 1$
be an integer. Let us say there exists a
{\it norm of degree $d$ for $\pi$}\footnote{This is nonstandard
notation.} if there exists a multiplicative map
$$
\text{Norm}_\pi : \pi_*\mathcal{O}_X \to \mathcal{O}_Y
$$
of sheaves such that
\begin{enumerate}
\item the composition
$\mathcal{O}_Y \xrightarrow{\pi^\sharp} \pi_*\mathcal{O}_X
\xrightarrow{\text{Norm}_\pi} \mathcal{O}_Y$ equals $g \mapsto g^d$, and
\item for $V \subset Y$ open if $f \in \mathcal{O}_X(\pi^{-1}V)$
is zero at $x \in \pi^{-1}(V)$, then $\text{Norm}_\pi(f)$
is zero at $\pi(x)$.
\end{enumerate}
We observe that condition (1) forces $\pi$ to be surjective.
Since $\text{Norm}_\pi$ is multiplicative it sends units to units
hence, given $y \in Y$, if $f$ is a regular function on $X$
defined at but nonvanishing at any $x \in X$
with $\pi(x) = y$, then $\text{Norm}_\pi(f)$ is defined
and does not vanish at $y$. This holds without requiring (2);
in fact, the constructions in this section will only require condition (1)
and only certain vanishing properties (which are used in particular
in the proof of Lemma \ref{lemma-norm-ample}) will require property (2).

\begin{lemma}
\label{lemma-finite-trivialize-invertible-upstairs}
Let $\pi : X \to Y$ be a finite morphism of schemes.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $y \in Y$. There exists an open neighbourhood
$V \subset Y$ of $y$ such that $\mathcal{L}|_{\pi^{-1}(V)}$ is trivial.
\end{lemma}

\begin{proof}
Clearly we may assume $Y$ and hence $X$ affine. Since $\pi$ is finite the
fibre $\pi^{-1}(\{y\})$ over $y$ is finite.
Since $X$ is affine, we can pick $s \in \Gamma(X, \mathcal{L})$
not vanishing in any point of $\pi^{-1}(\{y\})$. This follows
from Properties, Lemma
\ref{properties-lemma-quasi-affine-invertible-nonvanishing-section}
but we also give a direct argument. Namely, we can
pick a finite set $E \subset X$ of closed points such that
every $x \in \pi^{-1}(\{y\})$ specializes to some point of $E$.
For $x \in E$ denote $i_x : x \to X$ the closed immersion.
Then
$\mathcal{L} \to \bigoplus_{x \in E} i_{x, *}i_x^*\mathcal{L}$
is a surjective map of quasi-coherent $\mathcal{O}_X$-modules,
and hence the map
$$
\Gamma(X, \mathcal{L}) \to
\bigoplus\nolimits_{x \in E} \mathcal{L}_x/\mathfrak m_x\mathcal{L}_x
$$
is surjective (as taking global sections is an exact functor on the
category of quasi-coherent $\mathcal{O}_X$-modules, see
Schemes, Lemma \ref{schemes-lemma-equivalence-quasi-coherent}).
Thus we can find an $s \in \Gamma(X, \mathcal{L})$
not vanishing at any point specializing to a point of $E$.
Then $X_s \subset X$ is an open neighbourhood of $\pi^{-1}(\{y\})$.
Since $\pi$ is finite, hence closed, we conclude that there is an
open neighbourhood $V \subset Y$ of $y$ whose inverse image
is contained in $X_s$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-norm-invertible}
Let $\pi : X \to Y$ be a finite morphism of schemes. If there exists
a norm of degree $d$ for $\pi$, then there exists a homomorphism of
abelian groups
$$
\text{Norm}_\pi : \Pic(X) \to \Pic(Y)
$$
such that $\text{Norm}_\pi(\pi^*\mathcal{N}) \cong \mathcal{N}^{\otimes d}$
for all invertible $\mathcal{O}_Y$-modules $\mathcal{N}$.
\end{lemma}

\begin{proof}
We will use the correspondence between isomorphism classes of
invertible $\mathcal{O}_X$-modules and elements of
$H^1(X, \mathcal{O}_X^*)$ given in
Cohomology, Lemma \ref{cohomology-lemma-h1-invertible}
without further mention. We explain how to take the norm of an invertible
$\mathcal{O}_X$-module $\mathcal{L}$. Namely, by
Lemma \ref{lemma-finite-trivialize-invertible-upstairs}
there exists an open covering $Y = \bigcup V_j$ such that
$\mathcal{L}|_{\pi^{-1}V_j}$ is trivial. Choose a generating section
$s_j \in \mathcal{L}(\pi^{-1}V_j)$ for each $j$.
On the overlaps $\pi^{-1}V_j \cap \pi^{-1}V_{j'}$ we can write
$$
s_j = u_{jj'} s_{j'}
$$
for a unique $u_{jj'} \in \mathcal{O}^*_X(\pi^{-1}V_j \cap \pi^{-1}V_{j'})$.
Thus we can consider the elements
$$
v_{jj'} = \text{Norm}_\pi(u_{jj'}) \in \mathcal{O}_Y^*(V_j \cap V_{j'})
$$
These elements satisfy the cocycle condition (because the
$u_{jj'}$ do and $\text{Norm}_\pi$ is multiplicative) and
therefore define an invertible $\mathcal{O}_Y$-module.
We omit the verification that: this is well defined,
additive on Picard groups, and satisfies the property
$\text{Norm}_\pi(\pi^*\mathcal{N}) \cong \mathcal{N}^{\otimes d}$
for all invertible $\mathcal{O}_Y$-modules $\mathcal{N}$.
\end{proof}

\begin{lemma}
\label{lemma-norm-map-invertible}
Let $\pi : X \to Y$ be a finite morphism of schemes. Assume there exists
a norm of degree $d$ for $\pi$. For any $\mathcal{O}_X$-linear map
$\varphi : \mathcal{L} \to \mathcal{L}'$
of invertible $\mathcal{O}_X$-modules there is an $\mathcal{O}_Y$-linear
map
$$
\text{Norm}_\pi(\varphi) :
\text{Norm}_\pi(\mathcal{L})
\longrightarrow
\text{Norm}_\pi(\mathcal{L}')
$$
with $\text{Norm}_\pi(\mathcal{L})$, $\text{Norm}_\pi(\mathcal{L}')$
as in Lemma \ref{lemma-norm-invertible}. Moreover, for
$y \in Y$ the following are equivalent
\begin{enumerate}
\item $\varphi$ is zero at a point of $x \in X$ with $\pi(x) = y$, and
\item $\text{Norm}_\pi(\varphi)$ is zero at $y$.
\end{enumerate}
\end{lemma}

\begin{proof}
We choose an open covering $Y = \bigcup V_j$ such that
$\mathcal{L}$ and $\mathcal{L}'$ are trivial over the opens $\pi^{-1}V_j$.
This is possible by
Lemma \ref{lemma-finite-trivialize-invertible-upstairs}.
Choose generating sections
$s_j$ and $s'_j$ of $\mathcal{L}$ and $\mathcal{L}'$
over the opens $\pi^{-1}V_j$. Then $\varphi(s_j) = f_js'_j$
for some $f_j \in \mathcal{O}_X(\pi^{-1}V_j)$.
Define $\text{Norm}_\pi(\varphi)$ to be multiplication
by $\text{Norm}_\pi(f_j)$ on $V_j$. An simple
calculation involving the cocycles used to construct
$\text{Norm}_\pi(\mathcal{L})$, $\text{Norm}_\pi(\mathcal{L}')$
in the proof of Lemma \ref{lemma-norm-invertible}
shows that this defines
a map as stated in the lemma. The final statement follows
from condition (2) in the definition of a norm map of degree $d$.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-norm-ample}
Let $\pi : X \to Y$ be a finite morphism of schemes. Assume $X$ has
an ample invertible sheaf and there exists a norm of degree $d$
for $\pi$. Then $Y$ has an ample invertible sheaf.
\end{lemma}

\begin{proof}
Let $\mathcal{L}$ be the ample invertible sheaf on $X$ given to us
by assumption. We will prove that $\mathcal{N} = \text{Norm}_\pi(\mathcal{L})$
is ample on $Y$.

\medskip\noindent
Since $X$ is quasi-compact (Properties, Definition
\ref{properties-definition-ample}) and $X \to Y$ surjective
(by the existence of $\text{Norm}_\pi$)
we see that $Y$ is quasi-compact.
Let $y \in Y$ be a point. To finish the proof
we will show that there exists a section $t$ of some positive tensor
power of $\mathcal{N}$ which does not vanish at $y$ such that $Y_t$
is affine. To do this, choose an affine open neighbourhood $V \subset Y$
of $y$. Choose $n \gg 0$ and a section
$s \in \Gamma(X, \mathcal{L}^{\otimes n})$
such that
$$
\pi^{-1}(\{y\}) \subset X_s \subset \pi^{-1}V
$$
by
Properties, Lemma \ref{properties-lemma-ample-finite-set-in-principal-affine}.
Then $t = \text{Norm}_\pi(s)$ is a section of $\mathcal{N}^{\otimes n}$
which does not vanish at $x$ and with $Y_t \subset V$, see
Lemma \ref{lemma-norm-map-invertible}. Then $Y_t$
is affine by Properties, Lemma \ref{properties-lemma-affine-cap-s-open}.
\end{proof}

\begin{lemma}
\label{lemma-norm-quasi-affine}
Let $\pi : X \to Y$ be a finite morphism of schemes. Assume $X$ is quasi-affine
and there exists a norm of degree $d$ for $\pi$. Then $Y$ is quasi-affine.
\end{lemma}

\begin{proof}
By Properties, Lemma \ref{properties-lemma-quasi-affine-O-ample}
we see that $\mathcal{O}_X$ is an ample invertible sheaf on $X$.
The proof of Lemma \ref{lemma-norm-ample} shows that
$\text{Norm}_\pi(\mathcal{O}_X) = \mathcal{O}_Y$
is an ample invertible $\mathcal{O}_Y$-module. Hence
Properties, Lemma \ref{properties-lemma-quasi-affine-O-ample}
shows that $Y$ is quasi-affine.
\end{proof}

\begin{lemma}
\label{lemma-finite-locally-free-has-norm}
Let $\pi : X \to Y$ be a finite locally free morphism of degree $d \geq 1$.
Then there exists a canonical norm of degree $d$ whose formation commutes
with arbitrary base change.
\end{lemma}

\begin{proof}
Let $V \subset Y$ be an affine open such that $(\pi_*\mathcal{O}_X)|_V$
is finite free of rank $d$. Choosing a basis we obtain an isomorphism
$$
\mathcal{O}_V^{\oplus d} \cong (\pi_*\mathcal{O}_X)|_V
$$
For every $f \in \pi_*\mathcal{O}_X(V) = \mathcal{O}_X(\pi^{-1}(V))$
multiplication by $f$ defines a $\mathcal{O}_V$-linear endomorphism
$m_f$ of the displayed free vector bundle. Thus we get a $d \times d$
matrix $M_f \in \text{Mat}(d \times d, \mathcal{O}_Y(V))$ and we can set
$$
\text{Norm}_\pi(f) = \det(M_f)
$$
Since the determinant of a matrix is independent of the choice of
the basis chosen we see that this is well defined which also means
that this construction will glue to a global map as desired.
Compatibility with base change is straightforward from the construction.

\medskip\noindent
Property (1) follows from the fact that the determinant of a
$d \times d$ diagonal matrix with entries $g, g, \ldots, g$ is $g^d$.
To see property (2) we may base change and assume that $Y$ is the
spectrum of a field $k$. Then $X = \Spec(A)$ with $A$ a $k$-algebra
with $\dim_k(A) = d$. If there exists an $x \in X$ such that
$f \in A$ vanishes at $x$, then there exists a map $A \to \kappa$
into a field such that $f$ maps to zero in $\kappa$. Then
$f : A \to A$ cannot be surjective, hence $\det(f : A \to A) = 0$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-norm-in-normal-case}
Let $\pi : X \to Y$ be a finite surjective morphism with $X$ and $Y$
integral and $Y$ normal. Then there exists a norm of degree
$[R(X) : R(Y)]$ for $\pi$.
\end{lemma}

\begin{proof}
Let $\Spec(B) \subset Y$ be an affine open subset and let
$\Spec(A) \subset X$ be its inverse image. Then $A$ and $B$
are domains. Let $K$ be the fraction
field of $A$ and $L$ the fraction field of $B$. Picture:
$$
\xymatrix{
L \ar[r] & K \\
B \ar[u] \ar[r] & A \ar[u]
}
$$
Since $K/L$ is a finite extension, there is a norm map
$\text{Norm}_{K/L} : K^* \to L^*$ of degree $d = [K : L]$; this is given by
mapping $f \in K$ to $\det_L(f : K \to K)$ as in the proof
of Lemma \ref{lemma-finite-locally-free-has-norm}.
Observe that the characteristic polynomial of $f : K \to K$
is a power of the minimal polynomial of $f$ over $L$;
in particular $\text{Norm}_{K/L}(f)$ is a power of the constant
coefficient of the minimal polynomial of $f$ over $L$. Hence by
Algebra, Lemma \ref{algebra-lemma-minimal-polynomial-normal-domain}
$\text{Norm}_{K/L}$ maps $A$ into $B$.
This determines a compatible system of maps
on sections over affines and hence a global norm map
$\text{Norm}_\pi$ of degree $d$.

\medskip\noindent
Property (1) is immediate from the construction.
To see property (2) let $f \in A$ be contained in the
prime ideal $\mathfrak p \subset A$. Let
$f^m + b_1 f^{m - 1} + \ldots + b_m$ be the minimal
polynomial of $f$ over $L$. By
Algebra, Lemma \ref{algebra-lemma-minimal-polynomial-normal-domain}
we have $b_i \in B$. Hence $b_0 \in B \cap \mathfrak p$.
Since $\text{Norm}_{K/L}(f) = b_0^{d/m}$ (see above)
we conclude that the norm vanishes in the image point of $\mathfrak p$.
\end{proof}

\begin{lemma}
\label{lemma-Frobenius-gives-norm-for-reduction}
Let $X$ be a Noetherian scheme. Let $p$ be a prime number such that
$p\mathcal{O}_X = 0$. Then for some $e > 0$ there exists a norm
of degree $p^e$ for $X_{red} \to X$ where $X_{red}$ is the reduction
of $X$.
\end{lemma}

\begin{proof}
Let $A$ be a Noetherian ring with $pA = 0$. Let $I \subset A$ be the
ideal of nilpotent elements. Then $I^n = 0$ for some $n$ (Algebra,
Lemma \ref{algebra-lemma-Noetherian-power}).
Pick $e$ such that $p^e \geq n$. Then
$$
A/I \longrightarrow A,\quad
f \bmod I \longmapsto f^{p^e}
$$
is well defined. This produces a norm of degree $p^e$ for
$\Spec(A/I) \to \Spec(A)$. Now if $X$ is obtained by glueing some
affine schemes $\Spec(A_i)$ then for some $e \gg 0$ these maps
glue to a norm map for $X_{red} \to X$. Details omitted.
\end{proof}

\begin{proposition}
\label{proposition-push-down-ample}
Let $\pi : X \to Y$ be a finite surjective morphism of schemes.
Assume that $X$ has an ample invertible $\mathcal{O}_X$-module. If
\begin{enumerate}
\item $\pi$ is finite locally free, or
\item $Y$ is an integral normal scheme, or
\item $Y$ is Noetherian, $p\mathcal{O}_Y = 0$, and $X = Y_{red}$,
\end{enumerate}
then $Y$ has an ample invertible $\mathcal{O}_Y$-module.
\end{proposition}

\begin{proof}
Case (1) follows from a combination of
Lemmas \ref{lemma-finite-locally-free-has-norm} and \ref{lemma-norm-ample}.
Case (3) follows from a combination of
Lemmas \ref{lemma-Frobenius-gives-norm-for-reduction} and
\ref{lemma-norm-ample}.
In case (2) we first replace $X$ by an irreducible component of $X$
which dominates $Y$ (viewed as a reduced closed subscheme of $X$).
Then we can apply Lemma \ref{lemma-norm-in-normal-case}.
\end{proof}

\begin{lemma}
\label{lemma-push-down-quasi-affine}
Let $\pi : X \to Y$ be a finite surjective morphism of schemes.
Assume that $X$ is quasi-affine. If either
\begin{enumerate}
\item $\pi$ is finite locally free, or
\item $Y$ is an integral normal scheme
\end{enumerate}
then $Y$ is quasi-affine.
\end{lemma}

\begin{proof}
Case (1) follows from a combination of Lemmas
\ref{lemma-finite-locally-free-has-norm} and \ref{lemma-norm-quasi-affine}.
In case (2) we first replace $X$ by an irreducible component of $X$
which dominates $Y$ (viewed as a reduced closed subscheme of $X$).
Then we can apply Lemma \ref{lemma-norm-in-normal-case}.
\end{proof}





\section{Relative effective Cartier divisors}
\label{section-effective-Cartier-morphisms}

\noindent
The following lemma shows that an effective Cartier divisor which is
flat over the base is really a ``family of effective Cartier divisors''
over the base. For example the restriction to any fibre is an effective
Cartier divisor.

\begin{lemma}
\label{lemma-relative-Cartier}
Let $f : X \to S$ be a morphism of schemes.
Let $D \subset X$ be a closed subscheme.
Assume
\begin{enumerate}
\item $D$ is an effective Cartier divisor, and
\item $D \to S$ is a flat morphism.
\end{enumerate}
Then for every morphism of schemes $g : S' \to S$ the pullback
$(g')^{-1}D$ is an effective Cartier divisor on $X' = S' \times_S X$
where $g' : X' \to X$ is the projection.
\end{lemma}

\begin{proof}
Using
Lemma \ref{lemma-characterize-effective-Cartier-divisor}
we translate this as follows into algebra. Let $A \to B$ be a ring
map and $h \in B$. Assume $h$ is a nonzerodivisor and that $B/hB$ is flat
over $A$. Then
$$
0 \to B \xrightarrow{h} B \to B/hB \to 0
$$
is a short exact sequence of $A$-modules with $B/hB$ flat over $A$. By
Algebra, Lemma \ref{algebra-lemma-flat-tor-zero}
this sequence remains exact on tensoring over $A$ with any module, in
particular with any $A$-algebra $A'$.
\end{proof}

\noindent
This lemma is the motivation for the following definition.

\begin{definition}
\label{definition-relative-effective-Cartier-divisor}
Let $f : X \to S$ be a morphism of schemes.
A {\it relative effective Cartier divisor} on $X/S$ is an
effective Cartier divisor $D \subset X$ such that $D \to S$
is a flat morphism of schemes.
\end{definition}

\noindent
We warn the reader that this may be nonstandard notation.
In particular, in \cite[IV, Section 21.15]{EGA} the notion of a
relative divisor is discussed only when $X \to S$ is flat and
locally of finite presentation. Our definition is a bit more general.
However, it turns out that if $x \in D$ then $X \to S$ is
flat at $x$ in many cases (but not always).

\begin{lemma}
\label{lemma-sum-relative-effective-Cartier-divisor}
Let $f : X \to S$ be a morphism of schemes. If $D_1, D_2 \subset X$
are relative effective Cartier divisor on $X/S$ then so
is $D_1 + D_2$ (Definition \ref{definition-sum-effective-Cartier-divisors}).
\end{lemma}

\begin{proof}
This translates into the following algebra fact:
Let $A \to B$ be a ring map and $h_1, h_2 \in B$.
Assume the $h_i$ are nonzerodivisors and that $B/h_iB$ is flat over $A$.
Then $h_1h_2$ is a nonzerodivisor and $B/h_1h_2B$ is flat over $A$.
The reason is that we have a short exact sequence
$$
0 \to B/h_1B \to B/h_1h_2B \to B/h_2B \to 0
$$
where the first arrow is given by multiplication by $h_2$. Since
the outer two are flat modules over $A$, so is the middle one, see
Algebra, Lemma \ref{algebra-lemma-flat-ses}.
\end{proof}

\begin{lemma}
\label{lemma-difference-relative-effective-Cartier-divisor}
Let $f : X \to S$ be a morphism of schemes. If $D_1, D_2 \subset X$
are relative effective Cartier divisor on $X/S$ and $D_1 \subset D_2$
as closed subschemes, then the effective Cartier divisor $D$
such that $D_2 = D_1 + D$
(Lemma \ref{lemma-difference-effective-Cartier-divisors}) is
a relative effective Cartier divisor on $X/S$.
\end{lemma}

\begin{proof}
This translates into the following algebra fact:
Let $A \to B$ be a ring map and $h_1, h_2 \in B$.
Assume the $h_i$ are nonzerodivisors, that $B/h_iB$ is flat over $A$, and
that $(h_2) \subset (h_1)$. Then we can write $h_2 = h h_1$
where $h \in B$ is a nonzerodivisor. We get a short exact sequence
$$
0 \to B/hB \to B/h_2B \to B/h_1B \to 0
$$
where the first arrow is given by multiplication by $h_1$. Since
the right two are flat modules over $A$, so is the middle one, see
Algebra, Lemma \ref{algebra-lemma-flat-ses}.
\end{proof}

\begin{lemma}
\label{lemma-flat-at-x}
Let $f : X \to S$ be a morphism of schemes.
Let $D \subset X$ be a relative effective Cartier divisor on $X/S$.
If $x \in D$ and $\mathcal{O}_{X, x}$ is Noetherian, then $f$ is flat at $x$.
\end{lemma}

\begin{proof}
Set $A = \mathcal{O}_{S, f(x)}$ and $B = \mathcal{O}_{X, x}$.
Let $h \in B$ be an element which generates the ideal of $D$.
Then $h$ is a nonzerodivisor in $B$ such that $B/hB$ is a flat
local $A$-algebra. Let $I \subset A$ be a finitely generated ideal.
Consider the commutative diagram
$$
\xymatrix{
0 \ar[r] &
B \ar[r]_h &
B \ar[r] &
B/hB \ar[r] & 0 \\
0 \ar[r] &
B \otimes_A I \ar[r]^h \ar[u] &
B \otimes_A I \ar[r] \ar[u] &
B/hB \otimes_A I \ar[r] \ar[u] & 0
}
$$
The lower sequence is short exact as $B/hB$ is flat over $A$, see
Algebra, Lemma \ref{algebra-lemma-flat-tor-zero}.
The right vertical arrow is injective as $B/hB$ is flat over $A$, see
Algebra, Lemma \ref{algebra-lemma-flat}.
Hence multiplication by $h$ is surjective on the kernel $K$ of
the middle vertical arrow. By Nakayama's lemma, see
Algebra, Lemma \ref{algebra-lemma-NAK}
we conclude that $K= 0$. Hence $B$ is flat over $A$, see
Algebra, Lemma \ref{algebra-lemma-flat}.
\end{proof}

\noindent
The following lemma relies on the algebraic version of
openness of the flat locus. The scheme theoretic version can be found in
More on Morphisms, Section \ref{more-morphisms-section-open-flat}.

\begin{lemma}
\label{lemma-flat-relative-Cartier-divisor}
Let $f : X \to S$ be a morphism of schemes.
Let $D \subset X$ be a relative effective Cartier divisor.
If $f$ is locally of finite presentation, then there exists
an open subscheme $U \subset X$ such that $D \subset U$ and
such that $f|_U : U \to S$ is flat.
\end{lemma}

\begin{proof}
Pick $x \in D$. It suffices to find an open neighbourhood $U \subset X$
of $x$ such that $f|_U$ is flat. Hence the lemma reduces to the case
that $X = \Spec(B)$ and $S = \Spec(A)$ are affine
and that $D$ is given by a nonzerodivisor $h \in B$. By assumption
$B$ is a finitely presented $A$-algebra and $B/hB$ is a flat
$A$-algebra. We are going to use absolute Noetherian approximation.

\medskip\noindent
Write $B = A[x_1, \ldots, x_n]/(g_1, \ldots, g_m)$. Assume
$h$ is the image of $h' \in A[x_1, \ldots, x_n]$. Choose a finite type
$\mathbf{Z}$-subalgebra $A_0 \subset A$ such that all the coefficients
of the polynomials $h', g_1, \ldots, g_m$ are in $A_0$. Then we can set
$B_0 = A_0[x_1, \ldots, x_n]/(g_1, \ldots, g_m)$ and $h_0$ the image
of $h'$ in $B_0$. Then $B = B_0 \otimes_{A_0} A$ and
$B/hB = B_0/h_0B_0 \otimes_{A_0} A$. By Algebra, Lemma
\ref{algebra-lemma-flat-finite-presentation-limit-flat}
we may, after enlarging $A_0$, assume that $B_0/h_0B_0$ is flat
over $A_0$. Let $K_0 = \Ker(h_0 : B_0 \to B_0)$.
As $B_0$ is of finite type over $\mathbf{Z}$ we see that $K_0$ is
a finitely generated ideal. Let $A_1 \subset A$ be a finite type
$\mathbf{Z}$-subalgebra containing $A_0$ and denote $B_1$, $h_1$, $K_1$
the corresponding objects over $A_1$. By
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-H1-regular}
the map $K_0 \otimes_{A_0} A_1 \to K_1$ is surjective. On the other hand,
the kernel of $h : B \to B$ is zero by assumption. Hence every element
of $K_0$ maps to zero in $K_1$ for sufficiently large subrings
$A_1 \subset A$. Since $K_0$ is finitely generated, we conclude that
$K_1 = 0$ for a suitable choice of $A_1$.

\medskip\noindent
Set $f_1 : X_1 \to S_1$ equal to $\Spec$ of the
ring map $A_1 \to B_1$. Set $D_1 = \Spec(B_1/h_1B_1)$.
Since $B = B_1 \otimes_{A_1} A$, i.e., $X = X_1 \times_{S_1} S$,
it now suffices to prove the lemma for $X_1 \to S_1$ and the relative
effective Cartier divisor $D_1$, see
Morphisms, Lemma \ref{morphisms-lemma-base-change-module-flat}.
Hence we have reduced to the case where $A$ is a Noetherian ring.
In this case we know that the ring map $A \to B$ is flat at every
prime $\mathfrak q$ of $V(h)$ by
Lemma \ref{lemma-flat-at-x}.
Combined with the fact that the flat locus is open in this case, see
Algebra, Theorem \ref{algebra-theorem-openness-flatness}
we win.
\end{proof}

\noindent
There is also the following lemma (whose idea is apparently
due to Michael Artin, see \cite{Nobile}) which needs no finiteness
assumptions at all.

\begin{lemma}
\label{lemma-michael-artin}
Let $f : X \to S$ be a morphism of schemes.
Let $D \subset X$ be a relative effective Cartier divisor on $X/S$.
If $f$ is flat at all points of $X \setminus D$, then $f$ is flat.
\end{lemma}

\begin{proof}
This translates into the following algebra fact:
Let $A \to B$ be a ring map and $h \in B$.
Assume $h$ is a nonzerodivisor, that $B/hB$ is flat over $A$, and
that the localization $B_h$ is flat over $A$. Then $B$ is flat over $A$.
The reason is that we have a short exact sequence
$$
0 \to B \to B_h \to \colim_n (1/h^n)B/B \to 0
$$
and that the second and third terms are flat over $A$, which implies
that $B$ is flat over $A$ (see
Algebra, Lemma \ref{algebra-lemma-flat-ses}). Note that a filtered
colimit of flat modules is flat (see
Algebra, Lemma \ref{algebra-lemma-colimit-flat})
and that by induction on $n$ each $(1/h^n)B/B \cong B/h^nB$ is flat over
$A$ since it fits into the short exact sequence
$$
0 \to B/h^{n - 1}B \xrightarrow{h} B/h^nB \to B/hB \to 0
$$
Some details omitted.
\end{proof}

\begin{example}
\label{example-relative-cartier-ambient-space-not-flat}
Here is an example of a relative effective Cartier divisor $D$ where the
ambient scheme is not flat in a neighbourhood of $D$. Namely, let
$A = k[t]$ and
$$
B = k[t, x, y, x^{-1}y, x^{-2}y, \ldots]/(ty, tx^{-1}y, tx^{-2}y, \ldots)
$$
Then $B$ is not flat over $A$ but $B/xB \cong A$ is flat over $A$.
Moreover $x$ is a nonzerodivisor and hence defines a relative effective
Cartier divisor in $\Spec(B)$ over $\Spec(A)$.
\end{example}

\noindent
If the ambient scheme is flat and locally of finite presentation over
the base, then we can characterize a relative effective Cartier divisor
in terms of its fibres. See also
More on Morphisms, Lemma \ref{more-morphisms-lemma-slice-given-element}
for a slightly different take on this lemma.

\begin{lemma}
\label{lemma-fibre-Cartier}
Let $\varphi : X \to S$ be a flat morphism which is locally of finite
presentation. Let $Z \subset X$ be a closed subscheme.
Let $x \in Z$ with image $s \in S$.
\begin{enumerate}
\item If $Z_s \subset X_s$ is a Cartier divisor in a neighbourhood of $x$,
then there exists an open $U \subset X$ and a
relative effective Cartier divisor $D \subset U$ such that
$Z \cap U \subset D$ and $Z_s \cap U = D_s$.
\item If $Z_s \subset X_s$ is a Cartier divisor in a neighbourhood of $x$,
the morphism $Z \to X$ is of finite presentation, and $Z \to S$ is flat at
$x$, then we can choose $U$ and $D$ such that $Z \cap U = D$.
\item If $Z_s \subset X_s$ is a Cartier divisor in a neighbourhood of $x$
and $Z$ is a locally principal closed subscheme of $X$ in a neighbourhood
of $x$, then we can choose $U$ and $D$ such that $Z \cap U = D$.
\end{enumerate}
In particular, if $Z \to S$ is locally of finite presentation and flat and
all fibres $Z_s \subset X_s$ are effective Cartier divisors, then
$Z$ is a relative effective Cartier divisor. Similarly, if $Z$
is a locally principal closed subscheme of $X$ such that all fibres
$Z_s \subset X_s$ are effective Cartier divisors, then
$Z$ is a relative effective Cartier divisor.
\end{lemma}

\begin{proof}
Choose affine open neighbourhoods $\Spec(A)$ of $s$ and
$\Spec(B)$ of $x$ such that
$\varphi(\Spec(B)) \subset \Spec(A)$.
Let $\mathfrak p \subset A$ be the prime ideal corresponding to $s$.
Let $\mathfrak q \subset B$ be the prime ideal corresponding to $x$.
Let $I \subset B$ be the ideal corresponding to $Z$.
By the initial assumption of the lemma we know that
$A \to B$ is flat and of finite presentation.
The assumption in (1) means that, after shrinking $\Spec(B)$, we may
assume $I(B \otimes_A \kappa(\mathfrak p))$ is generated by a single
element which is a nonzerodivisor in $B \otimes_A \kappa(\mathfrak p)$.
Say $f \in I$ maps to this generator. We claim that after inverting
an element $g \in B$, $g \not \in \mathfrak q$ the closed subscheme
$D = V(f) \subset \Spec(B_g)$ is a relative effective Cartier
divisor.

\medskip\noindent
By
Algebra, Lemma \ref{algebra-lemma-flat-finite-presentation-limit-flat}
we can find a flat finite type ring map $A_0 \to B_0$ of Noetherian
rings, an element $f_0 \in B_0$, a ring map $A_0 \to A$ and an isomorphism
$A \otimes_{A_0} B_0 \cong B$. If $\mathfrak p_0 = A_0 \cap \mathfrak p$
then we see that
$$
B \otimes_A \kappa(\mathfrak p) =
\left(B_0 \otimes_{A_0} \kappa(\mathfrak p_0)\right)
\otimes_{\kappa(\mathfrak p_0))} \kappa(\mathfrak p)
$$
hence $f_0$ is a nonzerodivisor in $B_0 \otimes_{A_0} \kappa(\mathfrak p_0)$.
By
Algebra, Lemma \ref{algebra-lemma-grothendieck}
we see that $f_0$ is a nonzerodivisor in $(B_0)_{\mathfrak q_0}$
where $\mathfrak q_0 = B_0 \cap \mathfrak q$ and
that $(B_0/f_0B_0)_{\mathfrak q_0}$ is flat over $A_0$. Hence by
Algebra, Lemma \ref{algebra-lemma-regular-sequence-in-neighbourhood}
and
Algebra, Theorem \ref{algebra-theorem-openness-flatness}
there exists a $g_0 \in B_0$, $g_0 \not \in \mathfrak q_0$ such
that $f_0$ is a nonzerodivisor in $(B_0)_{g_0}$ and such that
$(B_0/f_0B_0)_{g_0}$ is flat over $A_0$. Hence we see that
$D_0 = V(f_0) \subset \Spec((B_0)_{g_0})$ is a relative effective
Cartier divisor. Since we know that this property is preserved under
base change, see
Lemma \ref{lemma-relative-Cartier},
we obtain the claim mentioned above with $g$ equal to the image of $g_0$
in $B$.

\medskip\noindent
At this point we have proved (1). To see (2) consider the closed
immersion $Z \to D$. The surjective ring map
$u : \mathcal{O}_{D, x} \to \mathcal{O}_{Z, x}$
is a map of flat local $\mathcal{O}_{S, s}$-algebras which
are essentially of finite presentation, and which becomes an
isomorphisms after dividing by $\mathfrak m_s$. Hence it is
an isomorphism, see
Algebra, Lemma \ref{algebra-lemma-mod-injective-general}.
It follows that $Z \to D$ is an isomorphism in a neighbourhood
of $x$, see
Algebra, Lemma \ref{algebra-lemma-local-isomorphism}.
To see (3), after possibly shrinking $U$ we may assume that
the ideal of $D$ is generated by a single nonzerodivisor $f$
and the ideal of $Z$ is generated by an element $g$. Then
$f = gh$. But $g|_{U_s}$ and $f|_{U_s}$ cut out the same
effective Cartier divisor in a neighbourhood of $x$. Hence
$h|_{X_s}$ is a unit in $\mathcal{O}_{X_s, x}$, hence $h$ is
a unit in $\mathcal{O}_{X, x}$ hence $h$ is a unit in an
open neighbourhood of $x$. I.e., $Z \cap U = D$ after shrinking $U$.

\medskip\noindent
The final statements of the lemma follow immediately from
parts (2) and (3), combined with the fact that $Z \to S$
is locally of finite presentation if and only if $Z \to X$ is
of finite presentation, see
Morphisms, Lemmas \ref{morphisms-lemma-composition-finite-presentation} and
\ref{morphisms-lemma-finite-presentation-permanence}.
\end{proof}



\section{The normal cone of an immersion}
\label{section-normal-cone}

\noindent
Let $i : Z \to X$ be a closed immersion. Let
$\mathcal{I} \subset \mathcal{O}_X$ be the corresponding quasi-coherent
sheaf of ideals. Consider the quasi-coherent sheaf of graded
$\mathcal{O}_X$-algebras
$\bigoplus_{n \geq 0} \mathcal{I}^n/\mathcal{I}^{n + 1}$.
Since the sheaves $\mathcal{I}^n/\mathcal{I}^{n + 1}$
are each annihilated by $\mathcal{I}$ this graded algebra
corresponds to a quasi-coherent sheaf of graded $\mathcal{O}_Z$-algebras
by
Morphisms, Lemma \ref{morphisms-lemma-i-star-equivalence}.
This quasi-coherent graded $\mathcal{O}_Z$-algebra is called the
{\it conormal algebra of $Z$ in $X$} and is often simply denoted
$\bigoplus_{n \geq 0} \mathcal{I}^n/\mathcal{I}^{n + 1}$
by the abuse of notation mentioned in
Morphisms, Section \ref{morphisms-section-closed-immersions-quasi-coherent}.

\medskip\noindent
Let $f : Z \to X$ be an immersion. We define the conormal algebra of $f$
as the conormal sheaf of the closed immersion
$i : Z \to X \setminus \partial Z$, where
$\partial Z = \overline{Z} \setminus Z$. It is often denoted
$\bigoplus_{n \geq 0} \mathcal{I}^n/\mathcal{I}^{n + 1}$
where $\mathcal{I}$ is the ideal sheaf
of the closed immersion $i : Z \to X \setminus \partial Z$.

\begin{definition}
\label{definition-conormal-sheaf}
Let $f : Z \to X$ be an immersion. The {\it conormal algebra
$\mathcal{C}_{Z/X, *}$ of $Z$ in $X$} or the {\it conormal algebra of $f$}
is the quasi-coherent sheaf of graded $\mathcal{O}_Z$-algebras
$\bigoplus_{n \geq 0} \mathcal{I}^n/\mathcal{I}^{n + 1}$ described above.
\end{definition}

\noindent
Thus $\mathcal{C}_{Z/X, 1} = \mathcal{C}_{Z/X}$ is the conormal sheaf
of the immersion. Also $\mathcal{C}_{Z/X, 0} = \mathcal{O}_Z$ and
$\mathcal{C}_{Z/X, n}$ is a quasi-coherent $\mathcal{O}_Z$-module
characterized by the property
\begin{equation}
\label{equation-conormal-in-degree-n}
i_*\mathcal{C}_{Z/X, n} = \mathcal{I}^n/\mathcal{I}^{n + 1}
\end{equation}
where $i : Z \to X \setminus \partial Z$ and $\mathcal{I}$ is the ideal
sheaf of $i$ as above. Finally, note that there is a canonical surjective
map
\begin{equation}
\label{equation-conormal-algebra-quotient}
\text{Sym}^*(\mathcal{C}_{Z/X}) \longrightarrow \mathcal{C}_{Z/X, *}
\end{equation}
of quasi-coherent graded $\mathcal{O}_Z$-algebras which is an isomorphism
in degrees $0$ and $1$.

\begin{lemma}
\label{lemma-affine-conormal-sheaf}
Let $i : Z \to X$ be an immersion. The conormal algebra
of $i$ has the following properties:
\begin{enumerate}
\item Let $U \subset X$ be any open such that $i(Z)$ is
a closed subset of $U$. Let $\mathcal{I} \subset \mathcal{O}_U$
be the sheaf of ideals corresponding to the closed subscheme
$i(Z) \subset U$. Then
$$
\mathcal{C}_{Z/X, *} =
i^*\left(\bigoplus\nolimits_{n \geq 0} \mathcal{I}^n\right) =
i^{-1}\left(
\bigoplus\nolimits_{n \geq 0} \mathcal{I}^n/\mathcal{I}^{n + 1}
\right)
$$
\item
For any affine open $\Spec(R) = U \subset X$
such that $Z \cap U = \Spec(R/I)$ there is a
canonical isomorphism
$\Gamma(Z \cap U, \mathcal{C}_{Z/X, *}) = \bigoplus_{n \geq 0} I^n/I^{n + 1}$.
\end{enumerate}
\end{lemma}

\begin{proof}
Mostly clear from the definitions. Note that given a ring $R$ and
an ideal $I$ of $R$ we have $I^n/I^{n + 1} = I^n \otimes_R R/I$.
Details omitted.
\end{proof}

\begin{lemma}
\label{lemma-conormal-algebra-functorial}
Let
$$
\xymatrix{
Z \ar[r]_i \ar[d]_f & X \ar[d]^g \\
Z' \ar[r]^{i'} & X'
}
$$
be a commutative diagram in the category of schemes.
Assume $i$, $i'$ immersions. There is a canonical map
of graded $\mathcal{O}_Z$-algebras
$$
f^*\mathcal{C}_{Z'/X', *}
\longrightarrow
\mathcal{C}_{Z/X, *}
$$
characterized by the following property: For every pair of affine opens
$(\Spec(R) = U \subset X, \Spec(R') = U' \subset X')$ with
$f(U) \subset U'$ such that
$Z \cap U = \Spec(R/I)$ and $Z' \cap U' = \Spec(R'/I')$
the induced map
$$
\Gamma(Z' \cap U', \mathcal{C}_{Z'/X', *}) =
\bigoplus\nolimits (I')^n/(I')^{n + 1}
\longrightarrow
\bigoplus\nolimits_{n \geq 0} I^n/I^{n + 1} =
\Gamma(Z \cap U, \mathcal{C}_{Z/X, *})
$$
is the one induced by the ring map $f^\sharp : R' \to R$ which
has the property $f^\sharp(I') \subset I$.
\end{lemma}

\begin{proof}
Let $\partial Z' = \overline{Z'} \setminus Z'$ and
$\partial Z = \overline{Z} \setminus Z$. These are closed subsets of $X'$ and
of $X$. Replacing $X'$ by $X' \setminus \partial Z'$ and $X$ by
$X \setminus \big(g^{-1}(\partial Z') \cup \partial Z\big)$ we
see that we may assume that $i$ and $i'$ are closed immersions.

\medskip\noindent
The fact that $g \circ i$ factors through $i'$ implies that
$g^*\mathcal{I}'$ maps into $\mathcal{I}$ under the canonical
map $g^*\mathcal{I}' \to \mathcal{O}_X$, see
Schemes, Lemmas
\ref{schemes-lemma-characterize-closed-subspace} and
\ref{schemes-lemma-restrict-map-to-closed}.
Hence we get an induced map of quasi-coherent sheaves
$g^*((\mathcal{I}')^n/(\mathcal{I}')^{n + 1}) \to
\mathcal{I}^n/\mathcal{I}^{n + 1}$.
Pulling back by $i$ gives
$i^*g^*((\mathcal{I}')^n/(\mathcal{I}')^{n + 1}) \to
i^*(\mathcal{I}^n/\mathcal{I}^{n + 1})$.
Note that
$i^*(\mathcal{I}^n/\mathcal{I}^{n + 1}) = \mathcal{C}_{Z/X, n}$.
On the other hand,
$i^*g^*((\mathcal{I}')^n/(\mathcal{I}')^{n + 1}) =
f^*(i')^*((\mathcal{I}')^n/(\mathcal{I}')^{n + 1}) =
f^*\mathcal{C}_{Z'/X', n}$.
This gives the desired map.

\medskip\noindent
Checking that the map is locally described as the given map
$(I')^n/(I')^{n + 1} \to I^n/I^{n + 1}$ is a matter of unwinding the
definitions and is omitted. Another observation is that given any
$x \in i(Z)$ there do exist affine open neighbourhoods $U$, $U'$
with $f(U) \subset U'$ and $Z \cap U$ as well as $U' \cap Z'$
closed such that $x \in U$. Proof omitted. Hence the requirement
of the lemma indeed characterizes the map (and could have been used
to define it).
\end{proof}

\begin{lemma}
\label{lemma-conormal-algebra-functorial-flat}
Let
$$
\xymatrix{
Z \ar[r]_i \ar[d]_f & X \ar[d]^g \\
Z' \ar[r]^{i'} & X'
}
$$
be a fibre product diagram in the category of schemes with
$i$, $i'$ immersions. Then the canonical map
$f^*\mathcal{C}_{Z'/X', *} \to \mathcal{C}_{Z/X, *}$ of
Lemma \ref{lemma-conormal-algebra-functorial}
is surjective. If $g$ is flat, then it is an isomorphism.
\end{lemma}

\begin{proof}
Let $R' \to R$ be a ring map, and $I' \subset R'$ an ideal.
Set $I = I'R$. Then $(I')^n/(I')^{n + 1} \otimes_{R'} R \to I^n/I^{n + 1}$
is surjective. If $R' \to R$ is flat, then $I^n = (I')^n \otimes_{R'} R$
and we see the map is an isomorphism.
\end{proof}

\begin{definition}
\label{definition-normal-cone}
Let $i : Z \to X$ be an immersion of schemes.
The {\it normal cone $C_ZX$} of $Z$ in $X$ is
$$
C_ZX = \underline{\Spec}_Z(\mathcal{C}_{Z/X, *})
$$
see
Constructions,
Definitions \ref{constructions-definition-cone} and
\ref{constructions-definition-abstract-cone}. The {\it normal bundle}
of $Z$ in $X$ is the vector bundle
$$
N_ZX = \underline{\Spec}_Z(\text{Sym}(\mathcal{C}_{Z/X}))
$$
see
Constructions,
Definitions \ref{constructions-definition-vector-bundle} and
\ref{constructions-definition-abstract-vector-bundle}.
\end{definition}

\noindent
Thus $C_ZX \to Z$ is a cone over $Z$ and $N_ZX \to Z$ is a vector bundle
over $Z$ (recall that in our terminology this does not imply that
the conormal sheaf is a finite locally free sheaf). Moreover, the canonical
surjection (\ref{equation-conormal-algebra-quotient}) of graded algebras
defines a canonical closed immersion
\begin{equation}
\label{equation-normal-cone-in-normal-bundle}
C_ZX \longrightarrow N_ZX
\end{equation}
of cones over $Z$.





\section{Regular ideal sheaves}
\label{section-regular-ideal-sheaves}

\noindent
In this section we generalize the notion of an effective Cartier divisor
to higher codimension. Recall that a sequence of elements
$f_1, \ldots, f_r$ of a ring $R$ is a {\it regular sequence} if for each
$i = 1, \ldots, r$ the element $f_i$ is a nonzerodivisor on
$R/(f_1, \ldots, f_{i - 1})$ and $R/(f_1, \ldots, f_r) \not = 0$, see
Algebra, Definition \ref{algebra-definition-regular-sequence}.
There are three closely related weaker conditions that we can impose.
The first is to assume that $f_1, \ldots, f_r$ is a {\it Koszul-regular
sequence}, i.e., that $H_i(K_\bullet(f_1, \ldots, f_r)) = 0$ for $i > 0$, see
More on Algebra,
Definition \ref{more-algebra-definition-koszul-regular-sequence}.
The sequence is called an {\it $H_1$-regular sequence} if
$H_1(K_\bullet(f_1, \ldots, f_r)) = 0$. Another condition we can impose
is that with $J = (f_1, \ldots, f_r)$, the map
$$
R/J[T_1, \ldots, T_r]
\longrightarrow
\bigoplus\nolimits_{n \geq 0}
J^n/J^{n + 1}
$$
which maps $T_i$ to $f_i \bmod J^2$ is an isomorphism. In this case
we say that $f_1, \ldots, f_r$ is a
{\it quasi-regular sequence}, see
Algebra, Definition \ref{algebra-definition-quasi-regular-sequence}.
Given an $R$-module $M$ there is also a notion of $M$-regular and
$M$-quasi-regular sequence.

\medskip\noindent
We can generalize this to the case of ringed spaces as follows.
Let $X$ be a ringed space and let
$f_1, \ldots, f_r \in \Gamma(X, \mathcal{O}_X)$.
We say that $f_1, \ldots, f_r$ is a {\it regular sequence} if
for each $i = 1, \ldots, r$ the map
\begin{equation}
\label{equation-map-regular}
f_i :
\mathcal{O}_X/(f_1, \ldots, f_{i - 1})
\longrightarrow
\mathcal{O}_X/(f_1, \ldots, f_{i - 1})
\end{equation}
is an injective map of sheaves. We say that $f_1, \ldots, f_r$ is a
{\it Koszul-regular sequence} if the Koszul complex
\begin{equation}
\label{equation-koszul}
K_\bullet(\mathcal{O}_X, f_\bullet),
\end{equation}
see
Modules, Definition \ref{modules-definition-koszul-complex},
is acyclic in degrees $> 0$. We say that $f_1, \ldots, f_r$ is a
{\it $H_1$-regular sequence} if the Koszul complex
$K_\bullet(\mathcal{O}_X, f_\bullet)$ is exact in degree $1$. Finally,
we say that $f_1, \ldots, f_r$ is a
{\it quasi-regular} sequence if the map
\begin{equation}
\label{equation-map-quasi-regular}
\mathcal{O}_X/\mathcal{J}[T_1, \ldots, T_r]
\longrightarrow
\bigoplus\nolimits_{d \geq 0} \mathcal{J}^d/\mathcal{J}^{d + 1}
\end{equation}
is an isomorphism of sheaves where $\mathcal{J} \subset \mathcal{O}_X$
is the sheaf of ideals generated by $f_1, \ldots, f_r$. (There is also
a notion of $\mathcal{F}$-regular and $\mathcal{F}$-quasi-regular sequence
for a given $\mathcal{O}_X$-module $\mathcal{F}$ which we will introduce
here if we ever need it.)

\begin{lemma}
\label{lemma-types-regular-sequences-implications}
Let $X$ be a ringed space.
Let $f_1, \ldots, f_r \in \Gamma(X, \mathcal{O}_X)$.
We have the following implications
$f_1, \ldots, f_r$ is a regular sequence $\Rightarrow$
$f_1, \ldots, f_r$ is a Koszul-regular sequence $\Rightarrow$
$f_1, \ldots, f_r$ is an $H_1$-regular sequence $\Rightarrow$
$f_1, \ldots, f_r$ is a quasi-regular sequence.
\end{lemma}

\begin{proof}
Since we may check exactness at stalks, a
sequence $f_1, \ldots, f_r$ is a regular sequence if and only
if the maps
$$
f_i :
\mathcal{O}_{X, x}/(f_1, \ldots, f_{i - 1})
\longrightarrow
\mathcal{O}_{X, x}/(f_1, \ldots, f_{i - 1})
$$
are injective for all $x \in X$. In other words, the image of the sequence
$f_1, \ldots, f_r$ in the ring $\mathcal{O}_{X, x}$ is a
regular sequence for all $x \in X$. The other types of regularity
can be checked stalkwise as well (details omitted).
Hence the implications follow from
More on Algebra, Lemmas
\ref{more-algebra-lemma-regular-koszul-regular},
\ref{more-algebra-lemma-koszul-regular-H1-regular}, and
\ref{more-algebra-lemma-H1-regular-quasi-regular}.
\end{proof}

\begin{definition}
\label{definition-regular-ideal-sheaf}
Let $X$ be a ringed space. Let $\mathcal{J} \subset \mathcal{O}_X$
be a sheaf of ideals.
\begin{enumerate}
\item We say $\mathcal{J}$ is {\it regular} if for every
$x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$ there exists an open
neighbourhood $x \in U \subset X$ and a regular sequence
$f_1, \ldots, f_r \in \mathcal{O}_X(U)$ such that $\mathcal{J}|_U$
is generated by $f_1, \ldots, f_r$.
\item We say $\mathcal{J}$ is {\it Koszul-regular} if for every
$x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$ there exists an open
neighbourhood $x \in U \subset X$ and a Koszul-regular sequence
$f_1, \ldots, f_r \in \mathcal{O}_X(U)$ such that $\mathcal{J}|_U$
is generated by $f_1, \ldots, f_r$.
\item We say $\mathcal{J}$ is {\it $H_1$-regular} if for every
$x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$ there exists an open
neighbourhood $x \in U \subset X$ and a $H_1$-regular sequence
$f_1, \ldots, f_r \in \mathcal{O}_X(U)$ such that $\mathcal{J}|_U$
is generated by $f_1, \ldots, f_r$.
\item We say $\mathcal{J}$ is {\it quasi-regular} if for every
$x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$ there exists an open
neighbourhood $x \in U \subset X$ and a quasi-regular sequence
$f_1, \ldots, f_r \in \mathcal{O}_X(U)$ such that $\mathcal{J}|_U$
is generated by $f_1, \ldots, f_r$.
\end{enumerate}
\end{definition}

\noindent
Many properties of this notion immediately follow from the
corresponding notions for regular and quasi-regular sequences
in rings.

\begin{lemma}
\label{lemma-regular-quasi-regular-scheme}
Let $X$ be a ringed space. Let $\mathcal{J}$ be a sheaf of ideals.
We have the following implications:
$\mathcal{J}$ is regular $\Rightarrow$
$\mathcal{J}$ is Koszul-regular $\Rightarrow$
$\mathcal{J}$ is $H_1$-regular $\Rightarrow$
$\mathcal{J}$ is quasi-regular.
\end{lemma}

\begin{proof}
The lemma immediately reduces to
Lemma \ref{lemma-types-regular-sequences-implications}.
\end{proof}

\begin{lemma}
\label{lemma-quasi-regular-ideal}
Let $X$ be a locally ringed space. Let $\mathcal{J} \subset \mathcal{O}_X$
be a sheaf of ideals. Then $\mathcal{J}$ is quasi-regular if and
only if the following conditions are satisfied:
\begin{enumerate}
\item $\mathcal{J}$ is an $\mathcal{O}_X$-module of finite type,
\item $\mathcal{J}/\mathcal{J}^2$ is a finite locally free
$\mathcal{O}_X/\mathcal{J}$-module, and
\item the canonical maps
$$
\text{Sym}^n_{\mathcal{O}_X/\mathcal{J}}(\mathcal{J}/\mathcal{J}^2)
\longrightarrow
\mathcal{J}^n/\mathcal{J}^{n + 1}
$$
are isomorphisms for all $n \geq 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that if $U \subset X$ is an open such that
$\mathcal{J}|_U$ is generated by a quasi-regular sequence
$f_1, \ldots, f_r \in \mathcal{O}_X(U)$ then $\mathcal{J}|_U$
is of finite type, $\mathcal{J}|_U/\mathcal{J}^2|_U$ is free
with basis $f_1, \ldots, f_r$, and the maps in (3) are isomorphisms
because they are coordinate free formulation of the degree $n$
part of (\ref{equation-map-quasi-regular}). Hence it is clear that
being quasi-regular implies conditions (1), (2), and (3).

\medskip\noindent
Conversely, suppose that (1), (2), and (3) hold. Pick a point
$x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$. Then there exists
a neighbourhood $U \subset X$ of $x$ such that
$\mathcal{J}|_U/\mathcal{J}^2|_U$
is free of rank $r$ over $\mathcal{O}_U/\mathcal{J}|_U$.
After possibly shrinking $U$ we may assume there exist
$f_1, \ldots, f_r \in \mathcal{J}(U)$ which map to a basis
of $\mathcal{J}|_U/\mathcal{J}^2|_U$ as an
$\mathcal{O}_U/\mathcal{J}|_U$-module.
In particular we see that the images of $f_1, \ldots, f_r$ in
$\mathcal{J}_x/\mathcal{J}^2_x$ generate. Hence by Nakayama's lemma
(Algebra, Lemma \ref{algebra-lemma-NAK})
we see that $f_1, \ldots, f_r$ generate the stalk $\mathcal{J}_x$.
Hence, since $\mathcal{J}$ is of finite type, by
Modules, Lemma \ref{modules-lemma-finite-type-surjective-on-stalk}
after shrinking $U$ we may assume that $f_1, \ldots, f_r$ generate
$\mathcal{J}$. Finally, from (3) and the isomorphism
$\mathcal{J}|_U/\mathcal{J}^2|_U = \bigoplus \mathcal{O}_U/\mathcal{J}|_U f_i$
it is clear that $f_1, \ldots, f_r \in \mathcal{O}_X(U)$
is a quasi-regular sequence.
\end{proof}

\begin{lemma}
\label{lemma-generate-regular-ideal}
Let $(X, \mathcal{O}_X)$ be a locally ringed space.
Let $\mathcal{J} \subset \mathcal{O}_X$ be a sheaf of ideals.
Let $x \in X$ and $f_1, \ldots, f_r \in \mathcal{J}_x$ whose images
give a basis for the $\kappa(x)$-vector space
$\mathcal{J}_x/\mathfrak m_x\mathcal{J}_x$.
\begin{enumerate}
\item If $\mathcal{J}$ is quasi-regular, then there exists an open
neighbourhood such that $f_1, \ldots, f_r \in \mathcal{O}_X(U)$
form a quasi-regular sequence generating $\mathcal{J}|_U$.
\item If $\mathcal{J}$ is $H_1$-regular, then there exists an open
neighbourhood such that $f_1, \ldots, f_r \in \mathcal{O}_X(U)$
form an $H_1$-regular sequence generating $\mathcal{J}|_U$.
\item If $\mathcal{J}$ is Koszul-regular, then there exists an open
neighbourhood such that $f_1, \ldots, f_r \in \mathcal{O}_X(U)$
form an Koszul-regular sequence generating $\mathcal{J}|_U$.
\end{enumerate}
\end{lemma}

\begin{proof}
First assume that $\mathcal{J}$ is quasi-regular. We may choose an
open neighbourhood $U \subset X$ of $x$ and a quasi-regular sequence
$g_1, \ldots, g_s \in \mathcal{O}_X(U)$ which generates $\mathcal{J}|_U$.
Note that this implies that $\mathcal{J}/\mathcal{J}^2$ is free of
rank $s$ over $\mathcal{O}_U/\mathcal{J}|_U$ (see
Lemma \ref{lemma-quasi-regular-ideal}
and its proof) and hence $r = s$.
We may shrink $U$ and assume $f_1, \ldots, f_r \in \mathcal{J}(U)$.
Thus we may write
$$
f_i = \sum a_{ij} g_j
$$
for some $a_{ij} \in \mathcal{O}_X(U)$. By assumption the matrix
$A = (a_{ij})$ maps to an invertible matrix over $\kappa(x)$.
Hence, after shrinking $U$ once more, we may assume that $(a_{ij})$
is invertible. Thus we see that $f_1, \ldots, f_r$ give a basis
for $(\mathcal{J}/\mathcal{J}^2)|_U$ which proves that $f_1, \ldots, f_r$
is a quasi-regular sequence over $U$.

\medskip\noindent
Note that in order to prove (2) and (3) we may, because the assumptions
of (2) and (3) are stronger than the assumption in (1), already assume that
$f_1, \ldots, f_r \in \mathcal{J}(U)$ and $f_i = \sum a_{ij}g_j$
with $(a_{ij})$ invertible as above, where now $g_1, \ldots, g_r$
is a $H_1$-regular or Koszul-regular sequence. Since the Koszul complex
on $f_1, \ldots, f_r$ is isomorphic to the Koszul complex on
$g_1, \ldots, g_r$ via the matrix $(a_{ij})$ (see
More on Algebra, Lemma \ref{more-algebra-lemma-change-basis})
we conclude that $f_1, \ldots, f_r$ is $H_1$-regular or Koszul-regular
as desired.
\end{proof}

\begin{lemma}
\label{lemma-regular-ideal-sheaf-quasi-coherent}
Any regular, Koszul-regular, $H_1$-regular, or quasi-regular sheaf
of ideals on a scheme is a finite type quasi-coherent sheaf of ideals.
\end{lemma}

\begin{proof}
This follows as such a sheaf of ideals is locally generated by
finitely many sections. And any sheaf of ideals locally generated
by sections on a scheme is quasi-coherent, see
Schemes, Lemma \ref{schemes-lemma-closed-subspace-scheme}.
\end{proof}

\begin{lemma}
\label{lemma-regular-ideal-sheaf-scheme}
Let $X$ be a scheme. Let $\mathcal{J}$ be a sheaf of ideals.
Then $\mathcal{J}$ is regular
(resp.\ Koszul-regular, $H_1$-regular, quasi-regular) if and only if
for every $x \in \text{Supp}(\mathcal{O}_X/\mathcal{J})$ there exists
an affine open neighbourhood $x \in U \subset X$, $U = \Spec(A)$
such that $\mathcal{J}|_U = \widetilde{I}$ and such that $I$
is generated by a regular (resp.\ Koszul-regular, $H_1$-regular,
quasi-regular) sequence $f_1, \ldots, f_r \in A$.
\end{lemma}

\begin{proof}
By assumption we can find an open neighbourhood $U$ of $x$ over which
$\mathcal{J}$ is generated by a
regular (resp.\ Koszul-regular, $H_1$-regular, quasi-regular)
sequence $f_1, \ldots, f_r \in \mathcal{O}_X(U)$. After shrinking
$U$ we may assume that $U$ is affine, say $U = \Spec(A)$.
Since $\mathcal{J}$ is quasi-coherent by
Lemma \ref{lemma-regular-ideal-sheaf-quasi-coherent}
we see that $\mathcal{J}|_U = \widetilde{I}$ for some ideal $I \subset A$.
Now we can use the fact that
$$
\widetilde{\ } : \text{Mod}_A \longrightarrow \QCoh(\mathcal{O}_U)
$$
is an equivalence of categories which preserves exactness. For example
the fact that the functions $f_i$ generate $\mathcal{J}$ means that
the $f_i$, seen as elements of $A$ generate $I$. The fact that
(\ref{equation-map-regular}) is injective
(resp.\ (\ref{equation-koszul}) is exact, (\ref{equation-koszul}) is exact
in degree $1$, (\ref{equation-map-quasi-regular}) is an isomorphism)
implies the corresponding property of the map
$A/(f_1, \ldots, f_{i - 1}) \to A/(f_1, \ldots, f_{i - 1})$
(resp.\ the complex $K_\bullet(A, f_1, \ldots, f_r)$, the
map $A/I[T_1, \ldots, T_r] \to \bigoplus I^n/I^{n + 1}$).
Thus $f_1, \ldots, f_r \in A$ is a regular
(resp.\ Koszul-regular, $H_1$-regular, quasi-regular)
sequence of the ring $A$.
\end{proof}

\begin{lemma}
\label{lemma-Noetherian-scheme-regular-ideal}
Let $X$ be a locally Noetherian scheme. Let $\mathcal{J} \subset \mathcal{O}_X$
be a quasi-coherent sheaf of ideals. Let $x$ be a point of the support of
$\mathcal{O}_X/\mathcal{J}$. The following are equivalent
\begin{enumerate}
\item $\mathcal{J}_x$ is generated by a regular sequence in
$\mathcal{O}_{X, x}$,
\item $\mathcal{J}_x$ is generated by a Koszul-regular sequence in
$\mathcal{O}_{X, x}$,
\item $\mathcal{J}_x$ is generated by an $H_1$-regular sequence in
$\mathcal{O}_{X, x}$,
\item $\mathcal{J}_x$ is generated by a quasi-regular sequence in
$\mathcal{O}_{X, x}$,
\item there exists an affine neighbourhood $U = \Spec(A)$ of $x$ such
that $\mathcal{J}|_U = \widetilde{I}$ and $I$ is generated by a
regular sequence in $A$, and
\item there exists an affine neighbourhood $U = \Spec(A)$ of $x$ such
that $\mathcal{J}|_U = \widetilde{I}$ and $I$ is generated by a
Koszul-regular sequence in $A$, and
\item there exists an affine neighbourhood $U = \Spec(A)$ of $x$ such
that $\mathcal{J}|_U = \widetilde{I}$ and $I$ is generated by an
$H_1$-regular sequence in $A$, and
\item there exists an affine neighbourhood $U = \Spec(A)$ of $x$ such
that $\mathcal{J}|_U = \widetilde{I}$ and $I$ is generated by a
quasi-regular sequence in $A$,
\item there exists a neighbourhood $U$ of $x$ such that $\mathcal{J}|_U$
is regular, and
\item there exists a neighbourhood $U$ of $x$ such that $\mathcal{J}|_U$
is Koszul-regular, and
\item there exists a neighbourhood $U$ of $x$ such that $\mathcal{J}|_U$
is $H_1$-regular, and
\item there exists a neighbourhood $U$ of $x$ such that $\mathcal{J}|_U$
is quasi-regular.
\end{enumerate}
In particular, on a locally Noetherian scheme the notions of
regular, Koszul-regular, $H_1$-regular, or quasi-regular ideal sheaf all agree.
\end{lemma}

\begin{proof}
It follows from
Lemma \ref{lemma-regular-ideal-sheaf-scheme}
that (5) $\Leftrightarrow$ (9), (6) $\Leftrightarrow$ (10),
(7) $\Leftrightarrow$ (11), and (8) $\Leftrightarrow$ (12).
It is clear that (5) $\Rightarrow$ (1), (6) $\Rightarrow$ (2),
(7) $\Rightarrow$ (3), and (8) $\Rightarrow$ (4).
We have (1) $\Rightarrow$ (5) by
Algebra, Lemma \ref{algebra-lemma-regular-sequence-in-neighbourhood}.
We have (9) $\Rightarrow$ (10) $\Rightarrow$ (11) $\Rightarrow$ (12) by
Lemma \ref{lemma-regular-quasi-regular-scheme}.
Finally, (4) $\Rightarrow$ (1) by
Algebra, Lemma \ref{algebra-lemma-quasi-regular-regular}.
Now all 12 statements are equivalent.
\end{proof}













\section{Regular immersions}
\label{section-regular-immersions}

\noindent
Let $i : Z \to X$ be an immersion of schemes. By definition this means
there exists an open subscheme $U \subset X$ such that
$Z$ is identified with a closed subscheme of $U$. Let
$\mathcal{I} \subset \mathcal{O}_U$ be the corresponding quasi-coherent
sheaf of ideals. Suppose $U' \subset X$ is a second such open
subscheme, and denote $\mathcal{I}' \subset \mathcal{O}_{U'}$
the corresponding quasi-coherent sheaf of ideals. Then
$\mathcal{I}|_{U \cap U'} = \mathcal{I}'|_{U \cap U'}$.
Moreover, the support of $\mathcal{O}_U/\mathcal{I}$
is $Z$ which is contained in $U \cap U'$ and is also the
support of $\mathcal{O}_{U'}/\mathcal{I}'$. Hence it follows from
Definition \ref{definition-regular-ideal-sheaf}
that $\mathcal{I}$ is a regular ideal if and only if
$\mathcal{I}'$ is a regular ideal. Similarly for being Koszul-regular,
$H_1$-regular, or quasi-regular.

\begin{definition}
\label{definition-regular-immersion}
Let $i : Z \to X$ be an immersion of schemes. Choose an open subscheme
$U \subset X$ such that $i$ identifies $Z$ with a closed
subscheme of $U$ and denote $\mathcal{I} \subset \mathcal{O}_U$
the corresponding quasi-coherent sheaf of ideals.
\begin{enumerate}
\item We say $i$ is a {\it regular immersion} if
$\mathcal{I}$ is regular.
\item We say $i$ is a {\it Koszul-regular immersion} if
$\mathcal{I}$ is Koszul-regular.
\item We say $i$ is a {\it $H_1$-regular immersion} if
$\mathcal{I}$ is $H_1$-regular.
\item We say $i$ is a {\it quasi-regular immersion} if
$\mathcal{I}$ is quasi-regular.
\end{enumerate}
\end{definition}

\noindent
The discussion above shows that this is independent of the choice
of $U$. The conditions are listed in decreasing order of strength, see
Lemma \ref{lemma-regular-quasi-regular-immersion}.
A Koszul-regular closed immersion is smooth locally a regular immersion, see
Lemma \ref{lemma-koszul-regular-smooth-locally-regular}.
In the locally Noetherian case all four notions agree, see
Lemma \ref{lemma-Noetherian-scheme-regular-ideal}.

\begin{lemma}
\label{lemma-regular-quasi-regular-immersion}
Let $i : Z \to X$ be an immersion of schemes.
We have the following implications:
$i$ is regular $\Rightarrow$
$i$ is Koszul-regular $\Rightarrow$
$i$ is $H_1$-regular $\Rightarrow$
$i$ is quasi-regular.
\end{lemma}

\begin{proof}
The lemma immediately reduces to
Lemma \ref{lemma-regular-quasi-regular-scheme}.
\end{proof}

\begin{lemma}
\label{lemma-regular-immersion-noetherian}
Let $i : Z \to X$ be an immersion of schemes.
Assume $X$ is locally Noetherian. Then
$i$ is regular $\Leftrightarrow$
$i$ is Koszul-regular $\Leftrightarrow$
$i$ is $H_1$-regular $\Leftrightarrow$
$i$ is quasi-regular.
\end{lemma}

\begin{proof}
Follows immediately from
Lemma \ref{lemma-regular-quasi-regular-immersion}
and
Lemma \ref{lemma-Noetherian-scheme-regular-ideal}.
\end{proof}

\begin{lemma}
\label{lemma-flat-base-change-regular-immersion}
Let $i : Z \to X$ be a regular (resp.\ Koszul-regular,
$H_1$-regular, quasi-regular) immersion. Let $X' \to X$ be a flat
morphism. Then the base change $i' : Z \times_X X' \to X'$
is a regular (resp.\ Koszul-regular,
$H_1$-regular, quasi-regular) immersion.
\end{lemma}

\begin{proof}
Via
Lemma \ref{lemma-regular-ideal-sheaf-scheme}
this translates into the algebraic statements in
Algebra, Lemmas \ref{algebra-lemma-flat-increases-depth} and
\ref{algebra-lemma-flat-base-change-quasi-regular}
and
More on Algebra,
Lemma \ref{more-algebra-lemma-koszul-regular-flat-base-change}.
\end{proof}

\begin{lemma}
\label{lemma-quasi-regular-immersion}
Let $i : Z \to X$ be an immersion of schemes. Then $i$ is a quasi-regular
immersion if and only if the following conditions are satisfied
\begin{enumerate}
\item $i$ is locally of finite presentation,
\item the conormal sheaf $\mathcal{C}_{Z/X}$ is finite locally free, and
\item the map (\ref{equation-conormal-algebra-quotient}) is an isomorphism.
\end{enumerate}
\end{lemma}

\begin{proof}
An open immersion is locally of finite presentation. Hence we may
replace $X$ by an open subscheme $U \subset X$ such that $i$ identifies
$Z$ with a closed subscheme of $U$, i.e., we may assume that $i$
is a closed immersion. Let $\mathcal{I} \subset \mathcal{O}_X$ be the
corresponding quasi-coherent sheaf of ideals. Recall, see
Morphisms, Lemma \ref{morphisms-lemma-closed-immersion-finite-presentation}
that $\mathcal{I}$ is of finite type if and only if $i$ is locally
of finite presentation. Hence the equivalence follows from
Lemma \ref{lemma-quasi-regular-ideal}
and unwinding the definitions.
\end{proof}

\begin{lemma}
\label{lemma-transitivity-conormal-quasi-regular}
Let $Z \to Y \to X$ be immersions of schemes. Assume that
$Z \to Y$ is $H_1$-regular. Then the canonical sequence of
Morphisms, Lemma \ref{morphisms-lemma-transitivity-conormal}
$$
0 \to i^*\mathcal{C}_{Y/X} \to
\mathcal{C}_{Z/X} \to
\mathcal{C}_{Z/Y} \to 0
$$
is exact and locally split.
\end{lemma}

\begin{proof}
Since $\mathcal{C}_{Z/Y}$ is finite locally free (see
Lemma \ref{lemma-quasi-regular-immersion}
and
Lemma \ref{lemma-regular-quasi-regular-scheme})
it suffices to prove that the sequence is exact. By what was proven in
Morphisms, Lemma \ref{morphisms-lemma-transitivity-conormal}
it suffices to show that the first map is injective.
Working affine locally this reduces to the following question:
Suppose that we have a ring $A$ and ideals $I \subset J \subset A$.
Assume that $J/I \subset A/I$ is generated by an $H_1$-regular sequence.
Does this imply that $I/I^2 \otimes_A A/J \to J/J^2$ is injective?
Note that $I/I^2 \otimes_A A/J = I/IJ$. Hence we are trying to prove
that $I \cap J^2 = IJ$. This is the result of
More on Algebra, Lemma \ref{more-algebra-lemma-conormal-sequence-H1-regular}.
\end{proof}

\noindent
A composition of quasi-regular immersions may not be quasi-regular, see
Algebra, Remark \ref{algebra-remark-join-quasi-regular-sequences}.
The other types of regular immersions are preserved under composition.

\begin{lemma}
\label{lemma-composition-regular-immersion}
Let $i : Z \to Y$ and $j : Y \to X$ be immersions of schemes.
\begin{enumerate}
\item If $i$ and $j$ are regular immersions, so is $j \circ i$.
\item If $i$ and $j$ are Koszul-regular immersions, so is $j \circ i$.
\item If $i$ and $j$ are $H_1$-regular immersions, so is $j \circ i$.
\item If $i$ is an $H_1$-regular immersion and $j$ is a quasi-regular
immersion, then $j \circ i$ is a quasi-regular immersion.
\end{enumerate}
\end{lemma}

\begin{proof}
The algebraic version of (1) is
Algebra, Lemma \ref{algebra-lemma-join-regular-sequences}.
The algebraic version of (2) is
More on Algebra, Lemma \ref{more-algebra-lemma-join-koszul-regular-sequences}.
The algebraic version of (3) is
More on Algebra, Lemma \ref{more-algebra-lemma-join-H1-regular-sequences}.
The algebraic version of (4) is
More on Algebra, Lemma \ref{more-algebra-lemma-join-quasi-regular-H1-regular}.
\end{proof}

\begin{lemma}
\label{lemma-permanence-regular-immersion}
Let $i : Z \to Y$ and $j : Y \to X$ be immersions of schemes. Assume
that the sequence
$$
0 \to i^*\mathcal{C}_{Y/X} \to
\mathcal{C}_{Z/X} \to
\mathcal{C}_{Z/Y} \to 0
$$
of
Morphisms, Lemma \ref{morphisms-lemma-transitivity-conormal}
is exact and locally split.
\begin{enumerate}
\item If $j \circ i$ is a quasi-regular immersion, so is $i$.
\item If $j \circ i$ is a $H_1$-regular immersion, so is $i$.
\item If both $j$ and $j \circ i$ are Koszul-regular immersions, so is $i$.
\end{enumerate}
\end{lemma}

\begin{proof}
After shrinking $Y$ and $X$ we may assume that $i$ and $j$ are closed
immersions. Denote $\mathcal{I} \subset \mathcal{O}_X$ the ideal sheaf
of $Y$ and $\mathcal{J} \subset \mathcal{O}_X$ the ideal sheaf of $Z$.
The conormal sequence is $0 \to \mathcal{I}/\mathcal{I}\mathcal{J}
\to \mathcal{J}/\mathcal{J}^2 \to
\mathcal{J}/(\mathcal{I} + \mathcal{J}^2) \to 0$.
Let $z \in Z$ and set $y = i(z)$, $x = j(y) = j(i(z))$.
Choose $f_1, \ldots, f_n \in \mathcal{I}_x$ which map to a basis of
$\mathcal{I}_x/\mathfrak m_z\mathcal{I}_x$. Extend this to
$f_1, \ldots, f_n, g_1, \ldots, g_m \in \mathcal{J}_x$
which map to a basis of $\mathcal{J}_x/\mathfrak m_z\mathcal{J}_x$.
This is possible as we have assumed that the sequence of conormal
sheaves is split in a neighbourhood of $z$, hence
$\mathcal{I}_x/\mathfrak m_x\mathcal{I}_x \to
\mathcal{J}_x/\mathfrak m_x\mathcal{J}_x$ is injective.

\medskip\noindent
Proof of (1). By
Lemma \ref{lemma-generate-regular-ideal}
we can find an affine open neighbourhood $U$ of $x$ such that
$f_1, \ldots, f_n, g_1, \ldots, g_m$ forms a quasi-regular sequence
generating $\mathcal{J}$. Hence by
Algebra, Lemma \ref{algebra-lemma-truncate-quasi-regular}
we see that $g_1, \ldots, g_m$ induces a quasi-regular sequence on
$Y \cap U$ cutting out $Z$.

\medskip\noindent
Proof of (2). Exactly the same as the proof of (1) except using
More on Algebra, Lemma \ref{more-algebra-lemma-truncate-H1-regular}.

\medskip\noindent
Proof of (3). By
Lemma \ref{lemma-generate-regular-ideal}
(applied twice)
we can find an affine open neighbourhood $U$ of $x$ such that
$f_1, \ldots, f_n$ forms a Koszul-regular sequence generating
$\mathcal{I}$ and $f_1, \ldots, f_n, g_1, \ldots, g_m$ forms a
Koszul-regular sequence generating $\mathcal{J}$. Hence by
More on Algebra, Lemma \ref{more-algebra-lemma-truncate-koszul-regular}
we see that $g_1, \ldots, g_m$ induces a Koszul-regular sequence on
$Y \cap U$ cutting out $Z$.
\end{proof}

\begin{lemma}
\label{lemma-extra-permanence-regular-immersion-noetherian}
Let $i : Z \to Y$ and $j : Y \to X$ be immersions of schemes.
Pick $z \in Z$ and denote $y \in Y$, $x \in X$ the corresponding points.
Assume $X$ is locally Noetherian.
The following are equivalent
\begin{enumerate}
\item $i$ is a regular immersion in a neighbourhood of $z$ and $j$
is a regular immersion in a neighbourhood of $y$,
\item $i$ and $j \circ i$ are regular immersions in a neighbourhood of $z$,
\item $j \circ i$ is a regular immersion in a neighbourhood of $z$ and the
conormal sequence
$$
0 \to i^*\mathcal{C}_{Y/X} \to
\mathcal{C}_{Z/X} \to
\mathcal{C}_{Z/Y} \to 0
$$
is split exact in a neighbourhood of $z$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X$ (and hence $Y$) is locally Noetherian all 4 types of regular
immersions agree, and moreover we may check whether a morphism is a
regular immersion on the level of local rings, see
Lemma \ref{lemma-Noetherian-scheme-regular-ideal}.
The implication (1) $\Rightarrow$ (2) is
Lemma \ref{lemma-composition-regular-immersion}.
The implication (2) $\Rightarrow$ (3) is
Lemma \ref{lemma-transitivity-conormal-quasi-regular}.
Thus it suffices to prove that (3) implies (1).

\medskip\noindent
Assume (3). Set $A = \mathcal{O}_{X, x}$. Denote $I \subset A$ the kernel
of the surjective map $\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$ and
denote $J \subset A$ the kernel
of the surjective map $\mathcal{O}_{X, x} \to \mathcal{O}_{Z, z}$.
Note that any minimal sequence of elements generating $J$ in $A$
is a quasi-regular hence regular sequence, see
Lemma \ref{lemma-generate-regular-ideal}.
By assumption the conormal sequence
$$
0 \to I/IJ \to J/J^2 \to J/(I + J^2) \to 0
$$
is split exact as a sequence of $A/J$-modules. Hence we can pick
a minimal system of generators $f_1, \ldots, f_n, g_1, \ldots, g_m$
of $J$ with $f_1, \ldots, f_n \in I$ a minimal system of generators of $I$.
As pointed out above $f_1, \ldots, f_n, g_1, \ldots, g_m$ is a regular
sequence in $A$. It follows directly from the definition of a regular
sequence that $f_1, \ldots, f_n$ is a regular sequence in $A$ and
$\overline{g}_1, \ldots, \overline{g}_m$ is a regular sequence in
$A/I$. Thus $j$ is a regular immersion at $y$ and $i$ is a regular
immersion at $z$.
\end{proof}

\begin{remark}
\label{remark-not-always-extra-permanence}
In the situation of
Lemma \ref{lemma-extra-permanence-regular-immersion-noetherian}
parts (1), (2), (3) are {\bf not} equivalent to
``$j \circ i$ and $j$ are regular immersions at $z$ and $y$''.
An example is $X = \mathbf{A}^1_k = \Spec(k[x])$,
$Y = \Spec(k[x]/(x^2))$ and $Z = \Spec(k[x]/(x))$.
\end{remark}

\begin{lemma}
\label{lemma-koszul-regular-smooth-locally-regular}
Let $i : Z \to X$ be a Koszul regular closed immersion.
Then there exists a surjective smooth morphism $X' \to X$ such
that the base change $i' : Z \times_X X' \to X'$ of $i$ is
a regular immersion.
\end{lemma}

\begin{proof}
We may assume that $X$ is affine and the ideal of $Z$ generated by
a Koszul-regular sequence by replacing $X$ by the members of a suitable
affine open covering (affine opens as in
Lemma \ref{lemma-regular-ideal-sheaf-scheme}).
The affine case is
More on Algebra,
Lemma \ref{more-algebra-lemma-Koszul-regular-flat-locally-regular}.
\end{proof}

\begin{lemma}
\label{lemma-immersion-regular-regular-immersion}
Let $i : Z \to X$ be an immersion. If $Z$ and $X$ are
regular schemes, then $i$ is a regular immersion.
\end{lemma}

\begin{proof}
Let $z \in Z$. By Lemma \ref{lemma-Noetherian-scheme-regular-ideal}
it suffices to show that the kernel of
$\mathcal{O}_{X, z} \to \mathcal{O}_{Z, z}$
is generated by a regular sequence. This follows from
Algebra, Lemmas \ref{algebra-lemma-regular-quotient-regular} and
\ref{algebra-lemma-regular-ring-CM}.
\end{proof}





\section{Relative regular immersions}
\label{section-relative-regular-immersion}

\noindent
In this section we consider the base change property for regular immersions.
The following lemma does not hold for regular immersions
or for Koszul immersions, see
Examples, Lemma \ref{examples-lemma-base-change-regular-sequence}.

\begin{lemma}
\label{lemma-relative-regular-immersion}
Let $f : X \to S$ be a morphism of schemes.
Let $i : Z \subset X$ be an immersion.
Assume
\begin{enumerate}
\item $i$ is an $H_1$-regular (resp.\ quasi-regular) immersion, and
\item $Z \to S$ is a flat morphism.
\end{enumerate}
Then for every morphism of schemes $g : S' \to S$ the base change
$Z' = S' \times_S Z \to X' = S' \times_S X$
is an $H_1$-regular (resp.\ quasi-regular) immersion.
\end{lemma}

\begin{proof}
Unwinding the definitions and using
Lemma \ref{lemma-regular-ideal-sheaf-scheme}
this translates into More on Algebra, Lemma
\ref{more-algebra-lemma-relative-regular-immersion-algebra}.
\end{proof}

\noindent
This lemma is the motivation for the following definition.

\begin{definition}
\label{definition-relative-H1-regular-immersion}
Let $f : X \to S$ be a morphism of schemes.
Let $i : Z \to X$ be an immersion.
\begin{enumerate}
\item We say $i$ is a {\it relative quasi-regular immersion}
if $Z \to S$ is flat and $i$ is a quasi-regular immersion.
\item We say $i$ is a {\it relative $H_1$-regular immersion}
if $Z \to S$ is flat and $i$ is an $H_1$-regular immersion.
\end{enumerate}
\end{definition}

\noindent
We warn the reader that this may be nonstandard notation.
Lemma \ref{lemma-relative-regular-immersion}
guarantees that relative quasi-regular (resp.\ $H_1$-regular)
immersions are preserved under any base change.
A relative $H_1$-regular immersion is a relative quasi-regular immersion, see
Lemma \ref{lemma-regular-quasi-regular-immersion}.
Please take a look at
Lemma \ref{lemma-flat-relative-H1-regular}
(or
Lemma \ref{lemma-relative-regular-immersion-flat-in-neighbourhood})
which shows that if $Z \to X$ is a relative $H_1$-regular
(or quasi-regular) immersion and the ambient scheme is (flat and)
locally of finite presentation over $S$, then $Z \to X$
is actually a regular immersion and the same remains true after
any base change.

\begin{lemma}
\label{lemma-quasi-regular-immersion-flat-at-x}
Let $f : X \to S$ be a morphism of schemes.
Let $Z \to X$ be a relative quasi-regular immersion.
If $x \in Z$ and $\mathcal{O}_{X, x}$ is Noetherian, then $f$ is flat at $x$.
\end{lemma}

\begin{proof}
Let $f_1, \ldots, f_r \in \mathcal{O}_{X, x}$ be a quasi-regular
sequence cutting out the ideal of $Z$ at $x$. By
Algebra, Lemma \ref{algebra-lemma-quasi-regular-regular}
we know that $f_1, \ldots, f_r$ is a regular sequence.
Hence $f_r$ is a nonzerodivisor on
$\mathcal{O}_{X, x}/(f_1, \ldots, f_{r - 1})$ such that the
quotient is a flat $\mathcal{O}_{S, f(x)}$-module.
By
Lemma \ref{lemma-flat-at-x}
we conclude that $\mathcal{O}_{X, x}/(f_1, \ldots, f_{r - 1})$
is a flat $\mathcal{O}_{S, f(x)}$-module.
Continuing by induction we find that $\mathcal{O}_{X, x}$
is a flat $\mathcal{O}_{S, s}$-module.
\end{proof}

\begin{lemma}
\label{lemma-relative-regular-immersion-flat-in-neighbourhood}
Let $X \to S$ be a morphism of schemes.
Let $Z \to X$ be an immersion.
Assume
\begin{enumerate}
\item $X \to S$ is flat and locally of finite presentation,
\item $Z \to X$ is a relative quasi-regular immersion.
\end{enumerate}
Then $Z \to X$ is a regular immersion and
the same remains true after any base change.
\end{lemma}

\begin{proof}
Pick $x \in Z$ with image $s \in S$. To prove this it suffices to
find an affine neighbourhood of $x$ contained in $U$ such that the
result holds on that affine open. Hence we may assume that $X$ is affine
and there exist a quasi-regular sequence
$f_1, \ldots, f_r \in \Gamma(X, \mathcal{O}_X)$
such that $Z = V(f_1, \ldots, f_r)$. By
More on Algebra, Lemma
\ref{more-algebra-lemma-relative-regular-immersion-algebra}
the sequence $f_1|_{X_s}, \ldots, f_r|_{X_s}$ is a
quasi-regular sequence in $\Gamma(X_s, \mathcal{O}_{X_s})$.
Since $X_s$ is Noetherian, this implies, possibly after shrinking
$X$ a bit, that $f_1|_{X_s}, \ldots, f_r|_{X_s}$ is a regular
sequence, see
Algebra, Lemmas \ref{algebra-lemma-quasi-regular-regular} and
\ref{algebra-lemma-regular-sequence-in-neighbourhood}.
By
Lemma \ref{lemma-fibre-Cartier}
it follows that $Z_1 = V(f_1) \subset X$ is a relative effective
Cartier divisor, again after possibly shrinking $X$ a bit.
Applying the same lemma again, but now to $Z_2 = V(f_1, f_2) \subset Z_1$
we see that $Z_2 \subset Z_1$ is a relative effective Cartier divisor.
And so on until on reaches $Z = Z_n = V(f_1, \ldots, f_n)$.
Since being a relative effective Cartier divisor is preserved under
arbitrary base change, see
Lemma \ref{lemma-relative-Cartier},
we also see that the final statement of the lemma holds.
\end{proof}

\begin{remark}
\label{remark-relative-regular-immersion-elements}
The codimension of a relative quasi-regular immersion,
if it is constant, does not change after a base change.
In fact, if we have a ring map $A \to B$ and a quasi-regular
sequence $f_1, \ldots, f_r \in B$ such that $B/(f_1, \ldots, f_r)$
is flat over $A$, then for any ring map $A \to A'$
we have a quasi-regular sequence 
$f_1 \otimes 1, \ldots, f_r \otimes 1$ in $B' = B \otimes_A A'$
by More on Algebra, Lemma
\ref{more-algebra-lemma-relative-regular-immersion-algebra}
(which was used in the proof of
Lemma \ref{lemma-relative-regular-immersion} above).
Now the proof of
Lemma \ref{lemma-relative-regular-immersion-flat-in-neighbourhood}
shows that if $A \to B$ is flat and locally of finite
presentation, then for every prime ideal $\mathfrak q' \subset B'$
the sequence
$f_1 \otimes 1, \ldots, f_r \otimes 1$ is even a
regular sequence in the local ring $B'_{\mathfrak q'}$.
\end{remark}

\begin{lemma}
\label{lemma-flat-relative-H1-regular}
Let $X \to S$ be a morphism of schemes.
Let $Z \to X$ be a relative $H_1$-regular immersion.
Assume $X \to S$ is locally of finite presentation. Then
\begin{enumerate}
\item there exists an open subscheme $U \subset X$ such that
$Z \subset U$ and such that $U \to S$ is flat, and
\item $Z \to X$ is a regular immersion and the same remains
true after any base change.
\end{enumerate}
\end{lemma}

\begin{proof}
Pick $x \in Z$. To prove (1) suffices to find an open neighbourhood
$U \subset X$ of $x$ such that $U \to S$ is flat. Hence the lemma reduces
to the case that $X = \Spec(B)$ and $S = \Spec(A)$ are affine
and that $Z$ is given by an $H_1$-regular sequence $f_1, \ldots, f_r \in B$.
By assumption $B$ is a finitely presented $A$-algebra and
$B/(f_1, \ldots, f_r)B$ is a flat $A$-algebra. We are going to use
absolute Noetherian approximation.

\medskip\noindent
Write $B = A[x_1, \ldots, x_n]/(g_1, \ldots, g_m)$. Assume
$f_i$ is the image of $f_i' \in A[x_1, \ldots, x_n]$. Choose a finite type
$\mathbf{Z}$-subalgebra $A_0 \subset A$ such that all the coefficients
of the polynomials $f_1', \ldots, f_r', g_1, \ldots, g_m$ are in $A_0$.
We set $B_0 = A_0[x_1, \ldots, x_n]/(g_1, \ldots, g_m)$ and we denote
$f_{i, 0}$ the image of $f_i'$ in $B_0$. Then $B = B_0 \otimes_{A_0} A$
and
$$
B/(f_1, \ldots, f_r) =
B_0/(f_{0, 1}, \ldots, f_{0, r}) \otimes_{A_0} A.
$$
By
Algebra, Lemma \ref{algebra-lemma-flat-finite-presentation-limit-flat}
we may, after enlarging $A_0$, assume that
$B_0/(f_{0, 1}, \ldots, f_{0, r})$ is flat over $A_0$.
It may not be the case at this point that the Koszul cohomology group
$H_1(K_\bullet(B_0, f_{0, 1}, \ldots, f_{0, r}))$ is zero.
On the other hand, as $B_0$ is Noetherian, it is a finitely
generated $B_0$-module. Let
$\xi_1, \ldots, \xi_n \in H_1(K_\bullet(B_0, f_{0, 1}, \ldots, f_{0, r}))$
be generators. Let $A_0 \subset A_1 \subset A$ be a larger finite type
$\mathbf{Z}$-subalgebra of $A$. Denote $f_{1, i}$ the image
of $f_{0, i}$ in $B_1 = B_0 \otimes_{A_0} A_1$. By
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-H1-regular}
the map
$$
H_1(K_\bullet(B_0, f_{0, 1}, \ldots, f_{0, r})) \otimes_{A_0} A_1
\longrightarrow
H_1(K_\bullet(B_1, f_{1, 1}, \ldots, f_{1, r}))
$$
is surjective. Furthermore, it is clear that the colimit (over all
choices of $A_1$ as above) of the
complexes $K_\bullet(B_1, f_{1, 1}, \ldots, f_{1, r})$ is the complex
$K_\bullet(B, f_1, \ldots, f_r)$ which is acyclic in degree $1$. Hence
$$
\colim_{A_0 \subset A_1 \subset A}
H_1(K_\bullet(B_1, f_{1, 1}, \ldots, f_{1, r}))
= 0
$$
by
Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}.
Thus we can find a choice of $A_1$ such that $\xi_1, \ldots, \xi_n$
all map to zero in $H_1(K_\bullet(B_1, f_{1, 1}, \ldots, f_{1, r}))$.
In other words, the Koszul cohomology group
$H_1(K_\bullet(B_1, f_{1, 1}, \ldots, f_{1, r}))$
is zero.

\medskip\noindent
Consider the morphism of affine schemes
$X_1 \to S_1$ equal to $\Spec$ of the
ring map $A_1 \to B_1$ and
$Z_1 = \Spec(B_1/(f_{1, 1}, \ldots, f_{1, r}))$.
Since $B = B_1 \otimes_{A_1} A$, i.e., $X = X_1 \times_{S_1} S$,
and similarly $Z = Z_1 \times_S S_1$,
it now suffices to prove (1) for $X_1 \to S_1$ and the relative
$H_1$-regular immersion $Z_1 \to X_1$, see
Morphisms, Lemma \ref{morphisms-lemma-base-change-module-flat}.
Hence we have reduced to the case where $X \to S$ is a finite type
morphism of Noetherian schemes.
In this case we know that $X \to S$ is flat at every
point of $Z$ by
Lemma \ref{lemma-quasi-regular-immersion-flat-at-x}.
Combined with the fact that the flat locus is open in this case, see
Algebra, Theorem \ref{algebra-theorem-openness-flatness}
we see that (1) holds. Part (2) then follows from an application of
Lemma \ref{lemma-relative-regular-immersion-flat-in-neighbourhood}.
\end{proof}

\noindent
If the ambient scheme is flat and locally of finite presentation over
the base, then we can characterize a relative
quasi-regular immersion in terms of its fibres.

\begin{lemma}
\label{lemma-fibre-quasi-regular}
Let $\varphi : X \to S$ be a flat morphism which is locally of finite
presentation. Let $T \subset X$ be a closed subscheme.
Let $x \in T$ with image $s \in S$.
\begin{enumerate}
\item If $T_s \subset X_s$ is a quasi-regular immersion
in a neighbourhood of $x$, then there exists an open
$U \subset X$ and a relative quasi-regular immersion
$Z \subset U$ such that $Z_s = T_s \cap U_s$ and $T \cap U \subset Z$.
\item If $T_s \subset X_s$ is a quasi-regular immersion
in a neighbourhood of $x$, the morphism $T \to X$ is of finite
presentation, and $T \to S$ is flat at $x$, then we can choose $U$ and
$Z$ as in (1) such that $T \cap U = Z$.
\item If $T_s \subset X_s$ is a quasi-regular immersion in a neighbourhood
of $x$, and $T$ is cut out by $c$ equations in a neighbourhood of $x$,
where $c = \dim_x(X_s) - \dim_x(T_s)$, then we can choose $U$ and $Z$ as in (1)
such that $T \cap U = Z$.
\end{enumerate}
In each case $Z \to U$ is a regular immersion by
Lemma \ref{lemma-relative-regular-immersion-flat-in-neighbourhood}.
In particular, if $T \to S$ is locally of finite presentation and flat and
all fibres $T_s \subset X_s$ are quasi-regular immersions, then
$T \to X$ is a relative quasi-regular immersion.
\end{lemma}

\begin{proof}
Choose affine open neighbourhoods $\Spec(A)$ of $s$ and
$\Spec(B)$ of $x$ such that
$\varphi(\Spec(B)) \subset \Spec(A)$.
Let $\mathfrak p \subset A$ be the prime ideal corresponding to $s$.
Let $\mathfrak q \subset B$ be the prime ideal corresponding to $x$.
Let $I \subset B$ be the ideal corresponding to $T$.
By the initial assumption of the lemma we know that
$A \to B$ is flat and of finite presentation.
The assumption in (1) means that, after shrinking $\Spec(B)$, we may
assume $I(B \otimes_A \kappa(\mathfrak p))$ is generated by a
quasi-regular sequence of elements. After possibly localizing $B$
at some $g \in B$, $g \not \in \mathfrak q$ we may assume there
exist $f_1, \ldots, f_r \in I$ which map to a quasi-regular
sequence in $B \otimes_A \kappa(\mathfrak p)$ which generates
$I(B \otimes_A \kappa(\mathfrak p))$. By
Algebra, Lemmas \ref{algebra-lemma-quasi-regular-regular} and
\ref{algebra-lemma-regular-sequence-in-neighbourhood}
we may assume after another localization that
$f_1, \ldots, f_r \in I$ form a regular
sequence in $B \otimes_A \kappa(\mathfrak p)$. By
Lemma \ref{lemma-fibre-Cartier}
it follows that $Z_1 = V(f_1) \subset \Spec(B)$
is a relative effective Cartier divisor, again after possibly
localizing $B$. Applying the same lemma again, but now to
$Z_2 = V(f_1, f_2) \subset Z_1$ we see that $Z_2 \subset Z_1$
is a relative effective Cartier divisor. And so on until one
reaches $Z = Z_n = V(f_1, \ldots, f_n)$. Then
$Z \to \Spec(B)$ is a regular immersion and $Z$ is
flat over $S$, in particular $Z \to \Spec(B)$ is
a relative quasi-regular immersion over $\Spec(A)$.
This proves (1).

\medskip\noindent
To see (2) consider the closed immersion $Z \to D$. The surjective
ring map $u : \mathcal{O}_{D, x} \to \mathcal{O}_{Z, x}$
is a map of flat local $\mathcal{O}_{S, s}$-algebras which
are essentially of finite presentation, and which becomes an
isomorphisms after dividing by $\mathfrak m_s$. Hence it is
an isomorphism, see
Algebra, Lemma \ref{algebra-lemma-mod-injective-general}.
It follows that $Z \to D$ is an isomorphism in a neighbourhood
of $x$, see
Algebra, Lemma \ref{algebra-lemma-local-isomorphism}.

\medskip\noindent
To see (3), after possibly shrinking $U$ we may assume that
the ideal of $Z$ is generated by a regular sequence $f_1, \ldots, f_r$
(see our construction of $Z$ above)
and the ideal of $T$ is generated by $g_1, \ldots, g_c$.
We claim that $c = r$. Namely,
\begin{align*}
\dim_x(X_s) & = \dim(\mathcal{O}_{X_s, x}) +
\text{trdeg}_{\kappa(s)}(\kappa(x)), \\
\dim_x(T_s) & = \dim(\mathcal{O}_{T_s, x}) +
\text{trdeg}_{\kappa(s)}(\kappa(x)), \\
\dim(\mathcal{O}_{X_s, x}) & = \dim(\mathcal{O}_{T_s, x}) + r
\end{align*}
the first two equalities by
Algebra, Lemma \ref{algebra-lemma-dimension-at-a-point-finite-type-field}
and the second by $r$ times applying
Algebra, Lemma \ref{algebra-lemma-one-equation}.
As $T \subset Z$ we see that
$f_i = \sum b_{ij} g_j$. But the ideals of $Z$ and $T$ cut out the same
quasi-regular closed subscheme of $X_s$ in a neighbourhood of $x$. Hence
the matrix $(b_{ij}) \bmod \mathfrak m_x$ is invertible (some details
omitted). Hence $(b_{ij})$ is invertible in an
open neighbourhood of $x$. In other words,
$T \cap U = Z$ after shrinking $U$.

\medskip\noindent
The final statements of the lemma follow immediately from
part (2), combined with the fact that $Z \to S$
is locally of finite presentation if and only if $Z \to X$ is
of finite presentation, see
Morphisms, Lemmas \ref{morphisms-lemma-composition-finite-presentation} and
\ref{morphisms-lemma-finite-presentation-permanence}.
\end{proof}

\noindent
The following lemma is an enhancement of
Morphisms, Lemma \ref{morphisms-lemma-section-smooth-morphism}.

\begin{lemma}
\label{lemma-section-smooth-regular-immersion}
Let $f : X \to S$ be a smooth morphism of schemes.
Let $\sigma : S \to X$ be a section of $f$.
Then $\sigma$ is a regular immersion.
\end{lemma}

\begin{proof}
By
Schemes, Lemma \ref{schemes-lemma-semi-diagonal}
the morphism $\sigma$ is an immersion.
After replacing $X$ by an open neighbourhood of $\sigma(S)$
we may assume that $\sigma$ is a closed immersion.
Let $T = \sigma(S)$ be the corresponding closed subscheme of $X$.
Since $T \to S$ is an isomorphism it is flat and of finite presentation.
Also a smooth morphism is flat and locally of finite presentation, see
Morphisms, Lemmas \ref{morphisms-lemma-smooth-flat} and
\ref{morphisms-lemma-smooth-locally-finite-presentation}.
Thus, according to
Lemma \ref{lemma-fibre-quasi-regular},
it suffices to show that $T_s \subset X_s$ is a quasi-regular closed
subscheme. This follows immediately from
Morphisms, Lemma \ref{morphisms-lemma-section-smooth-morphism}
but we can also see it directly as follows.
Let $k$ be a field and let $A$ be a smooth $k$-algebra.
Let $\mathfrak m \subset A$ be a maximal ideal whose residue field is $k$.
Then $\mathfrak m$ is generated by a quasi-regular sequence, possibly
after replacing $A$ by $A_g$ for some $g \in A$, $g \not \in \mathfrak m$.
In
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}
we proved that $A_{\mathfrak m}$ is a regular local ring,
hence $\mathfrak mA_{\mathfrak m}$ is generated by a regular sequence.
This does indeed imply that $\mathfrak m$ is generated by a
regular sequence (after replacing $A$ by $A_g$ for some $g \in A$,
$g \not \in \mathfrak m$), see
Algebra, Lemma \ref{algebra-lemma-regular-sequence-in-neighbourhood}.
\end{proof}

\noindent
The following lemma has a kind of converse, see
Lemma \ref{lemma-push-regular-immersion-thru-smooth}.

\begin{lemma}
\label{lemma-lift-regular-immersion-to-smooth}
Let
$$
\xymatrix{
Y \ar[rd]_j \ar[rr]_i & & X \ar[ld] \\
& S
}
$$
be a commutative diagram of morphisms of schemes.
Assume $X \to S$ smooth, and $i$, $j$ immersions.
If $j$ is a regular (resp.\ Koszul-regular, $H_1$-regular, quasi-regular)
immersion, then so is $i$.
\end{lemma}

\begin{proof}
We can write $i$ as the composition
$$
Y \to Y \times_S X \to X
$$
By
Lemma \ref{lemma-section-smooth-regular-immersion}
the first arrow is a regular immersion.
The second arrow is a flat base change of $Y \to S$, hence is a
regular (resp.\ Koszul-regular, $H_1$-regular, quasi-regular) immersion, see
Lemma \ref{lemma-flat-base-change-regular-immersion}.
We conclude by an application of
Lemma \ref{lemma-composition-regular-immersion}.
\end{proof}

\begin{lemma}
\label{lemma-immersion-lci-into-smooth-regular-immersion}
Let
$$
\xymatrix{
Y \ar[rd] \ar[rr]_i & & X \ar[ld] \\
& S
}
$$
be a commutative diagram of morphisms of schemes.
Assume that $Y \to S$ is syntomic, $X \to S$ smooth, and
$i$ an immersion. Then $i$ is a regular immersion.
\end{lemma}

\begin{proof}
After replacing $X$ by an open neighbourhood of $i(Y)$
we may assume that $i$ is a closed immersion.
Let $T = i(Y)$ be the corresponding closed subscheme of $X$. Since
$T \cong Y$ the morphism $T \to S$ is flat and of finite presentation
(Morphisms, Lemmas
\ref{morphisms-lemma-syntomic-locally-finite-presentation} and
\ref{morphisms-lemma-syntomic-flat}).
Also a smooth morphism is flat and locally of finite presentation
(Morphisms, Lemmas
\ref{morphisms-lemma-smooth-flat} and
\ref{morphisms-lemma-smooth-locally-finite-presentation}).
Thus, according to
Lemma \ref{lemma-fibre-quasi-regular},
it suffices to show that $T_s \subset X_s$ is a quasi-regular closed
subscheme. As $X_s$ is locally of finite type over a field, it is Noetherian
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}).
Thus we can check that $T_s \subset X_s$ is a quasi-regular immersion
at points, see
Lemma \ref{lemma-Noetherian-scheme-regular-ideal}.
Take $t \in T_s$. By
Morphisms, Lemma \ref{morphisms-lemma-local-complete-intersection}
the local ring $\mathcal{O}_{T_s, t}$ is a local complete intersection
over $\kappa(s)$.
The local ring $\mathcal{O}_{X_s, t}$ is regular, see
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}.
By
Algebra, Lemma \ref{algebra-lemma-lci-local}
we see that the kernel of the surjection
$\mathcal{O}_{X_s, t} \to \mathcal{O}_{T_s, t}$ is generated by a regular
sequence, which is what we had to show.
\end{proof}

\begin{lemma}
\label{lemma-immersion-smooth-into-smooth-regular-immersion}
Let
$$
\xymatrix{
Y \ar[rd] \ar[rr]_i & & X \ar[ld] \\
& S
}
$$
be a commutative diagram of morphisms of schemes.
Assume that $Y \to S$ is smooth, $X \to S$ smooth, and
$i$ an immersion. Then $i$ is a regular immersion.
\end{lemma}

\begin{proof}
This is a special case of
Lemma \ref{lemma-immersion-lci-into-smooth-regular-immersion}
because a smooth morphism is syntomic, see
Morphisms, Lemma \ref{morphisms-lemma-smooth-syntomic}.
\end{proof}

\begin{lemma}
\label{lemma-push-regular-immersion-thru-smooth}
Let
$$
\xymatrix{
Y \ar[rd]_j \ar[rr]_i & & X \ar[ld] \\
& S
}
$$
be a commutative diagram of morphisms of schemes.
Assume $X \to S$ smooth, and $i$, $j$ immersions.
If $i$ is a Koszul-regular (resp.\ $H_1$-regular, quasi-regular)
immersion, then so is $j$.
\end{lemma}

\begin{proof}
Let $y \in Y$ be any point. Set $x = i(y)$ and set $s = j(y)$.
It suffices to prove the result after replacing $X, S$ by open
neighbourhoods $U, V$ of $x, s$ and $Y$ by an open neighbourhood
of $y$ in $i^{-1}(U) \cap j^{-1}(V)$. Hence we may assume that
$Y$, $X$ and $S$ are affine. In this case we can choose a closed
immersion $h : X \to \mathbf{A}^n_S$ over $S$ for some $n$. Note that
$h$ is a regular immersion by
Lemma \ref{lemma-immersion-smooth-into-smooth-regular-immersion}.
Hence $h \circ i$ is a Koszul-regular (resp.\ $H_1$-regular, quasi-regular)
immersion, see
Lemmas \ref{lemma-composition-regular-immersion} and
\ref{lemma-regular-quasi-regular-immersion}.
In this way we reduce to the case $X = \mathbf{A}^n_S$ and $S$ affine.

\medskip\noindent
After replacing $S$ by an affine open $V$ and replacing $Y$ by
$j^{-1}(V)$ we may assume that $i$ is a closed immersion and $S$
affine. Write $S = \Spec(A)$. Then $j : Y \to S$ defines an
isomorphism of $Y$ to the closed subscheme $\Spec(A/I)$ for
some ideal $I \subset A$. The map
$i : Y = \Spec(A/I) \to
\mathbf{A}^n_S = \Spec(A[x_1, \ldots, x_n])$
corresponds to an $A$-algebra homomorphism
$i^\sharp : A[x_1, \ldots, x_n] \to A/I$.
Choose $a_i \in A$ which map to $i^\sharp(x_i)$ in $A/I$.
Observe that the ideal of the closed immersion $i$ is
$$
J = (x_1 - a_1, \ldots, x_n - a_n) + IA[x_1, \ldots, x_n].
$$
Set $K = (x_1 - a_1, \ldots, x_n - a_n)$. We claim the sequence
$$
0 \to K/KJ \to J/J^2 \to J/(K + J^2) \to 0
$$
is split exact. To see this note that $K/K^2$ is free with basis
$x_i - a_i$ over the ring $A[x_1, \ldots, x_n]/K \cong A$.
Hence $K/KJ$ is free with the same basis over the ring
$A[x_1, \ldots, x_n]/J \cong A/I$. On the other hand, taking derivatives
gives a map
$$
\text{d}_{A[x_1, \ldots, x_n]/A} :
J/J^2
\longrightarrow
\Omega_{A[x_1, \ldots, x_n]/A} \otimes_{A[x_1, \ldots, x_n]}
A[x_1, \ldots, x_n]/J
$$
which maps the generators $x_i - a_i$ to the basis elements $\text{d}x_i$
of the free module on the right. The claim follows. Moreover, note that
$x_1 - a_1, \ldots, x_n - a_n$ is a regular sequence in
$A[x_1, \ldots, x_n]$ with quotient ring
$A[x_1, \ldots, x_n]/(x_1 - a_1, \ldots, x_n - a_n) \cong A$.
Thus we have a factorization
$$
Y \to V(x_1 - a_1, \ldots, x_n - a_n) \to \mathbf{A}^n_S
$$
of our closed immersion $i$ where the composition is
Koszul-regular (resp.\ $H_1$-regular, quasi-regular),
the second arrow is a regular immersion, and the associated conormal
sequence is split. Now the result follows from
Lemma \ref{lemma-permanence-regular-immersion}.
\end{proof}











\section{Meromorphic functions and sections}
\label{section-meromorphic-functions}

\noindent
This section contains only the general definitions and some elementary results.
See \cite{misconceptions} for some possible
pitfalls\footnote{Danger, Will Robinson!}.

\medskip\noindent
Let $(X, \mathcal{O}_X)$ be a locally ringed space.
For any open $U \subset X$ we have defined the set
$\mathcal{S}(U) \subset \mathcal{O}_X(U)$
of regular sections of $\mathcal{O}_X$ over $U$, see
Definition \ref{definition-regular-section}. The restriction
of a regular section to a smaller open is regular. Hence
$\mathcal{S} : U \mapsto \mathcal{S}(U)$ is a subsheaf (of sets)
of $\mathcal{O}_X$. We sometimes denote $\mathcal{S} = \mathcal{S}_X$
if we want to indicate the dependence on $X$.
Moreover, $\mathcal{S}(U)$
is a multiplicative subset of the ring $\mathcal{O}_X(U)$ for
each $U$. Hence we may consider
the presheaf of rings
$$
U \longmapsto \mathcal{S}(U)^{-1} \mathcal{O}_X(U),
$$
see Modules, Lemma \ref{modules-lemma-simple-invert}.

\begin{definition}
\label{definition-sheaf-meromorphic-functions}
Let $(X, \mathcal{O}_X)$ be a locally ringed space.
The {\it sheaf of meromorphic functions on $X$} is
the sheaf {\it $\mathcal{K}_X$} associated to the presheaf
displayed above. A {\it meromorphic function} on $X$
is a global section of $\mathcal{K}_X$.
\end{definition}

\noindent
Since each element of each $\mathcal{S}(U)$ is a nonzerodivisor on
$\mathcal{O}_X(U)$ we see that the natural map of sheaves
of rings $\mathcal{O}_X \to \mathcal{K}_X$ is injective.

\begin{example}
\label{example-no-change}
Let $A = \mathbf{C}[x, \{y_\alpha\}_{\alpha \in \mathbf{C}}]/
((x - \alpha)y_\alpha, y_\alpha y_\beta)$. Any element of $A$
can be written uniquely as
$f(x) + \sum \lambda_\alpha y_\alpha$ with $f(x) \in \mathbf{C}[x]$
and $\lambda_\alpha \in \mathbf{C}$.
Let $X = \Spec(A)$.
In this case $\mathcal{O}_X = \mathcal{K}_X$, since on
any affine open $D(f)$ the ring $A_f$ any nonzerodivisor is
a unit (proof omitted).
\end{example}

\noindent
Let $(X, \mathcal{O}_X)$ be a locally ringed space.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}_X$-modules.
Consider the presheaf $U \mapsto \mathcal{S}(U)^{-1}\mathcal{F}(U)$.
Its sheafification is the sheaf
$\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{K}_X$, see
Modules, Lemma \ref{modules-lemma-simple-invert-module}.

\begin{definition}
\label{definition-meromorphic-section}
Let $X$ be a locally ringed space.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}_X$-modules.
\begin{enumerate}
\item We denote
$\mathcal{K}_X(\mathcal{F})$
the sheaf of $\mathcal{K}_X$-modules which is
the sheafification of the presheaf
$U \mapsto \mathcal{S}(U)^{-1}\mathcal{F}(U)$. Equivalently
$\mathcal{K}_X(\mathcal{F}) =
\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{K}_X$ (see above).
\item A {\it meromorphic section of $\mathcal{F}$}
is a global section of $\mathcal{K}_X(\mathcal{F})$.
\end{enumerate}
\end{definition}

\noindent
In particular we have
$$
\mathcal{K}_X(\mathcal{F})_x
=
\mathcal{F}_x \otimes_{\mathcal{O}_{X, x}} \mathcal{K}_{X, x}
=
\mathcal{S}_x^{-1}\mathcal{F}_x
$$
for any point $x \in X$. However, one has to be careful since it may
not be the case that $\mathcal{S}_x$ is the set of nonzerodivisors
in the local ring $\mathcal{O}_{X, x}$. Namely, there is always
an injective map
$$
\mathcal{K}_{X, x} \longrightarrow Q(\mathcal{O}_{X, x})
$$
to the total quotient ring. It is also surjective if and only if
$\mathcal{S}_x$ is the set of nonzerodivisors in $\mathcal{O}_{X, x}$.
The sheaves of meromorphic sections aren't quasi-coherent
modules in general, but they do have some properties in common
with quasi-coherent modules.

\begin{definition}
\label{definition-pullback-meromorphic-sections}
Let $f : (X, \mathcal{O}_X) \to (Y, \mathcal{O}_Y)$ be a morphism
of locally ringed spaces. We say that {\it pullbacks of meromorphic
functions are defined for $f$} if for every pair of open
$U \subset X$, $V \subset Y$ such that $f(U) \subset V$, and any
section $s \in \Gamma(V, \mathcal{S}_Y)$ the pullback
$f^\sharp(s) \in \Gamma(U, \mathcal{O}_X)$ is an element
of $\Gamma(U, \mathcal{S}_X)$.
\end{definition}

\noindent
In this case there is an induced map
$f^\sharp : f^{-1}\mathcal{K}_Y \to \mathcal{K}_X$,
in other words we obtain a commutative diagram of morphisms
of ringed spaces
$$
\xymatrix{
(X, \mathcal{K}_X) \ar[r] \ar[d]^f &
(X, \mathcal{O}_X) \ar[d]^f \\
(Y, \mathcal{K}_Y) \ar[r] &
(Y, \mathcal{O}_Y)
}
$$
We sometimes denote $f^*(s) = f^\sharp(s)$ for a
section $s \in \Gamma(Y, \mathcal{K}_Y)$.

\begin{lemma}
\label{lemma-pullback-meromorphic-sections-defined}
Let $f : X \to Y$ be a morphism of schemes.
In each of the following cases pullbacks of meromorphic
functions are defined.
\begin{enumerate}
\item every weakly associated point of $X$ maps to
a generic point of an irreducible component of $Y$,
\item $X$, $Y$ are integral and $f$ is dominant,
\item $X$ is integral and the generic point of $X$ maps
to a generic point of an irreducible component of $Y$,
\item $X$ is reduced and every generic point of every irreducible
component of $X$ maps to the generic point of an irreducible component
of $Y$,
\item $X$ is locally Noetherian, and any associated point of
$X$ maps to a generic point of an irreducible component of $Y$,
\item $X$ is locally Noetherian, has no embedded points and
any generic point of an irreducible component of
$X$ maps to the generic point of an irreducible component of $Y$, and
\item $f$ is flat.
\end{enumerate}
\end{lemma}

\begin{proof}
The question is local on $X$ and $Y$. Hence we reduce to the case where
$X = \Spec(A)$, $Y = \Spec(R)$ and $f$ is given by a ring map
$\varphi : R \to A$.
By the characterization of regular sections of the structure sheaf
in Lemma \ref{lemma-regular-section-structure-sheaf} we have to
show that $R \to A$ maps nonzerodivisors to nonzerodivisors.
Let $t \in R$ be a nonzerodivisor.

\medskip\noindent
If $R \to A$ is flat, then $t : R \to R$ being injective
shows that $t : A \to A$ is injective. This proves (7).

\medskip\noindent
In the other cases we note that $t$ is not contained in any of
the minimal primes of $R$ (because every element of a minimal
prime in a ring is a zerodivisor).
Hence in case (1) we see that $\varphi(t)$ is not contained
in any weakly associated prime of $A$. Thus this case follows from
Algebra, Lemma \ref{algebra-lemma-weakly-ass-zero-divisors}.
Case (5) is a special case of (1) by Lemma \ref{lemma-ass-weakly-ass}.
Case (6) follows from (5) and the definitions.
Case (4) is a special case of (1) by
Lemma \ref{lemma-weakass-reduced}.
Cases (2) and (3) are special cases of (4).
\end{proof}


\begin{lemma}
\label{lemma-meromorphic-weakass-finite}
Let $X$ be a scheme such that
\begin{enumerate}
\item[(a)] every weakly associated point of $X$ is a generic point of an
irreducible component of $X$, and
\item[(b)] any quasi-compact open has a finite number of irreducible components.
\end{enumerate}
Let $X^0$ be the set of generic points of irreducible components of $X$.
Then we have
$$
\mathcal{K}_X =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{O}_{X, \eta} =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{O}_{X, \eta}
$$
where $j_\eta : \Spec(\mathcal{O}_{X, \eta}) \to X$ is the canonical map
of Schemes, Section \ref{schemes-section-points}. Moreover
\begin{enumerate}
\item $\mathcal{K}_X$ is a quasi-coherent sheaf of
$\mathcal{O}_X$-algebras,
\item for every quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ the sheaf
$$
\mathcal{K}_X(\mathcal{F}) =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta
$$
of meromorphic sections of $\mathcal{F}$
is quasi-coherent,
\item $\mathcal{S}_x \subset \mathcal{O}_{X, x}$
is the set of nonzerodivisors for any $x \in X$,
\item $\mathcal{K}_{X, x}$ is the total quotient ring of $\mathcal{O}_{X, x}$
for any $x \in X$,
\item $\mathcal{K}_X(U)$ equals the total quotient ring of $\mathcal{O}_X(U)$
for any affine open $U \subset X$,
\item the ring of rational functions of $X$
(Morphisms, Definition \ref{morphisms-definition-rational-function})
is the ring of meromorphic
functions on $X$, in a formula: $R(X) = \Gamma(X, \mathcal{K}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Observe that a locally finite direct sum of sheaves of modules
is equal to the product since you can check this on stalks for
example. Then since $\mathcal{K}_X(\mathcal{F}) =
\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{K}_X$
we see that (2) follows from the other statements.
Also, observe that part (6) follows from the initial
statement of the lemma and Morphisms, Lemma
\ref{morphisms-lemma-integral-scheme-rational-functions}
when $X^0$ is finite; the general case of (6) follows from this
by glueing (argument omitted).

\medskip\noindent
Let $j : Y = \coprod\nolimits_{\eta \in X^0} \Spec(\mathcal{O}_{X, \eta}) \to X$
be the product of the morphisms $j_\eta$. We have to show that
$\mathcal{K}_X = j_*\mathcal{O}_Y$.
First note that $\mathcal{K}_Y = \mathcal{O}_Y$ as $Y$ is a disjoint
union of spectra of local rings of dimension $0$: in a local
ring of dimension zero any nonzerodivisor is a unit.
Next, note that pullbacks of meromorphic
functions are defined for $j$ by
Lemma \ref{lemma-pullback-meromorphic-sections-defined}.
This gives a map
$$
\mathcal{K}_X \longrightarrow j_*\mathcal{O}_Y.
$$
Let $\Spec(A) = U \subset X$ be an affine open. Then $A$ is a ring
with finitely many minimal primes $\mathfrak q_1, \ldots, \mathfrak q_t$
and every weakly associated prime of $A$ is one of the $\mathfrak q_i$.
We obtain $Q(A) = \prod A_{\mathfrak q_i}$
by Algebra, Lemmas \ref{algebra-lemma-total-ring-fractions-no-embedded-points}
and \ref{algebra-lemma-weakly-ass-zero-divisors}.
In other words, already the value of the presheaf
$U \mapsto \mathcal{S}(U)^{-1}\mathcal{O}_X(U)$ agrees with
$j_*\mathcal{O}_Y(U)$ on our affine open $U$. Hence the displayed
map is an isomorphism which proves the first displayed equality in
the statement of the lemma.

\medskip\noindent
Finally, we prove (1), (3), (4), and (5).
Part (5) we saw during the course of the proof that
$\mathcal{K}_X = j_*\mathcal{O}_Y$.
The morphism $j$ is quasi-compact by our assumption
that the set of irreducible components of $X$ is locally finite.
Hence $j$ is quasi-compact and quasi-separated (as $Y$ is separated).
By Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}
$j_*\mathcal{O}_Y$ is quasi-coherent. This proves (1).
Let $x \in X$. We may choose an affine open neighbourhood
$U = \Spec(A)$ of $x$ all of whose irreducible components
pass through $x$. Then $A \subset A_\mathfrak p$ because every
weakly associated prime of $A$ is contained in $\mathfrak p$
hence elements of $A \setminus \mathfrak p$ are nonzerodivisors
by Algebra, Lemma \ref{algebra-lemma-weakly-ass-zero-divisors}.
It follows easily that any nonzerodivisor of $A_\mathfrak p$
is the image of a nonzerodivisor on a (possibly smaller)
affine open neighbourhood of $x$. This proves (3).
Part (4) follows from part (3) by computing stalks.
\end{proof}

\begin{definition}
\label{definition-regular-meromorphic-section}
Let $X$ be a locally ringed space.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
A meromorphic section $s$ of $\mathcal{L}$ is said to be {\it regular}
if the induced map
$\mathcal{K}_X \to \mathcal{K}_X(\mathcal{L})$
is injective. In other words, $s$ is a regular
section of the invertible $\mathcal{K}_X$-module
$\mathcal{K}_X(\mathcal{L})$, see
Definition \ref{definition-regular-section}.
\end{definition}

\noindent
Let us spell out when (regular) meromorphic sections can be pulled back.

\begin{lemma}
\label{lemma-meromorphic-sections-pullback}
Let $f : X \to Y$ be a morphism of locally ringed spaces.
Assume that pullbacks of meromorphic functions are defined
for $f$ (see
Definition \ref{definition-pullback-meromorphic-sections}).
\begin{enumerate}
\item Let $\mathcal{F}$ be a sheaf of $\mathcal{O}_Y$-modules.
There is a canonical pullback map
$f^* : \Gamma(Y, \mathcal{K}_Y(\mathcal{F})) \to
\Gamma(X, \mathcal{K}_X(f^*\mathcal{F}))$
for meromorphic sections of $\mathcal{F}$.
\item Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
A regular meromorphic section $s$ of $\mathcal{L}$ pulls back
to a regular meromorphic section $f^*s$ of $f^*\mathcal{L}$.
\end{enumerate}
\end{lemma}

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

\begin{lemma}
\label{lemma-regular-meromorphic-ideal-denominators}
Let $X$ be a scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $s$ be a regular meromorphic section of $\mathcal{L}$.
Let us denote $\mathcal{I} \subset \mathcal{O}_X$ the
sheaf of ideals defined by the rule
$$
\mathcal{I}(V)
=
\{f \in \mathcal{O}_X(V) \mid fs \in \mathcal{L}(V)\}.
$$
The formula makes sense since
$\mathcal{L}(V) \subset \mathcal{K}_X(\mathcal{L})(V)$.
Then $\mathcal{I}$ is a quasi-coherent sheaf of ideals and
we have injective maps
$$
1 : \mathcal{I} \longrightarrow \mathcal{O}_X,
\quad
s : \mathcal{I} \longrightarrow \mathcal{L}
$$
whose cokernels are supported on closed nowhere dense subsets of $X$.
\end{lemma}

\begin{proof}
The question is local on $X$.
Hence we may assume that $X = \Spec(A)$,
and $\mathcal{L} = \mathcal{O}_X$. After shrinking further
we may assume that $s = a/b$ with $a, b \in A$ {\it both}
nonzerodivisors in $A$. Set $I = \{x \in A \mid x(a/b) \in A\}$.

\medskip\noindent
To show that $\mathcal{I}$ is quasi-coherent we have to show
that $I_f = \{x \in A_f \mid x(a/b) \in A_f\}$ for every
$f \in A$. If $c/f^n \in A_f$, $(c/f^n)(a/b) \in A_f$, then we see
that $f^mc(a/b) \in A$ for some $m$, hence $c/f^n \in I_f$.
Conversely it is easy to see that $I_f$ is contained in
$\{x \in A_f \mid x(a/b) \in A_f\}$. This proves quasi-coherence.

\medskip\noindent
Let us prove the final statement. It is clear that $(b) \subset I$.
Hence $V(I) \subset V(b)$ is a nowhere dense subset as $b$ is
a nonzerodivisor. Thus the cokernel of $1$ is supported in a nowhere
dense closed set. The same argument works for the cokernel
of $s$ since $s(b) = (a) \subset sI \subset A$.
\end{proof}

\begin{definition}
\label{definition-regular-meromorphic-ideal-denominators}
Let $X$ be a scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $s$ be a regular meromorphic section of $\mathcal{L}$.
The sheaf of ideals $\mathcal{I}$ constructed in
Lemma \ref{lemma-regular-meromorphic-ideal-denominators}
is called the {\it ideal sheaf of denominators of $s$}.
\end{definition}




\section{Meromorphic functions and sections; Noetherian case}
\label{section-meromorphic-noetherian}

\noindent
For locally Noetherian schemes we can prove some results about the
sheaf of meromorphic functions. However, there is an example in
\cite{misconceptions} showing that $\mathcal{K}_X$ need not be quasi-coherent
for a Noetherian scheme $X$.

\begin{lemma}
\label{lemma-meromorphic-section-restricts-to-zero}
Let $X$ be a quasi-compact scheme. Let $h \in \Gamma(X, \mathcal{O}_X)$ and
$f \in \Gamma(X, \mathcal{K}_X)$ such that $f$ restricts
to zero on $X_h$. Then $h^n f = 0$ for some $n \gg 0$.
\end{lemma}

\begin{proof}
We can find a covering of $X$ by affine opens $U$ such that $f|_U = s^{-1}a$
with $a \in \mathcal{O}_X(U)$ and $s \in \mathcal{S}(U)$. Since $X$ is
quasi-compact we can cover it by finitely many affine opens of this form.
Thus it suffices to prove the lemma when $X = \Spec(A)$ and $f = s^{-1}a$.
Note that $s \in A$ is a nonzerodivisor hence it suffices to prove
the result when $f = a$. The condition $f|_{X_h} = 0$ implies that
$a$ maps to zero in $A_h = \mathcal{O}_X(X_h)$ as
$\mathcal{O}_X \subset \mathcal{K}_X$. Thus $h^na = 0$ for some $n > 0$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-locally-Noetherian-K}
Let $X$ be a locally Noetherian scheme.
\begin{enumerate}
\item For any $x \in X$ we have $\mathcal{S}_x \subset \mathcal{O}_{X, x}$
is the set of nonzerodivisors, and hence $\mathcal{K}_{X, x}$
is the total quotient ring of $\mathcal{O}_{X, x}$.
\item For any affine open $U \subset X$ the ring
$\mathcal{K}_X(U)$ equals the total quotient ring of $\mathcal{O}_X(U)$.
\end{enumerate}
\end{lemma}

\begin{proof}
To prove this lemma we may assume $X$ is the spectrum of a Noetherian
ring $A$. Say $x \in X$ corresponds to $\mathfrak p \subset A$.

\medskip\noindent
Proof of (1). It is clear that $\mathcal{S}_x$ is contained
in the set of nonzerodivisors of $\mathcal{O}_{X, x} = A_\mathfrak p$.
For the converse, let $f, g \in A$, $g \not \in \mathfrak p$ and
assume $f/g$ is a nonzerodivisor in $A_{\mathfrak p}$. Let
$I = \{a \in A \mid af = 0\}$. Then we see that $I_{\mathfrak p} = 0$ by
exactness of localization. Since $A$ is Noetherian we see that $I$
is finitely generated and hence that $g'I = 0$ for some $g' \in A$,
$g' \not \in \mathfrak p$. Hence $f$ is a nonzerodivisor
in $A_{g'}$, i.e., in a Zariski open neighbourhood of $\mathfrak p$.
Thus $f/g$ is an element of $\mathcal{S}_x$.

\medskip\noindent
Proof of (2). Let $f \in \Gamma(X, \mathcal{K}_X)$ be a meromorphic function.
Set $I = \{a \in A \mid af \in A\}$. Fix a prime $\mathfrak p \subset A$
corresponding to the point $x \in X$. By (1) we can write the image of $f$
in the stalk at $\mathfrak p$ as $a/b$, $a, b \in A_{\mathfrak p}$ with
$b \in A_{\mathfrak p}$ not a zerodivisor. Write $b = c/d$ with
$c, d \in A$, $d \not \in \mathfrak p$. Then $ad - cf$ is a section of
$\mathcal{K}_X$ which vanishes in an open neighbourhood of $x$. Say it
vanishes on $D(e)$ with $e \in A$, $e \not \in \mathfrak p$. Then
$e^n(ad - cf) = 0$ for some $n \gg 0$ by
Lemma \ref{lemma-meromorphic-section-restricts-to-zero}.
Thus $e^nc \in I$ and $e^nc$ maps to a nonzerodivisor in
$A_{\mathfrak p}$. Let
$\text{Ass}(A) = \{\mathfrak q_1, \ldots, \mathfrak q_t\}$ be the
associated primes of $A$. By looking at $IA_{\mathfrak q_i}$ and
using Algebra, Lemma \ref{algebra-lemma-associated-primes-localize}
the above says that
$I \not \subset \mathfrak q_i$ for each $i$. By
Algebra, Lemma \ref{algebra-lemma-silly}
there exists an element $x \in I$, $x \not \in \bigcup \mathfrak q_i$.
By Algebra, Lemma \ref{algebra-lemma-ass-zero-divisors}
we see that $x$ is not a zerodivisor on $A$.
Hence $f = (xf)/x$ is an element of the total ring of fractions of $A$.
This proves (2).
\end{proof}

\begin{lemma}
\label{lemma-quasi-coherent-K}
Let $X$ be a locally Noetherian scheme having no embedded points.
Let $X^0$ be the set of generic points of irreducible components of $X$.
Then we have
$$
\mathcal{K}_X =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{O}_{X, \eta} =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{O}_{X, \eta}
$$
where $j_\eta : \Spec(\mathcal{O}_{X, \eta}) \to X$ is the canonical map
of Schemes, Section \ref{schemes-section-points}. Moreover
\begin{enumerate}
\item $\mathcal{K}_X$ is a quasi-coherent sheaf of $\mathcal{O}_X$-algebras,
\item for every quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ the sheaf
$$
\mathcal{K}_X(\mathcal{F}) =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta
$$
of meromorphic sections of $\mathcal{F}$ is quasi-coherent, and
\item the ring of rational functions of $X$ is the ring of meromorphic
functions on $X$, in a formula: $R(X) = \Gamma(X, \mathcal{K}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
This lemma is a special case of
Lemma \ref{lemma-meromorphic-weakass-finite}
because in the locally Noetherian case
weakly associated points are the same thing
as associated points by Lemma \ref{lemma-ass-weakly-ass}.
\end{proof}

\begin{lemma}
\label{lemma-regular-meromorphic-section-exists-noetherian}
Let $X$ be a locally Noetherian scheme having no embedded points.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Then $\mathcal{L}$ has a regular meromorphic section.
\end{lemma}

\begin{proof}
For each generic point $\eta$ of $X$ pick a generator
$s_\eta$ of the free rank $1$ module $\mathcal{L}_\eta$
over the artinian local ring $\mathcal{O}_{X, \eta}$.
It follows immediately from the description of
$\mathcal{K}_X$ and $\mathcal{K}_X(\mathcal{L})$ in
Lemma \ref{lemma-quasi-coherent-K} that $s = \prod s_\eta$
is a regular meromorphic section of $\mathcal{L}$.
\end{proof}

\begin{lemma}
\label{lemma-make-maps-regular-section}
Suppose given
\begin{enumerate}
\item $X$ a locally Noetherian scheme,
\item $\mathcal{L}$ an invertible $\mathcal{O}_X$-module,
\item $s$ a regular meromorphic section of $\mathcal{L}$, and
\item $\mathcal{F}$ coherent on $X$
without embedded associated points and $\text{Supp}(\mathcal{F}) = X$.
\end{enumerate}
Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal of
denominators of $s$. Let $T \subset X$ be the union
of the supports of $\mathcal{O}_X/\mathcal{I}$ and
$\mathcal{L}/s(\mathcal{I})$ which is a nowhere dense closed
subset $T \subset X$ according to
Lemma \ref{lemma-regular-meromorphic-ideal-denominators}.
Then there are canonical injective maps
$$
1 : \mathcal{I}\mathcal{F} \to \mathcal{F}, \quad
s : \mathcal{I}\mathcal{F} \to \mathcal{F} \otimes_{\mathcal{O}_X}\mathcal{L}
$$
whose cokernels are supported on $T$.
\end{lemma}

\begin{proof}
Reduce to the affine case with $\mathcal{L} \cong \mathcal{O}_X$,
and $s = a/b$ with $a, b \in A$ both nonzerodivisors.
Proof of reduction step omitted.
Write $\mathcal{F} = \widetilde{M}$.
Let $I = \{x \in A \mid x(a/b) \in A\}$
so that $\mathcal{I} = \widetilde{I}$ (see
proof of Lemma \ref{lemma-regular-meromorphic-ideal-denominators}).
Note that $T = V(I) \cup V((a/b)I)$.
For any $A$-module $M$ consider the map $1 : IM \to M$; this is the
map that gives rise to the map $1$ of the lemma.
Consider on the other hand the map
$\sigma : IM \to M_b, x \mapsto ax/b$.
Since $b$ is not a zerodivisor in $A$, and since
$M$ has support $\Spec(A)$ and no embedded primes we
see that $b$ is a nonzerodivisor on $M$ also. Hence $M \subset M_b$.
By definition of $I$ we have $\sigma(IM) \subset M$ as submodules
of $M_b$. Hence we get an $A$-module map $s : IM \to M$ (namely the
unique map such that $s(z)/1 = \sigma(z)$ in $M_b$ for all $z \in IM$).
It is injective because $a$ is a nonzerodivisor also (on both $A$ and $M$).
It is clear that $M/IM$ is annihilated by $I$ and that
$M/s(IM)$ is annihilated by $(a/b)I$. Thus the lemma follows.
\end{proof}





\section{Meromorphic functions and sections; reduced case}
\label{section-meromorphic-reduced}

\noindent
For a scheme which is reduced and which locally has finitely many irreducible
components, the sheaf of meromorphic functions is quasi-coherent.

\begin{lemma}
\label{lemma-reduced-finite-irreducible}
Let $X$ be a reduced scheme such that any quasi-compact open
has a finite number of irreducible components. Let $X^0$ be the set
of generic points of irreducible components of $X$. Then we have
$$
\mathcal{K}_X =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\kappa(\eta) =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\kappa(\eta)
$$
where $j_\eta : \Spec(\kappa(\eta)) \to X$ is the canonical map
of Schemes, Section \ref{schemes-section-points}. Moreover
\begin{enumerate}
\item $\mathcal{K}_X$ is a quasi-coherent sheaf of
$\mathcal{O}_X$-algebras,
\item for every quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ the sheaf
$$
\mathcal{K}_X(\mathcal{F}) =
\bigoplus\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta =
\prod\nolimits_{\eta \in X^0} j_{\eta, *}\mathcal{F}_\eta
$$
of meromorphic sections of $\mathcal{F}$
is quasi-coherent,
\item $\mathcal{S}_x \subset \mathcal{O}_{X, x}$
is the set of nonzerodivisors for any $x \in X$,
\item $\mathcal{K}_{X, x}$ is the total quotient ring of $\mathcal{O}_{X, x}$
for any $x \in X$,
\item $\mathcal{K}_X(U)$ equals the total quotient ring of $\mathcal{O}_X(U)$
for any affine open $U \subset X$,
\item the ring of rational functions of $X$ is the ring of meromorphic
functions on $X$, in a formula: $R(X) = \Gamma(X, \mathcal{K}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
This lemma is a special case of
Lemma \ref{lemma-meromorphic-weakass-finite}
because on a reduced scheme the weakly associated
points are the generic points by
Lemma \ref{lemma-weakass-reduced}.
\end{proof}

\begin{lemma}
\label{lemma-reduced-normalization}
Let $X$ be a scheme.
Assume $X$ is reduced and any quasi-compact open $U \subset X$
has a finite number of irreducible components.
Then the normalization morphism $\nu : X^\nu \to X$ is the
morphism
$$
\underline{\Spec}_X(\mathcal{O}') \longrightarrow X
$$
where $\mathcal{O}' \subset \mathcal{K}_X$ is the integral
closure of $\mathcal{O}_X$ in the sheaf of meromorphic functions.
\end{lemma}

\begin{proof}
Compare the definition of the normalization morphism
$\nu : X^\nu \to X$ (see
Morphisms, Definition \ref{morphisms-definition-normalization})
with the description of $\mathcal{K}_X$ in
Lemma \ref{lemma-reduced-finite-irreducible} above.
\end{proof}

\begin{lemma}
\label{lemma-meromorphic-functions-integral-scheme}
Let $X$ be an integral scheme with generic point $\eta$. We have
\begin{enumerate}
\item the sheaf of meromorphic functions is
isomorphic to the constant sheaf with value the
function field (see
Morphisms, Definition \ref{morphisms-definition-function-field})
of $X$.
\item for any quasi-coherent sheaf $\mathcal{F}$ on $X$ the
sheaf $\mathcal{K}_X(\mathcal{F})$ is isomorphic to the
constant sheaf with value $\mathcal{F}_\eta$.
\end{enumerate}
\end{lemma}

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

\noindent
In some cases we can show regular meromorphic sections exist.

\begin{lemma}
\label{lemma-regular-meromorphic-section-exists}
Let $X$ be a scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
In each of the following cases $\mathcal{L}$ has a regular meromorphic
section:
\begin{enumerate}
\item $X$ is integral,
\item $X$ is reduced and any quasi-compact open has a finite
number of irreducible components,
\item $X$ is locally Noetherian and has no embedded points.
\end{enumerate}
\end{lemma}

\begin{proof}
In case (1) let $\eta \in X$ be the generic point. We have seen in
Lemma \ref{lemma-meromorphic-functions-integral-scheme}
that $\mathcal{K}_X$, resp.\ $\mathcal{K}_X(\mathcal{L})$
is the constant sheaf with value
$\kappa(\eta)$, resp.\ $\mathcal{L}_\eta$.
Since $\dim_{\kappa(\eta)} \mathcal{L}_\eta = 1$
we can pick a nonzero element $s \in \mathcal{L}_\eta$.
Clearly $s$ is a regular meromorphic section of $\mathcal{L}$.
In case (2) pick $s_\eta \in \mathcal{L}_\eta$ nonzero
for all generic points $\eta$ of $X$; this is possible
as $\mathcal{L}_\eta$ is a $1$-dimensional vector space
over $\kappa(\eta)$.
It follows immediately from the description of
$\mathcal{K}_X$ and $\mathcal{K}_X(\mathcal{L})$
in Lemma \ref{lemma-reduced-finite-irreducible}
that $s = \prod s_\eta$ is a regular meromorphic section of $\mathcal{L}$.
Case (3) is Lemma \ref{lemma-regular-meromorphic-section-exists-noetherian}.
\end{proof}






\section{Weil divisors}
\label{section-Weil-divisors}

\noindent
We will introduce Weil divisors and rational equivalence of Weil
divisors for locally Noetherian integral schemes.
Since we are not assuming our schemes are quasi-compact we have
to be a little careful when defining Weil divisors. We have to allow
infinite sums of prime divisors because a rational function may have
infinitely many poles for example. For quasi-compact schemes our
Weil divisors are finite sums as usual. Here is a basic lemma we will
often use to prove collections of closed subschemes are locally finite.

\begin{lemma}
\label{lemma-components-locally-finite}
Let $X$ be a locally Noetherian scheme. Let $Z \subset X$ be a closed
subscheme. The collection of irreducible components of $Z$
is locally finite in $X$.
\end{lemma}

\begin{proof}
Let $U \subset X$ be a quasi-compact open subscheme. Then $U$ is a Noetherian
scheme, and hence has a Noetherian underlying topological space
(Properties, Lemma \ref{properties-lemma-Noetherian-topology}).
Hence every subspace is Noetherian and
has finitely many irreducible components
(see Topology, Lemma \ref{topology-lemma-Noetherian}).
\end{proof}

\noindent
Recall that if $Z$ is an irreducible closed subset of a scheme $X$,
then the codimension of $Z$ in $X$ is equal to the dimension
of the local ring $\mathcal{O}_{X, \xi}$, where $\xi \in Z$
is the generic point. See
Properties, Lemma \ref{properties-lemma-codimension-local-ring}.

\begin{definition}
\label{definition-Weil-divisor}
Let $X$ be a locally Noetherian integral scheme.
\begin{enumerate}
\item A {\it prime divisor} is an integral closed subscheme $Z \subset X$
of codimension $1$.
\item A {\it Weil divisor} is a formal sum $D = \sum n_Z Z$ where
the sum is over prime divisors of $X$ and the collection
$\{Z \mid n_Z \not = 0\}$ is locally finite
(Topology, Definition \ref{topology-definition-locally-finite}).
\end{enumerate}
The group of all Weil divisors on $X$ is denoted $\text{Div}(X)$.
\end{definition}

\noindent
Our next task is to define the Weil divisor associated to a rational
function. In order to do this we use the order of vanishing of a
rational function along a prime divisor which is defined as follows.

\begin{definition}
\label{definition-order-vanishing}
Let $X$ be a locally Noetherian integral scheme. Let $f \in R(X)^*$.
For every prime divisor $Z \subset X$ we define the
{\it order of vanishing of $f$ along $Z$} as the integer
$$
\text{ord}_Z(f) = \text{ord}_{\mathcal{O}_{X, \xi}}(f)
$$
where the right hand side is the notion of
Algebra, Definition \ref{algebra-definition-ord}
and $\xi$ is the generic point of $Z$.
\end{definition}

\noindent
Note that for $f, g \in R(X)^*$ we have
$$
\text{ord}_Z(fg) = \text{ord}_Z(f) + \text{ord}_Z(g).
$$
Of course it can happen that $\text{ord}_Z(f) < 0$.
In this case we say that $f$ has a {\it pole} along $Z$
and that $-\text{ord}_Z(f) > 0$ is the
{\it order of pole of $f$ along $Z$}. It is important to note
that the condition $\text{ord}_Z(f) \geq 0$ is {\bf not} equivalent
to the condition $f \in \mathcal{O}_{X, \xi}$ unless the local
ring $\mathcal{O}_{X, \xi}$ is a discrete valuation ring.

\begin{lemma}
\label{lemma-divisor-locally-finite}
Let $X$ be a locally Noetherian integral scheme. Let $f \in R(X)^*$.
Then the collections
$$
\{Z \subset X \mid Z\text{ a prime divisor with generic point }\xi
\text{ and }f\text{ not in }\mathcal{O}_{X, \xi}\}
$$
and
$$
\{Z \subset X \mid Z \text{ a prime divisor and }\text{ord}_Z(f) \not = 0\}
$$
are locally finite in $X$.
\end{lemma}

\begin{proof}
There exists a nonempty open subscheme $U \subset X$ such that $f$
corresponds to a section of $\Gamma(U, \mathcal{O}_X^*)$. Hence the
prime divisors which can occur in the sets of the lemma are all
irreducible components of $X \setminus U$.
Hence Lemma \ref{lemma-components-locally-finite} gives the desired result.
\end{proof}

\noindent
This lemma allows us to make the following definition.

\begin{definition}
\label{definition-principal-divisor}
Let $X$ be a locally Noetherian integral scheme. Let $f \in R(X)^*$.
The {\it principal Weil divisor associated to $f$} is the Weil divisor
$$
\text{div}(f) = \text{div}_X(f) = \sum \text{ord}_Z(f) [Z]
$$
where the sum is over prime divisors and $\text{ord}_Z(f)$ is as in
Definition \ref{definition-order-vanishing}. This makes sense
by Lemma \ref{lemma-divisor-locally-finite}.
\end{definition}

\begin{lemma}
\label{lemma-div-additive}
Let $X$ be a locally Noetherian integral scheme. Let $f, g \in R(X)^*$. Then
$$
\text{div}_X(fg) = \text{div}_X(f) + \text{div}_X(g)
$$
as Weil divisors on $X$.
\end{lemma}

\begin{proof}
This is clear from the additivity of the $\text{ord}$ functions.
\end{proof}

\noindent
We see from the lemma above that the collection of principal Weil divisors
form a subgroup of the group of all Weil divisors. This leads to the following
definition.

\begin{definition}
\label{definition-class-group}
Let $X$ be a locally Noetherian integral scheme. The
{\it Weil divisor class group} of $X$ is the quotient of
the group of Weil divisors by the subgroup of principal Weil divisors.
Notation: $\text{Cl}(X)$.
\end{definition}

\noindent
By construction we obtain an exact complex
\begin{equation}
\label{equation-Weil-divisor-class}
R(X)^* \xrightarrow{\text{div}} \text{Div}(X) \to \text{Cl}(X) \to 0
\end{equation}
which we can think of as a presentation of $\text{Cl}(X)$. Our next task
is to relate the Weil divisor class group to the Picard group.





\section{The Weil divisor class associated to an invertible module}
\label{section-c1}

\noindent
In this section we go through exactly the same progression as in
Section \ref{section-Weil-divisors} to define a canonical map
$\Pic(X) \to \text{Cl}(X)$
on a locally Noetherian integral scheme.

\medskip\noindent
Let $X$ be a scheme. Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $\xi \in X$ be a point. If $s_\xi, s'_\xi \in \mathcal{L}_\xi$ generate
$\mathcal{L}_\xi$ as $\mathcal{O}_{X, \xi}$-module, then there exists a unit
$u \in \mathcal{O}_{X, \xi}^*$ such that $s_\xi = u s'_\xi$.
The stalk of the sheaf of meromorphic sections
$\mathcal{K}_X(\mathcal{L})$ of $\mathcal{L}$
at $x$ is equal to
$\mathcal{K}_{X, x} \otimes_{\mathcal{O}_{X, x}} \mathcal{L}_x$.
Thus the image of any meromorphic section $s$
of $\mathcal{L}$ in the stalk at $x$ can be written as $s = fs_\xi$ with
$f \in \mathcal{K}_{X, x}$. Below we will abbreviate this by
saying $f = s/s_\xi$. Also, if $X$ is integral we have
$\mathcal{K}_{X, x} = R(X)$ is equal to the function field of $X$,
so $s/s_\xi \in R(X)$. If $s$ is a regular meromorphic section,
then actually $s/s_\xi \in R(X)^*$. On an integral scheme a regular
meromorphic section is the same thing as a nonzero meromorphic section.
Finally, we see that $s/s_\xi$ is independent of the choice of $s_\xi$ up to
multiplication by a unit of the local ring $\mathcal{O}_{X, x}$.
Putting everything together we see the following definition makes sense.

\begin{definition}
\label{definition-order-vanishing-meromorphic}
Let $X$ be a locally Noetherian integral scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $s \in \Gamma(X, \mathcal{K}_X(\mathcal{L}))$
be a regular meromorphic section of $\mathcal{L}$.
For every prime divisor $Z \subset X$ we define the
{\it order of vanishing of $s$ along $Z$} as the integer
$$
\text{ord}_{Z, \mathcal{L}}(s)
= \text{ord}_{\mathcal{O}_{X, \xi}}(s/s_\xi)
$$
where the right hand side is the notion of
Algebra, Definition \ref{algebra-definition-ord},
$\xi \in Z$ is the generic point,
and $s_\xi \in \mathcal{L}_\xi$ is a generator.
\end{definition}

\noindent
As in the case of principal divisors we have the following lemma.

\begin{lemma}
\label{lemma-divisor-meromorphic-locally-finite}
Let $X$ be a locally Noetherian integral scheme. Let $\mathcal{L}$ be an
invertible $\mathcal{O}_X$-module. Let $s \in \mathcal{K}_X(\mathcal{L})$ be a
regular (i.e., nonzero) meromorphic section of $\mathcal{L}$. Then the sets
$$
\{Z \subset X \mid Z \text{ a prime divisor with generic point }\xi
\text{ and }s\text{ not in }\mathcal{L}_\xi\}
$$
and
$$
\{Z \subset X \mid Z \text{ is a prime divisor and }
\text{ord}_{Z, \mathcal{L}}(s) \not = 0\}
$$
are locally finite in $X$.
\end{lemma}

\begin{proof}
There exists a nonempty open subscheme $U \subset X$ such that $s$
corresponds to a section of $\Gamma(U, \mathcal{L})$ which generates
$\mathcal{L}$ over $U$. Hence the prime divisors which can occur
in the sets of the lemma are all irreducible components of $X \setminus U$.
Hence Lemma \ref{lemma-components-locally-finite}.
gives the desired result.
\end{proof}

\begin{lemma}
\label{lemma-divisor-meromorphic-well-defined}
Let $X$ be a locally Noetherian integral scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $s, s' \in \mathcal{K}_X(\mathcal{L})$ be nonzero
meromorphic sections of $\mathcal{L}$. Then $f = s/s'$
is an element of $R(X)^*$ and we have
$$
\sum \text{ord}_{Z, \mathcal{L}}(s)[Z]
=
\sum \text{ord}_{Z, \mathcal{L}}(s')[Z]
+
\text{div}(f)
$$
as Weil divisors.
\end{lemma}

\begin{proof}
This is clear from the definitions.
Note that Lemma \ref{lemma-divisor-meromorphic-locally-finite}
guarantees that the sums are indeed Weil divisors.
\end{proof}

\begin{definition}
\label{definition-divisor-invertible-sheaf}
Let $X$ be a locally Noetherian integral scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
\begin{enumerate}
\item For any nonzero meromorphic section $s$ of $\mathcal{L}$
we define the {\it Weil divisor associated to $s$} as
$$
\text{div}_\mathcal{L}(s) =
\sum \text{ord}_{Z, \mathcal{L}}(s) [Z] \in \text{Div}(X)
$$
where the sum is over prime divisors.
\item We define {\it Weil divisor class associated to $\mathcal{L}$}
as the image of $\text{div}_\mathcal{L}(s)$ in $\text{Cl}(X)$
where $s$ is any nonzero meromorphic section of $\mathcal{L}$ over
$X$. This is well defined by
Lemma \ref{lemma-divisor-meromorphic-well-defined}.
\end{enumerate}
\end{definition}

\noindent
As expected this construction is additive in the invertible module.

\begin{lemma}
\label{lemma-c1-additive}
Let $X$ be a locally Noetherian integral scheme.
Let $\mathcal{L}$, $\mathcal{N}$ be invertible $\mathcal{O}_X$-modules.
Let $s$, resp.\ $t$ be a nonzero meromorphic section
of $\mathcal{L}$, resp.\ $\mathcal{N}$. Then $st$ is a nonzero
meromorphic section of $\mathcal{L} \otimes \mathcal{N}$, and
$$
\text{div}_{\mathcal{L} \otimes \mathcal{N}}(st)
=
\text{div}_\mathcal{L}(s) + \text{div}_\mathcal{N}(t)
$$
in $\text{Div}(X)$. In particular, the Weil divisor class of
$\mathcal{L} \otimes_{\mathcal{O}_X} \mathcal{N}$ is the sum
of the Weil divisor classes of $\mathcal{L}$ and $\mathcal{N}$.
\end{lemma}

\begin{proof}
Let $s$, resp.\ $t$ be a nonzero meromorphic section
of $\mathcal{L}$, resp.\ $\mathcal{N}$. Then $st$ is a nonzero
meromorphic section of $\mathcal{L} \otimes \mathcal{N}$.
Let $Z \subset X$ be a prime divisor. Let $\xi \in Z$ be its generic
point. Choose generators $s_\xi \in \mathcal{L}_\xi$, and
$t_\xi \in \mathcal{N}_\xi$. Then $s_\xi t_\xi$ is a generator
for $(\mathcal{L} \otimes \mathcal{N})_\xi$.
So $st/(s_\xi t_\xi) = (s/s_\xi)(t/t_\xi)$.
Hence we see that
$$
\text{div}_{\mathcal{L} \otimes \mathcal{N}, Z}(st)
=
\text{div}_{\mathcal{L}, Z}(s) + \text{div}_{\mathcal{N}, Z}(t)
$$
by the additivity of the $\text{ord}_Z$ function.
\end{proof}

\noindent
In this way we obtain a homomorphism of abelian groups
\begin{equation}
\label{equation-c1}
\Pic(X) \longrightarrow \text{Cl}(X)
\end{equation}
which assigns to an invertible module its Weil divisor class.

\begin{lemma}
\label{lemma-normal-c1-injective}
Let $X$ be a locally Noetherian integral scheme. If $X$ is normal,
then the map (\ref{equation-c1}) $\Pic(X) \to \text{Cl}(X)$
is injective.
\end{lemma}

\begin{proof}
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module whose
associated Weil divisor class is trivial. Let $s$ be a regular
meromorphic section of $\mathcal{L}$. The assumption means that
$\text{div}_\mathcal{L}(s) = \text{div}(f)$ for some
$f \in R(X)^*$. Then we see that $t = f^{-1}s$ is a regular
meromorphic section of $\mathcal{L}$ with
$\text{div}_\mathcal{L}(t) = 0$, see
Lemma \ref{lemma-divisor-meromorphic-well-defined}.
We will show that $t$ defines a trivialization of $\mathcal{L}$
which finishes the proof of the lemma.
In order to prove this we may work locally on $X$.
Hence we may assume that $X = \Spec(A)$ is affine
and that $\mathcal{L}$ is trivial. Then $A$ is a Noetherian normal
domain and $t$ is an element of its fraction field
such that $\text{ord}_{A_\mathfrak p}(t) = 0$
for all height $1$ primes $\mathfrak p$ of $A$.
Our goal is to show that $t$ is a unit of $A$.
Since $A_\mathfrak p$ is a discrete valuation ring for height
one primes of $A$ (Algebra, Lemma \ref{algebra-lemma-criterion-normal}), the
condition signifies that $t \in A_\mathfrak p^*$ for all primes $\mathfrak p$
of height $1$. This implies $t \in A$ and $t^{-1} \in A$ by
Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}
and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-local-rings-UFD-c1-bijective}
Let $X$ be a locally Noetherian integral scheme. Consider the map
(\ref{equation-c1}) $\Pic(X) \to \text{Cl}(X)$.
The following are equivalent
\begin{enumerate}
\item the local rings of $X$ are UFDs, and
\item $X$ is normal and $\Pic(X) \to \text{Cl}(X)$
is surjective.
\end{enumerate}
In this case $\Pic(X) \to \text{Cl}(X)$ is an isomorphism.
\end{lemma}

\begin{proof}
If (1) holds, then $X$ is normal by
Algebra, Lemma \ref{algebra-lemma-UFD-normal}.
Hence the map (\ref{equation-c1}) is injective by
Lemma \ref{lemma-normal-c1-injective}. Moreover,
every prime divisor $D \subset X$ is an effective
Cartier divisor by Lemma \ref{lemma-weil-divisor-is-cartier-UFD}.
In this case the canonical section $1_D$ of $\mathcal{O}_X(D)$
(Definition \ref{definition-invertible-sheaf-effective-Cartier-divisor})
vanishes exactly along $D$ and we see that the class of $D$ is the
image of $\mathcal{O}_X(D)$ under the map (\ref{equation-c1}).
Thus the map is surjective as well.

\medskip\noindent
Assume (2) holds. Pick a prime divisor $D \subset X$.
Since (\ref{equation-c1}) is surjective there exists an invertible
sheaf $\mathcal{L}$, a regular meromorphic section $s$, and $f \in R(X)^*$
such that $\text{div}_\mathcal{L}(s) + \text{div}(f) = [D]$.
In other words, $\text{div}_\mathcal{L}(fs) = [D]$.
Let $x \in X$ and let $A = \mathcal{O}_{X, x}$. Thus $A$ is
a Noetherian local normal domain with fraction field $K = R(X)$.
Every height $1$ prime of $A$ corresponds to a prime divisor on $X$
and every invertible $\mathcal{O}_X$-module restricts to the
trivial invertible module on $\Spec(A)$. It follows that for every
height $1$ prime $\mathfrak p \subset A$ there exists an element $f \in K$
such that $\text{ord}_{A_\mathfrak p}(f) = 1$ and
$\text{ord}_{A_{\mathfrak p'}}(f) = 0$ for every other
height one prime $\mathfrak p'$. Then $f \in A$ by Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}.
Arguing in the same fashion we see that every element $g \in \mathfrak p$
is of the form $g = af$ for some $a \in A$. Thus we see that every
height one prime ideal of $A$ is principal and $A$ is a UFD
by Algebra, Lemma \ref{algebra-lemma-characterize-UFD-height-1}.
\end{proof}







\section{More on invertible modules}
\label{section-invertible-modules}

\noindent
In this section we discuss some properties of invertible modules.

\begin{lemma}
\label{lemma-in-image-pullback}
Let $\varphi : X \to Y$ be a morphism of schemes. Let $\mathcal{L}$
be an invertible $\mathcal{O}_X$-module. Assume that
\begin{enumerate}
\item $X$ is locally Noetherian,
\item $Y$ is locally Noetherian, integral, and normal,
\item $\varphi$ is flat with integral (hence nonempty) fibres,
\item $\varphi$ is either quasi-compact or locally of finite type,
\item $\mathcal{L}$ is trivial when restricted to the generic fibre of
$\varphi$.
\end{enumerate}
Then $\mathcal{L} \cong \varphi^*\mathcal{N}$ for some invertible
$\mathcal{O}_Y$-module $\mathcal{N}$.
\end{lemma}

\begin{proof}
Let $\xi \in Y$ be the generic point. Let $X_\xi$ be the scheme theoretic
fibre of $\varphi$ over $\xi$. Denote $\mathcal{L}_\xi$ the pullback of
$\mathcal{L}$ to $X_\xi$. Assumption (5) means that $\mathcal{L}_\xi$
is trivial. Choose a trivializing section
$s \in \Gamma(X_\xi, \mathcal{L}_\xi)$. Observe that $X$ is integral by
Lemma \ref{lemma-flat-over-integral-integral-fibre}.
Hence we can think of $s$ as a regular meromorphic section of $\mathcal{L}$.
Pullbacks of meromorphic functions are defined for
$\varphi$ by Lemma \ref{lemma-pullback-meromorphic-sections-defined}.
Let $\mathcal{N} \subset \mathcal{K}_Y$ be the $\mathcal{O}_Y$-module
whose sections over an open $V \subset Y$ are those meromorphic functions
$g \in \mathcal{K}_Y(V)$ such that
$\varphi^*(g)s \in \mathcal{L}(\varphi^{-1}V)$.
A priori $\varphi^*(g)s$ is a section of $\mathcal{K}_X(\mathcal{L})$ over
$\varphi^{-1}V$. We claim that $\mathcal{N}$ is an invertible
$\mathcal{O}_Y$-module and that the map
$$
\varphi^*\mathcal{N} \longrightarrow \mathcal{L},\quad
g \longmapsto gs
$$
is an isomorphism.

\medskip\noindent
We first prove the claim in the following situation:
$X$ and $Y$ are affine and $\mathcal{L}$ trivial. Say $Y = \Spec(R)$,
$X = \Spec(A)$ and $s$ given by the element $s \in A \otimes_R K$
where $K$ is the fraction field of $R$. We can write $s = a/r$
for some nonzero $r \in R$ and $a \in A$. Since $s$ generates $\mathcal{L}$
on the generic fibre we see that there exists an $s' \in A \otimes_R K$
such that $ss' = 1$. Thus we see that $s = r'/a'$ for some
nonzero $r' \in R$ and $a' \in A$. Let
$\mathfrak p_1, \ldots, \mathfrak p_n \subset R$
be the minimal primes over $rr'$. Each $R_{\mathfrak p_i}$
is a discrete valuation ring
(Algebra, Lemmas \ref{algebra-lemma-minimal-over-1} and
\ref{algebra-lemma-criterion-normal}). By assumption
$\mathfrak q_i = \mathfrak p_i A$ is a prime. Hence
$\mathfrak q_i A_{\mathfrak q_i}$ is generated by a single element
and we find that $A_{\mathfrak q_i}$ is a discrete valuation ring as
well (Algebra, Lemma \ref{algebra-lemma-characterize-dvr}). Of course
$R_{\mathfrak p_i} \to A_{\mathfrak q_i}$ has ramification index $1$.
Let $e_i, e'_i \geq 0$ be the  valuation of $a, a'$ in $A_{\mathfrak q_i}$.
Then $e_i + e'_i$ is the valuation of $rr'$ in $R_{\mathfrak p_i}$. Note that
$$
\mathfrak p_1^{(e_1 + e'_1)} \cap \ldots \cap \mathfrak p_i^{(e_n + e'_n)} =
(rr')
$$
in $R$ by Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}.
Set
$$
I = \mathfrak p_1^{(e_1)} \cap \ldots \cap \mathfrak p_i^{(e_n)}
\quad\text{and}\quad
I' = \mathfrak p_1^{(e'_1)} \cap \ldots \cap \mathfrak p_i^{(e'_n)}
$$
so that $II' \subset (rr')$. Observe that
$$
IA =
(\mathfrak p_1^{(e_1)} \cap \ldots \cap \mathfrak p_i^{(e_n)})A =
(\mathfrak p_1A)^{(e_1)} \cap \ldots \cap (\mathfrak p_i A)^{(e_n)}
$$
by Algebra, Lemmas \ref{algebra-lemma-symbolic-power-flat-extension} and
\ref{algebra-lemma-flat-intersect-ideals}. Similarly for $I'A$. Hence
$a \in IA$ and $a' \in I'A$.
We conclude that $IA \otimes_A I'A \to rr'A$ is surjective.
By faithful flatness of $R \to A$ we find that
$I \otimes_R I' \to (rr')$ is surjective as well.
It follows that $II' = (rr')$ and $I$ and $I'$ are finite locally
free of rank $1$, see
Algebra, Lemma \ref{algebra-lemma-product-ideals-principal}.
Thus Zariski locally on $R$ we can write $I = (g)$ and $I' = (g')$
with $gg' = rr'$. Then $a = ug$ and $a' = u'g'$ for some $u, u' \in A$.
We conclude that $u, u'$ are units. Thus Zariski locally on $R$
we have $s = ug/r$ and the claim follows in this case.

\medskip\noindent
Let $y \in Y$ be a point.
Pick $x \in X$ mapping to $y$. We may apply the result of the previous
paragraph to $\Spec(\mathcal{O}_{X, x}) \to \Spec(\mathcal{O}_{Y, y})$.
We conclude there exists an element $g \in R(Y)^*$ well defined up to
multiplication by an element of $\mathcal{O}_{Y, y}^*$ such that
$\varphi^*(g)s$ generates $\mathcal{L}_x$. Hence $\varphi^*(g)s$
generates $\mathcal{L}$ in a neighbourhood $U$ of $x$.
Suppose $x'$ is a second point lying over $y$ and $g' \in R(Y)^*$ is
such that $\varphi^*(g')s$ generates $\mathcal{L}$ in an open neighbourhood
$U'$ of $x'$. Then we can choose a point
$x''$ in $U \cap U' \cap \varphi^{-1}(\{y\})$
because the fibre is irreducible. By the uniqueness for
the ring map $\mathcal{O}_{Y, y} \to \mathcal{O}_{X, x''}$
we find that $g$ and $g'$ differ (multiplicatively)
by an element in $\mathcal{O}_{Y, y}^*$. Hence we see that $\varphi^*(g)s$
is a generator for $\mathcal{L}$ on an open neighbourhood
of $\varphi^{-1}(y)$. Let $Z \subset X$ be the set of points
$z \in X$ such that $\varphi^*(g)s$ does not generate $\mathcal{L}_z$.
The arguments above show that $Z$ is closed and that $Z = \varphi^{-1}(T)$
for some subset $T \subset Y$ with $y \not \in T$. If we can show that
$T$ is closed, then $g$ will be a generator for $\mathcal{N}$ as an
$\mathcal{O}_Y$-module in the open neighbourhood $Y \setminus T$ of $y$
thereby finishing the proof (some details omitted).

\medskip\noindent
If $\varphi$ is quasi-compact, then $T$ is closed by
Morphisms, Lemma \ref{morphisms-lemma-fpqc-quotient-topology}.
If $\varphi$ is locally of finite type, then $\varphi$ is open
by Morphisms, Lemma \ref{morphisms-lemma-fppf-open}.
Then $Y \setminus T$ is open as the image of the open $X \setminus Z$.
\end{proof}

\begin{lemma}
\label{lemma-closure-effective-cartier-divisor}
Let $X$ be a locally Noetherian scheme. Let $U \subset X$ be
an open and let $D \subset U$ be an effective Cartier divisor.
If $\mathcal{O}_{X, x}$ is a UFD for all $x \in X \setminus U$,
then there exists an effective Cartier divisor $D' \subset X$
with $D = U \cap D'$.
\end{lemma}

\begin{proof}
Let $D' \subset X$ be the scheme theoretic image of the morphism $D \to X$.
Since $X$ is locally Noetherian the morphism $D \to X$ is quasi-compact, see
Properties, Lemma \ref{properties-lemma-immersion-into-noetherian}.
Hence the formation of $D'$ commutes with passing to opens in $X$ by
Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-scheme-theoretic-image}.
Thus we may assume $X = \Spec(A)$ is affine.
Let $I \subset A$ be the ideal corresponding to $D'$.
Let $\mathfrak p \subset A$ be a prime ideal corresponding to a point
of $X \setminus U$.
To finish the proof it is enough to show that $I_\mathfrak p$ is generated
by one element, see Lemma \ref{lemma-effective-Cartier-in-points}.
Thus we may replace $X$ by $\Spec(A_\mathfrak p)$, see
Morphisms, Lemma \ref{morphisms-lemma-flat-base-change-scheme-theoretic-image}.
In other words, we may assume that $X$ is the spectrum of a local
UFD $A$. Then all local rings of $A$ are UFD's. It follows that
$D = \sum a_i D_i$ with $D_i \subset U$ an integral effective Cartier divisor,
see Lemma \ref{lemma-effective-Cartier-divisor-is-a-sum}.
The generic points $\xi_i$ of $D_i$ correspond to prime ideals
$\mathfrak p_i \subset A$ of height $1$, see
Lemma \ref{lemma-effective-Cartier-codimension-1}.
Then $\mathfrak p_i = (f_i)$ for some prime element $f_i \in A$
and we conclude that $D'$ is cut out by $\prod f_i^{a_i}$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-extend-invertible-module}
Let $X$ be a locally Noetherian scheme. Let $U \subset X$ be
an open and let $\mathcal{L}$ be an invertible $\mathcal{O}_U$-module.
If $\mathcal{O}_{X, x}$ is a UFD for all $x \in X \setminus U$,
then there exists an invertible $\mathcal{O}_X$-module $\mathcal{L}'$
with $\mathcal{L} \cong \mathcal{L}'|_U$.
\end{lemma}

\begin{proof}
Choose $x \in X$, $x \not \in U$. We will show there exists an
affine open neighbourhood $W \subset X$, such that $\mathcal{L}|_{W \cap U}$
extends to an invertible sheaf on $W$. This implies by glueing of
sheaves (Sheaves, Section \ref{sheaves-section-glueing-sheaves})
that we can extend $\mathcal{L}$ to the strictly bigger open $U \cup W$.
Let $W = \Spec(A)$ be an affine open neighbourhood.
Since $U \cap W$ is quasi-affine, we see that we can write
$\mathcal{L}|_{W \cap U}$ as
$\mathcal{O}(D_1) \otimes \mathcal{O}(D_2)^{\otimes -1}$ for some
effective Cartier divisors $D_1, D_2 \subset W \cap U$, see
Lemma \ref{lemma-quasi-projective-Noetherian-pic-effective-Cartier}.
Then $D_1$ and $D_2$ extend to effective Cartier divisors of
$W$ by Lemma \ref{lemma-closure-effective-cartier-divisor}
which gives us the extension of the invertible sheaf.

\medskip\noindent
If $X$ is Noetherian (which is the case most used in practice), the above
combined with Noetherian induction finishes the proof. In the general case
we argue as follows. First, because every local ring of a point outside
of $U$ is a domain and $X$ is locally Noetherian, we see that the closure
of $U$ in $X$ is open. Thus we may assume that $U \subset X$ is dense
and schematically dense.
Now we consider the set $T$ of triples $(U', \mathcal{L}', \alpha)$
where $U \subset U' \subset X$ is an open subscheme, $\mathcal{L}'$
is an invertible $\mathcal{O}_{U'}$-module, and
$\alpha : \mathcal{L}'|_U \to \mathcal{L}$ is an isomorphism.
We endow $T$ with a partial ordering $\leq$ defined by the rule
$(U', \mathcal{L}', \alpha) \leq (U'', \mathcal{L}'', \alpha')$
if and only if $U' \subset U''$ and there exists an isomorphism
$\beta : \mathcal{L}''|_{U'} \to \mathcal{L}'$ compatible with
$\alpha$ and $\alpha'$. Observe that $\beta$ is unique (if it exists)
because $U \subset X$ is dense. The first part of the proof shows that
for any element $t = (U', \mathcal{L}', \alpha)$ of $T$ with $U' \not = X$
there exists a $t' \in T$ with $t' > t$. Hence to finish the proof it
suffices to show that Zorn's lemma applies. Thus consider a
totally ordered subset $I \subset T$. If $i \in I$ corresponds to
the triple $(U_i, \mathcal{L}_i, \alpha_i)$, then we can construct
an invertible module $\mathcal{L}'$ on $U' = \bigcup U_i$ as follows.
For $W \subset U'$ open and quasi-compact we see that
$W \subset U_i$ for some $i$ and we set
$$
\mathcal{L}'(W) = \mathcal{L}_i(W)
$$
For the transition maps we use the $\beta$'s (which are unique and hence
compose correctly). This defines an invertible $\mathcal{O}$-module
$\mathcal{L}'$ on the basis of quasi-compact opens of $U'$ which is sufficient
to define an invertible module (Sheaves, Section \ref{sheaves-section-bases}).
We omit the details.
\end{proof}

\begin{lemma}
\label{lemma-open-subscheme-UFD}
Let $R$ be a UFD. The Picard groups of the following are
trivial.
\begin{enumerate}
\item $\Spec(R)$ and any open subscheme of it.
\item $\mathbf{A}^n_R = \Spec(R[x_1, \ldots, x_n])$ and any open subscheme
of it.
\end{enumerate}
In particular, the Picard group of any open subscheme of affine
$n$-space $\mathbf{A}^n_k$ over a field $k$ is trivial.
\end{lemma}

\begin{proof}
Since $R$ is a UFD so is any localization of it and any polynomial
ring over it (Algebra, Lemma \ref{algebra-lemma-polynomial-ring-UFD}).
Thus if $U \subset \mathbf{A}^n_R$ is open, then the map
$\Pic(\mathbf{A}^n_R) \to \Pic(U)$ is surjective
by Lemma \ref{lemma-extend-invertible-module}.
The vanishing of $\Pic(\mathbf{A}^n_R)$ is equivalent to
the vanishing of the picard group of the UFD $R[x_1, \ldots, x_n]$
which is proved in
More on Algebra, Lemma \ref{more-algebra-lemma-UFD-Pic-trivial}.
\end{proof}

\begin{lemma}
\label{lemma-Pic-projective-space-UFD}
Let $R$ be a UFD. The Picard group of $\mathbf{P}^n_R$
is $\mathbf{Z}$. More precisely, there is an isomorphism
$$
\mathbf{Z} \longrightarrow \Pic(\mathbf{P}^n_R),\quad
m \longmapsto \mathcal{O}_{\mathbf{P}^n_R}(m)
$$
In particular, the Picard group of $\mathbf{P}^n_k$ of projective
space over a field $k$ is $\mathbf{Z}$.
\end{lemma}

\begin{proof}
Observe that the local rings of $X = \mathbf{P}^n_R$ are
UFDs because $X$ is covered by affine pieces isomorphic
to $\mathbf{A}^n_R$ and $R[x_1, \ldots, x_n]$ is a UFD
(Algebra, Lemma \ref{algebra-lemma-polynomial-ring-UFD}).
Hence $X$ is an integral Noetherian scheme all of whose
local rings are UFDs and we see that $\Pic(X) = \text{Cl}(X)$
by Lemma \ref{lemma-local-rings-UFD-c1-bijective}.

\medskip\noindent
The displayed map is a group homomorphism by
Constructions, Lemma \ref{constructions-lemma-apply-modules}.
The map is injective because $H^0$ of
$\mathcal{O}_X$ and $\mathcal{O}_X(m)$ are non-isomorphic $R$-modules
if $m > 0$, see Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring}.
Let $\mathcal{L}$ be an invertible module on $X$.
Consider the open $U = D_+(T_0) \cong \mathbf{A}^n_R$.
The complement $H = X \setminus U$ is a prime divisor because it is
isomorphic to $\text{Proj}(R[T_1, \ldots, T_n])$ which is
integral by the discussion in the previous paragraph.
In fact $H$ is the zero scheme of the regular global
section $T_0$ of $\mathcal{O}_X(1)$
hence $\mathcal{O}_X(1)$ maps to the class of $H$ in $\text{Cl}(X)$.
By Lemma \ref{lemma-open-subscheme-UFD} we see that
$\mathcal{L}|_U \cong \mathcal{O}_U$.
Let $s \in \mathcal{L}(U)$ be a trivializing section.
Then we can think of $s$ as a regular meromorphic section
of $\mathcal{L}$ and we see that necessarily
$\text{div}_\mathcal{L}(s) = m[H]$ for some $m \in \mathbf{Z}$
as $H$ is the only prime divisor of $X$ not meeting $U$.
In other words, we see that $\mathcal{L}$ and
$\mathcal{O}_X(m)$ map to the same element of $\text{Cl}(X)$
and hence $\mathcal{L} \cong \mathcal{O}_X(m)$
as desired.
\end{proof}






\section{Weil divisors on normal schemes}
\label{section-weil-divisors-normal}

\noindent
First we discuss properties of reflexive modules.

\begin{lemma}
\label{lemma-reflexive-normal}
Let $X$ be an integral locally Noetherian normal scheme.
For $\mathcal{F}$ and $\mathcal{G}$ coherent reflexive
$\mathcal{O}_X$-modules the map
$$
(\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{O}_X)
\otimes_{\mathcal{O}_X} \mathcal{G})^{**} \to
\SheafHom_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})
$$
is an isomorphism. The rule $\mathcal{F}, \mathcal{G} \mapsto
(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{G})^{**}$
defines an abelian group law on the set of isomorphism classes of rank $1$
coherent reflexive $\mathcal{O}_X$-modules.
\end{lemma}

\begin{proof}
Although not strictly necessary, we recommend reading
Remark \ref{remark-tensor} before proceeding with the proof.
Choose an open subscheme $j : U \to X$ such that
every irreducible component of $X \setminus U$ has codimension $\geq 2$
in $X$ and such that $j^*\mathcal{F}$ and $j^*\mathcal{G}$ are finite
locally free, see Lemma \ref{lemma-reflexive-over-normal}.
The map
$$
\SheafHom_{\mathcal{O}_U}(j^*\mathcal{F}, \mathcal{O}_U)
\otimes_{\mathcal{O}_U} j^*\mathcal{G} \to
\SheafHom_{\mathcal{O}_U}(j^*\mathcal{F}, j^*\mathcal{G})
$$
is an isomorphism, because we may check it locally and it is
clear when the modules are finite free. Observe that $j^*$
applied to the displayed arrow of the lemma gives the arrow
we've just shown is an isomorphism (small detail omitted).
Since $j^*$ defines an equivalence between coherent reflexive modules on $U$
and coherent reflexive modules on $X$
(by Lemma \ref{lemma-reflexive-S2-extend} and Serre's criterion
Properties, Lemma \ref{properties-lemma-criterion-normal}),
we conclude that the arrow of the lemma is an isomorphism too.
If $\mathcal{F}$ has rank $1$, then $j^*\mathcal{F}$
is an invertible $\mathcal{O}_U$-module and the reflexive module
$\mathcal{F}^\vee = \SheafHom(\mathcal{F}, \mathcal{O}_X)$
restricts to its inverse. It follows in the same manner as before that
$(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{F}^\vee)^{**} = \mathcal{O}_X$.
In this way we see that we have inverses for the group law
given in the statement of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-normal-class-group}
Let $X$ be an integral locally Noetherian normal scheme.
The group of rank $1$ coherent reflexive $\mathcal{O}_X$-modules
is isomorphic to the Weil divisor class group $\text{Cl}(X)$ of $X$.
\end{lemma}

\begin{proof}
Let $\mathcal{F}$ be a rank $1$ coherent reflexive $\mathcal{O}_X$-module.
Choose an open $U \subset X$ such that
every irreducible component of $X \setminus U$ has codimension $\geq 2$
in $X$ and such that $\mathcal{F}|_U$ is invertible, see
Lemma \ref{lemma-reflexive-over-normal}.
Observe that $\text{Cl}(U) = \text{Cl}(X)$
as the Weil divisor class group of $X$ only depends on
its field of rational functions and the points of
codimension $1$ and their local rings.
Thus we can define the Weil divisor class of $\mathcal{F}$
to be the Weil divisor class of $\mathcal{F}|_U$
in $\text{Cl}(U)$. We omit the verification that this
is independent of the choice of $U$.

\medskip\noindent
Denote $\text{Cl}'(X)$ the set of isomorphism classes of
rank $1$ coherent reflexive $\mathcal{O}_X$-modules. The
construction above gives a group homorphism
$$
\text{Cl}'(X) \longrightarrow \text{Cl}(X)
$$
because for any pair $\mathcal{F}, \mathcal{G}$ of elements
of $\text{Cl}'(X)$ we can choose a $U$ which works for both
and the assignment (\ref{equation-c1}) sending an invertible
module to its Weil divisor class is a homorphism.
If $\mathcal{F}$ is in the kernel of this map, then we find that
$\mathcal{F}|_U$ is trivial (Lemma \ref{lemma-normal-c1-injective})
and hence $\mathcal{F}$ is trivial too by
Lemma \ref{lemma-reflexive-S2-extend} and Serre's criterion
Properties, Lemma \ref{properties-lemma-criterion-normal}.
To finish the proof it suffices to check the map is surjective.

\medskip\noindent
Let $D = \sum n_Z Z$ be a Weil divisor on $X$.
We claim that there is an open $U \subset X$ such that
every irreducible component of $X \setminus U$ has codimension $\geq 2$
in $X$ and such that $Z|_U$ is an effective Cartier divisor
for $n_Z \not = 0$. To prove the claim we may assume $X$ is affine.
Then we may assume $D = n_1 Z_1 + \ldots + n_r Z_r$ is a finite sum
with $Z_1, \ldots, Z_r$ pairwise distinct. After throwing out
$Z_i \cap Z_j$ for $i \not = j$ we may assume $Z_1, \ldots, Z_r$
are pairwise disjoint. This reduces us to the case of a single
prime divisor $Z$ on $X$. As $X$ is $(R_1)$ by
Properties, Lemma \ref{properties-lemma-criterion-normal}
the local ring
$\mathcal{O}_{X, \xi}$ at the generic point $\xi$ of $Z$ is a discrete
valuation ring. Let $f \in \mathcal{O}_{X, \xi}$ be a uniformizer.
Let $V \subset X$ be an open neighbourhood of $\xi$ such that
$f$ is the image of an element $f \in \mathcal{O}_X(V)$.
After shrinking $V$ we may assume that $Z \cap V = V(f)$
scheme theoretically, since this is true in the local ring
at $\xi$. In this case taking
$$
U = X \setminus (Z \setminus V) = (X \setminus Z) \cup V
$$
gives the desired open, thereby proving the claim.

\medskip\noindent
In order to show that the divisor class of $D$ is in the image,
we may write $D = \sum_{n_Z < 0} n_Z Z - \sum_{n_Z > 0} (-n_Z) Z$.
By additivity of the map constructed above, we
may and do assume $n_Z \leq 0$ for all prime divisors $Z$
(this step may be avoided if the reader so desires).
Let $U \subset X$ be as in the claim above. If $U$ is quasi-compact,
then we write $D|_U = -n_1 Z_1 - \ldots - n_r Z_r$ for
pairwise distinct prime divisors $Z_i$ and $n_i > 0$ and
we consider the invertible $\mathcal{O}_U$-module
$$
\mathcal{L} =
\mathcal{I}_1^{n_1} \ldots \mathcal{I}_r^{n_r} \subset \mathcal{O}_U
$$
where $\mathcal{I}_i$ is the ideal sheaf of $Z_i$.
This is invertible by our choice of $U$ and
Lemma \ref{lemma-sum-effective-Cartier-divisors}.
Also $\text{div}_\mathcal{L}(1) = D|_U$.
Since $\mathcal{L} = \mathcal{F}|_U$ for some rank $1$ coherent
reflexive $\mathcal{O}_X$-module $\mathcal{F}$ by
Lemma \ref{lemma-reflexive-S2-extend} we find that $D$ is
in the image of our map.

\medskip\noindent
If $U$ is not quasi-compact, then we define
$\mathcal{L} \subset \mathcal{O}_U$ locally by the displayed formula
above. The reader shows that the construction glues and
finishes the proof exactly as before. Details omitted.
\end{proof}

\begin{lemma}
\label{lemma-structure-sheaf-Xs}
Let $X$ be an integral locally Noetherian normal scheme.
Let $\mathcal{F}$ be a rank 1 coherent reflexive $\mathcal{O}_X$-module.
Let $s \in \Gamma(X, \mathcal{F})$. Let
$$
U = \{x \in X \mid s : \mathcal{O}_{X, x} \to \mathcal{F}_x
\text{ is an isomorphism}\}
$$
Then $j : U \to X$ is an open subscheme of $X$ and
$$
j_*\mathcal{O}_U =
\colim (\mathcal{O}_X \xrightarrow{s} \mathcal{F}
\xrightarrow{s} \mathcal{F}^{[2]}
\xrightarrow{s} \mathcal{F}^{[3]}
\xrightarrow{s} \ldots)
$$
where $\mathcal{F}^{[1]} = \mathcal{F}$ and
inductively $\mathcal{F}^{[n + 1]} =
(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{F}^{[n]})^{**}$.
\end{lemma}

\begin{proof}
The set $U$ is open by Modules, Lemmas
\ref{modules-lemma-finite-type-surjective-on-stalk} and
\ref{modules-lemma-finite-type-to-coherent-injective-on-stalk}.
Observe that $j$ is quasi-compact by
Properties, Lemma \ref{properties-lemma-immersion-into-noetherian}.
To prove the final statement it suffices to show for every
quasi-compact open $W \subset X$ there is an isomorphism
$$
\colim \Gamma(W, \mathcal{F}^{[n]})
\longrightarrow
\Gamma(U \cap W, \mathcal{O}_U)
$$
of $\mathcal{O}_X(W)$-modules compatible with restriction maps.
We will omit the verification of compatibilities.
After replacing $X$ by $W$ and rewriting the above in
terms of homs, we see that it suffices to construct an isomorphism
$$
\colim \Hom_{\mathcal{O}_X}(\mathcal{O}_X, \mathcal{F}^{[n]})
\longrightarrow
\Hom_{\mathcal{O}_U}(\mathcal{O}_U, \mathcal{O}_U)
$$
Choose an open $V \subset X$ such that every irreducible component of
$X \setminus V$ has codimension $\geq 2$ in $X$ and such that
$\mathcal{F}|_V$ is invertible, see Lemma \ref{lemma-reflexive-over-normal}.
Then restriction defines an equivalence of categories
between rank $1$ coherent reflexive modules on $X$ and $V$
and between rank $1$ coherent reflexive modules on $U$ and $V \cap U$.
See Lemma \ref{lemma-reflexive-S2-extend} and Serre's criterion
Properties, Lemma \ref{properties-lemma-criterion-normal}.
Thus it suffices to construct an isomorphism
$$
\colim \Gamma(V, (\mathcal{F}|_V)^{\otimes n}) \longrightarrow
\Gamma(V \cap U, \mathcal{O}_U)
$$
Since $\mathcal{F}|_V$ is invertible and since $U \cap V$ is
equal to the set of points where $s|_V$ generates this invertible module,
this is a special case of
Properties, Lemma \ref{properties-lemma-invert-s-sections}
(there is an explicit formula for the map as well).
\end{proof}

\begin{lemma}
\label{lemma-Xs-codim-complement}
Assumptions and notation as in Lemma \ref{lemma-structure-sheaf-Xs}.
If $s$ is nonzero, then every irreducible component of $X \setminus U$
has codimension $1$ in $X$.
\end{lemma}

\begin{proof}
Let $\xi \in X$ be a generic point of an irreducible component $Z$ of
$X \setminus U$. After replacing $X$ by an open neighbourhood of
$\xi$ we may assume that $Z = X \setminus U$ is irreducible. Since
$s : \mathcal{O}_U \to \mathcal{F}|_U$ is an isomorphism, if
the codimension of $Z$ in $X$ is $\geq 2$, then
$s : \mathcal{O}_X \to \mathcal{F}$ is an isomorphism by
Lemma \ref{lemma-reflexive-S2-extend} and Serre's criterion
Properties, Lemma \ref{properties-lemma-criterion-normal}.
This would mean that $Z = \emptyset$, a contradiction.
\end{proof}

\begin{remark}
\label{remark-structure-sheaf-Xs}
Let $A$ be a Noetherian normal domain. Let $M$ be a rank $1$ finite reflexive
$A$-module. Let $s \in M$ be nonzero. Let $\mathfrak p_1, \ldots, \mathfrak p_r$
be the height $1$ primes of $A$ in the support of $M/As$.
Then the open $U$ of Lemma \ref{lemma-structure-sheaf-Xs} is
$$
U = \Spec(A) \setminus
\left(V(\mathfrak p_1) \cup \ldots \cup V(\mathfrak p_r)\right)
$$
by Lemma \ref{lemma-Xs-codim-complement}. Moreover, if $M^{[n]}$
denotes the reflexive hull of $M \otimes_A \ldots \otimes_A M$
($n$-factors), then
$$
\Gamma(U, \mathcal{O}_U) = \colim M^{[n]}
$$
according to Lemma \ref{lemma-structure-sheaf-Xs}.
\end{remark}

\begin{lemma}
\label{lemma-affine-Xs}
Assumptions and notation as in Lemma \ref{lemma-structure-sheaf-Xs}.
The following are equivalent
\begin{enumerate}
\item the inclusion morphism $j : U \to X$ is affine, and
\item for every $x \in X \setminus U$ there is an $n > 0$
such that $s^n \in \mathfrak m_x \mathcal{F}^{[n]}_x$.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1). Then for $x \in X \setminus U$ the inverse image $U_x$ of $U$
under the canonical morphism $f_x : \Spec(\mathcal{O}_{X, x}) \to X$ is affine
and does not contain $x$. Thus $\mathfrak m_x \Gamma(U_x, \mathcal{O}_{U_x})$
is the unit ideal. In particular, we see that we can write
$$
1 = \sum f_i g_i
$$
with $f_i \in \mathfrak m_x$ and $g_i \in \Gamma(U_x, \mathcal{O}_{U_x})$.
By Lemma \ref{lemma-structure-sheaf-Xs} we have
$\Gamma(U_x, \mathcal{O}_{U_x}) = \colim \mathcal{F}^{[n]}_x$
with transition maps given by multiplication by $s$.
Hence for some $n > 0$ we have
$$
s^n = \sum f_i t_i
$$
for some $t_i = s^ng_i \in \mathcal{F}^{[n]}_x$. Thus (2) holds.

\medskip\noindent
Conversely, assume that (2) holds. To prove $j$ is affine is local on $X$,
see Morphisms, Lemma \ref{morphisms-lemma-characterize-affine}.
Thus we may and do assume that $X$ is affine. Our goal is to
show that $U$ is affine.
By Cohomology of Schemes, Lemma \ref{coherent-lemma-affine-if-quasi-affine}
it suffices to show that $H^p(U, \mathcal{O}_U) = 0$ for $p > 0$.
Since $H^p(U, \mathcal{O}_U) = H^0(X, R^pj_*\mathcal{O}_U)$
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images-application})
and since $R^pj_*\mathcal{O}_U$ is quasi-coherent
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images})
it is enough to show the stalk $(R^pj_*\mathcal{O}_U)_x$
at a point $x \in X$ is zero. Consider the base change diagram
$$
\xymatrix{
U_x \ar[d]_{j_x} \ar[r] & U \ar[d]^j \\
\Spec(\mathcal{O}_{X, x}) \ar[r] & X
}
$$
By Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology} we have
$(R^pj_*\mathcal{O}_U)_x = R^pj_{x, *}\mathcal{O}_{U_x}$.
Hence we may assume $X$ is local with closed point $x$
and we have to show $U$ is affine (because this is equivalent to
the desired vanishing by the reference given above).
In particular $d = \dim(X)$ is finite
(Algebra, Proposition \ref{algebra-proposition-dimension}).
If $x \in U$, then $U = X$ and the result is clear.
If $d = 0$ and $x \not \in U$, then $U = \emptyset$
and the result is clear. Now assume $d > 0$ and $x \not \in U$.
Since $j_*\mathcal{O}_U = \colim \mathcal{F}^{[n]}$
our assumption means that we can write
$$
1 = \sum f_i g_i
$$
for some $n > 0$, $f_i \in \mathfrak m_x$, and $g_i \in \mathcal{O}(U)$.
By induction on $d$ we know that $D(f_i) \cap U$ is affine
for all $i$: going through the whole argument just given with
$X$ replaced by $D(f_i)$ we end up with Noetherian local rings
whose dimension is strictly smaller than $d$. Hence $U$
is affine by Properties, Lemma \ref{properties-lemma-characterize-affine}
as desired.
\end{proof}





\section{Relative Proj}
\label{section-relative-proj}

\noindent
Some results on relative Proj.
First some very basic results. Recall that a relative Proj is always
separated over the base, see
Constructions, Lemma \ref{constructions-lemma-relative-proj-separated}.

\begin{lemma}
\label{lemma-relative-proj-quasi-compact}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If one of the following holds
\begin{enumerate}
\item $\mathcal{A}$ is of finite type as a sheaf of
$\mathcal{A}_0$-algebras,
\item $\mathcal{A}$ is generated by $\mathcal{A}_1$ as an
$\mathcal{A}_0$-algebra and $\mathcal{A}_1$ is a finite type
$\mathcal{A}_0$-module,
\item there exists a finite type quasi-coherent $\mathcal{A}_0$-submodule
$\mathcal{F} \subset \mathcal{A}_{+}$ such that
$\mathcal{A}_{+}/\mathcal{F}\mathcal{A}$ is a locally nilpotent
sheaf of ideals of $\mathcal{A}/\mathcal{F}\mathcal{A}$,
\end{enumerate}
then $p$ is quasi-compact.
\end{lemma}

\begin{proof}
The question is local on the base, see
Schemes, Lemma \ref{schemes-lemma-quasi-compact-affine}.
Thus we may assume $S$ is affine.
Say $S = \Spec(R)$ and $\mathcal{A}$ corresponds to the
graded $R$-algebra $A$. Then $X = \text{Proj}(A)$, see
Constructions, Section \ref{constructions-section-relative-proj-via-glueing}.
In case (1) we may after possibly localizing more
assume that $A$ is generated by homogeneous elements
$f_1, \ldots, f_n \in A_{+}$ over $A_0$. Then
$A_{+} = (f_1, \ldots, f_n)$ by
Algebra, Lemma \ref{algebra-lemma-S-plus-generated}.
In case (3) we see that $\mathcal{F} = \widetilde{M}$
for some finite type $A_0$-module $M \subset A_{+}$. Say
$M = \sum A_0f_i$. Say $f_i = \sum f_{i, j}$ is the decomposition
into homogeneous pieces. The condition in (3) signifies that
$A_{+} \subset \sqrt{(f_{i, j})}$. Thus in both cases we conclude that
$\text{Proj}(A)$ is quasi-compact by
Constructions, Lemma \ref{constructions-lemma-proj-quasi-compact}.
Finally, (2) follows from (1).
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-finite-type}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If $\mathcal{A}$ is of finite type as a sheaf of
$\mathcal{O}_S$-algebras, then $p$ is of finite type and $\mathcal{O}_X(d)$
is a finite type $\mathcal{O}_X$-module.
\end{lemma}

\begin{proof}
The assumption implies that $p$ is quasi-compact, see
Lemma \ref{lemma-relative-proj-quasi-compact}. Hence it suffices
to show that $p$ is locally of finite type.
Thus the question is local on the base and target, see
Morphisms, Lemma \ref{morphisms-lemma-locally-finite-type-characterize}.
Say $S = \Spec(R)$ and $\mathcal{A}$ corresponds to the
graded $R$-algebra $A$. After further localizing on $S$ we may
assume that $A$ is a finite type $R$-algebra. The scheme $X$ is constructed
out of glueing the spectra of the rings $A_{(f)}$ for $f \in A_{+}$
homogeneous. Each of these is of finite type over $R$ by
Algebra, Lemma \ref{algebra-lemma-dehomogenize-finite-type} part (1).
Thus $\text{Proj}(A)$ is of finite type over $R$.
To see the statement on $\mathcal{O}_X(d)$ use part (2) of
Algebra, Lemma \ref{algebra-lemma-dehomogenize-finite-type}.
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-universally-closed}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If $\mathcal{O}_S \to \mathcal{A}_0$
is an integral algebra map\footnote{In other words, the integral
closure of $\mathcal{O}_S$ in $\mathcal{A}_0$, see
Morphisms, Definition \ref{morphisms-definition-integral-closure}, equals
$\mathcal{A}_0$.} and $\mathcal{A}$ is of finite type as an
$\mathcal{A}_0$-algebra, then $p$ is universally closed.
\end{lemma}

\begin{proof}
The question is local on the base. Thus we may assume that $X = \Spec(R)$
is affine. Let $\mathcal{A}$ be the quasi-coherent $\mathcal{O}_X$-algebra
associated to the graded $R$-algebra $A$. The assumption is that $R \to A_0$
is integral and $A$ is of finite type over $A_0$.
Write $X \to \Spec(R)$ as the composition $X \to \Spec(A_0) \to \Spec(R)$.
Since $R \to A_0$ is an integral ring map, we see that
$\Spec(A_0) \to \Spec(R)$ is universally closed, see
Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}.
The quasi-compact (see
Constructions, Lemma \ref{constructions-lemma-proj-quasi-compact}) morphism
$$
X = \text{Proj}(A) \to \Spec(A_0)
$$
satisfies the existence part of the valuative criterion by
Constructions, Lemma \ref{constructions-lemma-proj-valuative-criterion}
and hence it is universally closed by
Schemes, Proposition \ref{schemes-proposition-characterize-universally-closed}.
Thus $X \to \Spec(R)$ is universally closed as a composition of
universally closed morphisms.
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-proper}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. The following conditions are equivalent
\begin{enumerate}
\item $\mathcal{A}_0$ is a finite type $\mathcal{O}_S$-module
and $\mathcal{A}$ is of finite type as an $\mathcal{A}_0$-algebra,
\item $\mathcal{A}_0$ is a finite type $\mathcal{O}_S$-module
and $\mathcal{A}$ is of finite type as an $\mathcal{O}_S$-algebra
\end{enumerate}
If these conditions hold, then $p$ is locally projective and in
particular proper.
\end{lemma}

\begin{proof}
Assume that $\mathcal{A}_0$ is a finite type $\mathcal{O}_S$-module.
Choose an affine open $U = \Spec(R) \subset X$ such that $\mathcal{A}$
corresponds to a graded $R$-algebra $A$ with $A_0$ a finite $R$-module.
Condition (1) means that (after possibly localizing further on $S$)
that $A$ is a finite type $A_0$-algebra and condition (2) means that
(after possibly localizing further on $S$) that $A$ is a finite type
$R$-algebra. Thus these conditions imply each other by
Algebra, Lemma \ref{algebra-lemma-compose-finite-type}.

\medskip\noindent
A locally projective morphism is proper, see
Morphisms, Lemma \ref{morphisms-lemma-locally-projective-proper}.
Thus we may now assume that $S = \Spec(R)$ and $X = \text{Proj}(A)$
and that $A_0$ is finite over $R$ and $A$ of finite type over $R$.
We will show that $X = \text{Proj}(A) \to \Spec(R)$ is projective.
We urge the reader to prove this for themselves, by directly constructing
a closed immersion of $X$ into a projective space over $R$, instead
of reading the argument we give below.

\medskip\noindent
By Lemma \ref{lemma-relative-proj-finite-type}
we see that $X$ is of finite type over $\Spec(R)$.
Constructions, Lemma \ref{constructions-lemma-ample-on-proj}
tells us that $\mathcal{O}_X(d)$ is ample on $X$ for some $d \geq 1$
(see Properties, Section \ref{properties-section-ample}).
Hence $X \to \Spec(R)$ is quasi-projective (by
Morphisms, Definition \ref{morphisms-definition-quasi-projective}).
By Morphisms, Lemma \ref{morphisms-lemma-quasi-projective-open-projective}
we conclude that $X$ is isomorphic to an open subscheme of a scheme
projective over $\Spec(R)$. Therefore, to finish the proof, it suffices
to show that $X \to \Spec(R)$ is universally closed (use
Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}).
This follows from Lemma \ref{lemma-relative-proj-universally-closed}.
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-projective}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If $\mathcal{A}$ is generated by
$\mathcal{A}_1$ over $\mathcal{A}_0$ and $\mathcal{A}_1$
is a finite type $\mathcal{O}_S$-module, then $p$ is projective.
\end{lemma}

\begin{proof}
Namely, the morphism associated to the graded $\mathcal{O}_S$-algebra map
$$
\text{Sym}_{\mathcal{O}_X}^*(\mathcal{A}_1)
\longrightarrow
\mathcal{A}
$$
is a closed immersion $X \to \mathbf{P}(\mathcal{A}_1)$, see
Constructions, Lemma
\ref{constructions-lemma-surjective-generated-degree-1-map-relative-proj}.
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-flat}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If $\mathcal{A}_d$ is a flat $\mathcal{O}_S$-module
for $d \gg 0$, then $p$ is flat and $\mathcal{O}_X(d)$ is
flat over $S$.
\end{lemma}

\begin{proof}
Affine locally flatness of $X$ over $S$ reduces to the following statement:
Let $R$ be a ring, let $A$ be a graded $R$-algebra with
$A_d$ flat over $R$ for $d \gg 0$, let $f \in A_d$
for some $d > 0$, then $A_{(f)}$ is flat over $R$.
Since $A_{(f)} = \colim A_{nd}$ where the transition maps
are given by multiplication by $f$, this follows from
Algebra, Lemma \ref{algebra-lemma-colimit-flat}.
Argue similarly to get flatness of $\mathcal{O}_X(d)$ over $S$.
\end{proof}

\begin{lemma}
\label{lemma-relative-proj-finite-presentation}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. If $\mathcal{A}$ is a finitely presented
$\mathcal{O}_S$-algebra, then $p$ is of finite presentation
and $\mathcal{O}_X(d)$ is an $\mathcal{O}_X$-module of finite presentation.
\end{lemma}

\begin{proof}
Affine locally this reduces to the following statement:
Let $R$ be a ring and let $A$ be a finitely presented graded $R$-algebra.
Then $\text{Proj}(A) \to \Spec(R)$ is of finite presentation
and $\mathcal{O}_{\text{Proj}(A)}(d)$ is a
$\mathcal{O}_{\text{Proj}(A)}$-module of finite presentation.
The finite presentation condition implies we can choose
a presentation
$$
A = R[X_1, \ldots, X_n]/(F_1, \ldots, F_m)
$$
where $R[X_1, \ldots, X_n]$ is a polynomial ring graded by giving
weights $d_i$ to $X_i$ and $F_1, \ldots, F_m$ are homogeneous polynomials
of degree $e_j$. Let $R_0 \subset R$ be the subring generated by
the coefficients of the polynomials $F_1, \ldots, F_m$.
Then we set $A_0 = R_0[X_1, \ldots, X_n]/(F_1, \ldots, F_m)$.
By construction $A = A_0 \otimes_{R_0} R$.
Thus by
Constructions, Lemma \ref{constructions-lemma-base-change-map-proj}
it suffices to prove the result for $X_0 = \text{Proj}(A_0)$ over $R_0$.
By Lemma \ref{lemma-relative-proj-finite-type}
we know $X_0$ is of finite type over $R_0$ and
$\mathcal{O}_{X_0}(d)$ is a quasi-coherent $\mathcal{O}_{X_0}$-module
of finite type.
Since $R_0$ is Noetherian (as a finitely generated $\mathbf{Z}$-algebra)
we see that $X_0$ is of finite presentation over $R_0$
(Morphisms, Lemma
\ref{morphisms-lemma-noetherian-finite-type-finite-presentation})
and $\mathcal{O}_{X_0}(d)$ is of finite presentation by
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-Noetherian}.
This finishes the proof.
\end{proof}










\section{Closed subschemes of relative proj}
\label{section-closed-in-relative-proj}

\noindent
Some auxiliary lemmas about closed subschemes of relative proj.

\begin{lemma}
\label{lemma-closed-subscheme-proj}
Let $S$ be a scheme. Let $\mathcal{A}$ be a quasi-coherent graded
$\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. Let $i : Z \to X$ be a closed subscheme. Denote
$\mathcal{I} \subset \mathcal{A}$ the kernel of the canonical map
$$
\mathcal{A}
\longrightarrow
\bigoplus\nolimits_{d \geq 0} p_*\left((i_*\mathcal{O}_Z)(d)\right).
$$
If $p$ is quasi-compact, then there is an isomorphism
$Z = \underline{\text{Proj}}_S(\mathcal{A}/\mathcal{I})$.
\end{lemma}

\begin{proof}
The morphism $p$ is separated by
Constructions, Lemma \ref{constructions-lemma-relative-proj-separated}.
As $p$ is quasi-compact, $p_*$ transforms quasi-coherent modules
into quasi-coherent modules, see
Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}.
Hence $\mathcal{I}$ is a quasi-coherent $\mathcal{O}_S$-module.
In particular, $\mathcal{B} = \mathcal{A}/\mathcal{I}$ is a
quasi-coherent graded $\mathcal{O}_S$-algebra. The functoriality
morphism $Z' = \underline{\text{Proj}}_S(\mathcal{B}) \to
\underline{\text{Proj}}_S(\mathcal{A})$ is everywhere defined and
a closed immersion, see Constructions, Lemma
\ref{constructions-lemma-surjective-graded-rings-map-relative-proj}.
Hence it suffices to prove $Z = Z'$ as closed subschemes of $X$.

\medskip\noindent
Having said this, the question is local on the base and we may assume
that $S = \Spec(R)$ and that $X = \text{Proj}(A)$ for some
graded $R$-algebra $A$. Assume $\mathcal{I} = \widetilde{I}$
for $I \subset A$ a graded ideal. By
Constructions, Lemma \ref{constructions-lemma-proj-quasi-compact}
there exist $f_0, \ldots, f_n \in A_{+}$ such that
$A_{+} \subset \sqrt{(f_0, \ldots, f_n)}$ in other words
$X = \bigcup D_{+}(f_i)$. Therefore, it suffices to check that
$Z \cap D_{+}(f_i) = Z' \cap D_{+}(f_i)$ for each $i$.
By renumbering we may assume $i = 0$.
Say $Z \cap D_{+}(f_0)$, resp.\ $Z' \cap D_{+}(f_0)$
is cut out by the ideal $J$, resp.\ $J'$ of $A_{(f_0)}$.

\medskip\noindent
The inclusion $J' \subset J$.
Let $d$ be the least common multiple of $\deg(f_0), \ldots, \deg(f_n)$.
Note that each of the twists $\mathcal{O}_X(nd)$ is invertible, trivialized
by $f_i^{nd/\deg(f_i)}$ over $D_{+}(f_i)$, and that for any quasi-coherent
module $\mathcal{F}$ on $X$ the multiplication maps
$\mathcal{O}_X(nd) \otimes_{\mathcal{O}_X} \mathcal{F}(m)
\to \mathcal{F}(nd + m)$ are isomorphisms, see
Constructions, Lemma \ref{constructions-lemma-when-invertible}.
Observe that $J'$ is the ideal generated by the elements $g/f_0^e$ where
$g \in I$ is homogeneous of degree $e\deg(f_0)$ (see proof of
Constructions, Lemma
\ref{constructions-lemma-surjective-graded-rings-map-proj}).
Of course, by replacing $g$ by $f_0^lg$ for suitable $l$
we may always assume that $d | e$. Then, since $g$ vanishes as a section of
$\mathcal{O}_X(e\deg(f_0))$ restricted to $Z$ we see that
$g/f_0^d$ is an element of $J$. Thus $J' \subset J$.

\medskip\noindent
Conversely, suppose that $g/f_0^e \in J$. Again we may assume $d | e$.
Pick $i \in \{1, \ldots, n\}$. Then $Z \cap D_{+}(f_i)$ is
cut out by some ideal $J_i \subset A_{(f_i)}$. Moreover,
$$
J \cdot A_{(f_0f_i)} = J_i \cdot A_{(f_0f_i)}.
$$
The right hand side is the localization of $J_i$ with respect to
$f_0^{\deg(f_i)}/f_i^{\deg(f_0)}$. It follows that
$$
f_0^{e_i}g/f_i^{(e_i + e)\deg(f_0)/\deg(f_i)} \in J_i
$$
for some $e_i \gg 0$ sufficiently divisible. This proves that
$f_0^{\max(e_i)}g$ is an element of $I$, because its restriction to each
affine open $D_{+}(f_i)$ vanishes on the closed subscheme
$Z \cap D_{+}(f_i)$. Hence $g/f_0^e \in J'$ and we conclude $J \subset J'$
as desired.
\end{proof}

\begin{example}
\label{example-closed-subscheme-of-proj}
Let $A$ be a graded ring. Let $X = \text{Proj}(A)$ and $S = \Spec(A_0)$.
Given a graded ideal $I \subset A$ we obtain a closed subscheme
$V_+(I) = \text{Proj}(A/I) \to X$ by Constructions, Lemma
\ref{constructions-lemma-surjective-graded-rings-map-proj}.
Translating the result of Lemma \ref{lemma-closed-subscheme-proj}
we see that if $X$ is quasi-compact, then any closed subscheme $Z$
is of the form $V_+(I(Z))$ where the graded ideal $I(Z) \subset A$
is given by the rule
$$
I(Z) = \Ker(A \longrightarrow
\bigoplus\nolimits_{n \geq 0} \Gamma(Z, \mathcal{O}_Z(n)))
$$
Then we can ask the following two natural questions:
\begin{enumerate}
\item Which ideals $I$ are of the form $I(Z)$?
\item Can we describe the operation $I \mapsto I(V_+(I))$?
\end{enumerate}
We will answer this when $A$ is Noetherian.

\medskip\noindent
First, assume that $A$ is generated by $A_1$ over $A_0$. In this case,
for any ideal $I \subset A$ the kernel of the map
$A/I \to \bigoplus \Gamma(\text{Proj}(A/I), \mathcal{O})$
is the set of torsion elements of $A/I$, see
Cohomology of Schemes, Proposition
\ref{coherent-proposition-coherent-modules-on-proj}.
Hence we conclude that
$$
I(V_+(I)) = \{x \in A \mid A_n x \subset I\text{ for some }n \geq 0\}
$$
The ideal on the right is sometimes called the saturation of $I$.
This answers (2) and the answer to (1) is that an ideal is
of the form $I(Z)$ if and only if it is saturated, i.e., equal
to its own saturation.

\medskip\noindent
If $A$ is a general Noetherian graded ring, then we use
Cohomology of Schemes, Proposition
\ref{coherent-proposition-coherent-modules-on-proj-general}.
Thus we see that for $d$ equal to the lcm of the degrees
of generators of $A$ over $A_0$ we get
$$
I(V_+(I)) = \{x \in A \mid (Ax)_{nd} \subset I\text{ for all }n \gg 0\}
$$
This can be different from the saturation of $I$ if $d \not = 1$.
For example, suppose that $A = \mathbf{Q}[x, y]$
with $\deg(x) = 2$ and $\deg(y) = 3$. Then $d = 6$.
Let $I = (y^2)$. Then we see $y \in I(V_+(I))$ because
for any homogeneous $f \in A$ such that $6 | \deg(fy)$
we have $y | f$, hence $fy \in I$. It follows that
$I(V_+(I)) = (y)$ but $x^n y \not \in I$ for all $n$
hence $I(V_+(I))$ is not equal to the saturation.
\end{example}

\begin{lemma}
\label{lemma-equation-codim-1-in-projective-space}
Let $R$ be a UFD. Let $Z \subset \mathbf{P}^n_R$ be a closed subscheme
which has no embedded points such that every irreducible component
of $Z$ has codimension $1$ in $\mathbf{P}^n_R$.
Then the ideal $I(Z) \subset R[T_0, \ldots, T_n]$ corresponding
to $Z$ is principal.
\end{lemma}

\begin{proof}
Observe that the local rings of $X = \mathbf{P}^n_R$ are
UFDs because $X$ is covered by affine pieces isomorphic
to $\mathbf{A}^n_R$ and $R[x_1, \ldots, x_n]$ is a UFD
(Algebra, Lemma \ref{algebra-lemma-polynomial-ring-UFD}).
Thus $Z$ is an effective Cartier divisor by
Lemma \ref{lemma-codimension-1-is-effective-Cartier}.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the quasi-coherent
sheaf of ideals corresponding to $Z$.
Choose an isomorphism $\mathcal{O}(m) \to \mathcal{I}$
for some $m \in \mathbf{Z}$, see
Lemma \ref{lemma-Pic-projective-space-UFD}.
Then the composition
$$
\mathcal{O}_X(m) \to \mathcal{I} \to \mathcal{O}_X
$$
is nonzero. We conclude that $m \leq 0$ and that the corresponding
section of $\mathcal{O}_X(m)^{\otimes -1} = \mathcal{O}_X(-m)$
is given by some $F \in R[T_0, \ldots, T_n]$ of degree $-m$, see
Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring}.
Thus on the $i$th standard open $U_i = D_+(T_i)$ the
closed subscheme $Z \cap U_i$ is cut out by the ideal
$$
(F(T_0/T_i, \ldots, T_n/T_i)) \subset R[T_0/T_i, \ldots, T_n/T_i]
$$
Thus the homogeneous elements of the graded ideal
$I(Z) = \Ker(R[T_0, \ldots, T_n] \to \bigoplus \Gamma(\mathcal{O}_Z(m)))$
is the set of homogeneous polynomials $G$ such that
$$
G(T_0/T_i, \ldots, T_n/T_i) \in (F(T_0/T_i, \ldots, T_n/T_i))
$$
for $i = 0, \ldots, n$. Clearing denominators, we see there exist
$e_i \geq 0$ such that
$$
T_i^{e_i}G \in (F)
$$
for $i = 0, \ldots, n$. As $R$ is a UFD, so is $R[T_0, \ldots, T_n]$.
Then $F | T_0^{e_0}G$ and $F | T_1^{e_1}G$ implies $F | G$ as
$T_0^{e_0}$ and $T_1^{e_1}$ have no factor in common. Thus $I(Z) = (F)$.
\end{proof}

\noindent
In case the closed subscheme is locally cut out by finitely many
equations we can define it by a finite type ideal sheaf of
$\mathcal{A}$.

\begin{lemma}
\label{lemma-closed-subscheme-proj-finite}
Let $S$ be a quasi-compact and quasi-separated scheme.
Let $\mathcal{A}$ be a quasi-coherent graded $\mathcal{O}_S$-algebra. Let
$p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. Let $i : Z \to X$ be a closed subscheme.
If $p$ is quasi-compact and $i$ of finite presentation, then there exists
a $d > 0$ and a quasi-coherent finite type $\mathcal{O}_S$-submodule
$\mathcal{F} \subset \mathcal{A}_d$ such that
$Z = \underline{\text{Proj}}_S(\mathcal{A}/\mathcal{F}\mathcal{A})$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-closed-subscheme-proj} we know there exists a
quasi-coherent graded sheaf of ideals $\mathcal{I} \subset \mathcal{A}$
such that $Z = \underline{\text{Proj}}(\mathcal{A}/\mathcal{I})$.
Since $S$ is quasi-compact we can choose a finite affine open covering
$S = U_1 \cup \ldots \cup U_n$. Say $U_i = \Spec(R_i)$. Let
$\mathcal{A}|_{U_i}$ correspond to the graded $R_i$-algebra $A_i$ and
$\mathcal{I}|_{U_i}$ to the graded ideal $I_i \subset A_i$. Note that
$p^{-1}(U_i) = \text{Proj}(A_i)$ as schemes over $R_i$.
Since $p$ is quasi-compact we can choose finitely many homogeneous
elements $f_{i, j} \in A_{i, +}$ such that $p^{-1}(U_i) = D_{+}(f_{i, j})$.
The condition on $Z \to X$ means that the ideal sheaf of $Z$ in
$\mathcal{O}_X$ is of finite type, see
Morphisms, Lemma \ref{morphisms-lemma-closed-immersion-finite-presentation}.
Hence we can find finitely many homogeneous elements
$h_{i, j, k} \in I_i \cap A_{i, +}$ such that the ideal of
$Z \cap D_{+}(f_{i, j})$ is generated by the elements
$h_{i, j, k}/f_{i, j}^{e_{i, j, k}}$. Choose $d > 0$ to be a common multiple
of all the integers $\deg(f_{i, j})$ and $\deg(h_{i, j, k})$.
By Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
there exists a finite type quasi-coherent $\mathcal{F} \subset \mathcal{I}_d$
such that all the local sections
$$
h_{i, j, k}f_{i, j}^{(d - \deg(h_{i, j, k}))/\deg(f_{i, j})}
$$
are sections of $\mathcal{F}$. By construction $\mathcal{F}$ is a solution.
\end{proof}

\noindent
The following version of Lemma \ref{lemma-closed-subscheme-proj-finite}
will be used in the proof of
Lemma \ref{lemma-composition-admissible-blowups}.

\begin{lemma}
\label{lemma-closed-subscheme-proj-finite-type}
Let $S$ be a quasi-compact and quasi-separated scheme.
Let $\mathcal{A}$ be a quasi-coherent graded $\mathcal{O}_S$-algebra.
Let $p : X = \underline{\text{Proj}}_S(\mathcal{A}) \to S$ be the relative
Proj of $\mathcal{A}$. Let $i : Z \to X$ be a closed subscheme.
Let $U \subset X$ be an open. Assume that
\begin{enumerate}
\item $p$ is quasi-compact,
\item $i$ of finite presentation,
\item $U \cap p(i(Z)) = \emptyset$,
\item $U$ is quasi-compact,
\item $\mathcal{A}_n$ is a finite type $\mathcal{O}_S$-module for all $n$.
\end{enumerate}
Then there exists a $d > 0$ and a quasi-coherent finite type
$\mathcal{O}_S$-submodule $\mathcal{F} \subset \mathcal{A}_d$ with (a)
$Z = \underline{\text{Proj}}_S(\mathcal{A}/\mathcal{F}\mathcal{A})$
and (b) the support of $\mathcal{A}_d/\mathcal{F}$ is disjoint from $U$.
\end{lemma}

\begin{proof}
Let $\mathcal{I} \subset \mathcal{A}$ be the sheaf of quasi-coherent
graded ideals constructed in Lemma \ref{lemma-closed-subscheme-proj}.
Let $U_i$, $R_i$, $A_i$, $I_i$, $f_{i, j}$, $h_{i, j, k}$, and $d$
be as constructed in the proof of
Lemma \ref{lemma-closed-subscheme-proj-finite}.
Since $U \cap p(i(Z)) = \emptyset$ we see that
$\mathcal{I}_d|_U = \mathcal{A}_d|_U$ (by our construction of
$\mathcal{I}$ as a kernel). Since $U$ is quasi-compact we
can choose a finite affine open covering $U = W_1 \cup \ldots \cup W_m$.
Since $\mathcal{A}_d$ is of finite type we can find finitely many sections
$g_{t, s} \in \mathcal{A}_d(W_t)$ which generate
$\mathcal{A}_d|_{W_t} = \mathcal{I}_d|_{W_t}$
as an $\mathcal{O}_{W_t}$-module. To finish the proof, note that by
Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
there exists a finite type $\mathcal{F} \subset \mathcal{I}_d$
such that all the local sections
$$
h_{i, j, k}f_{i, j}^{(d - \deg(h_{i, j, k}))/\deg(f_{i, j})}
\quad\text{and}\quad
g_{t, s}
$$
are sections of $\mathcal{F}$. By construction $\mathcal{F}$ is a solution.
\end{proof}

\begin{lemma}
\label{lemma-conormal-sheaf-section-projective-bundle}
Let $X$ be a scheme. Let $\mathcal{E}$ be a quasi-coherent
$\mathcal{O}_X$-module. There is a bijection
$$
\left\{
\begin{matrix}
\text{sections }\sigma\text{ of the } \\
\text{morphism } \mathbf{P}(\mathcal{E}) \to X
\end{matrix}
\right\}
\leftrightarrow
\left\{
\begin{matrix}
\text{surjections }\mathcal{E} \to \mathcal{L}\text{ where} \\
\mathcal{L}\text{ is an invertible }\mathcal{O}_X\text{-module}
\end{matrix}
\right\}
$$
In this case $\sigma$ is a closed immersion and there is a canonical
isomorphism
$$
\Ker(\mathcal{E} \to \mathcal{L})
\otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes -1}
\longrightarrow
\mathcal{C}_{\sigma(X)/\mathbf{P}(\mathcal{E})}
$$
Both the bijection and isomorphism are compatible with base change.
\end{lemma}

\begin{proof}
Recall that $\pi : \mathbf{P}(\mathcal{E}) \to X$ is the relative proj of the
symmetric algebra on $\mathcal{E}$, see
Constructions, Definition \ref{constructions-definition-projective-bundle}.
Hence the descriptions of sections $\sigma$ follows immediately from
the description of the functor of points of $\mathbf{P}(\mathcal{E})$
in Constructions, Lemma \ref{constructions-lemma-apply-relative}.
Since $\pi$ is separated, any section is a closed immersion
(Constructions, Lemma \ref{constructions-lemma-relative-proj-separated} and
Schemes, Lemma \ref{schemes-lemma-section-immersion}).
Let $U \subset X$ be an affine open and $k \in \mathcal{E}(U)$ and
$s \in \mathcal{E}(U)$ be local sections such that $k$ maps to
zero in $\mathcal{L}$ and $s$ maps to a generator $\overline{s}$
of $\mathcal{L}$.
Then $f = k/s$ is a section of $\mathcal{O}_{\mathbf{P}(\mathcal{E})}$
defined in an open neighbourhood $D_+(s)$ of $s(U)$ in $\pi^{-1}(U)$.
Moreover, since $k$ maps to zero in $\mathcal{L}$ we see that
$f$ is a section of the ideal sheaf of $s(U)$ in $\pi^{-1}(U)$.
Thus we can take the image $\overline{f}$ of $f$ in
$\mathcal{C}_{\sigma(X)/\mathbf{P}(\mathcal{E})}(U)$.
We claim (1) that the image $\overline{f}$ depends only on the
sections $k$ and $\overline{s}$ and not on the choice of $s$
and (2) that we get an isomorphism over $U$ in this manner (see below).
However, once (1) and (2) are established, we see that
the construction is compatible with base change by $U' \to U$
where $U'$ is affine, which proves that these local maps glue
and are compatible with arbitrary base change.

\medskip\noindent
To prove (1) and (2) we make explicit what is going on.
Namely, say $U = \Spec(A)$ and say $\mathcal{E} \to \mathcal{L}$
corresponds to the map of $A$-modules $M \to N$. Then
$k \in K = \Ker(M \to N)$ and $s \in M$ maps to a generator $\overline{s}$
of $N$. Hence $M = K \oplus A s$. Thus
$$
\text{Sym}(M) = \text{Sym}(K)[s]
$$
Consider the identification $\text{Sym}(K) \to \text{Sym}(M)_{(s)}$
via the rule $g \mapsto g/s^n$ for $g \in \text{Sym}^n(K)$.
This gives an isomorphism $D_+(s) = \Spec(\text{Sym}(K))$ such
that $\sigma$ corresponds to the ring map $\text{Sym}(K) \to A$
mapping $K$ to zero. Via this isomorphism we see that the quasi-coherent
module corresponding to $K$ is identified with
$\mathcal{C}_{\sigma(U)/D_+(s)}$ proving (2).
Finally, suppose that $s' = k' + s$ for some $k' \in K$.
Then
$$
k/s' = (k/s) (s/s') = (k/s) (s'/s)^{-1} = (k/s) (1 + k'/s)^{-1}
$$
in an open neighbourhood of $\sigma(U)$ in $D_+(s)$. Thus we see that
$s'/s$ restricts to $1$ on $\sigma(U)$ and we see that $k/s'$ maps to
the same element of the conormal sheaf as does $k/s$ thereby proving (1).
\end{proof}





\section{Blowing up}
\label{section-blowing-up}

\noindent
Blowing up is an important tool in algebraic geometry.

\begin{definition}
\label{definition-blow-up}
Let $X$ be a scheme. Let $\mathcal{I} \subset \mathcal{O}_X$ be a
quasi-coherent sheaf of ideals, and let $Z \subset X$ be the closed subscheme
corresponding to $\mathcal{I}$, see
Schemes, Definition \ref{schemes-definition-immersion}.
The {\it blowing up of $X$ along $Z$}, or the
{\it blowing up of $X$ in the ideal sheaf $\mathcal{I}$} is
the morphism
$$
b :
\underline{\text{Proj}}_X
\left(\bigoplus\nolimits_{n \geq 0} \mathcal{I}^n\right)
\longrightarrow
X
$$
The {\it exceptional divisor} of the blowup is the inverse image
$b^{-1}(Z)$. Sometimes $Z$ is called the {\it center} of the blowup.
\end{definition}

\noindent
We will see later that the exceptional divisor is an effective Cartier
divisor. Moreover, the blowing up is characterized as the ``smallest'' scheme
over $X$ such that the inverse image of $Z$ is an effective Cartier divisor.

\medskip\noindent
If $b : X' \to X$ is the blowup of $X$ in $Z$, then we often denote
$\mathcal{O}_{X'}(n)$ the twists of the structure sheaf. Note that these
are invertible $\mathcal{O}_{X'}$-modules and that
$\mathcal{O}_{X'}(n) = \mathcal{O}_{X'}(1)^{\otimes n}$
because $X'$ is the relative Proj of a quasi-coherent graded
$\mathcal{O}_X$-algebra which is generated in degree $1$, see
Constructions, Lemma \ref{constructions-lemma-apply-relative}.
Note that $\mathcal{O}_{X'}(1)$ is $b$-relatively very ample, even though
$b$ need not be of finite type or even quasi-compact, because
$X'$ comes equipped with a closed immersion into $\mathbf{P}(\mathcal{I})$,
see Morphisms, Example \ref{morphisms-example-very-ample}.

\begin{lemma}
\label{lemma-blowing-up-affine}
Let $X$ be a scheme. Let $\mathcal{I} \subset \mathcal{O}_X$ be a
quasi-coherent sheaf of ideals. Let $U = \Spec(A)$ be an affine open
subscheme of $X$ and let $I \subset A$ be the ideal corresponding to
$\mathcal{I}|_U$. If $b : X' \to X$ is the blowup of $X$ in $\mathcal{I}$,
then there is a canonical isomorphism
$$
b^{-1}(U) = \text{Proj}(\bigoplus\nolimits_{d \geq 0} I^d)
$$
of $b^{-1}(U)$ with the homogeneous spectrum of the Rees algebra
of $I$ in $A$. Moreover, $b^{-1}(U)$ has an affine open covering by
spectra of the affine blowup algebras $A[\frac{I}{a}]$.
\end{lemma}

\begin{proof}
The first statement is clear from the construction of the relative Proj via
glueing, see Constructions, Section
\ref{constructions-section-relative-proj-via-glueing}.
For $a \in I$ denote $a^{(1)}$ the element $a$ seen as an element of
degree $1$ in the Rees algebra $\bigoplus_{n \geq 0} I^n$.
Since these elements generate the Rees algebra over $A$ we see that
$\text{Proj}(\bigoplus_{d \geq 0} I^d)$ is covered by the affine opens
$D_{+}(a^{(1)})$. The affine scheme $D_{+}(a^{(1)})$ is the spectrum of
the affine blowup algebra $A' = A[\frac{I}{a}]$, see
Algebra, Definition \ref{algebra-definition-blow-up}.
This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-flat-base-change-blowing-up}
\begin{slogan}
Blowing up commutes with flat base change.
\end{slogan}
Let $X_1 \to X_2$ be a flat morphism of schemes. Let $Z_2 \subset X_2$ be a
closed subscheme. Let $Z_1$ be the inverse image of $Z_2$ in $X_1$.
Let $X'_i$ be the blowup of $Z_i$ in $X_i$. Then there exists a cartesian
diagram
$$
\xymatrix{
X_1' \ar[r] \ar[d] & X_2' \ar[d] \\
X_1 \ar[r] & X_2
}
$$
of schemes.
\end{lemma}

\begin{proof}
Let $\mathcal{I}_2$ be the ideal sheaf of $Z_2$ in $X_2$.
Denote $g : X_1 \to X_2$ the given morphism. Then the ideal sheaf
$\mathcal{I}_1$ of $Z_1$ is the image of
$g^*\mathcal{I}_2 \to \mathcal{O}_{X_1}$
(by definition of the inverse image, see
Schemes, Definition \ref{schemes-definition-inverse-image-closed-subscheme}).
By Constructions, Lemma \ref{constructions-lemma-relative-proj-base-change}
we see that $X_1 \times_{X_2} X_2'$ is the relative Proj of
$\bigoplus_{n \geq 0} g^*\mathcal{I}_2^n$. Because $g$ is flat the map
$g^*\mathcal{I}_2^n \to \mathcal{O}_{X_1}$ is injective with image
$\mathcal{I}_1^n$. Thus we see that $X_1 \times_{X_2} X_2' = X_1'$.
\end{proof}

\begin{lemma}
\label{lemma-blowing-up-gives-effective-Cartier-divisor}
Let $X$ be a scheme. Let $Z \subset X$ be a closed subscheme.
The blowing up $b : X' \to X$ of $Z$ in $X$
has the following properties:
\begin{enumerate}
\item $b|_{b^{-1}(X \setminus Z)} : b^{-1}(X \setminus Z) \to X \setminus Z$
is an isomorphism,
\item the exceptional divisor $E = b^{-1}(Z)$ is an effective Cartier divisor
on $X'$,
\item there is a canonical isomorphism
$\mathcal{O}_{X'}(-1) = \mathcal{O}_{X'}(E)$
\end{enumerate}
\end{lemma}

\begin{proof}
As blowing up commutes with restrictions to open subschemes
(Lemma \ref{lemma-flat-base-change-blowing-up}) the first statement
just means that $X' = X$ if $Z = \emptyset$. In this case we are blowing
up in the ideal sheaf $\mathcal{I} = \mathcal{O}_X$ and the result follows from
Constructions, Example \ref{constructions-example-trivial-proj}.

\medskip\noindent
The second statement is local on $X$, hence we may assume $X$ affine.
Say $X = \Spec(A)$ and $Z = \Spec(A/I)$. By Lemma \ref{lemma-blowing-up-affine}
we see that $X'$ is covered by the spectra of the affine blowup algebras
$A' = A[\frac{I}{a}]$. Then $IA' = aA'$ and $a$ maps to a nonzerodivisor
in $A'$ according to Algebra, Lemma \ref{algebra-lemma-affine-blowup}.
This proves the lemma as the inverse image of $Z$ in $\Spec(A')$
corresponds to $\Spec(A'/IA') \subset \Spec(A')$.

\medskip\noindent
Consider the canonical map
$\psi_{univ, 1} : b^*\mathcal{I} \to \mathcal{O}_{X'}(1)$, see
discussion following Constructions, Definition
\ref{constructions-definition-relative-proj}.
We claim that this factors through an isomorphism
$\mathcal{I}_E \to \mathcal{O}_{X'}(1)$ (which proves the final assertion).
Namely, on the affine open corresponding to the blowup algebra
$A' = A[\frac{I}{a}]$ mentioned above $\psi_{univ, 1}$ corresponds to
the $A'$-module map
$$
I \otimes_A A'
\longrightarrow
\left(\Big(\bigoplus\nolimits_{d \geq 0} I^d\Big)_{a^{(1)}}\right)_1
$$
where $a^{(1)}$ is as in Algebra, Definition \ref{algebra-definition-blow-up}.
We omit the verification that this is the map
$I \otimes_A A' \to IA' = aA'$.
\end{proof}

\begin{lemma}[Universal property blowing up]
\label{lemma-universal-property-blowing-up}
Let $X$ be a scheme. Let $Z \subset X$ be a closed subscheme.
Let $\mathcal{C}$ be the full subcategory of $(\Sch/X)$ consisting
of $Y \to X$ such that the inverse image of $Z$ is an effective
Cartier divisor on $Y$. Then the blowing up $b : X' \to X$ of $Z$ in $X$
is a final object of $\mathcal{C}$.
\end{lemma}

\begin{proof}
We see that $b : X' \to X$ is an object of $\mathcal{C}$ according to
Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor}.
Let $f : Y \to X$ be an object of $\mathcal{C}$. We have to show there exists
a unique morphism $Y \to X'$ over $X$. Let $D = f^{-1}(Z)$.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal sheaf of $Z$
and let $\mathcal{I}_D$ be the ideal sheaf of $D$. Then
$f^*\mathcal{I} \to \mathcal{I}_D$ is a surjection
to an invertible $\mathcal{O}_Y$-module. This extends to a map
$\psi : \bigoplus f^*\mathcal{I}^d \to \bigoplus \mathcal{I}_D^d$
of graded $\mathcal{O}_Y$-algebras. (We observe that
$\mathcal{I}_D^d = \mathcal{I}_D^{\otimes d}$ as $D$ is an
effective Cartier divisor.) By the material in
Constructions, Section \ref{constructions-section-relative-proj}
the triple $(1, f : Y \to X, \psi)$ defines a morphism $Y \to X'$ over $X$.
The restriction
$$
Y \setminus D \longrightarrow X' \setminus b^{-1}(Z) = X \setminus Z
$$
is unique. The open $Y \setminus D$ is scheme theoretically dense in $Y$
according to Lemma \ref{lemma-complement-effective-Cartier-divisor}.
Thus the morphism $Y \to X'$ is unique by
Morphisms, Lemma \ref{morphisms-lemma-equality-of-morphisms}
(also $b$ is separated by Constructions, Lemma
\ref{constructions-lemma-relative-proj-separated}).
\end{proof}

\begin{lemma}
\label{lemma-characterize-affine-blowup}
Let $b : X' \to X$ be the blowing up of the scheme $X$ along a closed
subscheme $Z$. Let $U = \Spec(A)$ be an affine open of $X$ and let
$I \subset A$ be the ideal corresponding to $Z \cap U$.
Let $a \in I$ and let $x' \in X'$ be a point mapping to a point of $U$.
Then $x'$ is a point of the affine open $U' = \Spec(A[\frac{I}{a}])$
if and only if the image of $a$ in $\mathcal{O}_{X', x'}$ cuts
out the exceptional divisor.
\end{lemma}

\begin{proof}
Since the exceptional divisor over $U'$ is cut out by the image of
$a$ in $A' = A[\frac{I}{a}]$ one direction is clear. Conversely, assume
that the image of $a$ in $\mathcal{O}_{X', x'}$ cuts out $E$.
Since every element of $I$ maps to an element of the ideal
defining $E$ over $b^{-1}(U)$ we see that elements of $I$ become
divisible by $a$ in $\mathcal{O}_{X', x'}$. Thus for $f \in I^n$
we can write $f = \psi(f) a^n$ for some $\psi(f) \in \mathcal{O}_{X', x'}$.
Observe that since $a$ maps to a nonzerodivisor of $\mathcal{O}_{X', x'}$
the element $\psi(f)$ is uniquely characterized by this. Then we
define
$$
A' \longrightarrow \mathcal{O}_{X', x'},\quad
f/a^n \longmapsto \psi(f)
$$
Here we use the description of blowup algebras given following
Algebra, Definition \ref{definition-blow-up}. The uniqueness mentioned
above shows that this is an $A$-algebra homomorphism.
This gives a morphism $\Spec(\mathcal{O}_{X', x"}) \to \Spec(A') = U'$.
By the universal property of blowing up
(Lemma \ref{lemma-universal-property-blowing-up})
this is a morphism over
$X'$, which of course implies that $x' \in U'$.
\end{proof}

\begin{lemma}
\label{lemma-blow-up-effective-Cartier-divisor}
Let $X$ be a scheme. Let $Z \subset X$ be an effective Cartier divisor.
The blowup of $X$ in $Z$ is the identity morphism of $X$.
\end{lemma}

\begin{proof}
Immediate from the universal property of blowups
(Lemma \ref{lemma-universal-property-blowing-up}).
\end{proof}

\begin{lemma}
\label{lemma-blow-up-reduced-scheme}
Let $X$ be a scheme. Let $\mathcal{I} \subset \mathcal{O}_X$ be a
quasi-coherent sheaf of ideals. If $X$ is reduced, then the
blowup $X'$ of $X$ in $\mathcal{I}$ is reduced.
\end{lemma}

\begin{proof}
Combine Lemma \ref{lemma-blowing-up-affine}
with Algebra, Lemma \ref{algebra-lemma-blowup-reduced}.
\end{proof}

\begin{lemma}
\label{lemma-blow-up-integral-scheme}
Let $X$ be a scheme. Let $\mathcal{I} \subset \mathcal{O}_X$ be a
nonzero quasi-coherent sheaf of ideals. If $X$ is integral, then the
blowup $X'$ of $X$ in $\mathcal{I}$ is integral.
\end{lemma}

\begin{proof}
Combine Lemma \ref{lemma-blowing-up-affine}
with Algebra, Lemma \ref{algebra-lemma-blowup-domain}.
\end{proof}

\begin{lemma}
\label{lemma-blow-up-and-irreducible-components}
Let $X$ be a scheme. Let $Z \subset X$ be a closed subscheme.
Let $b : X' \to X$ be the blowing up of $X$ along $Z$. Then
$b$ induces an bijective map from the set of generic points
of irreducible components of $X'$ to the set of generic points of
irreducible components of $X$ which are not in $Z$.
\end{lemma}

\begin{proof}
The exceptional divisor $E \subset X'$ is an effective Cartier divisor
and $X' \setminus E \to X \setminus Z$ is an isomorphism, see
Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor}.
Thus it suffices to show the following: given an effective
Cartier divisor $D \subset S$ of a scheme $S$ none of the
generic points of irreducible components of $S$ are contained in $D$.
To see this, we may replace $S$ by the members of an affine open
covering. Hence by Lemma \ref{lemma-characterize-effective-Cartier-divisor}
we may assume $S = \Spec(A)$ and $D = V(f)$ where $f \in A$
is a nonzerodivisor. Then we have to show $f$ is not contained
in any minimal prime ideal $\mathfrak p \subset A$.
If so, then $f$ would map to a nonzerodivisor contained
in the maximal ideal of $R_\mathfrak p$ which is a contradiction
with Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}.
\end{proof}

\begin{lemma}
\label{lemma-blow-up-pullback-effective-Cartier}
Let $X$ be a scheme. Let $b : X' \to X$ be a blowup of $X$ in a closed
subscheme. The pullback $b^{-1}D$ is defined
for all effective Cartier divisors $D \subset X$
and pullbacks of meromorphic functions are defined for $b$
(Definitions
\ref{definition-pullback-effective-Cartier-divisor} and
\ref{definition-pullback-meromorphic-sections}).
\end{lemma}

\begin{proof}
By Lemmas \ref{lemma-blowing-up-affine} and
\ref{lemma-characterize-effective-Cartier-divisor}
this reduces to the following algebra fact:
Let $A$ be a ring, $I \subset A$ an ideal, $a \in I$, and $x \in A$
a nonzerodivisor. Then the image of $x$ in $A[\frac{I}{a}]$ is a
nonzerodivisor. Namely, suppose that $x (y/a^n) = 0$ in $A[\frac{I}{a}]$.
Then $a^mxy = 0$ in $A$ for some $m$. Hence $a^my = 0$ as $x$ is a
nonzerodivisor. Whence $y/a^n$ is zero in $A[\frac{I}{a}]$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-blowing-up-two-ideals}
Let $X$ be a scheme. Let $\mathcal{I}, \mathcal{J} \subset \mathcal{O}_X$
be quasi-coherent sheaves of ideals. Let $b : X' \to X$
be the blowing up of $X$ in $\mathcal{I}$. Let $b' : X'' \to X'$ be the
blowing up of $X'$ in $b^{-1}\mathcal{J} \mathcal{O}_{X'}$. Then $X'' \to X$
is canonically isomorphic to the blowing up of $X$ in $\mathcal{I}\mathcal{J}$.
\end{lemma}

\begin{proof}
Let $E \subset X'$ be the exceptional divisor of $b$ which is an effective
Cartier divisor by
Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor}.
Then $(b')^{-1}E$ is an effective Cartier divisor on $X''$ by
Lemma \ref{lemma-blow-up-pullback-effective-Cartier}.
Let $E' \subset X''$ be the exceptional divisor of $b'$ (also an effective
Cartier divisor). Consider the effective Cartier divisor
$E'' = E' + (b')^{-1}E$. By construction the ideal of $E''$ is
$(b \circ b')^{-1}\mathcal{I} (b \circ b')^{-1}\mathcal{J} \mathcal{O}_{X''}$.
Hence according to Lemma \ref{lemma-universal-property-blowing-up}
there is a canonical morphism from $X''$ to the blowup $c : Y \to X$
of $X$ in $\mathcal{I}\mathcal{J}$. Conversely, as $\mathcal{I}\mathcal{J}$
pulls back to an invertible ideal we see that
$c^{-1}\mathcal{I}\mathcal{O}_Y$ defines
an effective Cartier divisor, see
Lemma \ref{lemma-sum-closed-subschemes-effective-Cartier}.
Thus a morphism $c' : Y \to X'$ over $X$ by
Lemma \ref{lemma-universal-property-blowing-up}.
Then $(c')^{-1}b^{-1}\mathcal{J}\mathcal{O}_Y = c^{-1}\mathcal{J}\mathcal{O}_Y$
which also defines an effective Cartier divisor. Thus a morphism
$c'' : Y \to X''$ over $X'$. We omit the verification that this
morphism is inverse to the morphism $X'' \to Y$ constructed earlier.
\end{proof}

\begin{lemma}
\label{lemma-blowing-up-projective}
Let $X$ be a scheme. Let $\mathcal{I} \subset \mathcal{O}_X$ be a
quasi-coherent sheaf of ideals. Let $b : X' \to X$ be the blowing up of $X$
in the ideal sheaf $\mathcal{I}$. If $\mathcal{I}$ is of finite type, then
\begin{enumerate}
\item $b : X' \to X$ is a projective morphism, and
\item $\mathcal{O}_{X'}(1)$ is a $b$-relatively ample invertible sheaf.
\end{enumerate}
\end{lemma}

\begin{proof}
The surjection of graded $\mathcal{O}_X$-algebras
$$
\text{Sym}_{\mathcal{O}_X}^*(\mathcal{I})
\longrightarrow
\bigoplus\nolimits_{d \geq 0} \mathcal{I}^d
$$
defines via Constructions, Lemma
\ref{constructions-lemma-surjective-generated-degree-1-map-relative-proj}
a closed immersion
$$
X' = \underline{\text{Proj}}_X (\bigoplus\nolimits_{d \geq 0} \mathcal{I}^d)
\longrightarrow
\mathbf{P}(\mathcal{I}).
$$
Hence $b$ is projective, see
Morphisms, Definition \ref{morphisms-definition-projective}.
The second statement follows for example from the characterization
of relatively ample invertible sheaves in
Morphisms, Lemma \ref{morphisms-lemma-characterize-relatively-ample}.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-composition-finite-type-blowups}
\begin{slogan}
Composition of blowing ups is a blowing up
\end{slogan}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $Z \subset X$ be a closed subscheme of finite presentation.
Let $b : X' \to X$ be the blowing up with center $Z$. Let $Z' \subset X'$ be
a closed subscheme of finite presentation.
Let $X'' \to X'$ be the blowing up with center $Z'$.
There exists a closed subscheme $Y \subset X$ of finite presentation,
such that
\begin{enumerate}
\item $Y = Z \cup b(Z')$ set theoretically, and
\item the composition $X'' \to X$ is isomorphic to the blowing up
of $X$ in $Y$.
\end{enumerate}
\end{lemma}

\begin{proof}
The condition that $Z \to X$ is of finite presentation means that
$Z$ is cut out by a finite type quasi-coherent sheaf of ideals
$\mathcal{I} \subset \mathcal{O}_X$, see
Morphisms, Lemma \ref{morphisms-lemma-closed-immersion-finite-presentation}.
Write $\mathcal{A} = \bigoplus_{n \geq 0} \mathcal{I}^n$ so that
$X' = \underline{\text{Proj}}(\mathcal{A})$.
Note that $X \setminus Z$ is a quasi-compact open of $X$ by
Properties, Lemma \ref{properties-lemma-quasi-coherent-finite-type-ideals}.
Since $b^{-1}(X \setminus Z) \to X \setminus Z$ is an isomorphism
(Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor}) the same
result shows that
$b^{-1}(X \setminus Z) \setminus Z'$ is quasi-compact open in $X'$.
Hence $U = X \setminus (Z \cup b(Z'))$ is quasi-compact open in $X$.
By Lemma \ref{lemma-closed-subscheme-proj-finite-type}
there exist a $d > 0$ and a finite type
$\mathcal{O}_X$-submodule $\mathcal{F} \subset \mathcal{I}^d$ such
that $Z' = \underline{\text{Proj}}(\mathcal{A}/\mathcal{F}\mathcal{A})$
and such that the support of $\mathcal{I}^d/\mathcal{F}$ is contained
in $X \setminus U$.

\medskip\noindent
Since $\mathcal{F} \subset \mathcal{I}^d$ is an $\mathcal{O}_X$-submodule
we may think of $\mathcal{F} \subset \mathcal{I}^d \subset \mathcal{O}_X$
as a finite type quasi-coherent sheaf of ideals on $X$. Let's denote this
$\mathcal{J} \subset \mathcal{O}_X$ to prevent confusion. Since
$\mathcal{I}^d / \mathcal{J}$ and $\mathcal{O}/\mathcal{I}^d$
are supported on $X \setminus U$ we see that $V(\mathcal{J})$ is contained
in $X \setminus U$. Conversely, as $\mathcal{J} \subset \mathcal{I}^d$
we see that $Z \subset V(\mathcal{J})$. Over
$X \setminus Z \cong X' \setminus b^{-1}(Z)$ the sheaf of ideals
$\mathcal{J}$ cuts out $Z'$ (see displayed formula below). Hence
$V(\mathcal{J})$ equals $Z \cup b(Z')$. It follows that also
$V(\mathcal{I}\mathcal{J}) = Z \cup b(Z')$ set theoretically. Moreover,
$\mathcal{I}\mathcal{J}$ is an ideal of finite type as a product of two such.
We claim that $X'' \to X$ is isomorphic to the blowing up of $X$ in
$\mathcal{I}\mathcal{J}$ which finishes the proof of the lemma by setting
$Y = V(\mathcal{I}\mathcal{J})$.

\medskip\noindent
First, recall that the blowup of $X$ in $\mathcal{I}\mathcal{J}$
is the same as the blowup of $X'$ in $b^{-1}\mathcal{J} \mathcal{O}_{X'}$,
see Lemma \ref{lemma-blowing-up-two-ideals}.
Hence it suffices to show that the blowup of $X'$ in
$b^{-1}\mathcal{J} \mathcal{O}_{X'}$ agrees with the blowup of $X'$
in $Z'$. We will show that
$$
b^{-1}\mathcal{J} \mathcal{O}_{X'} = \mathcal{I}_E^d \mathcal{I}_{Z'}
$$
as ideal sheaves on $X''$. This will prove what we want as
$\mathcal{I}_E^d$ cuts out the effective Cartier divisor $dE$
and we can use Lemmas \ref{lemma-blow-up-effective-Cartier-divisor} and
\ref{lemma-blowing-up-two-ideals}.

\medskip\noindent
To see the displayed equality of the ideals we may work locally.
With notation $A$, $I$, $a \in I$ as in Lemma \ref{lemma-blowing-up-affine}
we see that $\mathcal{F}$ corresponds to an $R$-submodule $M \subset I^d$
mapping isomorphically to an ideal $J \subset R$. The condition
$Z' = \underline{\text{Proj}}(\mathcal{A}/\mathcal{F}\mathcal{A})$
means that $Z' \cap \Spec(A[\frac{I}{a}])$ is cut out by the ideal
generated by the elements $m/a^d$, $m \in M$. Say the element $m \in M$
corresponds to the function $f \in J$. Then in the affine blowup algebra
$A' = A[\frac{I}{a}]$ we see that $f = (a^dm)/a^d = a^d (m/a^d)$.
Thus the equality holds.
\end{proof}






\section{Strict transform}
\label{section-strict-transform}

\noindent
In this section we briefly discuss strict transform under blowing up.
Let $S$ be a scheme and let $Z \subset S$ be a closed subscheme.
Let $b : S' \to S$ be the blowing up of $S$ in $Z$ and denote $E \subset S'$
the exceptional divisor $E = b^{-1}Z$. In the following we will often
consider a scheme $X$ over $S$ and form the cartesian diagram
$$
\xymatrix{
\text{pr}_{S'}^{-1}E \ar[r] \ar[d] &
X \times_S S' \ar[r]_-{\text{pr}_X} \ar[d]_{\text{pr}_{S'}} &
X \ar[d]^f \\
E \ar[r] & S' \ar[r] & S
}
$$
Since $E$ is an effective Cartier divisor
(Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor})
we see that $\text{pr}_{S'}^{-1}E \subset X \times_S S'$
is locally principal
(Lemma \ref{lemma-pullback-locally-principal}).
Thus the complement of $\text{pr}_{S'}^{-1}E$ in $X \times_S S'$
is retrocompact
(Lemma \ref{lemma-complement-locally-principal-closed-subscheme}).
Consequently, for a quasi-coherent $\mathcal{O}_{X \times_S S'}$-module
$\mathcal{G}$ the subsheaf of sections supported on $\text{pr}_{S'}^{-1}E$
is a quasi-coherent submodule, see
Properties, Lemma \ref{properties-lemma-sections-supported-on-closed-subset}.
If $\mathcal{G}$ is a quasi-coherent sheaf of algebras, e.g.,
$\mathcal{G} = \mathcal{O}_{X \times_S S'}$, then this subsheaf is an ideal
of $\mathcal{G}$.

\begin{definition}
\label{definition-strict-transform}
With $Z \subset S$ and $f : X \to S$ as above.
\begin{enumerate}
\item Given a quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$
the {\it strict transform} of $\mathcal{F}$ with respect to the blowup
of $S$ in $Z$ is the quotient $\mathcal{F}'$ of $\text{pr}_X^*\mathcal{F}$
by the submodule of sections supported on $\text{pr}_{S'}^{-1}E$.
\item The {\it strict transform} of $X$ is the closed subscheme
$X' \subset X \times_S S'$ cut out by the quasi-coherent ideal of
sections of $\mathcal{O}_{X \times_S S'}$ supported on $\text{pr}_{S'}^{-1}E$.
\end{enumerate}
\end{definition}

\noindent
Note that taking the strict transform along a blowup depends on the
closed subscheme used for the blowup
(and not just on the morphism $S' \to S$).
This notion is often used for closed subschemes of $S$.
It turns out that the strict transform of $X$ is a blowup of $X$.

\begin{lemma}
\label{lemma-strict-transform}
In the situation of Definition \ref{definition-strict-transform}.
\begin{enumerate}
\item The strict transform $X'$ of $X$ is the blowup of $X$ in the closed
subscheme $f^{-1}Z$ of $X$.
\item For a quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ the
strict transform $\mathcal{F}'$ is canonically isomorphic to
the pushforward along $X' \to X \times_S S'$ of the strict transform of
$\mathcal{F}$ relative to the blowing up $X' \to X$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $X'' \to X$ be the blowup of $X$ in $f^{-1}Z$. By the universal
property of blowing up (Lemma \ref{lemma-universal-property-blowing-up})
there exists a commutative diagram
$$
\xymatrix{
X'' \ar[r] \ar[d] & X \ar[d] \\
S' \ar[r] & S
}
$$
whence a morphism $X'' \to X \times_S S'$. Thus the first assertion
is that this morphism is a closed immersion with image $X'$.
The question is local on $X$. Thus we may assume $X$
and $S$ are affine. Say that $S = \Spec(A)$, $X = \Spec(B)$, and $Z$
is cut out by the ideal $I \subset A$. Set $J = IB$. The map
$B \otimes_A \bigoplus_{n \geq 0} I^n \to \bigoplus_{n \geq 0} J^n$
defines a closed immersion $X'' \to X \times_S S'$, see
Constructions, Lemmas
\ref{constructions-lemma-base-change-map-proj} and
\ref{constructions-lemma-surjective-graded-rings-generated-degree-1-map-proj}.
We omit the verification that this morphism is the same as the
one constructed above from the universal property.
Pick $a \in I$ corresponding to the affine open
$\Spec(A[\frac{I}{a}]) \subset S'$, see Lemma \ref{lemma-blowing-up-affine}.
The inverse image of $\Spec(A[\frac{I}{a}])$ in the strict transform
$X'$ of $X$ is the spectrum of
$$
B' = (B \otimes_A A[\textstyle{\frac{I}{a}}])/a\text{-power-torsion}
$$
see Properties, Lemma
\ref{properties-lemma-sections-supported-on-closed-subset}.
On the other hand, letting $b \in J$ be the image of $a$ we see that
$\Spec(B[\frac{J}{b}])$ is the inverse image of $\Spec(A[\frac{I}{a}])$
in $X''$. By Algebra, Lemma \ref{algebra-lemma-blowup-base-change}
the open $\Spec(B[\frac{J}{b}])$ maps isomorphically to the open subscheme
$\text{pr}_{S'}^{-1}(\Spec(A[\frac{I}{a}]))$ of $X'$.
Thus $X'' \to X'$ is an isomorphism.

\medskip\noindent
In the notation above, let $\mathcal{F}$ correspond to the $B$-module $N$.
The strict transform of $\mathcal{F}$ corresponds to the
$B \otimes_A A[\frac{I}{a}]$-module
$$
N' = (N \otimes_A A[\textstyle{\frac{I}{a}}])/a\text{-power-torsion}
$$
see Properties, Lemma
\ref{properties-lemma-sections-supported-on-closed-subset}.
The strict transform of $\mathcal{F}$ relative to the blowup of
$X$ in $f^{-1}Z$ corresponds to the $B[\frac{J}{b}]$-module
$N \otimes_B B[\frac{J}{b}]/b\text{-power-torsion}$. In exactly the same
way as above one proves that these two modules are isomorphic.
Details omitted.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-flat}
In the situation of Definition \ref{definition-strict-transform}.
\begin{enumerate}
\item If $X$ is flat over $S$ at all points lying over $Z$, then
the strict transform of $X$ is equal to the base change $X \times_S S'$.
\item Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
If $\mathcal{F}$ is flat over $S$ at all points lying over $Z$, then
the strict transform $\mathcal{F}'$ of $\mathcal{F}$ is equal to the
pullback $\text{pr}_X^*\mathcal{F}$.
\end{enumerate}
\end{lemma}

\begin{proof}
We will prove part (2) as it implies part (1) by the definition of the
strict transform of a scheme over $S$. The question is local on $X$.
Thus we may assume that $S = \Spec(A)$, $X = \Spec(B)$, and that
$\mathcal{F}$ corresponds to the $B$-module $N$. Then $\mathcal{F}'$
over the open $\Spec(B \otimes_A A[\frac{I}{a}])$ of $X \times_S S'$
corresponds to the module
$$
N' = (N \otimes_A A[\textstyle{\frac{I}{a}}])/a\text{-power-torsion}
$$
see Properties, Lemma
\ref{properties-lemma-sections-supported-on-closed-subset}.
Thus we have to show that the $a$-power-torsion of
$N \otimes_A A[\frac{I}{a}]$ is zero. Let $y \in N \otimes_A A[\frac{I}{a}]$
with $a^n y = 0$. If $\mathfrak q \subset B$
is a prime and $a \not \in \mathfrak q$, then $y$ maps to
zero in $(N \otimes_A A[\frac{I}{a}])_\mathfrak q$. on the other hand,
if $a \in \mathfrak q$, then $N_\mathfrak q$ is a flat $A$-module
and we see that
$N_\mathfrak q \otimes_A A[\frac{I}{a}]
=(N \otimes_A A[\frac{I}{a}])_\mathfrak q$
has no $a$-power torsion (as $A[\frac{I}{a}]$ doesn't).
Hence $y$ maps to zero in this localization as well. We conclude that
$y$ is zero by
Algebra, Lemma \ref{algebra-lemma-characterize-zero-local}.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-affine}
Let $S$ be a scheme. Let $Z \subset S$ be a closed subscheme.
Let $b : S' \to S$ be the blowing up of $Z$ in $S$. Let
$g : X \to Y$ be an affine morphism of schemes over $S$.
Let $\mathcal{F}$ be a quasi-coherent sheaf on $X$.
Let $g' : X \times_S S' \to Y \times_S S'$ be the base change
of $g$. Let $\mathcal{F}'$ be the strict transform of $\mathcal{F}$
relative to $b$. Then $g'_*\mathcal{F}'$ is the strict transform
of $g_*\mathcal{F}$.
\end{lemma}

\begin{proof}
Observe that $g'_*\text{pr}_X^*\mathcal{F} = \text{pr}_Y^*g_*\mathcal{F}$
by Cohomology of Schemes, Lemma \ref{coherent-lemma-affine-base-change}.
Let $\mathcal{K} \subset \text{pr}_X^*\mathcal{F}$ be the subsheaf
of sections supported in the inverse image of $Z$ in $X \times_S S'$.
By Properties, Lemma
\ref{properties-lemma-push-sections-supported-on-closed-subset}
the pushforward $g'_*\mathcal{K}$ is the subsheaf of sections of
$\text{pr}_Y^*g_*\mathcal{F}$ supported in the inverse
image of $Z$ in $Y \times_S S'$. As $g'$ is affine
(Morphisms, Lemma \ref{morphisms-lemma-base-change-affine})
we see that $g'_*$ is exact, hence we conclude.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-different-centers}
Let $S$ be a scheme. Let $Z \subset S$ be a closed subscheme.
Let $D \subset S$ be an effective Cartier divisor.
Let $Z' \subset S$ be the closed subscheme cut out by the product
of the ideal sheaves of $Z$ and $D$.
Let $S' \to S$ be the blowup of $S$ in $Z$.
\begin{enumerate}
\item The blowup of $S$ in $Z'$ is isomorphic to $S' \to S$.
\item Let $f : X \to S$ be a morphism of schemes and let $\mathcal{F}$
be a quasi-coherent $\mathcal{O}_X$-module. If $\mathcal{F}$ has
no nonzero local sections supported in $f^{-1}D$, then the
strict transform of $\mathcal{F}$ relative to the blowing up
in $Z$ agrees with the strict transform of $\mathcal{F}$ relative
to the blowing up of $S$ in $Z'$.
\end{enumerate}
\end{lemma}

\begin{proof}
The first statement follows on combining
Lemmas \ref{lemma-blowing-up-two-ideals} and
\ref{lemma-blow-up-effective-Cartier-divisor}.
Using Lemma \ref{lemma-blowing-up-affine} the second statement
translates into the
following algebra problem. Let $A$ be a ring, $I \subset A$ an ideal,
$x \in A$ a nonzerodivisor, and $a \in I$. Let $M$ be an $A$-module
whose $x$-torsion is zero. To show: the $a$-power torsion in
$M \otimes_A A[\frac{I}{a}]$ is equal to the $xa$-power torsion.
The reason for this is that the kernel and cokernel of the map
$A \to A[\frac{I}{a}]$ is $a$-power torsion, so this map becomes an
isomorphism after inverting $a$. Hence the kernel
and cokernel of $M \to M \otimes_A A[\frac{I}{a}]$ are $a$-power
torsion too. This implies the result.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-composition-blowups}
Let $S$ be a scheme. Let $Z \subset S$ be a closed subscheme.
Let $b : S' \to S$ be the blowing up with center $Z$. Let $Z' \subset S'$ be
a closed subscheme. Let $S'' \to S'$ be the blowing up with center $Z'$.
Let $Y \subset S$ be a closed subscheme such that
$Y = Z \cup b(Z')$ set theoretically and the composition $S'' \to S$
is isomorphic to the blowing up of $S$ in $Y$.
In this situation, given any scheme $X$ over $S$ and
$\mathcal{F} \in \QCoh(\mathcal{O}_X)$ we have
\begin{enumerate}
\item the strict transform of $\mathcal{F}$ with respect to the blowing
up of $S$ in $Y$ is equal to the strict transform with respect to the
blowup $S'' \to S'$ in $Z'$ of the strict transform of $\mathcal{F}$
with respect to the blowup $S' \to S$ of $S$ in $Z$, and
\item the strict transform of $X$ with respect to the blowing
up of $S$ in $Y$ is equal to the strict transform with respect to the
blowup $S'' \to S'$ in $Z'$ of the strict transform of $X$
with respect to the blowup $S' \to S$ of $S$ in $Z$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $\mathcal{F}'$ be the strict transform of $\mathcal{F}$ with respect
to the blowup $S' \to S$ of $S$ in $Z$.
Let $\mathcal{F}''$ be the strict transform of $\mathcal{F}'$ with respect
to the blowup $S'' \to S'$ of $S'$ in $Z'$.
Let $\mathcal{G}$ be the strict transform of $\mathcal{F}$ with respect
to the blowup $S'' \to S$ of $S$ in $Y$.
We also label the morphisms
$$
\xymatrix{
X \times_S S'' \ar[r]_q \ar[d]^{f''} &
X \times_S S' \ar[r]_p \ar[d]^{f'} &
X \ar[d]^f \\
S'' \ar[r] & S' \ar[r] & S
}
$$
By definition there is a surjection $p^*\mathcal{F} \to \mathcal{F}'$
and a surjection $q^*\mathcal{F}' \to \mathcal{F}''$ which combine
by right exactness of $q^*$ to a surjection
$(p \circ q)^*\mathcal{F} \to \mathcal{F}''$. Also we have the surjection
$(p \circ q)^*\mathcal{F} \to \mathcal{G}$. Thus it suffices to prove
that these two surjections have the same kernel.

\medskip\noindent
The kernel of the surjection $p^*\mathcal{F} \to \mathcal{F}'$
is supported on $(f \circ p)^{-1}Z$, so this map is an isomorphism at
points in the complement. Hence the kernel of
$q^*p^*\mathcal{F} \to q^*\mathcal{F}'$
is supported on $(f \circ p \circ q)^{-1}Z$. The kernel of
$q^*\mathcal{F}' \to \mathcal{F}''$ is supported on $(f' \circ q)^{-1}Z'$.
Combined we see that the kernel of
$(p \circ q)^*\mathcal{F} \to \mathcal{F}''$ is supported on
$(f \circ p \circ q)^{-1}Z \cup (f' \circ q)^{-1}Z' =
(f \circ p \circ q)^{-1}Y$.
By construction of $\mathcal{G}$ we see that we obtain a factorization
$(p \circ q)^*\mathcal{F} \to \mathcal{F}'' \to \mathcal{G}$.
To finish the proof it suffices to show that $\mathcal{F}''$ has no
nonzero (local) sections supported on
$(f \circ p \circ q)^{-1}(Y) =
(f \circ p \circ q)^{-1}Z \cup (f' \circ q)^{-1}Z'$.
This follows from Lemma \ref{lemma-strict-transform-different-centers}
applied to $\mathcal{F}'$ on $X \times_S S'$ over $S'$, the closed
subscheme $Z'$ and the effective Cartier divisor $b^{-1}Z$.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-universally-injective}
In the situation of Definition \ref{definition-strict-transform}.
Suppose that
$$
0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0
$$
is an exact sequence of quasi-coherent sheaves on $X$ which remains
exact after any base change $T \to S$. Then the strict transforms of
$\mathcal{F}_i'$ relative to any blowup $S' \to S$
form a short exact sequence
$0 \to \mathcal{F}'_1 \to \mathcal{F}'_2 \to \mathcal{F}'_3 \to 0$ too.
\end{lemma}

\begin{proof}
We may localize on $S$ and $X$ and assume both are affine.
Then we may push $\mathcal{F}_i$ to $S$, see
Lemma \ref{lemma-strict-transform-affine}.
We may assume that our blowup is the morphism $1 : S \to S$
associated to an effective Cartier divisor $D \subset S$.
Then the translation into algebra is the following: Suppose that $A$
is a ring and $0 \to M_1 \to M_2 \to M_3 \to 0$ is a universally
exact sequence of $A$-modules. Let $a\in A$. Then the sequence
$$
0 \to
M_1/a\text{-power torsion} \to
M_2/a\text{-power torsion} \to
M_3/a\text{-power torsion} \to 0
$$
is exact too. Namely, surjectivity of the last map and injectivity of
the first map are immediate. The problem is exactness in the middle.
Suppose that $x \in M_2$ maps to zero in $M_3/a\text{-power torsion}$.
Then $y = a^n x \in M_1$ for some $n$. Then $y$ maps to zero in
$M_2/a^nM_2$. Since $M_1 \to M_2$ is universally injective we see that
$y$ maps to zero in $M_1/a^nM_1$. Thus $y = a^n z$ for some $z \in M_1$.
Thus $a^n(x - y) = 0$. Hence $y$ maps to the class of $x$ in
$M_2/a\text{-power torsion}$ as desired.
\end{proof}







\section{Admissible blowups}
\label{section-admissible-blowups}

\noindent
To have a bit more control over our blowups we introduce the following
standard terminology.

\begin{definition}
\label{definition-admissible-blowup}
Let $X$ be a scheme. Let $U \subset X$ be an open subscheme. A morphism
$X' \to X$ is called a {\it $U$-admissible blowup} if there exists a
closed immersion $Z \to X$ of finite presentation with $Z$ disjoint from
$U$ such that $X'$ is isomorphic to the blowup of $X$ in $Z$.
\end{definition}

\noindent
We recall that $Z \to X$ is of finite presentation if and only if the
ideal sheaf $\mathcal{I}_Z \subset \mathcal{O}_X$ is of finite type, see
Morphisms, Lemma \ref{morphisms-lemma-closed-immersion-finite-presentation}.
In particular, a $U$-admissible blowup is a projective morphism, see
Lemma \ref{lemma-blowing-up-projective}.
Note that there can be multiple centers which give rise to the same morphism.
Hence the requirement is just the existence of some center disjoint from
$U$ which produces $X'$.
Finally, as the morphism $b : X' \to X$ is an isomorphism over $U$ (see
Lemma \ref{lemma-blowing-up-gives-effective-Cartier-divisor}) we will often
abuse notation and think of $U$ as an open subscheme of $X'$ as well.

\begin{lemma}
\label{lemma-composition-admissible-blowups}
\begin{slogan}
Admissible blowups are stable under composition.
\end{slogan}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U \subset X$ be a quasi-compact open subscheme.
Let $b : X' \to X$ be a $U$-admissible blowup.
Let $X'' \to X'$ be a $U$-admissible blowup.
Then the composition $X'' \to X$ is a $U$-admissible blowup.
\end{lemma}

\begin{proof}
Immediate from the more precise
Lemma \ref{lemma-composition-finite-type-blowups}.
\end{proof}

\begin{lemma}
\label{lemma-extend-admissible-blowups}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U, V \subset X$ be quasi-compact open subschemes.
Let $b : V' \to V$ be a $U \cap V$-admissible blowup.
Then there exists a $U$-admissible blowup $X' \to X$
whose restriction to $V$ is $V'$.
\end{lemma}

\begin{proof}
Let $\mathcal{I} \subset \mathcal{O}_V$ be the finite type
quasi-coherent sheaf of ideals such that $V(\mathcal{I})$ is
disjoint from $U \cap V$ and such that $V'$ is isomorphic to the
blowup of $V$ in $\mathcal{I}$. Let
$\mathcal{I}' \subset \mathcal{O}_{U \cup V}$ be the quasi-coherent
sheaf of ideals whose restriction to $U$ is $\mathcal{O}_U$ and
whose restriction to $V$ is $\mathcal{I}$ (see Sheaves, Section
\ref{sheaves-section-glueing-sheaves}).
By Properties, Lemma \ref{properties-lemma-extend}
there exists a finite type quasi-coherent sheaf of ideals
$\mathcal{J} \subset \mathcal{O}_X$ whose restriction to $U \cup V$ is
$\mathcal{I}'$. The lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-dominate-admissible-blowups}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U \subset X$ be a quasi-compact open subscheme.
Let $b_i : X_i \to X$, $i = 1, \ldots, n$ be $U$-admissible blowups.
There exists a $U$-admissible blowup $b : X' \to X$ such that
(a) $b$ factors as $X' \to X_i \to X$ for $i = 1, \ldots, n$ and
(b) each of the morphisms $X' \to X_i$ is a $U$-admissible blowup.
\end{lemma}

\begin{proof}
Let $\mathcal{I}_i \subset \mathcal{O}_X$ be the finite type
quasi-coherent sheaf of ideals such that $V(\mathcal{I}_i)$ is
disjoint from $U$ and such that $X_i$ is isomorphic to the
blowup of $X$ in $\mathcal{I}_i$. Set
$\mathcal{I} = \mathcal{I}_1 \cdot \ldots \cdot \mathcal{I}_n$
and let $X'$ be the blowup of $X$ in $\mathcal{I}$. Then
$X' \to X$ factors through $b_i$ by Lemma \ref{lemma-blowing-up-two-ideals}.
\end{proof}

\begin{lemma}
\label{lemma-separate-disjoint-opens-by-blowing-up}
\begin{slogan}
Separate irreducible components by blowing up.
\end{slogan}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U, V$ be quasi-compact disjoint open subschemes of $X$.
Then there exist a $U \cup V$-admissible blowup $b : X' \to X$
such that $X'$ is a disjoint union of open subschemes
$X' = X'_1 \amalg X'_2$ with $b^{-1}(U) \subset X'_1$ and
$b^{-1}(V) \subset X'_2$.
\end{lemma}

\begin{proof}
Choose a finite type quasi-coherent sheaf of ideals $\mathcal{I}$,
resp.\ $\mathcal{J}$ such that $X \setminus U = V(\mathcal{I})$,
resp.\ $X \setminus V = V(\mathcal{J})$, see
Properties, Lemma \ref{properties-lemma-quasi-coherent-finite-type-ideals}.
Then $V(\mathcal{I}\mathcal{J}) = X$ set theoretically, hence
$\mathcal{I}\mathcal{J}$ is a locally nilpotent sheaf of ideals.
Since $\mathcal{I}$ and $\mathcal{J}$ are of finite type and $X$
is quasi-compact there exists an $n > 0$ such that
$\mathcal{I}^n \mathcal{J}^n = 0$. We may and do replace $\mathcal{I}$
by $\mathcal{I}^n$ and $\mathcal{J}$ by $\mathcal{J}^n$. Whence
$\mathcal{I} \mathcal{J} = 0$. Let $b : X' \to X$ be the blowing
up in $\mathcal{I} + \mathcal{J}$. This is $U \cup V$-admissible
as $V(\mathcal{I} + \mathcal{J}) = X \setminus U \cup V$. We will show that
$X'$ is a disjoint union of open subschemes $X' = X'_1 \amalg X'_2$
such that $b^{-1}\mathcal{I}|_{X'_2} = 0$ and $b^{-1}\mathcal{J}|_{X'_1} = 0$
which will prove the lemma.

\medskip\noindent
We will use the description of the blowing up in
Lemma \ref{lemma-blowing-up-affine}. Suppose that $U = \Spec(A) \subset X$
is an affine open such that $\mathcal{I}|_U$, resp.\ $\mathcal{J}|_U$
corresponds to the finitely generated ideal $I \subset A$, resp.\ $J \subset A$.
Then
$$
b^{-1}(U) = \text{Proj}(A \oplus (I + J) \oplus (I + J)^2 \oplus \ldots)
$$
This is covered by the affine open subsets $A[\frac{I + J}{x}]$
and $A[\frac{I + J}{y}]$ with $x \in I$ and $y \in J$. Since $x \in I$ is a
nonzerodivisor in $A[\frac{I + J}{x}]$ and $IJ = 0$ we see that
$J A[\frac{I + J}{x}] = 0$. Since $y \in J$ is a nonzerodivisor
in $A[\frac{I + J}{y}]$ and $IJ = 0$ we see that
$I A[\frac{I + J}{y}] = 0$. Moreover,
$$
\Spec(A[\textstyle{\frac{I + J}{x}}]) \cap
\Spec(A[\textstyle{\frac{I + J}{y}}]) =
\Spec(A[\textstyle{\frac{I + J}{xy}}]) = \emptyset
$$
because $xy$ is both a nonzerodivisor and zero. Thus $b^{-1}(U)$
is the disjoint union of the open subscheme $U_1$ defined as the union
of the standard opens $\Spec(A[\frac{I + J}{x}])$ for $x \in I$ and the open
subscheme $U_2$ which is the union of the affine opens
$\Spec(A[\frac{I + J}{y}])$ for $y \in J$. We have seen that
$b^{-1}\mathcal{I}\mathcal{O}_{X'}$ restricts to zero on $U_2$
and $b^{-1}\mathcal{I}\mathcal{O}_{X'}$ restricts to zero on $U_1$.
We omit the verification that these open subschemes glue to global
open subschemes $X'_1$ and $X'_2$.
\end{proof}

\begin{lemma}
\label{lemma-blowing-up-denominators}
Let $X$ be a locally Noetherian scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $s$ be a regular meromorphic section of $\mathcal{L}$.
Let $U \subset X$ be the maximal open subscheme such that
$s$ corresponds to a section of $\mathcal{L}$ over $U$.
The blowup $b : X' \to X$ in the ideal of denominators
of $s$ is $U$-admissible. There exists an effective Cartier divisor
$D \subset X'$ and an isomorphism
$$
b^*\mathcal{L} = \mathcal{O}_{X'}(D - E),
$$
where $E \subset X'$ is the exceptional divisor such that the
meromorphic section $b^*s$ corresponds, via the isomorphism,
to the meromorphic section $1_D \otimes (1_E)^{-1}$.
\end{lemma}

\begin{proof}
From the definition of the ideal of denominators in
Definition
\ref{definition-regular-meromorphic-ideal-denominators}
we immediately see that $b$ is a $U$-admissible blowup.
For the notation $1_D$, $1_E$, and $\mathcal{O}_{X'}(D - E)$
please see Definition
\ref{definition-invertible-sheaf-effective-Cartier-divisor}.
The pullback $b^*s$ is defined by
Lemmas \ref{lemma-blow-up-pullback-effective-Cartier} and
\ref{lemma-meromorphic-sections-pullback}.
Thus the statement of the lemma makes sense.
We can reinterpret the final assertion as saying
that $b^*s$ is a global regular section of
$b^*\mathcal{L}(E)$ whose zero scheme is $D$.
This uniquely defines $D$ hence
to prove the lemma we may work affine locally on $X$ and $X'$.
Assume $X = \Spec(A)$ is affine and
$\mathcal{L} = \mathcal{O}_X$. Then $s$ is a regular meromorphic
function and shrinking further we may assume
$s = a'/a$ with $a', a \in A$ nonzerodivisors.
Then the ideal of denominators of $s$ corresponds
to the ideal $I = \{x \in A \mid xa' \in aA\}$.
Recall that $X'$ is covered by spectra of affine blowup
algebras $A' = A[\frac{I}{x}]$ with $x \in I$
(Lemma \ref{lemma-blowing-up-affine}). Fix $x \in I$ and
write $xa' = a a''$ for some $a'' \in A$.
The divisor $E \subset X'$ is cut out by $x \in A'$ over
the spectrum of $A'$ and hence $1/x$ is a 
generator of $\mathcal{O}_{X'}(E)$ over $\Spec(A')$.
Finally, in the total quotient ring
of $A'$ we have $a'/a = a''/x$. Hence $b^*s = a'/a$ restricts
to a regular section of $\mathcal{O}_{X'}(E)$ which is
over $\Spec(A')$ given by $a''/x$. This finishes the proof.
(The divisor $D \cap \Spec(A')$ is cut out by the image of
$a''$ in $A'$.)
\end{proof}





\section{Blowing up and flatness}
\label{section-blowup-flat}

\noindent
We continue the discussion started in
More on Algebra, Section \ref{more-algebra-section-blowup-flat}.
We will prove further results in More on Flatness, Section
\ref{flat-section-blowup-flat}.


\begin{lemma}
\label{lemma-strict-transform-blowup-fitting-ideal}
Let $S$ be a scheme. Let $\mathcal{F}$ be a finite type
quasi-coherent $\mathcal{O}_S$-module. Let $Z_k \subset S$ be the closed
subscheme cut out by $\text{Fit}_k(\mathcal{F})$, see
Section \ref{section-fitting-ideals}.
Let $S' \to S$ be the blowup of $S$ in $Z_k$ and let
$\mathcal{F}'$ be the strict transform of $\mathcal{F}$.
Then $\mathcal{F}'$ can locally be generated by $\leq k$
sections.
\end{lemma}

\begin{proof}
Recall that $\mathcal{F}'$ can locally be generated by $\leq k$
sections if and only if $\text{Fit}_k(\mathcal{F}') = \mathcal{O}_{S'}$, see
Lemma \ref{lemma-fitting-ideal-generate-locally}.
Hence this lemma is a translation of
More on Algebra, Lemma \ref{more-algebra-lemma-blowup-fitting-ideal}.
\end{proof}

\begin{lemma}
\label{lemma-strict-transform-blowup-fitting-ideal-locally-free}
Let $S$ be a scheme. Let $\mathcal{F}$ be a finite type
quasi-coherent $\mathcal{O}_S$-module. Let $Z_k \subset S$ be the closed
subscheme cut out by $\text{Fit}_k(\mathcal{F})$, see
Section \ref{section-fitting-ideals}.
Assume that $\mathcal{F}$ is locally free of rank $k$ on $S \setminus Z_k$.
Let $S' \to S$ be the blowup of $S$ in $Z_k$ and let
$\mathcal{F}'$ be the strict transform of $\mathcal{F}$.
Then $\mathcal{F}'$ is locally free of rank $k$.
\end{lemma}

\begin{proof}
Translation of More on Algebra, Lemma
\ref{more-algebra-lemma-blowup-fitting-ideal-locally-free}.
\end{proof}

\begin{lemma}
\label{lemma-blowup-fitting-ideal}
Let $X$ be a scheme. Let $\mathcal{F}$ be a finitely presented
$\mathcal{O}_X$-module. Let $U \subset X$ be a scheme theoretically
dense open such that $\mathcal{F}|_U$ is finite locally free of
constant rank $r$. Then
\begin{enumerate}
\item the blowup $b : X' \to X$ of $X$ in the $r$th Fitting
ideal of $\mathcal{F}$ is $U$-admissible,
\item the strict transform $\mathcal{F}'$ of $\mathcal{F}$
with respect to $b$ is locally free of rank $r$,
\item the kernel $\mathcal{K}$ of the surjection
$b^*\mathcal{F} \to \mathcal{F}'$ is
finitely presented and $\mathcal{K}|_U = 0$,
\item $b^*\mathcal{F}$ and $\mathcal{K}$ are perfect
$\mathcal{O}_{X'}$-modules of tor dimension $\leq 1$.
\end{enumerate}
\end{lemma}

\begin{proof}
The ideal $\text{Fit}_r(\mathcal{F})$ is of finite type
by Lemma \ref{lemma-fitting-ideal-of-finitely-presented}
and its restriction to $U$ is equal to $\mathcal{O}_U$ by
Lemma \ref{lemma-fitting-ideal-finite-locally-free}.
Hence $b : X' \to X$ is $U$-admissible, see
Definition \ref{definition-admissible-blowup}.

\medskip\noindent
By Lemma \ref{lemma-fitting-ideal-finite-locally-free}
the restriction of $\text{Fit}_{r - 1}(\mathcal{F})$
to $U$ is zero, and since $U$ is scheme theoretically dense
we conclude that $\text{Fit}_{r - 1}(\mathcal{F}) = 0$
on all of $X$. Thus it follows from
Lemma \ref{lemma-fitting-ideal-finite-locally-free}
that $\mathcal{F}$ is locally free of rank $r$
on the complement of subscheme cut out by the $r$th
Fitting ideal of $\mathcal{F}$ (this complement may
be bigger than $U$ which is why we had to do this step
in the argument). Hence by
Lemma \ref{lemma-strict-transform-blowup-fitting-ideal-locally-free}
the strict transform
$$
b^*\mathcal{F} \longrightarrow \mathcal{F}'
$$
is locally free of rank $r$. The kernel $\mathcal{K}$
of this map is supported on the exceptional divisor
of the blowup $b$ and hence $\mathcal{K}|_U = 0$.
Finally, since $\mathcal{F}'$ is finite locally free
and since the displayed arrow is surjective, we can
locally on $X'$ write $b^*\mathcal{F}$ as the
direct sum of $\mathcal{K}$ and $\mathcal{F}'$.
Since $b^*\mathcal{F}'$ is finitely presented
(Modules, Lemma \ref{modules-lemma-pullback-finite-presentation})
the same is true for $\mathcal{K}$.

\medskip\noindent
The statement on tor dimension follows from
More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideals-and-pd1}.
\end{proof}





\section{Modifications}
\label{section-modifications}

\noindent
In this section we will collect results of the type: after a modification
such and such are true. We will later see that a modification can be
dominated by a blowup (More on Flatness, Lemma
\ref{flat-lemma-dominate-modification-by-blowup}).

\begin{lemma}
\label{lemma-filter-after-modification}
Let $X$ be an integral scheme. Let $\mathcal{E}$ be a finite locally free
$\mathcal{O}_X$-module. There exists a modification $f : X' \to X$
such that $f^*\mathcal{E}$ has a filtration whose successive quotients
are invertible $\mathcal{O}_{X'}$-modules.
\end{lemma}

\begin{proof}
We prove this by induction on the rank $r$ of $\mathcal{E}$.
If $r = 1$ or $r = 0$ the lemma is obvious. Assume $r > 1$.
Let $P = \mathbf{P}(\mathcal{E})$ with structure morphism $\pi : P \to X$,
see Constructions, Section \ref{constructions-section-projective-bundle}.
Then $\pi$ is proper (Lemma \ref{lemma-relative-proj-proper}).
There is a canonical surjection
$$
\pi^*\mathcal{E} \to \mathcal{O}_P(1)
$$
whose kernel is finite locally free of rank $r - 1$.
Choose a nonempty open subscheme $U \subset X$ such that
$\mathcal{E}|_U \cong \mathcal{O}_U^{\oplus r}$.
Then $P_U = \pi^{-1}(U)$ is isomorphic to $\mathbf{P}^{r - 1}_U$.
In particular, there exists a section $s : U \to P_U$ of $\pi$.
Let $X' \subset P$ be the scheme theoretic image of the
morphism $U \to P_U \to P$. Then $X'$ is integral
(Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-image-reduced}),
the morphism $f = \pi|_{X'} : X' \to X$ is proper (Morphisms, Lemmas
\ref{morphisms-lemma-closed-immersion-proper} and
\ref{morphisms-lemma-composition-proper}), and
$f^{-1}(U) \to U$ is an isomorphism. Hence $f$ is a modification
(Morphisms, Definition \ref{morphisms-definition-modification}).
By construction the pullback $f^*\mathcal{E}$ has a two step
filtration whose quotient is invertible because it is equal to
$\mathcal{O}_P(1)|_{X'}$ and whose sub $\mathcal{E}'$ is locally free of rank
$r - 1$. By induction we can find a modification $g : X'' \to X'$
such that $g^*\mathcal{E}'$ has a filtration as in the statement of
the lemma. Thus $f \circ g : X'' \to X$ is the required modification.
\end{proof}

\begin{lemma}
\label{lemma-extend-rational-map-after-modification}
Let $S$ be a scheme. Let $X$, $Y$ be schemes over $S$.
Assume $X$ is Noetherian and $Y$ is proper over $S$.
Given an $S$-rational map $f : U \to Y$ from $X$ to $Y$
there exists a morphism $p : X' \to X$ and an
$S$-morphism $f' : X' \to Y$ such that
\begin{enumerate}
\item $p$ is proper and $p^{-1}(U) \to U$ is an isomorphism,
\item $f'|_{p^{-1}(U)}$ is equal to $f \circ p|_{p^{-1}(U)}$.
\end{enumerate}
\end{lemma}

\begin{proof}
Denote $j : U \to X$ the inclusion morphism. Let $X' \subset Y \times_S X$
be the scheme theoretic image of $(f, j) : U \to Y \times_S X$
(Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-image}).
The projection $g : Y \times_S X \to X$ is proper
(Morphisms, Lemma \ref{morphisms-lemma-base-change-proper}).
The composition $p : X' \to X$ of $X' \to Y \times_S X$ and $g$ is proper
(Morphisms, Lemmas \ref{morphisms-lemma-closed-immersion-proper} and
\ref{morphisms-lemma-composition-proper}).
Since $g$ is separated and $U \subset X$ is retrocompact (as $X$ is Noetherian)
we conclude that $p^{-1}(U) \to U$ is an isomorphism by
Morphisms, Lemma
\ref{morphisms-lemma-scheme-theoretic-image-of-partial-section}.
On the other hand, the composition $f' : X' \to Y$ of $X' \to Y \times_S X$
and the projection $Y \times_S X \to Y$ agrees with $f$ on $p^{-1}(U)$.
\end{proof}







\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}
