Let $\Spec(A) \subset U$ be an affine neighbourhood of $u$ such that $u$ corresponds to a closed point of $U$, see Morphisms, Lemma \ref{morphisms-lemma-identify-finite-type-points}. Let $\Spec(B) \subset R$ be an affine neighbourhood of $e(u)$ which maps via $j$ into the open $\Spec(A) \times_S \Spec(A) \subset U \times_S U$. Let $\mathfrak m \subset A$ be the maximal ideal corresponding to $u$. Let $\mathfrak q \subset B$ be the prime ideal corresponding to $e(u)$. Pictures: $$ \vcenter{ \xymatrix{ B & A \ar[l]^s \\ A \ar[u]^t } } \quad\text{and}\quad \vcenter{ \xymatrix{ B_{\mathfrak q} & A_{\mathfrak m} \ar[l]^s \\ A_{\mathfrak m} \ar[u]^t } } $$ Note that the two induced maps $s, t : \kappa(\mathfrak m) \to \kappa(\mathfrak q)$ are equal and isomorphisms as $s \circ e = t \circ e = \text{id}_U$. In particular we see that $\mathfrak q$ is a maximal ideal as well. The ring maps $s, t : A \to B$ are of finite presentation and flat. By assumption the ring $$ \mathcal{O}_{F_u, e(u)} = B_{\mathfrak q}/s(\mathfrak m)B_{\mathfrak q} $$ is Cohen-Macaulay of dimension $d_2$. The equality of dimension holds by Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}. \medskip\noindent Let $R''$ be the restriction of $R$ to $u = \Spec(\kappa(u))$ via the morphism $\Spec(\kappa(u)) \to U$. As $u \to U$ is locally of finite type, we see that $(\Spec(\kappa(u)), R'', s'', t'', c'')$ is a groupoid scheme with $s'', t''$ locally of finite type, see Lemma \ref{lemma-restrict-preserves-type}. By Lemma \ref{lemma-groupoid-on-field-dimension-equal-stabilizer} this implies that $\dim(G'') = \dim(R'')$. We also have $\dim(R'') = \dim_{e''}(R'') = \dim(\mathcal{O}_{R'', e''})$, see Lemma \ref{lemma-groupoid-on-field-locally-finite-type-dimension}. By Groupoids, Lemma \ref{groupoids-lemma-restrict-stabilizer} we have $G'' = G_u$. Hence we conclude that $\dim(\mathcal{O}_{R'', e''}) = d_1$. \medskip\noindent As a scheme $R''$ is $$ R'' = R \times_{(U \times_S U)} \Big( \Spec(\kappa(\mathfrak m)) \times_S \Spec(\kappa(\mathfrak m)) \Big) $$ Hence an affine open neighbourhood of $e''$ is the spectrum of the ring $$ B \otimes_{(A \otimes A)} (\kappa(\mathfrak m) \otimes \kappa(\mathfrak m)) = B/s(\mathfrak m)B + t(\mathfrak m)B $$ We conclude that $$ \mathcal{O}_{R'', e''} = B_{\mathfrak q}/s(\mathfrak m)B_{\mathfrak q} + t(\mathfrak m)B_{\mathfrak q} $$ and so now we know that this ring has dimension $d_1$. \medskip\noindent We claim this implies we can find an element $f \in \mathfrak m$ such that $$ \dim(B_{\mathfrak q}/(s(\mathfrak m)B_{\mathfrak q} + fB_{\mathfrak q}) < d_2 $$ Namely, suppose $\mathfrak n_j \supset s(\mathfrak m)B_{\mathfrak q}$, $j = 1, \ldots, m$ correspond to the minimal primes of the local ring $B_{\mathfrak q}/s(\mathfrak m)B_{\mathfrak q}$. There are finitely many as this ring is Noetherian (since it is essentially of finite type over a field -- but also because a Cohen-Macaulay ring is Noetherian). By the Cohen-Macaulay condition we have $\dim(B_{\mathfrak q}/\mathfrak n_j) = d_2$, for example by Algebra, Lemma \ref{algebra-lemma-CM-dim-formula}. Note that $\dim(B_{\mathfrak q}/(\mathfrak n_j + t(\mathfrak m)B_{\mathfrak q})) \leq d_1$ as it is a quotient of the ring $\mathcal{O}_{R'', e''} = B_{\mathfrak q}/s(\mathfrak m)B_{\mathfrak q} + t(\mathfrak m)B_{\mathfrak q}$ which has dimension $d_1$. As $d_1 < d_2$ this implies that $\mathfrak m \not \subset t^{-1}(\mathfrak n_i)$. By prime avoidance, see Algebra, Lemma \ref{algebra-lemma-silly}, we can find $f \in \mathfrak m$ with $t(f) \not \in \mathfrak n_j$ for $j = 1, \ldots, m$. For this choice of $f$ we have the displayed inequality above, see Algebra, Lemma \ref{algebra-lemma-one-equation}. \medskip\noindent Set $A' = A/fA$ and $U' = \Spec(A')$. Then it is clear that $U' \to U$ is an immersion, locally of finite presentation and that $u \in U'$. Thus (1), (2) and (3) of the lemma hold. The morphism $$ U' \times_{g, U, t} R \longrightarrow U $$ factors through $\Spec(A)$ and corresponds to the ring map $$ \xymatrix{ B/t(f)B \ar@{=}[r] & A/(f) \otimes_{A, t} B & A \ar[l]_-s } $$ Now, we see $t(f)$ is not a zerodivisor on $B_{\mathfrak q}/s(\mathfrak m)B_{\mathfrak q}$ as this is a Cohen-Macaulay ring of positive dimension and $f$ is not contained in any minimal prime, see for example Algebra, Lemma \ref{algebra-lemma-reformulate-CM}. Hence by Algebra, Lemma \ref{algebra-lemma-grothendieck-general} we conclude that $s : A_{\mathfrak m} \to B_{\mathfrak q}/t(f)B_{\mathfrak q}$ is flat with fibre ring $B_{\mathfrak q}/(s(\mathfrak m)B_{\mathfrak q} + t(f)B_{\mathfrak q})$ which is Cohen-Macaulay by Algebra, Lemma \ref{algebra-lemma-reformulate-CM} again. This implies part (4) of the lemma. To see part (5) note that by Diagram (\ref{equation-restriction}) the fibre $F'_u$ is equal to the fibre of $h$ over $u$. Hence $\dim_{e'(u)}(F'_u) = \dim(B_{\mathfrak q}/(s(\mathfrak m)B_{\mathfrak q} + t(f)B_{\mathfrak q}))$ by Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point} and the dimension of this ring is $d_2 - 1$ by Algebra, Lemma \ref{algebra-lemma-reformulate-CM} once more. This proves the final assertion of the lemma and we win.