On the largest prime factor of  quartic polynomial values: the cyclic and dihedral cases
Cécile Dartyge and James Maynard

Let $P(X)\in\Z [X]$ be an irreducible, monic, quartic polynomial with cyclic or dihedral Galois group. We prove that there exists a constant $c_P>0$ such that for a positive proportion of integers $n$, $P(n)$ has a prime factor $\ge n^{1+c_P}$.

§ INTRODUCTION

Let $P(X)\in\Z[X]$ be an irreducible degree  polynomial with $d\ge 2$. Assuming that there is no local obstruction, it is widely believed [17] that $P$ should take on infinitely many prime values, but unfortunately this conjecture remains completely open for all non-linear polynomials $P$.

As an approximation to this problem, one can look for integers $n$ for which $P(n)$ has a large prime factor. For general polynomials $P$, the best known bound is due to Tenenbaum [18], who shows that there are infinitely many integers $n$ such that $P(n)$ has a prime factor of size at least $n \exp((\log{n})^\alpha)$ for any $\alpha<2-\log{4}$. When the degree of $P$ is 5 or more, this is the best known result, but for some low degree polynomials, one can produce bounds which are much stronger.

Hooley [9] proved the first result of this kind, showing that the largest prime factor $P^+(n^2+1)$ of $n^2+1$ satisfies $P^+(n^2+1)>n^{11/10}$ infinitely often. The exponent $11/10$ has been improved by Deshouillers and Iwaniec [5], next by La Bretèche and Drappeau [2] and  the current record due to Merikoski [15] is that $P^+(n^2+1)>n^{1.279}$ infinitely often. Heath-Brown [8] showed that $P^+(n^3+2)>n^{1+10^{-303}}$ infinitely often.
Irving [10] proved fifteen years later that exponent $1+10^{-303}$ can be replaced by $1+10^{-52}$.
It seems plausible that the underlying methods could be adapted to more general degree 2 or degree 3 polynomials.

For degree 4 polynomials, results can currently only be obtained when the Galois group $G$ of $P(X)$ takes a simple form. When $P(X)=X^4-X^2+1$, the twelfth cyclotomic polynomial, Dartyge [4] proved that there are infinitely many
$n$ such that  $P^+(n^4-n^2+1)>n^{1+10^{-26531}}$.
La Bretèche [1] generalised this result to quartic irreducible even monic polynomials with Galois group isomorphic to the Klein group $V:=\Z /2\Z\times \Z/2\Z$.  For such polynomials $P$, he proved that there exists  $c_P>0$ such that  $P^+(P(n))>n^{1+c_P}$ for a positive proportion of integers $n$. It seems plausible that the methods of  [1] and [4] may be adapted for some more general quartic polynomials, but the condition that the Galois group is $V$ is crucial to the method.

In this work we obtain results for irreducible quartic polynomials with  Galois group isomorphic to the cyclic group   $C_4:=\Z/4 \Z$ or the  dihedral group  $D_4=\Z/2\Z\ltimes \Z/4\Z$. Our method  doesn't work for polynomials with Galois group $A_4$ or $S_4$ which are the most frequent Galois groups for quartic irreducible polynomials.
However, the fifth cyclotomic polynomial $\Phi_5 (X)=X^4+X^3+X^2+X+1$, $X^4-5X^2+5$, $X^4+13X+39$ are   examples of polynomials with cyclic Galois group and $X^4+2$, $X^4+3X+3$, $X^4-5X^2+3$ are polynomials with Galois group $D_4$. (cf. [3] for other examples of quartic polynomials with dihedral or cyclic Galois group).

Let $P(X)$ be a monic quartic irreducible polynomial with Galois group $C_4$ or $D_4$. Then there exists a constant $c_P>0$ such that for $x>x_0 (P)$,
we have

\begin{equation*}
|\{ x<n\le 2x : P^+ (P(n)) \ge x^{1+c_P}\} |\gg x.
\end{equation*}

The key new technical innovation behind our proof of Theorem <ref> is to incorporate `Type II' or `bilinear' information into the method of detecting large prime factors; previous approaches had relied solely on `Type I' information. This Type II information allows us to handle polynomials with Galois groups $C_4$ or $D_4$ which were out of reach of the Type I approach. In principle one could hope to handle the remaining possibilities $A_4$ or $S_4$ to cover all Galois groups by a similar procedure, but we do not know how to handle the relevant Type II estimates in this case, and so our paper is limited to $C_4$ and $D_4$.
Following the approaches of Heath-Brown [8], Dartyge [4] and La Bretèche [1], the key to obtaining estimates like Theorem <ref> is showing that a certain multivariate polynomial $q$ associated to $P(X)$ has a convenient prime factorisation for a positive proportion of its values.

