\documentclass[11pt]{article} \usepackage[a4paper,margin=26mm]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern,amsmath,amssymb,amsthm,mathtools,microtype,enumitem,booktabs} \usepackage{mathrsfs,xurl,array,placeins} \numberwithin{equation}{section} \renewcommand{\thesubsection}{\thesection.\Alph{subsection}} \usepackage[hidelinks]{hyperref} \hypersetup{pdftitle={Polynomial parametrization of quadratic Diophantine equations: decision and construction},pdfauthor={Bogdan Grechuk and Ashleigh Ratcliffe},pdfkeywords={quadratic forms, polynomial parametrization, integral points}} \setlength{\emergencystretch}{2em} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{problem}[theorem]{Problem} \theoremstyle{definition}\newtheorem{definition}[theorem]{Definition} \theoremstyle{remark}\newtheorem{remark}[theorem]{Remark} \newcommand{\Z}{\mathbb Z}\newcommand{\Q}{\mathbb Q}\newcommand{\F}{\mathbb F}\newcommand{\R}{\mathbb R} \newcommand{\OO}{\mathcal O}\newcommand{\GL}{\operatorname{GL}}\newcommand{\SL}{\operatorname{SL}}\newcommand{\SO}{\operatorname{SO}} \newcommand{\Tr}{\operatorname{Tr}}\newcommand{\Nm}{\operatorname{Nm}} \newcommand{\Gal}{\operatorname{Gal}}\newcommand{\Res}{\operatorname{Res}}\newcommand{\diag}{\operatorname{diag}} \title{Polynomial parametrization of quadratic Diophantine equations: decision and construction} \author{Bogdan Grechuk and Ashleigh Ratcliffe} \date{} \begin{document}\maketitle \begin{abstract} We give an algorithm that, for any polynomial with integer coefficients of degree at most two, decides whether its integer zero set is a finite union of polynomial families with integer coefficients and constructs such families whenever they exist. The main step is a constructive proof that, for every nondegenerate integral quadratic form \(Q\) isotropic over \(\mathbb{Q}\) and every integer \(m\), the integer solutions of \(Q(\mathbf{x})=m\) form a finite union of polynomial families. This proves the nondegenerate case of a result announced without proof by Vaserstein. For fixed \(Q\), the number of parameters in each family is bounded independently of \(m\). The new descent argument treats forms in at least five variables with rational Witt index one. We also settle the previously open cases \(zt-x^2-y^2=1\) and \(zt-x^2-y^2=-1\) by combining Larsen--Nguyen's group parametrization with a classical reduction of binary Hermitian forms, obtaining two and three polynomial families, respectively. \end{abstract} \begin{center}\small \textbf{2020 Mathematics Subject Classification:} 11D09, 11E12, 11E57, 11R11, 20G30.\\ \textbf{Keywords:} quadratic forms, polynomial parametrization, integral points, arithmetic groups, quadratic fields. \end{center} \section{Introduction} What does it mean to solve a \emph{polynomial Diophantine equation}? This is an equation \begin{equation}\label{eq:diofgen} P(x_1,\ldots,x_n)=0 \end{equation} with integer coefficients, for which we seek all solutions in $\Z^n$. If there are finitely many solutions, a satisfactory answer is a complete list, together with a proof of completeness. If there are infinitely many, the meaning of a complete description is less clear. An algorithm that merely prints every solution eventually is too weak a requirement: one can always enumerate integer tuples in order of increasing maximum absolute coordinate and test the equation. We would like a description that reveals more of the structure of the solution set. Grunewald and Segal developed algorithms for quadratic equations that give considerably more information than enumeration \cite{GSalg,GS81}. If, after a rational linear change of variables, a variable occurs only in a nonzero linear term, the equation is handled by elementary congruences, including those imposed by the change of variables (Section~\ref{sec:decision}). Otherwise, completing squares and omitting free variables reduces a quadratic equation \eqref{eq:diofgen} to an equation of the form \[ Q(x_1,\ldots,x_n)=m, \] where $Q$ is an integral quadratic form, and $m\in\Z$, with possibly finitely many fixed congruence restrictions on variables. Classical finiteness results, combined with Grunewald--Segal's algorithms for generators and orbits \cite{GS79,GSalg}, yield a description by finitely many initial solutions and finitely many transformations that preserve the equation, together with free coordinates or integer scalar multiples where needed. Appendix~\ref{sec:effective-orbits} gives the effective reduction used here. One then imposes the congruences and returns to the original coordinates. We refer to this kind of description as a \emph{Grunewald--Segal description}. For example, the equation \begin{equation}\label{eq:exintro} y+y^2+z^2=3x^2 \end{equation} becomes \begin{equation}\label{eq:exintro2} Y^2+Z^2=3X^2+1 \end{equation} under $X=2x$, $Y=2y+1$ and $Z=2z$, with the restrictions that $Y$ is odd and $X,Z$ are even. All integer solutions of \eqref{eq:exintro2} can be obtained from $(0,1,0)$ by changing signs, interchanging $Y$ and $Z$, and applying \[ (X,Y,Z)\longmapsto(2X-Y,\,3X-2Y,\,Z); \] see \cite[Proposition~4.27]{GrechukBook}. To check completeness, use signs and the interchange to arrange $X\ge0$ and $Y\ge Z\ge0$. When $X>0$, the equation gives $X0$ with $x\in cL$; equivalently it is the gcd of the coordinates of $x$. Thus $x$ is primitive exactly when its content is one. We also use level sets $\{x\in L:Q(x)=m\}$ for rational $m$ and arbitrary full lattices. \begin{lemma}[Hyperbolic splitting; {\cite[Chapter~IV, \S1.3, Proposition~3]{Serre}}]\label{lem:hyperbolic-splitting} Over a field of characteristic different from two, a nondegenerate isotropic quadratic form is isometric to $uv+q(z)$ with $q$ nondegenerate. The change of basis is computable from an isotropic vector by linear algebra. \end{lemma} \begin{proof} Choose $e\ne0$ with $Q(e)=0$ and $v$ with $B_Q(e,v)=1$. Then $f=v-Q(v)e$ satisfies $Q(f)=0$ and $B_Q(e,f)=1$. The span of $e,f$ is a hyperbolic plane; adjoining a basis of its orthogonal complement gives the required coordinates. \end{proof} \section{Polynomial families and fixed denominators}\label{sec:denominators} Frisch \cite[main theorem and Lemmas~2--3]{Frisch} proved that the integer points in the image of a rational-coefficient polynomial map on integer parameters form a finite union of polynomial families. The same residue substitution also imposes fixed congruences. \begin{lemma}[Residue substitutions]\label{lem:filter} Let $\Phi\in D^{-1}\Z[\mathbf t]^n$, where $\mathbf t=(t_1,\ldots,t_N)$ and $D\geq1$ is fixed. Fix $M\ge1$ and $b\in\Z^n$, and let $\mathcal R\subseteq(\Z/DM\Z)^N$ be the set of residue vectors $a$ with $\Phi(a)\in b+M\Z^n$. Then: \begin{enumerate}[label=\textup{(\roman*)},leftmargin=2em] \item the condition $\Phi(\mathbf t)\in b+M\Z^n$ depends only on $\mathbf t\bmod DM$; \item for each $a\in\mathcal R$, represented by an integer vector, the polynomial map $\mathbf s\mapsto\Phi(a+DM\mathbf s)$ has its constant term in $b+M\Z^n$ and all its nonconstant coefficients in $M\Z^n$; in particular it has integer coefficients; \item the finitely many maps in \textup{(ii)} have union of images exactly $\Phi(\Z^N)\cap(b+M\Z^n)$, each uses the same $N$ parameters, and each satisfies every polynomial identity satisfied by $\Phi$. \end{enumerate} There are at most $(DM)^N$ maps. Taking $M=1$ retains precisely the integer points in the image of $\Phi$. Several fixed congruences can be imposed by using a common modulus and retaining all allowed residue classes. \end{lemma} \begin{proof} Put $f=D\Phi\in\Z[\mathbf t]^n$. The condition is $f(\mathbf t)\equiv Db\pmod{DM}$. For an allowed residue vector $a$, expanding each term shows that every nonconstant coefficient of $f(a+DM\mathbf s)$ is divisible by $DM$. Its constant coefficient is $f(a)\equiv Db\pmod{DM}$. Dividing by $D$ proves the coefficient assertions. These substitutions partition the allowed integer parameters and preserve all polynomial identities. \end{proof} \begin{lemma}[Change of lattice]\label{lem:lattice} Let $L_0,L$ be full lattices in a rational quadratic space $(V,Q)$, with $Q(L_0)\subseteq\Z$. If every integral level on $L_0$ is a finite union of polynomial families, the same is true of every rational level on $L$. Uniform bounds on parameters per family are preserved. \end{lemma} \begin{proof} Choose $D,D'\ge1$ with $DL\subseteq L_0$ and $D'L_0\subseteq L$. If $D^2m\notin\Z$, the level on $L$ is empty. Otherwise choose finitely many polynomial maps $\Phi_j$ whose images exhaust the level $D^2m$ on $L_0$, and divide their values by $D$. In a basis of $L$, these maps have coefficient denominators dividing $DD'$. Lemma~\ref{lem:filter} retains precisely their integral values. Since $Q(\Phi_j/D)=D^{-2}Q(\Phi_j)=m$, the resulting families exhaust the required level, without additional parameters. \end{proof} In particular, if $C\in\GL_n(\Q)$ and $Q(C\,\cdot)$ is integral, take $L_0=C\Z^n$ and $L=\Z^n$ to transfer the polynomial families for its integral levels to $Q$ on $\Z^n$. Scalar multiples cause no further difficulty: for $c\in\Q^\times$, $Q(x)=m$ is equivalent to $cQ(x)=cm$. Thus both the form and its level are scaled together whenever we pass to a similar form. \begin{lemma}[Content reduction]\label{lem:content-reduction} Let $Q$ be integral on a lattice $L$. Suppose that on every integral level, finitely many polynomial families contained in that level together contain all primitive vectors. Then every integral level is a finite union of polynomial families. Nonzero levels require no additional parameters; the zero level requires at most one. \end{lemma} \begin{proof} Every nonzero $x\in L$ is $cv$ for a primitive $v$ and an integer $c>0$. If $Q(x)=m\ne0$, then $c^2\mid m$: use the finitely many primitive levels $m/c^2$ and multiply their outputs by $c$ \cite[remark after Corollary~4, p.~982]{Vas}. At zero, multiply the primitive-level families by a free integer scalar; if there are none, use the constant zero map. \end{proof} Vaserstein's theorem \cite[Theorem~1]{Vas} gives a matrix with polynomial entries and determinant identically one, \begin{equation}\label{eq:Vasmap} \mathcal V\in\SL_2(\Z[t_1,\ldots,t_{46}]),\qquad \mathcal V(\Z^{46})=\SL_2(\Z). \end{equation} An explicit construction is given in \cite[Section~1, Proposition~1.5]{Vas}. \section{Elementary isometries and a ternary representation}\label{sec:operations} The high-rank argument concerns \[ F(u,v,z)=uv+q(z),\qquad z\in\Q^r,\quad r\ge3, \] where $q$ is nondegenerate and integral. Theorem~\ref{thm:primecover} constructs polynomial families containing points whose first coordinate is a prime of the prescribed type. Theorem~\ref{thm:reduction} moves every primitive point into that subset after a bounded integral rescaling. Inverting this reduction and applying Lemma~\ref{lem:filter} gives the required families; see \eqref{eq:finalmaps}. Put \[ q(z)=\tfrac12z^{\mathsf T}Gz,\qquad B(z,t)=z^{\mathsf T}Gt, \qquad \Delta=|\det G|. \] Thus $G$ is integral with even diagonal and $\Delta>0$. The elementary constructions in this section also apply in any positive rank over a field of characteristic different from two. For a vector $t$, define the Eichler transformations \begin{align} T_t(u,v,z)&=(u-B(z,t)-vq(t),\ v,\ z+vt),\label{eq:T}\\ S_t(u,v,z)&=(u,\ v-B(z,t)-uq(t),\ z+ut).\label{eq:S} \end{align} They preserve $F$, satisfy $T_sT_t=T_{s+t}$ and $S_sS_t=S_{s+t}$, and have inverses $T_{-t},S_{-t}$ (see \cite[\S3]{Eichler} and \cite[\S3.1, (5)]{GHS}). For integral $t$ they preserve the lattice and primitivity. We also use $R_\epsilon(u,v,z)=(\epsilon u,\epsilon v,z)$, where $\epsilon=\pm1$. Fix $w$ with $k=q(w)\ne0$. The classical action $X\mapsto gXg^{\mathsf T}$ of $\SL_2$ on symmetric binary matrices, applied to \[ X=\begin{pmatrix}u&B(z,w)/2\\B(z,w)/2&-kv\end{pmatrix}, \] and fixing the component of $z$ orthogonal to $w$, defines a transformation $\rho_w(g)$. For $g=\left(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\right)$, its coordinates are \begin{align} u'&=a^2u+abB(z,w)-kb^2v,\label{eq:rho-u}\\ v'&=d^2v-\frac{c^2u+cdB(z,w)}k,\\ z'&=z+\left(\frac{acu+bcB(z,w)}k-bdv\right)w.\label{eq:rho-z} \end{align} \begin{lemma}\label{lem:rho} Over any field $E$ of characteristic different from two, $\rho_w$ is a representation of $\SL_2(E)$ by isometries of $F$, fixing $\{(0,0,z):B(z,w)=0\}$ pointwise. For integral $q,w$, both $\rho_w(g)$ and $\rho_w(g)^{-1}$ have matrix entries in $k^{-1}\Z[a,b,c,d]$. \end{lemma} \begin{proof} Write $z=\lambda w+z_\perp$, with $\lambda=B(z,w)/(2k)$. Then $\det X=-k(uv+k\lambda^2)$, while $q(z_\perp)$ is fixed. This proves preservation of $F$ and the representation identity. The off-diagonal entry transforms to $acu+(ad+bc)k\lambda-bdkv$; using $ad-bc=1$ gives \eqref{eq:rho-z}. The displayed formulas prove the denominator bound, also for the inverse after replacing $(a,b,c,d)$ by $(d,-b,-c,a)$. \end{proof} Substituting Vaserstein's matrix \eqref{eq:Vasmap} gives polynomial isometry families in $46$ unrestricted integer parameters, with denominators dividing $k$. \begin{lemma}[Moving the first coordinate]\label{lem:move-first} Let $q$ be nondegenerate in $r\ge1$ variables over a finite field $\mathbb F$ of odd order. For every nonzero $(u,v,z)\in\mathbb F^{r+2}$, some $t\in\mathbb F^r$ makes the first coordinate of $T_t(u,v,z)$ nonzero. \end{lemma} \begin{proof} The polynomial $u-B(z,t)-vq(t)$ is nonzero by nondegeneracy. Its degree in each variable is at most $2<|\mathbb F|$, so it cannot vanish on all of $\mathbb F^r$, by the usual root bound applied successively to the variables. \end{proof} \section{An imaginary quadratic field of prime discriminant}\label{sec:field} For a number field $K$, write $\OO_K$ for its ring of integers. A prime ideal $\mathfrak p$ above $p$ has \emph{residue degree one} when $\OO_K/\mathfrak p\simeq\F_p$. For quadratic $K$, a bar denotes conjugation, and $\Tr(\alpha)=\alpha+\bar\alpha$, $\Nm(\alpha)=\alpha\bar\alpha$. A rational prime $p$ \emph{splits} in $K$ when $p\OO_K=\mathfrak p\bar{\mathfrak p}$ with two distinct prime ideals; both then have residue degree one. Write $\Q_\ell$ for the $\ell$-adic field. For rational $a\ne0$, $v_\ell(a)$ is the exponent of $\ell$ in $a$, with $v_\ell(0)=\infty$. \begin{lemma}\label{lem:field} Let $q$ be a nondegenerate rational quadratic form of rank $r\ge3$. Outside any prescribed finite set of rational primes there is a prime $P\equiv3\pmod8$ such that $q$ is isotropic over $K=\Q(\sqrt{-P})$, whose discriminant is $-P$. For $r\ge5$, every imaginary quadratic field makes $q$ isotropic. \end{lemma} \begin{proof} If $r\ge5$, $q$ is isotropic over every $\Q_\ell$ \cite[Chapter~IV, Theorem~6]{Serre}, hence over every finite completion of $K$. Its complex completions present no obstruction, so Hasse--Minkowski proves the last assertion \cite[Theorem~14.6.9]{Voight}. For $r=3,4$, choose a nondegenerate ternary subform $aX^2+bY^2+cZ^2$. It is isotropic precisely when the quaternion algebra $\mathscr A=(-ab,-ac)_\Q$ splits, that is, becomes $M_2(\Q)$ \cite[\S5.3.23 and Main Theorem~5.4.4]{Voight}. Here $(s,t)_\Q$ is generated by $\iota,\jmath$ with $\iota^2=s$, $\jmath^2=t$ and $\iota\jmath=-\jmath\iota$. Let $\Sigma$ be the finite set of rational primes where $\mathscr A$ ramifies, meaning that it is not a matrix algebra over $\Q_\ell$. For each odd $\ell\in\Sigma$, prescribe a nonzero class of $P\bmod\ell$ for which $-P$ is a nonsquare, and impose $P\equiv3\pmod8$. The Chinese remainder theorem and Dirichlet's theorem provide infinitely many such primes $P$ \cite[Chapter~VI, \S4.1]{Serre}. No ramified place of $\mathscr A$ splits in $K$: at $2$ this uses $-P\equiv5\pmod8$, and a real place becomes complex. Consequently $K$ splits $\mathscr A$ \cite[Proposition~14.6.7]{Voight}, proving isotropy. In both cases choose $P$ outside the prescribed set. Since $P\equiv3\pmod4$, $\operatorname{disc}(K)=-P$. \end{proof} The congruence modulo $8$ handles possible ramification of $\mathscr A$ at $2$; the descent itself requires only $P\equiv3\pmod4$. \section{Polynomial maps for quadratic levels over finite fields}\label{sec:modular} Put \[ \mathcal U(t)=\begin{pmatrix}1&t\\0&1\end{pmatrix},\qquad \mathcal L(t)=\begin{pmatrix}1&0\\t&1\end{pmatrix},\qquad \mathcal W_2(x,y)=\mathcal U(x)\mathcal L(y) =\begin{pmatrix}1+xy&x\\y&1\end{pmatrix}. \] \begin{lemma}[Two elementary factors]\label{lem:rowword} Let $\mathbb F$ be a finite field of odd order and $d,U\in\mathbb F^\times$. Some first row $(a,b)$ of $\mathcal W_2(x,y)$ satisfies $a^2-db^2=U$. \end{lemma} \begin{proof} For $U=1$, take $x=y=0$. Otherwise the binary quadratic count \cite[Lemma~6.24]{LidlNiederreiter} gives \[ \#\{(a,b):a^2-db^2=U\}=|\mathbb F|-\chi(d), \] where $\chi(0)=0$ and $\chi(x)$ is $1$ or $-1$ according as $x\ne0$ is a square or a nonsquare. At most two solutions have $b=0$, so one has $b\ne0$ when $|\mathbb F|\ge5$. For $|\mathbb F|=3$, $U\ne1$ is a nonsquare and every solution has $b\ne0$. Set $x=b$, $y=(a-1)/b$. \end{proof} \begin{samepage} \begin{lemma}[Reduction onto finite-field levels]\label{lem:modular} Let $q$ be a nondegenerate rational quadratic form in $r\ge3$ variables, isotropic over a number field $K$. For every $m\in\Z$ there is a polynomial map $Z_m\in K[\boldsymbol\theta]^r$ with $q(Z_m)=m$, using $N=2r-2$ parameters if $m\ne0$ and $N=2r-3$ if $m=0$. There are an integer $D_Z>0$ and a finite set $\mathcal B_0$ of rational primes, both independent of $m$, with the following properties. Put $\mathcal B=\mathcal B_0\cup\{p:p\mid m\}$ for $m\ne0$ and $\mathcal B=\mathcal B_0$ for $m=0$. \begin{enumerate}[label=\textup{(\roman*)},leftmargin=2em] \item $D_ZZ_m\in\OO_K[\boldsymbol\theta]^r$; \item if $\mathfrak p$ has residue degree one above $p\notin\mathcal B$, the reductions of $Z_m(\Z^N)$ exhaust $q=m$ over $\OO_K/\mathfrak p$. \end{enumerate} The set $\mathcal B_0$ includes $2$ and the primes dividing $D_Z$ or the coefficient denominators of $q$. Only imaginary quadratic $K$ will be used below. \end{lemma} \end{samepage} \begin{proof} By Lemma~\ref{lem:hyperbolic-splitting}, fix $C\in\GL_r(K)$ with \[ q(C(U,V,W))=UV+q_1(W),\qquad \operatorname{rank}q_1=r-2\ge1. \] Choose $w_0$ with $k_0=q_1(w_0)\ne0$. In this proof $T,S,\rho_{w_0}$ refer to this auxiliary form, using \eqref{eq:T}--\eqref{eq:rho-z} with $q_1$ in place of $q$. Define \begin{align} Z_m&=C\,T_{\mathbf t_T}S_{\mathbf t_S} \rho_{w_0}(\mathcal W_2(a_1,a_2))(1,m,0),\quad m\ne0, \label{eq:aux-nonzero}\\ Z_0&=C\,T_{\mathbf t_T}S_{\mathbf t_S}(a_0,0,0), \label{eq:aux-zero} \end{align} where $\mathbf t_T,\mathbf t_S\in\Z^{r-2}$ and all scalar parameters are integers. The initial vectors have value $m$ under $UV+q_1(W)$, which $T,S$ and $\rho_{w_0}$ preserve; hence $q(Z_m)=m$ identically. The first is polynomial jointly in its parameters and $m$, so one integer $D_Z$ clears denominators in both formulas for every $m$. Choose $\mathcal B_0$ so that outside it the coefficients of $C,C^{-1},q,q_1,w_0,k_0^{-1}$ and the inverse polar determinant of $q_1$ are integral. Include $2$ and the prime divisors of $D_Z$. Then reduction preserves the splitting, the nondegeneracy of $q_1$, and $k_0\ne0$. At a prime in (ii), work over $\OO_K/\mathfrak p\simeq\F_p$. Apply Lemma~\ref{lem:move-first} to $UV+q_1(W)$, whose residual form $q_1$ has rank $r-2\ge1$, to move a nonzero target to one with first coordinate $U\ne0$. If $m\ne0$, every target is nonzero because $p\nmid m$, and Lemma~\ref{lem:rowword} gives a first row $(a,b)$ with $a^2-k_0mb^2=U$. Thus $\rho_{w_0}(\mathcal W_2)(1,m,0)$ has first coordinate $U$. The factor $S_{\mathbf t_S}$ gives it any required $W$-coordinates, and the level equation forces $V$. The factor $T_{\mathbf t_T}$ reverses the initial move. For $m=0$, start instead from $(U,0,0)$; $a_0=0$ also attains zero. Residue degree one ensures that all these parameter residues lift to ordinary integers, proving (ii). \end{proof} \begin{remark} The condition $r\ge3$ is essential here. For a split binary form, $U(\boldsymbol\theta)V(\boldsymbol\theta)=m\ne0$ forces both polynomials to be constant. Finitely many such maps cannot exhaust the levels $UV=m$ over residue fields of unbounded size. \end{remark} \section{The trace equation and quadratic descent}\label{sec:descent} Fix a prime $P\equiv3\pmod4$ and put \[ K=\Q(\sqrt{-P}),\qquad \omega=(1+\sqrt{-P})/2,\qquad \OO_K=\Z[\omega]. \] Conjugation of polynomials acts on coefficients and fixes parameters. The descent uses a trace-one element $\alpha=A\pi$ to combine $Z$ and $\bar Z$. Choosing $\pi$ in a prime ideal ensures the desired residue; its norm need only be a bounded multiple of $p$. \begin{lemma}[The trace equation]\label{lem:trace} The coordinate vectors of pairs $\pi,A\in\OO_K$ satisfying \begin{equation}\label{eq:trace} \Tr(A\pi)=1 \end{equation} are covered by at most $P^{46}$ integer-coefficient polynomial maps with $46$ parameters each, satisfying the equation identically. For $\pi=a_1+a_2\omega$, such an $A$ exists precisely when $\gcd(a_1,a_2)=1$ and $P\nmid\Nm(\pi)$. \end{lemma} \begin{proof} Write $A=c_1+c_2\omega$ and set $X=2a_1+a_2$, $Y=a_1+(1-P)a_2/2$. Then \eqref{eq:trace} is $c_1X+c_2Y=1$, so it corresponds to \[ \begin{pmatrix}X&Y\\-c_2&c_1\end{pmatrix}\in\SL_2(\Z), \qquad X\equiv2Y\pmod P, \] with inverse coordinates \[ a_1=\frac{(P-1)X/2+Y}{P},\qquad a_2=\frac{X-2Y}{P}. \] Substitute \eqref{eq:Vasmap} and apply Lemma~\ref{lem:filter} with denominator $P$ and modulus one. For the criterion, $A$ exists exactly when $\gcd(X,Y)=1$. Away from $P$, the inverse formulas identify common prime divisors of $X,Y$ with those of $a_1,a_2$. At $P$, use $2Y=X-Pa_2$ and $4\Nm(\pi)=X^2+Pa_2^2$. \end{proof} \begin{lemma}[Descent identity]\label{lem:identity} Let $q$ be rational, with polar form $B$, and let polynomial vectors $Z$ over $K$ and polynomials $A,\pi$ over $\OO_K$, in independent parameter blocks, satisfy $q(Z)=m\in\Q$ and $\Tr(A\pi)=1$. Writing $\alpha=A\pi$, the rational polynomial coordinates \begin{align} u&=\Nm(\pi),\label{eq:descent-u}\\ v&=\Nm(A)\bigl(2m-B(Z,\bar Z)\bigr),\\ z'&=\bar\alpha Z+\alpha\bar Z\label{eq:descent-z} \end{align} satisfy $uv+q(z')=m$ identically. \end{lemma} \begin{proof} Conjugation fixes these coordinates. Since $q(Z)=q(\bar Z)=m$, \[ q((1-\lambda)Z+\lambda\bar Z) =m+\lambda(1-\lambda)\bigl(B(Z,\bar Z)-2m\bigr). \] Take $\lambda=\alpha$, using $1-\alpha=\bar\alpha$ and $\alpha\bar\alpha=\Nm(A)\Nm(\pi)$. \end{proof} \begin{lemma}[Bounded norm multiples]\label{lem:bounded-norm} If $p\ne P$ splits in $K$, then either prime $\mathfrak p$ above $p$ contains $\pi=a_1+a_2\omega$ with \[ \gcd(a_1,a_2)=1,\qquad \Nm(\pi)=cp,\qquad 1\le cp$ elements $a+b\omega$, $0\le a,b\le H_p$, two agree modulo $\mathfrak p$. Their difference is a nonzero $\pi_0=a+b\omega\in\mathfrak p$ with $|a|,|b|\le H_p$. Divide by $g=\gcd(a,b)$; since $g0,\qquad q(h)>0,\qquad B(w,h)=0. \] Choose $P$ by Lemma~\ref{lem:field}, avoiding the prime divisors of $2kq(h)\Delta$, and put $K=\Q(\sqrt{-P})$. \begin{lemma}[Bounded content]\label{lem:content} For every primitive $(u,v,z)$ with $u\ne0$, some $t\in\Z^r$ makes $S_t(u,v,z)=(u,v',z')$ satisfy \[ \gcd(u,v')=\gcd(u,v,(Gz)_1,\ldots,(Gz)_r)\mid\Delta. \] \end{lemma} \begin{proof} For each $\ell\mid u$, let $e=\min\{v_\ell(u),v_\ell(v),v_\ell((Gz)_1),\ldots,v_\ell((Gz)_r)\}$. If $e0$, $P\nmid u$, and \[ \beta_{x'}(\xi,\eta)=u\xi^2+B(z,w)\xi\eta-kv\eta^2 \] is positive definite, has content $\kappa\mid k\Delta$, and has discriminant prime to $P$. \end{proposition} \begin{proof} Primitivity and $P\nmid\Delta$ allow Lemma~\ref{lem:move-first} modulo $P$; choose $T_{\mathbf t}$ with $P\nmid u$, and $R_\epsilon$ with $u>0$. Lemma~\ref{lem:content} then makes $\gcd(u,v)\mid\Delta$. Apply $S_{u\tau h}$, obtaining \[ z_\tau=z+u^2\tau h,\qquad v_\tau=v-u\tau B(z,h)-u^3\tau^2q(h). \] Since $v_\tau-v$ is a multiple of $u$, this preserves $\gcd(u,v)$; it also preserves $u$ and $B(z,w)$. The new discriminant is \[ \mathscr D(\tau)=B(z,w)^2+4kuv -4ku^2\tau B(z,h)-4ku^4\tau^2q(h). \] Its leading coefficient is negative and nonzero modulo $P$. Since $P\ge3$, some residue class avoids its at most two roots; choose $\tau$ there with sufficiently large absolute value. Then $\mathscr D(\tau)<0$ and $P\nmid\mathscr D(\tau)$. Moreover, $\kappa=\gcd(u,B(z_\tau,w),kv_\tau) \mid k\gcd(u,v_\tau)\mid k\Delta$. The two $S$-transformations combine into one. \end{proof} \begin{theorem}[Compatible prime-coordinate reduction]\label{thm:reduction} There are two rational polynomial isometry families $\mathcal A_\epsilon(\boldsymbol\xi)$ of $F$, $\epsilon=\pm1$, each with $46+2r$ parameters, such that $k\mathcal A_\epsilon$ and $k\mathcal A_\epsilon^{-1}$ have integer-coefficient entries. For every primitive integral $x$ and finite set of primes $\mathcal E$, some integer parameter choice gives \[ y=k\mathcal A_\epsilon(\boldsymbol\xi)x\in\Z^{r+2},\qquad y_1=\delta_0p,\qquad F(y)=k^2F(x), \] where $\delta_0>0$ divides $k^2\Delta$ and $p\notin\mathcal E$ splits in $K$. The families depend only on the fixed data above. \end{theorem} \begin{proof} Apply Proposition~\ref{prop:binary}. Dividing $\beta_{x'}$ by $\kappa$ divides its discriminant by $\kappa^2$, so the resulting primitive form still has discriminant prime to $P$. Lemma~\ref{lem:simultaneous} gives $\beta_{x'}(a,b)=\kappa p$ for a prime of the required type. The pair $(a,b)$ is primitive because its square content divides $p$. Complete it to the first row of $g\in\SL_2(\Z)$. By \eqref{eq:rho-u}, the first coordinate of $\rho_w(g)x'$ is exactly this binary-form value. Multiplying by $k$ clears denominators and gives $\delta_0=k\kappa\mid k^2\Delta$. Thus take \[ \mathcal A_\epsilon =\rho_w(\mathcal V(\mathbf a))S_{\mathbf s}R_\epsilon T_{\mathbf t}. \] Lemma~\ref{lem:rho} bounds the denominators of this product and its inverse; its parameter count is $46+2r$. \end{proof} \section{Completion of the proof in rank at least five}\label{sec:complete} \begin{theorem}\label{thm:high} Let $q$ be a nondegenerate integral quadratic form in $r\ge3$ variables. Every integral level of $uv+q(z)$ is a finite union of integer-coefficient polynomial families. \end{theorem} \begin{proof} Since $r\ge3$, $q$ or $-q$ has positive index at least two. Replacing $(q,m,u)$ by $(-q,-m,-u)$ if necessary, assume this for $q$. Choose $w,h,k$ first, then $P,K$ as in Section~\ref{sec:reduction}. At level $k^2m$, construct the maps $\Psi_i$ and exceptional set $\mathcal B_{k^2m}$ of Theorem~\ref{thm:primecover}. All these choices precede the target. For a primitive $x\in X_m(F)$, Theorem~\ref{thm:reduction} with $\mathcal E=\mathcal B_{k^2m}$ gives \[ x\xrightarrow{\ k\mathcal A_\epsilon(\boldsymbol\xi)\ } (\delta_0p,v,z) \xrightarrow{\ \mathcal N_{\delta_0}\ } (p,\delta_0v,z)=\Psi_i(\boldsymbol\eta). \] Consequently the finitely many rational polynomial maps \begin{equation}\label{eq:finalmaps} \frac1k\mathcal A_\epsilon(\boldsymbol\xi)^{-1} \mathcal N_{\delta_0}^{-1}\Psi_i(\boldsymbol\eta), \qquad \epsilon=\pm1,\quad 0<\delta_0\mid k^2\Delta, \end{equation} lie on $F=m$ and cover every primitive integral point. More explicitly, writing $\mathcal D(Z,\pi,A)$ for the map of Lemma~\ref{lem:identity}, each $\Psi_i$ is a residue substitution into \[ \mathcal N_cS_{\mathbf s/(D_Zc)} \mathcal D\bigl(Z_{k^2m}(\boldsymbol\theta), \pi_j(\mathbf a),A_j(\mathbf a)\bigr), \] where $(\pi_j,A_j)$ ranges over the trace maps of Lemma~\ref{lem:trace} and $1\le c0}:d^2\mid a\}, \] for a computable constant $C_Q$. Indeed, Lemma~\ref{lem:modular} chooses $D_Z$ uniformly in $m$, and all subsequent denominators and finite choices are fixed. Primes dividing $m$ affect only prime avoidance. Thus the primitive construction uses a bounded number of residue substitutions, while content adds $s(|m|)$. A lattice change replaces $m$ by $D^2m$ and changes only the constant, since $s(D^2a)\le s(D^2)s(a)$. In particular the number is bounded uniformly for squarefree $m$. For every $\varepsilon>0$ it is at most $C_{Q,\varepsilon}|m|^\varepsilon$: indeed, $s(a)\le\prod_{\ell\mid a}(v_\ell(a)+1)$, and $e+1\le\ell^{\varepsilon e}$ for $e\ge1$ and all sufficiently large primes $\ell$; the finitely many remaining primes contribute a bounded factor. The constant can be enormous: even the trace step permits $P^{46}$ maps, before subsequent residue substitutions. \end{remark} \section{A worked example}\label{sec:example} Take $q(z)=z_1^2+z_2^2+z_3^2$, $m=-1$, $K=\Q(\sqrt{-3})$, and $\omega=(1+\sqrt{-3})/2$. Choose $w=e_1,h=e_2$, so $k=1$, $\Delta=8$ and $P=3\nmid2kq(h)\Delta$. The identity $q(1,\omega,\omega-1)=0$ gives the required isotropy. For the primitive point \[ x=(55,-2,-10,-3,0),\qquad \beta_x(X,Y)=55X^2-20XY+2Y^2, \] the preparatory transformations can be identities. The binary form is primitive, positive definite, of discriminant $-40$, and represents $7$ at $(1,4)$. Thus \[ \rho_{e_1}(\mathcal U(4))x=(7,-2,-2,-3,0). \] Put $Z=(\omega,\omega-1,0)$, $\zeta=(\omega-1,-\omega,0)$, and take $C$ with columns $(Z+e_3)/2,(e_3-Z)/2,\zeta$. Then $q(C(U,V,W))=UV-W^2$, $\det C=-1/2$ and $C^{-1}\in M_3(\OO_K)$. With $w_0=1,k_0=-1$, Lemma~\ref{lem:modular} gives $Z_{-1}(0)=Z$, $D_Z=2$ and exceptional set $\{2\}$. Choose \[ \pi=2+\omega,\quad A=\omega,\quad\alpha=-1+3\omega; \qquad \Nm(\pi)=7,\quad\Nm(A)=1,\quad\Tr(\alpha)=1. \] Modulo $(\pi)$, $\omega\equiv-2$, so $Z\equiv z_0=(-2,-3,0)$. Since $B(Z,\bar Z)=4$, descent gives $(u,v,z')=(7,-6,5,4,0)$. The correcting parameter $\mathbf s=D_Z(z_0-z')/7=(-2,-2,0)$ yields \[ S_{\mathbf s/2}(7,-6,5,4,0)=(7,-2,-2,-3,0), \] and $\rho_{e_1}(\mathcal U(-4))$ returns this point to $x$. Here zero parameters in $Z_{-1}$ already give the required residue; in general its parameters must be chosen to match the target modulo $\mathfrak p$. A norm factor greater than one can be unavoidable. Take $P=59$, $p=5$, and $\omega=(1+\sqrt{-59})/2$. The polynomial $T^2-T+15$ splits modulo $5$, so $5$ splits in $K$. There is no element of norm $5$, since \[ \Nm(a+b\omega)=(a+b/2)^2+59b^2/4 \] exceeds $5$ for $b\ne0$ and is a square for $b=0$. Nevertheless $\pi=\omega\in(5,\omega)$ has norm $15=3p$, and $A=1$ gives $\Tr(A\pi)=1$. The final rescaling $\mathcal N_3$ sends $(15,v_0/3,z_0)$ to $(5,v_0,z_0)$. \section{Orbit constructions}\label{sec:low} The cases of rank at most four follow from known polynomial matrix families and finiteness of integral orbits. We also record the resulting Gaussian formulas and extend Vaserstein's two-plane construction to rational splittings and arbitrary lattices. Let $Q$ be a nondegenerate rational quadratic form on $V$, and let $L\subset V$ be a full lattice. Let $O(Q)$ denote the group of all isometries of $Q$, and write \[ \Omega_L=\{g\in O(Q)(\Q):gL=L\},\qquad \Gamma_L=\{g\in\SO(Q)(\Q):gL=L\}. \] Thus $[\Omega_L:\Gamma_L]\le2$; for $L=\Z^n$ we also write $\Gamma_L=\SO(Q,\Z)$. \paragraph{Polynomial matrix families.} For $\SL_2(\Z)$ use the $46$-parameter map $\mathcal V$ in \eqref{eq:Vasmap}. For imaginary quadratic $E$, Larsen--Nguyen \cite[Theorem~1.9]{LN} give a polynomial parametrization of $\SL_2(\OO_E)$; Appendix~\ref{sec:effective-groups} makes the construction and parameter bounds explicit. For real quadratic $E$, Morgan--Rapinchuk--Sury give nine elementary factors \cite[Theorem~1.1]{MRS}; the corrected theorem of Jordan--Zaytman \cite[Theorem~1.2]{JZ} gives at most eight elementary factors, starting with a lower triangular factor. Combining consecutive factors of the same type and padding with zero parameters gives the surjective map \begin{equation}\label{eq:real-word} \mathcal L(t_1)\mathcal U(t_2)\mathcal L(t_3)\mathcal U(t_4) \mathcal L(t_5)\mathcal U(t_6)\mathcal L(t_7)\mathcal U(t_8), \qquad t_j\in\OO_E. \end{equation} An integral basis converts its eight ring parameters into $16$ integer parameters. Here $\mathcal U,\mathcal L$ are the elementary matrices of Lemma~\ref{lem:rowword}. \subsection{Finiteness and transfer of orbits} \begin{lemma}[Orbit finiteness]\label{lem:orbits} Let $Q$ be nondegenerate and $L$ a full lattice in its rational quadratic space. Every nonzero rational level on $L$, and the set of primitive isotropic vectors in $L$, consists of finitely many $\Gamma_L$-orbits. The same holds for every subgroup of finite index in $\Gamma_L$. \end{lemma} \begin{proof} After scaling $Q$ and the prescribed level together, assume $Q$ is integral on $L$. The effective reduction in Lemma~\ref{lem:effective-grams} gives finitely many Gram matrices for lattice bases beginning with a primitive vector of a prescribed value. Equal Gram matrices give vectors in the same $\Omega_L$-orbit. At a nonzero level $m$, only contents $c$ with $c^2\mid m$ occur. Finally, passing from $\Omega_L$ to $\Gamma_L$, or to a subgroup of finite index, splits each orbit into finitely many orbits. For nonzero levels, existence also follows from \cite[Theorem~6.9]{BHC}. \end{proof} An arithmetic subgroup is one commensurable with the integral points in a faithful rational matrix representation; commensurability means that the intersection has finite index in both groups. Surjectivity of algebraic groups is understood over an algebraic closure of $\Q$, and need not imply surjectivity on rational points. \begin{lemma}[Arithmetic images]\label{lem:spinindex} Let $\varphi:\mathcal G\to\SO(Q)$ be a surjective homomorphism of algebraic groups over $\Q$. If $\Lambda\subset\mathcal G(\Q)$ is arithmetic and $\varphi(\Lambda)\subseteq\Gamma_L$, then $\varphi(\Lambda)$ has finite index in $\Gamma_L$. \end{lemma} \begin{proof} The arithmetic-image theorem \cite[Theorem~4.1, pp.~174, 204]{PR} makes $\varphi(\Lambda)$ arithmetic. It is therefore commensurable with the arithmetic lattice stabilizer $\Gamma_L$; the inclusion gives finite index. \end{proof} \begin{lemma}[From matrix families to level sets]\label{lem:grouptransfer} Suppose $Q$ is integral on $L$ and a subgroup of finite index in $\Gamma_L$ is a finite union of integer-coefficient matrix families in a basis of $L$. Then every integral level on $L$ is a finite union of polynomial families. \end{lemma} \begin{proof} Apply the matrix families to representatives from Lemma~\ref{lem:orbits}, using primitive representatives at zero. Lemma~\ref{lem:content-reduction} completes the zero level with one additional scalar parameter. \end{proof} \subsection{Ranks at most four} \begin{proposition}\label{prop:low} Theorem~\ref{thm:main} holds in ranks at most four. \end{proposition} \begin{proof} A nondegenerate rank-one form is anisotropic. By hyperbolic splitting (Lemma~\ref{lem:hyperbolic-splitting}) and lattice transfer (Lemma~\ref{lem:lattice}), rationally similar integral models suffice. In rank two the model is $UV$: nonzero levels give finitely many divisor pairs, and the zero level is the union of the axes. In rank three the model is $UV-Z^2=\det\left(\begin{smallmatrix}U&Z\\Z&V\end{smallmatrix}\right)$. Its zero level is $(U,V,Z)=(sa^2,sb^2,sab)$ \cite[Example~5]{Vas}. For $m\ne0$, classical binary reduction \cite[Example~7, p.~983]{Vas} gives representatives $\mathsf X=\left(\begin{smallmatrix}a&b\\b&c\end{smallmatrix}\right)$ with \[ 0<3a^2\le4|m|,\quad |b|\le|a|/2,\quad c=(m+b^2)/a\in\Z, \] or $a=c=0$ and $b^2=-m$. When $-m$ is a square, first use a primitive isotropic vector to obtain $\left(\begin{smallmatrix}0&b\\b&c\end{smallmatrix}\right)$, with $|c|\le|b|$. If $c\ne0$, move it to the first diagonal entry and reduce the off-diagonal entry modulo $c$; this gives the first case. Thus the list is finite, computable, and covers this case too. The maps $\mathcal V(\mathbf t)\mathsf X\mathcal V(\mathbf t)^{\mathsf T}$ therefore exhaust the level, using $46$ parameters each. In split rank four the model is the determinant on $M_2(\Z)$. For $m\ne0$, determinant-one row operations give the finite list \[ H_{d,b}=\begin{pmatrix}d&b\\0&m/d\end{pmatrix},\qquad d\mid |m|,\quad d>0,\quad 0\le b<|m/d|. \] Hence $\mathcal V(\mathbf t)H_{d,b}$ gives $46$ parameters per family, as in the orbit method of \cite[Example~8]{Vas}. At zero, every integer matrix of rank at most one is an outer product $\left(\begin{smallmatrix}a\\b\end{smallmatrix}\right)(c\ d)$, giving four parameters; see also \cite{GV}. In rank four of Witt index one, write the rational form as $uv+ax^2+by^2$. Then $\delta=-ab$ is not a square. Replace $Q,m$ by $-aQ,-am$ and set $U=-au$, $V=v$, $X=ax$, $Y=y$, giving \[ UV-X^2+\delta Y^2 =\det\begin{pmatrix}U&X+Y\sqrt\delta\\X-Y\sqrt\delta&V\end{pmatrix}. \] Put $E=\Q(\sqrt\delta)$ and use the Hermitian lattice \[ L_E=\left\{\begin{pmatrix}U&w\\\bar w&V\end{pmatrix}: U,V\in\Z,\ w\in\OO_E\right\},\qquad q_E(\mathsf X)=\det\mathsf X, \] where the bar is quadratic conjugation, also for real $E$. The action $\mathsf X\mapsto g\mathsf X\bar g^{\mathsf T}$ of $\SL_2(\OO_E)$ preserves $L_E$ and is polynomial over $\Z$ in an integral basis of $\OO_E$. Writing entries over $E$ in a rational basis defines the restriction-of-scalars group $\Res_{E/\Q}\SL_2$, whose rational points are $\SL_2(E)$. The action induces a surjective homomorphism \[ \varphi:\Res_{E/\Q}\SL_2\longrightarrow\SO(q_E) \] with kernel $\{I,-I\}$ \cite[Chapter~6, Theorem~7, and Chapter~9, pp.~80--81]{Knus}. Over an algebraic closure it becomes the action $(g,h):\mathsf X\mapsto g\mathsf Xh^{\mathsf T}$ on $M_2$; its kernel is the diagonal $\{I,-I\}$, and both groups are connected of dimension six, so the action is surjective. Lemma~\ref{lem:spinindex} shows that $\Gamma'_E=\varphi(\SL_2(\OO_E))$ has finite index in $\Gamma_{L_E}$. Composing the polynomial group maps above with this action and applying Lemma~\ref{lem:grouptransfer} proves the claim on $L_E$. Lemma~\ref{lem:lattice} transfers it to the original lattice. \end{proof} Together, Section~\ref{sec:complete} and Proposition~\ref{prop:low} prove the existence assertion in Theorem~\ref{thm:main}; Proposition~\ref{prop:effective-covers} supplies computability. \subsection{The equations \texorpdfstring{$zt-x^2-y^2=\pm1$}{zt-x²-y²=±1}}\label{subsec:gaussian} The Hermitian method already appears in Frisch--Vaserstein \cite[Proposition~1]{FV2}, which gives a five-parameter family for $zt=x^2+y^2$. For the two nonzero levels we use the classical Hermitian action \cite[Chapter~9]{EGM} and the following explicit orbit reduction. \begin{proof}[Proof of Proposition~\ref{cor:gaussian}] Put $R=\Z[i]$ and $g^*=\bar g^{\mathsf T}$. Associate $(x,y,z,t)$ with \[ \mathsf X=\begin{pmatrix}z&w\\\bar w&t\end{pmatrix},\quad w=x+iy,\qquad R_{u,\eta}=\begin{pmatrix}0&u\\\bar u&\eta\end{pmatrix}. \] Writing $a=a_1+ia_2$ and similarly for $b,c,d$, the constraints \eqref{eq:gaussian-parameters} say that $g=\left(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\right)\in\SL_2(R)$. Direct multiplication identifies \eqref{eq:gaussian-plus-explicit} with $\sigma gg^*$ and \eqref{eq:gaussian-minus-explicit} with $gR_{e+if,\eta}g^*$. Their determinants are $1$ and $-1$. The actions $\mathsf X\mapsto g\mathsf Xg^*$ and $\mathsf X\mapsto g^*\mathsf Xg$ have the same orbits. \emph{Level $1$.} The form $v\mapsto v^*\mathsf Xv$ is definite. In the positive case choose a Gaussian integer vector of least positive value $z$. Its coordinates have Gaussian gcd $1$, so it extends to a determinant-one basis. Subtracting a Gaussian multiple of its first vector from the second makes $|w|\le z/\sqrt2$. Minimality gives $t\ge z$, so $1=zt-|w|^2\ge z^2/2$. Thus $z=1$, $w=0$, $t=1$. Changing sign handles the negative case: there are exactly two orbits, represented by $I$ and $-I$. \emph{Level $-1$.} If $z\ne0$, the identity \[ z(v^*\mathsf Xv)=|zv_1+wv_2|^2-|v_2|^2 \] makes $(1-w,z)^{\mathsf T}$ isotropic; if $z=0$, use $(1,0)^{\mathsf T}$. Dividing by a Gaussian gcd and completing to a determinant-one basis gives $R_{u,t}$ with $u\in R^\times$. Adding $\lambda$ times the first basis vector to the second changes $t$ by $2\operatorname{Re}(\bar\lambda u)$, an arbitrary even integer. A diagonal unit change changes $u$ by a sign. Thus the representatives are $R_{u,\eta}$ with $u\in\{1,i\}$ and $\eta\in\{0,1\}$. Since \[ \mathcal U(i-1)R_{1,1}\mathcal U(i-1)^*=R_{i,1}, \] three suffice. They are inequivalent: $R_{1,1}$ represents $1$, whereas $R_{1,0}$ and $R_{i,0}$ represent only even integers; and the upper-right entry of $gR_{1,0}g^*$ satisfies $a\bar d+b\bar c\equiv ad+bc\equiv1\pmod{2R}$, so cannot equal $i$. This proves both explicit descriptions. Finally compose these orbit maps with a single polynomial parametrization of $\SL_2(R)$ from \cite[Theorem~1.9]{LN}, expanding each Gaussian parameter in the basis $1,i$. This gives exactly two and three integer-coefficient polynomial families, respectively. \end{proof} Two families are necessary at level $1$. A polynomial map whose integer values lie on this level satisfies the defining equation identically, hence also over $\R$. Its first diagonal coordinate $z$ never vanishes, since $zt=1+x^2+y^2>0$, so its sign is constant on the connected parameter space $\R^N$. One family cannot therefore contain integer points with both signs of $z$. For $E=\Q(i)$, the discriminant has one prime divisor, so Corollary~\ref{cor:single-imaginary-map} gives $13\,440$ integer parameters for each of these two or three families. Using instead Proposition~\ref{prop:effective-imaginary} gives a larger finite union with at most $2800$ parameters per family. These bounds are not optimized; they are much larger than the five parameters at level zero in \cite[Proposition~1]{FV2}. \subsection{Two rational hyperbolic planes}\label{subsec:two-planes} The following complement improves the parameter bounds when two hyperbolic planes are available. For the integral shape $x_1x_2+x_3x_4+q_0$, the finite-union assertion is already discussed after \cite[Corollary~4]{Vas}. The following argument extends it to forms splitting two planes only over $\Q$ and to arbitrary lattices. A vector $x\in L$ is \emph{$Q$-unimodular} if $B_Q(x,L)=\Z$. \begin{proposition}\label{prop:two-hyperbolic} Let $Q$ be a nondegenerate integral quadratic form in $n$ variables of rational Witt index at least two. Every $X_m(Q)$ is a finite union of polynomial families with at most $3n+80$ parameters each for $m\ne0$, and $3n+81$ for $m=0$. If the Witt index is at least three, the bounds improve to $3n-6$ and $3n-5$, respectively. \end{proposition} \begin{proof} By Lemmas~\ref{lem:hyperbolic-splitting} and~\ref{lem:lattice}, use the integral model $Q=x_1x_2+x_3x_4+q_0$; when available, split the third plane from $q_0$ as well. Put $\Gamma=\SO(Q,\Z)$ and $y=(1,m,0,\ldots,0)$. This vector is $Q$-unimodular. Vaserstein gives a polynomial map $\Phi$ onto all $Q$-unimodular vectors of value $m$, with $3n+80$ parameters \cite[Corollary~4]{Vas}, or $3n-6$ with three planes \cite[Proposition~3.4, p.~997]{Vas}. Take finitely many $\Gamma$-orbit representatives $x_i$, using only primitive vectors if $m=0$. Witt's extension theorem \cite[Chapter~IV, \S1.5, Theorem~3]{Serre} gives rational isometries $g_i x_i=y$. Choose $M_i\ge1$ such that $M_i g_i$ and $M_i g_i^{-1}$ are integral, and put $\Gamma_i=\{\gamma\in\Gamma:\gamma\equiv I\pmod{M_i^2}\}$. This subgroup has finite index, and \[ g_i(I+M_i^2A)g_i^{-1} =I+(M_i g_i)A(M_i g_i^{-1}) \] shows that $g_i\Gamma_i g_i^{-1}\subseteq\Gamma$. Choose left coset representatives $\gamma_{ij}$. For $h\in\Gamma_i$, the vector $g_i h x_i=(g_i h g_i^{-1})y$ is integral and $Q$-unimodular, so it is a value of $\Phi$. Consequently the rational polynomial map $\gamma_{ij}g_i^{-1}\Phi$ contains $\gamma_{ij}\Gamma_i x_i$ in its image and always has value $m$ under $Q$. Lemma~\ref{lem:filter} extracts its integral values without adding parameters. These maps exhaust the nonzero level; at zero, Lemma~\ref{lem:content-reduction} adds one scalar parameter. Lattice transfer preserves the bounds. All choices are effective. Take the $\Omega_{\Z^n}$-representatives from Appendix~\ref{sec:effective-orbits} and, if necessary, their images under a determinant-$-1$ generator to obtain the $x_i$. Generators of the integral isometry groups are computable \cite{GSalg}. Enumeration of rational isometries finds the $g_i$, and the finite images of $\Gamma$ modulo $M_i^2$ give the representatives $\gamma_{ij}$. \end{proof} For forms of rank at least five and Witt index at least two, Erovenko--Rapinchuk show that the integral special orthogonal groups are products of finitely many cyclic subgroups \cite[Main Theorem]{ER}; their Witt-index-one case requires an additional finite place. Rational Witt index one occurs in every rank at least two, as $uv+z_1^2+\cdots+z_{n-2}^2$ shows. The descent of Sections~\ref{sec:field}--\ref{sec:complete} treats all such forms of rank at least five. \section{Classification and constructive algorithms}\label{sec:decision} The following leading-term obstruction extends the observation in \cite[\S1]{LiuSarnak} and Vaserstein's Pell-equation example \cite[Example~9]{Vas}. \begin{lemma}[Anisotropic quadratic parts]\label{lem:anisotropic-families} Let $q$ be a rational quadratic form in $r$ variables anisotropic over $\Q$, let $\ell$ be a rational linear form, and let $d\in\Q$. For $N\ge0$, every polynomial map $\Phi\in\Q[t_1,\ldots,t_N]^r$ satisfying $q(\Phi)+\ell(\Phi)+d=0$ on $\Z^N$ is constant. \end{lemma} \begin{proof} The equality is a polynomial identity. If $e=\max_i\deg\Phi_i>0$, its degree-$2e$ part is $q(H)=0$, where $H$ is the nonzero degree-$e$ homogeneous part of $\Phi$. Choose an integer tuple $t$ with $H(t)\ne0$. Then $q(H(t))=0$, contradicting anisotropy. \end{proof} \begin{lemma}[Anisotropic indefinite levels in a congruence class] \label{lem:anisotropic-infinite} Let $q$ be an integral quadratic form anisotropic over $\Q$ and indefinite over $\R$. For integers $m_0\ne0$, $D_0\ge1$ and $\eta\in\Z^r$, the set $\{x\in\Z^r:q(x)=m_0,\ x\equiv\eta\pmod{D_0}\}$ is empty or infinite. \end{lemma} \begin{proof} Take a point $x_0$ in this set. By the real signature of $q$, the orthogonal complement of $x_0$ contains a real vector on which $q$ has sign opposite to $m_0$. Rational approximation in this rational subspace, followed by clearing denominators, gives $w\in\Z^r$ with $B_q(x_0,w)=0$ and $m_0q(w)<0$. The positive integer $N_0=-m_0q(w)$ is nonsquare, since $N_0=d^2$ would make $dx_0+m_0w$ a nonzero rational zero of $q$. By the Pell theorem \cite[pp.~182--183]{LenstraPell}, choose a unit $\lambda=a+c\sqrt{N_0}>1$ of norm $1$ in $\Z[\sqrt{N_0}]$. Taking a positive power makes $\lambda\equiv1\pmod{D_0}$ in this ring, since its reduction is a unit in a finite ring. Write $\lambda^j=a_j+c_j\sqrt{N_0}$. Then \[ x_j=a_jx_0+m_0c_jw,\qquad q(x_j)=m_0(a_j^2-N_0c_j^2)=m_0,\qquad x_j\equiv\eta\pmod{D_0}. \] These vectors are distinct because $x_0,w$ are independent and the positive powers of $\lambda$ are distinct. \end{proof} \subsection{The classification} \begin{theorem}[Quadratic polynomials]\label{thm:classification} Let $f=Q+\ell+c\in\Z[x_1,\ldots,x_n]$ have degree at most two, with $Q$ homogeneous quadratic and $\ell$ linear. If $Q=0$, its integer zero set is a finite union of polynomial families. Otherwise choose an integer basis whose last $s$ vectors span $\operatorname{Rad}(Q)\cap\Z^n$, and write \begin{equation}\label{eq:radical-form} f(y,z)=g(y)+a\cdot z,\qquad g(y)=q(y)+b\cdot y+c, \qquad (y,z)\in\Z^r\times\Z^s, \end{equation} where $q$ is nondegenerate, $a\in\Z^s$, $b\in\Z^r$ and $r+s=n$. Put $Y=\{y\in\Z^r:g(y)=0\}$. Then the integer zero set of $f$ is a finite union of polynomial families if and only if \[ a\ne0,\qquad\text{or}\qquad q\text{ is isotropic over }\Q, \qquad\text{or}\qquad Y\text{ is finite}. \] The first condition means that $\ell$ is nonzero on the radical; when it fails, the other two conditions are independent of the adapted basis. \end{theorem} \begin{proof} For $Q=0$, integer linear algebra gives either the empty set or one affine integer family, including the constant-polynomial cases. For $Q\ne0$, integer row and column reduction gives the adapted basis in \eqref{eq:radical-form}. If $a\ne0$, change the $z$-basis so that $a\cdot z=g_0z_1$, with $g_0>0$ the gcd of its entries. For each residue vector $\eta\in\{0,\ldots,g_0-1\}^r$ satisfying $g(\eta)\equiv0\pmod{g_0}$, use unrestricted integer parameters $t$ and $\mathbf s$ in \[ y=\eta+g_0t,\qquad z_1=-g(\eta+g_0t)/g_0,\qquad (z_2,\ldots,z_s)=\mathbf s. \] These have integer coefficients and exhaust the solutions. Suppose $a=0$. Completing the square gives $g(y)=q(y+\zeta)-c_0$, where $\zeta=G_q^{-1}b$ and $c_0=q(\zeta)-c$. Choose $D_\zeta\ge1$ with $D_\zeta\zeta\in\Z^r$. Then $u=D_\zeta(y+\zeta)$ identifies $Y$ with \begin{equation}\label{eq:coset-level} \{u\in\Z^r:q(u)=m_0,\quad u\equiv D_\zeta\zeta\pmod{D_\zeta}\},\qquad m_0=D_\zeta^2c_0\in\Z. \end{equation} For isotropic $q$, apply Theorem~\ref{thm:main} and Lemma~\ref{lem:filter}. The residue substitutions make the coefficients of $u-D_\zeta\zeta$ divisible by $D_\zeta$, so returning to $y$ and adjoining the free $z$-coordinates gives the required integer-coefficient families. For anisotropic $q$, Lemma~\ref{lem:anisotropic-families} makes the $y$-coordinates of every family constant. Hence a finite union exists exactly when $Y$ is finite; use $\{y_0\}\times\Z^s$ for each $y_0\in Y$. \end{proof} \begin{remark}[Degenerate forms]\label{rem:degenerate-announcement} Isotropy supplied by the radical is insufficient: $Q(x,y,z)=x^2-2y^2$ is isotropic, but $X_1(Q)$ is the product of an infinite Pell level with $\Z$, so Lemma~\ref{lem:anisotropic-families} excludes a finite polynomial cover. This qualifies the announcement in \cite[p.~982]{Vas} if it is read as including degenerate forms. \end{remark} \begin{remark}[The introductory example]\label{rem:intro-obstruction} The form $y^2+z^2-3x^2$ is anisotropic: a primitive integer zero would satisfy $3\mid y,z$ by reduction modulo $3$, and the equation would then force $3\mid x$. However, \[ (x,y,0)\longmapsto(7x+4y+2,\,12x+7y+3,\,0) \] preserves \eqref{eq:exintro} and, starting at zero, produces infinitely many solutions with strictly increasing first coordinate. Lemma~\ref{lem:anisotropic-families} therefore rules out a finite polynomial cover of \eqref{eq:exintro}. \end{remark} \subsection{Decision and construction} \begin{proof}[Decision part of Theorem~\ref{thm:decision}] Compute the data of Theorem~\ref{thm:classification}. The answer is affirmative if $Q=0$, $a\ne0$, or $q$ is isotropic. To decide isotropy, diagonalize over $\Q$ and multiply by a common denominator to obtain a form $\sum_{i=1}^r a_iX_i^2$, with $a_i\in\Z\setminus\{0\}$. Rank one is anisotropic; in rank two test whether $-a_1/a_2$ is a rational square. In ranks three and four, it suffices to test indefiniteness and local isotropy at the finitely many primes $p\mid2\prod_i a_i$; the explicit local criteria use only finite arithmetic with valuations and residue classes. In ranks at least five, Meyer's theorem reduces the test to indefiniteness. See \cite[Chapter~II, \S3; Chapter~III, \S1.2; Chapter~IV, Theorems~6 and~8]{Serre}. It remains to decide finiteness of $Y$ for anisotropic $q$ and $a=0$. In \eqref{eq:coset-level}, $m_0=0$ gives at most the point $y=-\zeta$. A definite form gives a bounded, hence finite, set. Otherwise $m_0\ne0$ and $q$ is indefinite. Apply Grunewald--Segal's decision procedure for a single quadratic equation \cite{GS81} to $g(y)=0$. An empty set gives an affirmative answer; a nonempty set is infinite by Lemma~\ref{lem:anisotropic-infinite}, giving a negative answer. \end{proof} \begin{proposition}[Effective construction for isotropic forms] \label{prop:effective-covers} Given a nondegenerate isotropic integral quadratic form $Q$ and $m\in\Z$, one can compute the polynomial families in Theorem~\ref{thm:main}. \end{proposition} \begin{proof} Once isotropy is known, enumerating integer vectors finds a rational isotropic vector; Lemma~\ref{lem:hyperbolic-splitting} then computes a hyperbolic splitting. In rank at least five, make the sign choice in Theorem~\ref{thm:high}, so the complementary form $q$, in $r$ variables, has positive index at least two, and find the orthogonal integral vectors $w,h$ by rational search. To find the field in Lemma~\ref{lem:field}, at stage $B$ test the first $B$ primes $P\equiv3\pmod8$ outside its prescribed finite exceptional set and all nonzero vectors $u+v\sqrt{-P}$ with $u,v\in\{-B,\ldots,B\}^r$. That lemma guarantees termination. Compute the splitting over $K=\Q(\sqrt{-P})$ by Lemma~\ref{lem:hyperbolic-splitting}. The descent maps now follow by polynomial arithmetic, using \cite[\S1, Proposition~1.5]{Vas} and every norm factor $1\le c0$, Cauchy--Schwarz gives $u_i^2\le2m_0(G_q^{-1})_{ii}$; enumerate this finite box and test \eqref{eq:coset-level}. For $m_0<0$ there are no solutions. Return to $y$, use the affine families $\{y_0\}\times\Z^s$, and undo the integer basis changes. All output coefficients are integers. \end{proof} \appendix \section{Effective polynomial parametrizations of groups}\label{sec:effective-groups} Larsen--Nguyen prove polynomial parametrizability of $\SL_2(\OO_E)$ for imaginary quadratic $E$ \cite[Theorem~1.9]{LN}; their Remark~1.10 suggests extracting a parameter bound. We give an explicit recipe and count the moves in their proof. The group map $\mathcal V$ in \eqref{eq:Vasmap} is obtained from the explicit construction in \cite[\S1, Proposition~1.5]{Vas}. \subsection*{The auxiliary polynomial matrix} With $\mathcal U,\mathcal L$ as in Lemma~\ref{lem:rowword}, put \[ J=\begin{pmatrix}0&-1\\1&0\end{pmatrix},\qquad \Xi(x,y)=\begin{pmatrix}1-xy&x^2\\-y^2&1+xy\end{pmatrix}. \] Set $\mathcal W_4(\mathbf x)=\Xi(x_2,x_4)\Xi(x_1,x_3)\Xi(x_2,x_4)J$. This is Vaserstein's $\Phi_4$ \cite[p.~989]{Vas}, with $\mathcal W_4(1,0,0,1)=I$. Substitute $\mathbf x=(1+z_5z_1,z_5z_2,z_5z_3,1+z_5z_4)$, write the resulting entries as $w_{ij}$, and set \[ \mathcal H(\mathbf z)= \begin{pmatrix}w_{11}&z_5w_{12}\\w_{21}/z_5&w_{22}\end{pmatrix}. \] Since $w_{21}$ vanishes at $z_5=0$, the division is exact in $\Z[\mathbf z]$. Thus $\mathcal H\in\SL_2(\Z[\mathbf z])$ and $\mathcal H(0)=I$. \begin{proposition}\label{prop:effective-imaginary} Given an integral basis of $R=\OO_E$ for an imaginary quadratic field $E$, one can compute finitely many polynomial maps whose images exhaust $\SL_2(R)$ in integer basis coordinates. Each map uses at most $10(216\nu+64)$ integer parameters, where $\nu$ is the number of distinct prime divisors of $\operatorname{disc}(E)$. \end{proposition} A row $(a,b)\in R^2$ is primitive if $aR+bR=R$. Write $\mu=|R^\times|$ and, for $x\ne0$, let $\mathrm e(x)$ be the exponent of $(R/xR)^\times$, with $\mathrm e(x)=1$ for a unit. We use the following precise arithmetic inputs. \begin{lemma}[Carter--Keller]\label{lem:ck-exponents} Suppose $aR,bR$ are nonzero coprime prime ideals and the residue characteristic of $bR$ does not divide $\mu$. For each rational prime $p_0$ ramified in $E$, there are $c\ne0$ and $\gamma\ge1$ such that \[ bc\equiv-1\pmod{aR},\qquad \gcd(\mathrm e(b),\mathrm e(c))=\mu\gamma, \] every prime divisor of $\gamma$ ramifies in $E$, and $p_0\nmid\gamma$. \end{lemma} \begin{proof} This is \cite[Lemma~1.6]{LN}, with ideal $aR$ and unit $-1$. The prime-ideal hypothesis also matches the printed statement of \cite[Lemma~4]{CK}; the extension discussed in \cite[Remark~1.7]{LN} is unnecessary here. \end{proof} For the initial prime-power step, we use the following specialization of Morgan--Rapinchuk--Sury in place of \cite[Lemma~3]{CK}, the input used in the proof of \cite[Theorem~1.9]{LN}. \begin{lemma}[Morgan--Rapinchuk--Sury]\label{lem:mrs-prime-power} If $(s,t)\in R^2$ is primitive, $s\ne0$, and $sR+\mu R=R$, then at most three elementary operations take it to $(a',\pi^\mu)$, where $a'\ne0$ and $\pi R$ is prime. \end{lemma} \begin{proof} In \cite[Lemma~4.4]{MRS}, take $S$ to consist of the archimedean places, write $s=\alpha r^\mu$ with $\alpha=s$, $r=1$, and choose the exponent $m=1$. The condition on the primes dividing $\alpha$ is $sR+\mu R=R$; the required congruence $m\equiv1\pmod{|(R/a'R)^\times|}$ is automatic. That lemma does not require infinitely many units. Primitivity and the nonunit $\pi^\mu$ imply $a'\ne0$. \end{proof} \begin{proof}[Proof of Proposition~\ref{prop:effective-imaginary}] Use words in the nine polynomial matrix types \[ \mathscr A=\{ \mathcal U(t),\mathcal L(t),J,J^{-1},-I, \mathcal H(\mathbf z),\mathcal H(\mathbf z)^{-1}, \mathcal H(\mathbf z)^{\mathsf T}, \mathcal H(\mathbf z)^{-\mathsf T}\}, \] with independent variables at each occurrence. This alphabet is closed under inverse and transpose, up to parameter changes. Compare matrices at cost $c$ if $N=XMY$ with $|X|+|Y|\le c$, where $|X|$ denotes word length. For primitive rows, the comparison is required for every pair of determinant-one completions. Completions of the same row differ by one left $\mathcal L$ factor. Thus each elementary operation, simultaneous sign change, or move $(a,b)\mapsto(b,-a)$ costs at most two. Costs add, and comparison with a word of length $d$ gives a word of length at most $c+d$. The polynomial moves of \cite[Propositions~1.3--1.5]{LN} have the following costs in this alphabet: \[ \begin{array}{@{}lcl@{}} \text{Comparison of primitive rows}&\text{Cost}&\text{Source}\\ \hline (1+ab,b^2c)\longleftrightarrow(1+ab,c)&5&\text{Proposition 1.3}\\ (1+ab,bc)\longleftrightarrow(1+ab,c)&23&\text{Proposition 1.4}\\ \operatorname{row}_1(A^n)\longleftrightarrow(a^n,b)&52&\text{Proposition 1.5} \end{array} \] In the last row, $A\in\SL_2(R)$ has first row $(a,b)$ and $n\ge0$. We justify the numerical costs and the explicit witnesses. For the square-factor move choose $d,e$ with $(1+ab)e-bcd=-a$ and put \[ A_0=\begin{pmatrix}1+ab&b^2c\\d&1+be\end{pmatrix},\qquad B_0=\begin{pmatrix}1+ab&c\\b^2d&1+be\end{pmatrix}. \] Both have determinant one, and direct multiplication gives $A_0B_0^{\mathsf T}=\mathcal H(a,c,d,e,b)$ and $B_0=\mathcal H(a,c,d,e,b)^{\mathsf T}JA_0J^{-1}$. These identities hold also for $b=0$. Three letters and the two completion changes give cost five. For the factor move \begin{equation}\label{eq:effective-factor} (1+ab,bc)\longleftrightarrow(1+ab,c), \end{equation} use the prime choices and reciprocity argument of \cite[Proposition~1.4]{LN}. Its replacements $c\mapsto c+(1+ab)d$, $a\mapsto a+ce$, $c\mapsto c+(1+ab)f$ use one elementary operation on each row, six in total, and arrange $a\equiv-r^2\pmod c$. The final chain is \[ \begin{split} (1+ab,bc)&\longleftrightarrow(1-r^2b,bc) \longleftrightarrow(1-r^2b,r^2b^2c)\\ &\longleftrightarrow(1-r^2b,c) \longleftrightarrow(1+ab,c). \end{split} \] It uses three elementary operations and the square-factor move with parameters $(-r,rb,c)$, for total cost $9\cdot2+5=23$. If $abc(1+ab)=0$, the rows either coincide or each reaches $(1,0)$ in at most two elementary operations, so the same bound holds. For the power move, the proof of \cite[Proposition~1.5]{LN} uses two factor moves, two sign changes, and one elementary operation, giving $2\cdot23+2\cdot2+2=52$. To make its factorizations explicit, set $\psi_{-1}=-1$, $\psi_0=0$, $\psi_{j+1}=T\psi_j-\psi_{j-1}$. For $n\ge1$, the following pairs $(r,s)\in\Z[T]^2$ satisfy $\psi_n=rs$, $r\mid\psi_{n-1}-1$, $s\mid\psi_{n-1}+1$: \[ \begin{array}{c|cc} n&r&s\\ \hline 2j&\psi_{j+1}-\psi_{j-1}&\psi_j\\ 2j+1&\psi_{j+1}-\psi_j&\psi_{j+1}+\psi_j. \end{array} \] These identities follow from the recurrence before evaluation in $R$. Since $A^n=\psi_n(\operatorname{tr}A)A-\psi_{n-1}(\operatorname{tr}A)I$, its first row $(a_n,b_n)$ has $b_n=brs$, $a_n\equiv-1\pmod r$, $a_n\equiv1\pmod s$, after evaluating at $T=\operatorname{tr}A$. Remove $s$, change sign, remove $r$, and change sign back; then $a_n\equiv a^n\pmod b$ gives the final elementary operation. Vanishing evaluated factors are covered by the degenerate cases of \eqref{eq:effective-factor}; no division in $R$ is needed. The case $n=0$ is immediate. \emph{Arithmetic reduction.} We first bound completions of primitive rows $(a^\mu,b)$ with $aR$ prime. By \cite[Theorem~3.3]{MRS}, a move $b\mapsto b+a^\mu t$ of cost two makes $bR$ prime with residue characteristic prime to $\mu$. Write the ramified rational primes as $p_1,\ldots,p_\nu$. Lemma~\ref{lem:ck-exponents} gives $c_i,\gamma_i$ with \[ bc_i\equiv-1\pmod a,\qquad \gcd(\mathrm e(b),\mathrm e(c_i))=\mu\gamma_i,\qquad p_i\nmid\gamma_i. \] Every prime divisor of $\gamma_i$ is among the $p_j$, so $\gcd(\gamma_1,\ldots,\gamma_\nu)=1$. Choose $\sum_i h_i\gamma_i=1$, a completion $M$ of $(a,b)$, and put \[ N_i=\begin{pmatrix}a&b\\c_i&(1+bc_i)/a\end{pmatrix}. \] For $h_i\ne0$, choose positive $s_i,t_i$ with $t_i-s_i=\lambda_i:=\mu|h_i|\gamma_i$, $\mathrm e(c_i)\mid s_i$ and $\mathrm e(b)\mid t_i$; the gcd condition permits this. The rows $(a^{t_i},b)$ and $(a^{s_i},c_i)$ each reach $(1,0)$ in two elementary operations. The power comparison applied to $N_i$ and $N_i^{\mathsf T}$ makes $N_i^{t_i}$ and $(N_i^{\mathsf T})^{s_i}$ words of length at most $52+4=56$. Hence $N_i^{\lambda_i}$ has length at most $112$. Two power comparisons, through the common row $(a^{\lambda_i},b)$, transfer this to $M^{\lambda_i}$ at cost $104$. Inversion handles negative $h_i$. Consequently \[ M^\mu=\prod_{i=1}^{\nu}M^{\mu h_i\gamma_i} \] has length at most $216\nu$. One final power comparison and the initial prime-producing move give $216\nu+54$ for every completion of $(a^\mu,b)$. The same bound holds for $a=0$ or $a\in R^\times$, where at most two elementary operations reduce the row to $(1,0)$. For an arbitrary primitive row with nonzero coordinates, one elementary operation makes its first coordinate nonzero and coprime to $\mu R$, by the Chinese remainder theorem. Apply Lemma~\ref{lem:mrs-prime-power} and then multiply by $J$ to obtain $(\pi^\mu,-a')$. These four elementary operations and the move by $J$ cost at most ten. Zero-coordinate cases take at most three elementary operations. Thus every matrix in $\SL_2(R)$ is a word of length at most $\ell_E=216\nu+64$. The output algorithm simply enumerates all words of length at most $\ell_E$ in $\mathscr A$, including the empty word, with independent variables. Each letter has at most five ring parameters. Expanding them in the given integral basis gives at most $10\ell_E$ integer parameters and integer coefficients. Surjectivity was proved above; none of its auxiliary arithmetic choices is needed to compute the maps. \end{proof} \begin{corollary}\label{cor:single-imaginary-map} One can compute a single polynomial parametrization of $\SL_2(R)$ with $48(216\nu+64)$ integer parameters. \end{corollary} \begin{proof} Use independent parameters in the block \[ \mathcal P=\mathcal U(t_1)\mathcal L(t_2) \mathcal U(t_3)\mathcal L(t_4) \mathcal H(\mathbf z_1)\mathcal H(\mathbf z_2)^{-1} \mathcal H(\mathbf z_3)^{\mathsf T}\mathcal H(\mathbf z_4)^{-\mathsf T}. \] Its $24$ ring parameters give a polynomial matrix whose image contains $I$ and every letter of $\mathscr A$: all factors take the value $I$, and the first four factors contain \[ \begin{aligned} J&=\mathcal U(-1)\mathcal L(1)\mathcal U(-1),& J^{-1}&=\mathcal U(1)\mathcal L(-1)\mathcal U(1),\\ -I&=\mathcal U(1)\mathcal L(-2)\mathcal U(1)\mathcal L(-2). \end{aligned} \] A product of $\ell_E$ independent copies of $\mathcal P$ contains every word of length at most $\ell_E$, so is surjective. Expanding its ring parameters gives $48\ell_E$ integer parameters. \end{proof} \begin{table}[htbp] \centering\small \caption{Upper bounds on integer parameters per family; $n$ is the rank. Here $\ell_E=216\nu+64$, where $\nu$ counts the distinct prime divisors of $\operatorname{disc}(E)$ for the quadratic field $E$ in the four-variable construction. Take the minimum over applicable rows. The bounds are not optimized.} \label{tab:cases} \begin{tabular}{@{}lcc l@{}} \toprule Case & $m\ne0$ & $m=0$ & Construction\\ \midrule Rank $2$ & $0$ & $1$ & Divisor pairs and axes\\ Rank $3$ & $46$ & $3$ & Vaserstein's models\\ Split rank $4$ & $46$ & $4$ & Row reduction\\ Rank $4$, real quadratic $E$ & $16$ & $17$ & Eight-factor word \cite{JZ}\\ Rank $4$, imaginary quadratic $E$ & $10\ell_E$ & $10\ell_E+1$ & Appendix~\ref{sec:effective-groups}\\ Rank $n\ge5$ & $5n+80$ & $5n+80$ & Uniform descent\\ Witt index at least $2$ & $3n+80$ & $3n+81$ & Proposition~\ref{prop:two-hyperbolic}\\ Witt index at least $3$ & $3n-6$ & $3n-5$ & Proposition~\ref{prop:two-hyperbolic}\\ \bottomrule \end{tabular} \end{table} \FloatBarrier \section{Effective reduction and orbit representatives}\label{sec:effective-orbits} We give a short constructive form of classical integral reduction that keeps a prescribed primitive first vector. It supplies the finite candidate list for the orbit algorithm below and applies to definite and indefinite forms alike. Integral congruence means $G\mapsto U^{\mathsf T}GU$ with $U\in\GL_n(\Z)$. \begin{lemma}[Gram matrices with a prescribed first vector] \label{lem:effective-grams} Given integers $n\ge1$, $\mathfrak d\ne0$ and $a$, one can compute a finite set $\mathcal C_n(\mathfrak d;a)$ of symmetric integer matrices with determinant $\mathfrak d$ and $(1,1)$-entry $a$ such that, whenever $G_0$ is symmetric integral with $\det G_0=\mathfrak d$ and a primitive $v\in\Z^n$ satisfies $v^{\mathsf T}G_0v=a$, some $U\in\GL_n(\Z)$ satisfies $Ue_1=v$ and $U^{\mathsf T}G_0U\in\mathcal C_n(\mathfrak d;a)$. Here $e_1$ is the first coordinate vector. \end{lemma} \begin{proof} Simultaneously construct a complete finite congruence list $\mathcal C_n(\mathfrak d)$ without a prescribed first entry. Dimensions zero and one are immediate, with the empty matrix having determinant $1$. Complete $v$ to an integer basis; subsequent changes fix its first vector. If $a\ne0$, write $G=\left(\begin{smallmatrix}a&b^{\mathsf T}\\ b&G_1\end{smallmatrix}\right)$ and set $G_*=aG_1-bb^{\mathsf T}$, whose determinant is $a^{n-2}\mathfrak d$. Reduce $G_*$ to $\mathcal C_{n-1}(a^{n-2}\mathfrak d)$ and reduce $b$ modulo $|a|$ by adding multiples of $v$ to the other basis vectors. These additions preserve $G_*$. Enumerating the residues and retaining the integral matrices with $G_1=(G_*+bb^{\mathsf T})/a$ gives the required list. If $a=0$, integer column reduction gives \[ \begin{pmatrix}0&\delta&0\\ \delta&a'&b'^{\mathsf T}\\0&b'&G_1\end{pmatrix}, \qquad \delta>0,\qquad \mathfrak d=-\delta^2\det G_1. \] Reduce $G_1$ to $\mathcal C_{n-2}(-\mathfrak d/\delta^2)$. Adding multiples of $v$ reduces $a'$ modulo $2\delta$ and $b'$ modulo $\delta$, without changing $G_1$ or the first row. Enumerate these residues and the finitely many $\delta^2\mid\mathfrak d$. To close the induction, replace the eigenvalues of $G_0$ by their absolute values, obtaining $G_+$ with determinant $|\mathfrak d|$ and $|x^{\mathsf T}G_0x|\le x^{\mathsf T}G_+x$. Minkowski's theorem \cite[Chapter~I, Theorem~(4.4)]{Neukirch}, applied to the convex symmetric body $G_+^{-1/2}[-2|\mathfrak d|^{1/(2n)},2|\mathfrak d|^{1/(2n)}]^n$ of volume $4^n$, gives, after division by content, a primitive $v$ with $|v^{\mathsf T}G_0v|\le4n|\mathfrak d|^{1/n}\le4n|\mathfrak d|$. Thus \[ \mathcal C_n(\mathfrak d) =\bigcup_{|a|\le4n|\mathfrak d|}\mathcal C_n(\mathfrak d;a). \] The prescribed lists use only lower-dimensional lists, so this completes the induction and the algorithm. \end{proof} The Grunewald--Segal algorithms \cite{GSalg}, announced as Algorithms~A1--A2 in \cite[p.~915]{GS79}, compute generators for the full integer-point group of a rational matrix algebraic group, and decide orbits in rational linear representations, returning a group element carrying one vector to the other when one exists. Their input includes the defining equations of a rational matrix algebraic group $G$ and a subgroup $\Gamma$ of its integer-point group $G(\Z)$, together with a membership test for $\Gamma$ and an upper bound for $[G(\Z):\Gamma]$. In both applications below we use the full group $G(\Z)$ itself, namely $\GL_n(\Z)$ or $\Omega_L$. Thus the index bound is $1$, and membership within $G(\Z)$ is automatic. \begin{lemma}\label{lem:effective-orbits} For a nondegenerate integral quadratic form on a specified lattice $L$, one can compute finite lists meeting every $\Omega_L$-orbit on each nonzero level and on the primitive zero level. \end{lemma} \begin{proof} In a basis of $L$, write $Q(x)=\tfrac12x^{\mathsf T}G_0x$ and $\mathfrak d=\det G_0$. Apply the orbit algorithm to $\GL_n(\Z)$ acting on symmetric matrices by $U\cdot S=U^{-\mathsf T}SU^{-1}$. For each $G\in\mathcal C_n(\mathfrak d;2m)$, this decides whether $U^{\mathsf T}G_0U=G$ and produces such a $U$ by inverting the returned group element. Retain $Ue_1$. Lemma~\ref{lem:effective-grams} gives all primitive orbits, including $m=0$. For $m\ne0$, include $c$ times the lists at $m/c^2$ for all positive $c$ with $c^2\mid m$, as in Lemma~\ref{lem:content-reduction}. \end{proof} For the Hermitian model, put $\Gamma'_E=\varphi(\SL_2(\OO_E))$ as in Section~\ref{sec:low}. Apply the generator algorithm to the integral isometry group $\Omega_{L_E}$. For $g\in\Omega_{L_E}$, membership in $\Gamma'_E$ is decidable: exclude determinant $-1$, and for determinant $1$ solve $\varphi(h)=g$ with $h\in\SL_2(E)$ in rational coordinates relative to an integral basis of $\OO_E$. Since $\ker\varphi=\{\pm I_2\}$, this polynomial system has at most two complex solutions. Exact elimination and factorization over $\Q$ compute its rational solutions; integral coordinates decide whether a lift lies in $\SL_2(\OO_E)$. Lemma~\ref{lem:spinindex} gives finite index in $\Omega_{L_E}$. Enumerate right cosets by multiplying known representatives by the generators and their inverses, using \[ \Gamma'_E\gamma_i=\Gamma'_E\gamma_j \quad\Longleftrightarrow\quad \gamma_i\gamma_j^{-1}\in\Gamma'_E. \] Stop when every retained representative has been processed. Finite index guarantees termination, without a numerical index bound. If $\gamma_i$ are these representatives and $v_j$ are the vectors from Lemma~\ref{lem:effective-orbits}, then $\gamma_iv_j$ meet all required $\Gamma'_E$-orbits. \begin{thebibliography}{99} \small \interlinepenalty=10000 \setlength{\itemsep}{2pt plus .3pt minus .3pt} \bibitem{Berggren1934} B.~Berggren, \emph{Pytagoreiska trianglar}, Tidskrift f\"or element\"ar matematik, fysik och kemi \textbf{17} (1934), 129--139. \bibitem{BHC}A. Borel and Harish-Chandra, \emph{Arithmetic subgroups of algebraic groups}, Annals of Mathematics (2) \textbf{75} (1962), 485--535. \href{https://doi.org/10.2307/1970210}{doi:\nolinkurl{10.2307/1970210}}. \bibitem{CK}D.~Carter and G.~Keller, \emph{Bounded elementary generation of $\SL_n(\OO)$}, American Journal of Mathematics \textbf{105} (1983), no.~3, 673--687. \href{https://doi.org/10.2307/2374319}{doi:\nolinkurl{10.2307/2374319}}. \bibitem{Cox}D.~A. Cox, \emph{Primes of the Form $x^2+ny^2$: Fermat, Class Field Theory, and Complex Multiplication}, second edition, Pure and Applied Mathematics, Wiley, Hoboken, NJ, 2013. \href{https://doi.org/10.1002/9781118400722}{doi:\nolinkurl{10.1002/9781118400722}}. \bibitem{Eichler}M.~Eichler, \emph{Quadratische Formen und orthogonale Gruppen}, Grundlehren der mathematischen Wissenschaften 63, Springer-Verlag, Berlin--G\"ottingen--Heidelberg, 1952. \href{https://doi.org/10.1007/978-3-662-01212-3}{doi:\nolinkurl{10.1007/978-3-662-01212-3}}. \bibitem{EGM}J.~Elstrodt, F.~Grunewald and J.~Mennicke, \emph{Groups Acting on Hyperbolic Space: Harmonic Analysis and Number Theory}, Springer Monographs in Mathematics, Springer, Berlin, 1998. \href{https://doi.org/10.1007/978-3-662-03626-6}{doi:\nolinkurl{10.1007/978-3-662-03626-6}}. \bibitem{ER}I.~V. Erovenko and A.~S. Rapinchuk, \emph{Bounded generation of $S$-arithmetic subgroups of isotropic orthogonal groups over number fields}, Journal of Number Theory \textbf{119} (2006), no.~1, 28--48. \url{https://arxiv.org/abs/math/0508480}. \bibitem{Frisch}S.~Frisch, \emph{Remarks on polynomial parametrization of sets of integer points}, Communications in Algebra \textbf{36} (2008), no.~3, 1110--1114. \href{https://doi.org/10.1080/00927870701776938}{doi:\nolinkurl{10.1080/00927870701776938}}. \bibitem{FL}S.~Frisch and G.~Lettl, \emph{Polynomial parametrization of the solutions of Diophantine equations of genus~0}, Functiones et Approximatio Commentarii Mathematici \textbf{39} (2008), no.~2, 205--209. \href{https://doi.org/10.7169/facm/1229696571}{doi:\nolinkurl{10.7169/facm/1229696571}}. \bibitem{FV1}S. Frisch and L. Vaserstein, \emph{Parametrization of Pythagorean triples by a single triple of polynomials}, Journal of Pure and Applied Algebra \textbf{212} (2008), no.~1, 271--274. \href{https://doi.org/10.1016/j.jpaa.2007.05.019}{doi:\nolinkurl{10.1016/j.jpaa.2007.05.019}}. \bibitem{FV2}S. Frisch and L. Vaserstein, \emph{Polynomial parametrization of Pythagorean quadruples, quintuples and sextuples}, Journal of Pure and Applied Algebra \textbf{216} (2012), no.~1, 184--191. \href{https://doi.org/10.1016/j.jpaa.2011.06.002}{doi:\nolinkurl{10.1016/j.jpaa.2011.06.002}}. \bibitem{GV}L.~H. Gallardo and L.~N. Vaserstein, \emph{Polynomial parametrization of integer matrices with given determinant}, Journal of Pure and Applied Algebra \textbf{218} (2014), no.~2, 321--322. \href{https://doi.org/10.1016/j.jpaa.2013.06.003}{doi:\nolinkurl{10.1016/j.jpaa.2013.06.003}}. \bibitem{Grechuk}B.~Grechuk, \emph{On the smallest open Diophantine equations}, ACM SIGACT News \textbf{53} (2022), no.~1, 36--57. \href{https://doi.org/10.1145/3532737.3532743}{doi:\nolinkurl{10.1145/3532737.3532743}}. Author's version: \url{https://arxiv.org/abs/2204.11624v1} (2022). \bibitem{GrechukList}B.~Grechuk, \emph{A systematic approach to Diophantine equations: open problems}, arXiv preprint, arXiv:2404.08518v4, 23 January 2026. \url{https://arxiv.org/abs/2404.08518v4}. \bibitem{GrechukBook}B.~Grechuk, \emph{Polynomial Diophantine Equations: A Systematic Approach}, Springer, Cham, 2024. \href{https://doi.org/10.1007/978-3-031-62949-5}{doi:\nolinkurl{10.1007/978-3-031-62949-5}}. \bibitem{GHS}V.~Gritsenko, K.~Hulek and G.~K.~Sankaran, \emph{Abelianisation of orthogonal groups and the fundamental group of modular varieties}, Journal of Algebra \textbf{322} (2009), no.~2, 463--478. \href{https://doi.org/10.1016/j.jalgebra.2009.01.037}{doi:\nolinkurl{10.1016/j.jalgebra.2009.01.037}}. \bibitem{GS79}F.~J. Grunewald and D.~Segal, \emph{The solubility of certain decision problems in arithmetic and algebra}, Bulletin of the American Mathematical Society (N.S.) \textbf{1} (1979), no.~6, 915--918. \href{https://doi.org/10.1090/S0273-0979-1979-14692-5}{doi:\nolinkurl{10.1090/S0273-0979-1979-14692-5}}. \bibitem{GSalg}F. Grunewald and D. Segal, \emph{Some general algorithms. I: Arithmetic groups}, Annals of Mathematics (2) \textbf{112} (1980), no.~3, 531--583. \href{https://doi.org/10.2307/1971091}{doi:\nolinkurl{10.2307/1971091}}. \bibitem{GS81}F.~J. Grunewald and D. Segal, \emph{How to solve a quadratic equation in integers}, Mathematical Proceedings of the Cambridge Philosophical Society \textbf{89} (1981), no.~1, 1--5. \href{https://doi.org/10.1017/S030500410005787X}{doi:\nolinkurl{10.1017/S030500410005787X}}. \bibitem{Guy}R.~K. Guy, \emph{Conference problems session conducted by J.~L. Selfridge}, in \emph{Number Theory} (Ottawa, 1996), R.~Gupta and K.~S. Williams (eds.), CRM Proceedings \& Lecture Notes \textbf{19}, American Mathematical Society, Providence, RI, 1999, 385--390; Beukers's Problem CNTA~5.15, p.~390. \bibitem{JZ}B.~W. Jordan and Y.~Zaytman, \emph{On the bounded generation of arithmetic $\SL_2$}, Proceedings of the National Academy of Sciences of the USA \textbf{116} (2019), no.~38, 18880--18882. \href{https://doi.org/10.1073/pnas.1907728116}{doi:\nolinkurl{10.1073/pnas.1907728116}}. Correction, \textbf{118} (2021), no.~32, e2111531118. \href{https://doi.org/10.1073/pnas.2111531118}{doi:\nolinkurl{10.1073/pnas.2111531118}}. Corrected preprint: \url{https://arxiv.org/abs/1810.12972v3}. \bibitem{Knus}M.-A. Knus, \emph{Quadratic Forms, Clifford Algebras and Spinors}, Seminars in Mathematics 1, IMECC--UNICAMP, Campinas, 1988. \url{https://people.math.ethz.ch/~knus/papers/campinas.pdf}. \bibitem{LN}M. Larsen and D.~Q.~N. Nguyen, \emph{Polynomial parametrization for $\SL_2$ over quadratic number rings}, International Mathematics Research Notices \textbf{2021}, no.~9, 6993--7003. \href{https://doi.org/10.1093/imrn/rnz046}{doi:\nolinkurl{10.1093/imrn/rnz046}}. In \url{https://arxiv.org/abs/1808.05349}, statements numbered $1.j$ in the published article are numbered $j$. \bibitem{LenstraPell}H.~W. Lenstra, Jr., \emph{Solving the Pell equation}, Notices of the American Mathematical Society \textbf{49} (2002), no.~2, 182--192. \url{https://www.ams.org/notices/200202/fea-lenstra.pdf}. \bibitem{LidlNiederreiter}R.~Lidl and H.~Niederreiter, \emph{Finite Fields}, 2nd ed., Encyclopedia of Mathematics and its Applications~20, Cambridge University Press, Cambridge, 1997. \href{https://doi.org/10.1017/CBO9780511525926}{doi:\nolinkurl{10.1017/CBO9780511525926}}. \bibitem{LiuSarnak}J.~Liu and P.~Sarnak, \emph{Integral points on quadrics in three variables whose coordinates have few prime factors}, Israel Journal of Mathematics \textbf{178} (2010), 393--426. \href{https://doi.org/10.1007/s11856-010-0069-y}{doi:\nolinkurl{10.1007/s11856-010-0069-y}}. \bibitem{MRS}A.~V. Morgan, A.~S. Rapinchuk and B. Sury, \emph{Bounded generation of $\SL_2$ over rings of $S$-integers with infinitely many units}, Algebra \& Number Theory \textbf{12} (2018), no.~8, 1949--1974. \href{https://doi.org/10.2140/ant.2018.12.1949}{doi:\nolinkurl{10.2140/ant.2018.12.1949}}. \bibitem{Neukirch}J. Neukirch, \emph{Algebraic Number Theory}, Grundlehren der mathematischen Wissenschaften 322, Springer, Berlin, 1999. \href{https://doi.org/10.1007/978-3-662-03983-0}{doi:\nolinkurl{10.1007/978-3-662-03983-0}}. \bibitem{PR}V. Platonov and A. Rapinchuk, \emph{Algebraic Groups and Number Theory}, translated by R.~Rowen, Pure and Applied Mathematics 139, Academic Press, Boston, 1994. \bibitem{Serre}J.-P. Serre, \emph{A Course in Arithmetic}, Graduate Texts in Mathematics 7, Springer, New York, 1973. \href{https://doi.org/10.1007/978-1-4684-9884-4}{doi:\nolinkurl{10.1007/978-1-4684-9884-4}}. \bibitem{Shoup}V.~Shoup, \emph{A Computational Introduction to Number Theory and Algebra}, second edition, Cambridge University Press, Cambridge, 2008. Author's version~2.5: \url{https://www.shoup.net/ntb/ntb-v2_5.pdf}. \bibitem{Sie72}C.~L. Siegel, \emph{Zur Theorie der quadratischen Formen}, Nachrichten der Akademie der Wissenschaften in G\"ottingen, Mathematisch-Physikalische Klasse II (1972), no.~3, 21--46. \bibitem{Skolem}Th.~Skolem, \emph{Diophantische Gleichungen}, Ergebnisse der Mathematik und ihrer Grenzgebiete 5, no.~4, Springer, Berlin, 1938. \bibitem{Vas}L.~N. Vaserstein, \emph{Polynomial parametrization for the solutions of Diophantine equations and arithmetic groups}, Annals of Mathematics (2) \textbf{171} (2010), no.~2, 979--1009. \href{https://doi.org/10.4007/annals.2010.171.979}{doi:\nolinkurl{10.4007/annals.2010.171.979}}. \bibitem{Voight}J. Voight, \emph{Quaternion Algebras}, Graduate Texts in Mathematics 288, Springer, Cham, 2021. \href{https://doi.org/10.1007/978-3-030-56694-4}{doi:\nolinkurl{10.1007/978-3-030-56694-4}}. \bibitem{Weber}H.~Weber, \emph{Beweis des Satzes, dass jede eigentlich primitive quadratische Form unendlich viele Primzahlen darzustellen f\"ahig ist}, Mathematische Annalen \textbf{20} (1882), 301--329. \href{https://doi.org/10.1007/BF01443599}{doi:\nolinkurl{10.1007/BF01443599}}. \bibitem{Zannier}U.~Zannier, \emph{Remarks on a question of Skolem about the integer solutions of $x_1x_2-x_3x_4=1$}, Acta Arithmetica \textbf{78} (1996), no.~2, 153--164. \href{https://doi.org/10.4064/aa-78-2-153-164}{doi:\nolinkurl{10.4064/aa-78-2-153-164}}. \end{thebibliography} \end{document}