Lemma 31.18.9. 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$.

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

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

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

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.

**Proof.**
Choose affine open neighbourhoods $\mathop{\mathrm{Spec}}(A)$ of $s$ and $\mathop{\mathrm{Spec}}(B)$ of $x$ such that $\varphi (\mathop{\mathrm{Spec}}(B)) \subset \mathop{\mathrm{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 $\mathop{\mathrm{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 \mathop{\mathrm{Spec}}(B_ g)$ is a relative effective Cartier divisor.

By Algebra, Lemma 10.168.1 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 10.99.2 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 10.68.6 and Algebra, Theorem 10.129.4 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 \mathop{\mathrm{Spec}}((B_0)_{g_0})$ is a relative effective Cartier divisor. Since we know that this property is preserved under base change, see Lemma 31.18.1, we obtain the claim mentioned above with $g$ equal to the image of $g_0$ in $B$.

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 10.128.4. It follows that $Z \to D$ is an isomorphism in a neighbourhood of $x$, see Algebra, Lemma 10.126.6. 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$.

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 29.21.3 and 29.21.11.
$\square$

## Comments (0)