hcju/stacksqa huggingface dataset:
Note that the assumption on $Y' \to Y$ implies that for $y' \in Y'$ mapping to $y \in Y$ the field extension $\kappa(y) \subset \kappa(y')$ is finitely generated. Hence also all the fibres $X'_{y'} = (X_y)_{\kappa(y')}$ are locally Noetherian, see Varieties, Lemma \ref{varieties-lemma-locally-Noetherian-base-change}. Thus the lemma makes sense. Set $y' = f'(x')$ and $y = f(x)$. Hence we get the following commutative diagram of local rings $$ \xymatrix{ \mathcal{O}_{X', x'} & \mathcal{O}_{X, x} \ar[l] \\ \mathcal{O}_{Y', y'} \ar[u] & \mathcal{O}_{Y, y} \ar[l] \ar[u] } $$ where the upper left corner is a localization of the tensor product of the upper right and lower left corners over the lower right corner. \medskip\noindent Assume $f$ is Cohen-Macaulay at $x$. The flatness of $\mathcal{O}_{Y, y} \to \mathcal{O}_{X, x}$ implies the flatness of $\mathcal{O}_{Y', y'} \to \mathcal{O}_{X', x'}$, see Algebra, Lemma \ref{algebra-lemma-base-change-flat-up-down}. The fact that $\mathcal{O}_{X, x}/\mathfrak m_y\mathcal{O}_{X, x}$ is Cohen-Macaulay implies that $\mathcal{O}_{X', x'}/\mathfrak m_{y'}\mathcal{O}_{X', x'}$ is Cohen-Macaulay, see Varieties, Lemma \ref{varieties-lemma-CM-base-change}. Hence we see that $f'$ is Cohen-Macaulay at $x'$. \medskip\noindent Assume $f$ is flat at $x$ and $f'$ is Cohen-Macaulay at $x'$. The fact that $\mathcal{O}_{X', x'}/\mathfrak m_{y'}\mathcal{O}_{X', x'}$ is Cohen-Macaulay implies that $\mathcal{O}_{X, x}/\mathfrak m_y\mathcal{O}_{X, x}$ is Cohen-Macaulay, see Varieties, Lemma \ref{varieties-lemma-CM-base-change}. Hence we see that $f$ is Cohen-Macaulay at $x$. \medskip\noindent Assume $Y' \to Y$ is flat at $y'$ and $f'$ is Cohen-Macaulay at $x'$. The flatness of $\mathcal{O}_{Y', y'} \to \mathcal{O}_{X', x'}$ and $\mathcal{O}_{Y, y} \to \mathcal{O}_{Y', y'}$ implies the flatness of $\mathcal{O}_{Y, y} \to \mathcal{O}_{X, x}$, see Algebra, Lemma \ref{algebra-lemma-base-change-flat-up-down}. The fact that $\mathcal{O}_{X', x'}/\mathfrak m_{y'}\mathcal{O}_{X', x'}$ is Cohen-Macaulay implies that $\mathcal{O}_{X, x}/\mathfrak m_y\mathcal{O}_{X, x}$ is Cohen-Macaulay, see Varieties, Lemma \ref{varieties-lemma-CM-base-change}. Hence we see that $f$ is Cohen-Macaulay at $x$.
As $f$ is flat with locally Noetherian fibres the equality in (1) holds by definition. Parts (2) and (3) follow from Algebra, Lemma \ref{algebra-lemma-generic-CM-flat-finite-presentation}. Part (4) follows either from Algebra, Lemma \ref{algebra-lemma-CM-locus-commutes-base-change} or Varieties, Lemma \ref{varieties-lemma-CM-base-change}.
Openness of flatness shows (2) and (3) are equivalent, see Theorem \ref{theorem-openness-flatness}. \medskip\noindent Choose affine open $U = \Spec(A) \subset X$ with $x \in U$ and $V = \Spec(R) \subset S$ with $f(U) \subset V$. Then $R \to A$ is a flat ring map of finite presentation. Let $\mathfrak p \subset A$ be the prime ideal corresponding to $x$. After replacing $A$ by a principal localization we may assume there exists a quasi-finite map $R[x_1, \ldots, x_d]  \to A$, see Algebra, Lemma \ref{algebra-lemma-quasi-finite-over-polynomial-algebra}. Thus there exists at least one pair $(U, g)$ consisting of an open neighbourhood $U \subset X$ of $x$ and a locally\footnote{If $S$ is quasi-separated, then $g$ will be quasi-finite.} quasi-finite morphism $g : U \to \mathbf{A}^d_S$. \medskip\noindent Claim: Given $R \to A$ flat and of finite presentation, a prime $\mathfrak p \subset A$ and $\varphi : R[x_1, \ldots, x_d] \to A$ quasi-finite at $\mathfrak p$ we have: $\Spec(\varphi)$ is flat at $\mathfrak p$ if and only if $\Spec(A) \to \Spec(R)$ is Cohen-Macaulay at $\mathfrak p$.  Namely, by Theorem \ref{theorem-criterion-flatness-fibre} flatness may be checked on fibres. The same is true for being Cohen-Macaulay (as $A$ is already assumed flat over $R$). Thus the claim follows from Algebra, Lemma \ref{algebra-lemma-where-CM}. \medskip\noindent The claim shows that (1) is equivalent to (4) and combined with the fact that we have constructed a suitable $(U, g)$ in the second paragraph, the claim also shows that (1) is equivalent to (2).
We have $\mathcal{P}(f) = \mathcal{P}_1(f) \wedge \mathcal{P}_2(f)$ where $\mathcal{P}_1(f)=$``$f$ is flat'', and $\mathcal{P}_2(f)=$``the fibres of $f$ are locally Noetherian and Cohen-Macaulay''. We know that $\mathcal{P}_1$ is local in the fppf topology on the source and the target, see Descent, Lemmas \ref{descent-lemma-descending-property-flat} and \ref{descent-lemma-flat-fpqc-local-source}. Thus we have to deal with $\mathcal{P}_2$. \medskip\noindent Let $f : X \to Y$ be a morphism of schemes. Let $\{\varphi_i : Y_i \to Y\}_{i \in I}$ be an fppf covering of $Y$. Denote $f_i : X_i \to Y_i$ the base change of $f$ by $\varphi_i$. Let $i \in I$ and let $y_i \in Y_i$ be a point. Set $y = \varphi_i(y_i)$. Note that $$ X_{i, y_i} = \Spec(\kappa(y_i)) \times_{\Spec(\kappa(y))} X_y. $$ and that $\kappa(y) \subset \kappa(y_i)$ is a finitely generated field extension. Hence if $X_y$ is locally Noetherian, then $X_{i, y_i}$ is locally Noetherian, see Varieties, Lemma \ref{varieties-lemma-locally-Noetherian-base-change}. And if in addition $X_y$ is Cohen-Macaulay, then $X_{i, y_i}$ is Cohen-Macaulay, see Varieties, Lemma \ref{varieties-lemma-CM-base-change}. Thus $\mathcal{P}_2$ is fppf local on the target. \medskip\noindent Let $\{X_i \to X\}$ be a syntomic covering of $X$. Let $y \in Y$. In this case $\{X_{i, y} \to X_y\}$ is a syntomic covering of the fibre. Hence the locality of $\mathcal{P}_2$ for the syntomic topology on the source follows from Descent, Lemma \ref{descent-lemma-CM-local-syntomic}. Combining the above the lemma follows.
(Our conventions on regular sequences imply that $h_i \in \mathfrak m_x$ for each $i$.) The case $r = 1$ follows from Lemma \ref{lemma-slice-given-element} combined with Divisors, Lemma \ref{divisors-lemma-relative-Cartier} to see that $V(h_1)$ remains an effective Cartier divisor after base change. The case $r > 1$ follows from a straightforward induction on $r$ (applying the result for $r = 1$ exactly $r$ times; details omitted). \medskip\noindent Another way to prove the lemma is using the material from Divisors, Section \ref{divisors-section-relative-regular-immersion}. Namely, first by openness of flatness (see Theorem \ref{theorem-openness-flatness}) we may assume, after replacing $X$ by an open neighbourhood of $x$, that $X \to S$ is flat. We may also assume that $X$ and $S$ are affine. After possible shrinking $X$ a bit we may assume that we have $h_1, \ldots, h_r \in \Gamma(X, \mathcal{O}_X)$. Set $Z = V(h_1, \ldots, h_r)$. Note that $X_s$ is a Noetherian scheme (because it is an algebraic $\kappa(s)$-scheme, see Varieties, Section \ref{varieties-section-algebraic-schemes}) and that the topology on $X_s$ is induced from the topology on $X$ (see Schemes, Lemma \ref{schemes-lemma-fibre-topological}). Hence after shrinking $X$ a bit more we may assume that $Z_s \subset X_s$ is a regular immersion cut out by the $r$ elements $h_i|_{X_s}$, see Divisors, Lemma \ref{divisors-lemma-Noetherian-scheme-regular-ideal} and its proof. It is also clear that $r = \dim_x(X_s) - \dim_x(Z_s)$ because \begin{align*} \dim_x(X_s) & = \dim(\mathcal{O}_{X_s, x}) + \text{trdeg}_{\kappa(s)}(\kappa(x)), \\ \dim_x(Z_s) & = \dim(\mathcal{O}_{Z_s, x}) + \text{trdeg}_{\kappa(s)}(\kappa(x)), \\ \dim(\mathcal{O}_{X_s, x}) & = \dim(\mathcal{O}_{Z_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}. Hence Divisors, Lemma \ref{divisors-lemma-fibre-quasi-regular} part (3) applies to show that (after Zariski shrinking $X$) the morphism $Z \to X$ is a regular immersion to which Divisors, Lemma \ref{divisors-lemma-relative-regular-immersion-flat-in-neighbourhood} applies (which gives the flatness and the statement on base change).
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)$. \medskip\noindent 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 \ref{morphisms-lemma-locally-quasi-finite-rel-dimension-0}. Hence there exists an affine open neighbourhood $U \subset X$ such that $U \to S$ is quasi-finite, see Morphisms, Lemma \ref{morphisms-lemma-quasi-finite-points-open}. 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 \ref{schemes-lemma-fibre-topological}). This proves the lemma in this case. \medskip\noindent Next, assume $d > 0$. Note that because $x$ is a closed point of its fibre the extension $\kappa(s) \subset \kappa(x)$ is finite (by the Hilbert Nullstellensatz, see Morphisms, Lemma \ref{morphisms-lemma-closed-point-fibre-locally-finite-type}). 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 \ref{morphisms-lemma-dimension-fibre-at-a-point}. Thus we may apply Lemma \ref{lemma-slice-once} 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 \ref{divisors-lemma-relative-Cartier}. 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 \ref{algebra-lemma-reformulate-CM} 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 \ref{divisors-lemma-composition-regular-immersion}. This finishes the proof.
For every $s \in S$ there exists an $i \in I$ such that $s$ is in the image of $S_i \to S$. By Lemma \ref{lemma-qf-fp-flat-neighbourhood-dominates-fppf} we can find a morphism $g_s : T_s \to S$ such that $s \in g_s(T_s)$ which is flat, locally of finite presentation and locally quasi-finite and such that $g_s$ factors through $S_i \to S$. Hence $\{T_s \to S\}$ is the desired covering of $S$ that refines $\mathcal{U}$.
Let $Y' \subset Y$ be the reduction of $Y$. Set $X' = Y' \times_Y X$ and $Z' = Y' \times_Y Z$. As $Y' \to Y$ is a universal homeomorphism by Morphisms, Lemma \ref{morphisms-lemma-reduction-universal-homeomorphism} we see that it suffices to prove the lemma for $Z' \subset X' \to Y'$. Thus we may assume that $Y$ is integral, see Properties, Lemma \ref{properties-lemma-characterize-integral}. By Morphisms, Proposition \ref{morphisms-proposition-generic-flatness} there exists a nonempty affine open $V \subset Y$ such that $X_V \to V$ and $Z_V \to V$ are flat and of finite presentation. We claim that $V$ works. Pick $y \in V$. If $Z_y$ has a nonempty interior, then $Z_y$ contains a generic point $\xi$ of an irreducible component of $X_y$. Note that $\eta \leadsto f(\xi)$. Since $Z_V \to V$ is flat we can choose a specialization $\xi' \leadsto \xi$, $\xi' \in Z$ with $f(\xi') = \eta$, see Morphisms, Lemma \ref{morphisms-lemma-generalizations-lift-flat}. By Lemma \ref{lemma-flat-finite-presentation-specialization-dimension} we see that $$ \dim_{\xi'}(Z_\eta) = \dim_{\xi}(Z_y) = \dim_{\xi}(X_y) = \dim_{\xi'}(X_\eta). $$ Hence some irreducible component of $Z_\eta$ passing through $\xi'$ has dimension $\dim_{\xi'}(X_\eta)$ which contradicts the assumption that $Z_\eta$ is nowhere dense in $X_\eta$ and we win.
Let $Y' \subset Y$ be the reduction of $Y$. Let $X' = Y' \times_Y X$ and $U' = Y' \times_Y U$. As $Y' \to Y$ induces a bijection on points, and as $U' \to U$ and $X' \to X$ induce isomorphisms of scheme theoretic fibres, we may replace $Y$ by $Y'$ and $X$ by $X'$. Thus we may assume that $Y$ is integral, see Properties, Lemma \ref{properties-lemma-characterize-integral}. We may also replace $Y$ by a nonempty affine open. In other words we may assume that $Y = \Spec(A)$ where $A$ is a domain with fraction field $K$. \medskip\noindent As $f$ is of finite type we see that $X$ is quasi-compact. Write $X = X_1 \cup \ldots \cup X_n$ for some affine opens $X_i$. By Morphisms, Definition \ref{morphisms-definition-scheme-theoretically-dense} we see that $U_i = X_i \cap U$ is an open subscheme of $X_i$ such that $U_{i, \eta}$ is scheme theoretically dense in $X_{i, \eta}$. Thus it suffices to prove the result for the pairs $(X_i, U_i)$, in other words we may assume that $X$ is affine. \medskip\noindent Write $X = \Spec(B)$. Note that $B_K$ is Noetherian as it is a finite type $K$-algebra. Hence $U_\eta$ is quasi-compact. Thus we can find finitely many $g_1, \ldots, g_m \in B$ such that $D(g_j) \subset U$ and such that $U_\eta = D(g_1)_\eta \cup \ldots \cup D(g_m)_\eta$. The fact that $U_\eta$ is scheme theoretically dense in $X_\eta$ means that $B_K \to \bigoplus_j (B_K)_{g_j}$ is injective, see Morphisms, Example \ref{morphisms-example-scheme-theoretic-closure}. By Algebra, Lemma \ref{algebra-lemma-when-injective-covering} this is equivalent to the injectivity of $B_K \to \bigoplus\nolimits_{j = 1, \ldots, m} B_K$, $b \mapsto (g_1b, \ldots, g_mb)$. Let $M$ be the cokernel of this map over $A$, i.e., such that we have an exact sequence $$ 0 \to I \to B \xrightarrow{(g_1, \ldots, g_m)} \bigoplus\nolimits_{j = 1, \ldots, m} B \to M \to 0 $$ After replacing $A$ by $A_h$ for some nonzero $h$ we may assume that $B$ is a flat, finitely presented $A$-algebra, and that $M$ is flat over $A$, see Algebra, Lemma \ref{algebra-lemma-generic-flatness}. The flatness of $B$ over $A$ implies that $B$ is torsion free as an $A$-module, see More on Algebra, Lemma \ref{more-algebra-lemma-flat-torsion-free}. Hence $B \subset B_K$. By assumption $I_K = 0$ which implies that $I = 0$ (as $I \subset B \subset B_K$ is a subset of $I_K$). Hence now we have a short exact sequence $$ 0 \to B \xrightarrow{(g_1, \ldots, g_m)} \bigoplus\nolimits_{j = 1, \ldots, m} B \to M \to 0 $$ with $M$ flat over $A$. Hence for every homomorphism $A \to \kappa$ where $\kappa$ is a field, we obtain a short exact sequence $$ 0 \to B \otimes_A \kappa \xrightarrow{(g_1 \otimes 1, \ldots, g_m \otimes 1)} \bigoplus\nolimits_{j = 1, \ldots, m} B \otimes_A \kappa \to M \otimes_A \kappa \to 0 $$ see Algebra, Lemma \ref{algebra-lemma-flat-tor-zero}. Reversing the arguments above this means that $\bigcup D(g_j \otimes 1)$ is scheme theoretically dense in $\Spec(B \otimes_A \kappa)$. As $\bigcup D(g_j \otimes 1) = \bigcup D(g_j)_\kappa \subset U_\kappa$ we obtain that $U_\kappa$ is scheme theoretically dense in $X_\kappa$ which is what we wanted to prove.
If $Y$ is Noetherian then $U = X \setminus (Z_1 \cup \ldots \cup Z_n)$ is of finite type over $Y$ and we can directly apply Lemma \ref{lemma-empty-generic-fibre} to get that $U_V = \emptyset$ for a nonempty open $V \subset Y$. In general we argue as follows. As the question is topological we may replace $Y$ by its reduction. Thus $Y$ is integral, see Properties, Lemma \ref{properties-lemma-characterize-integral}. After shrinking $Y$ we may assume that $X \to Y$ is flat, see Morphisms, Proposition \ref{morphisms-proposition-generic-flatness}. In this case every point $x$ in $X_y$ is a specialization of a point $x' \in X_\eta$ by Morphisms, Lemma \ref{morphisms-lemma-generalizations-lift-flat}. As the $Z_i$ are closed in $X$ and cover the generic fibre this implies that $X_y = \bigcup Z_{i, y}$ for $y \in Y$ as desired.
Choose an affine neighbourhood $\Spec(A) \subset Y$ of $\eta$. Choose an affine open $\Spec(B) \subset X$ mapping into $\Spec(A)$ via the morphism $f$. Let $\mathfrak p \subset A$ be the minimal prime corresponding to $\eta$. Let $B_{red}$ be the quotient of $B$ by the nilradical $\sqrt{(0)}$. The algebraic content of the lemma is that $C = B_{red} \otimes_A \kappa(\mathfrak p)$ is reduced. Denote $I \subset A$ the nilradical so that $A_{red} = A/I$. Denote $\mathfrak p_{red} = \mathfrak p/I$ which is a minimal prime of $A_{red}$ with $\kappa(\mathfrak p) = \kappa(\mathfrak p_{red})$. Since $A \to B_{red}$ and $A \to \kappa(\mathfrak p)$ both factor through $A \to A_{red}$ we have $C = B_{red} \otimes_{A_{red}} \kappa(\mathfrak p_{red})$. Now $\kappa(\mathfrak p_{red}) = (A_{red})_{\mathfrak p_{red}}$ is a localization by  Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}. Hence $C$ is a localization of $B_{red}$ (Algebra, Lemma \ref{algebra-lemma-tensor-localization}) and hence reduced.
Let $V = \Spec(A)$ be a nonempty affine open of $Y$. By assumption the Jacobson radical of $A$ is a prime ideal $\mathfrak p$. Let $K = \kappa(\mathfrak p)$. Let $p$ be the characteristic of $K$ if positive and $1$ if the characteristic is zero. By Varieties, Lemma \ref{varieties-lemma-finite-extension-geometrically-reduced} there exists a finite purely inseparable field extension $K \subset K'$ such that $X_{K'}$ is geometrically reduced over $K'$. Choose elements $x_1, \ldots, x_n \in K'$ which generate $K'$ over $K$ and such that some $p$-power of $x_i$ is in $A/\mathfrak p$. Let $A' \subset K'$ be the finite $A$-subalgebra of $K'$ generated by $x_1, \ldots, x_n$. Note that $A'$ is a domain with fraction field $K'$. By Algebra, Lemma \ref{algebra-lemma-p-ring-map} we see that $A \to A'$ is a universal homeomorphism. Set $Y' = \Spec(A')$. Set $X' = (Y' \times_Y X)_{red}$. The generic fibre of $X' \to Y'$ is $(X_K)_{red}$ by Lemma \ref{lemma-reduction-generic-fibre} which is geometrically reduced by construction. Note that $X' \to X_V$ is a finite universal homeomorphism as the composition of the reduction morphism $X' \to Y' \times_Y X$ (see Morphisms, Lemma \ref{morphisms-lemma-reduction-universal-homeomorphism}) and the base change of $g$. At this point all of the properties of the lemma hold except for possibly (7). This can be achieved by shrinking $Y'$ and hence $V$, see Morphisms, Proposition \ref{morphisms-proposition-generic-flatness}.
Let $V = \Spec(A)$ be a nonempty affine open of $Y$. By assumption the Jacobson radical of $A$ is a prime ideal $\mathfrak p$. Let $K = \kappa(\mathfrak p)$. By Varieties, Lemma \ref{varieties-lemma-finite-extension-geometrically-irreducible-components} there exists a finite separable field extension $K \subset K'$ such that all irreducible components of $X_{K'}$ are geometrically irreducible over $K'$. Choose an element $\alpha \in K'$ which generates $K'$ over $K$, see Fields, Lemma \ref{fields-lemma-primitive-element}. Let $P(T) \in K[T]$ be the minimal polynomial for $\alpha$ over $K$. After replacing $\alpha$ by $f \alpha$ for some $f \in A$, $f \not \in \mathfrak p$ we may assume that there exists a monic polynomial $T^d + a_1T^{d - 1} + \ldots + a_d \in A[T]$ which maps to $P(T) \in K[T]$ under the map $A[T] \to K[T]$. Set $A' = A[T]/(P)$. Then $A \to A'$ is a finite free ring map such that there exists a unique prime $\mathfrak q$ lying over $\mathfrak p$, such that $K = \kappa(\mathfrak p) \subset \kappa(\mathfrak q) = K'$ is finite separable, and such that $\mathfrak pA'_{\mathfrak q}$ is the maximal ideal of $A'_{\mathfrak q}$. Hence $g : Y' = \Spec(A') \to V = \Spec(A)$ is \'etale at $\mathfrak q$, see Algebra, Lemma \ref{algebra-lemma-characterize-etale}. This means that there exists an open $W \subset \Spec(A')$ such that $g|_W : W \to \Spec(A)$ is \'etale. Since $g$ is finite and since $\mathfrak q$ is the only point lying over $\mathfrak p$ we see that $Z = g(Y' \setminus W)$ is a closed subset of $V$ not containing $\mathfrak p$. Hence after replacing $V$ by a principal affine open of $V$ which does not meet $Z$ we obtain that $g$ is finite \'etale.
We may replace $S$ by an affine open neighbourhood of $f(\xi)$ and $X$ by an affine open neighbourhood of $\xi$. Hence we may assume $S = \Spec(A)$, $X = \Spec(B)$ and that $f$ is given by the finite type ring map $A \to B$, see Morphisms, Lemma \ref{morphisms-lemma-locally-finite-type-characterize}. Moreover, we may write $\mathcal{F} = \widetilde{M}$ for some finite $B$-module $M$, see Properties, Lemma \ref{properties-lemma-finite-type-module}. Let $\mathfrak q \subset B$ be the prime corresponding to $\xi$ and let $\mathfrak p \subset A$ be the corresponding prime of $A$. By assumption $\mathfrak q \in \text{Ass}_B(M \otimes_A \kappa(\mathfrak p))$, see Algebra, Remark \ref{algebra-remark-bourbaki} and Divisors, Lemma \ref{divisors-lemma-associated-affine-open}. With this notation $Z = V(\mathfrak q) \subset \Spec(B)$. In particular $f(Z) \subset V(\mathfrak p)$. Hence clearly it suffices to prove the lemma after replacing $A$, $B$, and $M$ by $A/\mathfrak pA$, $B/\mathfrak pB$, and $M/\mathfrak pM$. In other words we may assume that $A$ is a domain with fraction field $K$ and $\mathfrak q \subset B$ is an associated prime of $M \otimes_A K$. \medskip\noindent At this point we can use generic flatness. Namely, by Algebra, Lemma \ref{algebra-lemma-generic-flatness} there exists a nonzero $g \in A$ such that $M_g$ is flat as an $A_g$-module. After replacing $A$ by $A_g$ we may assume that $M$ is flat as an $A$-module. \medskip\noindent In this case, by Algebra, Lemma \ref{algebra-lemma-post-bourbaki} we see that $\mathfrak q$ is also an associated prime of $M$. Hence we obtain an injective $B$-module map $B/\mathfrak q \to M$. Let $Q$ be the cokernel so that we obtain a short exact sequence $$ 0 \to B/\mathfrak q \to M \to Q \to 0 $$ of finite $B$-modules. After applying generic flatness Algebra, Lemma \ref{algebra-lemma-generic-flatness} once more, this time to the $B$-module $Q$, we may assume that $Q$ is a flat $A$-module. In particular we may assume the short exact sequence above is universally injective, see Algebra, Lemma \ref{algebra-lemma-flat-tor-zero}. In this situation $(B/\mathfrak q) \otimes_A \kappa(\mathfrak p') \subset M \otimes_A \kappa(\mathfrak p')$ for any prime $\mathfrak p'$ of $A$. The lemma follows as a minimal prime $\mathfrak q'$ of the support of $(B/\mathfrak q) \otimes_A \kappa(\mathfrak p')$ is an associated prime of $(B/\mathfrak q) \otimes_A \kappa(\mathfrak p')$ by Divisors, Lemma \ref{divisors-lemma-minimal-support-in-ass}.
Let $Z \subset X$ be the scheme theoretic support of $\mathcal{F}$, see Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-support}. Then $Z_\eta$ is the scheme theoretic support of $\mathcal{F}_\eta$ (Morphisms, Lemma \ref{morphisms-lemma-flat-pullback-support}). Hence the generic points of irreducible components of $Z_\eta$ are contained in $\text{Ass}_{X_\eta}(\mathcal{F}_\eta)$ by Divisors, Lemma \ref{divisors-lemma-minimal-support-in-ass}. Hence we see that $Z_\eta \cap U_\eta = \emptyset$. Thus $T = Z \setminus U$ is a closed subset of $Z$ with $T_\eta = \emptyset$. If we endow $T$ with the induced reduced scheme structure then $T \to Y$ is a morphism of finite type. By Lemma \ref{lemma-empty-generic-fibre} there is a nonempty open $V \subset Y$ with $T_V = \emptyset$. Then $V$ works.