For quartic $P(X)$, this associated polynomial $q=q(a_1,a_2,a_3)$ is a ternary sextic form.
If $P$ has a Galois group $V$, then $q(a_1,a_2,a_3)=q_1(a_1,a_2,a_3)q_2(a_1,a_2,a_3)q_3(a_1,a_2,a_3)$ is a product of 3 ternary quadratic forms, and the methods of [4] and [1] could then produce many suitable prime factorisations by showing equidistribution of $q_1$ and $q_2$ in suitable arithmetic progressions[Similarly, in the work of Heath-Brown [8] dealing with cubic $P(X)$, the associated form $q$ is a binary cubic, and it suffices to just obtain distribution estimates for $q$ in arithmetic progressions]. (This is why we refer to their methods as `Type I' methods.) When $P$ has a larger Galois group, then the form $q(a_1,a_2,a_3)$ is the product of a quartic and a quadratic (if $G=C_4$ or $D_4$) or is an irreducible sextic (if $G=A_4$ or $S_4$). Unfortunately one cannot obtain a suitable factorisation by just considering analogous equidistribution in arithmetic progressions in these cases, since one would need to work with moduli which are too large for equidistribution to occur.

We find that if $G=C_4$ or $D_4$, the ternary quartic factor of $q$ has the additional algebraic structure of being an `incomplete norm form'. Maynard [14] produced various Type II estimates which were used to count prime values of incomplete norm forms. By adapting the ideas underlying these estimates to our situation we are able to show that $q$ has a convenient prime factorisation for a positive proportion of its values. This part corresponds to Theorem <ref> announced in Section <ref>.

Combining this result with the previous machinery (suitably generalised to our situation) then yields Theorem <ref>.

§.§ Outline of the proof of Theorem <ref>

The proof of Theorem <ref> takes three key steps. Step 1 is an argument due to Heath-Brown [8] (see also [6]), which reduces the problem to showing the existence of many integers where $P(n)$ has an unusually large friable part (i.e. a part without large prime factor).

Step 2 follows and generalises [8, 4, 1] and shows that by using the $q$-analogue of Van der Corput's method, it suffices to show that a certain ternary form $q(a_1,a_2,a_3)$ associated to $P$ takes many values with a suitable prime factorisation. This step makes use of the fact that $P$ is a quartic polynomial. The key new ingredient in our work is Step 3, where we establish that $q(a_1,a_2,a_3)$ takes on many values with the suitable prime factorisation when $P$ has Galois group $C_4$ or $D_4$. For this final step we incorporate ideas of Maynard [14] on prime values of incomplete norm forms.

Step 1: Reduction to many integers with large friable part.

Let $r_1\in\overline{\Q}$ be a root of $P(n)$, $K=\Q(r_1)$ and $N_P=N_{K/\Q}$ the associated norm. Then we see that $N_P(n-r_1)=P(n)$, and so we are interested in counting integers $n$ such that the ideal $(n-r_1)$ has a prime ideal factor of large norm. In particular,

\[
\sum_{\substack{n\in[x,2x]\\ P^+(P(n))\ge x^{1+\eta}}}1=\sum_{\substack{n\in[x,2x]\\ \exists \pf|(n-r_1):\,N_P(\pf)\ge x^{1+\eta}}}1\gg \frac{1}{\log{x}}\sum_{n\in[x,2x]}\sum_{\substack{\pf^e|(n-r_1)\\ N_P(\pf)\ge x^{1+\eta} }}\log N_P(\pf).
\]

By inclusion-exclusion and the fact that $\sum_{\pf^e|(n-r_1)}\log{\pf}=\log P(n)$, we have that the double sum on the right hand side is given by

\[
\sum_{n\in[x,2x]}\log P(n)-\sum_{n\in[x,2x]}\sum_{\substack{\pf^e|(n-r_1)\\ N_P(\pf)\le 2x}}\log N_P(\pf)-\sum_{n\in[x,2x]}\sum_{\substack{\pf^e|(n-r_1)\\ 2x<N_P(\pf)< x^{1+\eta} }}\log N_P(\pf).
\]

Since $P(n)\asymp n^4$, the first sum is $(4+o(1))x\log{x}$. Swapping the order of summation and applying the Prime Ideal Theorem shows that the second sum is $(1+o(1))x\log{x}$. Let $\cA$ be the set of integers $n$ with $\sum_{\pf|(n-r_1),N_P(\pf)\le 2x}\log{N_P(\pf)}\ge (1+\delta_0)\log{x}$. We split the third sum according to whether $n\in\cA$ or not. Therefore the above expression is

\begin{align*}
(3+o(1))x\log{x}-\!\sum_{\substack{n\in[x,2x]\\ n\in \cA}}\sum_{\substack{\pf^e|(n-r_1)\\ 2x<N_P(\pf)< x^{1+\eta} }}\!\!\!\!\!\!\!\!\log N_P(\pf)-\sum_{\substack{n\in[x,2x]\\ n\notin \cA}}\sum_{\substack{\pf^e|(n-r_1)\\ 2x<N_P(\pf)< x^{1+\eta} }}\!\!\!\!\!\!\!\!\log N_P(\pf).
\end{align*}

If $n\in \cA$ then since prime ideals with $N_P(\pf)\le 2x$ contribute at least $(1+\delta_0)\log{x}$ to $\sum_{\pf|(n-r_1)}\log{N_P(\pf)}=(4+o(1))\log{x}$, the contribution from prime ideals with $N_P(\pf)>2x$ must be $\le(3-\delta_0-o(1))\log{x}$. If $n\notin \cA$ then we note from size considerations there can be at most 3 prime ideals with $N_P(\pf)\ge 2x$ dividing $(n-r_1)$, and so the inner sum over $\pf$ is at most $3(1+\eta)\log{x}$. Substituting these bounds into the above, we find

\[
\sum_{n\in[x,2x]}\sum_{\substack{\pf^e|(n-r_1)\\ N_P(\pf)\ge x^{1+\eta} }}\log N_P(\pf)\ge \delta_0\#\cA\log{x}-(3\eta+o(1)) x \log{x}.
\]

In particular, if $\#\cA\gg x$ then choosing $\eta=\delta_0\#\cA/(4x)$ shows that the left hand side is $\gg x\log{x}$. Thus it suffices to show

\[
\#\Bigl\{n\in[x,2x]:\, \prod_{\substack{\pf^e|(n-r_1)\\ N_P(\pf)\le x}}N_P(\pf)\ge x^{1+\delta_0}\Bigr\}\gg x.
\]

Step 2: Reduction to values of a polynomial with convenient factorisation.

By concentrating on multiples of friable principle ideals $\gJ=(a_0+a_1r_1+a_2r_1^2+a_3r_1^3)$ of norm $\asymp x^{1+\delta_0}$, where $r_1$ is a root of $P$, we find it suffices to show there is some dense set $\cA\subset \ZZ^4\cap[1,x^{(1+\delta_0)/4}]$ such that

\[
\sum_{\substack{(a_0,a_1,a_2,a_3)\in\cA}}\sum_{\substack{n\in [x,2x]\\ (a_0+a_1r_1+a_2r_1^2+a_3r_1^3)|(n-r_1)}}1\gg x.
\]

The condition $(a_0+a_1r_1+a_2r_1^2+a_3r_1 ^3)|(n-r_1)$ is equivalent to a congruence condition $n\equiv k_{\aa}\Mod{N_P(a_0+a_1r_1+a_2r_1^2+a_3r_1^3)}$, and so by completion of sums and swapping the order of summation, it suffices to obtain a power-saving in the exponential sums (for small integers $h\ne 0$ and with the standard notation $\e (t)=\exp (2i\pi t)$)

\[
\sum_{a_0,a_1,a_2,a_3\in \cA}\e\Bigl(\frac{h k_{a_0,a_1,a_2,a_3}}{N_P(a_0+a_1r_1+a_2r_1 ^2+a_3r_1 ^3)}\Bigr).
\]

This is complicated by the fact that the variables $a_0,a_1,a_2,a_3$ appear in both the numerator and denominator. However, for quartic $P$ we find that there are polynomials $B_{14}(a_0,a_1,a_2,a_3), B_{13}(a_0,a_1,a_2,a_3)$ and $q(a_1,a_2,a_3)$ with no common factor such that

\[
\e\Bigl(\frac{h k_{a_0,a_1,a_2,a_3}}{N_P(a_0+a_1r_1+a_2r_2+a_3r_3)}\Bigr)\approx \e\Bigl(\frac{hB_{13}(a_0,a_1,a_2,a_3)\overline{B_{14}(a_0,a_1,a_2,a_3)}}{q(a_1,a_2,a_3)}\Bigr),
\]

and now the denominator is independent of $a_0$. We wish to obtain a power-saving estimate for the sum over $a_0$, but this is complicated by the fact that the modulus of the expression $q(a_1,a_2,a_3)\asymp x^{6(1+\delta_0)/4}$ is much larger than the length $x^{(1+\delta_0)/4}$ of summation of $a_0$. To estimate such short exponential sums, we can use the $q$-analogue of Van der Corput's method provided the modulus $q(a_1,a_2,a_3)$ consists only of small prime factors.

Thus our task has reduced to showing that for a positive proportion of integers $a_1,a_2,a_3\in [1,x^{(1+\delta_0)/4}]$ we can ensure that the polynomial $q(a_1,a_2,a_3)$ has a convenient prime factorisation. Specifically, we will require that

\begin{equation}\label{factoring}
q (a_1,a_2,a_3)=d_0d_1\cdots d_r\end{equation}

where $d_0< x^{2-\varepsilon}$, $\max (d_1,\ldots ,d_r)\le x^{1-\varepsilon}$, $\min (d_0,\ldots ,d_r)\ge x^\varepsilon$ for some fixed $\varepsilon >0$.

Step 3: Counting factorisations of incomplete norm forms

So far we have followed a similar approach to the works [4, 1]. If the Galois group of $P$ is the Klein group, then it turns out that the polynomial $q(a_1,a_2,a_3)$ is the product of three quadratic polynomials. By considering the distribution in suitable residue classes one can then guarantee that each quadratic has a suitable factor, and so $q(a_1,a_2,a_3)$ then has a suitable prime factorisation.

When the Galois group of $P$ is $C_4$ or $D_4$, it turns out that $q(a_1,a_2,a_3)=q_1(a_1,a_2,a_3)q_2(a_1,a_2,a_3)$ is the product of a quartic polynomial and a quadratic polynomial. Unfortunately the fact that one factor is quartic means that one cannot guarantee a suitable prime factorisation by looking at variables in residue classes to reasonably small moduli. The difficulty here is that $q_1(a_1,a_2,a_3)\approx (\max_i a_i)^4$, so the size of the values considered are very  large compared to the size of the variables $a_i$. Indeed, it is not known that an arbitrary ternary quartic form $q_1$ takes infinitely many values compatible with the factorisation (<ref>).

Fortunately in our problem the form $q_1$ is not arbitrary, and in fact we can show that $q_1$ corresponds to an incomplete norm form of a number field.  More precisely, we prove that there exist a number field $K$ of degree 4 over $\Q$ depending only on $P$ and some elements
$\nu_1,\nu_2,\nu_3\in K$ such that $q_1(a_1,a_2,a_3)=N_{K/\Q} (\sum_{i=1}^3a_i\nu_i)$.

Maynard [14] gave asymptotic formulae for the number of primes represented by incomplete norm forms; that is
primes  $p$ such that $p=N(a_1+a_2\omega +\cdots +a_{n-k}\omega^{n-k-1})$ where $a_1,\ldots ,a_{n-k}$  are integers, $\omega$ is a root of monic and irreducible polynomial $f\in\Z [X]$ of degree $n\ge 4k$ and $N$ is a norm of the corresponding number field. For $k=1$ and $n=4$ this result counts values quartic norms in $3$ variables with a particular type of prime factorisation. We adapt the methods of [14] to our situation to count representations of the type (<ref>). Unfortunately we require various additional technical conditions (such as a localized version of Maynard's estimates where the variables lie in suitable arithmetic progressions), which means that large parts of [14] have to be generalised to our specific situation.
Once suitable technical estimates have been obtained, we find (<ref>) is satisfied for a positive proportion of $a_1,a_2,a_3$, as required.

§ ACKNOWLEDGEMENTS

CD was supported by ANR grant ANR-20-CE91-0006.

JM is supported by a Royal Society Wolfson Merit Award, and this project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 851318). Part of this work was conducted while JM was visiting the Institute for Advanced Study in Princeton.

§ INITIAL STEPS

Following the argument of Heath-Brown sketched as `step 1' in our outline, we have the following result.

Let $P\in\Z [X]$ be an irreducible quartic and monic polynomial of degree $4$ with root $r_1$, and let

\begin{equation}\label{defcE}
\cE(\delta):=\{ X<n\le 2X : \prod_{\substack{\pf^e|(n-r_1)\\ N_P(\pf)\le x}}N_P(\pf)\ge X^{1+\delta}\}.
\end{equation}

If $\delta_0, \delta_1>0$ are such that for all $X$ large enough in terms of $\delta_0,\delta_1, P$ we have $|\cE (\delta_0)|>\delta _1X$, then we have for sufficiently large $X$

\begin{equation*}
|\{ n\in]X,2X] : P^+ (P(n)) \gg X^{1+\frac{\delta_0\delta_1}{3}}\}|\ge (\delta_1\delta_0^2+o(1))X.
\end{equation*}

This is essentially <cit.>, (or <cit.>) after noting that $\sum_{p|P(n),p\le z}\log{p}\ge\sum_{\pf|(n-r_1),N_P(\pf)\le z}\log{N_P(\pf)}$.

Thus it suffices to show that $|\cE(\delta_0)|\gg X$ for some small absolute constant $\delta_0>0$. To do this we will choose a set of ideals $\cJ$ (the explicit, technical choice is made in Section <ref>) such that

\begin{align}
\prod_{\substack{\pf^e|\gJ\\ N_P(\pf)\le X}}N_P(\pf)&\ge X^{1+\delta_0} \qquad\qquad\forall \gJ\in\cJ.\label{eq:JProp1}
\end{align}

Let $\cJ_2:=\{\gJ\in\cJ:\,P^-(N_P(\gJ))\ge X^{\theta_0}\}$ for some small absolute constant $\theta_0>0$. Then we see that for any $n\in[X,2X]$ there are at most $2^{4\theta_0^{-1}}$ ideals $\gJ\in\cJ_2$ with $\gJ|(n-r_1)$, since $(n-r_1)$ can have at most $4\theta^{-1}$ prime ideal factors with norm bigger than $X^{\theta_0}$.

We then see that

\begin{align*}
|\cE(\delta_0)|&\ge |\{ X<n\le 2X : \exists\ \gJ\in\cJ_2\ {\rm such}\ {\rm that}\ \gJ| (n-r_1)\}|\\
&\ge \frac{\sum_{\gJ\in\cJ_2}|\cE_\gJ|}{\sup_{X\le n\le 2X}|\{\gJ\in\cJ_2:\,\gJ|(n-r)\}|}\\
&\gg \sum_{\substack{\gJ\in\cJ\\ P^-(N_P(\gJ))\ge X^{\theta_0}}}|\cE_\gJ|,
\end{align*}

where  $\cE_\gJ:=\{ X<n\le 2X : \gJ| (n-r_1)\}$. Every ideal $\gJ$ has at most $\alpha_0^{-1}$ representations as $\gJ=KL$ for $K$ a prime ideal with $N_P(K)\in[X^{4\alpha_0},X^{5\alpha_0}]$. Thus we see that

\[
|\cE(\delta_0)|\gg \sum_{\substack{K \in\cK}}\sum_{\substack{P^-(N_P(L))\ge X^{\theta_0}\\ KL\in\cJ}}|\cE_{KL}|,
\]

\begin{equation}
\cK:=\Bigl\{K\text{ prime ideal,}\  N_P(K)\in [X^{4\alpha_0},X^{5\alpha_0}]\Bigr\}.
\label{eq:KDef}
\end{equation}

We apply a linear sieve of level $X^{3\theta_0}$ to bound the condition $P^-(N_P(L))\ge X^{\theta_0}$ from below, giving

\[
|\cE(\delta_0)|\gg\sum_{K\in\cK}\sum_{KL\in\cJ}\Biggl(\sum_{d|N_P(L)} \lambda_d^-\Biggr )|\cE_{KL}|
\]

where $\lambda_d^-$ are the usual Rosser-Iwaniec lower bound linear sieve weights ([12] and [11]) supported on $d<X^{3\theta_0}$ with $p|d\Rightarrow p\le X^{\theta_0}$. We see that if $X$ is large enough $\cE_\gJ$ has density $\rho_P(N_P(\gJ))/N_P(\gJ)$, where

\begin{equation}
\varrho_P (\gI):={\rm card}
\{0\le n< N_P(\gI): n\equiv r_1\Mod \gI\}.
\label{eq:RhoPDef}
\end{equation}

With this in mind, we define the error $R_\gJ$ in the approximation by

\begin{equation}\label{defRJ}
R_\gJ:=|\cE_\gJ|-X\frac{\varrho_P (N_P(\gJ))}{N_P(\gJ)}.
\end{equation}

\begin{equation*}
|\cE _1|\gg XS_0+S_1,
\end{equation*}

\begin{equation}\label{defS0S1}\begin{split}
S_0&:=\sum_{K\in\cK}\sum_{KL\in\cJ (K)}\Bigg (\sum_{d|N_P(L)}\lambda_d^-\Bigg )\frac{\varrho _P (KL)}{N_P(KL)},\\
S_1&:=\sum_{K\in\cK}\sum_{KL\in\cJ (K)}\Bigg (\sum_{d|N_P(L)}\lambda_d^-\Bigg )R_{KL}.
\end{split}
\end{equation}

To obtain Theorem <ref> we see it suffices to prove the following two key propositions.

[Estimate for $S_0$]
Let $\theta_0$ be sufficiently small, and $\cJ$ be the set of ideals described in Section <ref>. Then we have

\[
S_0\gg 1.
\]

[Estimate for $S_1$]
Let $\theta_0$ be sufficiently small, and  $\cJ$ be the set of ideals described in Section <ref>. Then we have

\[
\]

Together these propositions rely heavily on our key technical result, Theorem <ref>. Section <ref> is devoted to establishing Proposition <ref>, which uses the fact that $\cJ$ is a set of ideals with small prime factors to bound the relevant exponential sums. Section <ref> is devoted to establishing Proposition <ref> assuming Theorem <ref>. The rest of the paper is then devoted to establishing Theorem <ref>, which asserts that $\cJ$ is a  set of nonzero density.

§ LOCALISED DIVISORS OF VALUES OF INCOMPLETE NORM FORMS

As described in the outline, the key to the proof of Theorem <ref> is to show that for a positive proportion of $a_1,a_2,a_3$ (in a box like $[A,2A]^3$) an auxiliary polynomial $q(a_1,a_2,a_3)=q_1(a_1,a_2,a_3)q_2(a_1,a_2,a_3)$ takes values where $P^+(q_2(a_1,a_2,a_3))<A^{2-\epsilon}$ and $P^+(q_1(a_1,a_2,a_3))<A^{1-\epsilon}$. The term $q_2$ will be a quadratic form, and so $P^+(q_2(a_1,a_2,a_3))<A^{2-\epsilon}$ if $p|q_2(a_1,a_2,a_3)$ for some $p\in [A^{2\epsilon},A^{3\epsilon}]$, which occurs if $a_1,a_2,a_3$ lie in suitable residue classes $\Mod{p}$. Thus it suffices to show that there are the expected number of $(a_1,a_2,a_3)$ such that $P^+(q_1(a_1,a_2,a_3))<A^{1-\epsilon}$ and $(a_1,a_2,a_3)$ lies in a suitable residue class modulo $p$ on average over $p\in[A^{2\epsilon},A^{3\epsilon}]$. Since $q_1$ will be an incomplete norm form for a quartic extension, we see that we are therefore counting friable values of an incomplete norm form (with some additional congruence constraints). The aim of this section is to introduce the notation to state Theorem <ref>, and then to explain how this technical statement relates to our specific problem by giving a suitable asymptotic for such friable values of auxiliary forms.

Let $K$ be a quartic extension of $\Q$ with a $\Z$-basis $\{\nu_1,\nu_2,\nu_3,\nu_4\}$ for $\Oc_K$ such that $\nu_1=1$ and $K=\Q (\nu_2)$. Given a large value $X$, we wish to count the number of $(a_1,a_2,a_3)$ in a small box such that $N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)$ has only small prime factors, and such that an auxiliary quadratic form $f(a_1,a_2,a_3)$ is a multiple of some fairly small $p\in [X^{\tau},X^{\tau'}]$.

With this in mind, we consider the box $\cX$ given by

\begin{align}
\cX&:=\prod_{i=1}^3[X_i,X_i(1+\eta_1)[,
\label{eq:cXDef}
\end{align}

where $\eta_1\in\R$ and $X_1,X_2,X_3\in\Z$ are parameters satisfying

\begin{align}
\eta_1&:=(\log{X})^{-100},
\label{eq:etaDef}\\
\label{eq:Xi1}\\
N_{K/\Q}(X_1\nu_1+X_2\nu_2+X_3\nu_3)&\ge \eta_1^{1/10}\max_i(X_i^4).
\label{eq:Xi2}
\end{align}

We are then interested in the sets

\begin{equation}\label{setN}
\begin{split}
\cA&:=\{(a_1,a_2,a_3)\in \Z^3\cap\cX\},\\
\cA (\u_0,m,p)&:=\{ (a_1,a_2,a_3)\in\cA : \a\equiv \u_0\Mod m,\ p|f(a_1,a_2,a_3)\},\\
\cA_d (\u_0, m,p)&:=\{ (a_1,a_2,a_3)\in  \cA (\u_0,m,p): d|N_{K/\Q} (a_1\nu_1+a_2\nu_2+a_3\nu_3)\}.
\end{split}
\end{equation}

Since we wish to count points when $N_{K/\Q} (a_1\nu_1+a_2\nu_2+a_3\nu_3)$ has small prime factors, we will count how often $d|N_{K/\Q} (a_1\nu_1+a_2\nu_2+a_3\nu_3)$ for an integer $d$ of the form $d=q_1\cdots q_\ell$ where each $q_i$ is a prime localised to lie in an interval $[X^{\theta_{j}},X^{\theta_{j}'}]$ for some fixed constants $\theta_i,\theta_i'$. We will require $\theta_{j},\theta_{j}'$ satisfy the following conditions.

* (Non-trivial intervals counting primes which are not too large)

\begin{equation}
\delta<\theta_i<\theta_i'<1-\delta\quad\forall\, 1\le i\le \ell.
\label{eq:th1}
\end{equation}

* ($q_{1j}$ are distinct primes)

\begin{equation}
[\theta_i,\theta_i']\cap[\theta_j,\theta_j']=\emptyset \quad\forall \,1\le i<j\le \ell .
\label{eq:th2}
\end{equation}

* ($\prod_{j=1}^\ell q_{1j}$ is not too large to divide $N$)

\begin{equation}
\sum_{i=1}^\ell\theta_i'<4-\delta.
\label{eq:th3}
\end{equation}

* (Impossible for $q_{1j}^2$ to divide $N(a_1\nu_1+a_2\nu_2+a_3\nu_3)$)

\begin{equation}
\theta_j+\sum_{i=1}^\ell\theta_i>4+\delta\quad \forall\,1\le j\le \ell.
\label{eq:th4}
\end{equation}

* (The product of the first $q_{1i}$ is of controlled size) There exists $\ell '\in [1,\ell-1]$ such that

\begin{equation}
1+\delta<\sum_{i=1}^{\ell '}\theta_i<\sum_{i=1}^{\ell '}\theta_i'<2-\delta.
\label{eq:th5}
\end{equation}

The conditions (<ref>)-(<ref>) are minor constraints to avoid some technical issues and to ensure that we expect that $d|N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)$ can actually occur; these constraints could be significantly weakened at the cost of some effort. The condition (<ref>) is a technical condition which is vital for our method.

To avoid some further technical issues we will focus on the case when the quadratic form $f$ is irreducible but not geometrically irreducible, and so the condition $f(a_1,a_2,a_3)$ becomes a product of two linear factors over $\F_p$ after restricting $p$ to an arithmetic progression. Again, this setup could be relaxed at the cost of additional technical effort, but is the situation that arises when dealing with Theorem <ref>.  It would be also interesting to have a more general result for incomplete norm forms and ternary forms $f$.

Finally we are in a position to state our counting result.

[localised factors of values of incomplete norm forms]
Let $f(X_1,X_2,X_3)\in\Z[X_1,X_2,X_3]$ be a homogeneous quadratic polynomial which splits into two distinct linear factors

over a suitable extension of $\Q$.
Let $D_f\in\N$ such that if $p\equiv 1\Mod{D_f}$ then the $\F_p$-reduction of the two linear forms $L_1 (X_1,X_2,X_3)$, $L_2 (X_1,X_2,X_3)$ are in $\F_p [X_1,X_2,X_3]$.

Let $K$ be a quartic extension of $\Q$ with $\{\nu_1,\nu_2,\nu_3,\nu_4\}$ being a $\Z$-basis for $\Oc_K$ such that $\nu_1=1$ and $K=\Q (\nu_2)$. Let $X_1,X_2,X_3$ satisfy (<ref>) and (<ref>). Let $\ell,\ell'\in\N$ such that $1\le\ell '<\ell$ and
$\theta_1,\theta_1',\dots,\theta_\ell,\theta_\ell '$ be reals satisfying (<ref>)-(<ref>). Let $0<\tau<\tau'$ satisfy

\begin{equation}
\label{eq:tau'}
\tau'<\min\Bigl(\frac{4-2\theta'_{1}-\ldots-2\theta'_{\ell '}}{100},\frac{\theta_1+\cdots+\theta_{\ell'}-1}{100}\Bigr).
\end{equation}

Let $\cA_d(\u_,m,p)$ be as given by (<ref>).

Then for any choice of $\u_0\Mod{m}$ and $A>0$, we have

\begin{align*}
\sum_{\substack{p\in [X^{\tau},X^{\tau'}]\\ p\equiv 1\Mod{D_f} }}&\sum_{\substack{ q_{1},\ldots,q_{\ell}\text{ prime}\\ q_{j}\in [X^{\theta_{j}},X^{\theta_{j}'}]\,\forall 1\le j \le \ell}}|\cA_{q_{1}\cdots q_{\ell}}(\u_0,m,p)|\\
&=\eta_1^3X_1X_2X_3\frac{2\log(\frac{\tau'}{\tau})}{m^3\varphi (D_f)}
\prod_{i=1}^{\ell}\log \Bigl (\frac {\theta_i'}{\theta_i}\Bigr)+O\Bigl(\frac{ X_1X_2X_3}{(\log X)^A}\Bigr).
\end{align*}

The implied constant depends on $f,K,A,\delta$ and the $\theta_i,\theta_i'$ only.

At first sight Theorem <ref> looks like a Type I estimate since we are counting $a_1,a_2,a_3$ such that $N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)$ is a multiple of $q_1\ldots q_\ell$.
However, since there are typically no values of $a_1,a_2,a_3$ such that this occurs (it is only a thin set of $q_j$'s when there is a solution), we instead are required to view this as a Type II estimate counting $N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)=m_1m_2$ where $m_1=q_1\cdots q_{\ell '}$ is a product of $\ell'$ primes of constrained size and $m_2=q_{\ell '+1}\cdots q_\ell r$ is the product of $\ell -\ell '$ primes and some other integer $r$.

§.§ Application to Theorem <ref>

If $P$ is an irreducible monic quartic polynomial, then (generalising previous works) there is an auxilliary sextic form $q(a_1,a_2,a_3)$ such that provided $q$ takes suitably friable values a positive proportion of the time, then we can use exponential sum methods to establish Theorem <ref>. If $P$ has Galois group $C_4$ or $D_4$, then it turns out that the roots $r_1,r_2,r_3,r_4$ of $P$ can be ordered such that $r_1r_2+r_3r_4\in \Q$ (c.f. Lemma <ref>), and that $q$ factorises as $q_1q_2$ for a quartic form $q_1$ and a quadratic form $q_2$ (c.f. Lemma <ref>) which split completely in the splitting field of $P$.

Moreover, we find that for the quartic extension $K:=\Q(r_1+r_3)$ of $\Q$, the form $q_1$ satisfies

\begin{equation*}
q_1 (a_1,a_2,a_3)=\pm N_{K/\Q}(a_1+a_2 (r_1+r_3)+a_3 (r_1^2+r_1r_3+r_3^2)),
\end{equation*}

and so takes the shape of an incomplete norm form (c.f. Proposition <ref>).

The quadratic $q_2$ takes the form

\begin{equation}\label{formf}\begin{split}
&\times [a_1+(r_3+r_4)a_2+(r_3^2+r_3r_4+r_4^2)a_3].
\end{split}
\end{equation}

Since the two polynomials $P_1(X):=(X-(r_1+r_2))(X-(r_3+r_4))$ and $P_2(X):=(X-(r_1^2+r_1r_2+r_2^2))(X-(r_3^2+r_3r_4+r_4^2))$ are in $\Z [X]$, $r_1+r_2$ and $r_1^2+r_1r_2+r_2^2$ are of degree at most $2$ over $\Q$. Let $\Delta_1$ and $\Delta _2$ be the discriminant of these two polynomials

\begin{equation}
\begin{cases}
[8,\Delta_1 ,\Delta_2]
& \text{if}\ \Delta_1\Delta_2\not =0,\\
[8,\Delta_1+\Delta_2] & \text{otherwise}.
\end{cases}
\label{eq:DqDef}
\end{equation}

Since $P$ is irreducible of degree $4$, we don't have $\Delta_1 =\Delta_2 =0$.[If $\Delta_1=\Delta_2=0$ then the roots of $r_1+r_2$ and $r_1r_2$ are in $\Q$. This contradicts the fact that
$[\Q(r_1):\Q]=4$.] If $p\equiv 1\Mod{D_{q_2}}$ and $\Delta_1\Delta_2\not =0$, then $(\Delta_1/p)=(\Delta _2/p)=1$  where  $(n/p)$ is the Legendre symbol. Thus the polynomials $P_1$ and $P_2$ modulo $p$ factor into products of two degree one polynomials.
The linear factors of $q_2$ in (<ref>) have their coefficients in $\F_p$.  We also verify that it is still the case when $p\equiv 1\Mod{D_{q_2}}$  and $\Delta_1\Delta_2=0$.

Then $N_{K/\Q}(\sum_{i=1}^4 a_i\nu_i)$ is a quartic form in the integer variables $a_1,a_2,a_3,a_4$,  and we have for all $a_1,a_2,a_3,a_4\in\Z$

$$N_{K/\Q}\Big (\sum_{i=1}^4 a_i\nu_i\Big )=\prod_{i=1}^4 \Big (\sum_{j=1}^4 a_j\sigma _i (\nu_j)\Big ),$$

where $\sigma_1,\sigma_2,\sigma_3 ,\sigma _4$ are the different embeddings of $K/\Q$.

Given an irreducible quartic polynomial $P\in\Z [X]$ with Galois group $C_4$ or $D_4$ it is the case (see Lemma <ref>) that the distinct roots $r_1,r_2,r_3,r_4$ of $P$ can be ordered
such that $r_1r_2+r_3r_4\in\Q$. We are interested in the auxiliary polynomial $q_2$ (see (<ref>)), given by

To ensure that $q_1(a_1,a_2,a_3)=N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)$ is composed only of suitably small prime factors, we will look for $a_1,a_2,a_3$ such that

\[
q_{11}q_{12}q_{13}q_{14}\ldots q_{1\ell}|N_{K/\Q}(a_1\nu_1+a_2\nu_2+a_3\nu_3)
\]

for some suitable primes $q_{11},q_{12},q_{13},q_{14},\ldots ,q_{1\ell}<X^{1-\delta}$ with $\prod_{j=1}^\ell q_{1j}>X^{3+\delta}$.
In the application to Theorem <ref>, we will only need the case $\ell =6$, but the proof in this particular case is exactly the same as in the general case.

§ ALGEBRAIC PROPERTIES OF AUXILLIARY POLYNOMIALS

§.§ Ideals

Let $r_1$ be a root of $P$.  We define for any ideal
$\gI$  of  $\Z [r_1]$ the function

\begin{equation*}
\varrho_P (\gI)={\rm card}
\{0\le n< N_P(\gI): n\equiv r_1\Mod \gI\},
\end{equation*}

where $N_P=N_{\Q (r_1)/\Q}$ is the norm on $\Q (r_1)$.
If $\gI$ is principal, $\gI=(\alpha)$, we will write simply $\varrho_P (\alpha)$ in place of $\varrho_P ((\alpha))$.

Let $\gI$ be an  ideal of $\Oc_{\Q(r_1)}$ such that  $(N_P(\gI),\Disc (P))=1$. If the equation  $n\equiv r_1\Mod \gI$ has a  solution with $n\in\Z$
then  $\gI$ is a product of prime ideals whose norm is a prime number.  Furthermore $\gI$ can't be divisible by two different prime ideals with the same norm.  Conversely,  if $\gI$ satisfies these  different conditions then this  congruence admits some solutions and $\varrho_P (\gI)=1$.
Finally if  $\gI$ is an   ideal such that   $\varrho_P (\gI)=1$ then for  $m\in\Z$, $\gI|m\Leftrightarrow N_P(\gI)|m$.

This is <cit.>.
The particular case $P=\Phi_{12}$ is handled in <cit.>.

§.§ The roots of $P$ modulo $m$

In this part only we suppose that  $P(X)=X^n+c_{n-1}X^{n-1}+\dots+c_0\in\Z[X]$ is monic, irreducible of degree $n$.
In our problem, the degree of $P$ is $4$ but the argument of this part is valid for all irreducible and monic polynomials and might be used in other contexts. Throughout the rest of the paper we fix a root $r_1$ of $P$.

For $\alpha\in\Z [r_1]$,  we write  $\alpha=a_0+a_1 r_1+a_2r_1^2+a_3r_1^3+\cdots + a_{n-1}r_1^{n-1}$.
Let $m_\alpha : \Q (r_1)\rightarrow \Q (r_1)$  be the multiplication-by-$\alpha$ map: $m_\alpha (x)=\alpha x$.
Let $M_\alpha$ be the  matrix of $m_\alpha$ with respect to the basis  $\{1,r_1,r_1^2,r_1^3, \ldots , r_1^{n-1}\}$ and  $N_P(\alpha )=N_{\Q(r_1)/\Q}(\alpha )$ its determinant.
For $P(X)=X^4+2$ the corresponding matrix is

\begin{equation*}
\left (\begin{matrix}
a_0 & -2a_3 & -2a_2 & -2a_1\\ a_1 & a_0 & -2a_3 & -2a_2\\ a_2 & a_1 & a_0 & -2a_3\\ a_3& a_2 & a_1 & a_0\\
\end{matrix}
\right ).
\end{equation*}

More generally since $r_1^n= -c_0-c_1r_1-\cdots - c_{n-1}r_1^{n-1}$, we have

\begin{equation}\label{malpha}
a_0 & -c_0a_{n-1} & * & \cdots & *\\
a_1 & a_0-c_1a_{n-1} & * & \cdots & *\\
\vdots & \vdots & \vdots &  \vdots & \vdots \\
a_{n-1} & a_{n-2}-c_{n-1}a_{n-1} & * & \cdots & *\\
\end{pmatrix}.
\end{equation}

In this section we prove results analogous to <cit.> or <cit.>.
As in these two papers, we let $B_{ij}=B_{ij}(\alpha)$ be the cofactor formed by taking the determinant of the $(n-1)\times(n-1)$ matrix formed by removing line $i$ and column $j$ from $M_\alpha$ and multiply it by $(-1)^{i+j}$. If $\alpha=a_0+a_1r_1+\dots+a_{n-1}r_1^{n-1}$ then $B_{ij}$ is a polynomial in the $a_i$. By an abuse of notation we will sometimes use $B_{ij}$ to refer to this polynomial, and sometimes the value attained at a particular point $(a_0,a_1,\dots,a_{n-1})$. The intended usage should be clear from the context.

Let $\alpha =a_0+a_1r_1+\cdots +a_{n-1}r_1^{n-1}$, with $a_0,\ldots ,a_{n-1}\in\Z$ be such that  $(N_P(\alpha), B_{1n})=1$. Then there exists an integer  $k_\alpha$, with $0\le k_\alpha<N_P(\alpha )$
such that we have

\begin{equation*}
n-r_1\equiv 0\Mod{(\alpha)}\Leftrightarrow n\equiv k_\alpha \Mod{N_P(\alpha )}.
\end{equation*}

This integer $k_\alpha$ satisfies the  congruence

\begin{equation*}
k_\alpha\equiv B_{2n}\overline{B_{1n}}\Mod{N_P(\alpha )}.
\end{equation*}

Furthermore, if  $\gJ$ is an   ideal of  $\Z [r_1]$ containing a  principal ideal  $(\alpha )$ with $\alpha$ as above then there exists a unique   $k_\gJ$
with $0\le k_\gJ<N_P(\gJ)$  and

\begin{equation*}
n-r_1\in \gJ\Leftrightarrow n\equiv k_\gJ\Mod{N_P(\gJ )}.
\end{equation*}

The starting point is the following trivial observation: $\alpha r_1^j\in (\alpha)$ for all $j=0,1,2,3,\ldots ,  n-1$. Let $(m_{i,j})_{1\le i,j\le n}$ be the  coefficients of $M_\alpha$. We obtain the  equations

\begin{equation*}
m_{1,j}+m_{2,j}r_1+\cdots +m_{n,j}r_1^{n-1}=0 \Mod {(\alpha)},\,\forall\, 1\le j\le n.
\end{equation*}

This system can be represented as

\begin{equation}\label{relmat}
\left (
\begin{matrix}
m_{2,1} & m_{3,1} & \ldots & m_{n,1}\\ m_{2,2} & m_{3,2} & \ldots & m_{n,2}\\
\vdots &\vdots &\ldots  &\vdots\\
m_{2,n}& m_{3,n}& \ldots & m_{n,n}\\
\end{matrix}\right )
\left (
\begin{matrix}
r_1\\ r_1^2\\ \vdots \\ r_1^{n-1}
\end{matrix}
\right )
=\left ( \begin{matrix} -m_{1,1}\\ -m_{1,2}\\ \vdots\\ -m_{1,n}
\end{matrix}\right )\Mod{(\alpha )}
\end{equation}

If we remove the i-th line in this system and apply Cramer's rule, we find

\begin{equation}\label{reli}
r_1\det \left (
\begin{matrix}
m_{2,1} & m_{3,1} & \ldots & m_{n,1}\\ \vdots &\vdots &\ldots  &\vdots \\ m_{2,i-1} & m_{3,i-1} & \ldots & m_{n,i-1}\\m_{2,i+1} & m_{3,i+1} & \ldots & m_{n,i+1}\\
\vdots &\vdots &\ldots  &\vdots\\
m_{2,n-1}& m_{3,n-1}& \ldots & m_{n,n-1}\\
m_{2,n}& m_{3,n}& \ldots & m_{n,n}\\
\end{matrix}\right )=\det \left (
\begin{matrix}
-m_{1,1} & m_{3,1} & \ldots & m_{n,1}\\ \vdots &\vdots &\ldots  &\vdots\\ -m_{1,i-1} & m_{3,i-1} & \ldots & m_{n,i-1}\\ -m_{1,i+1} & m_{3,i+1} & \ldots & m_{n,i+1}\\
\vdots &\vdots &\ldots  &\vdots\\
-m_{1,n-1}& m_{3,n-1}& \ldots & m_{n,n-1}\\
-m_{1,n}& m_{3,n}& \ldots & m_{n,n}\\
\end{matrix}\right )\Mod{(\alpha)}.
\end{equation}

The transpose of the matrix on the left is the submatrix of $M_\alpha$ obtained by removing the first line and the $i^{th}$ column. The matrix on the right is the submatrix of $M_\alpha$ obtained by removing the second line and the $i^{th}$ column and by multiplying all elements of the first column by $-1$.

We recall that the   $B_{ij}$, $1\le i,j\le n$, are   the cofactors of $M_\alpha$, so that

\begin{equation}\label{cofactor}
M^{-1}_\alpha =\frac{1}{N_P(\alpha)}\left (\begin{matrix}
B_{11}& B_{21} & \ldots & B_{n1}\\
B_{12} & B_{22} & \ldots & B_{n2}\\
\vdots & \vdots & \ldots & \vdots\\
B_{1n} & B_{2n} & \ldots & B_{nn}\end{matrix}\right ).
\end{equation}

With this notation, (<ref>) becomes

\begin{equation*}
(-1)^{i+1}B_{1i}r_1\equiv  -(-1)^{i+2} B_{2i}\Mod{(\alpha )}.
\end{equation*}

In particular, this gives

\begin{equation}\label{r11}
B_{1i}r_1\equiv B_{2i}\Mod{(\alpha )}.
\end{equation}

By Lemma <ref>, if an integer is congruent to $0\Mod{(\alpha)}$ then it is divisible by $N_P(\alpha)$. Therefore considering $i=n$ now gives the claim of the first part of Lemma <ref>.

For the second part when $J| (\alpha)$, thus it suffices to take $k_J\in [0,N_P(J)]$ such that $k_J\equiv{k_\alpha}\Mod{N_P(J)}$. The claim now follows from (<ref>).

We end this subsection by observing some connection between the cofactors $B_{1i}$ and $B_{2j}$
with $1\le i,j\le n$.
Since $(m_\alpha )^{-1}=m_{\alpha ^{-1}}$, we have

\begin{equation*}
\alpha ^{-1} = \frac{1}{N_P(\alpha)}(B_{11}+B_{12}r_1+\cdots +B_{1n}r_1^{n-1}),
\end{equation*}

and the columns of  $M_\alpha^{-1}$ satisfy the same   relations (<ref>) as the one in  $M_\alpha$. By the  relations (<ref>) for $M_{\alpha^{-1}}$, we see that

\begin{equation}\label{B2iB1j}
\left (\begin{matrix} B_{21}\\ B_{22}\\ \vdots\\ B_{2(n-1)}\\ B_{2n}
\end{matrix}\right )=
\left (\begin{matrix} -c_0B_{1n}\\ B_{11}-c_1B_{1n}\\ \vdots \\ B_{1(n-2)}-c_{n-2}B_{1n}\\ B_{1(n-1)}-c_{n-1}B_{1n}\end{matrix}\right ).
\end{equation}

In particular the last line implies that

\begin{equation}
\label{eq:CofactorRelation}
\end{equation}

For $n=4$, and $c_3=0$, we recover the  formula $B_{14}r_1\equiv B_{24}=B_{13}\Mod{(\alpha )}$,
proved in  [1] and in [4].

§.§ Elimination of $a_0$

The aim of this subsection is to approximate the fraction $k_\gJ/N_P(\alpha )$ by a fraction whose denominator depends
only on $a_1,a_2,a_3$. Now and for the rest of this paper we restrict our attention to $P$ having degree $4$.
In this subsection we prove the analogue of  <cit.>, or <cit.>. A natural way to proceed is to work with some   resultants of the different forms defined previously.

There is a homogeneous polynomial $q_3=q_3(a_1,a_2,a_3)$ in $a_1,a_2,a_3$ such that

\begin{equation}\label{BBN}
B_{24}B_{13}-B_{14}B_{23}=q_3 N_P(\alpha ).
\end{equation}

Applying (<ref>) with $i=3,4$, $n=4$ we find

\begin{equation*}
B_{13}B_{24}\equiv B_{14}B_{23}\Mod{N_P(\alpha)}.
\end{equation*}

Since this holds for all $a_0,a_1,a_2,a_3$, we deduce that there exists a form $q_3=q_3(a_0,a_1,a_2,a_{3})$ such that [In [1] and [4] this form corresponds to the form $q_4$.]

\begin{equation}
B_{24}B_{13}-B_{14}B_{23}=q_3 N_P(\alpha ).
\end{equation}

Therefore we just need to show that $q_3$ actually doesn't depend on $a_0$. $N_P(\alpha )$ has degree $4$ in $a_0$ while the polynomials $B_{ij}$, $i\not =j$ are of degree $2$ in $a_0$, and so by equating the coefficients of $a_0^4$ we see that $q_3$ must not depend on $a_0$.

One can explicitly compute $q_3$ in terms of the coefficients $c_i$ of $P$; it is given by

\begin{equation}\label{deff}
\end{equation}

When $c_3=0$ this coincides with the form $-q_4$
given in <cit.>.

Lemma <ref> makes important use of the fact that $P$ is a quartic polynomial. For polynomials $P$ of  degree $d>4$ the form $q_3$ would have degree $d-4$ in $a_0$, and so would no longer independent of $a_0$.

Following the notation of  [1] and [4], we write ${\rm Resultant} (P_1,P_2;x)$ for the resultant of the polynomials $P_1$, $P_2$
with respect to the  variable $x$.
We will be interested by the two following  resultants

\begin{equation}\label{resultant}\begin{split}
R&:=R(a_1,a_2,a_3)={\rm Resultant} (B_{14},N_P(\alpha );a_0)\\
R_0&:=R_0(a_1,a_2,a_3)={\rm Resultant} (B_{13},B_{14};a_0)\\
\end{split}
\end{equation}

With the previous notation we have

\begin{equation*}
q_3^2 R=R_0^2.
\end{equation*}

The proof of Lemma <ref> is the same as that of <cit.>.
Since  $B_{14}$ is of degree $2$ in $a_0$, we have

\begin{equation*}
q_3^2R={\rm Resultant} (B_{14},q_3 N_P(\alpha );a_0)={\rm Resultant} (B_{14},B_{24}B_{13}-B_{14}B_{23} ;a_0).
\end{equation*}

But $B_{24}=B_{13}-c_3B_{14}$ and $B_{13}$ is also of degree $2$ in $a_0$. We deduce that

\begin{equation*}
q_3^2R={\rm Resultant} (B_{14},B_{13}^2;a_0)=R_0^2.
\end{equation*}

This ends the proof of   Lemma <ref>.

We see that the polynomial $q_3$ divides $R_0$, and so we can write

\begin{equation}
\label{eq:qDef}
\end{equation}

for some homogeneous polynomial $q=q(a_1,a_2,a_3)$. Moreover, since $R_0$ is the resultant of $B_{13}$ and $B_{14}$, there are two  polynomials $U$ and $V\in\Z [a_0,a_1,a_2,a_3]$ such that

\begin{equation}\label{UV}
\end{equation}

We are now ready to state the main result of this section. It is analogous to <cit.> or <cit.>.

Suppose $a_0,a_1,a_2,a_3$ are such that $(B_{14}(a_0,a_1,a_2,a_3),q(a_1,a_2,a_3))=1$. Then
$(N_P (\alpha ), B_{14} (a_0,a_1,a_2,a_3))=1$
and for  $h\in\Z$ we have

\begin{equation*}
\e\Big ( \frac{-hk_{\alpha} }{N_P(\alpha )}\Big )=\e\Big ( \frac{-hU(a_0,a_1,a_2,a_3)\overline{B_{14}(a_0,a_1,a_2,a_3)} }{q(a_1,a_2,a_3)}+hR(a_0,a_1,a_2,a_3)\Big ),
\end{equation*}

where $U=U(a_0,a_1,a_2,a_3)$ is defined by (<ref>) and $R$ is given by

\begin{equation*}
R(a_0,a_1,a_2,a_3)=\frac{U}{qB_{14}}-\frac{B_{24}}{N_P(\alpha )B_{14}}.
\end{equation*}

To simplify notation, for the proof let $q,q_3,U,B_{14},B_{14},B_{23},B_{24},N_P(\alpha)$ denote the values of the polynomials evaluated at $a_0,a_1,a_2,a_3$.

Since $q$ divides the resultant $R$ defined in (<ref>), if $q$ is coprime with $B_{14}$, we have $(N_P (\alpha), B_{14})=1$. By Lemma <ref>,

\begin{equation*}
\e\Big (\frac{k_{\alpha}}{N_P(\alpha)}\Big )=\e\Big (\frac{B_{24}\overline{B_{14}}}{N_P(\alpha )}\Big ).
\end{equation*}

We use the Bézout relation

\begin{equation}\label{Bezout}
\frac{\bar u}{v}+\frac{\bar v}{u}\equiv\frac{1}{uv}\Mod 1\quad {\rm for}\ (u,v)=1,
\end{equation}

and the fact that  $(N_P(\alpha ), B_{14})=1$.  This yields the formula

\begin{equation}\label{kj1}
\e\Big (\frac{k_\alpha}{N_P(\alpha)}\Big )=\e\Big (-\frac{B_{24}\overline{N_P(\alpha)}}{B_{14}}+\frac{B_{24}}{B_{14}N_P(\alpha)}\Big ).
\end{equation}

Combining (<ref>), (<ref>) and (<ref>), we obtain

\begin{equation*} \begin{split}
UN_P(\alpha )q_3&=U[B_{13}(B_{13}-c_3B_{14})-B_{14}B_{23}]\\
& =U(B_{13}^2-B_{14}(B_{23}+c_3B_{13}))\\
\end{split}
\end{equation*}

This rearranges to give

\begin{equation*}
(UN_P(\alpha) -qB_{13})q_3=B_{14}(-VB_{13}-U(B_{23}+c_3B_{13})).
\end{equation*}

Since  $q_3$ and $B_{14}$ are coprime, we  deduce that

\begin{equation}\label{Congruence}
UN_P(\alpha) -qB_{13}\equiv 0\Mod{B_{14}}.
\end{equation}

Since $B_{24}\equiv B_{13}\Mod {B_{14}}$, we obtain

\begin{equation*}
B_{24}\ov{N_P(\alpha)}\equiv B_{13}\ov{N_P(\alpha )} \Mod {B_{14}}\equiv U\bar q\Mod {B_{14}}.
\end{equation*}

We insert this  in (<ref>) and apply  (<ref>)  one more time. This gives the desired result.

§.§ Explicit computations of $B_{13},B_{14},U,V$.

We have used  SAGE to explicitly compute the polynomials $q$, $B_{13}$, $B_{14}$, $U$ and $V$.  The cofactors $B_{13}$ and $B_{14}$ are of degree $2$ in $a_0$

\begin{align}
B_{13}=& -a_2a_0^2 + \Bigl(a_1^2 + c_3a_1a_2 + (-c_3^2 + c_2)a_2^2 + (-2c_2)a_1a_3 \nonumber\\
&\qquad + (c_3^3 - c_2c_3 + c_1)a_2a_3 + (-c_2c_3^2 + c_2^2 + c_1c_3 - c_0)a_3^2\Bigr)a_0 \nonumber\\
&+ (-c_3)a_1^3 + c_3^2a_1^2a_2 + (-c_2c_3)a_1a_2^2 + (c_1c_3 - c_0)a_2^3 \nonumber\\
&+ (-c_3^3 + 2c_2c_3)a_1^2a_3 + (c_2c_3^2 - 3c_1c_3 + 2c_0)a_1a_2a_3\nonumber\\
&+ (-c_1c_3^2 + 2c_0c_3)a_2^2a_3 + (-c_2^2c_3 + 2c_1c_3^2 - 2c_0c_3)a_1a_3^2\nonumber \\
&+ (c_1c_2c_3 - c_0c_3^2 - c_0c_2)a_2a_3^2 + (-c_1^2c_3 + c_0c_2c_3 + c_0c_1)a_3^3, \label{eq:B13}\\
B_{14}=& -a_3a_0^2 + \Bigl(2a_1a_2 -c_3a_2^2 -c_3a_1a_3 + c_3^2a_2a_3 + (-c_2c_3 + 2c_1)a_3^2\Bigr)a_0\nonumber\\
&- a_1^3 + c_3a_1^2a_2 -c_2a_1a_2^2 + c_1a_2^3 + (-c_3^2 + 2c_2)a_1^2a_3 + (c_2c_3 - 3c_1)a_1a_2a_3\nonumber \\
& + (-c_1c_3 + c_0)a_2^2a_3 + (-c_2^2 + 2c_1c_3 - c_0)a_1a_3^2\nonumber\\
& +(c_1c_2 - c_0c_3)a_2a_3^2 + (-c_1^2 + c_0c_2)a_3^3. \label{eq:B14}
\end{align}

The quantities $U$ and $V$ are of degree $1$ in $a_0$.
In some step we will need the  explicit formula for the coefficient in $a_0$ in $U$ and in $V$

\begin{align}
U=&a_0\Bigl(-a_1^2a_3^2 + 2a_1a_2^2a_3  -2c_3a_1a_2a_3^2 + 2c_2a_1a_3^3 -c_3a_2^3a_3 +\nonumber\\
& \qquad(2c_3^2 - c_2)a_2^2a_3^2 + (-c_3^3 + c_1)a_2a_3^3 + (c_2c_3^2 - c_2^2 - c_1c_3 + c_0)a_3^4\Bigr)\nonumber\\
&+3a_1^3a_2a_3 -2c_3a_1^3a_3^2 -4a_1^2a_2^3 + 4c_3a_1^2a_2^2a_3 \nonumber\\
&+ (c_3^2 - 6c_2)a_1^2a_2a_3^2 + (-c_3^3 + 3c_2c_3 + 2c_1)a_1^2a_3^3 \nonumber\\
&+ 4c_3a_1a_2^4 + (-9c_3^2 + 3c_2)a_1a_2^3a_3 + (6c_3^3 + c_2c_3 - 3c_1)a_1a_2^2a_3^2 \nonumber\\
& + (-c_3^4 - 5c_2c_3^2 + 3c_2^2 + 2c_1c_3 + c_0)a_1a_2a_3^3 + (c_2c_3^3 + c_1c_3^2 - 4c_1c_2 - c_0c_3)a_1a_3^4  -c_3^2a_2^5\nonumber\\
& + (3c_3^3 - c_2c_3 - c_1)a_2^4a_3 + (-3c_3^4 + 5c_1c_3 - 2c_0)a_2^3a_3^2 \nonumber\\
&+ (c_3^5 + 3c_2c_3^3 - 2c_2^2c_3 - 7c_1c_3^2 + c_1c_2 + 4c_0c_3)a_2^2a_3^3\nonumber \\
&+ (-2c_2c_3^4 + c_2^2c_3^2 + 3c_1c_3^3 + 2c_1c_2c_3 - 2c_0c_3^2 - c_1^2 - 2c_0c_2)a_2a_3^4 \nonumber\\
&+ (c_2^2c_3^3 - c_2^3c_3 - 3c_1c_2c_3^2 + 2c_1c_2^2 + c_1^2c_3 + 2c_0c_2c_3 - c_0c_1)a_3^5,\label{U}
\end{align}

\begin{equation}\label{V}
\begin{split}
V=&a_0\Bigl(a_1^2a_2a_3 -2a_1a_2^3 + 2c_3a_1a_2^2a_3 -2c_2a_1a_2a_3^2 + c_3a_2^4 \\
&\qquad+ (-2c_3^2 + c_2)a_2^3a_3 + (c_3^3 - c_1)a_2^2a_3^2 + (-c_2c_3^2 + c_2^2 + c_1c_3 - c_0)a_2a_3^3\Bigr)\\
&-a_1^4a_3 + a_1^3a_2^2 -2c_3a_1^3a_2a_3 + 4c_2a_1^3a_3^2 + 2c_3a_1^2a_2^3 + (-c_3^2 - 4c_2)a_1^2a_2^2a_3 \\
&+ (-c_3^3 + 5c_2c_3)a_1^2a_2a_3^2 + (2c_2c_3^2 - 6c_2^2 - 2c_1c_3 + 2c_0)a_1^2a_3^3 + (-3c_3^2 + c_2)a_1a_2^4 \\ &+ (6c_3^3 - c_2c_3 - c_1)a_1a_2^3a_3 + (-3c_3^4 - 7c_2c_3^2 + 5c_2^2 + 6c_1c_3 - 5c_0)a_1a_2^2a_3^2 \\
&+ (7c_2c_3^3 - 4c_2^2c_3 - 5c_1c_3^2 + 5c_0c_3)a_1a_2a_3^3 + (-4c_2^2c_3^2 + 4c_2^3 + 4c_1c_2c_3 - 4c_0c_2)a_1a_3^4 \\
&+ (c_3^3 - c_2c_3 + c_1)a_2^5 + (-3c3^4 + 4c_2c_3^2 - c_2^2 - 3c_1c_3 + 2c_0)a_2^4a_3  \\
&+(3c_3^5 - 3c_2c_3^3 + c_1c_3^2 + c_1c_2 - 2c_0c_3)a_2^3a_3^2 \\
&+ (-c_3^6 - 2c_2c_3^4 + 5c_2^2c_3^2 + 3c_1c_3^3 - 2c_2^3 - 4c_1c_2c_3 - 2c_0c_3^2 + 4c_0c_2)a_2^2a_3^3 \\
&+(2c_2c_3^5 - 3c_2^2c_3^3 - 2c_1c_3^4 + c_2^3c_3 + c_1c_2c_3^2 + 2c_0c_3^3 + c_1^2c_3 - 2c_0c_2c_3 - c_0c_1)a_2a_3^4 \\
&+ (-c_2^2c_3^4 + 2c_2^3c_3^2 + 2c_1c_2c_3^3 - c_2^4 - 2c_1c_2^2c_3 - c_1^2c_3^2 - 2c_0c_2c_3^2 + 2c_0c_2^2 + 2c_0c_1c_3 - c_0^2)a_3^5.
\end{split}
\end{equation}

We don't write the expression for $q$ because it would take more than one page and we won't need to know its precise shape
during the proof.
Let $U=a_0U_1+U_0$, $V=a_0V_1+V_0$. Then $U_1$ satisfies:

\begin{equation}\label{defU1}\begin{split}
U_1&=-a_1^2a_3^2 + 2a_1a_2^2a_3  -2c_3a_1a_2a_3^2 + 2c_2a_1a_3^3 -c_3a_2^3a_3 +\\
& \qquad (2c_3^2 - c_2)a_2^2a_3^2 + (-c_3^3 + c_1)a_2a_3^3 + (c_2c_3^2 - c_2^2 - c_1c_3 + c_0)a_3^4\\
&=a_3 \Bigl( -a_1^2a_3 + 2a_1a_2^2  -2c_3a_1a_2a_3 + 2c_2a_1a_3^2 -c_3a_2^3 +\\
&\qquad  (2c_3^2 - c_2)a_2^2a_3 + (-c_3^3 + c_1)a_2a_3^2 + (c_2c_3^2 - c_2^2 - c_1c_3 + c_0)a_3^3\Bigr).
\end{split}
\end{equation}

We observe that

\begin{equation}\label{U1V1}
\end{equation}

§.§ Factorisation of $q$

Let $P\in\Z [X]$ be an irreducible monic quartic polynomial and $r_1,r_2,r_3,r_4$ its roots.
Let $R$ and $R_0$ be the two resultants introduced in (<ref>). Let $a(r):=a_0+a_1r+a_2r^2+a_3r^3$.
Then there exists $t_P\in\Q^*$ such that

\begin{equation*}
R(a_1,a_2,a_3)=t_P\prod_{1\le i<j\le 4}(a(r_i)-a(r_j))^2.
\end{equation*}

Furthermore, the resultant $R_0$  is  divisible by

\begin{equation*}
\prod_{1\le i<j\le 4}(a(r_i)-a(r_j)).
\end{equation*}

This is <cit.> in the special case of quartic polynomials.

The coefficient $t_P$ in Lemma <ref>
is given by

\begin{equation*}
t_P=\prod_{1\le i<j\le 4}\frac{1}{(r_i-r_j)^2}.
\end{equation*}

The proof follows the argument of La Bretèche and Mestre, but for completeness we repeat the main steps.

We note that $N_P(\alpha )$ is the determinant of the linear map $g_a : \Q [X]/P(X)\rightarrow \Q [X]/P(X)$ given by $g_a (H(X))=a(X)H(X)$ where $a(X)=a_0+a_1X+a_2X^2+a_3X^3$. Let $L_1 (X),\ldots , L_4 (X)$ be the Lagrange interpolation polynomials for the roots $r_1,\ldots ,r_4$ of $P$. Thus $L_i(x)=\prod_{j\ne i}(x-r_j)/(r_i-r_j)$ and in particular $L_i(r_j)=1$ if $i=j$, $0$ if $i\ne j$. Then  for all $i=1,2,3,4$,

\begin{equation*}
g_a (L_i (X))=a(X)L_i(X)=\sum_{j=1}^4
\end{equation*}

in $\Q [X]/(P)$, since $P(X)| L_i(X)L_j(X)$ if $i\not =j$ and $P(X)| (L_i^2(X)-L_i(X))$.
Thus the matrix of $g_a$ with respect to the basis $\{L_1(X),L_2(X), L_3 (X), L_4(X)\}$ is diagonal with coefficients $a(r_1), a(r_2), a(r_3), a(r_4)$ on the diagonal.

Let $T$ be the matrix of the polynomials
$L_1 (X),L_2(X),L_3(X),L_4 (X)$ with respect to the standard basis $\{1,X,X^2,X^3\}$.
Then the matrix of $N_P (\alpha )g_a^{-1}$ with respect to the standard basis is $N_P (\alpha )M_\alpha ^{-1}$ with $M_{\alpha}^{-1}$ given by (<ref>). Thus have

\begin{equation}\label{Bga}
\begin{pmatrix}
B_{11} & B_{21} & B_{31} & B_{41}\\
B_{12} & B_{22} & B_{32} & B_{42}\\
B_{13} & B_{23} & B_{33} & B_{34}\\
B_{14} & B_{24} & B_{34} & B_{44}
\end{pmatrix}
= T \begin{pmatrix} \prod_{j\not =1} a(r_j) & 0 & 0 & 0\\ 0 &\prod_{j\not =2} a(r_j)
& 0 & 0\\
0 & 0 & \prod_{j\not =3} a(r_j) & 0\\
0 & 0 & 0 & \prod_{j\not =4} a(r_j)
\end{pmatrix}T^{-1}.
\end{equation}

The form $N_P(\alpha )=\prod_{i=1}^4 a(r_i)$ is quartic and monic in $a_0$. If we write $B_{14}=B_{14}(a_0)$ as
an element of $\Z [a_1,a_2,a_3][a_0]$,
the resultant $R$ satisfies

\begin{equation*}
R=\prod_{i=1}^4  B_{14}(d_i),
\end{equation*}

where $d_i = -a_1r_i-a_2r_i^2-a_3r_i^3$ for $i=1,2,3,4$
are the roots of $y\mapsto N_P (y+a_1r_1+a_2r_1^2+a_3r_1^3)$.
Let $P_i (X):= d_i + a_1X+a_2X^2+ a_3 X^3$. Formula (<ref>) with $d_1$ in place of $a_0$,   gives

\begin{equation*}
\begin{pmatrix}
B_{11}(d_1) & B_{21}(d_1) & B_{31} (d_1) & B_{41} (d_1)\\
B_{12}(d_1) & B_{22}(d_1) & B_{32}(d_1) & B_{42}(d_1)\\
B_{13}(d_1) & B_{23}(d_1) & B_{33}(d_1) & B_{34}(d_1)\\
B_{14}(d_1) & B_{24}(d_1) & B_{34}(d_1) & B_{44}(d_1)
\end{pmatrix}
\prod_{\ell\not =1}P_1 (r_\ell) & 0 & 0 & 0\\
0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{pmatrix}T^{-1}.
\end{equation*}

We have similar formulas for the polynomials $P_2$, $P_3$, $P_4$. The first column
of the matrix  of the left corresponds to the coordinates in the standard basis of
the image of the constant polynomial $1$ by the map $N_P(\alpha )g_\alpha ^{-1}$. The  decomposition of the polynomial $1$ in the Lagrange basis is $1=L_1(X)+L_2(X)+L_3(X)+L_4(X)$.
The first column of the left matrix is then

\begin{equation*}
\begin{pmatrix} B_{11}(d_1)\\
B_{12} (d_1)\\ B_{13} (d_1)\\ B_{14}(d_1)
\end{pmatrix} =T\begin{pmatrix}
\prod_{\ell\not =1}P_1 (r_\ell) & 0 & 0 & 0\\
0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{pmatrix}
\begin{pmatrix} 1 \\ 1\\ 1\\ 1
\end{pmatrix}=T\begin{pmatrix}\prod_{j=2}^4 P_1 (r_j)\\ 0\\ 0\\ 0\end{pmatrix}.
\end{equation*}

In particular we deduce that $B_{14} (d_1)$
is the coefficient of $X^3$ in the polynomial
$\prod_{j=2}^4 P_1 (r_j) L_1 (X)$.
Since $L_1 (X)=\prod_{j=2}^4 (X-r_j)/(r_1-r_j)$, we get

\begin{equation*}
B_{14} (d_1)=\frac{\prod_{j=2}^4 P_1 (r_j)}
{\prod_{j=2}^4 (r_1-r_j)}=-
\prod_{i=2}^4\frac{a(r_j)-a(r_1)}{r_j-r_1}.
\end{equation*}

In the same way we prove  for $i=2,3,4$ :

\begin{equation*}
B_{14} (d_i)=\frac{\prod_{j\not =i} P_i (r_j)}
{\prod_{j\not =i}^4 (r_i-r_j)}=-
\prod_{j\not =i}\frac{a(r_j)-a(r_i)}{r_j-r_i}.
\end{equation*}

This completes the proof of Lemma <ref>.

Lemma <ref> is stated for quartic polynomials but is in fact also valid for irreducible polynomials
of degree $n\ge 2$. For these polynomials,
if the resultant is between $N_P(\alpha)$ and the cofactor $B_{1n}$, then
$t_P^{-1}=(-1)^n\prod_{1\le i<j\le n} (r_i-r_j)^2.$
For the resultant between $N_P(\alpha)$ and
$B_{1\ell}$ for some $1\le \ell\le n-1$,
we may also have for $t_P$ an explicit  but more complicate formula, involving
the coefficients of $X^\ell$
in the Lagrange interpolation polynomials
associated with the roots $r_1,\ldots ,r_n$ of $P(X)$.

The polynomial $q(a_1,a_2,a_3)\in\Q[a_1,a_2,a_3]$ satisfies

\begin{equation*}
q=\pm\prod_{1\le i<j\le 4}\frac{a(r_i)-a(r_j)}{r_i-r_j},
\end{equation*}

where $a(r):=a_0+a_1r+a_2r^2+a_3r^3$.

This follows immediately from putting together Lemmas <ref>,  <ref> and <ref>.

§.§ The factor $q_1$ as a an incomplete norm form

A key point in the work of  [4] and [1] is that the form $q$ may be factored as a product of 3 quadratic forms whenever $P$ has a suitably small Galois group. In this  section, we prove that if $G=C_4$ or $D_4$ then  $q$ is a product of two forms $q=q_1q_2$, where $q_1$ has degree $4$, $q_2$ has degree $2$ and $q_1$ is related to a  norm form of a certain number field.

Let $P(X)$ be a monic quartic with Galois group $C_4$ or $D_4$. Then there is an ordering of the roots $r_1,r_2,r_3,r_4$ of $P$ such that

\[
\]

We recall  the notation $P(X)=X^4+c_3X^3+c_2X^2+c_1X+c_0$. The cubic resolvent of $P$ is

\begin{align*}
\end{align*}

We therefore see that the claim of the lemma is equivalent to $R_3(X)$ having a root in $\Q$ when $P(X)$ has Galois group $G=C_4$ or $D_4$. This fact (often stated in the form that the splitting field of $R_3(X)$ is a degree 2 extension) is a standard fact about cubic resolvants; see for example the web page of K. Conrad
[3]  or the book of Jensen, Ledet and Yui [13] for some nice expositions on the Galois group of quartic polynomials.

Let $P(X)$ have Galois group $C_4$ or $D_4$. Then the form $q\in \Q[a_1,a_2,a_3]$ has the factorisation

\[
\]

where $q_1\in\Q[a_1,a_2,a_3]$ has degree 4 and $q_2\in\Q[a_1,a_2,a_3]$ has degree 2. These are explicitly given by

\begin{equation}\label{defq1}
\end{equation}

\begin{equation}\label{defq2}
\end{equation}

where $a(X)=a_0+a_1X+a_2X^2+a_3X^3$ and $r_1,r_2,r_3,r_4$ are the roots of $P(X)$, ordered such that $r_1r_2+r_3r_4\in\Q$.

We recall from Lemma <ref> that the explicit formulae (<ref>) and (<ref>) give a factorisation $q=q_1q_2$ over $\overline{\Q}$. Thus we wish to show that in fact $q_1,q_2\in\Q[a_1,a_2,a_3]$, so that this is also a factorisation over $\Q$. A direct computation gives for all $1\le i<j\le 4$:

\begin{equation}\label{rij}
\frac{a(r_i)-a(r_j)}{r_i-r_j}=a_1+a_2(r_i+r_j)+a_3(r_i^2+r_ir_j+r_j^2).
\end{equation}

If $G=C_4$ then $G=\langle \sigma\rangle$ where $\sigma$ is the permutation $\sigma =(r_1r_3r_2r_4)$.
(This choice of $\sigma$ is motivated by the fact that we must have $\sigma (r_1r_2+r_3r_4)=
Since $\sigma (q_1)=q_1$ and $\sigma (q_2)=q_2$, we have that $q_1$ and $q_2$ are fixed by all of $G=\{ Id, \sigma ,\sigma^2,\sigma ^3\}$, and so $q_1,q_2\in\Q[a_1,a_2,a_3]$, giving the result in this case.

If $G=D_4$, then $G=\langle \sigma,\tau\rangle$ with $\tau =(r_3r_4)$ and $\sigma =(r_1r_3r_2r_4)$. Since $\tau (q_1)=q_1$ and $\tau (q_2)=q_2$ we also observe that $q_1,q_2\in \Q[a_1,a_2,a_3]$ in this case. This completes the proof.

The main result of this section is the following proposition.

Let $P(X)\in\Z[X]$ be irreducible, monic, quartic with Galois group $C_4$ or $D_4$.
Let $r_1,r_2,r_3,r_4$ be the roots of $P$ ordered such that $r_1r_2+r_3r_4\in \Q$ and
let $K:=\Q(r_1+r_3)$. Then the form $q_1$ defined in (<ref>) satisfies

\begin{equation*}
q_1 (a_1,a_2,a_3)=\pm N_{K/\Q}(a_1+a_2 (r_1+r_3)+a_3 (r_1^2+r_1r_3+r_3^2)).
\end{equation*}

We consider the cases when $G=C_4$ and $G=D_4$ separately.

Case 1: $G=C_4$. Let $G=\langle \sigma\rangle$ with $\sigma=(r_1r_3r_2r_4)$ and $r_1r_2+r_3r_4\in\Q$. We see that

\begin{equation*}
q_1=\prod_{i=0}^3\sigma^i\Big ( \frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )
=N_{\Q (r_1)/\Q}(a_1+a_2 (r_1+r_3)+a_3 (r_1^2+r_1r_3+r_3^2)).
\end{equation*}

To finish the proof, it remains to prove that $\Q(r_1+r_3)=\Q (r_1)$ is the splitting field of $P$. Since it is obviously contained in the splitting field, we just need to verify the field is not fixed by $\sigma^2$. But $c_3=-(r_1+r_2+r_3+r_4)=-(r_1+r_3)-\sigma^2(r_1+r_3)$ so if $\Q(r_1+r_3)$ is fixed by $\sigma^2$ then $\Q(r_1+r_3)=\Q$. But in this case $r_1+r_3=\sigma (r_1+r_3)=r_3+r_2$, so the roots would not be distinct, which contradicts our assumption. Thus $\Q(r_1+r_3)=\Q(r_1)$ as desired.

Case 2: $G=D_4$. Let $G=\langle \sigma, \tau\rangle$ with $\sigma$ as above and $\tau=(r_3r_4)$. We work with the permutation $\sigma\tau=(r_1r_3)(r_2r_4)$. Let $L$ be the splitting field of  $P(X)$ and $K_0=\{ x\in L : \sigma\tau (x)=x\}$.
Then  $L/K_0$ is a Galois extension of degree  $2$ and $[K_0:\Q]=4$.
We observe that $r_1+r_3, \frac{a(r_1)-a(r_3)}{r_1-r_3}\in K_0$.

Now,  by looking the orbit of $\{ 1,3\}$ under the subgroup of $S_4$ generated by $\{ (1324), (34)\}$,
we see that

\begin{equation*}
N_{L/\Q}\Big ( \frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )=q_1^2
\end{equation*}

\begin{equation*}
N_{L/K_0}\Big ( \frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )=\Big ( \frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )^2,
\end{equation*}

since $\frac{a(r_1)-a(r_3)}{r_1-r_3}\in K_0$.
By the transitive property of the   norms,

\begin{equation*}
N_{L/\Q}\Big ( \frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )=N_{K_0/\Q}\Big (N_{L/K_0} \Big (\frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )\Big )=N_{K_0/\Q}\Big (
\frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )^2.
\end{equation*}

We deduce  that
$q_1=\pm N_{K_0/\Q}\Big (\frac{a(r_1)-a(r_3)}{r_1-r_3}\Big )$.

As in the case (i), to finish the proof it remains to check that $\Q(r_1+r_3)=K_0$. We have already seen that $\Q (r_1+r_3)\subset K_0$, and so it suffices to show  $[\Q(r_1+r_3):\Q]=4$. This follows from an identical argument to that of case 1 because
the intermediate extension between $K_0$ and $\Q$ is the subfield of $K_0$ fixed  by $\sigma ^2 = (r_1 r_2)(r_3r_4)$.

We will   apply Theorem <ref> with $K=\Q (r_1+r_3)$ and
$\nu_1=1$, $\nu_2=r_1+r_3$, $\nu_3=r_1^2+r_3^2+r_1r_3$.
In the next lemma, we verify that these $3$ vectors $\nu_1$, $\nu_2$, $\nu_3$ are linearly independent over $\Q$ (even though the situation would be simpler if there was a linear dependence).

With the previous notation, $1,r_1+r_3, r_1^2+r_3^2+r_1r_3$ are linearly independent over $\Q$.

In the proof of Proposition <ref>, we have seen that   $r_1+r_3\not\in\Q$, and so certainly $1$ and $r_1+r_3$ are linearly independent.  Suppose that there exists  $u,v\in\Q$ such that
$r_1^2+r_3^2+r_1r_3=u+v(r_1+r_3)$. If we apply $\sigma^2=(r_1r_2)(r_3r_3)$ to this expression, we find $r_2^2+r_4^2+r_2r_4=u+v(r_2+r_4)$.
Summing this two equations gives

\begin{equation*}
\sum_{i=1}^4r_i^2+r_1r_3+r_2r_4=2u+v(r_1+r_2+r_3+r_4).
\end{equation*}

This contradicts  the fact that   $r_1r_3+r_2r_4\not\in\Q$ (since $\sum_i r_i,\sum_i r_i^2\in\Q$).

§.§ On the solutions of some congruence equations with $B_{14}$ and $q$

In this section we compute the number of solutions of various equations involving the factors $q_1,q_2$ and the cofactors $B_{13}, B_{14}$. These preliminary lemmas will be applied in several places in the proof of Theorem <ref>.

Some parts of this section are similar to <cit.>  or <cit.>, but both of these previous approaches relied on the condition $G=(\Z /2\Z)^2$ which we do not assume, and so we require a slightly different approach.

Let $\delta_P$ be the discriminant of the splitting field of $P$.

Suppose that $(p,a_3\delta_P\Disc{P})=1$ and $a_2\in \Z$.
Let $Q_p (a_2,a_3)$ denote the number of integers $a_1$  with $0\le a_1<p$
such that

\begin{equation}\label{pq1q2}
q_1 (a_1,a_2,a_3)\equiv q_2 (a_1,a_2,a_3)\equiv 0\Mod p.
\end{equation}

$$\label{qq12} Q_p(a_2,a_3)=\begin{cases}
1, &
\text{if} \ P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod p;\\

0, & \text{otherwise}.\\
\end{cases}

Let $L$ be the splitting field of $P$ and $\Oc_L$ its ring of integers. Since $(p,\delta_P)=1$, $p$ is not ramified in $\Oc_L$ and so its decomposition into prime ideals is
$p\cO_L=\prod_{i=1}^s \gP_i$ with $N_L (\gP_i)=p^t$ for some integers $s,t$ with $st=[L:\Q ]$. Formulas (<ref>), (<ref>), (<ref>) give us the factorisation of the polynomials $q_1$ and $q_2$ over $\Oc_L$. The condition $q_1(a_1,a_2,a_3)\equiv q_2(a_1,a_2,a_3)\equiv 0\Mod{p}$ is equivalent to one of the factors of $q_1$ and one of the factors of $q_2$ vanishing $\Mod{\gP_m}$ for each $1\le m\le s$.

First we suppose that (<ref>) has a solution. Thus for all $1\le m\le s$, there exists $(i,j)\in\{ (1,3), (1,4), (2,3), (2,4)\}$ and $(k,\ell )\in\{ (1,2), (3,4)\}$
such that

\begin{equation*}\left\{
\begin{matrix}
a_1+a_2(r_i+r_j)+a_3(r_i^2+r_ir_j+r_j^2)&\equiv 0\Mod{\gP_m},\\
a_1+a_2(r_k+r_\ell )+a_3(r_k^2+r_kr_\ell+r_\ell^2)&\equiv 0\Mod{\gP_m}.\\
\end{matrix}
\right.
\end{equation*}

Eliminating $a_1$,  we find

$$a_2 (r_i+r_j-r_k-r_\ell)\equiv a_3 (r_k^2+r_kr_\ell +r_\ell ^2-r_i^2-r_ir_j-r_j^2)\Mod {{\gP_m}}.$$

For notational simplicity we concentrate on the case $i=k=1$, $j=3$, $\ell =2$; the other cases are entirely analogous (noting that $\{i,j\}\cap\{k,\ell\}\ne \emptyset$).
We obtain

$$(r_3-r_2)a_2\equiv  a_3(r_2-r_3)(r_1+r_2+r_3)\Mod{\gP_m}.$$

Since $p\nmid\Disc (P)$ and $(r_3-r_2)|\Disc(P)$, we see that $r_3-r_2\not\equiv 0\Mod{\gP_m}$, and so (recalling $c_3=-r_1-r_2-r_3-r_4\in\Z$) we have $a_2\equiv  a_3 (c_3+r_4)\Mod{\gP_m}$. This implies that $r_4\equiv (a_2-a_3c_3)\ov{a_3}\Mod {\gP_m}$
and so

\[
P((a_2-a_3c_3)\ov{a_3})\equiv 0\Mod{\gP_m}.
\]

Since this argument is valid for all $m$, we find that $P((a_2-a_3c_3)\ov{a_3})\equiv 0\Mod{p}$. Thus if $P((a_2-c_3a_3)\ov{a_3})\not\equiv 0\Mod p$ then $Q_p(a_2,a_3)=0$.

Now we suppose that $P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod{p}$. Then there exists $j\in\{1,2,3,4\}$ such that $ r_j\equiv (a_2-a_3c_3)\ov{a_3}\Mod p$.
We may suppose that $j=4$; the other cases are analogous. We see that this implies that $a_2\equiv a_3(-r_1-r_2-r_3)\Mod{p}$ and that $r_4\in \Z+p\Oc_L$. Moreover,
we check that

\begin{align*}
a_2 (r_1+r_3)+a_3 (r_1^2+r_1r_3+r_3^2)&=a_3(-c_2-c_3r_4-r_4^2)\Mod{p},\\
a_2(r_1+r_2)+a_3(r_1^2+r_1r_2+r_2^2) &=a_2 (r_1+r_3)+a_3(r_1^2+r_1r_3+r_3^2)\Mod{p}.
\end{align*}

Thus the system (<ref>) admits the solution $a_1=-(a_2(r_1+r_3)+a_3(r_1^2+r_1r_3+r_3^2))\Mod{p}$, noting this is in $\Z+p\Oc_L$. Thus $Q_p(a_2,a_3)\ge 1$.

Moreover, there are no other solutions modulo $p$, because the previous computations showed that for any $\{ i,j,k,\ell\}=\{ 1,2,3,4\}$, if we have

\[
\left\{ \begin{matrix}
a_1 +a_2(r_i+r_j)+a_3(r_i^2+r_ir_j+r_j^2)=0\Mod{\gP_m},\\
a_1 +a_2(r_i+r_k)+a_3(r_i^2+r_ir_k+r_k^2)=0\Mod{\gP_m},
\end{matrix}\right.
\]

then we must have $(a_2-c_3a_3)\ov{a_3}=r_\ell\Mod{\gP_m}$. But the roots $r_1,r_2,r_3,r_4$ are distinct modulo $p$ when $(p,\Disc P)=1$, and so we must have $\ell=4$. Thus the only solution is $a_1\equiv -a_2(r_i+r_j)-a_3(r_i^2+r_ir_j+r_j^2)\Mod{p}$ (noting that these are the same for all choices of $\{i,j,k\}=\{1,2,3\}$). Thus $Q_p(a_2,a_3)=1$ when $P((a_2-c_3a_3)\overline{a_3})\equiv 0\Mod{p}$.

Recall that $B_{14},B_{13}$ are cubic forms in $a_0,a_1,a_2,a_3$ given explicitly by (<ref>) and (<ref>). For later estimates, we need to understand the number of solutions in $a_0$ of the equations $B_{14}\equiv 0\Mod p$ or $B_{13}\equiv 0\Mod p$. Since $B_{14}$ has degree $2$ in $a_0$, we can get an explicit formula for its roots in $\ov{\F_p}$ with the discriminant.

Let $\Delta_{14}\in\Z[a_1,a_2,a_3]$ be the discriminant of $B_{14}$
viewed as a polynomial in $a_0$. Then

\begin{equation}\label{Delta14}
\Delta_{14}=-q_3h,
\end{equation}

where $h$ is given by

\begin{align*}
&=(r_1+r_2-r_3-r_4)^2 q_3(a_1,a_2,a_3)-q_2 (a_1,a_2,a_3).
\end{align*}

We remind the reader that $q_3$ is the form defined in (<ref>) and $q_2$ is the form given by (<ref>).

This follows from explicit computation using the formula for the discriminant of a quadratic.

We recall that we have ordered the roots of $P$, $r_1,r_2,r_3,r_4$ so that $r_1r_2+r_3r_4\in\Q$.

Let $t_1:=r_1r_2+r_3r_4$ and $t_2:=(r_1+r_2)(r_3+r_4)$. Then $t_1,t_2\in\Z$.

First we note that $t_2$ is fixed by the permutations $(r_1r_3r_2r_4)$ and $(r_3r_4)$, so $t_2\in\Q$. Let $R(X)$ be a cubic resolvent associated to $P$, given by (see [3])

\begin{equation*}\begin{split}
R(X):=   & (X-(r_1+r_2)(r_3+r_4))(X-(r_1+r_3)(r_2+r_4))(X-(r_1+r_4)(r_2+r_3))\\&=
\end{split}
\end{equation*}

Then we see that $R(X)\in \Z[X]$ and it is a well-known fact that when $P$ has Galois group $C_4$ or $D_4$, $R(X)$ has a unique root over $\Q$, which must be $t_2$. Since $R(X)$ is monic we see that $t_2\in\Z$. Since $t_1+t_2=c_2\in\Z$ we see that $t_1\in\Z$.

(i) If $t_2=0$, that is $(r_1+r_2)(r_3+r_4)=0$, then we have in fact $r_1+r_2=r_3+r_4=0$ since $\sigma (r_1+r_2)=r_3+r_4$.
This implies that $c_3=0=c_1$. This situation is analogous to <cit.> (or also <cit.> for the polynomial $X^4-X^2+1$.)

(ii) We have $t_1\not =0$, since otherwise we would have $r_1-r_2=\pm (r_3-r_4)$. If we compose with the embedding $\tau = (r_3 r_4)$,
we find $r_1-r_2=r_3-r_4=0$ which is not possible.

Let $a_1,a_2,a_3\in\Z$ be such that $(q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1$ and $q(a_1,a_2,a_3)$ is squarefree. Let $t_2=(r_1+r_2)(r_3+r_4)\in\Z$.

Let $p$ be a prime with $p|q(a_1,a_2,a_3)$ and $p\nmid a_2a_3\delta_P\Disc P$.

* If $p|q_1(a_1,a_2,a_3)$ or $p\nmid c_3^2-4 t_2$, then

\[
|\{ 0\le a_0 < p : B_{14}(a_0,a_1,a_2,a_3)\equiv 0\Mod p\}|=2.
\]

* If  $p|q_2(a_1,a_2,a_3)$ and $p|c_3^2-4t_2$  then

\[
|\{ 0\le a_0 < p : B_{14}(a_0,a_1,a_2,a_3)\equiv 0\Mod p\}|=1.
\]

* We have

\[
|\{ 0\le a_0 <p : B_{13}(a_0,a_1,a_2,a_3)\equiv B_{14}(a_0,a_1,a_2,a_3)\equiv 0\Mod{p})\} |=1.
\]

We recall from (<ref>) and (<ref>) that $q|R_0$, the resultant of $B_{13}$ and
$B_{14}$ viewed as polynomials in $a_0$. Therefore since $p|q(a_1,a_2,a_3)$, we have that $p|R_0(a_1,a_2,a_3)$, and so the two quadratic polynomials in $a_0$, $B_{13}$ and $B_{14}$ have a common root
in some finite extension of $\F_p$.

If this common root is not in $\F_p$ then its conjugate is also a common root of $B_{13}$ and $B_{14}$, and so we would have $R_0(a_1,a_2,a_3)=q(a_1,a_2,a_3)q_3(a_1,a_2,a_3)\equiv 0\Mod{p^2}$. But this is impossible since we assume that $q(a_1,a_2,a_3)$ is squarefree and coprime to $q_3(a_1,a_2,a_3)$ with $p|q(a_1,a_2,a_3)$. Therefore the common root must lie in $\F_p$. This proves assertion (iii).

Since the common root of $B_{13}$ and $B_{14}$ is in $\F_p$ and $B_{14}$ is quadratic, both the roots of $B_{14}$ (seen as a polynomial in $a_0$) are in $\F_p$. Thus the number of $0\le a_0<p$ with $B_{14}\equiv 0\Mod p$ is $1$  when $p|\Delta_{14}$ and $2$ otherwise.

If $p|q_2$, by Lemma <ref>, $p|\Delta_{14}$ if and only if
$p|(r_1+r_2-r_3-r_4)^2$. This gives the assertion (i) and (ii) in the case $p|q_2$ because $(r_1+r_2-r_3-r_4)^2=c_3^2-4t_2$.

We now consider the case $p|q_1$.
Let $L$ be the splitting field of $P$, $\Oc_L$ its integer ring and $p\Oc_L=\prod_{m=1}^s\gP_m$, the decomposition of $p$ in $\Oc_L$.
Then for all $m$ there exists $(i,j)\in\{ (1,3), (1,4), (2,3), (2,4)\}$ such that
$a_1\equiv -a_2(r_i+r_j)-a_3(r_i^2+r_ir_j+r_j^2)\Mod{\gP_m}$.
We may suppose that $i=1$ and $j=3$, the other cases being similar.
Substituting $-a_2(r_1+r_3)-a_3(r_1^2+r_1r_3+r_3^2)$ for $a_1$ in the expression for $h$ in Lemma <ref>, gives

\begin{equation}\label{hr1r3}\begin{split}
\equiv -(a_3&(r_1+r_2+r_3)+a_2)(a_3(r_1+r_3+r_4)+a_2)\\
&\times     (r_1-r_2+r_3-r_4)^2\Mod {\gP_m}.\end{split}
\end{equation}

We have that $a_3(r_1+r_2+r_3)+a_2\not\equiv 0\Mod{\gP_m}$. If this were not the case we would have $a_3(-c_3-r_4)+a_2\equiv 0\Mod {\gP_m}$, and then $P((a_2-a_3c_3)\ov{a_3})=0\Mod p$.
By Lemma <ref> we would have $p| (q_1,q_2)$ which is not possible when $q$ is squarefree. Similarly $a_3(r_1+r_3+r_4)+a_2\not \equiv 0\Mod{\gP_m}$.

Thus $\Delta_{14}\equiv 0\Mod{\gP_m}$ if and only if $r_1-r_2+r_3-r_4\equiv 0\Mod{\gP_m}$ for all $m$. But this is equivalent to $r_1-r_2+r_3-r_4\equiv 0\Mod{p}$, and so $\gamma(r_1-r_2+r_3-r_3)\equiv 0\Mod{p}$ for all embeddings $\gamma$. Applying this with $\gamma=\iota,\tau$ we see that $p|\Delta_{14}$ if and only if $r_1\equiv r_2\Mod{p}$, which is impossible since $p\nmid \Disc(P)$. Thus when $p|q_1$ we have $p\nmid \Delta_{14}$, and so $B_{14}$ has two roots $\Mod{p}$.

Let $a_0,a_1,a_2,a_3,p\in\Z$ be such that $(q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1$, $q(a_1,a_2,a_3)$ is squarefree and $p| (q(a_1,a_2,a_3),B_{14}(a_0,a_1,a_2,a_3))$. Then we have

\[
p|N_P(\alpha)\Leftrightarrow p|B_{13}(a_0,a_1,a_2,a_3).
\]

where $\alpha=a_0+a_1r_1+a_2r_1^2+a_3r_1^3$.

This is a variant of <cit.> (or <cit.>). By (<ref>) and (<ref>), we have

$$(B_{13}-c_3B_{14})B_{13}-B_{14}(B_{12}-c_2B_{14})=q_3 N_P(\alpha ).$$

The Lemma follows from this formula since $(p,q_3(a_1,a_2,a_3))=1$.

§ THE SET OF IDEALS $\CJ$

In this section we define a set $\cJ$ of principle ideals which correspond to the forms $q_1$ and $q_2$ having a convenient prime factorisation. This will have a slightly technical definition to ensure that it is compatible with later arguments.

It is known (see <cit.>) that there is a fundamental domain $\cD_P$ of the units action group such that if $\alpha =a_0+a_1r_1+a_2r_1^2+a_3r_1^3\in\cD_P$, then $\max (|a_0|, |a_1|, |a_2|, |a_3|)\ll N_P(\alpha )^{1/4}$ and so $|\sigma  (\alpha )|\ll N_P(\alpha )^{1/4}$ for all embeddings $\sigma$. We recall that the forms $q_1(a_1,a_2,a_3)$ and $q_2(a_1,a_2,a_3)$ are defined by (<ref>) and (<ref>), the polynomials $P_1(X):=(X-(r_1+r_2))(X-(r_3+r_4))$ and $P_2(X):=(X-(r_1^2+r_1r_2+r_2^2))(X-(r_3^2+r_3r_4+r_4^2))$ with discriminants $\Delta_1$ and $\Delta_2$ respectively, $D_{q_2}$ from (<ref>), and $\delta_P$
is the discriminant of the splitting field of $P$.
With this notation we introduce a constant $q_0$ depending only on the polynomial $P$

\begin{equation}\label{defq0}
\end{equation}

where $t_1$ and $t_2$ are the integers defined in Lemma <ref>.
The set $\cJ$ will depend on various auxiliary absolute constants
These constants will be required to satisfy various inequalities, specifically

\begin{align}
[\theta_{ij},\theta_{ij}+\tau_{ij}]\cap[\theta_{i'j'},\theta_{i'j'}+\tau_{i'j'}]&=\emptyset\quad \text{for }(i,j)\ne (i',j'),\label{eq:Con10}\\
0<\theta_{1j}<\theta_{1j}+\tau_{1j}&<7/32  \ {\rm for}\ {\rm all}\ 1\le j\le 6,\label{eq:Con1}\\
\alpha_0&<\frac{1}{2^{15}},\label{eq:Con8}\\
\sum_{j=1}^6(\theta_{1j}+\tau_{1j})&<1+\alpha_0/2,\label{eq:Con3}\\
\theta_{11},\theta_{12},\theta_{13},\theta_{14},\theta_{15},\theta_{16},\theta_{21}&>1+\alpha_0 -\sum_{j=1}^6\theta_{1j}\label{eq:Con5},
\end{align}

\begin{align}
\frac{1+\alpha_0}{4}<\theta_{11}+\theta_{12}+\theta_{13}
\theta_{21}+\tau_{21}&<\frac{2+\alpha_0}{200}-\frac{\sum_{i=1}^3(\theta_{1i}+\tau_{1i})}{50},\label{eq:Con13}\\
\theta_{21}+\tau_{21}&<
\Big (\frac{4(\theta_{11}+\theta_{12}+\theta_{13})}{1+\alpha_0}-1\Big )\frac{2+\alpha_0}{800}.\label{eq:Con14}
\end{align}

There is reasonable flexibility in how we might choose these constants (and the above constraints could likely be weakened significantly), but for concreteness, we can chose the following explicit values of these variables:

$\alpha_0= 0.00001$,     $\theta_{11}=0.1398$,     $\theta_{12}=0.1401$,     $\theta_{13}=0.1402$,
$\theta_{15}=0.19$,     $\theta_{16}=0.1799$,     $\theta_{21}=0.001$,

2l$\tau_{ij}=0.0000001$ for all $(i,j)\in I_\cC.$

Now we are ready to define the set $\cJ$. The set $\cJ$ is the set of all principal ideals
$(\alpha)$ of $\cO_{\Q(r_1)}$ with generator $\alpha=a_0+a_1r_1+a_2r_1^2+a_3r_1^3$ where $(a_0,a_1,a_2,a_3)\in\Z^4\cap \cD_P$, satisfying the conditions (C1), (C2), (C3), (C4) and (C5) below.

$q(a_1,a_2,a_3)$ is squarefree.

(C2) Size conditions: We have

\[
\begin{split}
q(a_1,a_2,a_3)&\ge X^{3/2},\\
|B_{14}(a_0,a_1,a_2,a_3)|&\ge X^{3/4},\\
N_P(\alpha)&\in[X^{1+\alpha _0/2},X^{1+\alpha_0}].
\end{split}
\]

(C3) Factorisation conditions on $\alpha$: There exists ideals $K,L$ such that $(\alpha)=KL$ with $K$ a prime ideal satisfying

\begin{equation}\label{K}
X^{4\alpha_0}<N_P(K)\le X^{5\alpha _0}.
\end{equation}

(C4) Factorisations conditions of auxiliary polynomials:
The  values of the forms $q_1(a_1,a_2,a_3)$ and $q_2(a_1,a_2,a_3)$ evaluated at $a_1,a_2,a_3$ can be factored as:

\begin{equation}\label{qij}
\begin{split}
q_1(a_1,a_2,a_3)&=\prod_{j=1}^7 q_{1j},\\
q_2(a_1,a_2,a_3)&=q_{21}q_{22} \ {\rm with} \ q_{21}\equiv 1\Mod {D_{q_2}},
\end{split}
\end{equation}

where $q_{21}$, $q_{11},q_{12},q_{13},q_{14},q_{15},q_{16}$ are prime numbers satisfying

\[
q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]
\]

for all $(i,j)\in\{ (1,1),(1,2),(1,3),(1,4),(1,5),(2,1)\}$, and where $q_{22},q_{16}$ are integers (not necessarily prime) with

\[
\]

where $q_0$ is given by (<ref>).

(C5)Coprimality conditions:

* $(a_2,a_3)=30$ and
$a_2,a_3\equiv 30\Mod{900} $, $a_1\equiv 1\Mod{30}$.

* $(N_P (\alpha ),q_0)=1$.

* $(q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1$.

* $(q(a_1,a_2,a_3),B_{14}(a_0,a_1,a_2,a_3))=1$.

* $(q(a_1,a_2,a_3),a_2a_3)=1$.

With this definition of $\cJ$, we can verify the property (<ref>) if $\delta_0$ is chosen small enough.

We have that for all $\gJ\in\cJ$

\[
\prod_{\substack{\pf^e\|\gJ\\ N_P(\pf)\le X}}N_P(\pf)\ge X^{1+\alpha_0/2}.
\]

This is a consequence of (C2) which forces $N_P(\alpha)\ge X^{1+\alpha_0/2}$ and (C3), which forces all ideal factors of $(\alpha)$ to have norm at most $\max(X^{5\alpha_0},X^{1-3\alpha_0})<X$. (We note that (<ref>) implies that $19\alpha_0<1$).

The next Lemma says that the congruence $n\equiv{r_1}\Mod{\gJ}$ can be solved when $\gJ\in\cJ$. We recall that $\varrho_P$ is defined in (<ref>).

For all $\gJ\in\cJ$  we have $\varrho_P (\gJ)=1$.

Let $\gJ\in\cJ$. There exists
$\alpha =a_0+a_1r_1+a_2r_1^2+a_3r_1^3$ with $(a_0,a_1,a_2,a_3)\in\Z^4\cap \cD_P$ satisfying (C1),(C2),(C3),(C4),(C5) and such that $\gJ=(\alpha )$.
By Lemma <ref> and (C5)(d), $(N_P(\gJ),B_{14} (a_0,a_1,a_2,a_3))=1$. The condition (C5)(b) and Lemmas <ref> and <ref> imply then that $\varrho_P (\gJ)=1$.

As mentioned in Section <ref>, we will work with the set $\cJ_2$ which is the set of $\gJ\in\cJ$ such that $P^-(N_P (\gJ))>X^{\theta_0}$. This condition implies (C5)(b).

We see from condition $(C2)$ that if $\af\in\cJ$ then $\af=(a_0+a_1\nu_1+a_2\nu_2+a_3\nu_3)$ for some $\a\in\Z^4$ which lies in the region

\begin{equation}\label{defRP}\begin{split}
\cR:=\Bigl\{ \a\in&\R ^4\cap \cD_P :\ 7X^{1+\alpha_0/2}<\widetilde{N}(a_0,a_1,a_2,a_3)\le X^{1+\alpha_0}, \\
&\ |B_{14}(a_0,a_1,a_2,a_3)|\ge X^{3/4},\ |q(a_1,a_2,a_3)|\ge X^{3/2}\Bigr\}

Here we have written $\widetilde{N}_P$ as the extension of $N_P(\alpha)$ to $\mathbb{R}^4$;

\begin{equation}\label{eq:RealNDef}
\widetilde{N}(a_1,a_2,a_3,a_4):=\prod_{i=1}^4 \Big (\sum_{j=1}^4 a_j\sigma _i (\nu_j)\Big ).
\end{equation}

By our choice of $\cD_P$ we see that if $\a\in\cR$ then $|a_i|\ll X^{(1+\alpha_0)/4}$ for all $i\in\{1,2,3,4\}$.

For notational convenience we set $I_\cC$ to be the set

\begin{equation}\label{defIC}
I_\cC:=\{ (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(2,1)\},
\end{equation}

so that condition $(C4)$ forces $q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]$ for all $(i,j)\in I_\cC$, for example.

§ PROOF OF PROPOSITION <REF>: THE TERM $S_1$

In this section we establish Proposition <ref> by bounding the sum $S_1$ defined by (<ref>). The overall approach is similar to previous works. First we reduce to controlling exponential sums, then remove the $a_0$-dependence in the denominator of the phase which means that we can apply the $q$-analogue of Van der Corput's method whenever the denominator of the phase takes a suitably friable form.

[Reduction to exponential sums]
Let $S_1$ be as given by (<ref>), and $\eta_0,\alpha_0,\theta_0>0$ be such that

\begin{equation*}
\alpha_0 <\eta_0 <1-\frac{9}{4}\alpha_0,\qquad 12\theta_0+19\alpha _0 <1.
\end{equation*}

Then for $X\ge 2$, $H=X^{\eta_0}$ we have

\begin{equation}\label{S1start}
S_1\ll (\log H)\sum_{K\in\cK}\sum_{\substack{{A}\\
{N_P(A)|\cP (X^{\theta_0})}\\
{N_P (A)\le X^{3\theta _0}}}}\sum_{h\le H^2}
\frac{|E_1 (X,h ;KA)|+|E_2 (X,h ; KA)|}{h+h^2/H}+o(X),
\end{equation}

where for $\ell \in\{1,2\}$

\begin{equation*}
E_\ell (X,h;KA):=\sum_{\substack{{(\alpha)\in\cJ}\\
{ KA |(\alpha )}}}\e \Big ( \frac{ h\ell X}{N_P(\alpha )}-\frac{hU\ov{B_{14}}}{q}\Big ).
\end{equation*}

This is <cit.>.

To show that $S_1$ is small, our task is therefore reduced to showing cancellation in the exponential sums $E_\ell$. Lemma <ref> allows us to put the exponential phase into a form where we can then apply the $q$-analogue of Van der Corput's method. The bounds from this method are summarised in the following lemma.

[$q$-Van der Corput for short exponential sums] Let $k,D\ge 1$, $\varepsilon >0$. Let $f,g,v\in\Z [X]$ of degree $\le D$ and $r=r_0\cdots r_k$ be squarefree
such that $P^-(r)>2^k D$. Suppose that for every $p|r$ there is no polynomial $w\in\Z [X]$ of degree $\le k+1$ such that
$f(X)\equiv w(X)g(X)\Mod p$. Moreover, suppose that $v(X)$ is not the zero polynomial $\Mod p$ for any $p|r$. Then  for $A,B,h\ge 1$ we have

\begin{equation*}\begin{split}
\sum_{\substack{{ A<n\le A+B}\\ {(v(n)g(n),r)=1}}}\e \left (\frac{hf(n)\ov{g(n)}}{r}\right )
r^\varepsilon B \Big [\Big (\frac{\Delta}{r_0}\Big  )^{1/2^{k+1}}+\Big (\frac{r_0}{\Delta B^2}\Big )^{1/2^{k+1}}\\
&+\sum_{j=1}^k\Big (\frac{r_{k+1-j}}{B}\Big )^{1/2^j}\Big ],
\end{split}
\end{equation*}

where $\Delta:=(r_0,h)$.

This is <cit.> (a small variation of <cit.>).

To apply this lemma, the denominator $q(a_1,a_2,a_3)$ in our exponential phase must have a good factorisation. We will apply Theorem <ref> to show that for a positive proportion of $(a_1,a_2,a_3)$ the denominator $q=q(a_1,a_2,a_3)$ has such a factorisation.
We want the $\e(hU\ov{B_{14}}/q)$ factor to oscillate suitably to give this cancellation via Lemma <ref>. The following lemma will ensure that this factor is not degenerate.

Let $U=a_0U_1+U_0$, $V=a_0V_1+V_0$ as in (<ref>) and in (<ref>).
If $a_0,a_1,a_2,a_3\in\Z$ are such that $(a_0+a_1\nu_1+a_2\nu_2+a_3\nu_3)\in\cJ$, then

\[
\]

Imagine for a contradiction that $p| q(a_1,a_2,a_3),U_0(a_1,a_2,a_3),U_1(a_1,a_2,a_3)$. Then $U(a_0',a_1,a_2,a_3)=0\Mod{p}$ for all $a_0'$, and so the equation $U B_{13}+VB_{14}=q q_3$ (<ref>) simplifies to give

\[
V(a_0',a_1,a_2,a_3)B_{14}(a_0',a_1,a_2,a_3)\equiv 0\Mod{p}
\]

for all $a_0'$. Condition (C5)(d) then implies that $B_{14}(a_0',a_1,a_2,a_3)$ does not identically vanish $\Mod{p}$, so $V_1(a_1,a_2,a_3)=V_0(a_1,a_2,a_3)=0\Mod{p}$.

By conditions (C1) and (C5)(c), $a_1,a_2,a_3$ satisfy the hypotheses of Lemma <ref>. But this implies that there is a choice of $a_0'$ such that $B_{14}(a_0',a_1,a_2,a_3)=B_{13}(a_0',a_1,a_2,a_3)=0\Mod{p}$. Evaluating (<ref>) at $a_0',a_1,a_2,a_3$ then implies that

\[
q(a_1,a_2,a_3)q_3(a_1,a_2,a_3)\equiv 0\Mod{p^2}.
\]

This is impossible since $(q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1$ and $q(a_1,a_2,a_3)$ is squarefree by conditions (C5)(c) and (C1). This gives the result.

Finally, we need a short lemma to show that we can restrict attention to $q(a_1,a_2,a_3)$ being not too small.

[Bounding terms with $q_2 (a_1,a_2,a_3)$ small]
Let $\tau_{20}>0$ and  for $\ell =1,2$, $E_\ell '(X,h;KA)$ be the contribution in $E_\ell (X,h;KA)$ given by the $(\alpha)\in\cJ$ such that $|q_2(a_1,a_2,a_3)|\le X^{(1+\alpha_0)/2-\tau_{20}}$.

\[
E'_\ell (X,h;KA)\ll \frac{X^{1+\alpha_0-\tau_{20}/2}}{N_P (KA)}.
\]

Since $N_P(AK)$ is square-free by construction, by Lemma <ref>, there exists an integer $j$ such that $r_1\equiv j\Mod{KA}$. The condition $KA|(\alpha )$ is therefore equivalent to

\[
a_0\equiv {-a_1 j-a_2 j^2-a_3 j^3}\Mod{N_P(AK)}.
\]

Thus, for any given $a_1,a_2,a_3$ there are $O(X^{(1+\alpha_0)/4}/N_P(KA))$ terms $a_0$ in $E_{\ell}'(X,h;KA)$.

We recall that $q_2 (a_1,a_2,a_3)=\prod_{i=0}^1 L_{i}(a_1,a_2,a_3)$ with for $i=0,1$:

\[
\]

If $|q_2 (a_1,a_2,a_3)|\le X^{(1+\alpha_0)/2 -\tau_{20}}$

\begin{equation}
\label{smallLi0Li1}
\min_{i=0,1}|L_{2i} (a_1,a_2,a_3)| \ll X^{(1+\alpha_0)/4-\tau_{20}/2}.
\end{equation}

For any given $a_2,a_3$, the number of $a_1$ satisfying (<ref>) is $O(X^{(1+\alpha_0)/4-\tau_{20}/2}).$ Since there are $O(X^{(1+\alpha_0)/2})$ choices of $a_2,a_3$, the total number of terms in $E'(X,h;KA)$ is $O(X^{1+\alpha_0-\tau_{20}/2})$.

We are now able to bound $S_1$ suitably.

First we wish to apply Lemma <ref>. By (<ref>), we have $\alpha_0<1/20$, so the conditions of the lemma hold if $\eta_0$ is slightly larger than $\alpha_0$ and $\theta_0$ is sufficiently small. This gives

\[
S_1\ll (\log H)\sum_{K\in\cK}\sum_{\substack{{A}\\
{N_P(A)|\cP (X^{\theta_0})}\\
{N_P (A)\le X^{3\theta _0}}}}\sum_{h\le H^2}
\frac{|E_1 (X,h ;KA)|+|E_2 (X,h ; KA)|}{h+h^2/H}+o(X),
\]

\[
E_\ell (X,h;KA):=\sum_{\substack{{(\alpha)\in\cJ}\\
{ KA |(\alpha )}}}\e \Big ( \frac{ h\ell X}{N_P(\alpha )}-\frac{hU\ov{B_{14}}}{q}\Big ).
\]

We write $E_\ell=E_\ell'+E_{\ell}$ where $E_\ell'$ is the contribution from terms in $E_\ell$ with $|q_2(a_1,a_2,a_3)|\le Y$, and $E_\ell''$ is the contribution from terms with $|q_2(a_1,a_2,a_3)|>Y$. By Lemma <ref>, the contribution to $S_1$ from $E_\ell'$ is $O(X^{1-\epsilon+o(1)})$ provided

\begin{equation}\label{eq:YSize}
\end{equation}

Therefore we concentrate on the contribution from $E_\ell''$. As in the proof of Lemma <ref>, there exists an integer $j$ such that the condition $KA|(\alpha )$ is therefore equivalent to

\begin{equation}\label{a0KA}
a_0\equiv {-a_1 j-a_2 j^2-a_3 j^3}\Mod{N_P(AK)}.
\end{equation}

Let $\tilde a_0=\tilde a_0 (a_1,a_2,a_3 ;KA)$ be a solution of the congruence (<ref>). We may write
$a_0 =\tilde a_0 +mN_P (KA)$ with $m\in\cR' (a_1,a_2,a_3)$

\begin{equation*}
\cR' (a_1,a_2,a_3):=\{ m : (\tilde a_0 +mN_P(KA), a_1,a_2,a_3)\in \cR\}.
\end{equation*}

(We recall that $\cR$ is the domain defined in (<ref>).)
This set $\cR' (a_1,a_2,a_3)$ can be written as a finite union  of intervals $I'(a_1,a_2,a_3)$.

Any $a_0$ of the above form ensures that conditions $(C2)$ and $(C3)$ are satisfied. Conditions (C1), (C4) and (C5) parts (a),(c),(e) don't depend on $a_0$. Thus we find

\[
E_\ell ''(X,h;KA)\ll \sum_{\substack{a_1,a_2,a_3\ll X^{(1+\alpha_0)/4} \\ q_2(a_1a_2,a_3)>Y \\ \eqref{qij}}}\Bigl|\sum_{\substack{m\in I'(a_1,a_2,a_3) \\ (N_P(\alpha),q_0)=(q,B_{14})=1}}\e \Big ( \frac{ h\ell X}{N_P(\alpha )}-\frac{hU\ov{B_{14}}}{q}\Big )\Bigr|.
\]

Here by $\sum_{\eqref{qij} }$ we mean that the summation is constrained by the factorisation condition (<ref>) .

We now need to control the gcd between $N_P (KA)$ and $q$. We define $t=(N_P(KA),q)$ and $t'=q/t$. Since $q$ is squarefree, $(t,t')=1$. We apply Bezout formula (<ref>)
to separate the congruence in $t$ and in $t'$
and use partial summation to remove the factor
$e(h\ell X/N_P(\alpha))$.
This gives  for $\ell=1,2$, (as in <cit.>)

\begin{equation}\label{El}
E_\ell ''(X,h;KA)\ll X^{2\eta_0+\alpha_0/4}\sum_{\substack{ (a_1,a_2,a_3)\in\cC  \\  q_2(a_1,a_2,a_3)>Y \\ \eqref{qij}}}
\max_{B\ll \frac{X^{\frac{1+\alpha_0}{4}}}{N_P(KA)}}
\Big |\sum_{\substack{{m\le B}\\ {(g(m),t')=1}}}\e \Big ( \frac{h\bar t f(m)\ov{g(m)}}{t'}\Big )\Big |,
\end{equation}

where $\cC$ is the projection of $\cR$ onto the final 3 coordinates and

\[
f(m):=U(\tilde a_0+mN_P(KA)),\quad  g(m):=B_{14} (\tilde a_0+mN_P (KA)).
\]

We recall from (<ref>) that for all $a_1,a_2,a_3$ under consideration $q(a_1,a_2,a_3)$ factors as $\prod_{i=1}^7 q_{1i}\prod_{j=1}^2q_{2j}$ for some integers $q_{ij}$ of constrained sizes. We now wish to apply Lemma <ref>, which requires that for all $a_1,a_2,a_3$ under consideration and all $p|q(a_1,a_2,a_3)$, there is no polynomial $w(X)\in\Z [X]$ of degree less than $10$ such that $f(X)\equiv {w(X)g(X)}\Mod p$.

Let $p|q(a_1,a_2,a_3)$. By (C5)(e), $a_3$ is coprime with $p$, and so by (<ref>), $B_{14}\Mod{p}$ is a polynomial of degree exactly two in $a_0$ since its lead coefficient is $-a_3$. By Lemma <ref> , $(p,U_0(a_1,a_2,a_3),U_1(a_1,a_2,a_3))=1$, and so $U(a_0,a_1,a_2,a_3)\Mod p$ is not identically zero and has degree at most $1$ in $a_0$. This implies that  for all $p|q$, there is no polynomial $w\in\Z [X]$ such that
$U(X,a_1,a_2,a_3)\equiv w(X)B_{14}(X,a_1,a_2,a_3)\Mod p$ and we can apply Lemma $\ref{HB}$ with $k=8$.
We take $r_0=q_{22}$, $r_1=q_{21}$, $r_2=q_{17}$, $r_3=q_{16}$, …, $r_8=q_{11}$.
By (<ref>) and (<ref>), we observe that $q_{17}<q_{1j}$ for all $1\le j\le 6$.

\begin{equation}
\label{bigtheta11}
\theta_{max}+\tau_{max}=\sup_{(i,j)\in I_\cC}(\theta_{ij}+\tau_{ij}),
\end{equation}

where we recall from (<ref>) that
$$I_\cC:=\{ (1,1),(1,2),(1,3),(1,4),(1,5),(1,6), (2,1)\}.$$

Then the sum over $m$ in (<ref>) is bounded by

\[ \begin{split}
\Big |\sum_{\substack{ m\le B \\ (g(m),t')=1 }}&\e \Big ( \frac{h\bar t f(m)\ov{g(m)}}{t'}\Big )\Big|\\
&\ll q^\varepsilon B\Big ( \Big (\frac{(h,q)(q_{22},t)}{q_{22}}\Big )^{1/2^9}+\Big ( \frac{q_{22}}{B^2}\Big )^{1/2^9}+\sup_{(i,j)\in I_\cC}\Big (\frac{q_{ij}}{B}\Big)^{1/2^8}\Big).
\end{split}
\]

We insert this bound into $E_\ell '' (X,h ; KA)$, and then subsitute this into $S_1$. Writing $q_{22}=X^{\theta_{22}}$, this gives

\[\begin{split}
S_1 &\ll X^{2\eta_0+1+\frac{5\alpha_0}{4}+\varepsilon}
\big ( X^{-\theta_{22}2^{-9}}+X^{(\theta_{22}+\tau_{22}-\frac{1+\alpha_0}{2}+6\theta_0+10\alpha_0)2^{-9}}\\
&+X^{(\theta_{max}+\tau_{max}-\frac{1+\alpha_0}{4}+3\theta_0+5\alpha_0)2^{-8}}\big )+X^{1-\epsilon+o(1)}.\end{split}
\]

Thus we see that $S_1=o(X)$ provided

\begin{align*}
\frac{\theta_{22} }{2^9}&<\frac{1}{2^9}\Big ( \frac{1+\alpha_0}{2}-6\theta_0-10\alpha_0\Big )-2\eta_0-\frac{5\alpha_0}{4}\\
\frac{\theta_{max}+\tau_{max}}{2^8}&<\frac{1}{2^8}\Big ( \frac{1+\alpha_0}{4}-3\theta_0-5\alpha_0\Big )-2\eta_0-\frac{5\alpha_0}{4}.
\end{align*}

We recall that $q_{22}=q_2(a_1,a_2,a_3)/q_{21}$, that $q_2(a_1,a_2,a_3)\in[Y,X^{(1+\alpha_0)/2}]$ and $q_{21}\in [X^{\theta_{21}},X^{\theta_{21}+\tau_{21}}]$. Thus on choosing $Y=X^{(1+\alpha_0)/4-4\eta_0-\epsilon}$ so (<ref>) is satisfied, we see that the bound $S_1=o(X)$ holds provided

\begin{align*}
2\eta_0+\frac{5\alpha_0}{4}&<\Bigl(\frac{1+\alpha_0}{4}-\theta_{21}-\tau_{21}-4\eta_0\Bigr) \frac{1}{2^9}\\
\frac{1}{2^9}\Bigl(
\frac{1+\alpha_0}{4}-\theta_{21}
\Bigr)
&<\frac{1}{2^9}\Big ( \frac{1+\alpha_0}{2}-6\theta_0-10\alpha_0\Big )-2\eta_0-\frac{5\alpha_0}{4}\\
\frac{\theta_{max}+\tau_{max}}{2^8}&<\frac{1}{2^8}\Big ( \frac{1+\alpha_0}{4}-3\theta_0-5\alpha_0\Big )-2\eta_0-\frac{5\alpha_0}{4}.
\end{align*}

These follow from (<ref>), (<ref>) and (<ref>) on taking $\theta_0$ sufficiently small and $\eta_0$ sufficiently close to $\alpha_0$.

§ PROOF OF PROPOSITION <REF>: THE SUM $S_0$

In this section we estimate the sum $S_0$ from (<ref>) and establish Proposition <ref> all under the assumption of Theorem <ref>.

§.§ The variable $a_0$ in  $S_0$

With the notation $\alpha =a_0+a_1r_1+a_2r_1^2+a_3r_1^3$, we consider
the subset $\cR\in\R^4$ is defined by (<ref>).

For $S_0$ we proceed in the same way as in [1], [4], [8] but with slight differences in some steps where a bound in $O(X^\varepsilon)$  is not always sufficient.

[Removing the variable $a_0$]
Let $12\theta_0+ 22\alpha _0 <1$. We have

\begin{equation*}
S_0= \Bigl(\frac{4\e^\gamma}{3}\log(5/4)\log 2+o(1)\Bigr)\prod_{p<X^\theta_0}
\Big ( 1-\frac{g(p)}{p}\Big )S_{01}+O(X^{-\alpha_0/5}),
\end{equation*}

\begin{align}
g(p)&:=|\{ \gP : N_P (\gP )=p\}|,\\
\cC&:=\{(a_1,a_2,a_3)\in\R^3:\exists a_0\in \R\text{ s.t. }(a_0,a_1,a_2,a_3)\in\cR\},\label{eq:CRDef}\\
\cG&:=\{(a_1,a_2,a_3)\in \ZZ^3:\, \exists a_0\in \Z\text{ s.t. }(\alpha)\in\cJ\},\label{eq:GDef}\\
h(q)&:=\mu ^2 (q)\prod_{p|q}\frac{ (1-2/p)}{1-g(p)/p}\1_{P^-(q)>q_0},
\label{eq:HDef}\\
I(a_1,a_2,a_3)&:=\int_{a_0\in\cD (a_1,a_2,a_3)}\frac{\d a_0}{\widetilde{N}_P(a_0,a_1,a_2,a_3)},\\
\cD(a_1,a_2,a_3) &:=\{ a_0\in\R :(a_0,a_1,a_2,a_3)\in\cR\}.\label{eq:DDef}
\end{align}

Here $\widetilde{N}_P(a_0,a_1,a_2,a_3)$ is the quartic form coinciding with $N_P(a_0+a_1r_1+a_2r_1^2+a_3r_1^3)$ on integers.

We want to isolate the variable $a_0$. We note that the condition $(\alpha)\in\cJ$ implies that $(q(a_1,a_2,a_3),B_{14}(a_0,a_1,a_2,a_3))=1$ and that $(a_0,a_1,a_2,a_3)\in \cR$ but otherwise there are no further dependencies between $a_0$ and $a_1,a_2,a_3$. We use Möbius inversion to detect the condition $(q,B_{14})=1$ when evaluated at $a_0,a_1,a_2,a_3$. This give rise to a  squarefree $r|(q,B_{14})$ which we decompose as $r=r_1'r_2'$
with $r_1'|N_P(KA)$ and $(r_2',N_P(KA))=1$. This yields

\begin{equation}\begin{split}
\sum_{(a_1,a_2,a_3)\in \cC\cap\cG}\sum_{\substack{{r'_1|N_P(KA)}\\ {r'_1|q(a_1,a_2,a_3)}}}\mu (r'_1)\\
&\times\sum_{\substack{{r_2'|q(a_1,a_2,a_3)}\\{(r_2',N_P(KA))=1}}} \mu (r_2')
\sum_{\tilde a_0\in S(r_1',r_2')}
\sum_{\substack{{a_0\in\cD (a_1,a_2,a_3)}\\ {a_0\equiv \tilde a_0\Mod{r_2'N_P(KA)}}}}\frac{1}{N_P(\alpha )},
\end{split}
\label{eq:S0eq}
\end{equation}

where $\cC$, $\cG$ are as in (<ref>) and (<ref>)

\begin{equation}
S(r_1',r_2'):=\{ 0\le a_0\le  r_2'N_P(KA): r_1'r_2'| B_{14}(a_0,a_1,a_2,a_3),\, KA | (\alpha)\}.\label{eq:Sr1r2}
\end{equation}

(We have suppressed the dependence of $S(r_1',r_2')$ on $a_1,a_2,a_3$ for notational convenience.) The inner sum over $a_0$ is now over points in an interval with a congruence constraint, and so by partial summation (and recalling from (<ref>) that $N_P(\alpha)\gg X^{1+\alpha_0/2}$ for all $\aa\in \cR$), we obtain

\begin{equation}
\sum_{\substack{{a_0\in\cD (a_1,a_2,a_3)}\\ {a_0\equiv \tilde a_0\Mod{r_2'N_P(KA)}}}}\frac{1}{N_P(\alpha )}=\frac{I (a_1,a_2,a_3)}{r_2'N_P(AK)}+O\Bigl(\frac{1}{X^{1+\alpha_0/2}}\Bigr).
\label{eq:a0sum}
\end{equation}

The $O(X^{-(1+\alpha_0/2)})$ error term in (<ref>) contributes to $S_0$ a total

\[
\ll \frac{1}{X^{1+\alpha_0/2-o(1)}}\sum_{N_P(K)\ll X^{5\alpha_0}}\sum_{N_P(A)\le X^{3\theta_0}}\sum_{(a_1,a_2,a_3)\in\cC}1\ll X^{-1/4 +3\theta_0+21\alpha_0/4+o(1)}.
\]

(Recall that if $\aa\in\cR$ then $\|\aa\|_\infty \ll X^{(1+\alpha_0)/4}$ by our choice of fundamental domain). This is $O(X^{-\alpha_0/4+o(1)})$ if $12\theta_0+22\alpha_0<1$, as in the assumptions of the lemma.

Thus we are left to consider the contribution from the main term of (<ref>), namely

\begin{equation}
\sum_{(a_1,a_2,a_3)\in \cC}\sum_{K\in\cK}\sum_{A}\lambda_{N_P(A)}^-\sum_{\substack{ r'_1r_2'|q(a_1,a_2,a_3)\\ r'_1|N_P(KA)\\ (r_2',N_P(KA))=1}} \mu(r_1')\mu (r_2')\frac{|S(r_1',r_2')|I (a_1,a_2,a_3)}{r_2'N_P(AK)}.
\label{eq:S0Main}
\end{equation}

By the Chinese Remainder Theorem, we have

\begin{equation}
|S(r_1',r_2')|=\prod_{p| r_2'N_P(KA)}|S(r_1',r_2',p)|,
\label{eq:CRT}
\end{equation}

\begin{equation*}
\begin{cases} |\{ 0\le a_0<p : p| (B_{14}(a_0,a_1,a_2,a_3), N_P(\alpha ))\}|, & \text{if}\ p|r_1',\\
|\{ 0\le a_0 <p : p| B_{14}(a_0,a_1,a_2,a_3) \} |, & \text{if}\ p|r_2',\\
|\{ 0\le a_0 <p : p|N_P (\alpha )\}|, & \text{if}\ p|N_P(KA)/r_1'.\end{cases}
\end{equation*}

We compute $|S(r_1',r_2',p)|$ using Lemmas <ref> and
<ref>. Under the condition $P^-(q)>q_0$ we find

\begin{equation*}
2 & \text{if}\ p|r_2', \\
1 & \text{if}\ p|N_P(KA).
\end{cases}
\end{equation*}

Using this bound in (<ref>) gives

\begin{equation*}
|S(r_1',r_2')|=2^{\omega (r_2')}.
\end{equation*}

Inserting this in the previous expression (<ref>) for the main term of $S_0$, we see that the sum over $r_1'$ is $1$ if $(q(a_1,a_2,a_3),N_P(KA))=1$, and $0$ otherwise. Thus the expression (<ref>) simplifies to

\[
\sum_{(a_1,a_2,a_3)\in \cC}I (a_1,a_2,a_3)\Bigl(\sum_{r_2'|q(a_1,a_2,a_3)} \frac{\mu (r_2')2^{\omega(r_2')}}{r_2'}\Bigr)h_1(q(a_1,a_2,a_3)),
\]

\[
h_1(q):=\Biggl(\sum_{\substack{K\in\cK\\ (N_P(K),q)=1}}\frac{1}{N_P(K)}\Biggr)\Biggl(\sum_{(N_P(A),q)=1}\frac{\lambda_{N_P(A)}^- }{N_P(A)}\Biggr).
\]

Recalling that $\cK$ is the set of prime ideals with norm between $X^{4\alpha_0}$ and $X^{5\alpha_0}$, we see that for $q\ll X^{O(1)}$

\begin{align*}
\sum_{\substack{K\in \cK\\ (N_P(K),q)=1}}\frac{1}{N_P(K)}&=\log(5/4)+o(1),\\
\sum_{\substack{(N_P(A),q)=1}}\frac{\lambda^-_{N_P(A)}}{N_P(A)}&=\sum_{\substack{d\le X^{3\theta_0}\\ (d,q)=1}}\frac{\lambda^-_{d}g(d)}{d}\\
&=\Bigl(\frac{2 e^\gamma\log{2}}{3}+o(1)\Bigr)\prod_{p<X^{\theta_0}}\Bigl(1-\frac{g(p)}{p}\Bigr)\prod_{\substack{p|q\\ p\le X^{\theta_0}}}\Bigl(1-\frac{g(p)}{p}\Bigr)^{-1}.
\end{align*}

Here we used the fact that the linear sieve lower bound function evaluated at 3 is $2 e^\gamma\log{2}/3$. Putting these expressions together now gives the result.

§.§ Splitting into small boxes

We see from condition (C2) that if $\af\in\cJ$ then $\af=(a_0+a_1r_1+a_2r_1^2+a_3r_1^3)$ for some $\a\in\Z^4$ which lies in the region $\cR$ given by (<ref>). We recall that $\eta_1 =(\log x)^{-100}$. We cover the region $\cR$ by hyper-rectangles of type

\begin{equation}\label{HyperH}
\cH =]A_0,A_0+\eta_1 A_0]\times]A_1,A_1(1+\eta_1)]\times]A_2,A_2(1+\eta _1)]\times]A_3,A_3(1+\eta _1)].
\end{equation}

The number of such hyper-rectangles is $O(\eta_1^{-4})(\log X)^4=O(\eta_1^{-5})$.

Furthermore the contribution to $S_{01}$ from hyper-rectangles such that $\min (|A_i|)\le X^{1/4-7\alpha_0/8}$
is $O(X^{1-\alpha_0/8+\varepsilon})$ which is sufficiently small.

We will say that $\cH$ is a `good' hyper-rectangle if $\cH\subset\cR$ and

\begin{equation}\label{goodcube}
\begin{split}
\min (|A_0|,|A_1|,|A_2|,|A_3|)&\ge X^{1/4-7\alpha_0/8}, \\
\min (|A_0|,|A_1|,|A_2|,|A_3|)&\ge\eta_1\max (|A_0|,|A_1|, |A_2|, |A_3|),\\
q_1 (A_1,A_2,A_3)&\ge \eta_1^{1/10} \max (|A_1|,|A_2|,|A_3|)^4.
\end{split}
\end{equation}

If $\cH$ is not `good' then we say $\cH$ is `bad'. We note that the second and third assertions in this definition corresponds to the
conditions (<ref>) and (<ref>).

We denote by $\sH_\cR$ the set of all good hyper-rectangles. To each hyper-rectangle $\cH$ we associate its projection to $\R^3$ by ignoring $a_0$:

\begin{equation}\label{HyperH'}
\cH' =]A_1,A_1(1+\eta_1)]\times]A_2,A_2(1+\eta_1)]\times]A_3,A_3(1+\eta_1)].
\end{equation}

[Splitting into small boxes]
Let $S_{01}$ be as in Lemma <ref>. We have that

\[
S_{01}\gg \sum_{\cH\in\sH_\cR}\frac{A_0 \eta_1}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}S_{02}(\cH),
\]

\[
S_{02}(\cH):=\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
(i,j)\in I_\cC\\ {q_{21}\equiv 1\Mod{D_{q_2}}}}}\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6 q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\
{ (q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1}\\ {(q,a_2a_3)=1}\\
{(a_2,a_3)=30,\ a_1\equiv 1\Mod{30}}\\
a_2,a_3\equiv 30\Mod{900}
\]

