hcju/stacksqa huggingface dataset:
Apply Lemma \ref{lemma-Noetherian-approximation} to get a cartesian diagram $$ \xymatrix{ X_0 \ar[d]_{f_0} & X \ar[l]^g \ar[d]^f \\ S_0 & S \ar[l]_h } $$ of affine schemes with $X_0 \to S_0$ a finite type morphism of schemes of finite type over $\mathbf{Z}$. By Lemma \ref{lemma-geometrically-reduced-constructible} the set $E \subset S_0$ of points where the fibre of $f_0$ is geometrically reduced is a constructible subset. By Lemma \ref{lemma-base-change-fibres-geometrically-reduced} we have $h(S) \subset E$. Write $S_0 = \Spec(A_0)$ and $S = \Spec(A)$. Write $A = \colim_i A_i$ as a direct colimit of finite type $A_0$-algebras. By Limits, Lemma \ref{limits-lemma-limit-contained-in-constructible} we see that $\Spec(A_i) \to S_0$ has image contained in $E$ for some $i$. After replacing $S_0$ by $\Spec(A_i)$ and $X_0$ by $X_0 \times_{S_0} \Spec(A_i)$ we see that all fibres of $f_0$ are geometrically reduced.
Apply Lemma \ref{lemma-Noetherian-approximation} to get a cartesian diagram $$ \xymatrix{ X_0 \ar[d]_{f_0} & X \ar[l]^g \ar[d]^f \\ S_0 & S \ar[l]_h } $$ of affine schemes with $X_0 \to S_0$ a finite type morphism of schemes of finite type over $\mathbf{Z}$. By Lemma \ref{lemma-nr-geom-irreducible-components-constructible} the set $E \subset S_0$ of points where the fibre of $f_0$ is geometrically irreducible is a constructible subset. By Lemma \ref{lemma-base-change-fibres-geometrically-irreducible} we have $h(S) \subset E$. Write $S_0 = \Spec(A_0)$ and $S = \Spec(A)$. Write $A = \colim_i A_i$ as a direct colimit of finite type $A_0$-algebras. By Limits, Lemma \ref{limits-lemma-limit-contained-in-constructible} we see that $\Spec(A_i) \to S_0$ has image contained in $E$ for some $i$. After replacing $S_0$ by $\Spec(A_i)$ and $X_0$ by $X_0 \times_{S_0} \Spec(A_i)$ we see that all fibres of $f_0$ are geometrically irreducible.
Apply Lemma \ref{lemma-Noetherian-approximation} to get a cartesian diagram $$ \xymatrix{ X_0 \ar[d]_{f_0} & X \ar[l]^g \ar[d]^f \\ S_0 & S \ar[l]_h } $$ of affine schemes with $X_0 \to S_0$ a finite type morphism of schemes of finite type over $\mathbf{Z}$. By Lemma \ref{lemma-nr-geom-connected-components-constructible} the set $E \subset S_0$ of points where the fibre of $f_0$ is geometrically connected is a constructible subset. By Lemma \ref{lemma-base-change-fibres-geometrically-connected} we have $h(S) \subset E$. Write $S_0 = \Spec(A_0)$ and $S = \Spec(A)$. Write $A = \colim_i A_i$ as a direct colimit of finite type $A_0$-algebras. By Limits, Lemma \ref{limits-lemma-limit-contained-in-constructible} we see that $\Spec(A_i) \to S_0$ has image contained in $E$ for some $i$. After replacing $S_0$ by $\Spec(A_i)$ and $X_0$ by $X_0 \times_{S_0} \Spec(A_i)$ we see that all fibres of $f_0$ are geometrically connected.
Apply Lemma \ref{lemma-Noetherian-approximation} to get a cartesian diagram $$ \xymatrix{ X_0 \ar[d]_{f_0} & X \ar[l]^g \ar[d]^f \\ S_0 & S \ar[l]_h } $$ of affine schemes with $X_0 \to S_0$ a finite type morphism of schemes of finite type over $\mathbf{Z}$. By Lemma \ref{lemma-dimension-fibres-constructible} the set $E \subset S_0$ of points where the fibre of $f_0$ has dimension $d$ is a constructible subset. By Lemma \ref{lemma-base-change-dimension-fibres} we have $h(S) \subset E$. Write $S_0 = \Spec(A_0)$ and $S = \Spec(A)$. Write $A = \colim_i A_i$ as a direct colimit of finite type $A_0$-algebras. By Limits, Lemma \ref{limits-lemma-limit-contained-in-constructible} we see that $\Spec(A_i) \to S_0$ has image contained in $E$ for some $i$. After replacing $S_0$ by $\Spec(A_i)$ and $X_0$ by $X_0 \times_{S_0} \Spec(A_i)$ we see that all fibres of $f_0$ have dimension $d$.
The given pair of diagrams correspond to cocartesian diagrams of rings $$ \vcenter{ \xymatrix{ B_1 \ar[r] & B \\ A_1 \ar[u] \ar[r] & A \ar[u] } } \quad\text{and}\quad \vcenter{ \xymatrix{ B_2 \ar[r] & B \\ A_2 \ar[u] \ar[r] & A \ar[u] } } $$ Let $A_0 \subset A$ be a finite type $\mathbf{Z}$-subalgebra of $A$ containing the image of both $A_1 \to A$ and $A_2 \to A$. Such a subalgebra exists because by assumption both $A_1$ and $A_2$ are of finite type over $\mathbf{Z}$. Note that the rings $B_{0, 1} = B_1 \otimes_{A_1} A_0$ and $B_{0, 2} = B_2 \otimes_{A_2} A_0$ are finite type $A_0$-algebras with the property that $B_{0, 1} \otimes_{A_0} A \cong B \cong B_{0, 2} \otimes_{A_0} A$ as $A$-algebras. As $A$ is the directed colimit of its finite type $A_0$-subalgebras, by Limits, Lemma \ref{limits-lemma-descend-finite-presentation} we may assume after enlarging $A_0$ that there exists an isomorphism $B_{0, 1} \cong B_{0, 2}$ as $A_0$-algebras. Since properties $P$ and $Q$ are assumed stable under base change we conclude that setting $S_0 = \Spec(A_0)$ and $$ X_0 = X_1 \times_{S_1} S_0 = \Spec(B_{0, 1}) \cong \Spec(B_{0, 2}) = X_2 \times_{S_2} S_0 $$ works.
For part (1), consider the fibre product $U = U_1 \times_S U_2$. It is \'etale over both $U_1$ and $U_2$ because \'etale morphisms are preserved under base change, see Morphisms, Lemma \ref{morphisms-lemma-base-change-etale}. There is a point of $U$ mapping to both $u_1$ and $u_2$ for example by the description of points of a fibre product in Schemes, Lemma \ref{schemes-lemma-points-fibre-product}. For part (2), define $U''$ as the fibre product $$ \xymatrix{ U'' \ar[r] \ar[d] & U \ar[d]^{(h_1, h_2)} \\ U' \ar[r]^-\Delta & U' \times_S U'. } $$ Since $h_1$ and $h_2$ induce the same map of residue fields $\kappa(u') \to \kappa(u)$ there exists a point $u'' \in U''$ lying over $u'$ with $\kappa(u'') = \kappa(u')$. In particular $U'' \not = \emptyset$. Moreover, since $U'$ is \'etale over $S$, so is the fibre product $U'\times_S U'$ (see Morphisms, Lemmas \ref{morphisms-lemma-base-change-etale} and \ref{morphisms-lemma-composition-etale}). Hence the vertical arrow $(h_1, h_2)$ is \'etale by Morphisms, Lemma \ref{morphisms-lemma-etale-permanence}. Therefore $U''$ is \'etale over $U'$ by base change, and hence also \'etale over $S$ (because compositions of \'etale morphisms are \'etale). Thus $(U'', u'')$ is a solution to the problem.
Let $\Spec(A) \subset S$ be an affine neighbourhood of $s$. Let $\mathfrak p \subset A$ be the prime ideal corresponding to $s$. With these choices we have canonical isomorphisms $\mathcal{O}_{S, s} = A_{\mathfrak p}$ and $\kappa(s) = \kappa(\mathfrak p)$. A cofinal system of elementary \'etale neighbourhoods is given by those elementary \'etale neighbourhoods $(U, u)$ such that $U$ is affine and $U \to S$ factors through $\Spec(A)$. In other words, we see that the right hand side is equal to $\colim_{(B, \mathfrak q)} B$ where the colimit is over \'etale $A$-algebras $B$ endowed with a prime $\mathfrak q$ lying over $\mathfrak p$ with $\kappa(\mathfrak p) = \kappa(\mathfrak q)$. Thus the lemma follows from Algebra, Lemma \ref{algebra-lemma-henselization-different}.
We may assume $X$, $V$, and $S$ affine. Say the morphism $X \to S$ is given by $A \to B$ the point $x$ by a prime $\mathfrak q \subset B$, the point $s$ by $\mathfrak p = A \cap \mathfrak q$, and the morphism $V \to X_s$ by $B \otimes_A \kappa(\mathfrak p) \to C$. Since $\kappa(\mathfrak p)$ is a localization of $A/\mathfrak p$ there exists an $f \in A$, $f \not \in \mathfrak p$ and an \'etale ring map $B \otimes_A (A/\mathfrak p)_f \to D$ such that $$ C = (B \otimes_A \kappa(\mathfrak p)) \otimes_{B \otimes_A (A/\mathfrak p)_f} D $$ See Algebra, Lemma \ref{algebra-lemma-etale} part (9). After replacing $A$ by $A_f$ and $B$ by $B_f$ we may assume $D$ is \'etale over $B \otimes_A A/\mathfrak p = B/\mathfrak p B$. Then we can apply Algebra, Lemma \ref{algebra-lemma-lift-etale}. This proves the lemma.
If $A \to B$ is a flat ring map, then $\Spec(B) \to \Spec(A)$ maps minimal primes to minimal primes by going down (Algebra, Lemma \ref{algebra-lemma-flat-going-down}). If $A \to B$ is faithfully flat, then every minimal prime is the image of a minimal prime (by Algebra, Lemma \ref{algebra-lemma-ff-rings} and \ref{algebra-lemma-minimal-prime-image-minimal-prime}). Hence the number of minimal primes of $R_i$ is $\geq$ the number of minimal primes of $R_{i'}$ if $i \leq i'$. By Algebra, Lemma \ref{algebra-lemma-colimit-faithfully-flat} each of the maps $R_i \to R$ is faithfully flat and we also see that the number of minimal primes of $R$ is $\geq$ the number of minimal primes of $R_i$. Finally, suppose that $\mathfrak q_1, \ldots, \mathfrak q_n$ are pairwise distinct minimal primes of $R$. Then we can find an $i$ such that $R_i \cap \mathfrak q_1, \ldots, R_i \cap \mathfrak q_n$ are pairwise distinct (as sets and hence as prime ideals). This implies the lemma.
Parts (3) and (4) follow from parts (1) and (2) via Properties, Lemma \ref{properties-lemma-number-of-branches-1}. \medskip\noindent Proof of (1). Let $\Spec(A)$ be an affine open neighbourhood of $x$ and let $\mathfrak p \subset A$ be the prime ideal corresponding to $x$. We may replace $X$ by $\Spec(A)$ and it suffices to consider affine elementary \'etale neighbourhoods $(U, u)$ in the supremum as they form a cofinal subsystem. Recall that the henselization $A_\mathfrak p^h$ is the colimit of the rings $B_\mathfrak q$ over the category of pairs $(B, \mathfrak q)$ where $B$ is an \'etale $A$-algebra and $\mathfrak q$ is a prime lying over $\mathfrak p$ with $\kappa(\mathfrak q) = \kappa(\mathfrak p)$, see Algebra, Lemma \ref{algebra-lemma-henselization-different}. These pairs $(B, \mathfrak q)$ correspond exactly to the affine elementary \'etale neighbourhoods $(U, u)$ by the correspondence between rings and affine schemes. Observe that irreducible components of $\Spec(B)$ passing through $\mathfrak q$ are exactly the minimal prime ideals of $B_\mathfrak q$. The number of minimal primes of $A_\mathfrak p^h$ is the number of branches of $X$ at $x$ by Properties, Definition \ref{properties-definition-number-of-branches}. Observe that the transition maps $B_\mathfrak q \to B'_{\mathfrak q'}$ in the system are all flat. Since a flat local ring map is faithfully flat (Algebra, Lemma \ref{algebra-lemma-local-flat-ff}) we see that the lemma follows from Lemma \ref{lemma-nr-minimal-primes}. \medskip\noindent Proof of (2). The proof is the same as the proof of (1), except that we use Algebra, Lemma \ref{algebra-lemma-strict-henselization-different}. There is a tiny difference: given a separable algebraic closure $\kappa^{sep}$ of $\kappa(x)$ for every \'etale neighbourhood $(U, u)$ we can choose a $\kappa(x)$-embedding $\phi : \kappa(u) \to \kappa^{sep}$ because $\kappa(u)/\kappa(x)$ is finite separable (Morphisms, Lemma \ref{morphisms-lemma-etale-at-point}). Hence we can look at the supremum over all triples $(U, u, \phi)$ where $(U, u) \to (X, x)$ is an affine \'etale neighbourhood and $\phi : \kappa(u) \to \kappa^{sep}$ is a $\kappa(x)$-embedding. These triples correspond exactly to the triples in Algebra, Lemma \ref{algebra-lemma-strict-henselization-different} and the rest of the proof is exactly the same.
As $f$ is smooth at $x$ we may assume, after replacing $X$ by an open neighbourhood of $x$ that $f$ is smooth. In particular we see that $f$ is flat and locally of finite presentation. By Lemma \ref{lemma-slice-given-element} we already know there exists an open neighbourhood $U \subset X$ of $x$ such that $h$ comes from $h \in \Gamma(U, \mathcal{O}_U)$ and such that $D = V(h)$ is an effective Cartier divisor in $U$ with $x \in D$ and $D \to S$ flat and of finite presentation. By Morphisms, Lemma \ref{morphisms-lemma-differentials-relative-immersion} we have a short exact sequence $$ \mathcal{C}_{D/U} \to i^*\Omega_{U/S} \to \Omega_{D/S} \to 0 $$ where $i : D \to U$ is the closed immersion and $\mathcal{C}_{D/U}$ is the conormal sheaf of $D$ in $U$. As $D$ is an effective Cartier divisor cut out by $h \in \Gamma(U, \mathcal{O}_U)$ we see that $\mathcal{C}_{D/U} = h \cdot \mathcal{O}_S$. Since $U \to S$ is smooth the sheaf $\Omega_{U/S}$ is finite locally free, hence its pullback $i^*\Omega_{U/S}$ is finite locally free also. The first arrow of the sequence maps the free generator $h$ to the section $\text{d}h|_D$ of $i^*\Omega_{U/S}$ which has nonzero value in the fibre $\Omega_{U/S, x} \otimes \kappa(x)$ by assumption. By right exactness of $\otimes \kappa(x)$ we conclude that $$ \dim_{\kappa(x)} \left( \Omega_{D/S, x} \otimes \kappa(x) \right) = \dim_{\kappa(x)} \left( \Omega_{U/S, x} \otimes \kappa(x) \right) - 1. $$ By Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point} we see that $\Omega_{U/S, x} \otimes \kappa(x)$ can be generated by at most $\dim_x(U_s)$ elements. By the displayed formula we see that $\Omega_{D/S, x} \otimes \kappa(x)$ can be generated by at most $\dim_x(U_s) - 1$ elements. Note that $\dim_x(D_s) = \dim_x(U_s) - 1$ for example because $\dim(\mathcal{O}_{D_s, x}) = \dim(\mathcal{O}_{U_s, x}) - 1$ by Algebra, Lemma \ref{algebra-lemma-one-equation} (also $D_s \subset U_s$ is effective Cartier, see Divisors, Lemma \ref{divisors-lemma-relative-Cartier}) and then using Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}. Thus we conclude that $\Omega_{D/S, x} \otimes \kappa(x)$ can be generated by at most $\dim_x(D_s)$ elements and we conclude that $D \to S$ is smooth at $x$ by Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point} again. After shrinking $U$ we get that $D \to S$ is smooth and we win.
Write $k = \kappa(s)$ and $R = \mathcal{O}_{X_s, x}$. Denote $\mathfrak m$ the maximal ideal of $R$ and $\kappa = R/\mathfrak m$ so that $\kappa = \kappa(x)$. As formation of modules of differentials commutes with localization (see Algebra, Lemma \ref{algebra-lemma-differentials-localize}) we have $\Omega_{X_s/s, x} = \Omega_{R/k}$. By Algebra, Lemma \ref{algebra-lemma-differential-seq} there is an exact sequence $$ \mathfrak m/\mathfrak m^2 \xrightarrow{\text{d}} \Omega_{R/k} \otimes_R \kappa \to \Omega_{\kappa/k} \to 0. $$ Hence if (2) holds, there exists an element $\overline{h} \in \mathfrak m$ such that $\text{d}\overline{h}$ is nonzero. Choose a lift $h \in \mathcal{O}_{X, x}$ of $\overline{h}$ and apply Lemma \ref{lemma-slice-smooth-given-element}.
Write $k = \kappa(s)$ and $R = \mathcal{O}_{X_s, x}$. Denote $\mathfrak m$ the maximal ideal of $R$ and $\kappa = R/\mathfrak m$ so that $\kappa = \kappa(x)$. As formation of modules of differentials commutes with localization (see Algebra, Lemma \ref{algebra-lemma-differentials-localize}) we have $\Omega_{X_s/s, x} = \Omega_{R/k}$. By assumption (2) and Algebra, Lemma \ref{algebra-lemma-computation-differential} the map $$ \text{d} : \mathfrak m/\mathfrak m^2 \longrightarrow \Omega_{R/k} \otimes_R \kappa(\mathfrak m) $$ is injective. Assumption (3) implies that $\mathfrak m/\mathfrak m^2 \not = 0$. Thus there exists an element $\overline{h} \in \mathfrak m$ such that $\text{d}\overline{h}$ is nonzero. Choose a lift $h \in \mathcal{O}_{X, x}$ of $\overline{h}$ and apply Lemma \ref{lemma-slice-smooth-given-element}.
We may and do replace $S$ by an affine open neighbourhood of $s$. We may and do replace $X$ by an affine open neighbourhood of $x$ such that $X \to S$ is smooth. We will prove the lemma for smooth morphisms of affines 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$. 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 $X$ is quasi-finite and smooth over $S$, hence smooth of relative dimension $0$ over $S$, hence \'etale over $S$. Moreover, 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 $\Omega_{\kappa(x)/\kappa(s)} = 0$ as this holds for algebraic separable field extensions. Thus we may apply Lemma \ref{lemma-slice-smooth-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 $\dim_x(D_s) = \dim_x(X_s) - 1$ for example because $\dim(\mathcal{O}_{D_s, x}) = \dim(\mathcal{O}_{X_s, x}) - 1$ by Algebra, Lemma \ref{algebra-lemma-one-equation} (also $D_s \subset X_s$ is effective Cartier, see Divisors, Lemma \ref{divisors-lemma-relative-Cartier}) and then using Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}. Thus the morphism $D \to S$ is smooth with $\dim_x(D_s) = \dim_x(X_s) - 1 = d - 1$. By induction hypothesis we can find an immersion $Z \to D$ as desired, which finishes the proof.
[First proof of Lemma \ref{lemma-etale-nbhd-dominates-smooth}] By assumption $X_s \not = \emptyset$. By Varieties, Lemma \ref{varieties-lemma-smooth-separable-closed-points-dense} there exists a closed point $x \in X_s$ such that $\kappa(x)$ is a finite separable field extension of $\kappa(s)$. Hence by Lemma \ref{lemma-slice-smooth} there exists an immersion $Z \to X$ such that $Z \to S$ is \'etale and such that $x \in Z$. Take $(S' , s') = (Z, x)$.
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-etale-nbhd-dominates-smooth} we can find an \'etale morphism $g_s : T_s \to S$ such that $s \in g_s(T_s)$ and such that $g_s$ factors through $S_i \to S$. Hence $\{T_s \to S\}$ is an \'etale covering of $S$ that refines $\mathcal{U}$.
Let $s \in S$. By Varieties, Lemma \ref{varieties-lemma-smooth-separable-closed-points-dense} the set of closed points $x \in X_s$ such that $\kappa(x)/\kappa(s)$ is separable is dense in $X_s$. Thus it suffices to construct an \'etale morphism $U \to X$ with $x$ in the image such that $U \to S$ factors in the manner described in the lemma. To do this, choose an immersion $Z \to X$ passing through $x$ such that $Z \to S$ is \'etale (Lemma \ref{lemma-slice-smooth}). After replacing $S$ by $Z$ and $X$ by $Z \times_S X$ we see that we may assume $X \to S$ has a section $\sigma : S \to X$ with $\sigma(s) = x$. Then we can first replace $S$ by an affine open neighbourhood of $s$ and next replace $X$ by an affine open neighbourhood of $x$. Then finally, we consider the subset $X^0 \subset X$ of Section \ref{section-connected-components}. By Lemmas \ref{lemma-connected-along-section-open} and \ref{lemma-connected-along-section-locally-constructible} this is a retrocompact open subscheme containing $\sigma$ such that the fibres $X^0 \to S$ are geometrically connected. If $X^0$ is not affine, then we choose an affine open $U \subset X^0$ containing $x$. Since $X^0 \to S$ is smooth, the image of $U$ is open. Choose an affine open neighbourhood $V \subset S$ of $s$ contained in $\sigma^{-1}(U)$ and in the image of $U \to S$. Finally, the reader sees that $U \cap f^{-1}(V) \to V$ has all the desired properties. For example $U \cap f^{-1}(V)$ is equal to $U \times_S V$ is affine as a fibre product of affine schemes. Also, the geometric fibres of $U \cap f^{-1}(V) \to V$ are nonempty open subschemes of the irreducible fibres of $X^0 \to S$ and hence connected. Some details omitted.
The question is local on $X$ hence we may replace $X$ by an open neighbourhood of $y$. Since $Y \to X$ is a regular immersion by Divisors, Lemma \ref{divisors-lemma-immersion-smooth-into-smooth-regular-immersion} we may assume $X = \Spec(A)$ is affine and there exists a regular sequence $f_1, \ldots, f_n \in A$ such that $Y = V(f_1, \ldots, f_n)$. After shrinking $X$ (and hence $Y$) further we may assume there exists an \'etale morphism $Y \to \mathbf{A}^m_S$, see Morphisms, Lemma \ref{morphisms-lemma-smooth-etale-over-affine-space}. Let $\overline{g}_1, \ldots, \overline{g}_m$ in $\mathcal{O}_Y(Y)$ be the coordinate functions of this \'etale morphism. Choose lifts $g_1, \ldots, g_m \in A$ of these functions and consider the morphism $$ (g_1, \ldots, g_m, f_1, \ldots, f_n) : X \longrightarrow \mathbf{A}^{m + n}_S $$ over $S$. This is a morphism of schemes locally of finite presentation over $S$ and hence is locally of finite presentation (Morphisms, Lemma \ref{morphisms-lemma-finite-presentation-permanence}). The restriction of this morphism to $\mathbf{A}^m_S \subset \mathbf{A}^{m + n}_S$ is \'etale by construction. Thus, in order to show that $X \to \mathbf{A}^{m + n}_S$ is \'etale at $y$ it suffices to show that $X \to \mathbf{A}^{m + n}_S$ is flat at $y$, see Morphisms, Lemma \ref{morphisms-lemma-etale-at-point}. Let $s \in S$ be the image of $y$. It suffices to check that $X_s \to \mathbf{A}^{m + n}_s$ is flat at $y$, see Theorem \ref{theorem-criterion-flatness-fibre}. Let $z \in \mathbf{A}^{m + n}_s$ be the image of $y$. The local ring map $$ \mathcal{O}_{\mathbf{A}^{m + n}_s, z} \longrightarrow \mathcal{O}_{X_s, y} $$ is flat by Algebra, Lemma \ref{algebra-lemma-CM-over-regular-flat}. Namely, schemes smooth over fields are regular and regular rings are Cohen-Macaulay, see Varieties, Lemma \ref{varieties-lemma-smooth-regular} and Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}. Thus both source and target are regular local rings (and hence CM). The source and target have the same dimension: namely, we have $\dim(\mathcal{O}_{Y_s, y}) = \dim(\mathcal{O}_{\mathbf{A}^m_s, z})$ by More on Algebra, Lemma \ref{more-algebra-lemma-dimension-etale-extension}, we have $\dim(\mathcal{O}_{\mathbf{A}^{m + n}_s, z}) = n + \dim(\mathcal{O}_{\mathbf{A}^m_s, z})$, and we have $\dim(\mathcal{O}_{X_s, y}) = n + \dim(\mathcal{O}_{Y_s, y})$ because $\mathcal{O}_{Y_s, y}$ is the quotient of $\mathcal{O}_{X_s, y}$ by the regular sequence $f_1, \ldots, f_n$ of length $n$ (see Divisors, Remark \ref{divisors-remark-relative-regular-immersion-elements}). Finally, the fibre ring of the displayed arrow is finite over $\kappa(z)$ since $Y_s \to \mathbf{A}^m_s$ is \'etale at $y$. This finishes the proof.
The question is local on $X$ hence we may assume $X$, $Y$, $S$ are affine. Say $S = \Spec(R)$, $X = \Spec(A)$, $Y = \Spec(B)$. Write $B = R[x_1, \ldots, x_n]/(f_1, \ldots, f_m)$. Let $\mathfrak p \subset A$ be the prime ideal corresponding to $x$. The local ring $\mathcal{O}_{X, x} = A_\mathfrak p$ is a G-ring by More on Algebra, Proposition \ref{more-algebra-proposition-finite-type-over-G-ring}. The map $\varphi$ is a map $$ B_\mathfrak q^\wedge \longrightarrow A_\mathfrak p^\wedge $$ where $\mathfrak q \subset B$ is the prime corresponding to $y$. Let $a_1, \ldots, a_n \in A_\mathfrak p^\wedge$ be the images of $x_1, \ldots, x_n$ via $R[x_1, \ldots, x_n] \to B \to B_\mathfrak q^\wedge \to A_\mathfrak p^\wedge$. Then we can apply Smoothing Ring Maps, Lemma \ref{smoothing-lemma-approximation-property-variant} to get an \'etale ring map $A \to A'$ and a prime ideal $\mathfrak p' \subset A'$ and $b_1, \ldots, b_n \in A'$ such that $\kappa(\mathfrak p) = \kappa(\mathfrak p')$, $a_i - b_i \in (\mathfrak p')^N(A'_{\mathfrak p'})^\wedge$, and $f_j(b_1, \ldots, b_n) = 0$ for $j = 1, \ldots, n$. This determines an $R$-algebra map $B \to A'$ by sending the class of $x_i$ to $b_i \in A'$. This finishes the proof by taking $U = \Spec(A') \to \Spec(B)$ as the morphism $f$ and $u = \mathfrak p'$.