hcju/stacksqa huggingface dataset:
Let $r \in R$ be a point. In this proof we will use the correspondence between irreducible components of $R$ passing through a point $r$ and minimal primes of the local ring $\mathcal{O}_{R, r}$ without further mention. Choose $k \subset k'$ and $r' \in R'$ as in Lemma \ref{lemma-groupoid-on-field-explain-points}. Note that $\mathcal{O}_{R, r} \to \mathcal{O}_{R', r'}$ is faithfully flat and local, see Lemma \ref{lemma-restrict-groupoid-on-field}. Hence the result for $r' \in R'$ implies the result for $r \in R$. In other words we may assume that $s, t : k \to \kappa(r)$ are isomorphisms. By Lemma \ref{lemma-groupoid-on-field-move-point} there exists an automorphism moving $e$ to $r$. Hence we may assume $r = e$, i.e., part (1) follows from part (2). \medskip\noindent We first prove (2) in case $k$ is separably algebraically closed. Namely, let $X, Y \subset R$ be irreducible components passing through $e$. Then by Varieties, Lemma \ref{varieties-lemma-bijection-irreducible-components} and \ref{varieties-lemma-separably-closed-irreducible} the scheme $X \times_{s, U, t} Y$ is irreducible as well. Hence $c(X \times_{s, U, t} Y) \subset R$ is an irreducible subset. We claim it contains both $X$ and $Y$ (as subsets of $R$). Namely, let $T$ be the spectrum of a field. If $x : T \to X$ is a $T$-valued point of $X$, then $c(x, e \circ s \circ x) = x$ and $e \circ s \circ x$ factors through $Y$ as $e \in Y$. Similarly for points of $Y$. This clearly implies that $X = Y$, i.e., there is a unique irreducible component of $R$ passing through $e$. \medskip\noindent Proof of (2) and (3) in general. Let $k \subset k'$ be a separable algebraic closure, and let $(U', R', s', t', c')$ be the restriction of $(U, R, s, t, c)$ via $\Spec(k') \to \Spec(k)$. By the previous paragraph there is exactly one irreducible component $Z'$ of $R'$ passing through $e'$. Denote $e'' \in R \times_{s, U} U'$ the base change of $e$. As $R' \to R \times_{s, U} U'$ is faithfully flat, see Lemma \ref{lemma-restrict-groupoid-on-field}, and $e' \mapsto e''$ we see that there is exactly one irreducible component $Z''$ of $R \times_{s, k} k'$ passing through $e''$. This implies, as $R \times_k k' \to R$ is faithfully flat, that there is exactly one irreducible component $Z$ of $R$ passing through $e$. This proves (2). \medskip\noindent To prove (3) let $Z''' \subset R \times_k k'$ be an arbitrary irreducible component of $Z \times_k k'$. By Varieties, Lemma \ref{varieties-lemma-orbit-irreducible-components} we see that $Z''' = \sigma(Z'')$ for some $\sigma \in \text{Gal}(k'/k)$. Since $\sigma(e'') = e''$ we see that $e'' \in Z'''$ and hence $Z''' = Z''$. This means that $Z$ is geometrically irreducible over $\Spec(k)$ via the morphism $s$. The same argument implies that $Z$ is geometrically irreducible over $\Spec(k)$ via the morphism $t$.
Let $r, r' \in R$. Then $\dim_r(R) = \dim_{r'}(R)$ by Lemma \ref{lemma-groupoid-on-field-homogeneous} and Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-after-base-change}. By Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point} we have $$ \dim_r(R) = \dim(\mathcal{O}_{R, r}) + \text{trdeg}_{s(k)}(\kappa(r)) = \dim(\mathcal{O}_{R, r}) + \text{trdeg}_{t(k)}(\kappa(r)). $$ On the other hand, the dimension of $R$ (or any open subset of $R$) is the supremum of the dimensions of the local rings of $R$, see Properties, Lemma \ref{properties-lemma-codimension-local-ring}. Clearly this is maximal for closed points $r$ in which case $\text{trdeg}_k(\kappa(r)) = 0$ (by the Hilbert Nullstellensatz, see Morphisms, Section \ref{morphisms-section-points-finite-type}). Hence the lemma follows.
Let $Z \subset R$ be the irreducible component passing through $e$ (see Lemma \ref{lemma-groupoid-on-field-geometrically-irreducible}) thought of as an integral closed subscheme of $R$. Let $k'_s$, resp.\ $k'_t$ be the integral closure of $s(k)$, resp.\ $t(k)$ in $\Gamma(Z, \mathcal{O}_Z)$. Recall that $k'_s$ and $k'_t$ are fields, see Varieties, Lemma \ref{varieties-lemma-integral-closure-ground-field}. By Varieties, Proposition \ref{varieties-proposition-unique-base-field} we have $k'_s = k'_t$ as subrings of $\Gamma(Z, \mathcal{O}_Z)$. As $e$ factors through $Z$ we obtain a commutative diagram $$ \xymatrix{ k \ar[rd]_t \ar[rrd]^1 \\ & \Gamma(Z, \mathcal{O}_Z) \ar[r]^e & k \\ k \ar[ru]^s \ar[rru]_1 } $$ This on the one hand shows that $k'_s = s(k)$, $k'_t = t(k)$, so $s(k) = t(k)$, which combined with the diagram above implies that $s = t$! In other words, we conclude that $Z$ is a closed subscheme of $G = R \times_{(t, s), U \times_S U, \Delta} U$. The lemma follows as both $G$ and $R$ are equidimensional, see Lemma \ref{lemma-groupoid-on-field-locally-finite-type-dimension} and Groupoids, Lemma \ref{groupoids-lemma-group-scheme-finite-type-field}.
Let $r_2 \in R_2$ be a point in the closure of $a(R_1)$. We want to show $r_2 \in a(R_1)$. Pick $k \subset k'$ and $r_2' \in R'_2$ adapted to $(U, R_2, s_2, t_2, c_2)$ and $r_2$ as in Lemma \ref{lemma-groupoid-on-field-explain-points}. Let $R_i'$ be the restriction of $R_i$ via the morphism $U' = \Spec(k') \to U = \Spec(k)$. Let $a' : R'_1 \to R_2'$ be the base change of $a$. The diagram $$ \xymatrix{ R'_1 \ar[r]_{a'} \ar[d]_{p_1} & R'_2 \ar[d]^{p_2} \\ R_1 \ar[r]^a & R_2 } $$ is a fibre square. Hence the image of $a'$ is the inverse image of the image of $a$ via the morphism $p_2 : R'_2 \to R_2$. By Lemma \ref{lemma-restrict-groupoid-on-field} the map $p_2$ is surjective and open. Hence by Topology, Lemma \ref{topology-lemma-open-morphism-quotient-topology} we see that $r_2'$ is in the closure of $a'(R'_1)$. This means that we may assume that $r_2 \in R_2$ has the property that the maps $k \to \kappa(r_2)$ induced by $s_2$ and $t_2$ are isomorphisms. \medskip\noindent In this case we can use Lemma \ref{lemma-groupoid-on-field-move-point}. This lemma implies $c(r_2, a(R_1))$ is an open neighbourhood of $r_2$. Hence $a(R_1) \cap c(r_2, a(R_1)) \not = \emptyset$ as we assumed that $r_2$ was a point of the closure of $a(R_1)$. Using the inverse of $R_2$ and $R_1$ we see this means $c_2(a(R_1), a(R_1))$ contains $r_2$. As $c_2(a(R_1), a(R_1)) \subset a(c_1(R_1, R_1)) = a(R_1)$ we conclude $r_2 \in a(R_1)$ as desired.
Consider the commutative diagram $$ \xymatrix{ R_1 \times_{s_1, U, t_1} R_1 \ar[r] \ar[d] & R_1 \ar[d] \\ R_2 \times_{s_2, U, t_2} R_2 \ar[r] & R_2 } $$ By Varieties, Lemma \ref{varieties-lemma-closure-image-product-map} the closure of the image of the left vertical arrow is (set theoretically) $Z \times_{s_2, U, t_2} Z$. Hence the result follows.
We first explain why the statement makes sense. Since $U$ is the spectrum of a perfect field $k$, the scheme $Z$ is geometrically reduced over $k$ (via either projection), see Varieties, Lemma \ref{varieties-lemma-perfect-reduced}. Hence the scheme $Z \times_{s_2, U, t_2} Z \subset Z$ is reduced, see Varieties, Lemma \ref{varieties-lemma-geometrically-reduced-any-base-change}. Hence by Lemma \ref{lemma-map-groupoids-on-field-image} we see that $c$ induces a morphism $Z \times_{s_2, U, t_2} Z \to Z$. Finally, it is clear that $e_2$ factors through $Z$ and that the map $i_2 : R_2 \to R_2$ preserves $Z$. Since the morphisms of the septuple $(U, R_2, s_2, t_2, c_2, e_2, i_2)$ satisfies the axioms of a groupoid, it follows that after restricting to $Z$ they satisfy the axioms.
Let $k \subset k'$ be a perfect closure of the field $k$. Let $R_i'$ be the restriction of $R_i$ via the morphism $U' = \Spec(k') \to \Spec(k)$. Note that the morphisms $R_i' \to R_i$ are universal homeomorphisms as compositions of base changes of the universal homeomorphism $U' \to U$ (see diagram in statement of Lemma \ref{lemma-restrict-groupoid-on-field}). Hence it suffices to prove that $a'(R_1')$ is closed in $R_2'$. In other words, we may assume that $k$ is perfect. \medskip\noindent If $k$ is perfect, then the closure of the image is a groupoid scheme $Z \subset R_2$, by Lemma \ref{lemma-map-groupoids-on-perfect-field-image}. By the same lemma applied to $\text{id}_{R_1} : R_1 \to R_1$ we see that $(R_2)_{red}$ is a groupoid scheme. Thus we may apply Lemma \ref{lemma-open-image-is-closed} to the morphism $a|_{(R_2)_{red}} : (R_2)_{red} \to Z$ to conclude that $Z$ equals the image of $a$.
The main difficulty is to show that $c_2|_{Z \times_{s_2, U, t_2} Z}$ maps into $Z$. Consider the commutative diagram $$ \xymatrix{ R_1 \times_{s_1, U, t_1} R_1 \ar[r] \ar[d]^{a \times a} & R_1 \ar[d] \\ R_2 \times_{s_2, U, t_2} R_2 \ar[r] & R_2 } $$ By Varieties, Lemma \ref{varieties-lemma-scheme-theoretic-image-product-map} we see that the scheme theoretic image of $a \times a$ is $Z \times_{s_2, U, t_2} Z$. By the commutativity of the diagram we conclude that $Z \times_{s_2, U, t_2} Z$ maps into $Z$ by the bottom horizontal arrow. As in the proof of Lemma \ref{lemma-map-groupoids-on-perfect-field-image} it is also true that $i_2(Z) \subset Z$ and that $e_2$ factors through $Z$. Hence we conclude as in the proof of that lemma.
As $(U, U \times_S U, \text{pr}_1, \text{pr}_0, \text{pr}_{02})$ is a groupoid scheme over $S$ this is a special case of Lemma \ref{lemma-map-groupoids-on-field-image}. But we can also prove it directly as follows. \medskip\noindent Write $U = \Spec(k)$. Denote $R_s$ (resp.\ $Z_s$, resp.\ $U^2_s$) the scheme $R$ (resp.\ $Z$, resp.\ $U \times_S U$) viewed as a scheme over $k$ via $s$ (resp.\ $\text{pr}_1|_Z$, resp.\ $\text{pr}_1$). Similarly, denote ${}_tR$ (resp.\ ${}_tZ$, resp.\ ${}_tU^2$) the scheme $R$ (resp.\ $Z$, resp.\ $U \times_S U$) viewed as a scheme over $k$ via $t$ (resp.\ $\text{pr}_0|_Z$, resp.\ $\text{pr}_0$). The morphism $j$ induces morphisms of schemes $j_s : R_s \to U^2_s$ and ${}_tj : {}_tR \to {}_tU^2$ over $k$. Consider the commutative diagram $$ \xymatrix{ R_s \times_k {}_tR \ar[r]^c \ar[d]_{j_s \times {}_tj} &  R \ar[d]^j \\ U^2_s \times_k {}_tU^2 \ar[r] & U \times_S U } $$ By Varieties, Lemma \ref{varieties-lemma-closure-image-product-map} we see that the closure of the image of $j_s \times {}_tj$ is $Z_s \times_k {}_tZ$. By the commutativity of the diagram we conclude that $Z_s \times_k {}_tZ$ maps into $Z$ by the bottom horizontal arrow.
As $(U, U \times_S U, \text{pr}_1, \text{pr}_0, \text{pr}_{02})$ is a groupoid scheme over $S$ this is a special case of Lemma \ref{lemma-map-groupoids-on-perfect-field-image}. But we can also prove it directly as follows. \medskip\noindent We first explain why the statement makes sense. Since $U$ is the spectrum of a perfect field $k$, the scheme $Z$ is geometrically reduced over $k$ (via either projection), see Varieties, Lemma \ref{varieties-lemma-perfect-reduced}. Hence the scheme $Z \times_{\text{pr}_1, U, \text{pr}_0} Z \subset Z$ is reduced, see Varieties, Lemma \ref{varieties-lemma-geometrically-reduced-any-base-change}. Hence by Lemma \ref{lemma-groupoid-on-field-image} we see that $\text{pr}_{02}$ induces a morphism $Z \times_{\text{pr}_1, U, \text{pr}_0} Z \to Z$. Finally, it is clear that $\Delta_{U/S}$ factors through $Z$ and that the map $\sigma : U \times_S U \to U \times_S U$, $(x, y) \mapsto (y, x)$ preserves $Z$. Since $(U, U \times_S U, \text{pr}_0, \text{pr}_1, \text{pr}_{02}, \Delta_{U/S}, \sigma)$ satisfies the axioms of a groupoid, it follows that after restricting to $Z$ they satisfy the axioms.
As $(U, U \times_S U, \text{pr}_1, \text{pr}_0, \text{pr}_{02})$ is a groupoid scheme over $S$ this is a special case of Lemma \ref{lemma-quasi-compact-map-groupoids-on-field-image}. But we can also prove it directly as follows. \medskip\noindent The main difficulty is to show that $\text{pr}_{02}|_{Z \times_{\text{pr}_1, U, \text{pr}_0} Z}$ maps into $Z$. Write $U = \Spec(k)$. Denote $R_s$ (resp.\ $Z_s$, resp.\ $U^2_s$) the scheme $R$ (resp.\ $Z$, resp.\ $U \times_S U$) viewed as a scheme over $k$ via $s$ (resp.\ $\text{pr}_1|_Z$, resp.\ $\text{pr}_1$). Similarly, denote ${}_tR$ (resp.\ ${}_tZ$, resp.\ ${}_tU^2$) the scheme $R$ (resp.\ $Z$, resp.\ $U \times_S U$) viewed as a scheme over $k$ via $t$ (resp.\ $\text{pr}_0|_Z$, resp.\ $\text{pr}_0$). The morphism $j$ induces morphisms of schemes $j_s : R_s \to U^2_s$ and ${}_tj : {}_tR \to {}_tU^2$ over $k$. Consider the commutative diagram $$ \xymatrix{ R_s \times_k {}_tR \ar[r]^c \ar[d]_{j_s \times {}_tj} &  R \ar[d]^j \\ U^2_s \times_k {}_tU^2 \ar[r] & U \times_S U } $$ By Varieties, Lemma \ref{varieties-lemma-scheme-theoretic-image-product-map} we see that the scheme theoretic image of $j_s \times {}_tj$ is $Z_s \times_k {}_tZ$. By the commutativity of the diagram we conclude that $Z_s \times_k {}_tZ$ maps into $Z$ by the bottom horizontal arrow. As in the proof of Lemma \ref{lemma-groupoid-on-perfect-field-image} it is also true that $\sigma(Z) \subset Z$ and that $\Delta_{U/S}$ factors through $Z$. Hence we conclude as in the proof of that lemma.
As $s$ is locally of finite presentation the scheme $F_u$ is locally of finite type over $\kappa(u)$. Hence $\dim_{e(u)}(F_u) < \infty$ and we may argue by induction on $\dim_{e(u)}(F_u)$. \medskip\noindent If $\dim_{e(u)}(F_u) = \dim(G_u)$ there is nothing to prove. Assume $\dim_{e(u)}(F_u) > \dim(G_u)$. This means that Lemma \ref{lemma-slice} applies and we find a morphism $g : U' \to U$ which has properties (1), (2), (3), instead of (6) we have $\dim_{e(u)}(F'_u) < \dim_{e(u)}(F_u)$, and instead of (4) and (5) we have that the composition $$ h = s \circ \text{pr}_1 : U' \times_{g, U, t} R \longrightarrow U $$ is Cohen-Macaulay at the point $(u, e(u))$. We apply Remark \ref{remark-local-source-apply} and we obtain an open subscheme $U'' \subset U'$ such that $U'' \times_{g, U, t} R \subset U' \times_{g, U, t} R$ is the largest open subscheme on which $h$ is Cohen-Macaulay. Since $(u, e(u)) \in U'' \times_{g, U, t} R$ we see that $u \in U''$. Hence we may replace $U'$ by $U''$ and assume that in fact $h$ is Cohen-Macaulay everywhere! By Lemma \ref{lemma-restrict-property} we conclude that $s', t'$ are locally of finite presentation and Cohen-Macaulay (use Morphisms, Lemma \ref{morphisms-lemma-base-change-finite-presentation} and More on Morphisms, Lemma \ref{more-morphisms-lemma-base-change-CM}). \medskip\noindent By construction $\dim_{e'(u)}(F'_u) < \dim_{e(u)}(F_u)$, so we may apply the induction hypothesis to $(U', R', s', t', c')$ and the point $u \in U'$. Note that $u$ is also a finite type point of $U'$ (for example you can see this using the characterization of finite type points from Morphisms, Lemma \ref{morphisms-lemma-identify-finite-type-points}). Let $g' : U'' \to U'$ and $(U'', R'', s'', t'', c'')$ be the solution of the corresponding problem starting with $(U', R', s', t', c')$ and the point $u \in U'$. We claim that the composition $$ g'' = g \circ g' : U'' \longrightarrow U $$ is a solution for the original problem. Properties (1), (2), (3), (5), and (6) are immediate. To see (4) note that the morphism $$ h'' = s \circ \text{pr}_1 : U'' \times_{g'', U, t} R \longrightarrow U $$ is locally of finite presentation and Cohen-Macaulay by an application of Lemma \ref{lemma-double-restrict-property} (use More on Morphisms, Lemma \ref{more-morphisms-lemma-CM-local-source-and-target} to see that Cohen-Macaulay morphisms are fppf local on the target).
Take $g : U' \to U$ as in Lemma \ref{lemma-max-slice}. Since $h^{-1}(u) = F'_u$ we see that $h$ has relative dimension $\leq 0$ at $(u, e(u))$. Hence, by Remark \ref{remark-local-source-apply}, we obtain an open subscheme $U'' \subset U'$ such that $u \in U''$ and $U'' \times_{g, U, t} R$ is the maximal open subscheme of $U' \times_{g, U, t} R$ on which $h$ has relative dimension $\leq 0$. After replacing $U'$ by $U''$ we see that $h$ has relative dimension $\leq 0$. This implies that $h$ is locally quasi-finite by Morphisms, Lemma \ref{morphisms-lemma-locally-quasi-finite-rel-dimension-0}. Since it is still locally of finite presentation and Cohen-Macaulay we see that it is flat, locally of finite presentation and locally quasi-finite, i.e., (4) above holds. This implies that $s'$ is flat, locally of finite presentation and locally quasi-finite as a base change of $h$, see Lemma \ref{lemma-restrict-property}.
We apply Lemma \ref{lemma-quasi-finite-over-base} for the groupoid $(U, R, s, t, c)$ over the scheme $S$ with points $p$ and $u$. Hence we get an \'etale neighbourhood $(S', p') \to (S, p)$ and disjoint union decompositions $$ S' \times_S U = U' \amalg W, \quad S' \times_S R = R' \amalg W' $$ and $u' \in U'$ satisfying conclusions (a), (b), (c), (d), (e), (f), and (g). We may shrink $S'$ to a smaller neighbourhood of $p'$ without affecting the conclusions (a) -- (g). We will show that for a suitable shrinking conclusion (h) holds as well. Let us denote $j'$ the base change of $j$ to $S'$. By conclusion (e) it is clear that $$ j'^{-1}(U' \times_{S'} U') = R' \amalg Rest $$ for some open and closed $Rest$ piece. Since $U' \to S'$ is finite by conclusion (d) we see that $U' \times_{S'} U'$ is finite over $S'$. Since $j$ is universally closed, also $j'$ is universally closed, and hence $j'|_{Rest}$ is universally closed too. By conclusions (b) and (c) we see that the fibre of $$ (U' \times_{S'} U' \to S') \circ j'|_{Rest} : Rest \longrightarrow S' $$ over $p'$ is empty. Hence, since $Rest \to S'$ is closed as a composition of closed morphisms, after replacing $S'$ by $S' \setminus \Im(Rest \to S')$, we may assume that $Rest = \emptyset$. And this is exactly the condition that $R'$ is the restriction of $S' \times_S R$ to the open subscheme $U' \subset S' \times_S U$, see Groupoids, Lemma \ref{groupoids-lemma-restrict-groupoid-relation} and its proof.
Let $\{Z_r\}$ be the stratification of $U$ given by the Fitting ideals of the finite type quasi-coherent modules $s_*\mathcal{O}_R$. See Divisors, Lemma \ref{divisors-lemma-locally-free-rank-r-pullback}. Since the identity $e : U \to R$ is a section to $s$ we see that $s_*\mathcal{O}_R$ contains $\mathcal{O}_S$ as a direct summand. Hence $U = Z_{-1} = Z_0$ (details omitted). Since formation of Fitting ideals commutes with base change (More on Algebra, Lemma \ref{more-algebra-lemma-fitting-ideal-basics}) we find that $s^{-1}(Z_r)$ corresponds to the $r$th Fitting ideal of $\text{pr}_{1, *}\mathcal{O}_{R \times_{s, U, t} R}$ because the lower right square of diagram (\ref{equation-diagram}) is cartesian. Using the fact that the lower left square is also cartesian we conclude that $s^{-1}(Z_r) = t^{-1}(Z_r)$, in other words $Z_r$ is $R$-invariant. The morphism $s^{-1}(Z_{r - 1}) \setminus s^{-1}(Z_r) \to Z_{r - 1} \setminus Z_r$ is finite locally free of rank $r$ because the module $s_*\mathcal{O}_R$ pulls back to a finite locally free module of rank $r$ on $Z_{r - 1} \setminus Z_r$ by Divisors, Lemma \ref{divisors-lemma-locally-free-rank-r-pullback}.
Consider the stratification $U = Z_0 \supset Z_1 \supset Z_2 \supset \ldots$ of Lemma \ref{lemma-finite-stratify}. \medskip\noindent We will construct disjoint unions $W = \coprod_{r \geq 1} W_r$ and $W' = \coprod_{r \geq 1} W'_r$ with each $W'_r \to W_r$ a thickening of $R$-invariant subschemes of $U$ such that the morphisms $s_r', t_r'$ of the restrictions $(W_r', R_r', s_r', t_r', c_r')$ are finite locally free of rank $r$. To begin we set $W_1 = W'_1 = U \setminus Z_1$. This is an $R$-invariant open subscheme of $U$, it is true that $W_0$ is a thickening of $W'_0$, and the maps $s_1'$, $t_1'$ of the restriction $(W_1', R_1', s_1', t_1', c_1')$ are isomorphisms, i.e., finite locally free of rank $1$. Moreover, every point of $U \setminus Z_1$ is in $t(s^{-1}(\overline{W_1}))$. \medskip\noindent Assume we have found subschemes $W'_r \subset W_r \subset U$ for $r \leq n$ such that \begin{enumerate} \item $W_1, \ldots, W_n$ are disjoint, \item $W_r$ and $W_r'$ are $R$-invariant, \item $U \setminus Z_n \subset \bigcup_{r \leq n} t(s^{-1}(\overline{W_r}))$ set theoretically, \item $W_r$ is a thickening of $W'_r$, \item the maps $s_r'$, $t_r'$ of the restriction $(W_r', R_r', s_r', t_r', c_r')$ are finite locally free of rank $r$. \end{enumerate} Then we set $$ W_{n + 1} = Z_n \setminus \left( Z_{n + 1} \cup \bigcup\nolimits_{r \leq n} t(s^{-1}(\overline{W_r})) \right) $$ set theoretically and $$ W'_{n + 1} = Z_n \setminus \left( Z_{n + 1} \cup \bigcup\nolimits_{r \leq n} t(s^{-1}(\overline{W_r})) \right) $$ scheme theoretically. Then $W_{n + 1}$ is an $R$-invariant open subscheme of $U$ because $Z_{n + 1} \setminus \overline{U \setminus Z_{n + 1}}$ is open in $U$ and $\overline{U \setminus Z_{n + 1}}$ is contained in the closed subset $\bigcup\nolimits_{r \leq n} t(s^{-1}(\overline{W_r}))$ we are removing by property (3) and the fact that $t$ is a closed morphism. It is clear that $W'_{n + 1}$ is a closed subscheme of $W_{n + 1}$ with the same underlying topological space. Finally, properties (1), (2) and (3) are clear and property (5) follows from Lemma \ref{lemma-finite-stratify}. \medskip\noindent By Lemma \ref{lemma-finite-stratify} we have $\bigcap Z_r = \emptyset$. Hence every point of $U$ is contained in $U \setminus Z_n$ for some $n$. Thus we see that $U = \bigcup_{r \geq 1} t(s^{-1}(\overline{W_r}))$ set theoretically and we see that (2) holds. Thus $W' \subset W$ satisfy (1), (2), (3), and (4).
In this case the stratification $U = Z_0 \supset Z_1 \supset Z_2 \supset \ldots$ of Lemma \ref{lemma-finite-stratify} is given by closed immersions $Z_k \to U$ of finite presentation, see Divisors, Lemma \ref{divisors-lemma-locally-free-rank-r-pullback}. Part (1) follows immediately from this as $W' \to W$ is locally given by intersecting the open $W$ by $Z_r$. To see part (2) let $\{u_1, \ldots, u_n\}$ be the orbit of $u$. Since the closed subschemes $Z_k$ are $R$-invariant and $\bigcap Z_k = \emptyset$, we find an $k$ such that $u_i \in Z_k$ and $u_i \not \in Z_{k + 1}$ for all $i$. The image of $Z_k \to U$ and $Z_{k + 1} \to U$ is locally constructible (Morphisms, Theorem \ref{morphisms-theorem-chevalley}). Since $u_i \in U$ is a generic point of an irreducible component of $U$, there exists an open neighbourhood $U_i$ of $u_i$ which is contained in $Z_k \setminus Z_{k + 1}$ set theoretically (Properties, Lemma \ref{properties-lemma-generic-point-in-constructible}). In the proof of Lemma \ref{lemma-finite-flat-over-almost-dense-subscheme} we have constructed $W$ as a disjoint union $\coprod W_r$ with $W_r \subset Z_{r - 1} \setminus Z_r$ such that $U = \bigcup t(s^{-1}(\overline{W_r}))$. As $\{u_1, \ldots, u_n\}$ is an $R$-orbit we see that $u \in t(s^{-1}(\overline{W_r}))$ implies $u_i \in \overline{W_r}$ for some $i$ which implies $U_i \cap W_r \not = \emptyset$ which implies $r = k$. Thus we conclude that $u$ is in $$ W_{k + 1} = Z_k \setminus \left( Z_{k + 1} \cup \bigcup\nolimits_{r \leq k} t(s^{-1}(\overline{W_r})) \right) $$ as desired.
Let $W' \subset W \subset U$ be as in Lemma \ref{lemma-finite-flat-over-almost-dense-subscheme}. By Lemma \ref{lemma-finite-flat-over-almost-dense-subscheme-addendum} we get $u_j \in W$ and that $W' \to W$ is a thickening of finite presentation. By Limits, Lemma \ref{limits-lemma-affines-glued-in-closed-affine} it suffices to find an $R$-invariant affine open subscheme $V'$ of $W'$ containing $u_j$ (because then we can let $V \subset W$ be the corresponding open subscheme which will be affine). Thus we may replace $(U, R, s, t, c)$ by the restriction $(W', R', s', t', c')$ to $W'$. In other words, we may assume we have a groupoid scheme $(U, R, s, t, c)$ whose morphisms $s$ and $t$ are finite locally free. By Properties, Lemma \ref{properties-lemma-maximal-points-affine} we can find an affine open containing the union of the orbits of $u_1, \ldots, u_m$. Finally, we can apply Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine} to conclude.