We recall from (<ref>) that $\widetilde{N}_P(a_0,a_1,a_2,a_3)$ is the quartic form coinciding with $N_P(a_0+a_1r_1+a_2r_1^2+a_3r_1^3)$ on integers.

By splitting the sum over $a_1,a_2,a_3$ and the integral over $a_0$ into the hyperrectangles $\cH$, and then restricting only to good hyperrectangles for a lower bound, we find

\begin{equation*}
S_{01}\ge \sum_{\cH\in\sH_{\cR}}S_{01}'(\cH),
\end{equation*}

\begin{align*}
S_{01}'(\cH)&:=\sum_{(a_1,a_2,a_3)\in\cC\cap\cH'\cap \cG}h(q(a_1,a_2,a_3))I_\cH (a_1,a_2,a_3),\\
I_\cH (a_1,a_2,a_3)&:=\int_{A_0}^{A_0(1+\eta_1)}
\frac{\d a_0}{\widetilde{N}_P(a_0,a_1,a_2,a_3)}=\frac{A_0\eta_1(1+o(1))}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}.
\end{align*}

We recall from (<ref>) that if $(a_1,a_2,a_3)\in \cG$ then $q_1(a_1,a_2,a_3)$ and $q_2(a_1,a_2,a_3)$ factor as $\prod_{i=1}^6 q_{1i}$ and $q_{21}q_{22}$ respectively with $q_{21},q_{11},q_{12},q_{13},q_{14},q_{15}$ primes satisfying $q_{ij}\ge X^{\theta_{ij}}$. In particular, we see that for any choice of $a_1,a_2,a_3$ there are $O(1)$ choices of $q_{ij}$ such that $q_i(a_1,a_2,a_2)=\prod_{j}q_{ij}$. Thus, summing over these representations, we find

