%We first check that $\cA_0$ satisfies assumption (A1). Denote by $K_0$ the field of fractions of $\B_0$. Suppose that $\B_1\subset \overline{K_0}$ is a finitely generated $\B_0$-algebra and $a\in \cA_0(\B_1)$.
%Let $\U_0$ be a nonempty open subset of $\X_0$ such that for any $x_0\in \U_0$, $\dim (\cA_0)_{x_0} =\dim (\cA_0)_\eta$, where $\eta$ is the generic point of $\X_0$. Let $\U_1$ be the preimage of $\U_0$ under the morphism $\spec(\B_1)\rightarrow \X_0$ with respect to the inclusion $\B_0\subseteq \B_1$. Then $\U_1$ is a nonempty open subset of $\spec(\B_1)$. Suppose $x_1\in \U_1$. Let $x_0=x_1\cap \B_0$. Then $k_0(x_1)$ is an algebraic extension of $k_0(x_0)$ and thus $\overline{k_0(x_0)}=\overline{k_0(x_1)}$.
%For any $x_0\in \X_0$, the fibre $(\cA_0)_{x_0}=\cA_0\times_{\X_0} \spec(k_0(x_0))$ is an abelian variety over $k_0(x_0)$ and $\cA_0(\overline{k_0(x_0)})=(\cA_0)_{x_0}(\overline{k_0(x_0)})$, in particular, $\cA_0(\overline{K_0})=(\cA_0)_{\eta}(\overline{K_0})$. Suppose $m\geq 1$. Due to Theorem 8.2 of [28], the morphism $m_{\cA_0}: \cA_0\rightarrow \cA_0$ given by $a\mapsto a^m$ is surjective. By Lemma 66.24.1 of [40], the group homomorphism $m: \cA_0(\overline{K_0})\rightarrow \cA_0(\overline{K_0})$ given by $a\mapsto a^m$ is surjective. Similarly, the homomorphism $m: \cA_0(\overline{k_0(x_0)})\rightarrow \cA_0(\overline{k_0(x_0)})$ given by $a\mapsto a^m$ is surjective. Thus for any $m\geq 1$, neither of the sets $\{ b\in \cA_0(\overline{K_0}) \mid b^m=a\}$ or $\{ b\in \cA_0(\overline{k_0(x_0)}) \mid b^m=\sigma_{x_1}(a)\}$ is empty. Furthermore, by Remark 8.4 of [28],
%	$$
%	   |\{ b\in \cA_0(\overline{k_0(x_0)}) \mid b^m=1\}|=m^{2\dim (\cA_0)_{x_0}}=m^{2\dim (\cA_0)_\eta}=|\{ b\in \cA_0(\overline{K_0}) \mid b^m=1\}|.
%	$$
%	Since $\{ b\in \cA_0(\overline{K_0}) \mid{} b^m=a\}=\alpha\cdot \{ b\in \cA_0(\overline{K_0}) \mid b^m=1\}$ where $\alpha\in \cA_0(\overline{K_0})$ and $\alpha^m=a$,
%	$$
%	    |\{ b\in \cA_0(\overline{K_0}) \mid b^m=a\}|=|\{ b\in \cA_0(\overline{K_0}) \mid b^m=1\}|=m^{2\dim (\cA_0)_\eta}.
%	$$
%	Similarly, one has that
%	$$
%	    |\{ b\in \cA_0(\overline{k_0(x_0)}) \mid b^m=\sigma_{x_1}(a)\}|=|\{ b\in \cA_0(\overline{k_0(x_0)}) \mid b^m=1\}|=m^{2\dim (\cA_0)_{x_0}}.
%	$$
%	Therefore $\cA_0$ satifies assumption (A1), because $\overline{k_0(x_0)}=\overline{k_0(x_1)}$.

Since $K_0$ is finitely generated over $\mathbb{Q}$, by the generalized Mordell-Weil theorem (\cite[Chapter 6, Thm. 1]{Lang:FundamentalsofDiophantineGeometry}) the group $\cA_0(K_0)$ is finitely generated. Therefore, assumption (A1) is satisfied and also $\Gamma=\cA_0(\B_0)\leq \cA_0(K_0)$ is finitely generated. Thus Theorem~\ref{thm:specializationtheorem} applies.
\end{proof}

In addition to the case of group schemes of abelian type explained in the above corollary, Theorem~\ref{thm:specializationtheorem} also applies in the case where $k_0$ is a finitely generated field extension of $ℚ$ and $_0=𝔾_m,_0$ is the multiplicative group scheme over $_0$. In this case assumption
%(A1) is trivial (the cardinality equals $m$ on both sides) and
assumption (A1) is verified by \cite[Prop. 2.12]{Feng:DifferenceGaloisGrousUnderSpecialization}.

Theorem \ref{thm:specializationtheorem} does not apply to the additive group scheme $𝔾_a,_0$ over $_0$ because assumption (A1) is violated. For example, for $Γ=(ℤ,+)$, the group
in (A1) equals $(ℚ,+)$.

\subsubsection{Denseness of ad$\times$Jac-open sets}
\label{subsubsec: Denseness of ad-open and ab-open sets}

Throughout Section \ref{subsubsec: Denseness of ad-open and ab-open sets} we make the following assumptions:
\begin{itemize}
\item $k$ is an algebraically closed field of characteristic zero;
\item $\B$ is a finitely generated $k$-algebra that is an integral domain and
\item $\X=\spec(\B)$.
\end{itemize}

%We now introduce \emph{ab-open subsets} of $\X(k)$. Let $\B'$ be a finitely generated $\B$-algebra that is an integral domain and algebraic over $\B$.
%Let $\mathcal{A}'$ be a commutative group scheme of finite type over $\B'$ (i.e., over $\X'=\spec(\B')$) such that
%%$\cA$ is projective over $\X'$ ??
%the fibre $\cA'_{\xi'}$ %(or use geometric generic fibre??)
%of $\cA'\to \X'$ over the generic point $\xi'$ of $\X'$ is an abelian variety (over $k(\xi')=k(\B')$). For every point $x'\in\X'$ we have a specialization morphism
%$$\sigma_{x'}\colon \cA'(\B')\to \cA'(k(x'))=\cA'_{x'}(k(x'))$$
%obtained by composing an element $\X'\to \cA'$ of $\cA'(\B')=\Hom_{\X'}(\X',\cA')$ with $\spec(k(x'))\to \X'$. For a finitely generated subgroup $\Gamma'$ of $\cA'(\B')$ we set
%$$W_{\X'}(\cA',\Gamma')=\{x'\in \X'(k)|\ \sigma_{x'} \text{ is injective on } \Gamma'\}.$$
%\begin{defi} \label{defi: ab-open subset}
%	A subset $\U$ of $\X(k)$ is \emph{ab-open} if there exists an integral domain $\B'$ containing $\B$ such that $\B'$ is algebraic and finitely generated over $\B$ and a subset $W_{\X'}(\cA',\Gamma')$ of $\X'(k)$, (where $\X'=\spec(\B')$) as above such that $\U$ is the image of $W_{\X'}(\cA',\Gamma')$ under $\X'\to \X$.

%Let $\B'$ be a finitely generated $k$-algebra that is an integral domain.
%Let $\mathcal{A}$ be a commutative group scheme over $\B$ (i.e., over $\X=\spec(\B)$) such that the fibre $\cA_\eta$ of $\cA\to \X$ over the generic point $\eta$ of $\X$ is an abelian variety (over $k(\eta)$, the field of fractions of $\B$). For every point $x\in\X$ we have a specialization morphism
%$$\sigma_x\colon \cA(\B)\to \cA(k(x))=\cA_x(k(x))$$
%obtained by composing an element $\X\to \cA$ of $\cA(\B)$ with $\spec(k(x))\to \X$. For a finitely generated subgroup $\Gamma$ of $\cA(\B)$ we set
%$$W_\X(\cA,\Gamma)=\{x\in \X|\ \sigma_x \text{ is injective on } \Gamma\}.$$
%	A subset $\U$ of $\X(k)$ is \emph{ab-open} if there exists an integral domain $\B'$ containing $\B$ such that $\B'$ is algebraic and finitely generated over $\B$ and a subset $W_{\X'}(\cA',\Gamma')$ of $\X'=\spec(\B')$ as above such that $\U$ is the intersection of $\X(k)$ with the image of  $W_{\X'}(\cA',\Gamma')$ under $\X'\to \X$.
%\emph{Ad-open subsets} are defined similarly to ab-open subsets but with abelian varieties replaced by the additive group $\Ga$. Also, in the case of ad-open subsets the algebraic extension $\B'$ of $\B$ is not needed.
%For a finitely generated subgroup $\Gamma$ of $\Ga(\B)=(\B,+)$ we set
%W_\X(\Ga,\Gamma)=\{c\in \X(k) \mid \mbox{$c$ is injective on $\Gamma$}\},
%where we identify $\X(k)$ with $\Hom_k(\B,k)$.
%	A subset $\U$ of $\X(k)$ is \emph{ad-open} if there exists a finitely generated subgroup $\Gamma$ of $(\B,+)$ such that $\U=W_\X(\Ga,\Gamma)$.
% Note that if $\Gamma$ is generated by a single element $b\in \B$, then $W_\X(\Ga,\Gamma)=\{c\in \X(k)|\ b(c)\neq 0\}$ is the basic Zariski open subset of $\X(k)$ where $b$ does not vanish. In this sense, one can think of ad-open and ab-open subsets as generalizations of Zariski open subset.
%	Let $\B=k[u]$ be a univariate polynomial ring over $k$ so that $\X=\A^1_k$ and $\X(k)=k$. For $\mathbb{Q}$-linearly independent elements $a_1,\ldots,a_m\in k$, let $\Gamma$ be the subgroup of $(\B,+)$ generated by $a_1,\ldots,a_m$ and $u$. Then $W_\X(\Ga,\Gamma)=k\smallsetminus V$ consists of all elements of $k$ that are not contained in the $\mathbb{Q}$-vector space $V$ generated by $a_1,\ldots,a_m$.

%	\label{def: basic open sets and Hilbert sets}
%	A subset $\U$ of $\X(k)$ is \emph{ad-open} if it is of the form $\U=W_\X(\Ga,\Gamma)$ for a finitely generated subgroup $\Gamma$ of $(\B,+)$.

%As $\Z(\B,a)$ is the usual basic Zariski open subset defined by $a$, one can think of $\Ga$-open subsets of $\X(k)$ as a generalization of Zariski open subsets.

%\mw{The above definition is less general than \cite[Def. 2.1]{Feng:DifferenceGaloisGrousUnderSpecialization}. This should be remarked and explained why.}
%	If $\Gamma_1,\ldots,\Gamma_m$ are finitely generated subgroups of $(\B,+)$ and $\Gamma$ is the subgroup generated by $\Gamma_1,\ldots,\Gamma_m$, then $W_\X(\Ga,\Gamma)\subseteq W_\X(\Ga,\Gamma_1)\cap\ldots\cap W_\X(\Ga,\Gamma_m)$. Thus a finite intersection of ad-open subsets of $\X(k)$ contains an ad-open subset.
%The image of a dominant morphism of varieties contains a Zariski open subset. The following lemma, which follows from \cite[Lemma 5A.1]{Hrushovski:ComputingTheGaloisGroupOfaLinearDifferentialEequation}, is an analog of this statement in our context. It also explains why for ad-open subsets we do not need to use algebraic extension $\B'$ of $\B$ as in the case of ab-open subset.
%% which indicates that to prove a property holds on a basic open subset of $\X(k)$ it suffices to prove this property holds on a basic open subset of $\tilde{\X}(k)$ where $\tilde{\X}$ is an affine scheme over an integral domain finitely generated over $\B$.
%	\label{LM:extensionsofbasicopensubsets}
%	Let $\B\subseteq\B'$ be an inclusion of integral domains that are finitely generated over $k$. Set $\X'=\spec(\B')$ and let $\f\colon  \X'(k)\to\X(k)$ be the map corresponding to the inclusion $\B\subseteq\B'$. If $\U'$ is an ad-open subset $\X'(k)$, then there exists an ad-open subset $\U$ of $\X(k)$ such that  $\U\subseteq \f(\U')$.
%    Moreover, assume further that $\B'$ is algebraic over $\B$, then for any $p'\in \X'(k)$, $\f(p')\in \U$ implies $p'\in \U'$.
%	\qed
%	%	contthere exists a $\Ga$-open subset
%	%	Let $\tilde{\B}$ be an integral domain finitely generated over $\B$.
%	%	Suppose that $\U$ is a basic open subset of $\Hom_k(\tilde{\B},k)$. Then there is a basic open subset $\VV$ of $\X(k)$ such that every element of $\VV$ can be extended to an element of $\U$.
%\rf{I add one more assertion in the case that $\B'$ is algebraic over $\B$. This assertion will help us to conclude that the projection of the intersection of an ad-open set with an ab-open set of $\X'(k)$ contains the intersection of an ad-open set with an ab-open set of $\X(k)$. Since Hrushovski did not explicitly state the last assertion, should we repeat his proof here?}
%	Let $\B\subseteq \B'$ be an inclusion of integral domains that are finitely generated $k$-algebras such that $\B'$ is algebraic over $\B$. Let $\f\colon \X'\to \X$ denote the morphism corresponding to the inclusion $\B\subseteq \B'$. Let $\U'$ be a subset of $\X'$ that is ad-open, ab-open, Jac-open or the intersection of an an??

%As explained in the following remark, Lemma \ref{LM:extensionsofbasicopensubsets} allows us, in the context of Notation~\ref{notation: setup}, to enlarge $\B$ if necessary.
%\begin{rem} \label{rem: extend B}
%	??improve
%	Assume the setup of Notation \ref{notation: setup} and suppose we would like to show that there exists a $\Ga$-open subset $\U$ of $\X(k)$ such that $R^c$ has a certain property $P$ for every $c\in \U$. As we now explain, to show this, one can replace $\B$ by any $\tilde{\B}\subseteq \K$ such that $\B\subseteq \tilde{\B}$ and $\tilde{\B}$ is finitely generated over $k$.
%	Indeed, $\tilde{\R}=\R\otimes_\B\tilde{\B}$ is a differential $\tilde{\G}=\G_{\tilde{\B}}$-torsor (Lemma \ref{lemma: actions}) and $\tilde{\Y}=\Y\otimes1\in \Gl_n(\tilde{\R})$ is such that $\de(\tilde{\Y})=\cA\tilde{\Y}$ and $\tilde{\R}=\tilde{\B}[x]_f[\tilde{\Y},\frac{1}{\det(\tilde{\Y})}]$. Since $\G$ acts on $\Y$ through matrix multiplication, also $\tilde{\G}$ acts on $\tilde{Y}$ through matrix multiplication. Thus $\tilde{\R}/\tilde{\B}[x]_f$ is a differential $\tilde{\G}$-torsor for $\de(y)=\cA y$ with fundamental matrix $\tilde{Y}$. Since $\B\subseteq \tilde{\B}\subseteq \K$, the algebraic closure of the field of fractions of $\tilde{\B}$ agrees with $\K$. Therefore $\tilde{R}_\gen=\tilde{\R}\otimes_{\tilde{\B}[x]_f}\K(x)=R_\gen$.
%	For $\tilde{c}\in \tilde{\X}(k)$, where $\tilde{\X}=\spec(\tilde{\B})$, let $c\in \X(k)$ be the image of $\tilde{c}$ under $\tilde{\X}(k)\to \X(k)$. Then $\tilde{R}^{\tilde{c}}=\tilde{\R}\otimes_{\tilde{\B}[x]_f}k(x)= (\R\otimes_\B \tilde{\B})\otimes_{\tilde{\B}[x]_f}k(x)=\R\otimes_{\B[x]_f}k(x)=R^c$. Thus, if we can show that there exists a $\Ga$-open subset $\tilde{\U}$ of $\tilde{\X}$ such that $\tilde{R}^{\tilde{c}}$ has property $P$ for every $\tilde{c}\in \tilde{\U}$. Then Lemma \ref{LM:extensionsofbasicopensubsets} yields a $\Ga$-open subset $\U$ of $\X(k)$ such that $R^c$ has property $P$ for every $c\in\U$.

%We would like to show that the intersection of an ad-open and an ab-open subset is Zariski dense in $\X(k)$.
%A key ingredient for this endeavor is N\'{e}ron's specialization theorem that we now formulate.
%Let $k_0$ be a finitely generated field extension of $\mathbb{Q}$ and let $\X_0$ be an affine variety over $k_0$ (i.e., a geometrically integral affine scheme of finite type over $k_0$). Let $\cA\to \X_0$ be a commutative group scheme over $\X_0$ such that the generic fibre is an abelian variety.
%% Then, replacing $\X_0$ by an open affine subvariety of $\X_0$ if necessary, we can assume that $A_{k_0(\X_0)}$ extends to a group scheme $A\to\X_0$ such that the fibre over the generic point of $\X_0$ is $A_{k_0(\X_0)}$.
%%For $x_0\in \X_0$ let $k_0(x_0)$ denote the residue field at $x_0$.
%For every $x_0\in \X_0$ we obtain a specialization morphism
%$$\sigma_{x_0}\colon \cA(\X_0)\to \cA(k_0(x_0))$$
%by composing an element of $\cA(\X_0)=\Hom_{\X_0}(\X_0,\cA)$ with $\spec(k_0(x_0))\to \X_0$.
%\begin{theo}[N\'{e}ron's specialization theorem]
%	There exists a Hilbert subset $H$ of $\X_0$ such that for every $x_0\in H$ the specialization morphism $\sigma_{x_0}$ is injective.
%	??

We continue to work towards showing that ad$×$Jac-open subsets are Zariski dense. The following proposition is an important step in this direction. It can be seen as a ``geometric'' version of Corollary \ref{cor: Nerons specialization theorem}.

\begin{prop} \label{prop: ab contains Hilbert}
Let $\U$ be an ab-open subset of $\X(k)$ and $S\subseteq \B$ a finite subset. Then there exists a geometric $\B_0/k_0$-Hilbert set $\H\subseteq \X(k)$ such that $S\subseteq \B_0$ and $\H\subseteq \U$. In particular,
every ab-open subset of $\X(k)$ contains a geometric Hilbert set.
\end{prop}
\begin{proof}
The ab-open set $\U$ is of the form $\U=\f(W_{\X'}(\cA,\Gamma))$,
where $\X'=\spec(\B')$ with $\B'$ an integral domain containing $\B$, finitely generated and algebraic over $\B$, $\cA$ is a group scheme of abelian type over $\B'$, $\Gamma$ is a finitely generated subgroup of $\cA(\B)$ and $\f\colon\X'(k)\to\X(k)$ is the morphism induced by the inclusion $\B\subseteq \B'$.
The idea of the proof is to descend the whole situation from $k$ to a finitely generated field extension of $\mathbb{Q}$ so that we can apply N\'{e}ron's specialization theorem.
%	 be an ab-open subset of $\X(k)$. So there exist an integral domain $\B'$ containing $\B$ finitely generated and algebraic over $\B$ and a subset ?? $W_{\X'}(\cA',\Gamma')$ of $\X'=\spec(\B')$ such that $\U$ is the intersection of $\X(k)$ with the image of ?? $W_{\X'}(\cA',\Gamma')$ in $\X$.
We claim that we can find
\begin{itemize}
\item a nonzero $b\in \B$ such that every $\p\in D(b)$ lifts to a prime ideal of $\B'$;
\item a subfield $k_0$ of $k$ that is finitely generated over $\mathbb{Q}$;
\item a finitely generated $k_0$-subalgebra $\B_0$ of $\B$ containing $b$ and $S$ such that the canonical map $\B_0\otimes_{k_0}k\to \B$ is an isomorphism;
%\rf{I add $S$ here.}
\item a finitely generated $k_0$-subalgebra $\B'_0$ of $\B'$ containing $\B_0$ such that the canonical map $\B_0'\otimes_{k_0}k\to \B'$ is an isomorphism and such that $\B_0'$ is algebraic over $\B_0$;
\item a group scheme $\cA_0$ over $\B'_0$ of abelian type such that the base change from $k_0$ to $k$ of $\cA_0/\B'_0$ equals $\cA/\B'$ and $\Gamma\subseteq \cA_0(\B'_0)$ (where we identify $\cA_0(\B_0')$ with a subset of $\cA(\B')$).
%\rf{It seems that we need to choose $\cA_0$ to be (or prove it is always) an abelian scheme.}
\end{itemize}
To see that we can find the above items we argue as follows. First, by Chevalley's theorem, we can find an appropriate $b\in \B$.
Let $\gamma_1,\ldots,\gamma_s$ be a finite generating set of $\Gamma$.
Writing $\B'$ as the directed union of all of its finitely generated $\mathbb{Z}$-algebras and considering the morphisms $\gamma_1\colon \spec(\B')\to \cA,\ldots,\gamma_s\colon\spec(\B')\to \cA$ and the separated commutative group scheme $\cA$ over $\B'$, we can combine Theorem 8.8.2 and Theorem 8.10.5 (v) of [20], to obtain a finitely generated $\mathbb{Z}$-subalgebra $\tilde{\B}$ of $\B'$, a commutative separated group scheme $\tilde{\cA}$ of finite type over $\tilde{\B}$ and morphisms $\tilde{\gamma_i}\colon \spec(\tilde{\B})\to \tilde{\cA}$ $(i=1,\ldots,s)$ such that the base change of $\tilde{\cA}$ from $\tilde{\B}$ to $\B'$ is $\cA$ and the base change of $\tilde{\gamma_i}$ from $\tilde{\B}$ to $\B'$ is $\gamma_i$ for $i=1,\ldots,s$. So, if we identify $\tilde{\cA}(\tilde{\B})$ with a subset of $\cA(\B')$, then $\Gamma\subseteq  \tilde{\cA}(\tilde{\B})$.

