**Proof.**
We may and do replace $S$ by an affine open neighbourhood of $s$. We will prove the lemma for affine $S$ by induction on $d = \dim _ x(X_ s)$.

The case $d = 0$. In this case we show that we may take $Z$ to be an open neighbourhood of $x$. (Note that an open immersion is a regular immersion.) Namely, if $d = 0$, then $X \to S$ is quasi-finite at $x$, see Morphisms, Lemma 29.29.5. Hence there exists an affine open neighbourhood $U \subset X$ such that $U \to S$ is quasi-finite, see Morphisms, Lemma 29.55.2. Thus after replacing $X$ by $U$ we see that the fibre $X_ s$ is a finite discrete set. Hence after replacing $X$ by a further affine open neighbourhood of $X$ we see that $f^{-1}(\{ s\} ) = \{ x\} $ (because the topology on $X_ s$ is induced from the topology on $X$, see Schemes, Lemma 26.18.5). This proves the lemma in this case.

Next, assume $d > 0$. Note that because $x$ is a closed point of its fibre the extension $\kappa (x)/\kappa (s)$ is finite (by the Hilbert Nullstellensatz, see Morphisms, Lemma 29.20.3). Thus we see

\[ \text{depth}(\mathcal{O}_{X_ s, x}) = \dim (\mathcal{O}_{X_ s, x}) = d > 0 \]

the first equality as $\mathcal{O}_{X_ s, x}$ is Cohen-Macaulay and the second by Morphisms, Lemma 29.28.1. Thus we may apply Lemma 37.22.3 to find a diagram

\[ \xymatrix{ D \ar[r] \ar[rrd] & U \ar[r] \ar[rd] & X \ar[d] \\ & & S } \]

with $x \in D$. Note that $\mathcal{O}_{D_ s, x} = \mathcal{O}_{X_ s, x}/(\overline{h})$ for some nonzerodivisor $\overline{h}$, see Divisors, Lemma 31.18.1. Hence $\mathcal{O}_{D_ s, x}$ is Cohen-Macaulay of dimension one less than the dimension of $\mathcal{O}_{X_ s, x}$, see Algebra, Lemma 10.104.2 for example. Thus the morphism $D \to S$ is flat, locally of finite presentation, and Cohen-Macaulay at $x$ with $\dim _ x(D_ s) = \dim _ x(X_ s) - 1 = d - 1$. By induction hypothesis we can find a regular immersion $Z \to D$ having properties (a), (b), (c). As $Z \to D \to U$ are both regular immersions, we see that also $Z \to U$ is a regular immersion by Divisors, Lemma 31.21.7. This finishes the proof.
$\square$

## Comments (2)

Comment #2686 by Johan on

Comment #2711 by Takumi Murayama on