\begin{equation*}\begin{split}
S_{01}(\cH)&\gg \frac{A_0\eta_1}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}S_{02}(\cH),
\end{split}
\end{equation*}

say, with $S_{02}(\cH)$ as given by the lemma and $I_\cC$ defined in (<ref>). This gives the result.

§.§ Preparation for the application of Theorem <ref>

Following <cit.> or <cit.>, we do several manipulations in order to take care of the different coprimality conditions and the  multiplicative weight $h(q)$. In our situation it is important that we are slightly more careful than these previous works. We do not impose congruence conditions to moduli larger than $(\log{X})^{O(1)}$ since this would cause issues related to Siegel zeros (the argument of the previous papers would introduce a congruence constraint of modulus $X^{t_0}$ for some $t_0>0$). This means we need to be careful not to lose the fact that when $(a_0,a_1,a_2,a_3)\in\cH$, the $a_i$ are in small intervals.

\begin{equation}
Z:=(\log X)^{\lambda_0}, \qquad Z':=X^{\alpha_0/10000},
\label{eq:ZDef}
\end{equation}

where $\alpha_0$ is the constant used to define the set $\cK$ (which will be chosen sufficiently small later on) and $\lambda_0$ is a fixed constant (which will be chosen sufficiently large). From the bound (<ref>), we certainly note that since $\alpha_0<1$ we have