Next choose a finite generating set $S'$ of $\B'$ as a $k$-algebra such that $S'$ contains a finite generating set of $\tilde{\B}$ as a $\mathbb{Z}$-algebra. Then choose a finite generating set $T$ of $\B$ as a $k$-algebra such that $b\in T$, $S\subseteq T$ and all elements of $S'$ satisfy a nonzero univariate (not necessarily monic) polynomial over $\mathbb{Z}[T]$. Set $T'=S'\cup T$. Then $T\subseteq T'$, $T$ generates $\B$ as a $k$-algebra, $T'$ generates $\B'$ as a $k$-algebra and every element of $T'$ is algebraic over $\mathbb{Z}[T]$. Next, let $k_0\subseteq k$ be a finitely generated field extension of $\mathbb{Q}$ such that the ideal of all $k$-algebraic relations among the elements of $T$ as well as the ideal of all $k$-algebraic relations among the elements of $T'$ is generated by polynomials with coefficients in $k_0$. Set $\B_0=k_0[T]$ and $\B_0'=k_0[T']$. Then $\B_0\subseteq \B'_0$ and $\B'_0$ is finitely generated and algebraic over $\B_0$. Moreover, $b\in \B_0$, $S\subseteq\B_0$, $\tilde{\B}\subseteq \B_0'$ and the morphisms $\B_0\otimes_{k_0}k\to \B_0$ and $\B_0'\otimes_{k_0}k\to \B'$ are isomorphism.

Let $\cA_0$ be the base change of $\tilde{\cA}$ from $\tilde{\B}$ to $\B_0'$.
Then $\cA_0$ is a commutative separated group scheme of finite type over $\B_0'$ with $\Gamma\subseteq\cA_0(\B'_0)$ and the base change of $\cA_0$ from $\B_0'$ to $\B'$ is $\cA$. It follows that the base change of $\cA_0\times_{\spec(\B'_0)}\spec(k_0(\B'_0))$ from $k_0(\B'_0))$ to $k(\B')$ is $\cA\times_{\spec(\B')}k(\B')$. Since the latter is an abelian variety, also $\cA_0\times_{\spec(\B'_0)}\spec(k_0(\B'_0))$ must be an abelian variety. So $\cA_0$ is of abelian type. In summary, we have successfully descended everything to $k_0$: The base change of $\B'_0/\B_0$ from $k_0$ to $k$ is $\B'/\B$ and the base change of $\cA_0/\B'_0$ from $k_0$ to $k$ is $\cA/\B'$.

Set $\X_0=\spec(\B_0)$ and $\X'_0=\spec(\B'_0)$ so that $\cA\to\X'\to\X$ is the base change from $k_0$ to $k$ of $\cA_0\to\X'_0\to\X_0$.

By Neron's specialization theorem (Corollary \ref{cor: Nerons specialization theorem}), there exists a Hilbert subset $H_0'$ of $\X'_0$ such that the specialization map $\sigma_{x_0'}\colon \cA_0(\B_0')\to \cA_0(k_0(x_0'))$ is injective for every $x'_0\in H'_0$.
%\rf{Should $\cA_0'$ be $\cA_0$ and $\cA$ be $\cA'$?}
By Lemma \ref{lemma: Hilbert set under projection} there exists a Hilbert subset $H_0$ of $\X_0$ such that the image of $H_0'$ in $\X_0$ contains $H_0$ and every element of $H_0$ has a unique lift to an element of $\X_0'$. Let $\H$ be the inverse image of $H_0\cap D(b)$ under $\X(k)\to \X\to \X_0$. Then $\H$ is a geometric $\B_0/k_0$-Hilbert set.

We claim that the geometric Hilbert set $\H$ is contained in $\U$. Let $c\in \H$ and let $x,x_0$ denote the image of $c$ in $\X,\X_0$ respectively. By construction of $H_0$, there exists an $x_0'\in H_0'$ mapping to $x_0$.
On the other hand, if $\p$ is the prime ideal of $\B$ corresponding to $x$, then $b\notin\p$ and so $x$ lifts to a point $x'$ of $\X'$ by the choice of $b$. The commutative diagram
\xymatrix{
\X' \ar[r] \ar[d] & \X \ar[d] \\
\X_0' \ar[r] & \X_0
then shows that the image of $x'$ in $\X_0'$ equals $x_0'$ because $x_0'$ is the unique lift of $x_0$ to an element of $\X_0'$.
We then have a commutative diagram
\xymatrix{
\cA_0(\B_0') \ar[r] \ar_-{\sigma_{x_0'}}[d] & \cA(\B') \ar^-{\sigma_{x'}}[d] \\
\cA_0(k_0(x_0')) \ar[r] & \cA(k(x'))
where the horizontal maps are injections. As $\sigma_{x_0'}$ is injective, it is in particular injective on $\Gamma$. Thus also $\sigma_{x'}=\sigma_c$ is injective on $\Gamma$. So $c\in W_{\X'}(\cA,\Gamma)=\U$ as desired.
\end{proof}

%	Let $H\subseteq \X(k)$ be a $\B_0/k_0$-Hilbert set and let $b_1,\ldots,b_m\in\B$. Then there exists a $\B_1/k_0$-Hilbert set $H_1\subseteq H$ such that $b_1,\ldots,b_m\in\B_1$.
%	Let ??

We are now prepared to prove the main theorem of this section.

\begin{theo} \label{theo: ad meets ab is dense}
The intersection of an ad-open and an ab-open subset of $\X(k)$ is Zariski dense in $\X(k)$. In particular, an ad$\times$Jac-open subset of $\X(k)$ is Zariski dense in $\X(k)$.
\end{theo}
\begin{proof}
Let $\U=W_\X(\Ga,\Gamma)$ be an ad-open subset of $\X(k)$ and let $\mathcal{V}$ be an ab-open subset of $\X(k)$. We first show that $\U\cap\mathcal{V}$ is nonempty.

Choose a finite generating set $S\subseteq \B$ of the finitely generated subgroup $\Gamma$ of $(\B,+)$. By Proposition \ref{prop: ab contains Hilbert} there exists a geometric $\B_0/k_0$-Hilbert set $\H$ of $\X(k)$ with $S\subseteq \B_0$ and $\H\subseteq \mathcal{V}$. Now Lemma \ref{lemma: containmemt for Hilber sets} yields an $\boldsymbol{\eta}\in \B_0^m$ with $\B_0=k_0[\boldsymbol{\eta}]$ and appropriate $\boldsymbol{f}$, $g$ such that
$\H_{k_0,\X(k)}^{\boldsymbol{\eta}}((1,\ldots,1),\boldsymbol{f},g)\subseteq \H.$ In particular, $\H_{k_0,\X(k)}^{\boldsymbol{\eta}}((1,\ldots,1),\boldsymbol{f},g)\subseteq \mathcal{V}.$

On the other hand, $\Gamma\subseteq \B_0$ as $S\subseteq \B_0$ and so by Proposition \ref{prop: Hilbert set in ad-open}, there exists a $\boldsymbol{d}$ such that $\H^{\boldsymbol{\eta}}_{k_0,\X(k)}(\boldsymbol{d},\emptyset,1)\subseteq \U$.
$$\H_{k_0,\X(k)}^{\boldsymbol{\eta}}(\boldsymbol{d},\boldsymbol{f},g)=\H^{\boldsymbol{\eta}}_{k_0,\X(k)}(\boldsymbol{d},\emptyset,1)\cap \H_{k_0,\X(k)}^{\boldsymbol{\eta}}((1,\ldots,1),\boldsymbol{f},g)\subseteq \U\cap\mathcal{V}. $$
Since $\H_{k_0,\X(k)}^{\boldsymbol{\eta}}(\boldsymbol{d},\boldsymbol{f},g)\neq\emptyset$ by \cite[Prop. 2.8]{Feng:DifferenceGaloisGrousUnderSpecialization}, we can conclude that $\U\cap\mathcal{V}\neq\emptyset$.

\medskip

We next show that $\U\cap \H$ is Zariski dense in $\X(k)$. Suppose, for a contradiction, that $\U\cap \H$ is not Zariski dense. Then there exists a non-empty Zariski open subset $\U'$ of $\X(k)$ such that $\U'\cap\U\cap \mathcal{V}=\emptyset$. So, if $\U''$ is any ad-open subset of $\X(k)$ contained in $\U'\cap\U$, then $\U''\cap \mathcal{V}=\emptyset$. This contradicts the first part of the proof.
\end{proof}

We can do slightly better:
\begin{rem} \label{rem: finite intersection of ad and ab is dense}
The intersection of finitely many ad-open and finitely many ab-open subsets of $\X(k)$ is Zariski dense in $\X(k)$.
\end{rem}
\begin{proof}
The intersection of finitely many ad-open subsets contains an ad-open subset (Remark \ref{rem: intersection of ad-opens}) and the intersection of finitely many ab-open subsets is an ab-open subset (argue as in (\ref{eq: intersection of ads})). Thus the remark follows from Theorem \ref{theo: ad meets ab is dense}.
\end{proof}

%\begin{prop} \label{prop: ad meet hilbert is dense}
%	Let $\U$ be an ad-open subset and $\H$ a geometric Hilbert set in $\X(k)$. Then $\U\cap\H$ is Zariski dense in $\X(k)$.
%	We first show that $\U\cap\H\neq\emptyset$.
%	Let $\Gamma$ be a finitely generated subgroup of $(\B,+)$ such that $\U=\Z(\B,\Gamma)$. Moreover, let ??
%	\medskip
%	We next show that $\U\cap \H$ is Zariski dense in $\X(k)$. Suppose, for a contradiction, that $\U\cap \H$ is not Zariski dense. Then there exists a non-empty Zariski open subset $\mathcal{V}$ of $\X(k)$ such that $\mathcal{V}\cap\U\cap \H=\emptyset$. So if $\U'$ is any ad-open subset of $\X(k)$ contained in $\mathcal{V}\cap\U$, then $\U'\cap \H=\emptyset$. This contradicts the first part of the proof.
%According to \cite[Theorem 2.16]{Feng:DifferenceGaloisGrousUnderSpecialization} every ad-open subset of $\X(k)$ is Zariski dense in $\X(k)$.??

%Combining Proposition \ref{prop: ab contains Hilbert} and \ref{prop: ad meet hilbert is dense} we obtain:
%\begin{cor} \label{cor: ad meet ab is dense}
%	The intersection of an ad-open and an ab-open subset of $\X(k)$ is Zariski dense in $\X(k)$. \qed

%\subsubsection{Old things ?? (This section needs cleaning up)}
%Let us also recall the notion of  \emph{$\tilde{k}$-Hilbert sets} from Notation 2.6 of [17]. Write $\B=k[\bfu]$, where $\bfu=\{u_1,\dots,u_m\}$, $u_1,\dots,u_l$ are algebraically independent over $k$ and $u_{l+i}$ is algebraic over $k[u_1,\dots,u_l]$ for $i=1,\dots,m-l$. Let $\tilde{k}\subseteq k$ be a subfield of $k$ that is finitely generated over $\bQ$ and  such that for each $i=1,\dots,m-l$ the minimal polynomial of ${u_{l+i}}$ over $k(u_1,\dots,u_l)$ has coefficients in $\tilde{k}(u_1,\dots,u_l)$.
%	\label{defi:hilbertset}
%	$H\subset \X(k)$ is called a $\tilde{k}$-Hilbert set if there is a nonzero $b\in \tilde{k}[\bfu]$ and a finite set $\bgg$ of polynomials in $\tilde{k}[\bfu][z]$ which are irreducible over $\tilde{k}(\bfu)$ such that $H$ is the set of $c\in\X(k)$ satisfying that
%	\begin{enumerate}
%		\item for each $g\in \bgg$, $g^c\neq 0$ and $g^c$ is irreducible over $\tilde{k}(\bfu^c)$;
%		\item $b^c\neq 0$.
%	\end{enumerate}
%	We denote $H$ by $\calH_{\tilde{k},\X(k)}(\bgg,b)$.
%	In Notation 2.6 of [17], $u_{i+l}$ is supposed to be integral over $\tilde{k}[u_1,\dots,u_l]$ and each $g\in \bgg$ is supposed to be monic. However, these assumptions are not essential as shown in the proof of the following proposition.
%In Lemma 5A.9 of [23], the intersection of a basic open set and a Hilbert set is proved to be infinite and Proposition 2.10 of [17] implies that basic open sets are Zariski dense in $\X(k)$. The following proposition implies that the intersection of a basic open set and a Hilbert set is also Zariski dense.

%Let $\Gamma$ be a finitely generated subgroup of $\Ga(\tilde{k}[\bfu])$.
%Then the intersection of $\Z(\B,\Gamma)$ and a $\tilde{k}$-Hilbert set is Zariski dense in $\X(k)$.
%By the Noether normalization lemma, $\tilde{k}[\bfu]=\tilde{k}[\tilde{\bfu}]$ where $\tilde{u}=\{\tilde{u}_1,\dots,\tilde{u}_s\}$, $\tilde{u}_1,\dots,\tilde{u}_l$ are algebraically independent over $\tilde{k}$, $\tilde{u}_{i+l}$ is integral over $\tilde{k}[\tilde{u}_1,\dots,\tilde{u}_l]$. One sees that $k[\bfu]=k[\tilde{\bfu}]$. Suppose that $\VV=\calH_{\tilde{k},\X(k)}(\bgg,b)$. Let $\tilde{\bgg}=\{ \lc(g)^{\deg(g)-1}g(z/\lc(g))\mid g\in \bgg\}$. Then each element of $\tilde{\bgg}$ is monic. By Proposition 2.10 in [17], there is an $s$-tuple of positive integers $\bfd$ such that $\calH_{\tilde{k},\X(k)}(\bfd,\emptyset,1)\subset \Z(\B,\Gamma)$ where $\calH_{\tilde{k},\X(k)}(\cdot,\cdot,\cdot)$ is given in Notation 2.6 of [17]. Set $\tilde{b}=b\prod_{g\in \bgg} \lc(g)$. Then $\calH_{\tilde{k},\X(k)}(\tilde{\bgg},\tilde{b})\subset \calH_{\tilde{k},\X(k)}(\bgg,b)$. On the other hand,  $\calH_{\tilde{k},\X(k)}(\bfd,\tilde{\bgg},\tilde{b})\subset \calH_{\tilde{k},\X(k)}(\bfd,\emptyset,1)$. So
%  \calH_{\tilde{k},\X(k)}(\bfd,\tilde{\bgg},\tilde{b})\subset\calH_{\tilde{k},\X(k)}(\tilde{\bgg},\tilde{b})\cap \calH_{\tilde{k},\X(k)}(\bfd,\emptyset,1)\subset \calH_{\tilde{k},\X(k)}(\bgg,b)\cap \Z(\B,\Gamma).
%It remains to show that $\U=\calH_{\tilde{k},\X(k)}(\bfd,\tilde{\bgg},\tilde{b})$ is Zariski dense. Suppose that $\U$ is not Zariski dense, i.e. there is a nonzero $a\in \B$ such that for each $c\in \U$, $a^c=0$. Write $a=\sum_{i=1}^\ell a_i\xi_i$ where $a_i\in \bar{\tilde{k}}[\tilde{\bfu}]\setminus \{0\}$ and $\xi_1,\dots,\xi_\ell\in k$ are linearly independent over $\bar{\tilde{k}}$. Then for any $c\in \U$ with $\tilde{\bfu}^c\subset \bar{\tilde{k}}$, one has that $a_i^c=0$ for all $i$. Note that by Proposition 2.8 of [17] $\calH_{\tilde{k},\bX}(\bfd,\tilde{\bgg},h)\neq \emptyset$ for any nonzero $h\in \tilde{k}[\tilde{\bfu}]$, where $\bX=\Hom_{\bar{\tilde{k}}}(\bar{\tilde{k}}[\tilde{\bfu}],\bar{\tilde{k}})$. Let $\tilde{a}_1$ be an element in $\tilde{k}[\tilde{\bfu}]$ such that $\tilde{a}_1=a_1 r$ from some $r\in \bar{\tilde{k}}[\tilde{\bfu}]$. Suppose that $\calH_{\tilde{k},\bX}(\bfd,\tilde{\bgg},\tilde{b}\tilde{a}_1)\neq \emptyset$ and let $\tilde{c}\in \calH_{\tilde{k},\bX}(\bfd,\tilde{\bgg},\tilde{b}\tilde{a}_1)$. Then $\tilde{c}$ can be extended to an element $c$ of $\U$ with $\tilde{\bfu}^c\subset \bar{\tilde{k}}$ and $(\tilde{b}\tilde{a}_1)^{c}\neq 0$. However, $(\tilde{b}\tilde{a}_1)^{c}=\tilde{b}^c r^{c} a_1^{c}=0$. This implies that $\calH_{\tilde{k},\bX}(\bfd,\tilde{\bgg},\tilde{b}\tilde{a}_1)=\emptyset$, a contradiction. So $\U$ is Zariski dense.
%%Lemma~\ref{LM:extensionsofbasicopensubsets} implies that the image of a $\Ga$-open set under a morphism contains a $\Ga$-open set. When $\tilde{B}$ is finitely generated and algebraic over $\B$, a similar statement holds for $\tilde{k}$-Hilbert sets. ??
%Let $\tilde{\B}$ be an integral domain finitely generated and algebraic over $\B$.
%Suppose that $\U$ is a $\tilde{k}$-Hilbert set of $\Hom_k(\tilde{\B},k)$. Then there is a $\tilde{k}$-Hilbert set $\VV$ of $\X(k)$ such that every element of $\VV$ can be extended to an element of $\U$.
% \end{lemma}
% \begin{proof}
% It suffices to show the case that $\tilde{B}=\B[v]=k[\bfu,v]$ where $v$ is algebraic over $\B$. Assume that $\U=\calH_{\tilde{k},\tilde{\X}(k)}(\{\tilde{g}_1,\dots,\tilde{g}_\ell\},\tilde{b})$, where $\tilde{\X}(k)=\Hom_k(\tilde{\B},k)$, $\tilde{g}_i\in \tilde{k}[\bfu,v][z]$ irreducible over $\tilde{k}(\bfu,v)$ and $\tilde{b}\in \tilde{k}[\bfu,v]\setminus \{0\}$. For each $i$, let $g_i\in \tilde{k}[\bfu][z]$ be a polynomial irreducible over $\tilde{k}(\bfu)$ satisfying $g_i=h_i\tilde{g}_i$ for some $h_i\in \tilde{k}[\bfu,v][z]$. Let $b\in \tilde{k}[\bfu]\setminus\{0\}$ satisfy that $b= r \tilde{b}$ from some $r\in \tilde{k}[\bfu,v]$. Let $a$ be the leading coefficient of a nonzero polynomial in $\tilde{k}[\bfu][z]$ annihilated by $v$. Such polynomial exists, because $\tilde{k}$ is chosen to satisfy that there is a minimal polynomial of $v$ over $k(u_1,\dots,u_l)$ having coefficients in $\tilde{k}[u_1,\dots,u_l]$. Set $\VV=\calH_{\tilde{k},\X(k)}(\{g_1,\dots,g_\ell\},ab\prod_{i=1}^\ell \lc(g_i))$. We claim that $\VV$ satisfies the requirement. Suppose $c\in \VV$. Since $a^c\neq 0$, $c$ can be extended to an element $\tilde{c}$ of $\tilde{\X}(k)$. Assume that $\tilde{g}_i^{\tilde{c}}$ is reducible over $\tilde{k}(\bfu^c,v^{\tilde{c}})$ and $Q_i$ is a proper factor of $\tilde{g}_i^c$. Then $\deg(Q_i)<\deg(\tilde{g}_i^c)\leq \deg(\tilde{g}_i)$. Let $P_i\in \tilde{k}(\bfu^c)[z]$ be a polynomial irreducible over $\tilde{k}(\bfu^c)$ with $Q_i$ as a factor. One sees that $\deg(g_i)=\deg(\tilde{g}_i)[\tilde{k}(\bfu,v):\tilde{k}(\bfu)]$. As $[\tilde{k}(\bfu^c,v^{\tilde{c}}):\tilde{k}(\bfu^c)]\leq [\tilde{k}(\bfu,v):\tilde{k}(\bfu,v)]$,
% $$\deg(P_i)=\deg(Q_i)[\tilde{k}(\bfu^c,v^{\tilde{c}}):\tilde{k}(\bfu^c)]<\deg(\tilde{g}_i)[\tilde{k}(\bfu,v):\tilde{k}(\bfu)]= \deg(g_i)=\deg(g_i^c).$$ This implies that $g_i^c$ is reducible, because $P_i$ and $g_i^c$ have a common factor $Q_i$, a contradiction. Hence $\tilde{c}\in \U$.
% \end{proof}

\subsection{Specializations of differential torsors: proto-Picard-Vessiot rings} \label{subsec:proto-Picard-Vessiot}

We now begin with the specialization arguments for families of linear differential equations.
In this section we introduce proto-Picard-Vessiot rings, a certain ``approximation'' of Picard-Vessiot rings, and, in the context of Notation \ref{notation: setup}, we show that there exists an ad\=/open subset $\U$ of $\X(k)$ such that $R^c$ is a proto-Picard-Vessiot ring for all $c\in \U$. Roughly, this corresponds to the first step in Hrushovski's algorithm in which a proto-Galois group is computed.

%Throughout Section \ref{subsec:proto-Picard-Vessiot} we assume that setup of Notation

%let $k$ be an algebraically closed field of characteristic zero, $\B$ a finitely generated $k$-algebra that is an integral domain and $\X=\spec(\B)$. Furthermore, $f\in \B[x]$ is a monic polynomial, $\mathcal{A}\in \B[x]_f^{n\times n}$ and $\G$ is an affine group scheme of finite type over $\B$.

For a linear algebraic group $G$, let $G^t$ denote the intersection of all kernels of all characters of $G^\circ$, the identity component of $G$. The algebraic group $G^t$ plays a fundamental role in the study of moduli of linear differential equations ([39]) and in Hrushovski's algorithm ([23]). In regards to Hrushovski's algorithm, the key point concerning $G^t$ is the following. While the degree of defining equations of a closed subgroup of $\Gl_n$ cannot be bounded uniformly in $n$ (consider, e.g., the groups $\mu_m$ of $m$-th roots of unity in $\Gl_1$), there exists a function $\bfd$ of $n$ such that for every closed subgroup $H$ of $\Gl_n$ there exists a closed subgroup $G$ of $\Gl_n$ defined by equations of degree at most $\bfd(n)$ satisfying
\begin{equation}\label{eq: proto Galois group}
G^t\leq H\leq G.
\end{equation}
For our purpose, the mere existence of the function $\bfd(n)$ is sufficient. To make Hrushovski's algorithm practical (a goal that seems rather far out of reach), it is important to find small bounds. In [2] it is shown that one can take $\bfd(n)=(4n)^{3n^2}$.

One can think of $G$ as an ``approximation'' of $H$. This approximation is good in the sense that $G/G^t$ is small. Indeed, $G^t$ is normal in $G$ and the identity component of $G/G^t$ is a torus.
An alternative description of $G^t$ is, as the closed subgroup of $G$ generated by all unipotent elements of $G$.
Given $H$, an algebraic group $G$ satisfying (\ref{eq: proto Galois group}) is called a \emph{proto-Galois group} for $H$ (\cite[Def. 4.1]{AmzallagMinchenkoPogudin:DegreeBoundforToricEnvelope}). Our next goal is to introduce an analog of this notion for differential torsors.

\subsubsection{Proto-Picard-Vessiot rings}
\label{subsubsec:Proto-Picard-Vessiot rings}

Throughout Section \ref{subsubsec:Proto-Picard-Vessiot rings} we make the following assumptions:
\begin{itemize}
\item $F$ is a differential field of characteristic zero with field of constants $F^\de=k$ algebraically closed and of characteristic zero;
\item $G$ is a linear algebraic group over $k$;
\item $A\in F^{n\times n}$;
\item $R/F$ is a differential $G$-torsor for $\de(y)=Ay$ with fundamental matrix $Y\in \Gl_n(R)$ such that $R$ is an integral domain;
%		\item $E=\overline{K}L$ is the field compositum of $\overline{K}$ and the field of fractions $L$ of $R$ (inside $\overline{L}$).
\end{itemize}

%?? do this subsubsection for $K$ instead of $k(x)$??
%Let $G$ be an algebraic group over $k$, $A\in k(x)^{n\times n}$, $R/k(x)$ a differential $G$-torsor for $\de(y)=Ay$ with fundamental matrix $Y\in\Gl_n(R)$.

Note that if $\m$ is a maximal $\de$-ideal of $R$, then $R/\m$ is a Picard-Vessiot ring for $\de(y)=Ay$. As we will now explain, the differential Galois group $H$ of $R/\m$ is canonically a closed subgroup of $G$ (cf. the proof of Proposition 1.15 in [6]).
The composition
%??simplify this arguments using the new definition \ref{defi: differential Gtorsor for de(y)=Ay}??
\begin{equation} \label{eq: composite map}
R\otimes_k k[G]\xrightarrow{\simeq }R\otimes_{F}R\to R/\m\otimes_{F} R/\m\xrightarrow{\simeq} R/\m\otimes_k k[H]
\end{equation}
maps $k[G]$ into $k[H]$, because the elements of $k[G]$ are constant and the constants of $R/\m\otimes_k k[H]$ are just $k[H]$. Thus the surjection (\ref{eq: composite map}) is of the form $\pi\otimes\psi$, where $\pi\colon R\to R/\m$ is the canonical map and $\psi\colon k[G]\to k[H]$ is a surjective map of $k$-algebras.
So $\psi$ defines a closed embedding $H\to G$ of algebraic varieties and we may identify $H$ with a closed subvariety of $G$. We claim that
\begin{equation} \label{eq: H subgroup G}
H(T)=\{g\in G(T)|\ g(\m\otimes_k T)=\m\otimes_k T\}
\end{equation}
for every $k$-algebra $T$. In particular, $H$ is a closed subgroup of $G$.

The commutative diagram
\xymatrix{
R \ar^-\rho[r] \ar_-\pi[d]& R\otimes_k k[G] \ar^-{\pi\otimes\psi}[d] \\
R/\m \ar[r] & R/\m\otimes_k k[H]
shows that $\rho(\m)\subseteq \m\otimes_k k[G]+R\otimes_k \I(H)$, where $\I(H)=\ker(\psi)\subseteq k[G]$ is the defining ideal of $H$. Therefore $g(\m\otimes_k T)\subseteq \m\otimes_k T$ for $g\in H(T)$. Since also $g^{-1}\in H(T)$, we deduce that indeed $g(\m\otimes_k T)=\m\otimes_k T$.

Conversely, if $g\in G(T)$ satisfies $g(\m\otimes_k T)=\m\otimes_k T$, then $g$ induces a differential automorphism of $(R\otimes_k T)/(\m\otimes_k T)=R/\m\otimes_k T$ and thus belongs to $H(T)$ by definition of $H$.
This proves (\ref{eq: H subgroup G}).

Now let $\m'$ be another maximal $\de$-ideal of $R$. Then $R/\m'$ is a Picard-Vessiot ring over $F$ with differential Galois group $H'$ canonically contained in $G$. We will show that $G^t\leq H$ if and only if $G^t\leq H'$.

As a first step, let us show that there exists a $g\in G(k)$ such that $\m'=g(\m)$. Consider the morphism
\begin{equation}\label{eq: morphism for one to all}
k[G]\to R\otimes_k k[G]\xrightarrow{\simeq}R\otimes_{F} R\to R/\m'\otimes_{F} R/\m\to S,
\end{equation}
where $S$ is a quotient of $R/\m'\otimes_{F} R/\m$ by a maximal $\de$-ideal. As $S$ is $\de$-simple and finitely generated over $F$, we have $S^\de=k$ (\cite[Lemma 1.17]{SingerPut:differential}). Thus (\ref{eq: morphism for one to all}) maps $k[G]$ into $k$ and therefore defines a point $g\in G(k)$. By construction, $g(\m)\subseteq \m'$. Since $g(\m)$ is a maximal $\de$-ideal of $R$, we obtain $g(\m)=\m'$ as claimed.

From (\ref{eq: H subgroup G}), we thus deduce that $H'=gHg^{-1}$. As $G^t$ is normal $G$, we see that $G^t\leq H$ if and only if $G^t\leq H'$.
% As $R/\m$ and $R/\m'$ are both Picard-Vessiot rings for $\de(y)=Ay$ over $k(x)$. The uniqueness of Picard-Vessiot rings yields a $k(x)$-$\de$-isomorphism $\psi\colon R/\m\to R/\m'$. Let $\overline{Y}$ and $\overline{Y}'$ denote the image of $Y$ in $R/\m$ and $R/\m'$ respectively. Then $\psi(\overline{Y})=\overline{Y}' g$, for some $g\in\Gl_n(k)$. As $\psi(\overline{Y})=\overline{Y}' g$ satisfies all the $k(x)$-algebraic relations satisfied by $Y$.

%In general, if $G$ and $H$ are algebraic groups, $Z$ a $G$-torsor and $W$ an $H$-torsor such that $W$ is a closed subvariety of $Z$, then the composition $$W\times H\xrightarrow{\simeq} W\times W\to Z\times Z\xrightarrow{\simeq} Z\times  G$$
%induces a morphism $W\times H\to W\times G$ of group schemes over $W$.
% Indeed, we claim that the closed subgroup $\widetilde{H}$ of $G$ given by $\widetilde{H}(T)=\{g\in G(T)|\ g(\m\otimes_k T)=\m\otimes_k T\}$ is canonically isomorphic to $H$.

In summary, if $\m$ and $\m'$ are maximal $\de$-ideals in $R$, yielding differential Galois groups $H\leq G$ and $H'\leq G$ respectively, then $G^t\leq H$ if and only if $G^t\leq H'$. So we can use this property to define proto-Picard-Vessiot rings.

\begin{defi}
The differential torsor $R/F$ is \emph{proto-Picard-Vessiot} if
for one (equivalently every) maximal $\de$-ideal $\m$ of $R$ we have $G^t\leq H$, where $H$ is the differential Galois group of $R/\m$.
%\mw{Why does the above definition require integral domain?}

%Suppose that $\R$ is a differential $\G$-torsor for $\delta(y)=A y$ and $\R$ is an integral domain. Let $\km$ be a maximal $\delta$-ideal of $\R$ and $\H$ an algebraic subgroup of $\G$ such that $\R/\km$ is a differential $\H$-torsor. We say $\R$ is proto-Picard-Vessiot if
%     \G^t \subset \H \subset \G
%where $\G^t$ denotes the algebraic subgroup of $\G$ generated by all unipotent elements.
\end{defi}
Clearly, $R/F$ is proto-Picard-Vessiot if $R/F$ is Picard-Vessiot.
The main goal of this subsection is to show that, in the context of Notation \ref{notation: setup}, there exists an ad-open subset $\U$ of $\X(k)$ such that $R^c/k(x)$ is proto-Picard-Vessiot for all $c\in \U$ (Proposition \ref{PROP:protoPV}). To this end, we first derive a criterion to test if $R/F$ is Picard-Vessiot.

Following [16] and \cite[Def. 2.3]{AmzallagMinchenkoPogudin:DegreeBoundforToricEnvelope} we make the below definition.
%We shall first investigate the subset of $\X(k)$ such that the specializations of a given Picard-Vessiot ring are proto-Picard-Vessiot.

\begin{defi}
\label{DEF:boundvarieties}
Let $k'$ be a field. A closed subvariety $Z$ of $\Gl_{n,k'}$ is \emph{bounded} by a positive integer $d$, if there exist polynomials $f_1,\dots,f_s\in k'[X]$ of degree at most $d$ such that
\begin{equation} \label{eq: bounded}
Z(\overline{k'})=\{g\in\Gl_n(\overline{k'})|\ f_1(g)=\ldots=f_s(g)=0\}.
\end{equation}
Note that, by Hilbert's Nullstellensatz, (\ref{eq: bounded}) is equivalent to $\I(Z)=\sqrt{(f_1,\ldots,f_s)}$, where $\I(Z)\subseteq k'[X,\frac{1}{\det{X}}]$ is the defining ideal of $Z$ and $(f_1,\ldots,f_s)$ is the ideal of $k'[X,\frac{1}{\det{X}}]$ generated by $f_1,\ldots,f_s$.
\end{defi}

