The $R$-orbit of $u$ is finite. By conditions (2) and (3) it is contained in an affine open $U'$ of $U$, see Varieties, Proposition \ref{varieties-proposition-finite-set-of-points-of-codim-1-in-affine}. Then $t(s^{-1}(U \setminus U'))$ is an $R$-invariant closed subset of $U$ which does not contain $u$. Thus $U \setminus t(s^{-1}(U \setminus U'))$ is an $R$-invariant open of $U'$ containing $u$. Replacing $U$ by this open we may assume $U$ is quasi-affine. \medskip\noindent By Lemma \ref{lemma-find-affine-integral} we may replace $U$ by its reduction and assume $U$ is reduced. This means $R$-invariant subschemes $W' \subset W \subset U$ of Lemma \ref{lemma-finite-flat-over-almost-dense-subscheme} are equal $W' = W$. As $U = t(s^{-1}(\overline{W}))$ some point $u'$ of the $R$-orbit of $u$ is contained in $\overline{W}$ and by Lemma \ref{lemma-find-affine-integral} we may replace $U$ by $\overline{W}$ and $u$ by $u'$. Hence we may assume there is a dense open $R$-invariant subscheme $W \subset U$ such that the morphisms $s_W, t_W$ of the restriction $(W, R_W, s_W, t_W, c_W)$ are finite locally free. \medskip\noindent If $u \in W$ then we are done by Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine} (because $W$ is quasi-affine so any finite set of points of $W$ is contained in an affine open, see Properties, Lemma \ref{properties-lemma-ample-finite-set-in-affine}). Thus we assume $u \not \in W$ and hence none of the points of the orbit of $u$ is in $W$. Let $\xi \in U$ be a point with a nontrivial specialization to a point $u'$ in the orbit of $u$. Since there are no specializations among the points in the orbit of $u$ (Lemma \ref{lemma-no-specializations-map-to-same-point}) we see that $\xi$ is not in the orbit. By assumption (3) we see that $\xi$ is a generic point of $U$ and hence $\xi \in W$. As $U$ is Noetherian there are finitely many of these points $\xi_1, \ldots, \xi_m \in W$. Because $s_W, t_W$ are flat the orbit of each $\xi_j$ consists of generic points of irreducible components of $W$ (and hence $U$). \medskip\noindent Let $j : U \to \Spec(A)$ be an immersion of $U$ into an affine scheme (this is possible as $U$ is quasi-affine). Let $J \subset A$ be an ideal such that $V(J) \cap j(W) = \emptyset$ and $V(J) \cup j(W)$ is closed. Apply Lemma \ref{lemma-find-almost-invariant-function} to the groupoid scheme $(W, R_W, s_W, t_W, c_W)$, the morphism $j|_W : W \to \Spec(A)$, the points $\xi_j$, and the ideal $J$ to find an $f \in J$ such that $(j|_W)^{-1}D(f)$ is an $R_W$-invariant affine open containing $\xi_j$ for all $j$. Since $f \in J$ we see that $j^{-1}D(f) \subset W$, i.e., $j^{-1}D(f)$ is an $R$-invariant affine open of $U$ contained in $W$ containing all $\xi_j$. \medskip\noindent Let $Z$ be the reduced induced closed subscheme structure on $$ U \setminus j^{-1}D(f) = j^{-1}V(f). $$ Then $Z$ is set theoretically $R$-invariant (but it may not be scheme theoretically $R$-invariant). Let $(Z, R_Z, s_Z, t_Z, c_Z)$ be the restriction of $R$ to $Z$. Since $Z \to U$ is finite, it follows that $s_Z$ and $t_Z$ are finite. Since $u \in Z$ the orbit of $u$ is in $Z$ and agrees with the $R_Z$-orbit of $u$ viewed as a point of $Z$. Since $\dim(\mathcal{O}_{U, u'}) \leq 1$ and since $\xi_j \not \in Z$ for all $j$, we see that $\dim(\mathcal{O}_{Z, u'}) \leq 0$ for all $u'$ in the orbit of $u$. In other words, the $R_Z$-orbit of $u$ consists of generic points of irreducible components of $Z$. \medskip\noindent Let $I \subset A$ be an ideal such that $V(I) \cap j(U) =\emptyset$ and $V(I) \cup j(U)$ is closed. Apply Lemma \ref{lemma-find-almost-invariant-function} to the groupoid scheme $(Z, R_Z, s_Z, t_Z, c_Z)$, the restriction $j|_Z$, the ideal $I$, and the point $u \in Z$ to obtain $h \in I$ such that $j^{-1}D(h) \cap Z$ is an $R_Z$-invariant open affine containing $u$. \medskip\noindent Consider the $R_W$-invariant (Groupoids, Lemma \ref{groupoids-lemma-determinant-trick}) function $$ g =  \text{Norm}_{s_W}(t_W^\sharp(j^\sharp(h)|_W)) \in \Gamma(W, \mathcal{O}_W) $$ (In the following we only need the restriction of $g$ to $j^{-1}D(f)$ and in this case the norm is along a finite locally free morphism of affines.) We claim that $$ V = (W_g \cap j^{-1}D(f)) \cup (j^{-1}D(h) \cap Z) $$ is an $R$-invariant affine open of $U$ which finishes the proof of the lemma. It is set theoretically $R$-invariant by construction. As $V$ is a constuctible set, to see that it is open it suffices to show it is closed under generalization in $U$ (Topology, Lemma \ref{topology-lemma-characterize-closed-Noetherian} or the more general Topology, Lemma \ref{topology-lemma-constructible-stable-specialization-closed}). Since $W_g \cap j^{-1}D(f)$ is open in $U$, it suffices to consider a specialization $u_1 \leadsto u_2$ of $U$ with $u_2 \in j^{-1}D(h) \cap Z$. This means that $h$ is nonzero in $j(u_2)$ and $u_2 \in Z$. If $u_1 \in Z$, then $j(u_1) \leadsto j(u_2)$ and since $h$ is nonzero in $j(u_2)$ it is nonzero in $j(u_1)$ which implies $u_1 \in V$. If $u_1 \not \in Z$ and also not in $W_g \cap j^{-1}D(f)$, then $u_1 \in W$, $u_1 \not \in W_g$ because the complement of $Z = j^{-1}V(f)$ is contained in $W \cap j^{-1}D(f)$. Hence there exists a point $r_1 \in R$ with $s(r_1) = u_1$ such that $h$ is zero in $t(r_1)$. Since $s$ is finite we can find a specialization $r_1 \leadsto r_2$ with $s(r_2) = u_2$. However, then we conclude that $f$ is zero in $u'_2 = t(r_2)$ which contradicts the fact that $j^{-1}D(h) \cap Z$ is $R$-invariant and $u_2$ is in it. Thus $V$ is open. \medskip\noindent Observe that $V \subset j^{-1}D(h)$ for our function $h \in I$. Thus we obtain an immersion $$ j' : V \longrightarrow \Spec(A_h) $$ Let $f' \in A_h$ be the image of $f$. Then $(j')^{-1}D(f')$ is the principal open determined by $g$ in the affine open $j^{-1}D(f)$ of $U$. Hence $(j')^{-1}D(f)$ is affine. Finally, $j'(V) \cap V(f') = j'(j^{-1}D(h) \cap Z)$ is closed in $\Spec(A_h/(f')) = \Spec((A/f)_h) = D(h) \cap V(f)$ by our choice of $h \in I$ and the ideal $I$. Hence we can apply Lemma \ref{lemma-get-affine} to conclude that $V$ is affine as claimed above.