\begin{equation}
\end{equation}

For brevity we will write

\begin{equation}\label{defNH}
N_\cH =\widetilde{N}_P(A_0,A_1,A_2,A_3).
\end{equation}

[Removing the condition $(q,q_3)=1$]
Let $S_{02}(\cH)$ be as in Lemma <ref>. Then we have

\[
S_{02}(\cH)=S_{03}(\cH)+O\Bigl(\frac{ \eta_1^3  A_1A_2A_3}{Z^{3/4}}\Bigr),
\]

\[
S_{03}(\cH):=\sum_{d\le Z}\mu_(d)\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\ (i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\ d|q(a_1,a_2,a_3)\\ d|q_3(a_1,a_2,a_3) \\
{ (q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1}\\ {(q,a_2a_3)=1}\\
(a_2,a_3)=30,\ a_1\equiv 1\Mod{30}\\ a_2,a_3\equiv 30\Mod{900}}}h(q(a_1,a_2,a_3)).
\]

First, we detect the condition $(q,q_3)=1$ via Möbius inversion

\begin{equation*}
S_{02}(\cH)=\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\ (i,j)\in I_\cC \\ q_{21}\equiv 1\Mod{D_{q_2}} }}
\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\
{ (q(a_1,a_2,a_3),q_3(a_1,a_2,a_3))=1}\\ {(q,a_2a_3)=1}\\
{(a_2,a_3)=30,\ a_1\equiv 1\Mod{30}}\\
{a_2,a_3\equiv 30\Mod{900}}}}h(q(a_1,a_2,a_3))\sum_{\substack{{d|q(a_1,a_2,a_3)}\\ {d|q_3(a_1,a_2,a_3)}}}\mu (d).
\end{equation*}