\begin{lemma} \label{lemma: bound for torsor}
Let $k'$ be a field, $G$ a closed subgroup of $\Gl_{n,k'}$ and $Z$ a closed subvariety of $\Gl_{n,k'}$ such that $Z$ is a $G$-torsor under right multiplication. If $G$ is bounded by $d$, then also $Z$ is bounded by $d$.
\end{lemma}
\begin{proof}
A point $z\in Z(\overline{k'})$ defines an isomorphism $G_{\overline{k'}}\to Z_{\overline{k'}},\ g\mapsto zg$ of varieties over $\overline{k'}$.
If $f_1,\ldots,f_2\in k'[X]$ are such that $$G(\overline{k'})=\{g\in\Gl_n(\overline{k'})|\ f_1(g)=\ldots=f_s(g)=0 \},$$ then $$Z(\overline{k'})=\{g\in\Gl_n(\overline{k'})|\ f_1(z^{-1}g)=\ldots=f_s(z^{-1}g)=0\}.$$ So $\I(Z_{\overline{k'}})=\sqrt{(f_1(z^{-1}X),\ldots,f_s(z^{-1}X))}\subseteq \overline{k'}[X,\frac{1}{\det(X)}]$.

We have $\I(Z_{\overline{k'}})=\I(Z)\otimes_k k'$ and so, if $f_i(z^{-1}X)\in \overline{k'}[X]$ has degree at most $d$, i.e, $f_i$ has degree at most $d$, then $f_i(z^{-1}X)$ can be written as a $\overline{k'}$-linear combination of polynomials $h_{i,j}\in k'[X]\cap \I(Z)$ of degree at most $d$. The set of solutions of all $h_{ij}$'s in $\Gl_n(\overline{k'})$ is $Z(\overline{k'})$. Therefore $Z$ is bounded by $d$.
\end{proof}

%A closed subvariety $Z$ of $\Gl_{n,k}$ is \emph{bounded} by a positive integer $d$, if there exists polynomials $f_1,\dots,f_s\in k[X]$ of degree at most $d$ such that
%   Z(k)=\{g\in\Gl_n(k)|\ f_1(g)=\ldots=f_s(g)=0\}.
As above, set
\bfd(n)=(4n)^{3n^2}.
\begin{lemma}
\label{LM:criterionforprotoPV}
%Let $G$ be an algebraic group over $k$, $A\in k(x)^{n\times n}$ and $R/k(x)$  a differential $G$-torsor for $\de(y)=Ay$ with fundamental matrix $Y\in\Gl_n(R)$. Assume that $R$ is an integral domain and
Let $\m$ be a maximal $\de$-ideal of $R$. If $h(Y)=0$ for every $h\in F[X]$ with $\deg(h)\leq \bfd(n)$ and $h(Y)\in\m$, then $R/F$ is proto-Picard-Vessiot.
%Suppose that $\tilde{\R}=K[\Y,1/\det(\Y)]$ is a differential $\G$-torsor and $\tilde{\R}$ is an integral domain.
% Suppose that $\km$ is a maximal $\delta$-ideal of $\tilde{\R}$. Then
%$\tilde{\R}$ is proto-Picard-Vessiot if for any $f\in K[X]$ with $\tdeg(f)\leq \bfd(n)$, $f(\Y)\in \km$ implies that $f(\Y)=0$.
\end{lemma}
\begin{proof}
Let $H\leq G$ be the differential Galois group of $R/\m$ and consider $H$ as a closed subgroup of $\Gl_{n,k}$ via the fundamental solution matrix $\overline{Y}\in\Gl_n(R/\m)$, the image of $Y$ in $R/\m$. Due to Corollary 4.1 of [2], there exists a closed subgroup $\tilde{G}$ of $\Gl_{n,k}$ bounded by $\bfd(n)$ such that
\tilde{G}^t \leq H \leq \tilde{G}.

Let $\m'$ be the maximal $\de$-ideal of $F[X,\frac{1}{\det(X)}]$ whose image in $R$ is $\m$ and let $Z'$ be the algebraic subvariety of $\Gl_{n,F}$ defined by $\m'$. The image $\tilde{Z}$ of $Z'\times \tilde{G}_{F}\to \Gl_{n,F}, (z,g)\mapsto zg$ is a $\tilde{G}_{F}$-torsor. Indeed, for a point $z\in Z'(\overline{F})$ we have $$\tilde{Z}(\overline{F})=Z'(\overline{F})\tilde{G}(\overline{F})=zH(\overline{F})\tilde{G}(\overline{F})=z\tilde{G}(\overline{F}).$$
We know from Lemma \ref{lemma: bound for torsor} that $\tilde{Z}$ is bounded by $\bfd(n)$. Let $f_1,\ldots,f_s\in F[X]$ be polynomials of degree at most $\bfd(n)$ such that $\I(\tilde{Z})=\sqrt{(f_1,\ldots,f_s)}$. As
$Z'\subseteq \tilde{Z}$, we have $\I(\tilde{Z})\subseteq \m'$. Therefore $f_1(Y),\ldots,f_s(Y)\in \m$. By assumption, the image of $f_1,\ldots,f_s$ in $R$ is zero. Since $R$ is reduced, we see that in fact the image of $\I(\tilde{Z})$ in $R$ is zero. Geometrically, this means that $Z\subseteq \tilde{Z}$, where $Z\subseteq \Gl_{n,F}$ is the closed subvariety defined by $\I(Z)=\{h\in F[X,\frac{1}{\det(X)}]|\ h(Y)=0\}$. As $Z$ is a $G_{F}$-torsor and $\tilde{Z}$ is a $\tilde{G}_{F}$-torsor (both under right multiplication), we must have $G\leq \tilde{G}$. Therefore, $G^t\leq \tilde{G}^t\leq H$ and $R/F$ is proto-Picard-Vessiot.
% Set $I=\bigcap_{g\in \tilde{G}(k)}g(\m')$. Then $I$ is the largest ideal of $R$ contained in $\m$ such that $g(I)=I$ for all $g\in G(k)$. The latter condition translates to $\rho(I)\subseteq I\otimes_k k[G]$, where $\rho\colon R\to R\otimes_k k[G]$ is the coaction (as in Lemma \ref{lemma: equivalence with coaction}).
%Let $Z$ and $\tilde{Z}$ be the algebraic subvariety of $\Gl_{n,k(x)}$ defined by $\m$ and $I$ respectively. As $I\subseteq \m$, we have $Z\subseteq \tilde{Z}$.
%Let $\m'$ be the maximal $\s$-ideal of $k(x)[X,\frac{1}{\det(X)}]$, whose ima ge in $R$ is $\m$.
%   J=\{f\in K[X,1/\det(X)] \mid \forall\,g\in \tilde{G}(k),\ f(\overline{Y}g)=0\}
%By Lemma 2.1 of [16], $J$ is generated by finitely many polynomials in $K[X]$ of total degree not greater than $\bfd(n)$, say $f_1,\dots,f_s$. Then
%  \Gl_n(\calF)\cap \bV(f_1,\dots,f_s)=\bar{\Y}\tilde{\G}(\calF)
%where $\calF$ is the field of fractions of $\tilde{\R}/\km$.
%Since $f_i(\bar{\Y})=0$, i.e. $f_i(\Y)\in \km$, by assumption, $f_i(\Y)=0$. As $\tilde{\R}$ is a differential $\G$-torsor, $f_i(\Y g)=0$ for all $g\in \G(k)$. Therefore $f_i(\bar{\Y}g)=0$ for all $g\in \G(k)$. This implies that $\bar{\Y} \G(\calF) \subset \bar{\Y}\tilde{\G}(\calF)$. In other words, $\G\subset \tilde{\G}$. So $\G^t\subset \H\subset \G$.
\end{proof}

\subsubsection{Specializations yielding proto-Picard-Vessiot rings}

Combining the criterion of Lemma \ref{LM:criterionforprotoPV} with the main result of Appendix A, we can now exhibit a large set of specializations that yield proto-Picard-Vessiot rings. We assume the setup of Notation \ref{notation: setup}.

%?? Suppose that $\R$ is generaically Picard-Vessiot. Then there is a nonzero $a\in \B$ such that for every $c\in \Z(\B,a)$, $\R_c$ is an integral domain.
%Enlarging $\B$ and replacing $f$ by a multiple of $f$ if necessary, we assume that $\B[x]_f[\Y,\frac{1}{\det(\Y)}]=\B[x]_f[u_1,\dots,u_s,v]$ where $u_1,\dots,u_s$ are algebraically independent over the field of fractions of $\B[x]$ and $v$ is algebraic over $\B[x]_f$, moreover if $P\in \B[x,z_1,\dots,z_s,y]$ is a polynomial irreducible over the field of fractions of $\B$ such that $P(x,u_1,\dots,u_s,v)=0$ then $P$ is absolutely irreducible. By the Bertini-Noether theorem (see for example Proposition 9.4.3 on page 170 of \cite{FriedJarden:FieldArithemtic}), there is a nonzero $a\in \B$ such that for every $c\in \Z(\B,a)$, $P^c$ is irreducible over $k$. Suppose that $c\in \Z(\B,a)$. Note that $P^c$ viewed as a polynomial over $k(x)$ is still irreducible. One can verify that
%$\R_c$ is isomorphic to $k(x)[z_1,\dots,z_s,y]/(P^c)$. So $\R_c$ is an integral domain.

\begin{prop}
\label{PROP:protoPV}
There exists an ad-open subset $\U$ of $\X(k)$ such that $R^c/k(x)$ is proto-Picard-Vessiot for all $c\in\X(k)$.
\end{prop}
\begin{proof}
By Lemma~\ref{lemma:domain}, there exists a nonempty Zariski open subset $\U_1$ of $\X(k)$ such that $R^c$ is an integral domain for every $c\in\U_1$.
As in Appendix A, for a differential field $F$, a Picard-Vessiot ring $R/F$ for $\de(y)=Ay$ with fundamental matrix $Y\in\Gl_n(R)$ and $m\in\nn$,  we consider the finite dimensional $F$-vector space
\algrel(Y,m,F)=\{h\in F[X]\mid h(Y)=0,\ \deg(h)\leq m\}.
%where $F$ is a fundamental matrix of $\delta(y)=By$ in some Picard-Vessiot ring over $K$.

Let $f_1,\dots,f_r\in K[x][X]$ be a $K(x)$-basis of $\algrel(Y^\gen,\bfd(n),K(x))$. Extending $\B$ if necessary (Remark \ref{rem: extend B}), we may assume that $f_1,\ldots,f_r\in \B[x][X]$.
As $f_i(\Y)=0$, also $f_i^c(Y^c)=(f_i(\Y))^c=0$ for $i=1,\ldots,r$ and all $c\in\X(k)$.

For $c\in \X(k)$ let $\m_c$ be a maximal $\de$-ideal of $R^c$ and let $\overline{Y^c}\in\Gl_n(R^c/\m_c)$ denote the image of $Y^c$ in $R^c/\m_c$. By Theorem~\ref{theo:basisunderspecialization} of Appendix A, there exists an ad-open subset $\U_2$ of $\X(k)$ such that $f_1^c,\dots,f_r^c$ is a $k(x)$-basis of $\algrel(\overline{Y^c},\bfd(n),k(x))$ for any $c\in\U_2$.
%where $\km_c$ is a maximal $\delta$-ideal of $\R_c$.

We will show that $R^c/k(x)$ is proto-Picard-Vessiot for any $c\in \U_1\cap\U_2$. Let $h\in k(x)[X]$ with $\deg(h)\leq \bfd(n)$ and $h(Y^c)\in\m_c$. According to Lemma \ref{LM:criterionforprotoPV}, it suffices to show that $h(Y^c)=0$.

As $h(\overline{Y^c})=0$, i.e., $h\in\algrel(\overline{Y^c},\bfd(n),k(x))$,  we have $h=\sum_{i=1}^r a_i f_i^c$ for appropriate $a_1,\ldots,a_r\in k(x)$.
%Fix $c\in \U$. Then $Y_c+\km_c$ is a fundamental matrix of $\delta(y)=A_c y$ in the Picard-Vessiot ring $\R_c/\km_c$. Now suppose that $g\in k(x)[X]$ with $\tdeg(g)\leq \bfd(n)$ such that $g(Y_c)\in \km_c$. Then $g(Y_c+\km_c)=0$, i.e. $g\in \calS(Y_c+\km_c,m,k(x))$. Thus there are $a_1,\dots,a_s\in k(x)$ such that $g=\sum_{i=1}^s a_i f_i^c$.
Therefore, $h(Y^c)=\sum_{i=1}^r a_i f_i^c(Y^c)=0$.
%The last equality holds because $f_i(Y_\gen)=0$ ?? need some sort of flatness to get from $f_i(Y_\gen)=0$ to $f_i(\Y)=0$. and thus $f_i^c(Y_c)=0$.
Thus, we can choose $\U$ as any ad-open subset of $\U_1\cap\U_2$.
\end{proof}

\subsection{Specializations of differential torsors: the toric part}
\label{subsec: Specializations of differential torsors: the toric part}

In the previous subsection we have seen that, in the context of Notation \ref{notation: setup}, there exists a large set of specializations $c$ such that $R^c/k(x)$ is proto-Picard-Vessiot. Our next goal is to make the step from proto-Picard-Vessiot to Picard-Vessiot. Roughly, this corresponds to the second main step of Hrushovski's algorithm, which is more or less the Compoint-Singer algorithm from \cite[Section 2.5]{CompointSinger:ComputingGaloisGroupsOfCompletelyReducibleDifferentialEquations}. We first develop a practical criterion to decide if a proto-Picard-Vessiot ring is Picard-Vessiot.

\subsubsection{A criterion for proto-Picard-Vessiot rings to be Picard-Vessiot}
\label{subsubsec: A criterion for proto-Picard-Vessiot rings to be Picard-Vessiot}

Throughout Section \ref{subsubsec: A criterion for proto-Picard-Vessiot rings to be Picard-Vessiot} we make the following assumptions:
\begin{itemize}
\item $F$ is a differential field of characteristic zero with $F^\de=k$ algebraically closed and of characteristic zero;
\item $G$ is a linear algebraic group over $k$;
\item $A\in F^{n\times n}$;
\item $R/K$ is a differential $G$-torsor for $\de(y)=Ay$ with fundamental matrix $Y\in \Gl_n(R)$ such that $R$ is an integral domain;
\item $E$ is the field compositum of $\overline{F}$ and the field of fractions of $R$ (inside the algebraic closure of the field of fractions of $R$). %??why not just use $\overline{L}$ throughout
\end{itemize}

Recall that $G^\circ$ denotes the identity component of the algebraic group $G$.

\begin{lemma} \label{lemma: Is G0 torsor}
Let $F'$ denote the relative algebraic closure of $F$ in $R$. Then $R/F'$ is a differential $G^\circ$-torsor for $\de(y)=Ay$.
\end{lemma}
\begin{proof}
As in \cite[Section 6.5]{Waterhouse:IntroductiontoAffineGroupSchemes}, for a $k'$-algebra $S$ over a field $k'$, let $\pi_0(S/k')$ denote the union of all \'{e}tale $k'$-subalgebras of $S$. In particular, $\pi_0(R/F)=F'$ and $\pi_0(k[G]/k)=k[G/G^\circ]$. In fact, the defining ideal $\I(G^\circ)\subseteq k[G]$ of $G^\circ$ is the ideal of $k[G]$ generated by $\ker(\varepsilon)\cap \pi_0(k[G]/k)$, where $\varepsilon\colon k[G]\to k$ is the counit (\cite[Section 6.7]{Waterhouse:IntroductiontoAffineGroupSchemes}).

We first show that $G^\circ$ acts on $R/F'$. I.e., we have to show that
\begin{equation} \label{eq: composition with rho}
R\xrightarrow{\rho} R\otimes_k k[G]\to R\otimes_k k[G^\circ]
\end{equation}
is the identity on $F'$. Since the functor $\pi_0$ is compatible with tensor products and base change (\cite[Section 6.5]{Waterhouse:IntroductiontoAffineGroupSchemes}) we have
\begin{align*}
\pi_0(R\otimes_k k[G]/F) & =\pi_0(R\otimes_F (k[G]\otimes_k F)/F)=\pi_0(R/F)\otimes_F \pi_0(k[G]\otimes_k F/F)= \\
& = F'\otimes_F(\pi_0(k[G]/k)\otimes_k F)=F'\otimes_k\pi_0(k[G]/k).
\end{align*}
%	Similarly, $\pi_0(R\otimes_k k[G^\circ]/K)=K'\otimes_k \pi_0(k[G^\circ]/k)=K'\otimes_k k=K'$.
Let $h\in F'$. Applying $\pi_0$ to $\rho$ yields a map $F'\to F'\otimes_k \pi_0(k[G]/k)$. Thus $\rho(h)$ can be written as $\rho(h)=\sum_{i=1}^mh_i\otimes f_i$ with $h_i\in F'$ and $f_i\in \pi_0(k[G]/k)$. Since $f_i-\varepsilon(f_i)$ lies in the kernel of $k[G]\to k[G^\circ]$, we see that the image of $\rho(h)=\sum_{i=1}^mh_i\otimes f_i$ in $R\otimes_k k[G^\circ]$
is $\sum_{i=1}^m h_i\otimes\varepsilon(f_i)=h\otimes 1\in R\otimes_k k[G^\circ]$. Thus $G^\circ$ acts on $R/F'$.

It now suffices to show that the induced map $R\otimes_{K'}R\to R\otimes_k k[G^\circ]$ is an isomorphism. We have a commutative diagram
\xymatrix{
R\otimes_FR \ar^-\simeq[r] \ar[d] & R\otimes_k k[G] \ar[d] \\
R\otimes_{F'} R \ar[r] & R\otimes_k k[G^\circ]
The kernel of the left vertical map is $(a\otimes 1-1\otimes a|\ a\in F')\subseteq R\otimes_F R$. The kernel of the right vertical map is $R\otimes_k \I(G^\circ)$, the ideal of $R\otimes_kk[G]$ generated by $\ker(\varepsilon)\cap \pi_0(k[G]/k)$. It suffices to show that these two kernels correspond to each other under the isomorphism.

The diagram
\xymatrix{
F'\otimes_F F' \ar^-{\simeq}[rr] \ar[rd] & & F'\otimes_k\pi_0(k[G]/k) \ar^-{\id\cdot \varepsilon}[ld] \\
& F'&
where the top isomorphism is obtained by applying $\pi_0$ to $R\otimes_F R\simeq R\otimes_k k[G]$, commutes. The kernel of the left map is $(a\otimes 1-1\otimes a|\ a\in F')\subseteq F'\otimes_F F'$. The kernel of the right map is $F'\otimes_k(\pi_0(k[G]/k)\cap \ker(\varepsilon))$. This implies the claim.
\end{proof}

\begin{cor} \label{cor: existence of h}
There exists an $h\in\Hom_{F}(R,\overline{F})$ such that $h(Y)^{-1}Y\in G^\circ(E)$.
\end{cor}
\begin{proof}
Let $F'$ denote the relative algebraic closure of $F$ in $R$. Set $Z=\spec(R)$ considered as a scheme over $F'$. As $R/F'$ is a $G^\circ$-torsor by Lemma \ref{lemma: Is G0 torsor}, the morphism
\begin{equation}
\label{eq: torsor isom}
Z\times_{F'} G^\circ_{F'}\to Z\times_{F'} Z, \ (z,g)\mapsto (z,zg)
\end{equation}
is an isomorphism. If we consider $Z$ and $G^\circ_{F'}$ as closed subschemes of $\Gl_{n,F'}$ via $Y$, the inverse of (\ref{eq: torsor isom}) is given by $(z_1,z_2)\mapsto (z_1,z_1^{-1}z_2)$. In particular, for any field extension $\widetilde{F}$ of $F'$ and $z_1,z_2\in Z(\widetilde{F})$, we have $z_1^{-1}z_2\in G^\circ(\widetilde{F})$.
Thus, any $h\in Z(\overline{F})=\Hom_{F'}(R,\overline{F})\subseteq \Hom_F(R,\overline{F})$ does the job.
\end{proof}

%Suppose that $G$ is an algebraic group over $k$, $A\in k(x)^{n\times n}$ and $R/k(x)$ is a differential $G$-torsor for $\delta(y)=Ay$. The comultiplication $\Delta$ induces an action of $G$ on $k[G]$.
%Then both $R\otimes_{k(x)} R$ and $R\otimes_k k[G]$ become $G$-module by acting $G$ on the second factors respectively. One sees that the map $\Phi: R\otimes_{k(x)} R \longrightarrow R\otimes_k k[G]$ given by $a\otimes b \mapsto (a\otimes 1)\rho(b)$ is a $G$-module isomorphism. If $R$ is an integral domain, then $G$ also naturally acts on $L$.
%Suppose that $G$ is an algebraic group over $k$, $A\in k(x)^{n\times n}$ and $R/k(x)$ is a differential $G$-torsor for $\delta(y)=Ay$. Let $H$ be a normal algebraic subgroup of $G$ containing $G^\circ$, the identity component of $G$. Then $L^H$ is the field of fractions of $R^H$.
%It suffices to show that each element of $L^H$ can be written as a quotient of two elements of $R^H$. Let $a\in L^{H}\setminus \{0\}$. Set $J=\{b\in R \mid ba\in R\}$. Then $J$ is stable under the action of $H$ because $h(a)=a$ for all $h\in H$. Let $u\in J\setminus \{0\}$. Write $u=Q(Y,\frac{1}{\det(Y)})$ where $Y$ is a fundamental matrix of $\delta(y)=Ay$ and $Q$ is a polynomial in $n^2+1$ variables. Since $h(u)=Q(Y[h],\frac{1}{\det([h])\det(Y)})$ for all $h\in H$, $\{h(u) \mid \forall h\in H\}$ generates a finite dimensional vector space over $k$. Let $u_1,\dots,u_s$ be a basis of this vector space and $w$ the Wronskian of $u_1,\dots,u_s$. Then $w\neq 0$ and by expanding the Wronskian with respect to the first low, one sees that $w\in J$. We have $h(w)=\chi(h)w$ for all $h\in H$. Actually, one can check that $h\mapsto \chi(h)$ defines a character of $H$.  If there is a nonzero $q\in R$ such that $h(q)=\frac{1}{\chi(h)}q$ for all $h\in H$. Then $qw\in R^{H}$. Since $qw\in J$, one has that $qwa\in R^{H}$. Consequently, $a$ belongs to the field of fractions of $R^{H}$. Therefore it remains to show that for each character $\chi$ of $H$, there is a nonzero $q_\chi \in R$ such that $h(q_\chi)=\chi(h)q_\chi$ for all $h\in H$.
%Now let $\chi$ be a character of $H$. We first show that there is a nonzero $b\in k[G]$ such that $h(b)=\chi(h)b$ for all $h\in H$. Suppose that $G=\cup_{i=1}^\ell  H_i$ where $H_1=H,\dots,H_\ell$ are all cosets by $H$ in $G$. Since $H$ is normal in $G$, $H$ naturally acts on $k[H_i]$ for all $i$. As $H_i\cap H_j=\emptyset$ for all $1\leq i \neq j \leq \ell$, the map
%         \phi: k[G] &\longrightarrow k[H_1]\oplus \dots \oplus k[H_\ell] \\
%                   f &\longmapsto (f|_{H_1},\dots, f|_{H_\ell})
%is  $k$-isomorphism and it is also an $H$-modules isomorphism. Now let $P\in k[H]\setminus\{0\}$ be such that $h(P)=\chi(h)P$ for all $h\in H$ and let $b=\phi^{-1}(P)$. Then $b$ is a nonzero element of $k[G]$ and $h(b)=\chi(h)b$ for all $h\in H$.  Denote by $u$ the preimage of $1\otimes b$ under the $G$-module isomorphism $\Phi: R\otimes_{k(x)} R \longrightarrow R\otimes_k k[G]$. Write $u=\sum_{i=1}^l u_i\otimes v_i$ where $u_1,\dots,u_l,v_1,\dots,v_l\in R\setminus\{0\}$ and $u_1,\dots,u_l$ are linearly independent over $k(x)$. From the equalities $h(b)=\chi(h)b$ for all $h\in H$, one sees that for all $h\in H$
%    \sum_{i=1}^l u_i\otimes h(v_i)=h(\Phi^{-1}(1\otimes b))=\Phi^{-1}(1\otimes h(b))=\Phi^{-1}(1\otimes \chi(h)b)= \sum_{i=1}^l u_i\otimes \chi(h)v_i.
%In other words, for all $i=1,\dots,l$ and $h\in H$, $h(v_i)=\chi(h)v_i$. Hence each $v_i$ has the deserved property.
%Suppose that $G$ is an algebraic group over $k$, $A\in k(x)^{n\times n}$ and $R/k(x)$ is a differential $G$-torsor for $\delta(y)=Ay$. Assume that $R$ is an integral domain and $K$ is the relative algebraic closure of $k(x)$ in $L$, the field of fractions of $R$. Then $K\subset R$.
%We first show that $R^G=k(x)$. Suppose that there is $a\in R$ satisfying that $g(a)=a$ for all $g\in G$. Write $\rho(a)=\sum_{i=1}^l a_i\otimes b_i$ where $a_i\in R, b_i\in k[G]$ and $a_1,\dots,a_l$ are linearly independent over $k$. Since $\Phi$ is a $G$-module isomorphism,
%    \sum_{i=1}^l a_i\otimes g(b_i)=g(\Phi(1\otimes a)=\Phi(1\otimes g(a))=\Phi(1\otimes a)= \sum_{i=1}^l a_i\otimes b_i.
%Hence $g(b_i)=b_i$ for all $g\in G$ and $i=1,\dots,l$. This implies that $b_i\in k$ for all $i=1,\dots,l$ and thus $\Phi(1\otimes a)=u\otimes 1$ where $u=\sum_{i=1}^l a_ib_i$. On the other hand, since $\Phi$ is injective, $1\otimes a=u\otimes 1$. This can only happen in the case $a\in k(x)$. So $R^G=k(x)$.  Now by Lemma~\ref{LM:invariants}, $L^G=R^G=k(x)$.
%Since $L$ is finitely generated over $k(x)$ and $K$ is algebraic over $k(x)$, $K=k(x)(\alpha)$ for some $\alpha\in K$. Let $\alpha_1=\alpha,\dots,\alpha_s$ be all elements in $K$ which are conjugate to $\alpha$. Then $G$ acts on $\{\alpha_1,\dots,\alpha_s\}$.
%Set $H=\{h\in G\mid h(\alpha)=\alpha\}$. Then $H$ is an algebraic subgroup of $G$. One sees that $[G:H]\leq s$. This together with $L^G=k(x)$ implies that $L^H$ is algebraic over $k(x)$. Hence $L^H=K$. Furthermore we have that $H$ is normal in $G$. To see this, note that $h(a)=a$ for all $h\in H$ and $a\in K$. Suppose that $g\in G, h\in H$. Then $g(\alpha)\in K$ and thus $h(g(\alpha))=g(\alpha)$. This implies that $g^{-1}hg(\alpha)=\alpha$ and therefore $g^{-1}hg\in H$. As $[G:H]\leq s$, every element of $R^H$ is algebraic over $k(x)$ and it is generated over $k(x)$ by finitely many elements of $R$  as a $k(x)$-algebra. Thus $R^H$ is a field. By Lemma~\ref{LM:invariants}, $K=L^H=R^H$. Consequently, $K\subset R$.
%Suppose that $G$ is an algebraic group over $k$, $A\in k(x)^{n\times n}$ and $R/k(x)$ is a differential $G$-torsor for $\delta(y)=Ay$. Assume that $R$ is an integral domain and $K$ is the relative algebraic closure of $k(x)$ in $R$. Then $R/K$ is a differential $G^\circ$-torsor for $\delta(y)=Ay$.
%By Lemma~\ref{LM:basefields}, the relative algebraic closure $\tilde{K}$ of $k(x)$ in $L$ is contained in $R$, where $L$ is the field of fractions of $R$. From this, one has that $K=\tilde{K}$ . As in the proof of Lemma~\ref{LM:basefields}, let $H$ be the subgroup of $G$ which keeps every element of $K$ fixed. Then $H$ is an algebraic subgroup of $G$. We claim that $R/K$ is a differential $H$-torsor for $\delta(y)=Ay$. It suffices to show that $R/K$ is an $H$-torsor. Since $H$ acts on $R/K$, there is a homomorphism $\bar{\Phi}: R\otimes_K R\longrightarrow R\otimes_k k[H]$. Moreover we have the following commutative diagram
%   \xymatrix{
%R\otimes_{k(x)} R \ar^-\Phi[r] \ar_-{\id \otimes_K \id} [d] & R\otimes_k k[G] \ar^-{\id \otimes_k \cdot|_H }[d] \\
%R\otimes_K R \ar^-{\bar{\Phi}}[r] & R\otimes_k k[H]
%	}
%where $\cdot |_H$ is the restriction of a function on $H$.
%Since $\Phi$ is isomorphic, $\bar{\Phi}$ is surjective. To prove that $\bar{\Phi}$ is injective, it suffices to show that $\Phi^{-1}(\ker(\id \otimes_k \cdot|_H))\subset \ker(\id \otimes_K \id)$.  Note that $\ker(\id \otimes_k \cdot|_H)$ is generated by elements of the form $1\otimes_k f$ with $f(h)=0$ for all $h\in H$. One only needs to show that $\Phi^{-1}(1\otimes_k f)=f(Y^{-1}\otimes_{k(x)} Y)\in \ker(\id \otimes_K \id)$, where $Y$ is a fundamental matrix of $\delta(y)=Ay$. Suppose that $z_1,z_2\in \Hom_K(R,\overline{K})$. There is the unique $g\in G$ such that $z_2=z_1\cdot g$, i.e. $z_2(a)=z_1(g(a))$ for all $a\in R$. One sees that $f(Y^{-1}\otimes_K Y)$ takes the value $f(g)$ at $(z_1,z_2)$. As $z_1,z_2$ are $K$-homomorphism, $g(a)=a$ for all $a\in K$ and thus $g\in H$. This implies that $f(Y^{-1}\otimes_K Y)$ takes the value $0$ at all $(z_1,z_2)$. Hence $f(Y^{-1}\otimes_K Y)=0$, i.e. $f(Y^{-1}\otimes_{k(x)} Y)\in \ker(\id \otimes_K \id)$. Therefore $\bar{\Phi}$ is isomorphic.
%Since $K$ is algebraically closed in $L$, $R\otimes_K R$ is an integral domain by Proposition 2 on page 141 of \cite{Bourbaki:Algebra2} and so is $R\otimes_k k[H]$. This implies that $k[H]$ is an integral domain and thus $H$ is irreducible. On the other hand, from the proof of Lemma~\ref{LM:basefields}, $[G:H]$ is finite. Hence $H=G^\circ$ and thus $R/K$ is a differential $G^\circ$-torsor for $\delta(y)=Ay$.

We denote with $I_n$ the $n\times n$-identity matrix.

\begin{lemma}
\label{LM:characters}
Let $\chi$ be a character of $G^\circ$ and let $h\in \Hom_F(R,\overline{F})$ be such that $h(Y)^{-1}Y\in G^\circ(E)$. Then, for $g=h(Y)\in \Gl_n(\overline{F})$ we have
\delta(\chi(g^{-1}Y))=\left(\sum_{i,j=1}^n\frac{\partial \chi}{\partial X_{ij}}(I_n)(\delta(g^{-1})g+g^{-1}Ag)_{ij}\right)\chi(g^{-1}Y).
\end{lemma}
\begin{proof}
We will work with the ring $E[\varepsilon]$ of dual numbers, i.e., $\varepsilon^2=0$. For $a\in F[X,\frac{1}{\det(X)}]$ and $B,C\in \Gl_n(E)$ we then have $a(B+\varepsilon C)=a(B)+\varepsilon\sum_{i,j=1}^n\frac{\partial a}{\partial X_{ij}}(B)C_{ij}$. Therefore
\begin{equation}
\label{eq: dual numbers}
a(B+\varepsilon\de(B))=a(B)+\varepsilon\sum_{i,j=1}^n\frac{\partial a}{\partial X_{ij}}(B)\de(B_{ij})=a(B)+\varepsilon(\de(a(B)).
\end{equation}

For $Y'=g^{-1}Y\in\Gl_n(E)$ and $A'=\de(g^{-1})g+g^{-1}Ag\in \overline{F}^{n\times n}$ we have $\de(Y')=A'Y'$.
As $Y'\in G^\circ(E)$ it follows from (\ref{eq: dual numbers}) that $Y'+\varepsilon\de(Y')\in G^\circ(E[\varepsilon])$. We have

On the other hand,
$$ \chi(Y'+\varepsilon\de(Y'))\chi(Y'^{-1})=\chi((Y'+\varepsilon\de(Y'))Y'^{-1})=\chi(I_n+\varepsilon A')=I_n+\sum_{i,j=1}^n\frac{\partial \chi}{\partial X_{ij}}(I_n)A'_{ij}.$$
$$\de(\chi(Y'))=\left(\sum_{i,j=1}^n\frac{\partial \chi}{\partial X_{ij}}(I_n)A'_{ij}\right) \chi(Y')$$
as claimed.
%We first claim that $$1+\epsilon(\delta(g^{-1})g+g^{-1}Ag)\in \G^\circ(\overline{K}[\epsilon])$$
%where $\epsilon^2=0$. Write $k[\G^\circ]=k[X,1/\det(X)]/\km$. Suppose that $f\in \km$. Then $f(g^{-1}\Y)=0$ and thus
%    0=\delta(f(g^{-1}\Y))=\sum_{i,j} \frac{\partial f}{ \partial X_{ij}}(g^{-1}\Y) (\delta(g^{-1})\Y+g^{-1}A\Y)_{ij}.
%On the other hand, one has that
%   f(g^{-1}\Y+\epsilon(\delta(g^{-1})\Y+g^{-1}A\Y))=f(g^{-1}\Y)+\epsilon\sum_{ij}\frac{\partial f}{\partial X_{ij}}(g^{-1}\Y)(\delta(g^{-1})\Y+g^{-1}A\Y)_{ij}=0.
%Hence $g^{-1}\Y+\epsilon(\delta(g^{-1})\Y+g^{-1}A\Y)\in \G^\circ(\calF(\overline{K})[\epsilon])$.
%This implies that $1+\epsilon (\delta(g^{-1})g+g^{-1}Ag)\in \G^\circ(\overline{K}[\epsilon])$. Now a simple calculation yields
%   \chi(\Y^{-1}g)\chi(g^{-1}\Y+\epsilon(\delta(g^{-1})\Y+g^{-1}A\Y))=1+\epsilon \delta(\chi(g^{-1}\Y))\chi(\Y^{-1}g).
%On the other hand, one sees that
%  \chi(\Y^{-1}g)\chi(g^{-1}\Y+\epsilon(\delta(g^{-1})\Y+g^{-1}A\Y))&=\chi(1+\epsilon(\delta(g^{-1})g+g^{-1}Ag))\\
%  &=1+\epsilon\sum_{i,j}\frac{\partial \chi}{\partial X_{ij}}(1)(\delta(g^{-1})g+g^{-1}Ag).
%The later equality together with (\ref{EQ:eqn1}) concludes the lemma.
\end{proof}

The proof of Lemma \ref{LM:characters} shows that $\sum_{i,j=1}^n\frac{\partial \chi}{\partial X_{ij}}(I_n)(\delta(g^{-1})g+g^{-1}Ag)_{ij}\in \overline{F}$ does not depend on the lift of $\chi\in k[G^\circ]$ to an element of $k[X,\frac{1}{\det(X)}]$.

Our criterion that characterizes Picard-Vessiot rings among proto-Picard-Vessiot rings is based on the concept of \emph{logarithmic independence} that we now define.

\begin{defi} \label{defi: logarithmically independent}
Elements $f_1,\dots,f_s$ of a differential field $F$ are \emph{logarithmically independent} (over $F$) if $\sum_{i=1}^s d_i f_i =\delta(a)/a$ for $d_1,\ldots,d_s\in\mathbb{Z}$ and $a\in F^\times$ implies $d_1=\dots=d_s=0$.
\end{defi}

The significance of the above definition is the following. Let $y_1,\ldots,y_m$ be nonzero elements of some $\de$-field extension of $F$ with no new constants such that $\de(y_i)=f_i y_i$ for $i=1,\ldots,s$. By the Kolchin-Ostrowski theorem ([25]), if $y_1,\ldots,y_s$ are algebraically dependent over $F$, then there exist $d_1,\ldots,d_s\in\mathbb{Z}$ not all equal to zero such that $y_1^{d_1}\ldots y_s^{d_s}=a\in F$.
Applying the logarithmic derivative $y\mapsto \frac{\de(y)}{y}$ to this equation yields  $\sum_{i=1}^s d_i f_i =\delta(a)/a$.

On the other hand, if $\sum_{i=1}^s d_i f_i =\delta(a)/a$ holds, the logarithmic derivative of $\frac{y_1^{d_1}\ldots y_s^{d_s}}{a}$ is zero. So $\frac{y_1^{d_1}\ldots y_s^{d_s}}{a}$ is a constant $c$ and $y_1^{d_1}\ldots y_s^{d_s}=ac\in F$. In summary, we see that $y_1,\ldots,y_s$ are algebraically independent over $F$ if and only if $f_1,\ldots,f_s$ are logarithmically independent.

Note that if $F\subseteq F'$ is an inclusion of differential fields, then $f_1,\ldots,f_s\in F$ may be logarithmically independent over $F$ but logarithmically dependent over $F'$. However, from the above discussion we deduce the following.

\begin{rem} \label{rem: logarithmic independence preserved under algebraic extension}
If $F'/F$ is an algebraic extension of differential fields and $f_1,\ldots,f_s\in F$, then $f_1,\ldots,f_s$ are logarithmically independent over $F$ if and only if $f_1,\ldots,f_s$ are logarithmically independent over $F'$.
\end{rem}
%Note that Definition \ref{defi: logarithmically independent} depends on the choice of $K$. That is, if $K\subseteq L$ is an inclusion of differential fields, then $f_1,\ldots,f_m\in \overline{K}$ might be logarithmically independent while $f_1,\ldots,f_m\in\overline{L}$ are logarithmically dependent.

The following lemma provides a criterion to test if a proto-Picard-Vessiot ring is Picard-Vessiot. We denote with $X(G^\circ)$ the group of characters of $G^\circ$.

\begin{lemma}\label{LM:criterion}
Assume that $R/F$ is proto-Picard-Vessiot and $R$ is an integral domain.
%Suppose that $\tilde{\R}=K[\Y,\frac{1}{\det(\Y)}]$ is a differential $\G$-torsor for $\delta(y)=Ay$ and it is proto-Picard-Vessiot.
Let $\chi_1,\dots,\chi_s$ be a basis of $X(G^\circ)$ as a free abelian group and let $h \in\Hom_F(R,\overline{F})$ be such that $h(Y)^{-1}Y\in G^\circ(E)$. For $g=h(Y)$ and $l=1,\dots,s$ set
f_l=\sum_{i,j=1}^n\frac{\partial \chi_l}{\partial X_{ij}}(I_n)(\delta(g^{-1})g+g^{-1}Ag)_{ij}\in \overline{F}.
Then $R/F$ is Picard-Vessiot if and only if $f_1,\dots,f_s$ are logarithmically independent over $\overline{F}$.
\end{lemma}
\begin{proof}
We first assume that $f_1,\dots,f_s$ are logarithmically independent over $\overline{F}$. Suppose $R/F$ is not Picard-Vessiot, i.e., $R$ is not $\delta$-simple. Let $\km$ be a maximal $\delta$-ideal of $R$ and let $H$ be the differential Galois group of $R/\km$. As $\km$ is a nonzero prime ideal of $R$ and $R$ is an integral domain $\dim(R/\km)<\dim(R)$. Thus also $\dim(H)<\dim(G)$.

We have $G^t\leq H\leq G$ since $R$ is proto-Picard-Vessiot. As the identity component $G^\circ/G^t$ of $G/G^t$ is a torus and $H^\circ/G^t$ is a proper subgroup of $G^\circ/G^t$, there exists a nontrivial character of $G^\circ/G^t$ that is trivial on $H^\circ/G^t$,
%i.e.  By Lemma 4.1 of [2] and  Proposition 2.6 of [17],
i.e., there exists a nontrivial character $\chi$ of $G^\circ$ such that $H^\circ\subseteq \ker(\chi)$.

%Note that $\H$ is the Galois group of $\tilde{\R}/\km$ over $K$.
Let $L$ be the field of fractions of $R/\km$ and let $E'=L\overline{F}$ be the field compositum of $L$ and $\overline{F}$ (inside $\overline{L}$). Since $L/F$ is a Picard-Vessiot extension with differential Galois group $H$, we know that $E'/\overline{F}$ is a Picard-Vessiot extension with differential Galois group $H^\circ$.
%	 $\tilde{\calF}(\overline{K})$ the Picard-Vessiont extension of $\overline{K}$ for $\delta(y)=Ay$. Then $\H^\circ$ is the Galois group of $\tilde{\calF}(\overline{K})$ over $\overline{K}$.

Let $\overline{Y}\in\Gl_n(R/\m)$ denote the image of $Y\in\Gl_n(R)$ in $R/\m$ and set $Y'=g^{-1}\overline{Y}\in G^\circ(E')$.
For every $\sigma\in H^\circ(k)$ we can write $\sigma(Y')=Y'[\sigma]$ for some $[\sigma]\in \Gl_n(k)$. Then
for every $\sigma\in H^\circ(k)$.
Thus $\chi(Y')=a\in \overline{F}\setminus\{0\}$ by the differential Galois correspondence. Write $\chi=\prod_{i=1}^s \chi_i^{d_i}$ with $d_i\in \bZ$. Then not all $d_i$ are zero, because $\chi$ is nontrivial. Using Lemma \ref{LM:characters} we find
\frac{\de(a)}{a}=\frac{\delta(\chi(Y'))}{\chi(Y')}=\sum_{i=1}^s d_i\frac{\delta(\chi_i(Y'))}{\chi_i(Y')}=\sum_{i=1}^s d_i f_i
Thus $f_1,\dots,f_s$ are logarithmically dependent; a contradiction.

Conversely, assume that $R/F$ is Picard-Vessiot. Then $G$ is the differential Galois group of $R/F$ and $E/\overline{F}$ is a Picard-Vessiot extension with differential Galois group $G^\circ$. Suppose
$f_1,\dots,f_s$ are logarithmically dependent, i.e., there are $d_1,\dots,d_s\in \bZ$ not all zero and $a\in \overline{F}\setminus \{0\}$ such that $\sum_{i=1}^s d_if_i=\delta(a)/a$. Write $\chi=\prod_{i=1}^s \chi_i^{d_i}$. Then $\chi$ is a nontrivial character of $G^\circ$.
For $Y'=g^{-1}Y$, using Lemma \ref{LM:characters}, we obtain
$$\frac{\delta(\chi(Y'))}{\chi(Y')}=\sum_{i=1}^s d_i\frac{\delta(\chi_i(Y'))}{\chi_i(Y')}=\sum_{i=1}^s d_i f_i=\frac{\de(a)}{a}.$$
Thus $\de(\frac{\chi(Y')}{a})=0$, i.e., $\frac{\chi(Y')}{a}=c\in k$. So $\chi(Y')=ca\in \overline{F}$.

%  A simple calculation implies that
% $$
%     \frac{\delta(\chi(g^{-1}\Y))}{\chi(g^{-1}\Y)}-\frac{\delta(f)}{f}=\frac{\delta(\chi(g^{-1}\Y)/f)}{\chi(g^{-1}\Y)/g}=0.
% $$
% Suppose that $\tilde{\R}$ is $\delta$-simple. Then $\tilde{\R}$ is Picard-Vessiot and $\G$ is its Galois group. Note that $\tilde{\calF}(\overline{K})$ is the Picard-Vessiot extension of $\overline{K}$ for $\delta(y)=Ay$ whose Galois group equals $\G^\circ$, where $\tilde{\calF}$ is the field of fractions of $\tilde{\R}$.
%So $\chi(g^{-1}\Y)-cf=0$ for some nonzero $c\in k$.

For every $\sigma\in G^\circ(k)$ we can write $\sigma(Y')=Y'[\sigma]$ for some $[\sigma]\in \Gl_n(k)$. Then
for all $\sigma\in G^\circ(k)$. This implies that $\chi$ is trivial; a contradiction.
\end{proof}

Note that in case $X(G^\circ)$ is trivial, Lemma \ref{LM:criterion} asserts that a proto-Picard-Vessiot ring is automatically Picard-Vessiot.

\begin{rem} \label{rem: C1}
If $F=k(x)$ and $R/F$ is Picard-Vessiot with connected differential Galois group $G$, then the $h\in\Hom_F(R,\overline{F})$ in Lemma \ref{LM:criterion} can be chosen such that $g=h(Y)\in \Gl_n(F)$ and therefore also $f_1,\ldots,f_s\in F$.
\end{rem}
\begin{proof}
By Tsen's theorem the field $F=k(x)$ is a $C_1$-field and so by Steinberg's theorem every torsor for a connected linear algebraic group over $F$ is trivial (\cite[Chapter III, Section 2.3]{Serre:GaloisCohomology}). As $R$ defines a torsor for $G_F$, we see that there exists a morphisms $h\in\Hom_F(R,F)$. Because $G$ is connected, the differential Galois correspondence implies that the relative algebraic closure of $F'$ of $F$ in $R$ is equal to $F$. So the proof of Corollary~\ref{cor: existence of h} shows that $h$ has the desired property $h(Y)^{-1}Y\in G^\circ(E)=G(E)$.
\end{proof}

The following example illustrates Lemma \ref{LM:criterion}

\begin{ex} \label{ex: elements for logarithmic test}
Let $a,b\in F$ such that $a\in F^\times $ is not a square in $F$. Then $F(\eta)=F[y]/(y^2-a)$ is a differential field extension of $F$.
As in Example \ref{ex: torsor for monomial matrices} we set $$R=F(\eta)[y_1,y_2,y_1^{-1},y_2^{-1}]=F[X,\tfrac{1}{\det(X)}]/(P_1,P_2)=F[Y,\tfrac{1}{\det(Y)}],$$
where $\de(y_1)=(b+\eta)y_1$, $\de(y_2)=(b-\eta)y_2$,
P_1=X_{21}X_{22}-(b^2-a)X_{11}X_{12}, \quad  \quad  P_2=X_{21}X_{12}+X_{22}X_{11}-2bX_{11}X_{12,} $$

$$A=\begin{pmatrix}  0 & 1 \\ a+\de(b)-b^2-\frac{\delta(a)b}{2a} & 2b+\frac{\delta(a)}{2a}\end{pmatrix}\in F^{2\times 2},$$
and $\de(X)=AX$. Then $R$ is an integral domain and $R/F$ is a differential $G$-torsor for $\de(y)=A y$, where $G\leq\Gl_{2,k}$ is the group of $2\times 2$ monomial matrices (as seen in Example~\ref{ex: torsor for monomial matrices}). As $G^t=1$, it is clear that $R/F$ is proto-Picard Vessiot.

The algebraic group $G^\circ$ is the diagonal torus in $\Gl_{2,k}$ and so a basis $\chi_1,\chi_2$ of $X(G^\circ)$ is represented by $X_{11}$ and $X_{22}$.
%Let $\chi_1,\chi_2$ be a basis of $X(G^\circ)$. Then $\chi_1,\chi_2$ can be represented by $X_{11},X_{22}$ respectively.
g=\begin{pmatrix} 1 & 1 \\ b+\eta & b-\eta \end{pmatrix}\in\Gl_2(F(\eta)).
Then $P_1(g)=P_2(g)=0$ and so $g$ defines a morphism $h\colon R\to \overline{F},\ Y\mapsto g$ of $F$-algebras.

As $g\begin{pmatrix}
y_1 & 0 \\
0 & y_2
\end{pmatrix}=Y$, we see that $h(Y)^{-1}Y=g^{-1}Y\in G^\circ(E)$. We have

\begin{equation} \label{eq: systems}
\de\begin{pmatrix}
y_1 & 0 \\
0 & y_2
\end{pmatrix}=\begin{pmatrix}
b+\eta & 0 \\
0 & b-\eta
\end{pmatrix}\begin{pmatrix}
y_1 & 0 \\
0 & y_2
\end{pmatrix} \text{ and } \de(Y)=AY.
\end{equation}
Because  $g\begin{pmatrix}
y_1 & 0 \\
0 & y_2
\end{pmatrix}=Y$, the matrices defining the differential equations in (\ref{eq: systems}) are related via the Gauge transformation defined by $g$, i.e.,
b+\eta & 0 \\
0 & b-\eta
\end{pmatrix}$.
%	Then have that $\beta^{-1}\bar{X}\in G^\circ(M)$ where $M$ is as in Corollary\ref{cor: existence of h} and $\bar{X}$ is the image of $X$ in $R$, and
\begin{align*}
f_1=&\sum_{i,j=1}^2 \frac{\partial \chi_1}{\partial X_{ij}}(I_2)(\delta(g^{-1})g+g^{-1}A g)_{ij}=b+\eta \quad \text{ and }\\
f_2=&\sum_{i,j=1}^2 \frac{\partial \chi_2}{\partial X_{ij}}(I_2)(\delta(g^{-1})g+g^{-1}A g)_{ij}=b-\eta.
\end{align*}
So Lemma \ref{LM:criterion} shows that $R/F$ is Picard-Vessiot if and only if $b+\eta$ and $b-\eta$ are logarithmically indepenendet over $F(\eta)$.
\end{ex}

\subsubsection{Specializations yielding Picard-Vessiot rings}
%?? The letter M is used for two things, field of fractions of $\B$ and field compositum of $\overline{k(x)}$ and field of fractions of $R^c$. Use $k(\B)$ for field of fractions of $\B$??

We are now prepared to prove our main specialization result. A key ingredient for the proof is the main result of Appendix B, stating that logarithmic independence of algebraic functions is preserved under many specializations. We assume the setup of Notation \ref{notation: setup}.

%Set $\tilde{\R}=\R\otimes_{\B[x]_f} k_0(x)$.

%Suppose that $\tilde{\R}$ is Picard-Vessiot and $\G$ is the Galois group of $\tilde{R}$ over $k_0(x)$.

\begin{theo} \label{theo: main specialization}
%Let $\B$ be a finitely generated $k$-algebra that is an integral domain and let $\G$ be an affine group scheme of finite type over $\B$. Set $\X=\spec(\B)$ and let $\mathcal{A}\in\B	[x]_f^{n\times n}$, where $f\in \B[x]$ is a monic polynomial. Let $\R/\B[x]_f$ be a differential $\G$-torsor for $\de(y)=\mathcal{A}y$.
There exists an ad$\times$Jac-open subset $\U$ of $\X(k)$ such that $R^c/k(x)$ is Picard-Vessiot for all $c\in\U$. In particular, the set of all $c\in \X(k)$ such that $R^c/k(x)$ is Picard-Vessiot, is Zariski dense in $\X(k)$.
\end{theo}
\begin{proof}
Extending $\B$ if necessary (Remark \ref{rem: extend B}), we can assume that the morphism $\G\to \Gl_{n,\B}$ defined by $\Y$ is a closed embedding (Lemma \ref{lemma: closed embedding}). We can thus consider $\G$ as a closed subgroup of $\Gl_{n,\B}$. Note that the equations defining $\G$ as a closed subgroup of $\Gl_{n,\B}$, also define $G^\gen$ as a closed subgroup of $\Gl_{n,K}$. Let $P_1,\ldots,P_m\in K[X,\frac{1}{\det(X)}]$ be such that $\I((G^\gen)^\circ)=(P_1,\ldots,P_m)$, where $\I((G^\gen)^\circ)\subseteq K[X,\frac{1}{\det(X)}]$ is the defining ideal of $(G^\gen)^\circ$.

Let $\{\chi_1,\dots,\chi_s\}$ be a basis of $X((G^\gen)^\circ)$ and let $Q_1,\ldots,Q_s\in K[X,\frac{1}{\det(X)}]$ be such that the image of $Q_i$ in $K[X,\frac{1}{\det(X)}]/\I((G^\gen)^\circ)=K[(G^\gen)^\circ]$ agrees with $\chi_i$ for $i=1,\ldots,s$.

Let $h\in \Hom_{K(x)}(R^\gen, \overline{K(x)})$ be such that $h(Y^\gen)^{-1}Y^\gen\in (G^\gen)^\circ(E)$, where $E$ is the field compositum of $\overline{K(x)}$ and the field of fractions of $R^\gen$ (inside the algebraic closure of the field of fractions of $R^\gen$). (Such an $h$ exists by Lemma \ref{lemma: generic} and Corollary \ref{cor: existence of h}.)

Let $\eta\in \overline{K(x)}$ be such that $g=h(Y^\gen)\in \Gl_n(\overline{K(x)})$ has coefficients in $K(x)[\eta]=K(x,\eta)$. Replacing $\eta$ with a $K(x)$-multiple of $\eta$ if necessary, we can assume that the minimal polynomial $P\in K(x)[y]$ of $\eta$ over $K(x)$ has coefficients in $K[x]$.

%	 Let $P(x,z)$ be an irreducible polynomial over $\K$ such that $P(x,\eta)=0$. (So, up to multiplication with an element of $\K(x)$, $P$ is the minimal polynomial of $\eta$ over $\K(x)$.)

%	For suitable $c\in \X(k)$, we shall construct a $k(x)$-homomorphism $h^c$ from $R^c$ to $\overline{k(x)}$ via $h$ such that $h^c(Y^c)^{-1}Y^c\in (G^c)^\circ(M^c)$, where $M^c$ is the field compositum of $\overline{k(x)}$ and the field of fractions of $R^c$.

Extending $\B$ and replacing $f$ by a multiple of $f$ if necessary (Remark \ref{rem: extend B}), we may assume that
\begin{itemize}
\item  the coefficients of $P,P_1,\ldots,P_m,Q_1,\ldots,Q_s$ are all in $\B$,
\item $\delta(\eta)\in \B[x]_f[\eta]$, so that $\B[x]_f[\eta]$ is a differential subring of $K(x,\eta)$ and
\item $g,g^{-1},\delta(g^{-1})\in \B[x]_f[\eta]^{n\times n}$.
\end{itemize}

By \cite[Prop. 3.5]{Feng:DifferenceGaloisGrousUnderSpecialization}, there exists a nonempty Zariski open subset $\U_1$ of $\X(k)$ such that for every $c\in\U_1$ the subvariety of $\Gl_{n,k}$ defined by $P_1^c,\ldots,P_m^c$ agrees with $(G^c)^\circ$ and the images $\chi_1^c,\ldots,\chi_s^c$ of $Q_1^c,\ldots,Q_s^c$ in $k[(G^c)^\circ]$ are a basis of $X((G^c)^\circ)$.

\medskip

Our next goal is to construct, using $h$, elements $h^c\in \Hom_{k(x)}(R^c,\overline{k(x)})$ such that $h^c(Y^c)^{-1}Y^c\in (G^c)^\circ(E^c)$, where $E^c$ is the field compositum of $\overline{k(x)}$ and the field of fractions of $R^c$. We know that $P_i(h(Y^\gen)^{-1}Y^\gen)=0$ for $i=1,\ldots,m$. However, to specialize these equations, we first need to discuss extensions of $c\colon \R\to R^c,\ r\mapsto r^c$.

Recall (Lemma \ref{lemma: injective}) that we may regard $\R$ as a $\de$-subring of $R^\gen$. So $\R[\eta]$ makes sense, say as $\de$-subring of $E$. As noted in Lemma \ref{lemma:domain}, there exists a nonempty Zariski open subset $\U_2$ of $\U_1$ such that $R^c$ is an integral domain. For $c\in \U_2$, let $E^c$ be the field compositum of $\overline{k(x)}$ and the field of fractions of $R^c$.

We claim that there exists a nonempty Zariski open subset $\U_3$ of $\U_2$ such that for every $c\in \U_3$, the morphism $c\colon \R\to R^c$ of differential rings extends to a morphism $c\colon \R[\eta]\to \overline{E^c}$ of rings.

Applying \cite[Cor. 3, Chapter V, \S 3.1]{Bourbaki:commutativealgebra} to the inclusion $\R\subseteq \R[\eta]$, shows that there exists a nonzero element $r\in \R$ such that every (ring) morphism $c\colon \R\to M$ into some algebraically closed field $M$ with $c(r)\neq 0$, extends to a morphism $c\colon \R[\eta]\to M$. By Lemma \ref{lemma: nonzero extends}, there exists a nonempty Zariski open subset $\U_3$ of $\U_2$ such that $r^c\neq 0$ for all $c\in \U_3$. Thus, for every $c\in \U_3$ the morphism $c\colon \R\to R^c$ extends to a morphism of rings $c\colon \R[\eta]\to \overline{E^c}$.

As $P\in\B[x,y]$ is irreducible in $K(x)[y]$ and monic in $y$, it follows from Gauss's lemma that $P$ is irreducible in $K[x,y]$. By the Bertini-Noether theorem (\cite[Prop.~9.4.3]{FriedJarden:FieldArithmetic}), there exits a nonempty Zariski open subset $\U_4$ of $\U_3$ such that $P^c(x,y)$ is irreducible in $k[x,y]$, and hence also irreducible in $k(x)[y]$, for any $c\in \U_4$. So, for $c\in \U_4$, the ring $\B[x]_f[\eta]\otimes_{\B[x]_f}k(x)=k(x)[y]/(P^c)$ is a field, in fact, a finite field extension of $k(x)$.

Now, for every $c\in \U_4$, let us fix an extension $c\colon \R[\eta]\to \overline{E^c}$ of $c\colon \R\to R^c$. As $\B[x]_f[\eta]\subseteq \R[\eta]$, we obtain from $c\colon \R[\eta]\to \overline{E^c}$ an induced morphism $\B[x]_f[\eta]\otimes_{\B[x]_f}k(x)\to \overline{E^c}$. As $\B[x]_f[\eta]\otimes_{\B[x]_f}k(x)$ is a finite field extension of $k(x)$, this in fact defines an embedding $\psi_c\colon\B[x]_f[\eta]\otimes_{\B[x]_f}k(x)\to \overline{k(x)}\subseteq \overline{E^c}$.

% and thus can be embedded into $\overline{k(x)}$.
The composition
$$ \R\to R^\gen\xrightarrow{h}\overline{K(x)},\ \Y\mapsto h(Y^\gen)$$
can be regarded as a morphism $ \R\to \B[x]_f[\eta]$ of $\B[x]_f$-algebras. Its base change via $c\colon \B[x]_f\to k(x)$ (for $c\in\U_4$) can be composed with the embedding $\psi_c\colon \B[x]_f[\eta]\otimes_{\B[x]_f}k(x)\hookrightarrow \overline{k(x)}$ to yield a morphism $h^c\colon R^c\to \overline{k(x)}$ of $k(x)$-algebras.

\medskip

We claim that $h^c(Y^c)^{-1}Y^c\in (G^c)^\circ(E^c)$ for all $c\in\U_4$.
As $(G^c)^\circ\leq \Gl_{n,k}$ is defined by $P_1^c,\ldots,P_m^c$, it suffices to see that $P_i^c(h^c(Y^c)^{-1}Y^c)=0$ for $i=1,\ldots,m$.

Note that $g=h(Y^\gen)\in(\B[x]_f[\eta])^{n\times n}$ and $c(h(Y^\gen))=h^c(Y^c)$ by construction.
Moreover $h(Y^\gen)^{-1}\in (\B[x]_f[\eta])^{n\times n}$ and $Y^\gen\in\R$, so that $h(Y^\gen)^{-1}Y^\gen\in\R[\eta]$. We can thus apply $c\colon \R[\eta]\to \overline{E^c}$ to  $P_i(h(Y^\gen)^{-1}Y^\gen)=0$. This yields
for $i=1,\ldots,m$. Thus $h^c(Y^c)^{-1}Y^c\in (G^c)^\circ(E^c)$ as desired.

%	\begin{align*}
%	h_c: \R_c &\longrightarrow \B[x]_f[\eta]\otimes_{\B[x]_f}k(x) \subset \overline{k(x)} \\
%	Y_c=\Y \otimes 1 &\longmapsto h(\Y)\otimes 1=g\otimes 1
%	\end{align*}

%Assume that $\{\chi_1,\dots,\chi_s\}$ is a basis of $X(\G^\circ)$ and the $\chi_i$'s are defined over $\B$.
For $l=1,\ldots,s$ we set
f_l=\sum_{i,j=1}^n\frac{\partial Q_l}{\partial X_{ij}}(I_n)(\delta(g^{-1})g+g^{-1}\mathcal{A}g)_{ij}\in \B[x]_f[\eta]\subseteq K(x,\eta)\subseteq \overline{K(x)}.
As $R^\gen/K(x)$ is Picard-Vessiot, it follows from Lemma \ref{LM:criterion} and Remark \ref{rem: logarithmic independence preserved under algebraic extension} that $f_1,\ldots,f_s$ are logarithmically independent over $K(x,\eta)$.

For an element $a$ of $\B[x]_f[\eta]$ and $c\in\U_4$, let us write $a^c=a\otimes 1\in \B[x]_f[\eta]\otimes_{\B[x]}k(x)$ for the image of $a$ in $\B[x]_f[\eta]\otimes_{\B[x]}k(x)$.
Note that then $\psi_c(a^c)=c(a)$.

Then, for $l=1,\ldots,s$, we have
\begin{equation} \label{eq: formula for fl}
f_l^c=\sum_{i,j=1}^n\frac{\partial Q_{l}^c}{\partial X_{ij}}(I_n)(\delta((g^c)^{-1})g^c+(g^c)^{-1}A^cg^c)_{ij}\in \B[x]_f[\eta]\otimes_{\B[x]_f}k(x).
\end{equation}
%where $g_c=h_c(Y_c)=g\otimes 1$.
% Let $\chi_1,\dots,\chi_s$ be a basis of $X((G^\gen)^\circ)$ and let $h\in \Hom_{\K(x)}(R^\gen,\K(x))$ be such that $h(Y_\gen)^{-1}Y_\gen\in (G_\gen)^\circ(\mathcal{M})$,  where $\mathcal{M}$ is the field compositum of $\overline{\K(x)}$ and the field of fractions of $R_\gen$.  Denote $g=h(\Y)$ and let $f_i$ be as in Lemma~\ref{LM:criterion}. Since $\tilde{\R}$ is generically Picard-Vessiot, by Lemma~\ref{LM:criterionforprotoPV}, $f_1,\dots,f_s$ are logarithmically independent. Extending $\B$ and replacing $f$ by a multiple of $f$ if necessary, we may assume that the $\chi_i$'s are defined over $\B$ and $g,g^{-1}, \delta(g^{-1})\in \B[x]_f[\eta]^{n\times n}$ for some $\eta\in \overline{k_0(x)}$.

% By Proposition 3.5 of [17], there exists a nonempty open subset $\U_2$ of $\X(k)$ such that $\chi_{1}^c,\dots,\chi_{s}^c$ is a basis of $X((G^c)^\circ)$. The above discussion implies that there is a nonempty Zariski open subset $\U_3$ of $\X(k)$ such that for any $c\in \U_1\cap \U_2\cap \U_3$, $h$ induces a $k(x)$-homomorphism $h^c$ from $R^c$ to $\overline{k(x)}$ such that $h_c(Y_c)^{-1}Y_c$ is a zero of $\G_c^\circ$ and moreover
%$$ f_l\otimes 1=\sum_{i,j}\frac{\partial \chi_{l}^c}{\partial X_{ij}}(1)(\delta(g_c^{-1})g_c+g_c^{-1}A_cg_c)_{ij}$$
% where $g_c=h_c(Y_c)$.
By Theorem~\ref{theo: main Appendix B} in Appendix B, there exists an ad$\times$Jac-open subset $\U'$ of $\X(k)$ contained such that $f_1^c,\dots,f_s^c$ are logarithmically independent over $\B[x]_f[\eta]\otimes_{\B[x]_f}k(x)$ for all $c\in \U'$. Then $\U'$ is of the form $\U'=\U_5\cap\mathcal{V}$ with $\U_5$ ad-open and $\mathcal{V}$ Jac-open.

By Proposition~\ref{PROP:protoPV} there exists an ad-open subset $\U_6$ of $\X(k)$ such that $R^c/k(x)$ is proto-Picard-Vessiot for any $c\in \U_6$.
Let $\U_7$ be an ad-open subset of $\U_5\cap\U_6$. Then $\U=\U_7\cap\mathcal{V}$ is ad$\times$Jac-open.

Using the embedding $\psi_c\colon \B[x]_f[\eta]\otimes_{\B[x]_f}k(x)\to \overline{k(x)}$, identity (\ref{eq: formula for fl}) can be interpreted as an identity in $\overline{k(x)}$.
So Lemma~\ref{LM:criterion} implies that $R^c/k(x)$ is Picard-Vessiot for any $c\in \U$.

The last statement of the theorem follows from Theorem \ref{theo: ad meets ab is dense}.
\end{proof}

The proof of Theorem \ref{theo: main specialization} shows that if the algebraic group $G^\gen$ over $K$ is such that $(G^\gen)^t=G^\gen$ (e.g., $G^\gen$ is semisimple or unipotent), then the Jac-open subset is not needed, i.e., the set of good specializations contains an ad-open subset.
However, we can do much better than that:

\begin{cor} \label{cor: no Jac if connected}
Assume that in the setup of Notation \ref{notation: setup} the generic differential Galois group $G^\gen$ is connected. Then there exists an ad-open subset $\U$ of $\X(k)$ such that $R^c$ is Picard-Vessiot for every $c\in\U$.
\end{cor}
\begin{proof}
If $G^\gen$ is connected, then the $h\in\Hom_{K(x)}(R^\gen,\overline{K(x)})$ in the proof of Theorem~\ref{theo: main specialization} can be chosen such that $g=h(Y^\gen)\in \Gl_n(K(x))$ by Remark \ref{rem: C1}. We can therefore choose $\eta=1$ and so $f_1,\ldots,f_s\in \B[x]_f\subseteq K(x)$. By Remark \ref{rem: eta=1 logarithmic independence} the Jac-open subset $\mathcal{V}$ is then not needed so that $\U'=\U_5$ is ad-open and therefore also $\U$ is ad-open.
\end{proof}

% This follows from ??. Moreover, it follows from ?? that the abelian variety involved in the definition of the ab-ope

%	If in Theorem \ref{theo: main specialization} the algebraic group $G^\gen$ over $K$ is such that $(G^\gen)^t=G^\gen$ (e.g., $G^\gen$ is semisimple or unipotent), then the ab-open subset is not needed, i.e., the set of good specializations contains an ad-open subset. This follows from ??. Moreover, it follows from ?? that the abelian variety involved in the definition of the ab-open subset can be chosen to be a Jacobian.
%Also if $G^\gen$ is connected, ab-open subsets are not needed??. Do example of diagonal system where ab-open subset is needed??

While Jac-open subsets do not occur when the generic differential Galois is connected, they do indeed occur in the non-connected case. This is illustrated in the following example.

\begin{ex} \label{ex: need Jac-open}
%In this example we assume $k=\mathbb{C}$ (in order to use the results from ??).
Let $\alpha$ and $\beta$ be variables over $k$ and set $\B=k[\alpha,\beta]$. In line with Notation~\ref{notation: setup} we also set $K=\overline{k(\alpha,\beta)}$.

Let $a=\frac{(x-\beta)^2}{x^4+x+\alpha}$, $f=(x^4+x+\alpha)(x-\beta)$ and consider the differential equation
\begin{equation}
\label{eq: dgl for elleptic curve}
\de^2(y)-\big(2a+\tfrac{\de(a)}{2a}\big)\de(y)+\big(a^2-a-\tfrac{\de(a)}{2}\big)y=0
\end{equation}
over $\B[x]_f$. Note that the companion matrix $\cA\in \B[x]_f^{2\times 2}$ of (\ref{eq: dgl for elleptic curve}) is of the form described in Examples \ref{ex: torsor for monomial matrices} and \ref{ex: integral domain} with $b=a$.

As $a$ is not a square in $k(\alpha,\beta)(x)$, we see that $\B[x]_f[y]/(y^2-a)=\B[x]_f[\eta]$ is an integral domain and a differential ring.
As in the previous examples we set $$\R=\B[x]_f[\eta][y_1,y_2,y_1^{-1},y_2^{-1}]=\B[x]_f[X,\tfrac{1}{\det(X)}]/(P_1,P_2)=\B[x]_f[\Y,\tfrac{1}{\det(\Y)}],$$ where
P_1=X_{21}X_{22}-(a^2-a)X_{11}X_{12} \quad  \quad  P_2=X_{21}X_{12}+X_{22}X_{11}-2aX_{11}X_{12}, $$
$\de(y_1)=(a+\eta)y_1$, $\de(y_2)=(a+\eta)y_2$ and
$\de(\Y)=\cA \Y$.
%Consider the differential equation $\delta(y)=\cA y$

%where $f=??\in\B[x]$. %$f=(x^4+x+\alpha)(x-\beta)\in \B[x]$.
We know from Example \ref{ex: torsor for monomial matrices} that $\R/\B[x]_f$ is a differential  $\G$-torsor for $\de(y)=\cA y$ where $\G$ is the group scheme of $2\times 2$ monomial matrices over $\B$.
Therefore, $$R^\gen=\R\otimes_{\B[x]_f}K(x)=K(x,\eta)[y_1,y_2,y_1^{-1},y_{2}^{-1}]=K(x)[Y^\gen,\tfrac{1}{Y^\gen}]$$
is a differential $G^\gen=\G_K$-torsor.
% The identity component of $G^\gen$ is the diagonal torus in $\Gl_{2,K}$ and so $(G^\gen)^t=1$. Thus $R^\gen/K(x)$ is a proto-Picard-Vessiot ring.
Example \ref{ex: elements for logarithmic test} shows that $R^\gen/K(x)$ is Picard-Vessiot if and only if $f_1=a+\eta$ and $f_2=a-\eta$ are logarithmically independent over $K(x,\eta)$.
From Example \ref{ex: get elleptic curve} we know that $f_1,f_2$ are logarithmically independent over $K(x,\eta)$ if the point $(0,1)$ is not a torsion point on the elliptic curve (over $K$) defined by $v^2=u^3-4\alpha u+1$.

Combining Example 2.4 (i) of [50] and Proposition 12.1 of [51] we see that the latter is the case and so $R^\gen/K(x)$ is Picard-Vessiot. (Note that in the notation of these references $\infty_+=(0,1)$ and $\infty_-$ is the neutral element.)

Set $\X=\spec(\B)=\mathbb{A}^2_k$.
We would like to determine an ad$\times$Jac-open subset $\U$ of $\X(k)=k^2$ such that $R^c=\R\otimes_{\B[x]_f}k(x)$ is Picard-Vessiot for every $c\in \U$. To this end, we follow the same strategy as at the generic point.
Example \ref{ex: integral domain} shows that $R^c$ is an integral domain provided that $256(\alpha^c)^3-27\neq 0$. For these $c$'s, Example \ref{ex: elements for logarithmic test} shows that $R^c$ is Picard-Vessiot if and only if $f_1^c=a^c+\eta^c$ and $f_2^c=a^c-\eta^c$ are logarithmically independent over $F^c=k(x,\eta^c)=k(x)[y]/(y^2-a^c)$. With $z^c=\frac{x-\beta^c}{\eta^c}$, we have
$F^c=k(x,z^c)$ and $(z^c)^2=x^4+x+\alpha^c$.
% Then  $\frac{2(\alpha_1-\beta)^2}{4(\alpha_1)^3-1}$ ??

% For $c\in\U_1$ the element $a^c$ is not a square in $k(x)$ and so $R^c$ is an integral domain by Example \ref{ex: integral domain}. As in the generic case it follows that $R^c$ is proto-Picard-Vessiot and that $R^c$ is Picard-Vessiot if and only if $f_1^c=a^c+\eta^c$ and $f_2^c=a^c+\eta^c$ are logarithmically independent over $k(x,\eta^c)=k(x)[y]/(y^2-a^c)$.

%\mw{It seems unclear to me if $R^c$ is PV for those $c=(\alpha^c,\beta^c)\in k^2$ with $256(\alpha^c)^3-27\neq 0$ and $\frac{2(\alpha_i^c-\beta^c)^2}{4(\alpha_i^c)^3-1}\in\mathbb{Q}$ for $i=3,\ldots,6$ and $\sum_{i=1}^4\frac{2(\alpha_i^c-\beta^c)^2}{4(\alpha_i^c)^3-1}=0$. It even seems unclear if such $c$ exists at all? (These conditions come from $Z_1$.)}
%\rf{As you have suggested, I used $\prod_{i=3}^6 \frac{(\alpha_i-\beta)^2}{4\alpha_i^3+1} (=\frac{(\beta^4+\beta+\alpha)^2}{256\alpha^3-27})$ instead of $\frac{(\alpha_1-\beta)^2}{4\alpha_1^3+1}$.}

% before. I don't know if this is automatic. The problem is with the argument later on. As we do not know the special values of $a^c$ such that $(0,1)$ is a torsion point we cannot rule out }

% and let $\U_1$ be the Zariski open subset of $\X(k)$ where the discriminante $256\alpha^3-27$ of $x^4+x+\alpha$ does not vanish. Then $a^c$ is not a square in $k(x)$ and it follows from Example~\ref{ex: integral domain} that $R^c=\R\otimes_{\B[x]_f}k(x)$ is an integral domain for any $c\in \U_1$, where $\X=\spec(\B)$. The identity component of $G^c=\G_c$ is the diagonal torus in $\Gl_{2,k}$ and so $(G^c)^t=1$. Thus $R^c/k(x)$ is a proto-Picard-Vessiot ring for every $c\in \X(k)$.
%Similarly, ??

%i.e., $A$ is the companion matrix of the differential operator
%%As a first step, we determine the differential Galois group $G^\gen$ and the Picard-Vessiot ring $R^\gen$ of $\de(y)=Ay$ over $K(x)$.
%Note that over $\overline{K(x)}$ the operator $L$ admits the factorizations
%$$ L=\left(\de-b-\tfrac{\de(a)}{2a}-\sqrt{a}\right)\left(\de-b+\sqrt{a}\right).$$

%We begin with some rather general preliminary considerations. Let $\Q\subseteq \Q[\eta]$ be an inclusion of differential $k$-algebras such that $\Q[\eta]$ is an integral domain and $\eta$ has minimal polynomial $y^2-a$ over the field of fractions of $\Q$, where $a$ is some element of $\Q^\times$. We also fix $b\in \Q$. Let $y_1,y_2$ be indeterminates over $\Q[\eta]$ and define a derivation $\de$ on $\R=\Q[\eta][y_1,y_2,y^{-1}_1,y^{-1}_2]$ by $\de(y_1)=(b+\eta)y_1,\ \de(y_2)=(b-\eta)y_2$.
%y_1 & y_2 \\
%\de(y_1) & \de(y_2)
%	y_1 & y_2 \\
%	(b+\eta)y_1 & (b-\eta)y_2
%Then $\det(Y)=-2\eta y_1y_2$. Therefore $\R=\Q[Y,\frac{1}{\det(Y)}]$. A direct computation shows that $\de(Y)=AY$, where $A\in\Q^{2\times 2 }$ is given by the formula in (\ref{eq: for A}). Let $\mathcal{I}$ denote the kernel of the morphism $\Q[X,\frac{1}{\det(X)}]\to \R,\ X\mapsto Y$. As $\R$ is an integral domain, $\mathcal{I}$ is a prime differential ideal of $\Q[X,\frac{1}{\det(X)}]$, where $\de(X)=AX$. We have
%$$(b+\eta)y_1\cdot(b-\eta)y_2=(b^2-a)y_1y_2 \quad \text{ and } \quad (b+\eta)y_1\cdot y_2+(b-\eta)y_2\cdot y_1=2by_1y_2. $$ %\ \text{ and } \det(Y)^2=4ay^2_1y^2_2.$$
%Therefore, the polynomials
%\mw{As discussed by email, previously four polynomials were given here. The prove below shows that only two of them are needed.}
%P_1=X_{21}X_{22}-(b^2-a)X_{11}X_{12} \quad \text{ and } \quad  P_2=X_{21}X_{12}+X_{22}X_{11}-2bX_{11}X_{12} $$
%lie in $\mathcal{I}$. We will show that $\mathcal{I}=(P_1,P_2)$. For this, it suffices to show that the induced map $\Q[X,\frac{1}{\det(X)}]/\mathcal{I}\to \R$ is injective. Let $z_1, z_2, z_1', z_2'$ denote the image in $\Q[X,\frac{1}{\det(X)}]/\mathcal{I}$ of $X_{11},X_{12},X_{21},X_{22}$ respectively. Then
%\begin{equation} \label{eq: for ex 1}
%\begin{equation} \label{eq: for ex 2}
%%\begin{equation} \label{eq: for ex 3}
%Subtracting $2z_1'z_2$ from (\ref{eq: for ex 2}) yields $z_1z_2'-z_1'z_2=2z_2(bz_1-z_1')$. Since $z_1z_2'-z_1'z_2$ is invertible, we see that also $z_2$ is invertible. Similarly, subtracting $2z_2'z_1$ from (\ref{eq: for ex 2}), we see that $z_1$ is invertible. So (\ref{eq: for ex 2}) can be rewritten as
%\label{eq: for ex 3}
%\end{equation} whereas (\ref{eq: for ex 1}) becomes $\frac{z'_1}{z_1}\cdot\frac{z_2'}{z_2}=b^2-a$. Plugging $\frac{z'_2}{z_2}=2b-\frac{z_1'}{z_1}$ into the latter equation yields $(\frac{z'_1}{z_1}-b)^2=a$. Set $\eta'=\frac{z'_1}{z_1}-b$. Then $\eta'^2=a$,  $z_1'=(b+\eta')z_1$ and from (\ref{eq: for ex 3}) we obtain $z_2'=(b-\eta')z_2$.
% Set $\mathcal{S}=\Q[\eta',z_1,z_2,z_1^{-1},z_2^{-1}]$. We claim that $\mathcal{S}=\Q[X,\frac{1}{\det(X)}]/\mathcal{I}$. It suffices to show that $z_1',z_2'$ and $\frac{1}{z_1z_2'-z_1'z_2}$ lie in $\mathcal{S}$. But $z_1'=(b+\eta')z_1\in\mathcal{S}$, $z_2'=(b-\eta')z_2\in\mathcal{S}$ and
% $z_1z_2'-z_1'z_2=2\eta'z_1z_2$. So $\frac{1}{z_1z_2'-z_1'z_2}\in \S$ and $\mathcal{S}=\Q[X,\frac{1}{\det(X)}]/\mathcal{I}$ as claimed.
% The map
% \begin{equation} \label{eq: map}
% \Q[\eta'][z_1,z_2,z_1^{-1},z_2^{-1}]=\Q[X,\tfrac{1}{\det(X)}]/\mathcal{I}\longrightarrow \R=\Q[\eta][y_1,y_2,y^{-1}_1,y^{-1}_2]
% \end{equation}
% sends $\eta'$ to $\eta$, $z_1$ to $y_1$ and $z_2$ to $y_2$.
% As $\eta'^2=a$, the restriction $\Q[\eta']\to \Q[\eta]$ is injective. But then, since $y_1$ and $y_2$ are algebraically independent over $\Q[\eta]$, the map (\ref{eq: map}) is injective. Thus $\mathcal{I}=(P_1,P_2)$ as claimed.

% Let $\Z$ be the closed subscheme of $\Gl_{2,\Q}$ defined by $P_1,P_2$. So $\Q[\Z]=\Q[X,\frac{1}{\det(X)}]/(P_1,P_2)=\R$.
%  By Example \ref{ex: torsor for monomial matrices}
%  $z'_2=2bz_2-z_2\frac{z'_1}{z_1}\in\mathcal{S}$ and $\frac{1}{z_1z_2'-z_1'z_2}$??
%From (\ref{eq: for ex 3}) we infer that $z_1$ and $z_2$ are invertible. Thus,
%P_1=(b^2-a)X_{11}X_{12}-X_{21}X_{22}, \quad P_2=X_{11}X_{22}+X_{12}X_{21}-2bX_{11}X_{12}=0,\\
%Thus the Picard-Vessiot ring for $\de(y)=Ay$ over $K(x)$ is of the form $K(x)[y_1,y_2,\de(y_1),\de(y_2),\frac{1}{\operatorname{wr}}]$, where $\frac{\de(y_1)}{y_1}=b+\sqrt{a}$, $\frac{\de(y_2)}{y_2}=b-\sqrt{a}$ and $\operatorname{wr}=y_1\de(y_2)-\de(y_1)y_2$.
%From this we deduce
% \tfrac{\de(y_1)}{y_1}\tfrac{\de(y_2)}{y_2}=b^2-a, \quad \tfrac{\de(y_1)}{y_1}+\tfrac{\de(y_2)}{y_2}=2b, \\
% (\tfrac{\de(y_1)}{y_1}-b)^2=a,\quad  (\tfrac{\de(y_2)}{y_2}-b)^2=a.
%Thus the matrix
%y_1 & y_2 \\
%\de(y_1) & \de(y_2)
%$$ satisfies the equations
%P_1=(b^2-a)X_{11}X_{12}-X_{21}X_{22}=0,\quad P_2=X_{11}X_{22}+X_{12}X_{21}-2bX_{11}X_{12}=0,\\
%P_3=(X_{21}-bX_{11})^2-aX_{11}^2=0,\quad  P_4=(X_{22}-bX_{12})^2-aX_{12}^2=0.
%\mw{These equations look redundant, $P_3$ and $P_4$ are implied by $P_1$ and $P_2$ and the fact that $\det(X)$ is invertible?, multiply $P_3$ by $\det(X)$ and write as linear combination of $P_1$ and $P_2$ }
%Let $\Z$ be the closed subscheme of $\Gl_{2,\B[x]_f}$ defined by the above
%equations and let $\R$ be its coordinate ring, i.e., $\R=\B[x]_f[X,\frac{1}{\det(X)}]/(P_1,P_2,P_3,P_4)$.
%It is
%Now let $\B$ be a constant $k$-subalgebra of $\Q$ and let $\G$ be the group scheme of monomial $2\times 2$ matrices over $\B$, i.e.,
%$$\G(\T)=\left\{\begin{pmatrix} g_{11} & g_{12} \\ g_{21} & g_{22} \end{pmatrix}\in\Gl_2(\T) \mid g_{11}g_{12}=g_{11}g_{21}=g_{22}g_{12}=g_{22}g_{21}=0\right\}\leq\Gl_2(\T)
%for any $\B$-algebra $\T$. In particular, if $\T$ is an integral domain then
%\G(\T)=\left\{\begin{pmatrix} s & 0 \\ 0 & t \end{pmatrix}\mid s,t\in \T^\times\right\}\cup \left\{\begin{pmatrix} 0 & s \\ t & 0  \end{pmatrix}\mid s,t\in \T^\times\right\}\leq\Gl_2(\T).
%We will define an action of $\G$ on $\R/\Q$.
%\mw{I did not see a better way of showing }

%Let $X=(X_{ij})$ be a $2\times 2$ matrix of indeterminate over $K$. Consider $K[X,\frac{1}{\det(X)}]$ as a $K$-$\delta$-algebra via $\delta(X)=AX$. Denote by $\km$ the ideal of $K[X,\frac{1}{\det(X)}]$ generated by
%    P_1=(h^2-g)X_{11}X_{12}-X_{21}X_{22},\,\, P_2=X_{11}X_{22}+X_{12}X_{21}-2hX_{11}X_{12},\\
%    P_3=(hX_{11}-X_{21})^2-gX_{11}^2,\,\, P_4=(hX_{12}-X_{22})^2-gX_{12}^2.
%Then $\km$ is a prime $\delta$-ideal of dimension two over $K$ and thus it is a maximal $\delta$-ideal. Thus $K[X,\frac{1}{\det(X)}]/\km$ is the Picard-Vessiot ring over $K$ for $\delta(y)=Ay$. Let $G$ be its Galois group. Then
%   G(k)=\left\{\begin{pmatrix} a & \\ & b \end{pmatrix}\mid a,b\in k\setminus\{0\}\right\}\cup \left\{\begin{pmatrix}  & a \\ b &  \end{pmatrix}\mid a,b\in k\setminus\{0\}\right\}.
% $$
%$%For $G^\gen=\G_K$, a basis of $X((G^\gen)^\circ)$ is represented by $X_{11}$ and $X_{22}$.
%Let $\chi_1,\chi_2$ be a basis of $X(G^\circ)$. Then $\chi_1,\chi_2$ can be represented by $X_{11},X_{22}$ respectively.
%     g=\begin{pmatrix} 1 & 1 \\ b+\eta & b-\eta \end{pmatrix}\in\Gl_2(K(x,\eta)).
%Then $P_1(g)=P_2(g)=0$ and so $g$ defines a morphism $h\colon R^\gen\to K(x,\eta),\ Y^\gen\mapsto g$ of $K(x)$-algebras.
%As $g\begin{pmatrix}
%y_1 & 0 \\
%0 & y_2
%	b+\eta & 0 \\
%	0 & b-\eta
%Then have that $\beta^{-1}\bar{X}\in G^\circ(M)$ where $M$ is as in Corollary\ref{cor: existence of h} and $\bar{X}$ is the image of $X$ in $R$, and
%     f_1=&\sum_{i,j=1}^2 \frac{\partial \chi_1}{\partial X_{ij}}(I_2)(\delta(g^{-1})g+g^{-1}\cA g)_{ij}=b+\eta,\\
%     f_2=&\sum_{i,j=1}^2 \frac{\partial \chi_2}{\partial X_{ij}}(I_2)(\delta(g^{-1})g+g^{-1}\cA g)_{ij}=b-\eta.
%As in the proof of Theorem~\ref{theo: main specialization}, write $f_i^c=f_i\otimes 1$ in $\B[x]_f[\eta]\otimes_{\B[x]_f} k(x)$ for $c\in \X(\B)$. Then due to Lemma~\ref{LM:criterion}, $R^c/k(x)$ is a Picard-Vessiot ring for $\delta(y)=\cA^c y$ if and oly if $f_1^c, f_2^c$ are logarithmically independent over $\overline{k(x)}$.

%\rf{I provided some details here: mainly presented a projective smooth model of $F$ and how to compute the residues. }
%Let $F=K(x,z)$ with $z=\sqrt{x^4+x+\alpha}$. Then $F$ is an algebraic function field of one variable over $K$ and $\B[x]_f[\eta]$ is a subring of $F$. Since the genus of $z^2=x^4+x+\alpha$ is one, using Maple,  we can obtain its Weierstrass form: $v^2+u^3-4\alpha u-1=0$, and the birational map is given by
%   u\mapsto -\frac{2\sqrt{\alpha}z+x+2\alpha}{x^2}, v\mapsto -\frac{(4\alpha+x)z+3\sqrt{\alpha}x+4\alpha^{3/2}}{x^3}.
%and the inverse map is given by
%     x\mapsto -\frac{u+2\sqrt{\alpha}v}{u^2-4\alpha}, z\mapsto \frac{\sqrt{\alpha}u^4-16\alpha^{5/2}-u^2v-4\sqrt{\alpha}u-4\alpha v}{(u^2-4\alpha)^2}.
%Let $I$ be the homogenous ideal in $K[u,v,w]$ generated by
%   T=v^2w+u^3-4\alpha uw^2-w^3.
%Then $C=\operatorname{Proj}(K[u,v,w]/I)$ is an irreducible and smooth projective curve with $F$ as its rational function field. Now let us investigate the poles of $b dx$ and $\eta dx$. Note that  $b=(x-\beta)^2/(x^4+x+\alpha)$ and $\eta=(x-\beta)/z$. There are two places of $F/K$ lying above $1/x$, say $q_1,q_2$. As $z=\pm x^2\sqrt{1+1/x^3+\alpha/x^4}$, one can take $1/x$ to be a uniformizing variable at $q_i$ with $i=1,2$. From this, one sees that the places $q_1,q_2$ correspond to the points  $(-2\sqrt{\alpha}:-1:1)$ and $(2\sqrt{\alpha}:1:1)$ in $C(K)$ respectively. Let $\alpha_1,\dots,\alpha_4$ be all distinct roots of $x^4+x+\alpha=0$ in $K$. For each $\alpha_i$, there is exactly one place of $F/K$ lying above $x-\alpha_i$, say $q_{i+2}$. Since $z^2=(x-\alpha_i)\prod_{j\neq i}(x-\alpha_j)$, one can take $z$ to be a uniformizing variable at $q_i$ for all $i=3,\dots,6$. Furthermore, we have that $q_i$ corresponds to
%  \left(-\frac{\alpha_i+2\alpha}{\alpha_i^2}, -\frac{3\sqrt{\alpha}\alpha_i+4\alpha^{3/2}}{\alpha_i^3},1\right)\in C(K).
%These $q_i$ are all possible poles of $bdx$ or $\eta dx$, because $q_1,q_2$ are all poles of $x$ and the poles of $b$ or $\eta$ must be the poles of $x$ or zeros of $x^4+x+\alpha$. Because $\ord_{q_i}(bdx)=0$ for $i=1,2$, none of $q_1,q_2$ is a pole of $b dx$. On the other hand, as $\ord_{q_i}(bdx)=-1$, all of $q_3,\dots,q_6$ are poles of $bdx$. As $\ord_{q_i}(x-\alpha_i)=2$ for each $i=3,\dots,6$, we may assume that the $q_i$-adic expansion of $x-\alpha_i$ is of the form  $c_iz^2+\dots$ with $c_i\in K$. Substituting $x=\alpha_i+c_iz^2+\dots$ into $z^2=x^4+x+\alpha$ yields that
%  z^2=(c_iz^2+\dots)\prod_{j\neq i}(\alpha_i-\alpha_j+c_iz^2+\dots)=\left(\prod_{j\neq i}(\alpha_i-\alpha_j)c_i \right)
%z^2 (1+\dots).
%This implies that $c_i=\frac{1}{\prod_{j\neq i}(\alpha_i-\alpha_j)}$, i.e. $x=\alpha_i+\frac{1}{\prod_{j\neq i}(\alpha_i-\alpha_j)}z^2+\dots$. Now we have that
%   bdx=\frac{(\alpha_i-\beta+c_iz^2+\dots)^2 2c_i z}{c_iz^2\prod_{j\neq i}(\alpha_i-\alpha_j+c_iz^2+\dots)}dz=\left ( \frac{2(\alpha_i-\beta)^2}{\prod_{j\neq i}(\alpha_i-\alpha_j)}\frac{1}{z}+\dots\right)dz.
%Therefore $\res_{q_i}(bdx)=\frac{2(\alpha_i-\beta)^2}{\prod_{j\neq i}(\alpha_i-\alpha_j)}$ for $i=3,\dots,6$. As to %$\eta dx$, one can verify that none of $q_i, i=3,\dots,6$ is a pole of $\eta dx$ and $\ord_{q_i}(\eta dx)=-1$ for %$i=1,2$. Furthermore, for $i=1,2$, the $q_i$-adic expansion of $z$ is of the from $x^2(1+\dots)$ or $-x^2(1+\dots)$. %Without loss of generality, we may assume that $x^2(1+\dots)$ is the $q_1$-expansion of $z$ and $-x^2(1+\dots)$ is the %$q_2$-expansion. A direct calculation yields that
%  \eta dx=\frac{x-\beta}{\pm x^2(1+\dots)}(-x^2) d\frac{1}{x}=(\pm x+\dots) d \frac{1}{x}.
%Then we have that $\res_{q_1}(\eta dx)=-1$ and $\res_{q_2}(\eta dx)=1$.

%Let $\alpha_3,\ldots,\alpha_6\in K$ denote the (distinct) roots of $x^4+x+\alpha$.
% Note that the discrimant of $x^4+x+\alpha$ is $256\alpha^3-27$. Set
% \B'=\B[\alpha_3,\dots,\alpha_6,\frac{1}{(256\alpha^3-27)\alpha}]
%and $\X'=\spec(\B')$.
Set $\U=W_{\X}(\Ga, \Gamma) \cap \VV $, where $\Gamma$ is the subgroup of $(\B,+)$ generated by $(\beta^4+\beta+\alpha)^2$ and $256\alpha^3-27$ and  $\VV$ is the set of all $c=(\alpha^c,\beta^c)\in \X(k)$ such that $256(\alpha^c)^3-27\neq 0$ and $(0:1:1)$ is not a torsion point of the elliptic curve $E^c$ with affine equation: $u^2=v^3-4\alpha^c v+1$.
So $\U$ is an ad$\times$Jac-open subset of $\X(k)$. We will show that $R^c/k(x)$ is Picard-Vessiot for every $c\in \U$.

Let $c\in \U$. Because $c\in W_{\X}(\Ga, \Gamma)$, we have
(\beta^c)^4+\beta^c+\alpha^c\neq 0, \,\,256(\alpha^c)^3+1\neq 0,\,\,\mbox{and}\,\,\frac{((\beta^c)^4+\beta^c+\alpha^c)^2}{256(\alpha^c)^3+1}\notin \bQ.
$$ From Example~\ref{ex: get elleptic curve} with $\alpha,\beta$ being replaced by $\alpha^c,\beta^c$ respectively, we see that $Z_1((f_1^c,f_2^c),\cP)=\{(d,-d)\mid d\in \bZ\}$, where $\cP=\{P_1,P_2,\dots,P_6\}$ are all poles of $f_1^c dx$ and $f_2^c dx$. In particular, $P_1,P_2$ are places of the function field $F^c=k(x,z^c)$ with $(z^c)^2=x^4+x+\alpha^c$ and $P_1$ is the place corresponding to the neutral element $(0:1:0)\in E^c(k)$, while $P_2$ corresponds to the point $(0:1:1)\in E^c(k)$. For each $(d,-d)\in Z_1((f_1^c, f_2^c), \cP)$,
\sum_{P\in \cP} \left(\sum_{i=1}^2 d \res_P (f_i^c dx)\right)P=2d(P_2-P_1)
Furthermore, as $c\in \VV$, $2d(P_2-P_1)$ is not a torsion point of $E^c(k)$ if $d\neq 0$. Thus $Z_2((f_1^c,f_2^c), \cP)$ is trivial and therefore $f_1^c, f_2^c$ are logarithmically independent (see Example~\ref{ex: get elleptic curve} for details). So $R^c/k(x)$ is Picard-Vessiot for every $c\in\U$.
% From Example 2.4 of [50] and Proposition 12.1 of [51], $q_2-q_1$ is not a torosion in the Jacobian $J_C$ of $C$ but there are infinitely many $r \in k$ such that if $\alpha^c=r$ then $q_2^c-q_1^c$ is a torsion in $J_{C^c}$. Let $\mathcal{V}$ be the set of $c\in \X'(k)$ such that $q_2^c-q_1^c$ is not a torsion in $J_{C^c}$. Then $\mathcal{V}$ is an ab-open set. From the proof of Theorem~\ref{theo: main Appendix B}, for each $c\in\mathcal{V}$, $f_1^c, f_2^c$ are logarithmically independent and thus $R^c$ is Picard-Vessiot. On the other hand, there are infinitely many $c\in \X'(k)$ such that $R^c$ is not Picard-Vessiot. To see this, let $c\in \X'(k)$ be such that $q_2^c-q_1^c$ is a torsion in $J_{C^c}$, i.e. $m_c(q_2^c-q_1^c)=(h_c)$ for some nonzero integer $m_c$ and $h_c\in F^c$. We see that both $\left(\frac{m_c x}{\sqrt{x^4+x+r}}-\frac{\delta(h_c)}{h_c}\right)dx$ and $\frac{dx}{\sqrt{x^4+x+r}}$ are differentials with no poles, where $r=\alpha^c$. Since the dimension of the vector space spanned by all differentials with no poles which is equal to the genus of $C$ is one, there is $s \in k$ such that
%  $$
%     \frac{m_c x}{\sqrt{x^4+x+r}}-\frac{\delta(h_c)}{h_c}-\frac{s}{\sqrt{x^4+x+r}}=0.
%  $$
%  Among the set of $c\in \X'(k)$ with $\alpha^c=r$, we take $c\in \X'(k)$ to be such that $\alpha^c=r$ and $\beta^c=s/m_c$. Such $c$ exists because
%  $$
%       \X'=\spec(\B')=\spec(k[\alpha,\alpha_1,\dots,\alpha_4,\frac{1}{\alpha (256\alpha^3-27)}])\times_{\spec(k)} \spec(k[\beta])
%  $$ For such $c$, the above equality implies that
%  $$
%  m_c(f_1^c-f_2^c)=m_c \eta^c=m_c\left(\frac{x}{\sqrt{x^4+x+r}}-\frac{s/m_c}{\sqrt{x^4+x+r}}\right)=\frac{\delta(h_c)}{h_c}.
%In other words, for such $c$, $f_1^c, f_2^c$ are logarithmically dependent and thus $R^c$ is not Picard-Vessiot.

In the following, we also show that there are infinitely many $c=(\alpha^c,\beta^c)\in k^2=\X(k)$ with $256(\alpha^c)^3-27\neq 0$ such that $R^c$ is not Picard-Vessiot, i.e., $f_1^c,f_2^c$ are logarithmically dependent.
By Example 2.4 (i) of [50], there exist infinitely many $\alpha^c\in k$ with $256(\alpha^c)^3-27\neq 0$ such that $(0,1)$ is a torsion point on the elliptic curve $E^c$. For every such $\alpha^c\in k$, let $m_c\geq 2$ denote the order of $(0,1)$. Now $m_c(0,1)$ is the neutral element of $E^c$, if and only if the divisor $m_c(P_2-P_1)$ is principal. Thus, there exist an $h_c\in F^c$ such that $(h_c)=m_c(P_2-P_1)$. Note that $\frac{dx}{z^c}$ is a regular differential of $F^c$. The only poles of $\frac{dh^c}{h_c}=\frac{\de(h_c)}{h_c}dx$ are $P_1$ and $P_2$. Moreover, these poles are simple with residues $-m_c$ and $m_c$ respectively. On the other hand, $\frac{m_c x}{z^c}dx=\frac{m_cx^2}{z^c}d(x^{-1})$ and the $P_i$-adic expansion of $z$ is $z=c_i(x^{-1})^{-1}+\ldots$ for $i=1,2$ with $c_1=-1$ and $c_2=1$ (Example~\ref{ex: get elleptic curve}). It follows that also the differential $\frac{m_cx}{z^c}dx-\frac{\de(h_c)}{h_c}dx$ is regular. As $F^c/k$ has genus one, the space of regular differentials is one dimensional. Therefore, there exists an $s\in k$ such that $\frac{m_cx}{z^c}-\frac{\de(h_c)}{h_c}=\frac{s}{z^c}$. If we set $\beta^c=\frac{s}{m_c}\in k$, then
so that indeed $f_1^c,f_2^c$ are logarithmically dependent for $c=(\alpha^c,\beta^c)\in\X(k)$.

As the above $c$'s are not really given explicitly, let us present at least one explicit $c\in W_\X(\Ga,\Gamma)$ such that $R^c/k(x)$ is not Picard-Vessiot. (In this sense the set $\mathcal{V}$ is necessary.)

Set $c=(\alpha^c, \beta^c)=(-\frac{1+\sqrt{-3}}{4}, -\frac{1+\sqrt{-3}}{8})$. Then
256\alpha^c-27=5, \quad ((\beta^c)^4+\beta^c+\alpha^c)^2=\frac{37249 (\sqrt{-3}+1)^2}{262144}.
So $c=(\alpha^c,\beta^c)\in W_\X(\Ga,\Gamma)$ but $f_1^c, f_2^c$ are logarithmically dependent. In fact, one has that
2(f_1^c-f_2^c)dx=4\frac{(x-\frac{1+\sqrt{-3}}{8}) dx}{\sqrt{x^4+x-\frac{1+\sqrt{-3}}{4}}}=\frac{\delta(h)}{h},
$h=p+q\sqrt{x^4+x-\frac{1+\sqrt{-3}}{4}}$ with
\begin{align*}
\end{align*}
%Therefore the set $\VV$ is necessary.
%\mw{There is a little problem here: I do not know how to show that we can can choose $\alpha^c$ and $\beta^c$ such that $c\in \U_1$. The conditions we need on $\alpha^c$ and $\beta^c$ are, there is at least one $i\in\{1,2,3,4\}$ such that the number $\frac{2(\alpha_i^c-\beta^c)^2}{4(\alpha_i^c)^3-1}$ is not rational or something weaker that would imply that $Z_1(f_1^c,f_2^c)=\{(-d,d)|\ d\in\mathbb{Z} \}$ and $((256\alpha^3-27)(\beta^4+\beta+\alpha))^c\neq 0$ }
%\rf{I added a specific $c$ which implies that Jac-open is necessary in some sense.}
\end{ex}
%\begin{lemma} \label{lemma: prepare R}
%	Let $k$ be an algebraically closed field of cha{}racteristic zero and let $R/k(x)${} be a Picard-Vessiot ring with differential Galois group $H$. Then there exists a monic polynomial $h\in k[x]$, a $k[x]_h$\=/$\de$\=/subalgebra $R_0$ of $R$ and an action of $H$ on $R_0/k[x]_h$ turning $R_0/k[x]_h$ into a differential $H$-torsor such that $R_0\otimes_{k[x{}]_h}k(x)\to R$ is an isomorphism (equivalently, $S^{-1}R_0=R$, where $S=k[x]_h\smallsetminus \{0\}$) and the induced action of $H$ on $S^{-1}R_0/S^{-1}k[x]_h$ is the natural action of $H$ on $R/k(x)$.
%	Choose $A\in k(x)^{n\times n}$ such that $R/k(x)$ is a Picard-Vessiot ring for $\de(y)=Ay$. Let $h\in k[x]$ be a monic polynomial such that $A\in k[x]_h^{n\times n}$ and let $Y\in \Gl_n(R)$ satisfy $\de(Y)=AY$. Then $R_0=k[x]_h[Y,\frac{1}{\det(Y)}]$ is a $\de$-subring of $R$ because $\de(Y)=AY\in R_0^{n\times n}$.
%	By generic flatness (\cite[Theorem 14.4]{Eisenbud:view}), we may assume that $R_0$ is flat over $k[x]_h$.
%	For a $k$-algebra $T$ an element $g\in H(T)$ acts on $R\otimes_k T$ by $Y\otimes 1\mapsto Y\otimes [g]$ for some matrix $[g]\in \Gl_n(T)$. Thus $g\colon R\otimes_k T \to R\otimes_k T$ restricts to a $k[x]_k\otimes_k T$\=/$\de$\=/automorphism of $R_0\otimes_k T$. This defines an action of $H$ on $R_0/k[x]_h$ that clearly induces the given action on $R/k(x)$. To see that $R_0/k[x]_h$ is a differential $G$-torsor, let us first show that $R_0\otimes_{k[x]_h}R_0\to R\otimes_{k(x)}R$ is injective. Since localization maps are flat
%	(\cite[\href{https://stacks.math.columbia.edu/tag/00HT}{Tag 00HT}]{stacks-project}) and $R$ is a localization of $R_0$, we know that $R$ is flat over $R_0$. As the composition of flat ring maps is flat (\cite[\href{https://stacks.math.columbia.edu/tag/00HC}{Tag 00HC}]{stacks-project}), $R$ is flat over $k[x]_h$. Thus the inclusion $R_0\to R$ yields an injective map $R\otimes_{k[x]_h}R_0\to R\otimes_{k[x]_h}R$. On the other hand, flatness of $R_0$ over $k[x]_h$ applied to the inclusion $R_0\to R$, yields an injection $R_0\otimes_{k[x]_h}R_0\to R\otimes_{k[x]_h}R_0$. Thus $R_0\otimes_{k[x]_h} R_0\to R\otimes_{k[x]_h} R$ is injective.
%For $f\in k[x]\smallsetminus\{0\}$ we have
%$$\left(\tfrac{1}{f}\otimes 1\right)^{-1}=f\otimes 1=1\otimes f=\left(1\otimes\tfrac{1}{f}\right)^{-1}\in R\otimes_{k[x]_h}.R$$
%Therefore $\frac{1}{f}\otimes 1=1\otimes\frac{1}{f}\in R\otimes_{k[x]_h}R$ and so indeed $f'\otimes 1=1\otimes f'\in R\otimes_{k[x]_h} R$ for every $f'\in k(x)$. Hence $R\otimes_{k[x]_h}R=R\otimes_{k(x)}R$ and, as claimed, the map $R_0\otimes_{k[x]_h}R_0\to R\otimes_{k(x)}R$ is injective. In the commutative diagram
%R\otimes_{k(x)}R & R\otimes_kk[G] \\
%R_0\otimes_{k[x]_h} R_0 & R_0\otimes_kk[G]

\subsection{Some consequences of the specialization theorem}

In this section we deduce the results announced in the introduction from Theorem~\ref{theo: main specialization}.

%Let $k\subseteq k'$ be an inclusion of algebraically closed fields of characteristic zero and let $R'/k'(x)$ be a Picard-Vessiot ring for $\de(y)=
%A'y$ with $A'\in k'(x)^{n\times n}$. Then $R'$ is of the form $R'=k'(x)[X,\frac{1}{\det(X)}]/\m$ for some maximal differential ideal $\m$ of $k'(x)[X,\frac{1}{\det(X)}]$ where $\de(X)=A'X$. Let $P_1,\ldots,P_m$ be a generating set of the ideal $\m$. Fix a finitely generated $k$-subalgebra $\B_0$ of $k'$ and $f_0\in\B_0[x]$ a monic polynomial such that $A'\in \B_0[x]_{f_0}$ and $P_1,\ldots,P_m\in \B_0[x]_f[X,\frac{1}{\det(x)}]$. Set $\X_0=\spec(\B_0)$ and for $c\in\X_0(k)$ let $\m^c$ denote the ideal of $k(x)[X,\frac{1}{\det(X)}]$ generated by $P_1^c,\ldots,P_m^c$.

\subsubsection{Exceptional parameter values for the algebraic relations among the solutions in a family of linear differential equations} \label{subsubsec: Exception parameter values for relations}

Let $k\subseteq K$ be an inclusion of algebraically closed fields of characteristic zero and let $R/K(x)$ be a Picard-Vessiot ring for $\de(y)=
Ay$ with $A\in K(x)^{n\times n}$. Then $R$ is of the form $R=K(x)[X,\frac{1}{\det(X)}]/\m$ for some maximal differential ideal $\m$ of $K(x)[X,\frac{1}{\det(X)}]$ where $\de(X)=AX$. Let $P_1,\ldots,P_m$ be a generating set of the ideal $\m$. Fix a finitely generated $k$-subalgebra $\B$ of $K$ and $f\in\B[x]$ a monic polynomial such that $A\in \B[x]_{f}^{n\times n}$ and $P_1,\ldots,P_m\in \B[x]_f[X,\frac{1}{\det(X)}]$. Set $\X=\spec(\B)$ and for $c\in\X(k)$ let $\m^c$ denote the ideal of $k(x)[X,\frac{1}{\det(X)}]$ generated by $P_1^c,\ldots,P_m^c$.

\begin{cor} \label{cor: algebraic relations preserved}
There exists an ad$\times$Jac-open subset $\U$ of $\X(k)$ such that $\m^c$ is a maximal differential ideal of $k(x)[X,\frac{1}{\det(X)}]$ for every $c\in\U$, where $k(x)[X,\frac{1}{\det(X)}]$ as a differential ring with respect to the derivation determined by $\de(X)=A^cX$.
\end{cor}
\begin{proof}
By Lemma \ref{lemma: spread out PVring} there exists
\begin{itemize}
\item a finitely generated $k$-subalgebra $\B'$ of $K$ containing $\B$ and contained in the algebraic closure of the field of fractions of $\B$;
\item a monic polynomial $f'\in\B'[x]$ such that $f$ divides $f'$ in $\B'[x]$;
\item an affine group scheme $\G'$ of finite type over $\B'$;
\item a differential $\G'$-torsor $\R'/\B'[x]_{f'}$ for $\de(y)=Ay$
\end{itemize}
such that
$\R'$ is a flat $\B[x]_f$-module, $\R'\otimes_{\B'[x]_{f'}}K'(x)$ is $\de$-simple, where $K'\subseteq K$ is the algebraic closure of the field of fractions of $\B'$ and $\R'\otimes_{\B'[x]_{f'}}K(x)\simeq R$.

Let $Y$ denote the image of $X$ in $R=K(x)[X,\frac{1}{\det(X)}]/\m$ and let $\Y'\in \Gl_n(\R')$ be the fundamental matrix corresponding to $Y$ under the isomorphism $\R'\otimes_{\B'[x]_{f'}}K(x)\simeq R$. Then $$\m=\left\{P\in K(x)[X,\tfrac{1}{\det(X)}]\ \big|\ P(Y)=0\right\}$$ and for
$$\mathcal{I}=\{P\in \B'[x]_{f'}[X,\tfrac{1}{\det(X)}]\ \big| P(\Y')=0\}$$ we have $\mathcal{I}\otimes_{\B'[x]_{f'}}K(x)=\m=(P_1,\ldots,P_m)\subseteq K(x)[X,\frac{1}{\det(X)}]$.

Set $\X'=\spec(\R')$ and let  $\f\colon \X'(k)\to \X(k)$ be the map induced by the inclusion $\B\subseteq \B'$.
%For $c'\in\X'(k)$ let $c\in \X(k)$ denote the image of $c'$ under the map

We claim that there exists a nonempty Zariski open subset
$\U'$ of $\X'(k)$
such that $\mathcal{I}\otimes_{\B'[x]_{f'}}k(x)=\m^{\f(c')}\subseteq k(x)[X,\frac{1}{\det(X)}]$ for all $c'\in \X'(k)$, where the tensor product $\mathcal{I}\otimes_{\B'[x]_{f'}}k(x)$ is formed using $c'\colon \B'[x]_{f'}\to k(x)$. As $P_1,\ldots,P_m\in \mathcal{I}$, we have $\m^{\f(c')}\subseteq \mathcal{I}\otimes_{\B'[x]_{f'}}k(x)$ for all $c'\in \X'(k)$.

$$\mathcal{I}'=\{P\in k(\B')(x)[X,\tfrac{1}{\det(X)}]\ \big| P(\Y')=0\}.$$
As $\mathcal{I}'\otimes_{k(\B')(x)}K(x)=\m=(P_1,\ldots,P_m)\subseteq K(x)[X,\frac{1}{\det(X)}],$
we must have $\mathcal{I}'=(P_1,\ldots,P_m)\subseteq k(\B')(x)[X,\tfrac{1}{\det(X)}]$.

Let $Q_1,\ldots,Q_r\in \B'[x]_{f'}[X,\frac{1}{\det(X)}]$ be such that $\mathcal{I}=(Q_1,\ldots,Q_r)$. As $Q_i\in \mathcal{I}\subseteq \mathcal{I}'=(P_1,\ldots,P_m)$, we can find a nonzero $b'\in\B'$ and a monic $f''\in \B'[x]$ such that $b'f''Q_i\in (P_1,\ldots,P_m)\subseteq \B'[x][X,\frac{1}{\det(X)}]$ for $i=1,\ldots,r$. Let $\U'$ be the Zariski open subset of $\X'(k)$ where $b'$ does not vanish. Then $Q_i^{c'}\in(P_1^{c'},\ldots,P_m^{c'})\subseteq k(x)[X,\frac{1}{\det(X)}]$ for $i=1,\ldots,r$ for every $c'\in\U'$. Therefore
$$\mathcal{I}\otimes_{\B'[x]_{f'}}k(x)=(Q_1,\ldots,Q_r)\otimes_{\B'[x]_{f'}}k(x)=(Q_1^{c'},\ldots,Q_r^{c'})\subseteq (P_1^{c'},\ldots,P_m^{c'})=\m^{\f(c')}$$
and so  $\mathcal{I}\otimes_{\B'[x]_{f'}}k(x)=\m^{\f(c')}$ for all $c'\in\U'$ as claimed. In particular, since $\mathcal{I}$ is a differential ideal, also $\m^{\f(c')}$ is a differential ideal for all $c'\in\U'$.

Theorem \ref{theo: main specialization} applied to the differential torsor $\R'/\B'[x]_{f'}$ yields an ad$\times$Jac-open subset $\mathcal{V}'$ of $\X'(k)$ such that $\R'\otimes_{\B'[x]_{f'}}k(x)$ is $\de$-simple for every $c'\in \mathcal{V}'$. For $c'\in\U'\cap\mathcal{V}'$ we then have that
\begin{align*}
\R'\otimes_{\B'[x]_{f'}}k(x)=(\B'[x]_f[X,\tfrac{1}{\det(X)}]/\mathcal{I})\otimes_{\B'[x]_{f'}}k(x) & =     k(x)[X,\tfrac{1}{\det(X)}]/\mathcal{I}\otimes_{\B'[x]_{f'}}k(x)= \\
& =k(x)[X,\tfrac{1}{\det(X)}]/\m^{\f(c')}
\end{align*}
is $\de$-simple, i.e., $\m^{\f(c')}$ is a maximal $\de$-ideal. By Lemma \ref{lemma: lift opens} there exists an ad$\times$Jac-open subset $\U$ of $\X(k)$ such that $\U\subseteq \f(\U')$. Then $\m^c$ is a maximal $\de$-ideal for all $c\in \U$.
\end{proof}

\begin{rem} \label{rem: no Jac for connected in relations}
If, in the context of Corollary \ref{cor: algebraic relations preserved}, the differential Galois group of $\de(y)=Ay$ (over $K(x)$) is connected, then the set $\U$ can be chosen to be ad-open.
\end{rem}
\begin{proof}
If the differential Galois group $G$ of $\de(y)=Ay$ is connected, also the differential Galois group $G'^\gen$ of $\R'^\gen=\R'\otimes_{\B'[x]_{f'}}K'(x)$ is connected because $G=(G'^\gen)_K$ by Lemma \ref{lemma: base change of PV ring over constants}. Thus, by Corollary \ref{cor: no Jac if connected}, the ad$\times$Jac-open subset $\mathcal{V}$ of $\X'(k)$ in the proof of Corollary \ref{cor: algebraic relations preserved} can be chosen to be ad-open. Then by Lemma \ref{lemma: lift opens} also $\U$ can be chosen to be ad-open.
\end{proof}

\subsubsection{Families of not solvable algebraic groups} \label{subsubsec: Families of non-solvable algebraic groups}

We next work towards a proof of Corollary B1 from the introduction. A linear differential equation is solvable by Liouvillian functions if and only if the identity component of the differential Galois group is solvable (\cite[Theorem 1.43]{SingerPut:differential}). For the proof of Corollary~B1 we need to know that the contrapositive of this property spreads out from the generic fibre to an open subset of the parameter space.

Throughout Section \ref{subsubsec: Families of non-solvable algebraic groups} we make the following assumptions:
\begin{itemize}
\item $k$ is an algebraically closed field of characteristic zero;
\item $\B$ is a finitely generated $k$-algebra that is an integral domain;
\item $K=\overline{k(\B)}$ is the algebraic closure of the field of fractions $k(\B)$ of $\B$;
\item $\X=\spec(\B)$;
\item $\G$ is an affine group scheme of finite type over $\X$ such that $\G\to \X$ is dominant, i.e., the dual map $\B\to \B[\G]$ is injective.
\item $\xi$ is the generic point of $\X$ and $\G_\xi=\G\times_\X\spec(k(\xi))$ is the generic fibre (an algebraic group over $k(\xi)=k(\B)$) whereas $\G_{\overline{\xi}}=\G\times_\X\spec(K)$ is the geometric generic fibre (an algebraic group over $K$). Moreover, $\G_x$ is the fibre over $x\in\X$ (an algebraic group over the residue field of $x$).
\end{itemize}

The main goal of this subsection is to prove the following:

\begin{prop} \label{prop: not solvable spreads out}
If $(\G_{\overline{\xi}})^\circ$ is not solvable, then there exists a nonempty Zariski open subset $\U$ of $\X(k)$ such that $(\G_c)^\circ$ is not solvable for every $c\in \U$.
\end{prop}

The proof of Proposition \ref{prop: not solvable spreads out} is given at the end of Section \ref{subsubsec: Families of non-solvable algebraic groups}. We will need some properties of the derived subgroup of an algebraic group. For more background see \cite[Section 6 d]{Milne:AlgebraicGroupsTheTheoryOfGroupSchemesOfFiniteTypeOverAField} or \cite[Section 10.1]{Waterhouse:IntroductiontoAffineGroupSchemes}.
Let $k'$ be a field of characteristic zero and let $G$ be an algebraic group over $k'$. The \emph{derived group} $\mathcal{D}(G)$ of $G$ can be defined as the smallest closed normal subgroup of $G$ such that $G/\mathcal{D}(G)$ is abelian.  Alternatively, it can also be described as the closed subgroup of $G$ generated by the commutator map $G\times G\to G,\ (g,h)\mapsto ghg^{-1}h^{-1}$ (\cite[Prop. 6.18]{Milne:AlgebraicGroupsTheTheoryOfGroupSchemesOfFiniteTypeOverAField}). More generally, for every $n\geq 1$, consider the map $$\f_n\colon G^{2n}\to G,\ (g_1,h_1,\ldots,g_n,h_n)\mapsto g_1h_1g_1^{-1}h_1^{-1}\ldots g_nh_ng_n^{-1}h_n^{-1}$$ and its dual $\f_n^*\colon k'[G]\to \otimes^{2n}k'[G]$.
So $\ker(\f_n^*)$ is the defining ideal of the closure of the image of $\f_n$.
One has $\ker(\f_1^*)\supseteq \ker(\f_2^*)\supseteq\ldots$ and the defining ideal $\I(\mathcal{D}(G))\subseteq k'[G]$ of $\mathcal{D}(G)$ is $\I(\mathcal{D}(G))=\bigcap_{n\geq 1}\ker(\f_n^*)$. In fact, $\I(\mathcal{D}(G))=\ker(\f_n^*)$ for some $n$ (\cite[Prop.~6.20]{Milne:AlgebraicGroupsTheTheoryOfGroupSchemesOfFiniteTypeOverAField}).

The algebraic group $G$ is \emph{perfect} if $\mathcal{D}(G)=G$. Thus $G$ is perfect if and only of $\f_n^*$ is injective for some $n\geq 1$. In other words, $G$ is perfect if and only if $\f_n$ is dominant for some $n\geq 1$.

The higher derived groups $\mathcal{D}^i(G)$ are defined recursively by $\mathcal{D}^i(G)=\mathcal{D}(\mathcal{D}^{i-1}(G))$. Then $G\supseteq \mathcal{D}(G)\supseteq\mathcal{D}^2(G)\supseteq\ldots$ is a descending sequence of closed subgroups (the derived series) that must eventually terminate, say at $\mathcal{D}^n(G)$. If $\mathcal{D}^n(G)=1$ is the trivial group, then $G$ is called \emph{solvable}. Otherwise, $\mathcal{D}^n(G)$ is a nontrivial perfect closed subgroup of $G$.

%	Let $\R\to\SSS$ be a morphism of finitely generated $\B$-algebras. If $\R\otimes_\B k(\B)\to\SSS\otimes_\B k(\B)$ is injective, then there exists a nonempty open subset $\U$ of $\spec(\B)$ such that $\R\otimes_\B k(\p)\to \SSS\otimes_\B k(\p)$ is injective for every $\p\in \U$.
%?? not true ??

\begin{lemma} \label{lemma: perfect spreads out}
If $\G_\xi$ is perfect and nontrivial, then there exists a nonempty open subset $\U$ of $\X$ such that $\G_x$ is perfect and nontrivial for every $x\in \U$.
\end{lemma}
\begin{proof}
As above, for $n\geq 1$ consider the scheme morphism $$\f_n\colon\G^{2n}\to\G,\ (g_1,h_1,\ldots,g_n,h_n)\mapsto g_1h_1g_1^{-1}h_1^{-1}\ldots g_nh_ng_n^{-1}h_n^{-1}.$$
Since $\G_\xi$ is perfect $(\f_n)_\xi\colon \G_\xi^n\to \G_\xi$ is dominant for some $n\geq 1$. By  \cite[Theorem~9.6.1~(ii)]{Grothendieck:EGAIV3}, the set of all $x\in \X$ such that $(\f_n)_x\colon \G_x^n\to \G_x$ is dominant is constructible. As it contains the generic point $\xi$, this set thus contains a nonempty open subset $\U'$ of $\X$. So for every $x\in \U'$, the algebraic group $\G_x$ is perfect.