Lemma 57.16.3. Let $S$ be a Noetherian scheme. Let $s \in S$. Let $p : X \to Y$ be a morphism of schemes over $S$. Assume

1. $Y \to S$ and $X \to S$ proper,

2. $X$ is flat over $S$,

3. $X_ s \to Y_ s$ an isomorphism.

Then there exists an open neighbourhood $U \subset S$ of $s$ such that the base change $X_ U \to Y_ U$ is an isomorphism.

Proof. The morphism $p$ is proper by Morphisms, Lemma 29.41.6. By Cohomology of Schemes, Lemma 30.21.2 there is an open $Y_ s \subset V \subset Y$ such that $p|_{p^{-1}(V)} : p^{-1}(V) \to V$ is finite. By More on Morphisms, Theorem 37.16.1 there is an open $X_ s \subset U \subset X$ such that $p|_ U : U \to Y$ is flat. After removing the images of $X \setminus U$ and $Y \setminus V$ (which are closed subsets not containing $s$) we may assume $p$ is flat and finite. Then $p$ is open (Morphisms, Lemma 29.25.10) and $Y_ s \subset p(X) \subset Y$ hence after shrinking $S$ we may assume $p$ is surjective. As $p_ s : X_ s \to Y_ s$ is an isomorphism, the map

$p^\sharp : \mathcal{O}_ Y \longrightarrow p_*\mathcal{O}_ X$

of coherent $\mathcal{O}_ Y$-modules ($p$ is finite) becomes an isomorphism after pullback by $i : Y_ s \to Y$ (by Cohomology of Schemes, Lemma 30.5.1 for example). By Nakayama's lemma, this implies that $\mathcal{O}_{Y, y} \to (p_*\mathcal{O}_ X)_ y$ is surjective for all $y \in Y_ s$. Hence there is an open $Y_ s \subset V \subset Y$ such that $p^\sharp |_ V$ is surjective (Modules, Lemma 17.9.4). Hence after shrinking $S$ once more we may assume $p^\sharp$ is surjective which means that $p$ is a closed immersion (as $p$ is already finite). Thus now $p$ is a surjective flat closed immersion of Noetherian schemes and hence an isomorphism, see Morphisms, Section 29.26. $\square$