We split $S_{02}(\cH)$ into three sums,

\[
S_{02} (\cH)=S_{03}(\cH)+U_{21}(\cH)+U_{22}(\cH),
\]

where $S_{03} (\cH)$ is the contribution of the terms in $S_{02}(\cH)$ with $d\le Z$, $U_{21}(\cH)$ is the contribution from $Z<d\le Z'$ and $U_{22}(\cH)$ is the contribution from $d>Z'$. We note that $S_{03}(\cH)$ is as given in the lemma, so we are left to bound $U_{21}(\cH)$ and $U_{22}(\cH)$.

First we  bound $U_{21}$.  Recall that $q_3(a_1,a_2,a_3)=-a_1a_3+a_2^2-c_3a_2a_3-c_2a_3^2$, so the condition  $q_3\equiv 0\Mod d$ implies that
$a_1\equiv \ov{a_3} (a_2^2-c_3a_2a_3-c_2a_3^2)\Mod d$. (We restrict ourselves to $(a_3,q(a_1,a_2,a_3))=1$ so $(a_3,d)=1$.) Inserting
this into the condition $q(a_1,a_2,a_3)\equiv 0\Mod d$ and multiplying by $a_3^6$ gives
$Q(a_2,a_3):=q(a_2^2-c_3a_2a_3-c_2a_3^2,a_2a_3,a_3^2)\equiv 0\Mod d$, for a polynomial $Q(a_2,a_3)$ which is of degree $12$ in $a_2$ (and non-zero). For any given $a_3$
the number of roots of $Q(a_2,a_3)\Mod{d}$ is $O(12^{\omega (d)})$.  For any choice of $a_1,a_2,a_3$ under consideration, there are $O(1)$ choices of primes $q_{ij}\in [X^{\theta _{ij}},X^{\theta_{ij}+\tau_{ij}}]$ with $q_{ij}|q_1(a_1,a_2,a_3)q_2(a_1,a_2,a_3)$. Thus, letting $b(a_2,a_3)=\ov{a_3} (a_2^2-c_3a_2a_3-c_2a_3^2)$, and noting $Z'<A_i^{0.99}$ (recall (<ref>)), we deduce

\begin{align*}
U_{21}(\cH)& \ll\sum_{Z<d\le Z'}\sum_{a_3\in [A_3,A_3(1+\eta_1)]}\sum_{\substack{a_2\in [A_2,A_2(1+\eta_1)]\\ Q(a_2,a_3)\equiv 0\Mod d}}\sum_{\substack{a_1\in [A_1,A_1(1+\eta_1)]\\ a_1\equiv  b(a_2,a_3)\Mod d}}1\\
&\ll A_1A_2A_3\eta_1^3\sum_{Z<d<Z'}\frac{12^{\omega (d)}}{d^2}\ll A_1A_2A_3\eta_1^3Z^{-3/4}.
\end{align*}

We now consider $U_{22}$. Since $Q(a_2,a_3)\equiv 0\Mod{d}$, if $Q(a_2,a_3)\ne 0$ there are $O(X^\epsilon)$ choices of $d$ given $a_2,a_3$.
We have $Q(a_2,a_3)=0$ if and only if $\exists (i,j)$ such that

\begin{equation*}
(a_2^2-c_3a_2a_3-c_2a_3^2)+(r_i+r_j)a_2a_3+a_3^2 (r_i^2+r_ir_j+r_j^2)=0,
\end{equation*}

which rearranges to

\begin{equation*}
a_2^2+ a_2a_3 (r_i+r_j-c_3)+a_3^2 (r_i^2+r_ir_j+r_j^2-c_2)=0.
\end{equation*}

Since $a_3\not =0$, $a_2/a_3$ is a root of $X^2+(r_i+r_j-c_3)X+r_i^2+r_ir_j+r_j^2-c_2$ and there are at most two such roots. Thus for each choice of $a_2$ there are at most 2 choices of $a_3$ such that $Q(a_2,a_3)=0$. Moreover, in this case we still have $d|q_3(a_1,a_2,a_3)\ne0$, so there are $O(X^\epsilon)$ choices of $d$ given $a_1,a_2,a_3$. We deduce that (using $Z'\ll A_1,A_3$)

\begin{align*}
U_{22} (\cH)&\ll \sum_{d>Z'}\mu^2 (d)\sum_{\substack{(a_1,a_2,a_3)\in\cH'\\ Q(a_2,a_3)\ne 0\\ a_1\equiv b(a_2,a_3)\Mod d}}1+\sum_{d>Z'}\sum_{\substack{(a_1,a_2,a_3)\in\cH'\\ Q(a_2,a_3)= 0 \\ d|q_3(a_1,a_2,a_3)}}\mu ^2 (d)\\
&\ll \sum_{a_2\in [A_2,A_2 (1+\eta_1)]}\sum_{\substack{a_3\in  [A_3,A_3(1+\eta_1)] \\ Q(a_2,a_3)\ne 0}}\sum_{\substack{d>Z'\\ d|Q(a_2,a_3)\\ \mu^2 (d)=1}}\sum_{\substack{a_1\in[A_1, A_1 (1+\eta_1)]\\ a_1\equiv b(a_2,a_3)\Mod d}}1\\
&\qquad +\sum_{a_1\ll A_1, a_2\ll A_2}\sum_{\substack{0<a_3\ll A_3\\ Q(a_2,a_3)=0}}\sum_{d|q_3(a_1,a_2,a_3)}1\\
&\ll \frac{A_1}{Z'}\sum_{\substack{a_2\in  [A_2,A_2(1+\eta_1)]\\ a_3\in  [A_3,A_3(1+\eta_1)]\\
Q(a_2,a_3)\not =0}}
\tau (Q(a_2,a_3))+A_1A_2X^\varepsilon\ll \frac{A_1A_2A_3X^\varepsilon}{Z'}.
\end{align*}

This gives the result.

[Removing the condition $(q,a_2a_3)=1$]
Let $S_{03}(\cH)$ be as given in Lemma <ref>. Then we have

\[
S_{03}(\cH)=S_{04}(\cH)+O\Bigl(\frac{\eta_1^3  A_1 A_2 A_3}{Z^{1/2}} \Bigr),
\]

\[
S_{04}(\cH):=\sum_{\substack{d\le Z\\ s_2s_3\le Z}}\mu  (d)\mu (s_2s_3)\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
\forall\,(i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,s_2a_2',s_3a_3')\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,s_2a_2',s_3a_3')}\\ {q_{21}|q_2(a_1,s_2a_2',s_3a_3')}\\
{[d,s_2s_3]|q(a_1,s_2a_2',s_3a_3')}\\ d|q_3(a_1,a_2,a_3)\\
{(s_2a_2',s_3a_3')=30,\ a_1\equiv 1\Mod {30}}\\
s_2a_2',s_3a_3'\equiv 30\Mod{900}}}h(q(a_1,s_2a_2',s_3a_3')).
\]

We remove the condition $(a_2a_3,q(a_1,a_2,a_3))=1$ via Mobius inversion, giving

\begin{equation*}
S_{03}(\cH )=\sum_{d\le Z}\mu (d)\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
(i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\
{(a_2,a_3)=30,\ a_1\equiv 1\Mod {30}}\\
{a_2,a_3\equiv 30\Mod{900}}\\
{d|q_3(a_1,a_2,a_3)}}}\sum_{\substack{{s|a_2a_3}\\ {[d,s]|q(a_1,a_2,a_3)}}}\mu (s)h(q(a_1,a_2,a_3)).
\end{equation*}

We write $s$ as $s=s_2s_3$ with $s_2|a_2$ and  $s_3|a_3$, and write $a_2=s_2a_2'$, $a_3=s_3a_3'$.
Let $U_3 (\cH)$ denote the contribution given by the $s>Z$  and $S_{04}(\cH)$
the remaining contribution with $s\le Z$. Thus we are left to bound $U_3(\cH)$.

Since each $q_i(a_1,s_2a_2',s_3a_3')$ has a finite number of prime factors in $[X^{\theta _{ij}},X^{\theta_{ij}+\tau_{ij}}]$, there are $O(1)$ choices of the $q_{ij}$, so

\begin{equation*}
U_3(\cH)\ll \sum_{d\le Z}\mu^2 (d)\sum_{Z<s_2s_3\ll N_\cH^{1/4}}\mu^2(s_2s_3)
\sum_{\substack{{(a_1,s_2a_2',s_3a_3')\in\cH'}\\ {[d,s]|q(a_1,a_2's_2,a_3's_3)}\\ {d|q_3(a_1,a_2's_2,a_3's_3)}}}1.
\end{equation*}

The form $q$ is monic of degree $6$ in $a_1$ (by (<ref>), (<ref>)) and $[d,s_2s_3]$ is squarefree, so given $s_2,s_3,a_2',a_3'$ there are $O(6^{\omega([d,s_2s_3])})$ choices of $a_1\Mod{[d,s_2s_3]}$ such that $q(a_1,a_2's_2,a_3's_3)=0\Mod{[d,s_2s_3]}$.
Since $(a_1,a_2's_2,a_3's_3)\in\cH'$ we obtain

\begin{equation*}\begin{split}
U_3 (\cH)&\ll \sum_{d<Z}\mu^2 (d)\sum_{Z<s_2s_3\ll N_\cH^{1/4}}\mu^2 (s_2s_3)6^{\omega ([s_2s_3,d])}\Big ( \frac{\eta_1A_2}{s_2}+1\Big )\Big (\frac{\eta_1A_3}{s_3}+1\Big )\Big (\frac{\eta_1A_1}{[s_2s_3,d]} +1\Big )\\
&\ll Z N_\cH^{1/4+\varepsilon}+Z N_\cH^{1/4+\varepsilon}(|A_1|+|A_2|+|A_3|)+
\frac{A_1A_2A_3\eta_1^2}{\min (A_1,A_2,A_3)}Z X^\varepsilon
\\
\eta_1^3 A_1 A_2 A_3\sum_{d<Z}\sum_{s>Z}\frac{6^{\omega([d,s])}}{s[s,d]}.
\end{split}
\end{equation*}

This final term is seen to be $O(\eta_1^3A_1A_2A_3(\log{Z})^{O(1)} /Z)$. Since $\max (A_1,A_2,A_3)\ll N_\cH^{1/4}$ and $Z=(\log{X})^{O(1)}$, this gives

\[
U_3(\cH)\ll \frac{\eta_1^3 A_1A_2A_3}{Z^{1/2}}+N_\cH^{1/2+\epsilon}.
\]

This gives the result.

[Simplifying the function $h$]
Let $S_{04}(\cH)$ be as in Lemma <ref>. Then we have

\[
S_{04}(\cH)=S_{05}(\cH)+O\Bigl(\frac{\eta_1^3 A_1A_2A_3}{Z}\Bigr),
\]

\[
S_{05}(\cH):=\sum_{\substack{u\le Z^{20}\\ d\le Z\\ s_2s_3\le Z}}\mu (d)\mu  (s_2s_3)\ell(u)\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
\forall\,(i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,s_2a_2',s_3a_3')\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,s_2a_2',s_3a_3')}\\ {q_{21}|q_2(a_1,s_2a_2',s_3a_3')}\\
{[d,s_2s_3,u]|q(a_1,s_2a_2',s_3a_3')}\\ d|q_3(a_1,a_2,a_3)\\
{(s_2a_2',s_3a_3')=30,\ a_1\equiv 1\Mod{30}}\\
s_2a_2',s_3a_3'\equiv {30}\Mod{900}}}1,
\]

and $\ell$ is the multiplicative function defined by

\begin{equation*}
\ell (p^\nu):=\begin{cases}
\frac{g(p)-2}{p-g(p)}, & \text{if}\ p>q_0\text{ and }\nu=1,\\
-1, & \text{if}\ 7\le p\le q_0\text{ and }\nu=1,\\
-h(p), & \text{if}\ \nu =2,\\
0, & \text{if}\ \nu\ge 3,
\end{cases}
\end{equation*}

with $q_0$ given by (<ref>).

Recalling (<ref>), we see that $h=\1 *\ell$ where $\ell$ is as given by the lemma. In particular,

\[
h(q(a_1,s_2a_2',s_3a_3'))= \sum_{u|q(a_1,s_2a_2',s_3a_3')}\ell (u).
\]

Since $a_1\equiv 1\Mod{30}$ and $30| (a_2,a_3)$, $(u,30)=1$.
We substitute this into our definition of $S_{04}(\cH)$, and consider separately the contribution $S_{05}(\cH)$ from $u<Z^{20}$ and the contribution $U_4(\cH)$ from $u>Z^{20}$.

Since $\ell (u)=0$ when there exists $p$ such that $p^3|u$, we may write $u=v^2w$ with $\mu^2 (vw)=1$. Since $U_4(\cH)$ has $u>Z^{20}$, it suffices to separately bound the contribution of terms $U_{41}(\cH)$ with $w>Z^{10}$ and the contribution $U_{42}(\cH)$ of terms with $v^2>Z^{10}\ge w$.

First we bound $U_{41}(\cH)$ with $w>Z^{10}$. Since $q_0>10$, we see that $|\ell (u)|\le 10^{\omega (vw)}/w$. Following an entirely analogous argument to our bound for $U_2(\cH)$ in Lemma <ref>, we can find that

\begin{equation*}\begin{split}
U_{41}(\cH) &\ll Z\sum_{\substack{s_2s_3<Z\\ \mu^2 (s_2s_3)=1}}
\sum_{\substack{w\ge Z^{10} \\ {wv^2 |q}}}\mu^2 (vw)
\frac{(60)^{\omega (v w)}}{w}
\Big (\frac{\eta_1 A_1}{wv^2}+1\Big )\frac{\eta_1^2 A_2A_3}{s_2s_3}\\
&\ll A_2A_3X^\varepsilon + \eta_1^3 A_1A_2A_3 (\log X)Z^{-3}\ll \frac{A_1A_2A_3}{Z}.
\end{split}
\end{equation*}

Thus we are left to bound $U_{42}(\cH)$ involving terms with $v\ge Z^5$. We see

\begin{equation*}
U_{42}(\cH)\le V'(\cH)+\sum_{(i,j)\in I_\cC}V_{ij}(\cH),
\end{equation*}

where $V_{ij}(\cH)$ denotes those terms with $q_{ij}|v$ for some $q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]$,  and $V'(\cH)$ denotes those terms with $(\prod_{(i,j)\in I_\cC} q_{ij},v)=1$ for all $q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]$,
$(i,j)\in I_\cC$.

First we consider $V_{21}(\cH)$. By (<ref>), we  have $\sum_{i=1}^6\theta_{1i}+\theta_{21}>1+\alpha_0$. We recall $q_1(a_1,a_2a_3)\ll X^{1+\alpha_0}$ for all $(a_1,a_2,a_3)\in\cH$ and that $\prod_{j=1}^6 q_{1j}|q_1(a_1,a_2,a_3)$ with $\prod_{j=1}^6 q_{1j}\gg X^{\sum_{j=1}^6 \theta_{1j}}$. Therefore we must have that $(q_{21},q_1(a_1,a_2,a_3))=1$.
Since $\alpha_0<1/19$ by (<ref>) and $q_{21}^2\le X^{2\theta_{21}+2\tau_{21}}\le X^{1/4-7\alpha_0/8}\le \min(A_1,A_2,A_3)$ by (<ref>) and
(<ref>), we deduce that

\begin{equation*}\begin{split}
V_{21}(\cH )&\ll X^\varepsilon \sum_{q_{21}\in [X^{\theta_{21}}, X^{\theta_{21}+\tau_{21}}]}
\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {q_{21}^2|q_2 (a_1,a_2,a_3)}}}1\\
& \ll X^{-\theta_{21}+\varepsilon}A_1A_2A_3.
\end{split}
\end{equation*}

We now consider $V_{1j}(\cH)$. As with $V_{21}(\cH)$, we can't have $q_{1j}^2|q_1(a_1,a_2,a_3)$ by size considerations and (<ref>). Therefore if $q_{1i}^2|q(a_1,a_2,a_3)$ then $q_{1i}| (q_1(a_1,a_2,a_3),q_2(a_1,a_2,a_3))$, and so Lemma <ref> shows that $P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod{q_{1i}}$. Again, we have that $q_{1j}\le \min(A_1,A_2,A_3)$. Thus we have

\begin{equation*}\begin{split}
V_{1i}(\cH)&\ll X^\varepsilon\sum_{q_{1i}\in [X^{\theta_{1i}}, X^{\theta_{1i}+\tau_{1i}}]}\sum_{\substack{{(a_2,a_3)\in [A_2,A_2(1+\eta_1)]\times [A_3,A_3(1+\eta_1)]}\\
{P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod{q_{1i}}}}}
\sum_{\substack{{a_1\in [A_1,A_1(1+\eta_1)]}\\ {q_{1i}| q_1(a_1,a_2,a_3)}}}1\\
&\ll X^{-\theta_{1i}+\varepsilon}A_1A_2A_3.
\end{split}
\end{equation*}

Finally, we are left to bound $V'(\cH)$.
Each $v$ counted in $V'(\cH)$ may factored as $v=v_1v_2v_3$, with

\begin{equation*}
v_1:=\prod_{\substack{{p|v}\\ {p^2|q_1(a_1,a_2,a_3)}}}p,
\qquad v_2:=\prod_{\substack{{p|v/v_1}\\ {p^2|q_2(a_1,a_2,a_3)}}}p,\qquad v_3:=\frac{v}{v_1v_2}.
\end{equation*}

Since $v$ was squarefree, we see that $v_1,v_2,v_3$ are pairwise coprime and squarefree.

By Lemma <ref> again, $P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod {v_3}$. In $V'(\cH)$, $v$ is coprime with all the $q_{ij}$, and so for any $a_1,a_2,a_3\in\cH$

\begin{align}
v_1^2v_3&\ll \frac{q_1(a_1,a_2,a_3)}{\prod_{j=1}^5 q_{1j}}\ll X^{1+\alpha_0-\sum_{j=1}^5\theta_{1j}}<\eta_1 A_2,\\
v_2^2v_3&\ll \frac{q_2(a_1,a_2,a_3)}{q_{21}}\ll X^{(1+\alpha_0)/2-\theta_{21}}.
\end{align}

Thus we have

\[
V'(\cH)\ll \sum_{\substack{{s,d<Z}\\ {\mu^2 (d)\mu^2(s)=1}}}\sum_{w<Z^{10} } \frac{10^{\omega (w)}}{w}\sum_{\substack{v_1 v_2 v_3>Z^5 \\ \mu^2(wv_1v_2v_3)=1}}
\sum_{\substack{{a_2
\in [A_2,A_2(1+\eta_1)]}\\ {a_3\in [A_3,A_3(1+\eta_1)]}\\
{P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod {v_3}}}}
\sum_{\substack{{a_1\in [A_1,A_1(1+\eta_1)]}\\ {v_1^2v_3|q_1(a_1,a_2,a_3)}\\
\]

Let $d_1\in\mathbb{Z}[a_2,a_3]$ denote the discriminant of $q_1$ (viewing $q_1$ as a polynomial in $a_1$), and $d_2\in\mathbb{Z}[a_2,a_3]$ denote the discriminant of $q_2$. By Lemma <ref>, we see that the inner sum restricts $a_1$ to one of $O(6^{\omega(v_1v_2v_3)})$ residue classes modulo $v_1^2v_2^2v_3/(v_1,d_1(a_2,a_3))(v_2,d_2(a_2,a_3))$. Thus

\begin{align}\label{suma1}
\sum_{\substack{{a_1\in [A_1,A_1(1+\eta_1)]} \\ {v_1^2v_3|q_1(a_1,a_2,a_3)}\\
{v_2^2v_3|q_2(a_1,a_2,a_3)} }}1    &\ll 6^{\omega (v_1v_2v_3)}
\Big ( \frac{\eta_1 A_1(v_1,d_1(a_2,a_3))(v_2,d_2(a_2,a_3))}{v_1^2v_2^2v_3}+1\Bigr).
\end{align}

Let $I_1=\{ (1,3), (1,4), (2,3), (2,4)\}$   be the set of the indexes  $(i,j)$ such that $(r_i,r_j)$ is involved in the factorisation of $q_1$.
We note that

\begin{align*} d_1 (a_2,a_3)&=\prod_{ \substack{(i,j),(k,l)\in I_1\\ (i,j)\not = (k,l)}}(a_2 (r_i+r_j-r_k-r_\ell)+ a_3(r_i^2+r_ir_j+r_j^2-r_k^2-r_\ell^2-r_kr_\ell))\\
d_2 (a_2,a_3)&=-(a_2(r_1+r_2-r_3-r_4)+a_3(r_1^2+r_1r_2+r_2^2-r_3^2-r_3r_4-r_4^2))^2.
\end{align*}

We remark that the coefficient in $a_2^{12}$ in $d_1$ is non zero because we can't have $r_i+r_j -r_k-r_l=0$ for two different $(i,j),(k,\ell ) \in I_1$.
The case $\{ i,j\}\cap \{ k,\ell\}\not =\emptyset$ is clear, the other case was  noticed in Remark (ii) after the proof of Lemma <ref>.

For $d_2$, it may be the case that $r_1+r_2-r_3-r_4=0$. However in this case we can't also have
$r_1^2+r_1r_2+r_2^2-r_3-r_3r_4-r_4^2=0$ since this would imply that $r_1+r_2=r_3+r_4$ and $r_1r_2=r_3r_4$ which is not possible when the roots of $P$ are distinct. Thus either the coefficient of $a_2$ in $d_2$ is non-zero or the coefficient of $a_3$ is non-zero.

To estimate the sum over $v_1,v_2,v_3,a_2,a_3$  of the terms with $d_1 (a_2,a_3),d_2 (a_2,a_3)$ in
(<ref>), we write $w_i  =(v_i , d_i (a_2,a_3))$ for $i=1,2$ and next forget the coprimality between $v_i/w_i$ and $d_i (a_2,a_3)/w_i$. This sum is thus bounded by

\[
\sum_{\substack{v_1v_2v_3\ge Z^5\\ v_1^2v_3\le X^{1+\alpha_0-\sum_{j=1}^6 \theta_{1j}}\\
v_2^2v_3\le X^{(1+\alpha_0)/2 -\theta_{21}}\\ \mu^2 (v_1v_2v_3)=1}}
\frac{6^{\omega (v_1v_2v_3)}}{v_1^2v_2^2v_3}\sum_{\substack{w_1|v_1\\ w_2|v_2}}w_1w_2\sum_{\substack{a_2\in [A_2,A_2 (1+\eta_1)]\\ a_3\in [A_3,A_3 (1+\eta _1)\\ d_1 (a_2,a_3)\equiv 0\Mod {w_1}\\ d_2 (a_2,a_3)\equiv 0\Mod {w_2}\\ P((a_2-c_3a_3)\ov{a_3})\equiv 0\Mod{v_3}}}1.
\]

If the coefficient in $a_2^2$ in $d_2 (a_2,a_3)$ is non zero, then the inner sum over $a_2$, $a_3$ is

$$\ll \eta_1 A_3 \Big (1+\frac{\eta_1A_2}{w_1w_2v_3}\Big )12^{\omega (w_1w_2v_3)},$$

otherwise the condition $w_2| d_2 (a_2,a_3)$ is equivalent to $w_2| d_P a_3$ for some $d_P\in\Z$ depending only of $P$ (we recall that $w_2$ is square free) and thus the inner sum over $a_2,a_3$ is bounded by

$$\ll  \Big ( 1+\frac{\eta_1 A_3}{w_2}\Big )\Big ( 1+\frac{\eta _1A_2}{w_1v_3}\Big )12^{\omega (v_1v_2v_3)}
\ll 12^{\omega (w_1w_2v_3)}\Big (1+\frac{\eta _1A_3}{w_2}+\frac{\eta_1 A_2}{w_1v_3}+\frac{\eta_1^2A_2A_3}{w_1w_2v_3}\Big ).$$

Finally we obtain that

\begin{align*}
V'(\cH)&\ll Z^2(\log Z)^{10}
\sum_{\substack{v_1v_2v_3\ge Z^5\\ v_1^2v_3\le X^{1+\alpha_0-\sum_{j=1}^6 \theta_{1j}}\\
v_2^2v_3\le X^{(1+\alpha_0)/2 -\theta_{21}}\\ \mu^2 (v_1v_2v_3)=1}}
6^{\omega (v_1v_2v_3)}\Big [ \eta_1^2 A_2A_3\\ &+\sum_{\substack{w_1|v_1\\ w_2|v_2}}\frac{12^{\omega (w_1w_2v_3)}\eta_1A_1w_1w_2}{v_1^2v_2^2v_3^2}\Big (
\eta_1 A_3+\frac{\eta_1A_2}{w_1v_3}+\frac{\eta_1^2A_2A_3}{w_1w_2v_3}\Big )\Big ]\\
& \ll Z^{-3}(\log Z)^{10}\eta_1^3 A_1A_2A_3+Z^3\frac{A_1A_2A_3}{\min (A_1,A_2,A_3)}X^{3(1+\alpha_0)/4-\sum_{(i,j)\in I_\cC}\theta_{ij}/2}.
\end{align*}

By (<ref>) and (<ref>) we see that $X^{3(1+\alpha_0)/4-\sum_{ij\in I_\cC}\theta_{ij}/2}\le \min (A_1,A_2,A_3)X^{-\epsilon}$. Putting everything together then gives the result.

[Removing $(a_2,a_3)/30=1$]
Let $S_{05}(\cH)$ be as given in Lemma <ref>. Then we have

\[
S_{05}(\cH)=S_{06}(\cH)+O\Bigl(\frac{\eta_1^3 A_1A_2A_3}{Z}\Bigr),
\]

\[
S_{06}(\cH):=\sum_{\substack{t\le Z^{50}\\ u\le Z^{20}\\ d\le Z\\ s_2s_3\le Z\\ (t,30)=1}}\mu (d)\mu (s_2s_3)\ell(u)\mu (t)\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
\forall\,(i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\
{[d,s_2s_3,u]|q(a_1,a_2,a_3)}\\ d|q_3(a_1,a_2,a_3)\\ [t,s_2]|a_2 \\ [t,s_3]|a_3 \\
a_2,a_3\equiv 30\Mod{900} \\ a_1\equiv 1\Mod{30}}}1.
\]

Since we have $a_2,a_3\equiv{30}\Mod{900}$, we can detect $(a_2,a_3)|30$ using Möbius inversion $\1_{(a_2,a_3)|30}=\sum_{\substack{t|(a_2,a_3)\\ {(t,30)=1}}}\mu (t)$ and separately consider the contribution $S_{06}(\cH)$ from terms with $t\le Z^{50}$ and the contribution $U_5(\cH)$ from terms with $t>Z^{50}$. Since there are $O(1)$ choices of the $q_{ij}$ given a choice of $a_1,a_2,a_3$, we see that

\begin{align*}
U_5(\cH)&\ll \sum_{t>Z^{50} }\sum_{\substack{u\le Z^{20}\\ d,s_2s_3\le Z}}\sum_{\substack{(a_1,a_2,a_3)\in \cH'\\ t|(a_2,a_3)}}O(1)\\
&\ll Z^{30}\sum_{Z^{50}<t<\min(A_2,A_3)}\eta_1 A_1 \Bigl(\frac{\eta_1 A_2}{t}+1\Bigr)\Bigl(\frac{\eta_1 A_3}{t}+1\Bigr)\ll \frac{\eta_1^3A_1A_2A_3}{Z}.
\end{align*}

This gives the result.

§.§ Application of Theorem <ref>

[Application of Theorem <ref>]
Let $S_{06}(\cH)$ be as in Lemma <ref>. Then we have

\[
S_{06}(\cH)\gg \eta_1^3 A_1A_2A_3.
\]

Recalling the definition of $S_{06}$ from Lemma <ref>, we remark that the different conditions modulo $30$  on $a_1,a_2,a_3$ imply that $(q(a_1,a_2,a_3),30)=1$ and thus we may impose that $(ds_2s_3tu,30)=1$.
Splitting $(a_1,a_2,a_3)$ into residue classes $\Mod{[t,u,d,s_2,s_3]}$, we see that

\begin{align}
S_{06}(\cH)&=\sum_{\substack{t\le Z^{50}\\ u\le Z^{20}\\ d\le Z\\ s_2s_3\le Z\\ (ds_2s_3tu,30)=1}}\mu (d)\mu (s_2s_3)\ell(u)\mu (t)\sum_{\u_0\in \cS(d,s_2,s_3,t,u)}S_{07}(\u_0,[d,s_2,s_3,t,u]),
\label{eq:S6}
\end{align}

\begin{align*}
S_{07}(\u_0,m)&:=\sum_{\substack{{q_{ij}\in [X^{\theta_{ij}},X^{\theta_{ij}+\tau_{ij}}]}\\
\forall\,(i,j)\in I_\cC\\ q_{21}\equiv 1\Mod{D_{q_2}}}}\sum_{\substack{{(a_1,a_2,a_3)\in\cH'}\\ {\prod_{j=1}^6q_{1j}|q_1(a_1,a_2,a_3)}\\ {q_{21}|q_2(a_1,a_2,a_3)}\\
{(a_1,a_2,a_3)\equiv \u_0\Mod{m}}\\
a_2,a_3\equiv 30\Mod{900},\ a_1\equiv 1\Mod{30} }}1,\\
\cS ( d,s_2,s_3,t,u)&:=\Bigl\{ (u_1,u_2,u_3)\Mod{[d,s_2s_3,t,u]}:\,[d,s_2s_3,u] | q (u_1,u_2,u_3),\\
&\qquad d|q_3(u_1,u_2,u_3),\, [s_2,t]|u_2,\,
\end{align*}

We now apply  Theorem <ref> on incomplete norms with $K=\Q (r_1+r_3)$, $\nu_1=1$, $\nu_2=r_1+r_3$, $\nu_3=r_1^2+r_3^2+r_1r_3$ and $\nu_4$ such that
$\nu_4$ is in the ring of integers of $K$ and $(\nu_1 , \nu_2,\nu_3 ,\nu_4)$ is a $\Q$-basis of $K$.
By Theorem <ref> (taking $X_i=A_i$, $\ell=5$, $\ell'=3$, $\theta_i=\theta_{1i}\frac{\log{X}}{\log{A_1}}$, $\theta_i'=(\theta_{1i}+\tau_{1i})\frac{\log{X}}{\log{A_1}}$, $\tau=\theta_{21}\frac{\log X}{\log A_1}$, $\tau'=(\theta_{21}+\tau_{21})\frac{\log X}{\log A_1}$), we have that

\[
S_{07}(\u_0,m)=(1+o(1))\frac{\eta_1^3 A_1A_2A_3}{30^5 m^3\varphi (D_{q_2})}\prod_{(i,j)\in I_\cC}\log\Bigl(1+\tau_{ij}/\theta_{ij}\Bigr).
\]

Here we have used the fact that (<ref>) and (<ref>) hold by (<ref>). Similarly (<ref>) holds by (<ref>), (<ref>) holds by (<ref>), (<ref>) holds by (<ref>), (<ref>) holds by (<ref>), (<ref>) holds by (<ref>) and (<ref>) holds by (<ref>) and (<ref>) and by noticing that
$\frac{4}{1+\alpha_0}\le \frac{\log X}{\log A_1}\le\frac{4}{1+\alpha_0/2}$. Substituting this into our expression (<ref>) for $S_{06}$, we find that

\begin{equation}
S_{06} (\cH) = (1+o(1))\frac{\eta_1^3}{30^5} \frac{A_1A_2A_3}{\varphi (D_{q_2})}\prod_{(i,j)\in I_\cC}\log\Bigl(1+\tau_{ij}/\theta_{ij}\Bigr)    \sum_{m\le Z^{72} }\frac{L(m)}{m^3},
\label{eq:S6Asymp}
\end{equation}

\begin{equation*}
L(m):=\sum_{\substack{ d\le Z \\ s_2s_3\le Z\\  u\le Z^{20}\\ (ds_2s_3tu,30)=1 \\ t<Z^{50}\\ [d,s_2s_3,t,u]=m }}\mu (d)\mu (s_2s_3)\mu (t)\ell (u)|\cS (d,s_2,s_3,t,u)|.
\end{equation*}

We wish to remove the upper bound constraints on $d,s_2,s_3,u,t,m$ so we can understand $\sum_{m}L(m)/m^3$ via an Euler product. Let

\begin{align*}
L^*(m)&:=\sum_{\substack{[d,s,t,u]=m\\ (ds_2s_3tu,30)=1}}|\mu (d)\mu(s)\mu (t)\ell (u)|\sum_{s_2s_3=s}|\cS (d,s_2,s_3,t,u)|,\\
\tilde L (m)& := \sum_{\substack{[d,s,t,u]=m\\ (ds_2s_3tu,30)=1}}\mu (d)\mu (s)\mu (t)\ell (u)\sum_{s_2s_3=s}|\cS (d,s_2,s_3,t,u)|,
\end{align*}

which are multiplicative functions of $m$. We note that $L^*(m)\ge \max(|L(m)|,|\tilde{L}(m)|)$ for all $m$ and that $\tilde{L}(m)=L(m)$ for $m\le Z$. From the support of $\mu,\ell$ we have $L^*(p^k)=0$ for $k\ge 3$. We easily check that $L^* (p)\le 2^5 p$  and $L^* (p^2)\le 3p^2$ for $p>q_0$ since $|\ell (p)|\le 2/(p-2)$ in this range. We deduce that $L^*(m)/m^3\ll \tau(m)^5/m^2$.
We note that $\tilde L (p^k)=0$ for $k\ge 2$ and $2\le p\le q_0$, and
that $\tilde L (p^k)=0$ for any $k\ge 1$ when $p=2,3,5$.
We find

\begin{align*}
\sum_{m\le Z^{72} }\frac{L(m)}{m^3}&=\sum_{m\le Z}\frac{\tilde{L}(m)}{m^3}+O\Bigl(\sum_{m>Z}\frac{L^*(m)}{m^3}\Bigr)\\
&=\prod_{7\le p\le q_0}\Big (1+\frac{\tilde{L}(p)}{p^3}\Big )\prod_{p>q_0}\Bigl(1+\frac{\tilde{L}(p)}{p^3}\Bigr)+O\Bigl(\frac{1}{Z^{1/2}}\Bigr).
\end{align*}

From our bounds on $L^*$ we see that $\prod_{p>q_0}(1+\tilde{L}(p)/p^3)\gg 1$ and the product over $p\le q_0$ converges. We wish to show that the product converges to a strictly positive constant, and so need to check that $1+\tilde{L} (p)/p^3$ doesn't vanish for some small prime $p$ with $7\le p\le q_0$.
If $p|[d,s_2,s_3]$ then for  $u=1$ or $p$, we have

$$|\cS (d,s_2,s_3,u,1)|=|\cS (d,s_2,s_3,u,p)|.$$

Since $\ell(p)+\ell (1)=0$ when $7\le p\le q_0$,
we deduce

\[
\sum_{[d,s_2,s_3]=p}\sum_{[d,s_2,s_3,t,u]=p}
\mu (d)\mu (s_2s_3)\mu (t)\ell (u)
|\cS (d,s_1,s_2,t,u)|=0.
\]

The value $\tilde L (p)$ is then

$$\tilde L (p)=1-p-|\{ (u_1,u_2,u_3)\Mod p : p|q(u_1,u_2,u_3)\}|.$$

$$1+\tilde L(p)/p^3\ge (p^3-6p^2-p+1)/p^3 >0,$$

when $p\ge 7$.
Thus $\sum_{m\le Z^{72}}L(m)/m^3\gg 1$, and so substituting this into (<ref>) and using the fact $\tau_{ij}/\theta_{ij}\gg 1$ we obtain the result.

§.§ Proof of Proposition <ref>

By Lemmas <ref>, <ref>, <ref>, <ref>, <ref>, <ref> and <ref> in turn, we see that

\[
S_0\gg \frac{1}{\log{X}}\sum_{\cH\in\sH_\cR}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}+O\Bigl(\frac{1}{Z^{1/2}}\Bigr).
\]

(Note that in this application  Lemma <ref> we are assuming Theorem <ref>, and that we have $12\theta_0+22\alpha_0<1$ required for Lemma <ref> since we are taking $\theta_0$ sufficiently small and assuming that $\alpha_0$ satisfies (<ref>).) We note that

\[
\sum_{\cH\in\sH_\cR}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}=\sum_{\cH\subset\cR}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}-\sum_{\substack{\cH\subset \cR\\ \cH \text{ bad} }}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}.
\]

If $\cH$ is bad, then $\max(A_1,A_2,A_3)^4\eta_1^{1/10}\ge  q_1(A_1,A_2,A_3)$ or there exists $i\in\{ 0,1,2,3\}$
such that $|A_i|<\eta_1\max (|A_0|,|A_1|,|A_2|, |A_3|)$. The first inequality implies that there exists $(i,j)\in I_\cC$
such that

\[ L_{i,j}(A_1,A_2,A_3):=|A_1+(r_i+r_j)A_2+(r_i^2+r_ir_j+r_j^2)A_3|\ll \eta_1^{1/40}\max (A_1,A_2,A_3).
\]

Thus, by partial summation

\begin{align*}
\sum_{\substack{\cH\subset \cR\\ \cH \text{ bad} }}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}&\ll
\sum_{(i,j)\in I_\cC}\sum_{\substack{A=2^\ell \\ X^{1-\frac{7\alpha_0}{8}}\ll A\ll X^{\frac{1+\alpha_0}{4}} }} \sum_{\substack{(a_0,a_1,a_2,a_3)\in \cR\\ L_{i,j}(a_1,a_2,a_3 )\le \eta_1^{1/40}A \\\max(a_0,a_1,a_2,a_3)\ll A}}\frac{1}{A^4}\\
&+ \sum_{i=0}^3\sum_{\substack{A=2^\ell \\ X^{1-\frac{7\alpha_0}{8}}\ll A\ll X^{\frac{1+\alpha_0}{4}} }}
\sum_{\substack{(a_0,a_1,a_2,a_3)\in \cR\\ a_i\le \eta_1 A \\\max(a_0,a_1,a_2,a_3)\ll A}}\frac{1}{A^4}\\
&\ll \eta_1^{1/40}\log{X}.
\end{align*}

Similarly, we find by partial summation

\begin{align*}
\sum_{\substack{\cH\subset \cR }}\frac{A_0A_1A_2A_3 \eta_1^4}{\widetilde{N}_P(A_0,A_1,A_2,A_3)}&=(1+o(1)) \sum_{\substack{(a_0,a_1,a_2,a_3)\in \cR}}\frac{1}{\widetilde{N}_P(a_0,a_1,a_2,a_3)}\\
&\gg \log{X}.
\end{align*}

Putting everything together now gives Proposition <ref>.

Thus we are left to establish Theorem <ref>.

§ INCOMPLETE NORM FORMS

In this section we perform our initial reductions to reduce the proof of Theorem <ref> to that of establishing Proposition <ref> and Proposition <ref>. We roughly follow the argument of [14] in this section, but require a number of small technical modifications.

Let  $K$ be a quartic number field, $\cO_K$ its integer ring, $Cl_K$ its class group. Let $\nu_1,\nu_2,\nu_3,\nu_4 \in \cO_K$  such that $\v=(\nu_1,\nu_2,\nu_3,\nu_4)$ is a $\Q$-basis of $K$. We suppose for convenience that $\nu_1=1$ and $K=\Q (\nu_2)$. We then define $\cO_\v =\Z [ \nu_1,\nu_2,\nu_3,\nu_4]$ the order generated by $\v$.

We let $N(·)=N_K(·)$ be the norm on $K$, and note that this is a different norm to $N_P$ on $(r_1)$ encountered earlier.

There exists an integral basis of $_K$, $=(ω_1 ,ω_2,ω_3 ,ω_4)$ and some integers
$w_ij$,  $1≤i≤j≤4$, such that
\begin{equation}
\label{basew}
\nu_j=\sum_{i=1}^j w_{ij}\omega_i\quad (j=1,2,3,4).
\end{equation}
(cf. for example \cite[Proposition 2.11]{Nark}).

\subsection{From $\cO_K$ to  $\cO_\v$ and vice-versa}

We denote by $L_{\w \v}=(w _{ij})_{1\le i,j\le 4}$ the matrix of $\v$ in $\w$ so that
for all $1\le j\le 4$,
$\nu_j=\sum_{i=1}^4w _{ij}\omega_i$.

By \eqref{basew} this matrix is upper triangular and  the absolute value of its  determinant is
\begin{equation}
\label{W}
\end{equation}
\begin{lmm}\label {coordinates}
For all  $\alpha \in \cO_K$, there exist $a_1,a_2,a_3,a_4\in\Z$,
\begin{equation*}
\alpha =\frac{1}{W}\sum_{i=1}^4a_i\nu_i
\end{equation*}
Conversely, there exists a subset $\cV_0\subset \{ 0,\ldots , W-1\}^4$ such that for all $\a\in\Z^4$ we have
\begin{equation*}
\frac{1}{W}\sum_{i=1}^4a_i\nu_i\in \cO_K\Leftrightarrow \exists \u\in \cV_0 : \a\equiv\u \Mod W.
\end{equation*}
\end{lmm}
\begin{proof}
Let $\alpha\in\cO_K$. There exist $(a_1,a_2,a_3,a_4)\in\Z^4$
and $(a'_1,a_2',a_3',a_4')\in\Q^4$
such that  $\alpha =\sum_{i=1}^4a_i\omega_i=\sum_{i=1}^4a'_i\nu_i$.
With our previous notation,
\begin{equation*}
\begin{pmatrix} a'_1 \\ a'_2\\ a'_3\\ a'_4\\
\end{pmatrix}
\begin{pmatrix} a_1 \\ a_2\\ a_3\\ a_4\\
\end{pmatrix}.
\end{equation*}
The matrix $(L_{\w\v})^{-1}$ is of type $\frac{1}{W} (w '_{ij})_{1\le i,j\le 4}$
where the coefficients $w '_{ij}$ are integers.
This implies the first part of the lemma.

The second part of the lemma is also a direct consequence of the change of basis formula.
With our previous notation we have
\begin{equation*}
\sum_{j=1}^4a_j\nu_j=\sum_{i=1}^4\Big (\sum_{j=1}^4w_{ij}a_j\Big )\omega_i.
\end{equation*}
Then for any $\a=(a_1,a_2,a_3,a_4)\in\Z^4$, $\frac{1}{W}\sum_{i=1}^4a_i\nu_i\in\cO_K$ if and only if
for all $1\le i\le 4$, we have
\begin{equation*}
\sum_{j=1}^4w _{ij}a_j\equiv 0\Mod W.
\end{equation*}
The set $\cV_0$ is the the subset of $\{ 0,\ldots ,W-1\}^4$ formed by all the solutions of these congruences.
\end{proof}
\begin{lmm}\label{Wsg}
Let $\ga$ be a principal ideal. Then there is a generator $\alpha$ of $\ga$ such that
\begin{equation*}
|\alpha^\sigma |\ll N(\ga )^{1/4}
\end{equation*}
for all embeddings $\sigma : K \hookrightarrow \C$. Furthermore there exists $V>0$ depending only on $\v$ such that
\begin{equation*}
\alpha =\frac{1}{W}\sum_{i=1}^4a_i\nu_i
\end{equation*}
for some integers $a_i\ll N(\ga )^{1/4}$.
\end{lmm}
\begin{proof}
The first part is a particular case of \cite[Lemma 4.3]{May15b}.
The last part follows also from this lemma combined with  Lemma \ref{coordinates}.
\end{proof}

\medskip

\begin{lmm}\label{Ovq}
Let $\cC$ be an hypercube of side length $\delta_0 B$ which contains a point $\bb_0\in\Z^4$ such that $\| \bb_0\| \ll B$.
We suppose that  $\gb_0 =(W^{-1}\sum_{i=1}^4 (\bb_0 )_i\nu_i)$ is an integral ideal  whose norm satisfies
$N(\gb_0)=B_0^4\gg B^4$. Let  $q$ such that $W|q$ and $10qW\le \delta_0B$.

Then there exists  a set  $\cW(\b_0)$ of  $W^4$  elements $\beta_0'\in\cO_K$
with $\beta_0'=W^{-1}\sum_{i=1}^4 (\bb _0')_i\nu_i$  and with $\bb_0'\in\cC$,
such that  for all $\bb\in\cC$,
$\bb\equiv\bb_0\Mod q$ if and only if $\beta =\frac{1}{V}\sum_{i=1}^4 b_i\nu_i\in\cO_K$ and there exists $\beta_0'\in\cW(\b_0)$ with
$\beta\equiv\beta_0'\Mod q$.
\end{lmm}
\begin{proof}
This is  variant of an argument used in the proof of \cite[Lemma 9.4]{May15b}.

Let $\beta_0 :=\frac{1}{W}\sum_{i=1}^4 (\b_0)_i\nu_i$.
For all $\v=(v_1,\ldots ,v_4)\in\{ 0,\ldots ,W-1\}^4$, there exists $\u =\u (\b_0 , \v)\in\Z^4$
such that $\b_0+q(\v +W\u)\in\cC$ since $qW\le \delta_0 B$, the side length of $\cC$. We will prove that the set
\[
\cW:=\Big\{ \beta_0'=\frac{1}{W}\sum_{i=1}^4 b_i'\nu_i \ \text{with}\ \b'= \b_0+q(\v +W\u (\b_0,\v)), \v\in
\{ 0,\ldots ,W-1\}^4\Big\}
\]
satisfies the conclusion of the lemma.

First we suppose that $\bb \equiv \bb_0\Mod q$. This implies that there exist four integers $m_1,m_2,m_3,m_4$
such that $b_i=(\b_0)_i+qm_i$.
We get
$$\beta :=\frac{1}{W}\sum_{i=1}^4\b_i\nu_i=\frac{1}{W}\sum_{i=1}^4 ((\bb_0)_i +m_iq)\nu_i=\beta_0+\frac{q}{W}\sum_{i=1}^4m_i\nu_i.$$
Since $W|q$, this implies that $\beta\in\cO_K$.
If we choose $\beta_0'=\beta_0+\frac{q}{W}\sum_{i=1}^4 v_i\nu_i+$
with $0\le v_1,\ldots ,v_4<W$ such that $v_i\equiv m_i\Mod W$ then we would have
$\beta =\beta_0' +\frac{q}{W}\sum_{i=1}^4 ( m_i-v_i+Wu_i)\nu_i$, and thus $\beta\equiv \beta_0'\Mod q$.

Now we prove the reciprocal assertion.  We suppose that there exists $\beta'_0\in\cW$  such that $\beta\equiv \beta'_0\Mod q$. Then
$\beta=\beta_0' +q\gamma$ for some $\gamma\in\cO_K$. There exists
$g_1,g_2,g_3,g_4\in\Z$ such that $\gamma=\frac{1}{W}\sum_{i=1}^4 g_i\nu_i$.
For each $i=1,2,3,4$, we have
$\frac{b_i}{W}=\frac{(\b_0)_i +q(v_i+Wu_i+g_i)}{W}.$ This implies that $\bb\equiv \bb_0 \Mod q$.
\end{proof}

\medskip
For any ideal $\gd$ of $\cO_K$, we define the function $\varrho_\v$ by
\begin{equation}
\varrho_\v (\gd):=\frac{|\{\a\in [1,N(\gd )^3] : \gd | (a_1\nu_1+a_2\nu_2+a_3\nu_3)\}|}{N(\gd)^2}.\label{eq:RhoVDef}
\end{equation}

This function  satisfies the following properties.
\begin{lmm}\label{rhov}
\begin{enumerate}
\item For all degree one prime ideals $\gp$ with $(N(\gp), W)=1$, we have
$\varrho_\v (\gp)=1$.
\item We have
\begin{equation*}
\Big|\Big\{ \x\in [1,p^2]^3 : p^2| N\Big ( \sum_{i=1}^3 x_i\nu_i\Big )\Big\}\Big | \ll p^4.
\end{equation*}
\item For any ideal $\goe$ such that $N(\goe )$  is a power of $p$, we have
\begin{equation*}
\frac{\varrho_\v (\goe)}{N(\goe)}\ll  \frac{1}{p^2}
\end{equation*}
unless $\goe$ is a degree $1$ prime ideal above $p$.
\item For any ideals $\ga ,\gb$, $\varrho_\v (\ga \gb)=\varrho_\v (\ga)\varrho_\v (\gb)$ if $(N(\ga ),N(\gb))=1$.
\item For $k\ge 3$, we have
\begin{equation*}