\documentclass[12pt]{amsart} \usepackage{amsmath,amssymb,amsthm} \usepackage[a4paper,margin=1.1in]{geometry} \usepackage{enumitem} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{microtype} \usepackage{hyperref} \usepackage{xcolor} \hypersetup{colorlinks=true,linkcolor=teal,citecolor=blue,urlcolor=teal} \numberwithin{equation}{section} \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\NN}{\mathbb{N}} \newcommand{\PP}{\mathbb{P}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bk}{\mathbf{k}} \newcommand{\bl}{\mathbf{l}} \newcommand{\bm}{\mathbf{m}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bnu}{\boldsymbol{\nu}} \newcommand{\bmu}{\boldsymbol{\mu}} \newcommand{\bell}{\boldsymbol{\ell}} \newcommand{\bgam}{\boldsymbol{\gamma}} \newcommand{\bth}{\boldsymbol{\theta}} \newcommand{\cN}{\mathcal{N}} \newcommand{\cH}{\mathcal{H}} \newcommand{\cA}{\mathcal{A}} \newcommand{\bh}{\mathbf{h}} \newcommand{\CC}{\mathbb{C}} \newcommand{\cM}{\mathcal{M}} \newcommand{\cR}{\mathcal{R}} \newcommand{\cE}{\mathcal{E}} \newcommand{\cU}{\mathcal{U}} \newcommand{\cQ}{\mathcal{Q}} \newcommand{\cC}{\mathcal{C}} \newcommand{\fS}{\mathfrak{S}} \newcommand{\fJ}{\mathfrak{J}} \newcommand{\fM}{\mathfrak{M}} \newcommand{\fF}{\mathfrak{F}} \newcommand{\sumstar}{\sideset{}{^*}\sum} \newcommand{\one}{\mathbf{1}} \newcommand{\Qt}{\widetilde{Q}} \newcommand{\cf}{\operatorname{cf}} \newcommand{\meas}{\operatorname{meas}} \newcommand{\supp}{\operatorname{supp}} \newcommand{\rank}{\operatorname{rank}} \newcommand{\eps}{\varepsilon} \setlength{\emergencystretch}{2.5em} \begin{document} \title[Intersections of cubic and quadric hypersurfaces in $28$ variables]{Rational points on intersections of cubic and quadric hypersurfaces in $28$ variables} \author{Esrafil Ali Molla} \address{Department of Mathematics, Indian Institute of Technology Bombay, Mumbai 400076, India} \email{esrafil.math@gmail.com} \date{\today} \subjclass[2020]{11D72 (11P55, 11G35, 14G05)} \keywords{Hasse principle, weak approximation, circle method, delta symbol, Kloosterman refinement, cubic forms, quadratic forms} \begin{abstract} Let $X\subset\mathbb{P}^{n-1}$ be a non-singular complete intersection of a cubic and a quadric hypersurface defined over $\mathbb{Q}$. Browning, Dietmann and Heath-Brown established that $X$ satisfies the Hasse principle when $n\geq 29$. In this article we improve this result to $n\geq 28$. More precisely, we establish an asymptotic formula for a smoothly weighted count of the integral points on $X$ in an expanding box, and we deduce that $X$ satisfies weak approximation. \end{abstract} \maketitle \setcounter{tocdepth}{1} \tableofcontents \section{Introduction} Let $C,Q\in\QQ[x_1,\dots,x_n]$ be a cubic form and a quadratic form whose common zero locus is a complete intersection $X\subset\PP^{n-1}$. This paper is concerned with the Hasse principle for $X$. Thus we would like to show that $X(\QQ)$ is non-empty as soon as $X$ has points over $\RR$ and over $\QQ_p$ for every prime $p$, under the mildest possible assumption on the number of variables $n$. For complete intersections cut out by forms of the same degree, a classical theorem of Birch~\cite{Bir} establishes the Hasse principle when the number of variables is sufficiently large in terms of the degree, the number of forms and the dimension of a certain singular locus. {In Birch's theorem the number of variables has to grow quadratically with the number of forms. For systems of quadratic forms and of cubic forms that define a smooth complete intersection, Rydin Myerson~\cite{RM18,RM19} has shown that linear growth suffices, and in~\cite{RM17} he obtains a result of the same kind for generic systems of forms of higher degree.} Birch's method does not adapt easily to forms of differing degrees, because the process of differencing loses all trace of the forms of lower degree. For a cubic form and a quadratic form that are both diagonal, work of Wooley~\cite{Woo91,Woo98} handles $n\geqslant13$, under mild conditions on the coefficients. For general forms the first results are due to Browning, Dietmann and Heath-Brown~\cite{BDHB}. Among other things they proved that if $X$ is non-singular and $n\geqslant29$, then $X(\QQ)\neq\emptyset$ if and only if $X(\RR)\neq\emptyset$; in this range $X$ has points over $\QQ_p$ for every $p$. Their proof is based on a version of the Hardy--Littlewood circle method in two variables. {Browning and Heath-Brown~\cite{BHB} later extended Birch's method to systems of forms of differing degrees. For a non-singular intersection of a cubic and a quadric, their work gives an asymptotic formula with a power saving when $n\geqslant37$ \cite[Corollary~1.8]{BHB}, and hence the Hasse principle and weak approximation in this range.} Over the function field $\mathbb{F}_q(t)$ with $\operatorname{char}(\mathbb{F}_q)>3$, Glas~\cite{Gla} has obtained an asymptotic formula and weak approximation for $n\geqslant26$, by means of a two-dimensional version of the $\delta$-method. Over $\QQ$ a two-dimensional $\delta$-symbol has recently been developed by Li, Rydin Myerson and Vishe~\cite{LRV}, who applied it to pairs of quadratic forms. A different approach to systems of two equations was introduced by Munshi~\cite{Mun15}, who established an asymptotic formula for the number of integral points of bounded height on non-singular intersections of two quadrics in at least $11$ variables. (For non-singular intersections of two quadrics the Hasse principle had been established by Colliot-Th\'el\`ene, Sansuc and Swinnerton-Dyer~\cite{CTSSD} in at least $9$ variables, by algebraic methods.) In his \emph{nested $\delta$-method} the first equation is detected by the $\delta$-symbol of Duke, Friedlander and Iwaniec~\cite{DFI} and of Heath-Brown~\cite{HB96} with a modulus $q_1$; the second equation is then split into a congruence modulo $q_1$ and an equation of smaller size, and the latter is detected by a second $\delta$-symbol with a correspondingly smaller modulus $q_2$. In~\cite[\S1, p.~1192]{Mun15} it is remarked that for the intersection of a quadric and a cubic this method should yield an asymptotic formula as soon as $n\geqslant28$. We are not aware of a published proof. The purpose of this paper is to provide one, by a variant of the nested $\delta$-method. \begin{theorem}\label{thm:HP} Let $n\geqslant28$ and let $X\subset\PP^{n-1}$ be a non-singular complete intersection of a cubic hypersurface and a quadric hypersurface, both defined over $\QQ$. Then $X(\QQ)\neq\emptyset$ if and only if $X(\RR)\neq\emptyset$. \end{theorem} For $n\geqslant29$ this is contained in~\cite[Theorem~1.3]{BDHB}, so that the new case is $n=28$. The quadric hypersurface containing $X$ is unique, and if $X$ is non-singular then the corresponding quadratic form has rank $n$ or $n-1$, by~\cite[Corollary~3.2]{BDHB}. Both cases are covered by Theorem~\ref{thm:HP}. They require different arguments at one point of the proof, as we explain below. No conditions at the finite primes appear in Theorem~\ref{thm:HP}, because $X(\QQ_p)\neq\emptyset$ for every prime $p$ in this range (see Lemmas~\ref{lem:local} and~\ref{lem:localsing}). For an arbitrary intersection of a cubic and a quadric in $n>13$ variables, Zahid~\cite{Zah} has shown that $X(\QQ_p)\neq\emptyset$ for every prime $p>293$. Theorem~\ref{thm:HP} is a consequence of an asymptotic formula. By~\cite[Corollary~3.2]{BDHB}, after a linear change of variables over $\QQ$, a variety $X$ as in Theorem~\ref{thm:HP} is given by $C=Q=0$, where \begin{equation}\label{eq:normal} \begin{gathered} C\in\ZZ[x_1,\dots,x_n]\ \text{is a non-singular cubic form},\\ Q(\bx)=\sum_{i=1}^nd_ix_i^2,\qquad d_i\in\ZZ,\quad d_1\cdots d_{n-1}\neq0. \end{gathered} \end{equation} Thus $Q$ has rank $n$ if $d_n\neq0$, and rank $n-1$ if $d_n=0$. For a weight function $w$ on $\RR^n$ and $P\geqslant1$ let \[ N_w(P)=\sum_{\substack{\bx\in\ZZ^n\\ C(\bx)=Q(\bx)=0}}w(\bx/P). \] \begin{theorem}\label{thm:asymp} Let $n\geqslant28$, let $C$ and $Q$ be as in~\eqref{eq:normal}, and suppose that $X:C=Q=0$ is non-singular and $X(\RR)\neq\emptyset$. Let $w$ be the weight function constructed in \S\ref{ss:weight}. Then for every $\eps>0$ \[ N_w(P)=\fS\,\fJ\,P^{n-5}+O_\eps\bigl(P^{n-5-1/43+\eps}\bigr), \] where $\fS$ and $\fJ$ are the singular series and the singular integral defined in \S\ref{sec:major}. Both are positive. \end{theorem} The exponent $1/43$ is dictated by the case $n=28$. For larger $n$ it could be improved, but we have not pursued this. The method also yields weak approximation. Recall that $X$ is said to satisfy weak approximation if the image of $X(\QQ)$ under the diagonal embedding is dense in $X(\RR)\times\prod_pX(\QQ_p)$, where the product is over all primes and carries the product topology. \begin{theorem}\label{thm:WA} Let $n\geqslant28$ and let $X$ be as in Theorem~\ref{thm:HP}. Then $X$ satisfies weak approximation. \end{theorem} Since $X$ is non-singular, $X(\RR)$ is Zariski dense in $X$ as soon as it is non-empty, by~\cite[Lemme~3.1.2]{CTCS}. Theorem~\ref{thm:WA} therefore implies that $X(\QQ)$ is Zariski dense in $X$ whenever $X(\RR)\neq\emptyset$. Over $\mathbb{F}_q(t)$ the corresponding statement for $n\geqslant26$ is due to Glas~\cite{Gla}. Over $\QQ$ it is remarked in~\cite{BDHB} that the arguments given there may be developed to establish weak approximation; the details are left to the reader{. For $n\geqslant37$ weak approximation follows from~\cite[Corollary~1.8]{BHB}.} Theorem~\ref{thm:WA} is deduced from a version of Theorem~\ref{thm:asymp} in which $\bx$ is restricted to a residue class $\bx\equiv\bb\pmod H$ (Theorem~\ref{thm:cong}). We detect the congruence condition by additive characters. This leads to the sums $S(\alpha,\beta)$ with an additional factor $e(\bth\cdot\bx)$, where $\bth\in H^{-1}\ZZ^n$. In the argument outlined below, the only effect of this factor is that the dual variable $\bm$ is replaced by $\bm-q_1q_2\bth$ in the oscillatory integrals. The complete exponential sums are the same as before. The necessary changes are described in \S\ref{sec:WA}. \subsection*{Outline of the proof} We write $S(\alpha,\beta)=\sum_{\bx}w(\bx/P)e(\alpha C(\bx)+\beta Q(\bx))$, so that $N_w(P)$ is the integral of $S(\alpha,\beta)$ over the unit square. The argument of~\cite{BDHB} combines a Weyl bound, which depends only on a rational approximation to $\alpha$, with a bound obtained from Poisson summation to a modulus that is a common denominator for $\alpha$ and $\beta$. Neither bound exploits cancellation in the sums over the numerators. Our starting point is different. Heath-Brown's $\delta$-symbol~\cite{HB96}, applied to the equation $C(\bx)=0$ with level $P^{3/2}$, gives the exact formula \begin{equation}\label{eq:introid} N_w(P)=\frac{c}{P^3}\sum_{q_1\ll P^{3/2}}\ \sumstar_{a_1\bmod q_1}\int_{\RR}p_{r_1}(t)\,\cH\Bigl(\frac{a_1}{q_1}+\frac{t}{P^3}\Bigr)dt,\qquad\cH(\alpha)=\int_0^1S(\alpha,\beta)\,d\beta, \end{equation} in which $c=1+O(P^{-N})$, $r_1=q_1P^{-3/2}$, and $p_{r_1}(t)$ is bounded and is negligible unless $|t|\leqslant P^{3/2+\eps}/q_1$ (Lemma~\ref{lem:identity}). Put $\Theta=1+|t|$. We divide the pairs $(q_1,t)$ into three regions. The pairs with $q_1$ and $\Theta$ at most a small power of $P$ form the major arcs for the cubic. They are treated classically, and produce the main term (\S\ref{sec:major}). If $q_1^{n/8-2}\Theta^{n/8-1}\geqslant P^{2+\eta_0}$, where $\eta_0>0$ is a small parameter, we bound $\cH(\alpha)$ by the supremum of $|S(\alpha,\beta)|$ over $\beta$, and use the Weyl bound $S(\alpha,\beta)\ll P^{n+\eps}(q_1\Theta)^{-n/8}$, which holds uniformly in $\beta$. We give a complete proof of it in \S\ref{sec:dissection}, by Davenport's form of Weyl differencing, as in~\cite[Lemma~4.1]{BDHB}. This \emph{Weyl region} contributes $O(P^{n-5-\eta_0+\eps})$ (\S\ref{sec:dissection}). In the remaining region we detect the equation $Q(\bx)=0$ in the manner of Munshi. We write it as the congruence $q_1\mid Q(\bx)$ together with the equation $Q(\bx)/q_1=0$, and apply the $\delta$-symbol to the latter, with the level \[ R=\frac{P}{(q_1\Theta)^{1/2}}. \] This level depends on $t$ as well as on $q_1$. The reason is that we may insert a factor $B(\Theta Q(\bx/P))$, with a smooth function $B$ such that $B(0)=1$, at no cost: it oscillates no faster than the factor $e(tC(\bx/P))$ which is already present. After this the integer $Q(\bx)/q_1$ has size $R^2$. The sum over $\bx$ now has the modulus $q_1q_2$, where $q_2\ll R$ is the modulus of the second $\delta$-symbol, and we apply Poisson summation. The result is an expression of the shape \[ \sumstar_{a_1\bmod q_1}\cH\Bigl(\frac{a_1}{q_1}+\frac t{P^3}\Bigr)\approx\frac{P^n}{R^2}\sum_{q_2\ll R}\frac1{(q_1q_2)^n}\sum_{\bm\in\ZZ^n}S_{q_1,q_2}(\bm)\,I_{q_1,q_2}(t;\bm) \] (Lemma~\ref{lem:nested}), in which $S_{q_1,q_2}(\bm)$ is a complete exponential sum modulo $q_1q_2$ and $I_{q_1,q_2}(t;\bm)$ is an oscillatory integral. Outside the Weyl region the conductor $P(q_1\Theta)^{1/2}$ of this sum is at most $P^{5/3+\eta_0}$. The sum $S_{q_1,q_2}(\bm)$ runs over $a_1$ modulo $q_1$, over the numerator $a_2$ of the second $\delta$-symbol modulo $q_2$, and over $\bk$ modulo $q_1q_2$ with $q_1\mid Q(\bk)$. For the sum over $\bk$ we use the estimates of~\cite[\S6]{BDHB} for complete sums, which rest on Deligne's theorem and give square-root cancellation except for moduli with a large cube-full part. The sum over $a_1$ is estimated trivially. The sum over $a_2$, on the other hand, can be evaluated: for the primes $p\mid q_2$ that do not divide $q_1$ the sum over $\bk$ is a product of quadratic Gauss sums, and what remains of the sum over $a_2$ is a Ramanujan sum if $n$ is even, as in the critical case $n=28$, and a Gauss sum if $n$ is odd. In both cases we save a factor $q_2^{1/2}$ (Lemma~\ref{lem:gauss}). The primes that divide both moduli require a separate argument, based on stationary phase modulo prime powers (Lemma~\ref{lem:mixed}). These bounds are combined in the mean value estimate of Proposition~\ref{prop:mean}, which is the arithmetic heart of the paper. The integrals $I_{q_1,q_2}(t;\bm)$ are treated in \S\ref{sec:delta}, where the final bookkeeping is carried out in Lemmas~\ref{lem:LPa}--\ref{lem:LPe}. The description in the last paragraph applies when $Q$ has rank $n$. Suppose now that $d_n=0$, so that the variable $x_n$ does not occur in $Q$. Then the sum over $k_n$ in $S_{1,e}(\bm)$ is not a Gauss sum, and for an individual $\bm$ the sum over $a_2$ saves nothing. On the other hand, a shift of $k_n$ by multiples of $q_1$ shows that \[ S_{q_1,q_2}(\bm)=0\qquad\text{unless }q_2\mid m_n \] (Lemma~\ref{lem:supp}). So only one value of $m_n$ in $q_2$ contributes, and on average over $\bm$ this makes up for the saving that is lost. The mean value estimate that replaces Proposition~\ref{prop:mean} is Proposition~\ref{prop:meansing}. Its proof needs only the estimates of~\cite[\S6]{BDHB}, which are available for forms $Q$ of rank $n-1$. The case $d_n=0$ is treated in \S\ref{sec:sing}, and it leads to the same exponent in the error term. \subsection*{The savings} It may be helpful to see, at a heuristic level, how much is saved at each step. Consider the pairs $(q_1,t)$ with $q_1\asymp Q_1$ and $\Theta\asymp1$. By~\eqref{eq:introid} their contribution to $N_w(P)$ is about \[ \frac1{P^3}\sum_{q_1\asymp Q_1}\ \sumstar_{a_1\bmod q_1}\cH\Bigl(\frac{a_1}{q_1}+\frac t{P^3}\Bigr). \] The trivial bound $\cH(\alpha)\ll P^{n-2}$ gives $P^{n-5}Q_1^2$, so that a factor $Q_1^2$ has to be saved; this is $P^{8/3}$ for $Q_1=P^{4/3}$, and $P^3$ for the largest moduli. After the second $\delta$-symbol and Poisson summation the dual variable $\bm$ has length $q_1q_2/P$ in each coordinate. The number of $\bm$ is therefore $(q_1q_2/P)^n$, which cancels the factor $P^n(q_1q_2)^{-n}$, and the contribution is about \begin{equation}\label{eq:heur} \frac1{P^3}\cdot Q_1\cdot\frac1{R^2}\cdot R\cdot\max|S_{q_1,q_2}(\bm)|=\frac{Q_1}{P^3R}\,\max|S_{q_1,q_2}(\bm)|,\qquad R=PQ_1^{-1/2}, \end{equation} the maximum being over $q_1\asymp Q_1$, $q_2\asymp R$ and the relevant $\bm$. Square-root cancellation in the sum over $\bk$ gives $|S_{q_1,q_2}(\bm)|\ll q_1q_2(q_1q_2)^{n/2}$, and the evaluation of the sum over $a_2$ improves this to $q_1q_2^{1/2}(q_1q_2)^{n/2}$. Inserting the latter into~\eqref{eq:heur}, with $q_1q_2\asymp PQ_1^{1/2}$, we obtain \[ \frac{Q_1^2}{P^3R^{1/2}}\,(PQ_1^{1/2})^{n/2}=P^{\frac n2-\frac72}\,Q_1^{\frac{n+9}4}, \] which is the first term in Proposition~\ref{prop:res}. This increases with $Q_1$, and it is needed only outside the Weyl region, that is, for $Q_1\leqslant P^{8(2+\eta_0)/(n-16)}$. For $n=28$ and $\eta_0\to0$ the largest such modulus is $Q_1=P^{4/3}$, with $R=P^{1/3}$ and $q_1q_2\asymp P^{5/3}$. In this critical case the main term has size $P^{23}$, and the three estimates for $S_{q_1,q_2}(\bm)$ lead to the following bounds. \begin{center} \renewcommand{\arraystretch}{1.25} \begin{tabular}{p{0.47\textwidth}ll} \hline Estimate used for $S_{q_1,q_2}(\bm)$&Bound for $|S_{q_1,q_2}(\bm)|$&Contribution\\ \hline Trivial&$(q_1q_2)^{n+1}$&$P^{139/3}$\\ Square-root cancellation in the sum over $\bk$&$q_1q_2\,(q_1q_2)^{n/2}$&$P^{23}$\\ In addition, evaluation of the sum over $a_2$&$q_1q_2^{1/2}(q_1q_2)^{n/2}$&$P^{23-1/6}$\\ \hline \end{tabular} \end{center} Thus the bounds of~\cite{BDHB} alone bring us exactly to the size of the main term when $n=28$, and the saving from the sum over $a_2$ is what makes this case accessible. If $Q$ has rank $n-1$, the last line of the table has to be read differently. The bound for an individual sum is then $q_1q_2^{3/2}(q_1q_2)^{n/2}$, which is larger than the bound in the second line. But only the $\bm$ with $q_2\mid m_n$ contribute, and since $q_1q_2/P>q_2$ in the critical case, these are one in $q_2$ of all the relevant $\bm$. The contribution is again $P^{23-1/6}$. The Weyl bound saves $P^{\eta_0}$ in its region, while moving the boundary of the Weyl region by $P^{\eta_0}$ costs $P^{(37/6)\eta_0}$ in the critical case (Lemma~\ref{lem:LPa}); the relation $\eta_0+(37/6)\eta_0=1/6$ gives $\eta_0=1/43$. There is a second critical case, $q_1\asymp\Theta\asymp P^{1/2}$ and $q_2\asymp1$, in which the moduli $q_1$ with a large cube-full part dominate; it also gives $P^{23-1/6}$ (Lemma~\ref{lem:LPe}). The same bookkeeping shows that the method does not reach $n=27$, where the corresponding bound exceeds the main term by a factor of about $P^{1.1}$. \subsection*{Notation} Throughout, $n$ is the number of variables. In the theorems, in Proposition~\ref{prop:major}, and in \S\S\ref{sec:delta}--\ref{sec:WA} we have $n\geqslant28$; some intermediate results hold for smaller $n$, as stated. For $\bx\in\RR^n$ we write $|\bx|=\max_i|x_i|$. We put $e(x)=e^{2\pi ix}$ and $e_q(x)=e(x/q)$. A sum $\sumstar_{a\bmod q}$ runs over the residues $a$ modulo $q$ with $(a,q)=1$. The letter $\eps$ denotes an arbitrarily small positive number, not necessarily the same at each occurrence, and $N$ an arbitrarily large positive number. Implied constants depend at most on $n$, $C$, $Q$, the weight $w$, $\eps$ and $N$. For a positive integer $q$, $\omega(q)$ is the number of distinct prime factors of $q$, $\tau(q)$ the number of divisors, and $v_p(q)$ the exponent of the prime $p$ in $q$. We put \[ D=d_1\cdots d_n,\qquad\Delta=2D,\qquad\Qt(\bm)=\sum_{i=1}^nm_i^2\prod_{j\neq i}d_j, \] and for a positive integer $q$ \[ q^\flat=\prod_{p\mid\Delta}p^{v_p(q)},\qquad q^\sharp=q/q^\flat,\qquad\cf(q)=\prod_{p^e\|q,\ e\geqslant3}p^e,\qquad\kappa(q)=q^\flat\,\cf(q^\sharp). \] (In \S\ref{sec:sing}, where $d_n=0$, the definition of $D$ is changed to $D=d_1\cdots d_{n-1}$.) We write $\beta\mid\Delta^\infty$ if every prime factor of $\beta$ divides $\Delta$. We shall use that the number of $\beta\mid\Delta^\infty$ with $\beta\leqslant x$ is $O((\log 3x)^{\omega(\Delta)})$, and that the number of cube-full integers up to $x$ is $O(x^{1/3})$. \subsection*{Declaration on the use of AI} The strategy of the paper, namely to detect the quadratic equation by a nested $\delta$-symbol in the manner of Munshi inside a circle-method treatment of the cubic equation, was chosen by the author, and the author directed the work throughout. In developing the detailed arguments and in preparing the manuscript, the author made use of the AI system Claude (Anthropic). The author has checked all the arguments in the paper and takes full responsibility for its content. \section{Preliminaries}\label{sec:prelim} We begin by recording the normalisation of the forms $C$ and $Q$ and the choice of the weight function. We then collect the facts about the $\delta$-symbol and about oscillatory integrals that will be needed later. \subsection{Normalisation} Let $X$ be as in Theorem~\ref{thm:HP}. By~\cite[Corollary~3.2]{BDHB}, which rests on a result of Aznar~\cite[\S2]{Azn}, there are a non-singular cubic form $C\in\ZZ[\bx]$ and a diagonal quadratic form $Q\in\ZZ[\bx]$ of rank at least $n-1$ such that, after a linear change of variables over $\QQ$, $X$ is given by $C=Q=0$. After a permutation of the variables~\eqref{eq:normal} holds. Since the statement of Theorem~\ref{thm:HP} is invariant under linear changes of variables over $\QQ$, it suffices to prove Theorem~\ref{thm:asymp}. From now on $C$ and $Q$ are as in~\eqref{eq:normal}, $X$ is non-singular, and $X(\RR)\neq\emptyset$. \emph{In \S\S\ref{sec:prelim}--\ref{sec:proofs} we assume in addition that $d_n\neq0$.} The case $d_n=0$ is treated in \S\ref{sec:sing}, where we indicate which of the results of \S\S\ref{sec:prelim}--\ref{sec:proofs} carry over, and replace the others. \begin{remark}\label{rem:diagonal} The diagonal shape of $Q$ in~\eqref{eq:normal} is a normalisation, and not a restriction in Theorem~\ref{thm:HP}. Every quadratic form over $\QQ$ is diagonalised by a linear change of variables over $\QQ$. Such a change maps the rational points and the real points of $X$ bijectively to those of the new variety, it preserves the non-singularity of $X$ and the rank of the quadratic form, and it transforms $C$ into another cubic form, whose coefficients become integers after a scaling. We use the diagonal shape for three reasons. The bounds of~\cite[\S6]{BDHB} for the complete exponential sums, which we quote in~\eqref{eq:BDHBmult} and Lemmas~\ref{lem:BDHBii}--\ref{lem:BDHBiv}, are stated for diagonal $Q$. The Gauss sums in Lemma~\ref{lem:gauss} factorise over the coordinates. And the gradient of $Q$ is $(2d_iz_i)_i$ with $|d_i|\geqslant1$, which is used in Lemma~\ref{lem:Jv}. The lemmas of \S\ref{sec:sums} that are proved here, Lemmas~\ref{lem:gauss}, \ref{lem:statphase} and~\ref{lem:mixed}, hold in the same way for $Q(\bx)=\bx^T\mathbf A\bx$ with a symmetric integer matrix $\mathbf A$ and primes $p\nmid2\det\mathbf A$, with the adjoint form of $\mathbf A$ in place of $\Qt$. Theorem~\ref{thm:asymp}, on the other hand, is a statement about the normalised forms. Under the change of variables the integral points of the original variety correspond to the points of a lattice in the new coordinates, and not to all of $\ZZ^n$. An asymptotic formula for the integral points in the original coordinates, for a quadratic form that is not diagonal, would require a lattice condition on $\bx$. Such a condition is a union of congruence conditions of the kind considered in \S\ref{sec:WA}, but we have not pursued this. \end{remark} \subsection{The weight function}\label{ss:weight} Every point of $X(\RR)$ is non-singular. By homogeneity there is $\bz_0\in\RR^n$ with $0<|\bz_0|\leqslant1/4$, $C(\bz_0)=Q(\bz_0)=0$ and $\nabla C(\bz_0)$, $\nabla Q(\bz_0)$ linearly independent. We fix indices $i_1\neq i_2$ such that the $2\times2$ minor of the matrix with rows $\nabla C(\bz_0)$, $\nabla Q(\bz_0)$ formed by the columns $i_1,i_2$ is non-zero. By continuity and compactness we can fix $\rho_0>0$ and $c_0>0$ such that the closed ball $\cU=\{\bz:|\bz-\bz_0|\leqslant2\rho_0\}$ has the following properties: \begin{enumerate}[label=\textup{(U\arabic*)}] \item $\cU\subset(-1/2,1/2)^n$ and $|\bz|\geqslant|\bz_0|/2$ for $\bz\in\cU$; \item $|s_3\nabla C(\bz)+s_2\nabla Q(\bz)|\geqslant c_0(|s_3|+|s_2|)$ for all $\bz\in\cU$ and $(s_3,s_2)\in\RR^2$; \item the minor above does not vanish on $\cU$, and $\bz\mapsto(C(\bz),Q(\bz),(z_i)_{i\neq i_1,i_2})$ is a diffeomorphism from a neighbourhood of $\cU$ onto its image. \end{enumerate} Let $w_0\in C^\infty(\RR^n)$ be non-negative, supported in $\{|\by|\leqslant1\}$, with $w_0(\bzero)>0$, and put \[ w(\bz)=w_0\bigl((\bz-\bz_0)/\rho_0\bigr). \] Then $w$ is smooth, non-negative, supported in $\{|\bz-\bz_0|\leqslant\rho_0\}\subset\cU$, and $w(\bz_0)>0$. We put \begin{align*} S(\alpha,\beta)&=\sum_{\bx\in\ZZ^n}w(\bx/P)\,e\bigl(\alpha C(\bx)+\beta Q(\bx)\bigr),\\ \cH(\alpha)&=\sum_{\substack{\bx\in\ZZ^n\\ Q(\bx)=0}}w(\bx/P)\,e\bigl(\alpha C(\bx)\bigr)=\int_0^1S(\alpha,\beta)\,d\beta. \end{align*} \subsection{The \texorpdfstring{$\delta$}{delta}-symbol} Let $\varpi\in C^\infty(\RR)$ be the non-negative function of~\cite[\S3]{HB96}, supported in $[1/2,1]$ with $\int\varpi=1$, and for $x>0$ and $y\in\RR$ let \[ h(x,y)=\sum_{j=1}^\infty\frac1{xj}\Bigl\{\varpi(xj)-\varpi\Bigl(\frac{|y|}{xj}\Bigr)\Bigr\}. \] \begin{lemma}\label{lem:delta} For every $R>1$ there is a constant $c_R$ with $c_R=1+O_N(R^{-N})$ such that, for every $k\in\ZZ$, \[ \delta(k)=\frac{c_R}{R^2}\sum_{q=1}^\infty\ \sumstar_{a\bmod q}e_q(ak)\,h\Bigl(\frac qR,\frac k{R^2}\Bigr), \] where $\delta(0)=1$ and $\delta(k)=0$ for $k\neq0$. The function $h$ is smooth on $(0,\infty)\times\RR$, and $h(x,y)=0$ unless $x\leqslant\max\{1,2|y|\}$. Moreover, for all integers $j,N\geqslant0$, \begin{equation}\label{eq:hbound} \frac{\partial^jh}{\partial y^j}(x,y)\ll_{j,N}x^{-1-j}\Bigl(x^N+\min\Bigl\{1,\Bigl(\frac{x}{|y|}\Bigr)^N\Bigr\}\Bigr), \end{equation} and the term $x^N$ may be omitted if $j\geqslant1$. \end{lemma} \begin{proof} This is~\cite[Theorem~1 and Lemma~5]{HB96}. \end{proof} We need three consequences. Put $c_C=\sup_{\bz\in\cU}|C(\bz)|$ and $r_0=\max\{1,2c_C\}$. Fix $\psi\in C_c^\infty(\RR)$ with $\psi=1$ on $[-c_C,c_C]$, and a smooth even function $B$ with $B=1$ on $[-1,1]$ and $\supp B\subset[-2,2]$. For $00$ and $N\geqslant2$. Then \[ \int_{\RR}f(y)h(x,y)\,dy=f(0)+O_N\Bigl(x^{N-1}\bigl(\|f\|_{L^1}+\|f^{(N)}\|_{L^1}\bigr)\Bigr). \] \end{lemma} \begin{proof} For fixed $x$ the sum defining $h(x,y)$ is finite, uniformly for $y$ in a compact set. For $s\in\RR$ put \[ \Omega(s)=\varpi(s)/s,\qquad G(s)=\int_0^\infty\bigl\{f(sv)+f(-sv)\bigr\}\varpi(v)\,dv. \] Then $\Omega\in C_c^\infty((0,\infty))$, and $G$ is smooth, even and compactly supported, with $G(0)=2f(0)$. The substitution $y=\pm xjv$ gives $\int f(y)\varpi(|y|/(xj))\,dy=xj\,G(xj)$. Hence \[ \int_{\RR}f(y)h(x,y)\,dy=\Bigl(\int f\Bigr)\sum_{j\geqslant1}\Omega(xj)-\sum_{j\geqslant1}G(xj) =\Bigl(\int f\Bigr)\sum_{j\in\ZZ}\Omega(xj)-\frac12\sum_{j\in\ZZ}G(xj)+f(0). \] By Poisson summation $\sum_{j\in\ZZ}F(xj)=x^{-1}\sum_{k\in\ZZ}\widehat F(k/x)$ for $F=\Omega$ and $F=G$. Now $\widehat\Omega(0)=\int\varpi(s)s^{-1}ds$ and \[ \widehat G(0)=\int_0^\infty\varpi(v)\int_{\RR}\bigl\{f(sv)+f(-sv)\bigr\}ds\,dv=2\Bigl(\int f\Bigr)\int_0^\infty\frac{\varpi(v)}{v}dv, \] so the terms with $k=0$ cancel. For $k\neq0$ we have $\widehat\Omega(k/x)\ll_N(x/|k|)^N$ and $|\widehat G(k/x)|\leqslant(2\pi|k|/x)^{-N}\|G^{(N)}\|_{L^1}$, and $\|G^{(N)}\|_{L^1}\leqslant2\|f^{(N)}\|_{L^1}\int\varpi(v)v^{N-1}dv\leqslant2\|f^{(N)}\|_{L^1}$. Summing over $k\neq0$ gives the claim. \end{proof} \begin{lemma}\label{lem:prii} For $0c_2|\gamma_2|$, then $J(\bgam;\bu)\ll_N(|\gamma_2|+|\bu|)^{-N}$. For all $\bu$ and every $P\geqslant1$, \[ J(\bgam;\bu)\ll_{N,\eps}P^{-N}+P^{\eps}|\gamma_2|^{-n/2}. \] \end{lemma} \begin{proof} We have $\nabla f_{\bgam}(\bz)=2\gamma_2(d_iz_i)_i+\gamma_3\nabla C(\bz)$. If $K_0$ is large enough, then for $|\gamma_2|\geqslant K_0(1+|\gamma_3|)$ and $\bz,\bz'\in\cU$, \begin{equation}\label{eq:inj} \kappa_1|\gamma_2|\leqslant|\nabla f_{\bgam}(\bz)|\leqslant3\kappa_2|\gamma_2|,\qquad|\nabla f_{\bgam}(\bz)-\nabla f_{\bgam}(\bz')|\geqslant|\gamma_2|\,|\bz-\bz'|, \end{equation} because $|d_i|\geqslant1$ and $\nabla C$ is Lipschitz on $\cU$. Let $c_1=\kappa_1/2$ and $c_2=6\kappa_2$. If $|\bu|c_2|\gamma_2|$, then $|\nabla F|\gg|\gamma_2|+|\bu|$ on $\cU$, while the derivatives of $F$ of order at least two are $O(|\gamma_2|)$; Lemma~\ref{lem:ibp} gives the first assertion. For the second we use Lemma~\ref{lem:Jiv}. By the second inequality in~\eqref{eq:inj}, the set $\{\bz\in\cU:|\nabla f_{\bgam}(\bz)-\bu|\leqslant P^\eps\|\bgam\|^{1/2}\}$ has diameter at most $2P^\eps\|\bgam\|^{1/2}/|\gamma_2|\ll P^\eps|\gamma_2|^{-1/2}$, so its measure is $O(P^{n\eps}|\gamma_2|^{-n/2})$. \end{proof} \section{Exponential sums}\label{sec:sums} This section is devoted to the complete exponential sums. We first recall the estimates of Browning, Dietmann and Heath-Brown for the sums that arise from a single modulus. We then introduce the sums $S_{q_1,q_2}(\bm)$ attached to the nested $\delta$-symbol, and estimate them according to the way in which the primes are distributed between the two moduli. The outcome is the mean value estimate of Proposition~\ref{prop:mean}. \subsection{The complete sums of Browning, Dietmann and Heath-Brown} For $q\in\NN$, $\ba=(a_3,a_2)\in\ZZ^2$ and $\bm\in\ZZ^n$ let \[ S(\ba,q;\bm)=\sum_{\by\bmod q}e_q\bigl(a_3C(\by)+a_2Q(\by)+\bm\cdot\by\bigr). \] For a prime $p$ let $\nu_p$ be the largest integer $\nu$ such that $p^\nu$ divides one of $2d_1,\dots,2d_{n-1}$, as in~\cite[\S6]{BDHB}; thus $\nu_p=0$ for $p\nmid\Delta$. Put $C_\Delta=\prod_{p\mid\Delta}p^{\nu_p}$. If $\gcd(q,a_3,a_2)=1$ we factorise $q=q^{(0)}q^{(1)}q^{(2)}$, where \[ q^{(0)}=\prod_{\substack{p^e\|q\\ p^{1+\nu_p}\mid a_3}}p^e,\qquad q^{(2)}=\prod_{\substack{p^e\|q,\ e\geqslant3\\ p^{1+\nu_p}\nmid a_3}}p^e, \] so that $q^{(1)}$ is cube-free and $q^{(2)}$ is cube-full. We shall use four results of Browning, Dietmann and Heath-Brown, which are stated in~\cite[\S6]{BDHB} for a non-singular cubic form $C$ and a diagonal form $Q$ with $d_1\cdots d_{n-1}\neq0$. In all of them $q\in\NN$ and $\ba\in\ZZ^2$ with $\gcd(q,a_3,a_2)=1$. We record the hypotheses precisely. In~\cite[\S6]{BDHB} the form $C$ is non-singular and $Q=\sum_id_ix_i^2$ with $d_1\cdots d_{n-1}\neq0$, by~\cite[(6.1)]{BDHB}. The coefficient $d_n$ may vanish, and $\nu_p$ is defined in terms of $2d_1,\dots,2d_{n-1}$ only, so these results apply verbatim when $d_n=0$, as in \S\ref{sec:sing}. The numerators are assumed in~\cite[(6.2)]{BDHB} to satisfy $\gcd(q,\ba)=1$ and $1\leqslant a_3,a_2\leqslant q$. The second condition is no restriction, since $S(\ba,q;\bm)$ depends only on $\ba$ modulo $q$. Lemmas~\ref{lem:BDHBii} and~\ref{lem:BDHBiii} are stated in~\cite{BDHB} for every $\bm\in\ZZ^n$, and Lemma~\ref{lem:BDHBiv} for every $\bm_0\in\RR^n$ and $V\geqslant1$. In all three the implied constants depend only on $n$, $C$, $Q$ and $\eps$, and not on $\ba$ or $\bm$. This can be read off from the proofs. In~\cite[Lemma~6.2]{BDHB} the constant comes from the number $p^{\nu_p}\ll1$ of choices for each of the variables $y_i$ there. In~\cite[Lemma~6.3]{BDHB} it comes from Deligne's bound for moduli $p$ and Heath-Brown's bound for moduli $p^2$, applied to the polynomial $a_3C(\bx)+a_2Q(\bx)+\bm\cdot\bx$, whose leading form $a_3C$ is non-singular modulo $p$; the finitely many primes that divide $\Delta$, or modulo which $C$ is singular, are treated trivially. In~\cite[Lemma~6.4]{BDHB} the only condition on $\ba$ is that $\gcd(q,a_3)$ be bounded, and here this takes the form $\gcd(q,a_3)\leqslant C_\Delta$. The first is the multiplicativity relation~\cite[(6.6)]{BDHB}: if $q=q'q''$ with $(q',q'')=1$, then for all $\bm\in\ZZ^n$ \begin{equation}\label{eq:BDHBmult} S(\ba,q;\bm)=S(\ba',q';\bm)\,S(\ba'',q'';\bm),\qquad\ba'=(q''^2a_3,q''a_2),\quad\ba''=(q'^2a_3,q'a_2). \end{equation} The other three are the following lemmas. \begin{lemma}[{\cite[Lemma~6.2]{BDHB}}]\label{lem:BDHBii} If $q=p^e$ and $p^{1+\nu_p}\mid a_3$, then $S(\ba,q;\bm)\ll q^{(n+1)/2}$ for all $\bm\in\ZZ^n$. \end{lemma} \begin{lemma}[{\cite[Lemma~6.3]{BDHB}}]\label{lem:BDHBiii} If $q$ is cube-free and $p^{1+\nu_p}\nmid a_3$ for every prime $p\mid q$, then $S(\ba,q;\bm)\ll q^{n/2+\eps}$ for all $\bm\in\ZZ^n$. \end{lemma} \begin{lemma}[{\cite[Lemma~6.4]{BDHB}}]\label{lem:BDHBiv} If $q$ is cube-full and $\gcd(q,a_3)\leqslant C_\Delta$, then for all $\bm_0\in\RR^n$ and $V\geqslant1$ \[ \sum_{\substack{\bm\in\ZZ^n\\ |\bm-\bm_0|\leqslant V}}|S(\ba,q;\bm)|\ll q^{n/2+\eps}\bigl(V^n+q^{n/3}\bigr). \] \end{lemma} \begin{corollary}\label{cor:BDHB} Let $q\in\NN$ and $\ba\in\ZZ^2$ with $\gcd(q,a_3,a_2)=1$. For all $\bm_0\in\RR^n$ and $V\geqslant1$, \[ \sum_{|\bm-\bm_0|\leqslant V}|S(\ba,q;\bm)|\ll q^{n/2+\eps}\bigl(q^{(0)}\bigr)^{1/2}\Bigl(V^n+\bigl(q^{(2)}\bigr)^{n/3}\Bigr). \] \end{corollary} \begin{proof} By~\eqref{eq:BDHBmult}, $S(\ba,q;\bm)$ is the product of three sums with moduli $q^{(0)}$, $q^{(1)}$, $q^{(2)}$ and the same $\bm$. Their numerators are obtained from $\ba$ on multiplying $a_3$ and $a_2$ by integers coprime to the modulus, so the conditions of Lemmas~\ref{lem:BDHBii}, \ref{lem:BDHBiii} and~\ref{lem:BDHBiv} hold for them. We apply~\eqref{eq:BDHBmult} and Lemma~\ref{lem:BDHBii} to the prime powers dividing $q^{(0)}$; the product of the implied constants is $O(q^\eps)$. Then we apply Lemma~\ref{lem:BDHBiii} to $q^{(1)}$, and Lemma~\ref{lem:BDHBiv} to $q^{(2)}$ if $q^{(2)}>1$. \end{proof} \subsection{The nested sums} For $q_1,q_2\in\NN$ and $\bm\in\ZZ^n$ let \[ S_{q_1,q_2}(\bm)=\sumstar_{a_1\bmod q_1}\ \sumstar_{a_2\bmod q_2}\ \sum_{\substack{\bk\bmod q_1q_2\\ q_1\mid Q(\bk)}}e_{q_1q_2}\bigl(a_1q_2C(\bk)+a_2Q(\bk)+\bk\cdot\bm\bigr). \] The summand is well defined: if $q_1\mid Q(\bk)$, then $a_2Q(\bk)/(q_1q_2)$ modulo $1$ depends only on $a_2$ modulo $q_2$. \begin{lemma}\label{lem:multi} If $q_1=q_1'q_1''$ and $q_2=q_2'q_2''$ with $(q_1'q_2',q_1''q_2'')=1$, then \[ S_{q_1,q_2}(\bm)=S_{q_1',q_2'}(\bm)\,S_{q_1'',q_2''}(\bm). \] \end{lemma} \begin{proof} Put $q'=q_1'q_2'$ and $q''=q_1''q_2''$, and write $\bk=q''\bk'+q'\bk''$ with $\bk'$ modulo $q'$ and $\bk''$ modulo $q''$. Then $q_1\mid Q(\bk)$ if and only if $q_1'\mid Q(\bk')$ and $q_1''\mid Q(\bk'')$. Let $\overline{q''}$ be an inverse of $q''$ modulo $q'$ and $\overline{q'}$ an inverse of $q'$ modulo $q''$, so that $e_{q'q''}(M)=e_{q'}(\overline{q''}M)e_{q''}(\overline{q'}M)$ for $M\in\ZZ$. Since $C(\bk)\equiv q''^3C(\bk')$, $Q(\bk)\equiv q''^2Q(\bk')$ and $\bk\equiv q''\bk'$ modulo $q'$, \[ e_{q'}\bigl(\overline{q''}(a_1q_2C(\bk)+a_2Q(\bk)+\bk\cdot\bm)\bigr)=e_{q_1'q_2'}\bigl(a_1'q_2'C(\bk')+a_2'Q(\bk')+\bk'\cdot\bm\bigr), \] with $a_1'=a_1q_2''q''^2$ and $a_2'=a_2q''$, and similarly for the other factor. As $a_1$ runs over the reduced residues modulo $q_1$, the pair $(a_1'\bmod q_1',a_1''\bmod q_1'')$ runs over the pairs of reduced residues, and likewise for $a_2$. \end{proof} \begin{lemma}\label{lem:multii} For all $q_1,q_2\in\NN$ and $\bm\in\ZZ^n$ we have \[ S_{q_1,q_2}(\bm)=\frac1{q_1}\sum_{b\bmod q_1}\ \sumstar_{a_1\bmod q_1}\ \sumstar_{a_2\bmod q_2}S\bigl((a_1q_2,\,a_2+bq_2),\,q_1q_2;\,\bm\bigr), \] and $\gcd(q_1q_2,a_1q_2,a_2+bq_2)=1$ for all $b$, $a_1$, $a_2$ in the sum. \end{lemma} \begin{proof} We detect the condition $q_1\mid Q(\bk)$ by $q_1^{-1}\sum_{b\bmod q_1}e_{q_1}(bQ(\bk))$ and note that $e_{q_1}(bQ(\bk))=e_{q_1q_2}(bq_2Q(\bk))$. If a prime $p$ divides $q_2$, then $p\nmid a_2+bq_2$. If $p$ divides $q_1$ but not $q_2$, then $p\nmid a_1q_2$. \end{proof} \subsection{The second modulus alone} \begin{lemma}\label{lem:gauss} There is a constant $A\geqslant1$ such that, for all $e\in\NN$ and $\bm\in\ZZ^n$, \[ |S_{1,e}(\bm)|\leqslant A^{\omega(e)}\,e^{(n+1)/2}\,\bigl(e^\flat\bigr)^{1/2}\,\bigl(e^\sharp,\Qt(\bm)\bigr)^{1/2}. \] Here $(e^\sharp,0)=e^\sharp$. \end{lemma} \begin{proof} By Lemma~\ref{lem:multi} it suffices to take $e=p^s$. We have \[ S_{1,p^s}(\bm)=\sumstar_{a\bmod p^s}\ \prod_{i=1}^nG(ad_i,m_i),\qquad G(u,v)=\sum_{k\bmod p^s}e_{p^s}(uk^2+vk). \] Squaring out, $|G(u,v)|^2\leqslant p^s\,\#\{h\bmod p^s:2uh\equiv0\}=p^s(2u,p^s)$. If $p\mid\Delta$ this gives $|S_{1,p^s}(\bm)|\leqslant p^s\cdot(2^n|D|)^{1/2}p^{sn/2}$, which is the claim with $A=(2^n|D|)^{1/2}$. Let $p\nmid\Delta$. Then, for $p\nmid u$, completing the square gives $G(u,v)=e_{p^s}(-\overline{4u}v^2)\bigl(\tfrac{u}{p}\bigr)^sG(1,0)$, where $\bigl(\tfrac\cdot p\bigr)$ is the Legendre symbol and $|G(1,0)|=p^{s/2}$. Hence \[ |S_{1,p^s}(\bm)|=p^{sn/2}\Bigl|\ \sumstar_{a\bmod p^s}\Bigl(\frac ap\Bigr)^{sn}e_{p^s}(aM)\Bigr|,\qquad M=-\overline{4D}\,\Qt(\bm), \] on replacing $a$ by its inverse. If $sn$ is even, the sum over $a$ is a Ramanujan sum, of modulus at most $(p^s,M)\leqslant p^{s/2}(p^s,M)^{1/2}$. If $sn$ is odd, it is a Gauss sum for the character $\bigl(\tfrac\cdot p\bigr)$ modulo $p^s$: it vanishes unless $p^{s-1}\,\|\,M$, in which case its modulus is $p^{s-1/2}=p^{s/2}(p^s,M)^{1/2}$. Since $(p^s,M)=(p^s,\Qt(\bm))$, this proves the lemma. \end{proof} \subsection{Moduli with a common prime factor} We first record a form of the method of stationary phase for sums modulo prime powers. \begin{lemma}\label{lem:statphase} Let $p$ be an odd prime, $t\geqslant1$, and \[ g(\bz)=\bz^T\mathbf B\bz+\bell\cdot\bz+c+p\,h(\bz), \] where $\mathbf B$ is a symmetric $n\times n$ integer matrix with $p\nmid\det\mathbf B$, $\bell\in\ZZ^n$, $c\in\ZZ$ and $h\in\ZZ[z_1,\dots,z_n]$. Then \[ \Bigl|\sum_{\bz\bmod p^t}e_{p^t}\bigl(g(\bz)\bigr)\Bigr|=p^{nt/2}. \] \end{lemma} \begin{proof} For $t=1$ the sum is a Gauss sum for the non-singular quadratic form $\bz^T\mathbf B\bz$ over $\mathbb F_p$. Let $t\geqslant2$, $j=\lfloor t/2\rfloor$ and $k=t-j$, and write $\bz=\bx+p^k\bv$ with $\bx$ modulo $p^k$ and $\bv$ modulo $p^j$. The coefficients of the Taylor expansion of a polynomial with integer coefficients are polynomials with integer coefficients, and $2k\geqslant t$; hence $g(\bx+p^k\bv)\equiv g(\bx)+p^k\nabla g(\bx)\cdot\bv\pmod{p^t}$. Summing over $\bv$, \[ \sum_{\bz\bmod p^t}e_{p^t}(g(\bz))=p^{nj}\sum_{\substack{\bx\bmod p^k\\ \nabla g(\bx)\equiv\bzero\bmod p^j}}e_{p^t}(g(\bx)). \] Now $\nabla g(\bx)=2\mathbf B\bx+\bell+p\nabla h(\bx)$. If $\nabla g(\bx)\equiv\nabla g(\bx')\pmod{p^j}$ and $\bx\equiv\bx'\pmod{p^i}$ for some $iV$, then $\min\{V,\kappa(\varrho_1)\}\geqslant V/C_\Delta$ by~\eqref{eq:q0q2}, and the claim follows from Lemma~\ref{lem:rest1}. Let $\kappa'\leqslant V$. By \eqref{eq:BDHBmult} and Lemmas~\ref{lem:BDHBii} and~\ref{lem:BDHBiii}, \[ |S(\ba,q;\bm)|\ll(q/\kappa')^{n/2+\eps}\bigl(q^{(0)}\bigr)^{1/2}\,|S(\ba'',\kappa';\bm)| \] for a suitable $\ba''$, and the last factor depends only on $\bm$ modulo $\kappa'$. For given $m_1,\dots,m_{n-1}$ there are at most two $m_n$ with $\Qt(\bm-\bm_1)=0$, because this is a quadratic equation for $m_n$ in which the coefficient of $m_n^2$ is non-zero. Hence each residue class modulo $\kappa'$ contains at most $2(2V/\kappa'+1)^{n-1}\ll(V/\kappa')^{n-1}$ vectors $\bm$ with $|\bm-\bm_0|\leqslant V$ and $\Qt(\bm-\bm_1)=0$. By Lemma~\ref{lem:BDHBiv}, applied to a box of side $\kappa'$, the sum of $|S(\ba'',\kappa';\bnu)|$ over $\bnu$ modulo $\kappa'$ is $O(\kappa'^{3n/2+\eps})$. Therefore \[ \sum_{\substack{|\bm-\bm_0|\leqslant V\\ \Qt(\bm-\bm_1)=0}}|S(\ba,q;\bm)|\ll(q/\kappa')^{n/2+\eps}\bigl(q^{(0)}\bigr)^{1/2}\Bigl(\frac V{\kappa'}\Bigr)^{n-1}\kappa'^{3n/2+\eps}\ll q^{n/2+\eps}\bigl(q^{(0)}\bigr)^{1/2}V^{n-1}\kappa', \] and $\kappa'\leqslant\min\{V,C_\Delta\kappa(\varrho_1)\}$. By~\eqref{eq:q0q2}, summing over the triples $(b,a_1,a_2)$ gives the lemma. \end{proof} \subsection{The mean value} The following proposition is the arithmetic input for \S\ref{sec:delta}. The factor $Q_2^{3/2}$, in place of the trivial $Q_2^2$, is the saving from the sum over $a_2$. \begin{proposition}\label{prop:mean} Let $Q_1,Q_2\geqslant1/2$ and $V\geqslant1$, and for each $q_1$ let $\bm_0(q_1)\in\RR^n$ with $|\bm_0(q_1)|\leqslant V_0$. Then \begin{multline*} \sum_{Q_10$, and divide the set of pairs $(q_1,t)$ with $q_1\leqslant r_0P^{3/2}$ and $t\in\RR$ into four parts: \begin{align*} \cR_\infty&=\{(q_1,t):\ |t|>P^{\eps}/r_1\},\\ \fM_1&=\{(q_1,t):\ q_1\leqslant P^{\delta_1},\ |t|\leqslant P^{\delta_1}\},\\ \cR_W&=\{(q_1,t)\notin\cR_\infty\cup\fM_1:\ q_1^{n/8-2}\,\Theta^{n/8-1}\geqslant P^{2+\eta_0}\},\\ \cR_\delta&=\{(q_1,t)\notin\cR_\infty\cup\fM_1:\ q_1^{n/8-2}\,\Theta^{n/8-1}P^\eps/r_1}(r_1|t|)^{-N}dt\ll_NP^{-N}. \end{equation} \subsection{The Weyl region} In this subsection we prove the Weyl bound, Lemma~\ref{lem:weyl}, and deduce Proposition~\ref{prop:weyl}. The bound is a version of~\cite[Lemma~4.1]{BDHB}, which rests on~\cite[Lemma~1]{DL}. We give a complete proof, for three reasons: in~\cite[\S4]{BDHB} it is assumed that $n\geqslant29$; we need the bound uniformly in $\beta$, and in \S\ref{sec:WA} also in the presence of a linear phase; and we work with the smooth weight $w$. The argument is Davenport's~\cite[\S\S12--13]{Dav}, in the form given by Heath-Brown~\cite[\S2]{HB07}. For $\bth\in\RR^n$ we put \[ S(\alpha,\beta;\bth)=\sum_{\bx\in\ZZ^n}w(\bx/P)\,e\bigl(\alpha C(\bx)+\beta Q(\bx)+\bth\cdot\bx\bigr), \] so that $S(\alpha,\beta)=S(\alpha,\beta;\bzero)$. In this subsection the implied constants depend only on $n$, $C$, $w$ and $\eps$. In particular they do not depend on $\alpha$, $\beta$ or $\bth$, and the form $Q$ plays no role. \begin{lemma}\label{lem:linsum} Let $P\geqslant1$, and let $V\in C^\infty(\RR^n)$ be supported in $[-P,P]^n$, with $|\partial_1\cdots\partial_nV|\leqslant AP^{-n}$ on $\RR^n$. Then, for all $\bgam\in\RR^n$, \[ \Bigl|\sum_{\bx\in\ZZ^n}V(\bx)e(\bgam\cdot\bx)\Bigr|\ll_nA\prod_{i=1}^n\min\bigl\{P,\|\gamma_i\|^{-1}\bigr\}. \] \end{lemma} \begin{proof} For $1\leqslant i\leqslant n$ and $y\in\ZZ$ let $E_i(y)=\sum_{u\in\ZZ,\ -P-10$, and for $00$, let $\alpha,\beta\in\RR$ and $\bth\in\RR^n$, and suppose that $S(\alpha,\beta;\bth)\neq0$. Define $T>0$ by $|S(\alpha,\beta;\bth)|=P^nT^{-n}$, and suppose that $T^8\leqslant P^{3/2}$. If $P$ is sufficiently large in terms of $n$, $C$, $w$ and $\eps$, then there are coprime integers $s\geqslant1$ and $b$ such that \[ \alpha=\frac bs+\varphi,\qquad s\bigl(1+P^3|\varphi|\bigr)\ll P^\eps T^8. \] \end{lemma} \begin{proof} Write $W(\bx)=w(\bx/P)$ and $f(\bx)=\alpha C(\bx)+\beta Q(\bx)+\bth\cdot\bx$, and let $\Delta_{\bh}g(\bx)=g(\bx+\bh)-g(\bx)$. By~(U1), $W(\bx)=0$ unless $|\bx|

0$ by $|S(\alpha,\beta;\bth)|=P^nT^{-n}$. We show that $T^8\gg P^{-3\eps}\Xi$, which gives the lemma. If $T^8>P^{3/2}$, this holds because $\Xi\leqslant P^{3/2+\eps}$; so no restriction on the size of $T$ is needed. Let $T^8\leqslant P^{3/2}$. By Lemma~\ref{lem:dioph} there are coprime integers $s\geqslant1$ and $b$ with \[ \alpha=\frac bs+\varphi,\qquad s(1+P^3|\varphi|)\ll P^{\eps}T^8. \] If $b/s=a/q$, then $s=q$ and $\varphi=z$, so $\Xi\ll P^\eps T^8$. Otherwise $1\leqslant sq|a/q-b/s|\leqslant sq|\varphi|+sq|z|$. Here $sq|\varphi|\ll qP^{\eps-3}T^8$ and $sq|z|\leqslant s\,\Xi P^{-3}\ll\Xi P^{\eps-3}T^8$, and $q\leqslant\Xi$. Hence $T^8\gg P^{3-\eps}\Xi^{-1}\geqslant P^{-3\eps}\Xi$, because $\Xi^2\leqslant P^{3+2\eps}$. In both cases $T^8\gg P^{-3\eps}\Xi$, and the lemma follows. \end{proof} \begin{proposition}\label{prop:weyl} We have $N_W\ll P^{n-5-\eta_0+\eps}$. \end{proposition} \begin{proof} If $(q_1,t)\in\cR_W$, then $\Xi=q_1\Theta\leqslant q_1+P^{\eps}q_1/r_1\ll P^{3/2+\eps}$. By Lemma~\ref{lem:weyl} (with $2\eps$ in place of $\eps$), $|\cH(a_1/q_1+tP^{-3})|\leqslant\sup_\beta|S(a_1/q_1+tP^{-3},\beta)|\ll P^{n+\eps}(q_1\Theta)^{-n/8}$. Since $p_{r_1}(t)\ll1$, \[ N_W\ll P^{n-3+\eps}\sum_{q_1}q_1\int_{(q_1,t)\in\cR_W}(q_1\Theta)^{-n/8}\,dt. \] We divide the range into $O((\log P)^2)$ parts with $Q_1Y}q^{-n}\sum_{\substack{\ba\bmod q\\ \gcd(q,a_3,a_2)=1}}|S(\ba,q;\bzero)|\ll Y^{7/6-n/12+\eps}. \] In particular the series $\fS$ converges absolutely. \item The integral $\fJ$ converges absolutely, and $\fJ>0$. \end{enumerate} \end{lemma} \begin{proof} (i) By Corollary~\ref{cor:BDHB} with $\bm_0=\bzero$ and $V=1$, $S(\ba,q;\bzero)\ll q^{n/2+\eps}(q^{(0)})^{1/2}(q^{(2)})^{n/3}$. Put $u=q^{(0)}q^{(1)}$ and $v=q^{(2)}$. Then $q=uv$, $(u,v)=1$, $v$ is cube-full, and $q^{-n}S(\ba,q;\bzero)\ll q^\eps u^{(1-n)/2}v^{-n/6}$. There are at most $q^2$ pairs $\ba$. Hence the sum in~(i) is \[ \ll\sum_{\substack{u,v\\ uv>Y}}(uv)^\eps u^{(5-n)/2}v^{2-n/6}, \] where $v$ runs over cube-full integers. The terms with $u>Y^{1/2}$ contribute $O(Y^{(7-n)/4+\eps})$, and the terms with $v>Y^{1/2}$ contribute $O(Y^{(1/2)(1/3+2-n/6)+\eps})$, since $n/6-2>1/3$. (ii) The convergence follows from Lemma~\ref{lem:Jiii}. By (U3) we may use $\by=(C(\bz),Q(\bz))$ and $\bz''=(z_i)_{i\neq i_1,i_2}$ as coordinates on a neighbourhood of $\cU$. Then $J(\bgam;\bzero)=\int_{\RR^2}\Phi(\by)e(\gamma_3y_1+\gamma_2y_2)\,d\by$, where $\Phi(\by)$ is the integral of $w$ over the fibre, against $d\bz''$ divided by the absolute value of the minor in (U3). The function $\Phi$ is smooth, non-negative and compactly supported, so $\fJ=\Phi(\bzero)$ by Fourier inversion, and $\Phi(\bzero)>0$ because $w\geqslant0$ and $w(\bz_0)>0$. \end{proof} For $q_1,q_2\in\NN$ and $a_1,a_2\in\ZZ$ let \[ S^*(a_1,q_1;a_2,q_2)=\sum_{\bk\bmod q_1q_2}e\Bigl(\frac{a_1C(\bk)}{q_1}+\frac{a_2Q(\bk)}{q_2}\Bigr). \] \begin{lemma}\label{lem:majorS} Let $q_1\leqslant P^{\delta_1}$, $(a_1,q_1)=1$ and $|t|\leqslant P^{\delta_1}$, and put $\alpha=a_1/q_1+tP^{-3}$. Let $q_2\leqslant P$, $(a_2,q_2)=1$ and $\beta=a_2/q_2+z_2$ with $|z_2|\leqslant(q_2P)^{-1}$. Then \[ S(\alpha,\beta)=\frac{P^n}{(q_1q_2)^n}\,S^*(a_1,q_1;a_2,q_2)\,J\bigl((t,z_2P^2);\bzero\bigr)+O\bigl(P^{n/2+8n\delta_1}\bigr), \] and $S^*(a_1,q_1;a_2,q_2)\ll q_1^{2n}q_2^{n/2}$. \end{lemma} \begin{proof} Put $q=q_1q_2$, $L=P/q$, $t_2=z_2P^2$ and $\bgam=(t,t_2)$. Splitting $\bx$ into residue classes modulo $q$ and applying Poisson summation, as in~\cite[Lemma~6.1]{BDHB}, we get \[ S(\alpha,\beta)=L^n\sum_{\bm\in\ZZ^n}\fS(\bm)\,J(\bgam;L\bm),\qquad\fS(\bm)=\sum_{\bk\bmod q}e\Bigl(\frac{a_1C(\bk)}{q_1}+\frac{a_2Q(\bk)}{q_2}+\frac{\bk\cdot\bm}{q}\Bigr). \] Write $\bk=\bk_1+q_1\bl$ with $\bk_1$ modulo $q_1$ and $\bl$ modulo $q_2$. For fixed $\bk_1$ the sum over $\bl$ is a product of $n$ sums $\sum_{l\bmod q_2}e_{q_2}(ul^2+vl)$ with $u=a_2d_iq_1^2$, each of modulus at most $(q_2(2u,q_2))^{1/2}\leqslant(2|d_i|q_1^2q_2)^{1/2}$. Hence $\fS(\bm)\ll q_1^{2n}q_2^{n/2}$ for all $\bm$; this includes the bound for $S^*=\fS(\bzero)$. It remains to show that \begin{equation}\label{eq:majerr} L^n\,q_1^{2n}q_2^{n/2}\sum_{\bm\neq\bzero}|J(\bgam;L\bm)|\ll P^{n/2+8n\delta_1}. \end{equation} Note that $|t_2|\leqslant P/q_2$ and $\|\bgam\|\leqslant2P^{\delta_1}+|t_2|$. Suppose first that $q\leqslant P^{1-3\delta_1}$, so that $L\geqslant P^{3\delta_1}$. If $|t_2|\leqslant P^{2\delta_1}$, then $|L\bm|\geqslant c_4\|\bgam\|$ for all $\bm\neq\bzero$, and by Lemma~\ref{lem:Jii} the sum in~\eqref{eq:majerr} is $O(L^{-N})$. If $|t_2|>P^{2\delta_1}$, then $|t_2|\geqslant K_0(1+|t|)$, and we apply Lemma~\ref{lem:Jv}. The $\bm\neq\bzero$ with $|L\bm|c_2|t_2|$ contribute $O(L^{-N})$. The number of the remaining $\bm$ is $O((|t_2|/L)^n)$, and each contributes $O(P^{-N}+P^\eps|t_2|^{-n/2})$. So the left-hand side of~\eqref{eq:majerr} is $O(1+P^\eps q_1^{2n}(q_2|t_2|)^{n/2})=O(P^{n/2+2n\delta_1+\eps})$. Suppose now that $q>P^{1-3\delta_1}$. Then $q_2>P^{1-4\delta_1}$, so $|t_2|P^{\delta_2}$ contribute \[ \ll P^{n-2}q_1^n\sum_{q_2>P^{\delta_2}}q_2^{1-n/2}\ll P^{n-2+n\delta_1-(n/2-2)\delta_2}. \] For $q_2\leqslant P^{\delta_2}$ we extend the integral over $z_2$ to $\RR$; the part $|z_2|>(2q_2P)^{-1}$ has $|t_2|\geqslant P^{1-\delta_2}/2$ and is negligible. Hence \begin{multline*} \cH(\alpha)=P^{n-2}\sum_{q_2\leqslant P^{\delta_2}}\ \sumstar_{a_2\bmod q_2}\frac{S^*(a_1,q_1;a_2,q_2)}{(q_1q_2)^n}\int_{\RR}J\bigl((t,t_2);\bzero\bigr)\,dt_2\\ +O\bigl(P^{n-2+n\delta_1-(n/2-2)\delta_2}+P^{n/2+8n\delta_1}\bigr). \end{multline*} We insert this into the definition of $N_{\fM}$. For $(q_1,t)\in\fM_1$ we have $r_1\leqslant P^{\delta_1-3/2}$, so $p_{r_1}(t)=1+O(P^{-N})$ by Lemma~\ref{lem:prii}, and $c_*=1+O(P^{-N})$. The error terms contribute \[ \ll P^{3\delta_1-3}\bigl(P^{n-2+n\delta_1-(n/2-2)\delta_2}+P^{n/2+8n\delta_1}\bigr)\ll P^{n-5+(n+3)\delta_1-(n/2-2)\delta_2}, \] which is $O(P^{n-5-17/40})$ for $n\geqslant28$, since $(n+3)\delta_1-(n/2-2)\delta_2=(11-n)/40$. By Lemma~\ref{lem:Jiii}, the integral of $J(\bgam;\bzero)$ over $|t|\leqslant P^{\delta_1}$ and $t_2\in\RR$ is $\fJ+O(P^{-N})$. Therefore \begin{multline*} N_{\fM}=P^{n-5}\bigl(\fJ+O(P^{-N})\bigr)\sum_{q_1\leqslant P^{\delta_1}}\ \sum_{q_2\leqslant P^{\delta_2}}\ \sumstar_{a_1\bmod q_1}\ \sumstar_{a_2\bmod q_2}\frac{S^*(a_1,q_1;a_2,q_2)}{(q_1q_2)^n}\\ +O\bigl(P^{n-5-17/40}\bigr). \end{multline*} The quadruples $(q_1,a_1,q_2,a_2)$ with $(a_1,q_1)=(a_2,q_2)=1$ correspond bijectively to the pairs $(q,\ba)$ with $\ba$ modulo $q$ and $\gcd(q,a_3,a_2)=1$, by $q=\operatorname{lcm}(q_1,q_2)$ and $\ba=(a_1q/q_1,a_2q/q_2)$; and $(q_1q_2)^{-n}S^*(a_1,q_1;a_2,q_2)=q^{-n}S(\ba,q;\bzero)$. The quadruples that are missing from the sum have $q>P^{\delta_1}$. By Lemma~\ref{lem:SJ}(i) and $n\geqslant28$, the sum is $\fS+O(P^{-7\delta_1/6+\eps})$, and $7\delta_1/6>1/40$. \end{proof} \section{The nested \texorpdfstring{$\delta$}{delta}-symbol}\label{sec:delta} In this section we estimate $N_\delta$. Throughout, $n\geqslant28$. For $(q_1,t)\in\cR_\delta$ we put \[ \Theta=1+|t|,\qquad R=R(q_1,t)=\frac{P}{(q_1\Theta)^{1/2}}. \] Since $(q_1\Theta)^{n/8-2}\leqslant q_1^{n/8-2}\Theta^{n/8-1}P^{1/4}$. \subsection{The identity} \begin{lemma}\label{lem:nested} Let $(q_1,t)\in\cR_\delta$. Then \[ \sumstar_{a_1\bmod q_1}\cH\Bigl(\frac{a_1}{q_1}+\frac t{P^3}\Bigr)=\frac{c_R\,P^n}{R^2}\sum_{q_2\leqslant4R}\frac1{(q_1q_2)^n}\sum_{\bm\in\ZZ^n}S_{q_1,q_2}(\bm)\,I_{q_1,q_2}(t;\bm), \] where \[ I_{q_1,q_2}(t;\bm)=\int_{\RR^n}w(\bz)\,e\bigl(tC(\bz)\bigr)\,g_{q_2/R}\bigl(\Theta\,Q(\bz)\bigr)\,e\Bigl(-\frac{P\,\bm\cdot\bz}{q_1q_2}\Bigr)d\bz. \] \end{lemma} \begin{proof} Let $\bx\in\ZZ^n$ with $q_1\mid Q(\bx)$. Then $\delta(Q(\bx))=\delta(Q(\bx)/q_1)\,B(Q(\bx)/(q_1R^2))$, because both sides vanish unless $Q(\bx)=0$, and $B(0)=1$. We apply Lemma~\ref{lem:delta} with level $R$ to the integer $k=Q(\bx)/q_1$. If $B(k/R^2)\neq0$, then $|k|/R^2\leqslant2$, so that $h(q_2/R,k/R^2)$ vanishes unless $q_2\leqslant4R$. Since $q_1R^2\Theta=P^2$, we have $k/R^2=\Theta\,Q(\bx/P)$. Therefore \[ \cH(\alpha)=\frac{c_R}{R^2}\sum_{q_2\leqslant4R}\ \sumstar_{a_2\bmod q_2}\ \sum_{\substack{\bx\in\ZZ^n\\ q_1\mid Q(\bx)}}w(\bx/P)\,e\Bigl(\alpha C(\bx)+\frac{a_2Q(\bx)}{q_1q_2}\Bigr)g_{q_2/R}\bigl(\Theta Q(\bx/P)\bigr). \] Take $\alpha=a_1/q_1+tP^{-3}$ and sum over $a_1$. The function $\bx\mapsto e_{q_1q_2}(a_1q_2C(\bx)+a_2Q(\bx))\one[q_1\mid Q(\bx)]$ is periodic modulo $q_1q_2$. We split $\bx$ into residue classes $\bk$ modulo $q_1q_2$ and apply Poisson summation to the smooth function $\bx\mapsto w(\bx/P)e(tC(\bx/P))g_{q_2/R}(\Theta Q(\bx/P))$, whose Fourier transform at $\bm/(q_1q_2)$ is $P^nI_{q_1,q_2}(t;\bm)$. \end{proof} By Lemma~\ref{lem:identity}, Lemma~\ref{lem:nested} and the bounds $c_R\ll1$, $p_{r_1}(t)\ll1$, \begin{equation}\label{eq:Ndelta} N_\delta\ll P^{n-3}\sum_{q_1}\int_{(q_1,t)\in\cR_\delta}\frac1{R^2}\sum_{q_2\leqslant4R}\frac1{(q_1q_2)^n}\sum_{\bm\in\ZZ^n}|S_{q_1,q_2}(\bm)|\,|I_{q_1,q_2}(t;\bm)|\,dt. \end{equation} \subsection{The integrals} We write $r_2=q_2/R\leqslant4$ and $\bu=P\bm/(q_1q_2)$. By Lemma~\ref{lem:priii} and Fubini's theorem, \begin{equation}\label{eq:IJ} I_{q_1,q_2}(t;\bm)=\int_{\RR}\widehat g_{r_2}(\tau)\,J\bigl((t,\tau\Theta);\bu\bigr)\,d\tau,\qquad\|(t,\tau\Theta)\|=\Theta(1+|\tau|). \end{equation} In the next three lemmas $(q_1,t)\in\cR_\delta$, $q_2\leqslant4R$ and $\bm\in\ZZ^n$, and $K_0$, $c_1$, $c_2$ are the constants of Lemma~\ref{lem:Jv}. \begin{lemma}\label{lem:Ii} We have $I_{q_1,q_2}(t;\bzero)\ll_N\Theta^{-N}$. \end{lemma} \begin{proof} By Lemma~\ref{lem:Jiii}, $J((t,\tau\Theta);\bzero)\ll(\Theta(1+|\tau|))^{-N-2}$, and $\widehat g_{r_2}\ll1$. The lemma follows from~\eqref{eq:IJ}. \end{proof} \begin{lemma}\label{lem:Iii} If $\bm\neq\bzero$ and $|\bu|\geqslant P^\eps\Theta/r_2$, then $I_{q_1,q_2}(t;\bm)\ll_NP^{-N}|\bm|^{-N}$. \end{lemma} \begin{proof} Put $Y=r_2|\bu|/\Theta$, so that $Y\geqslant P^\eps$ by hypothesis. Since $\bu=P\bm/(q_1q_2)$ and $q_1R^2\Theta=P^2$, we have $Y=|\bm|(q_1\Theta)^{-1/2}\geqslant|\bm|/P$; moreover $|\bu|\geqslant Y/4$ and $r_2^{-1}\leqslant R\leqslant P$. For the $\tau$ with $c_4\Theta(1+|\tau|)\leqslant|\bu|$ we have $J((t,\tau\Theta);\bu)\ll_M|\bu|^{-M}$ by Lemma~\ref{lem:Jii}, and $\int_{\RR}|\widehat g_{r_2}(\tau)|\,d\tau\ll r_2^{-1}$. The remaining $\tau$ satisfy $|\tau|\geqslant|\bu|/(2c_4\Theta)$, and for them we use $\widehat g_{r_2}(\tau)\ll_M(r_2|\tau|)^{-M}$ and~\eqref{eq:Jtriv}. Thus, for every $M\geqslant2$, \[ I_{q_1,q_2}(t;\bm)\ll_Mr_2^{-1}\bigl(|\bu|^{-M}+Y^{1-M}\bigr)\ll_MP\,Y^{1-M}. \] Since $Y\geqslant\max\{P^\eps,|\bm|/P\}$, we have $Y^{1-M}\leqslant P^{-\eps(M-1-N)}(|\bm|/P)^{-N}$, and the claim follows on taking $M$ large enough in terms of $N$ and $\eps$. \end{proof} \begin{lemma}\label{lem:Iiii} If $\bm\neq\bzero$ and $|\bu|K_0$ the pair $\bgam=(t,\tau\Theta)$ satisfies $|\gamma_2|\geqslant K_0(1+|\gamma_3|)$, and we apply Lemma~\ref{lem:Jv}. The $\tau$ with $|\bu|c_2|\tau|\Theta$ contribute \[ \ll\int_{|\tau|>K_0}(|\tau|\Theta+|\bu|)^{-N-1}d\tau\ll\Theta^{-1}(\Theta+|\bu|)^{-N}\ll\Theta^{-N}\one\bigl[|\bu|\leqslant P^\eps\Theta\bigr]+P^{-\eps N}. \] The remaining $\tau$, with $|\tau|>K_0$ and $c_1|\tau|\Theta\leqslant|\bu|\leqslant c_2|\tau|\Theta$, exist only if $|\bu|\geqslant c_1K_0\Theta$. They form a set of measure $O(|\bu|/\Theta)$, on which $J((t,\tau\Theta);\bu)\ll P^{-N}+P^\eps|\bu|^{-n/2}$. Since $|\bu|\tfrac12P^{\delta_1}\ \ \text{or}\ \ T>\tfrac12P^{\delta_1}, \end{equation} the second statement because $\cR_\delta$ is disjoint from $\fM_1$. Put $R_0=P(Q_1T)^{-1/2}$, so that $R_0/21$ it is $O(\xi^{1-n/2})$, since $Q_2\geqslant1/2$. So the third term is \[ \ll P^{\frac n2-4+\eps}Q_1^{\frac n3+\frac43}T\cdot\frac{P}{TQ_1}\min\Bigl\{1,\Bigl(\frac{P}{TQ_1}\Bigr)^{\frac n2-2}\Bigr\}, \] which is the third term of the proposition. \end{proof} \begin{proposition}\label{prop:non} Let $Q_1,T$ satisfy~\eqref{eq:block}. Then $\cE_{\mathrm{non}}\ll P^\eps(\cE_\alpha+\cE_\beta)$, where \begin{align*} \cE_\alpha&=P^{\frac n2-\frac72}Q_1^{\frac{n+9}4}T^{\frac{n+7}4}+P^{\frac n2-3}Q_1^{\frac{n+7}4}T^{\frac{n+6}4}+P^{n-5}Q_1^{\frac73-\frac n6}T^{\frac52}\max\Bigl\{1,\frac{P}{T^{1/2}Q_1}\Bigr\}^{2-\frac n2},\\ \cE_\beta&=P^{n-6}\,T^3\sup_{Q_2}\Bigl\{Q_1^{4-\frac n2}Q_2^{3-\frac n2}+Q_1^{\frac{10}3-\frac n6}Q_2^{3-\frac n2}\Bigr\}, \end{align*} the supremum being over $Q_2\geqslant1/2$ with $Q_1Q_2T\geqslant P^{1-\eps}$. \end{proposition} \begin{proof} Fix $t$ and $\tau$ with $|\tau|\leqslant K_0$, and put $\bgam=(t,\tau\Theta)$ and $\rho=P^\eps\|\bgam\|^{1/2}$; then $T\leqslant\|\bgam\|\leqslant2(1+K_0)T$. By Lemma~\ref{lem:Jiv}, \begin{multline}\label{eq:measure} \sum_{q_1,q_2}\ \sum_{0<|\bm|\leqslant M_0}|S_{q_1,q_2}(\bm)|\,\bigl|J(\bgam;\bu)\bigr|\\ \ll P^{-N}+\int_{\cU}\ \sum_{q_1,q_2}\ \sum_{\bm\neq\bzero}|S_{q_1,q_2}(\bm)|\,\one\Bigl[\,\Bigl|\nabla f_{\bgam}(\bz)-\frac{P\bm}{q_1q_2}\Bigr|\leqslant\rho\Bigr]\,d\bz, \end{multline} where $q_1$ runs over $(Q_1,2Q_1]$, $q_2$ runs over $(Q_2,2Q_2]$, and where we have used~\eqref{eq:M0}. Fix $\bz\in\cU$ and $q_1$, and let $\bw=\nabla f_{\bgam}(\bz)$, so that $|\bw|\leqslant c_4\|\bgam\|$. The condition in~\eqref{eq:measure} says that $\bm$ lies within $\rho q_1q_2/P\leqslant V_1:=4\rho Q_1Q_2/P$ of the point $(q_1q_2/P)\bw$. As $q_2$ varies in $(Q_2,2Q_2]$, these points lie on a segment of length at most $\Lambda:=2c_4Q_1Q_2\|\bgam\|/P$. Let $V=\max\{1,V_1\}$. Choosing points on the segment at distance at most $V$ from each other, we see that all the $\bm$ in question, for all $q_2\in(Q_2,2Q_2]$, lie in the union of at most $\Lambda/V+2$ balls of radius $2V$, whose centres depend only on $\bz$ and $q_1$ (and on $\bgam$ and $Q_2$). Moreover, if there is such an $\bm\neq\bzero$, then $1\leqslant|\bm|\leqslant(4Q_1Q_2/P)(c_4\|\bgam\|+\rho)$, hence \begin{equation}\label{eq:exist} Q_1Q_2T\geqslant P^{1-2\eps}. \end{equation} The number of balls is \[ \ll1+\min\Bigl\{\Lambda,\frac{\Lambda}{V_1}\Bigr\}\ll1+\min\Bigl\{\frac{TQ_1Q_2}{P},\,T^{1/2}\Bigr\}. \] For each ball we apply Proposition~\ref{prop:mean}. Integrating over $\bz$, $\tau$ and $t$ we obtain \begin{multline*} \cE_{\mathrm{non}}\ll P^{n-5+\eps}Q_1T^2\sum_{Q_2}\Bigl(1+\min\Bigl\{\frac{TQ_1Q_2}{P},T^{\frac12}\Bigr\}\Bigr)Q_1^{2-\frac n2}Q_2^{\frac32-\frac n2}\\ \times\Bigl\{V^n\bigl(1+Q_2^{\frac12}V^{-\frac12}\bigr)+Q_1^{\frac n3-\frac23}Q_2^{\frac12}\Bigr\}, \end{multline*} where the sum is over the $Q_2\leqslant4R_0$ satisfying~\eqref{eq:exist}, and $V\asymp\max\{1,P^\eps T^{1/2}Q_1Q_2/P\}$. Consider first the $Q_2$ with $T^{1/2}Q_1Q_2>P$. Then the number of balls is $O(T^{1/2})$ and $1\leqslant V\ll P^\eps T^{1/2}Q_1Q_2/P$. The three terms in the braces contribute \[ P^{-5+\eps}Q_1^{3+\frac n2}T^{\frac52+\frac n2}Q_2^{\frac32+\frac n2},\qquad P^{-\frac92+\eps}Q_1^{\frac52+\frac n2}T^{\frac94+\frac n2}Q_2^{\frac32+\frac n2},\qquad P^{n-5+\eps}Q_1^{\frac73-\frac n6}T^{\frac52}Q_2^{2-\frac n2}. \] The first two are largest for $Q_2\asymp R_0=P(Q_1T)^{-1/2}$, the third for the smallest admissible $Q_2$, which is $\asymp\max\{1,P/(T^{1/2}Q_1)\}$. This gives $\cE_\alpha$. Consider now the $Q_2$ with $T^{1/2}Q_1Q_2\leqslant P$. Then $V\ll P^\eps$, and by~\eqref{eq:exist} the number of balls is $O(P^{2\eps}TQ_1Q_2/P)$. The contribution is \[ \ll P^{n-6+\eps}Q_1^{4-\frac n2}T^3Q_2^{\frac52-\frac n2}\bigl\{1+Q_2^{\frac12}+Q_1^{\frac n3-\frac23}Q_2^{\frac12}\bigr\}\ll P^\eps\cE_\beta. \] This completes the proof. \end{proof} \begin{proposition}\label{prop:tail} Let $Q_1,T$ satisfy~\eqref{eq:block}. If $T\geqslant P^{\eps}$, then $\cE_{\mathrm{tail}}\ll P^{-N}$. If $TP$ have $V\ll P^{2\eps}Q_1Q_2/P$, and the terms with $V^n$ contribute \[ \ll P^{-5+\eps}Q_1^{3+\frac n2}Q_2^{\frac32+\frac n2}\bigl(1+(P/Q_1)^{\frac12}\bigr)\ll P^{\eps}\bigl(P^{\frac n2-\frac72}Q_1^{\frac{n+9}4}+P^{\frac n2-3}Q_1^{\frac{n+7}4}\bigr). \] The $Q_2$ with $Q_1Q_2\leqslant P$ have $V\ll P^{2\eps}$, and the terms with $V^n$ contribute $O(P^{n-5+\eps}Q_1^{3-n/2})$. The last term in the braces contributes $O(P^{n-5+\eps}Q_1^{7/3-n/6})$. Since $3-n/2\leqslant7/3-n/6$, this proves the proposition. \end{proof} \subsection{The bookkeeping} The next five lemmas evaluate the bounds of Propositions~\ref{prop:res}, \ref{prop:non} and~\ref{prop:tail}, one term at a time. In all of them we suppose that \begin{equation}\label{eq:Z} n\geqslant28,\qquad0<\eta_0\leqslant\frac1{20},\qquad Q_1\geqslant\frac12,\qquad T\geqslant1,\qquad Z:=Q_1^{n/8-2}\,T^{n/8-1}P$, it equals $P^{n-5}Q_1^{7/3-n/6}T^{2-n/2}\leqslant P^{n-5}(Q_1T)^{7/3-n/6}P$. Since $Q_2\geqslant1/2$ and $Q_1>P/T$, we have $E\ll P^{n-6-\kappa}T^{3+\kappa}$. Moreover $Z>(P/T)^{n/8-2}T^{n/8-1}=P^{n/8-2}T$, so $T\tfrac12P^{\delta_1}$ by~\eqref{eq:block}, and $Q_1^{n/8-2}0$. \end{lemma} \begin{proof} Let $q=q'q''$ with $(q',q'')=1$. By the Chinese remainder theorem the map $\ba\mapsto(\ba',\ba'')$ with $\ba'=(q''^2a_3,q''a_2)$ modulo $q'$ and $\ba''=(q'^2a_3,q'a_2)$ modulo $q''$ is a bijection between the $\ba$ modulo $q$ with $\gcd(q,a_3,a_2)=1$ and the pairs $(\ba',\ba'')$ with $\gcd(q',a_3',a_2')=\gcd(q'',a_3'',a_2'')=1$. By~\eqref{eq:BDHBmult} with $\bm=\bzero$, $A(q)=A(q')A(q'')$. By Lemma~\ref{lem:SJ}(i), $\sum_q|A(q)|<\infty$. Hence $\fS=\prod_p\sigma_p$ with $\sigma_p=\sum_kA(p^k)$, and $\sum_p|\sigma_p-1|<\infty$. For $k\geqslant0$ we detect the two congruences by additive characters, and sort the pairs $\ba$ modulo $p^k$ according to the value $p^{k-j}$ of $\gcd(p^k,a_3,a_2)$: \begin{align*} \lambda(p^k)&=p^{-2k}\sum_{\ba\bmod p^k}\ \sum_{\bx\bmod p^k}e_{p^k}\bigl(a_3C(\bx)+a_2Q(\bx)\bigr)\\ &=p^{-2k}\sum_{j=0}^kp^{(k-j)n}\sum_{\substack{\ba\bmod p^j\\ \gcd(p^j,a_3,a_2)=1}}S(\ba,p^j;\bzero)=p^{k(n-2)}\sum_{j=0}^kA(p^j). \end{align*} This proves the formula for $\sigma_p$. Since $\sum_p|\sigma_p-1|<\infty$, it remains to show that $\sigma_p>0$ for every $p$. By Lemma~\ref{lem:local} and homogeneity there is a primitive vector $\bx_0\in\ZZ_p^n$ with $C(\bx_0)=Q(\bx_0)=0$. Since $X$ is non-singular, the vectors $\nabla C(\bx_0)$ and $\nabla Q(\bx_0)$ are linearly independent. So there are indices $i2\mu$, and let $\by\in\ZZ_p^n$ with $\by\equiv\bx_0\pmod{p^{2\mu+1}}$. Then $C(\by)\equiv Q(\by)\equiv0\pmod{p^{2\mu+1}}$ and $M(\by)$ has valuation $\mu$. By Hensel's lemma for two equations in the two unknowns $x_i$, $x_j$, there is $\bx\in\ZZ_p^n$ with $C(\bx)=Q(\bx)=0$ and $x_l=y_l$ for all $l\neq i,j$. The vectors $\by$ give $p^{(k-2\mu-1)(n-2)}$ different values of $(y_l)_{l\neq i,j}$ modulo $p^k$, and therefore at least as many solutions $\bx$ modulo $p^k$. So $\lambda(p^k)\geqslant p^{(k-2\mu-1)(n-2)}$ for all $k>2\mu$, and $\sigma_p\geqslant p^{-(2\mu+1)(n-2)}>0$. \end{proof} \subsection{Proof of Theorem~\ref{thm:asymp}} By~\eqref{eq:split}, \eqref{eq:Ninfty} and Propositions~\ref{prop:weyl}, \ref{prop:major} and~\ref{prop:delta}, with $\eta_0=1/43$, \[ N_w(P)=\fS\,\fJ\,P^{n-5}+O\bigl(P^{n-5-1/40}\bigr)+O\bigl(P^{n-5-1/43+\eps}\bigr). \] Here $\fJ>0$ by Lemma~\ref{lem:SJ}(ii) and $\fS>0$ by Lemma~\ref{lem:series}. This proves Theorem~\ref{thm:asymp} for $d_n\neq0$. \subsection{Proof of Theorem~\ref{thm:HP}} Let $X$ be as in Theorem~\ref{thm:HP}. If $X(\QQ)\neq\emptyset$ then $X(\RR)\neq\emptyset$. Conversely, suppose that $X(\RR)\neq\emptyset$. As explained in \S\ref{sec:prelim}, after a linear change of variables over $\QQ$ we may suppose that $X$ is given by forms $C$ and $Q$ as in~\eqref{eq:normal}. By Theorem~\ref{thm:asymp}, which has just been proved for $d_n\neq0$ and is proved in \S\ref{sec:sing} for $d_n=0$, we have $N_w(P)>0$ if $P$ is large. By (U1) the weight $w$ vanishes in a neighbourhood of the origin, so there is $\bx\in\ZZ^n\setminus\{\bzero\}$ with $C(\bx)=Q(\bx)=0$. Hence $X(\QQ)\neq\emptyset$. \section{Quadratic forms of rank \texorpdfstring{$n-1$}{n-1}}\label{sec:sing} In this section we prove Theorem~\ref{thm:asymp}, and with it Theorem~\ref{thm:HP}, in the case that $d_n=0$. Thus \[ Q(\bx)=\sum_{i=1}^{n-1}d_ix_i^2,\qquad d_1\cdots d_{n-1}\neq0, \] and the variable $x_n$ does not occur in $Q$. We write $\bx=(\bx',x_n)$ with $\bx'=(x_1,\dots,x_{n-1})$, and similarly for other vectors. In this section $D=d_1\cdots d_{n-1}$ and $\Delta=2D$, and $q^\flat$, $q^\sharp$, $\cf(q)$ and $\kappa(q)$ are defined as in \S1 with this $\Delta$. The parameters $\eta_0$, $\delta_1$, $\delta_2$ and the four sets of pairs $(q_1,t)$ are those of \S\ref{sec:dissection}, and $n\geqslant28$. Several results of the preceding sections do not involve the coefficient $d_n$, and remain valid with the same proofs. These are Lemmas~\ref{lem:delta}--\ref{lem:ibp}, the bound~\eqref{eq:Jtriv} and Lemmas~\ref{lem:Jii}, \ref{lem:Jiii} and~\ref{lem:Jiv}; the relation~\eqref{eq:BDHBmult}, Lemmas~\ref{lem:BDHBii}--\ref{lem:BDHBiv}, Corollary~\ref{cor:BDHB} and Lemmas~\ref{lem:multi} and~\ref{lem:multii}, where we note that the results of~\cite{BDHB} quoted in~\eqref{eq:BDHBmult} and Lemmas~\ref{lem:BDHBii}--\ref{lem:BDHBiv} are stated for $d_1\cdots d_{n-1}\neq0$; all of \S\ref{sec:dissection}; Lemma~\ref{lem:SJ}; and Lemma~\ref{lem:nested}. We shall use them freely. What has to be replaced is Lemma~\ref{lem:Jv}, the estimates for the sums $S_{q_1,q_2}(\bm)$ in Lemmas~\ref{lem:gauss}--\ref{lem:rest2} and Proposition~\ref{prop:mean}, and those parts of \S\S\ref{sec:major}--\ref{sec:proofs} that depend on them. \subsection{The weight function and the integrals} Let $\mathbf e_n=(0,\dots,0,1)$. Then $Q(\mathbf e_n)=0$ and $\nabla Q(\mathbf e_n)=\bzero$. If $C(\mathbf e_n)$ were zero, then $\mathbf e_n$ would define a singular point of $X$. Hence $C(\mathbf e_n)\neq0$. In particular a real zero $\bz_0$ of $C$ and $Q$ is not a multiple of $\mathbf e_n$, that is, $\bz_0'\neq\bzero$. In the construction of \S\ref{ss:weight} we choose $\rho_0$ so small that, in addition to (U1)--(U3), we have $|\bz'|\geqslant|\bz_0'|/2$ for $\bz\in\cU$. Then there are constants $0<\kappa_1\leqslant\kappa_2$ with $\kappa_1\leqslant|(d_iz_i)_{ic_2|\gamma_2|$, then $J(\bgam;\bu)\ll_N(|\gamma_2|+|\bu|)^{-N}$. For all $\bu$ and every $P\geqslant1$, \[ J(\bgam;\bu)\ll_{N,\eps}P^{-N}+P^{\eps}|\gamma_2|^{-(n-1)/2}. \] \end{lemma} \begin{proof} We have $\nabla f_{\bgam}(\bz)=2\gamma_2(d_1z_1,\dots,d_{n-1}z_{n-1},0)+\gamma_3\nabla C(\bz)$. If $K_0$ is large enough, then $\kappa_1|\gamma_2|\leqslant|\nabla f_{\bgam}(\bz)|\leqslant3\kappa_2|\gamma_2|$ for $\bz\in\cU$, and the first assertion follows as in the proof of Lemma~\ref{lem:Jv}, with $c_1=\kappa_1/2$ and $c_2=6\kappa_2$. Moreover, if $\bz,\bw\in\cU$ have the same last coordinate, then the first $n-1$ coordinates of $\nabla f_{\bgam}(\bz)-\nabla f_{\bgam}(\bw)$ form a vector of norm at least $|\gamma_2|\,|\bz-\bw|$, because $|d_i|\geqslant1$ for $iV$, then $U=V$ and it is $O(q^{n/2+\eps}q^{n/3})$. \end{proof} In the next two lemmas $q_1,\varrho_2\in\NN$ are such that every prime factor of $\varrho_2$ divides $q_1$. Let $\mathcal A$ be the set of primes $p\mid q_1$ with $v_p(\varrho_2)\geqslant1+\nu_p$, and put \begin{equation}\label{eq:w0w2} w_0=\prod_{p\in\mathcal A}p^{v_p(q_1\varrho_2)},\qquad w_2=\prod_{\substack{p\notin\mathcal A\\ v_p(q_1\varrho_2)\geqslant3}}p^{v_p(q_1\varrho_2)}. \end{equation} \begin{lemma}\label{lem:rhoi} For all $\bm_0'\in\RR^{n-1}$, $m_n\in\ZZ$ and $V\geqslant1$, \[ \sum_{|\bm'-\bm_0'|\leqslant V}|S_{q_1,\varrho_2}(\bm',m_n)|\ll(q_1\varrho_2)^{n/2+1+\eps}\,w_0^{1/2}\bigl(V^{n-1}w_2^{1/3}+w_2^{n/3}\bigr). \] \end{lemma} \begin{proof} Put $q=q_1\varrho_2$. By Lemma~\ref{lem:multii}, $|S_{q_1,\varrho_2}(\bm)|\leqslant q_1^{-1}\sum_{b,a_1,a_2}|S(\ba,q;\bm)|$ with $\ba=(a_1\varrho_2,a_2+b\varrho_2)$ and $\gcd(q,a_1\varrho_2,a_2+b\varrho_2)=1$, and there are at most $q_1^2\varrho_2$ triples $(b,a_1,a_2)$. Since $(a_1,q_1)=1$ and every prime factor of $q$ divides $q_1$, we have $v_p(a_1\varrho_2)=v_p(\varrho_2)$ for $p\mid q$. So in the factorisation $q=q^{(0)}q^{(1)}q^{(2)}$ attached to $\ba$ we have $q^{(0)}=w_0$ and $q^{(2)}=w_2$, for all triples. The claim follows from Lemma~\ref{lem:slab}. \end{proof} \begin{lemma}\label{lem:rhoii} Let $q_1\in\NN$, and let $w_0$ and $w_2$ be defined by~\eqref{eq:w0w2}. Then, the sums being over all $\varrho_2$ whose prime factors divide $q_1$, \[ \sum_{\varrho_2}\varrho_2^{-3/2}w_0^{1/2}w_2^{1/3}\ll q_1^\eps\,\kappa(q_1)^{1/2},\qquad\sum_{\varrho_2}\varrho_2^{-3/2}w_0^{1/2}w_2^{n/3}\ll q_1^\eps\,\kappa(q_1)^{n/3}. \] \end{lemma} \begin{proof} Each of the two sums is a product over the primes $p\mid q_1$ of sums of local factors. Let $r=v_p(q_1)\geqslant1$ and $s=v_p(\varrho_2)\geqslant0$, and let $j=1/3$ or $j=n/3$. If $s\geqslant1+\nu_p$, the local factor is $p^{-3s/2}p^{(r+s)/2}=p^{r/2-s}$. If $s\leqslant\nu_p$, it is $p^{-3s/2}p^{(r+s)j}$ if $r+s\geqslant3$, and $p^{-3s/2}$ otherwise. Suppose first that $p\nmid\Delta$ and $r\leqslant2$. Then $\nu_p=0$, the factor for $s=0$ is $1$, and the sum of the local factors over $s\geqslant0$ is at most $1+\sum_{s\geqslant1}p^{1-s}\leqslant3$. In the remaining case $p^r$ is the exact power of $p$ dividing $\kappa(q_1)$, and the sum over $s$ is at most \[ (\nu_p+1)\,p^{\nu_pj}\,p^{rj}+\sum_{s>\nu_p}p^{r/2-s}\leqslant c_p\,p^{r\max\{j,1/2\}}, \] where $c_p=3$ for $p\nmid\Delta$, and $c_p$ depends only on $p$ and $n$ for $p\mid\Delta$. Since $3^{\omega(q_1)}\ll q_1^\eps$, this proves the lemma. \end{proof} \begin{proposition}\label{prop:meansing} Let $Q_1,Q_2\geqslant1/2$ and $V\geqslant1$, and for all $q_1,q_2$ let $\bm_0(q_1,q_2)\in\RR^n$. Then \begin{multline*} \sum_{Q_1P^{2\delta_1}$, we use Lemma~\ref{lem:Jsing}. The number of the $\bm$ that are not negligible is $O((|t_2|/L)^n)$, and each of them contributes $O(P^{-N}+P^\eps|t_2|^{-(n-1)/2})$. So the left-hand side is $O(1+P^\eps q_1^{2n}(q_2|t_2|)^{(n+1)/2})=O(P^{(n+1)/2+2n\delta_1+\eps})$. If $q>P^{1-3\delta_1}$, the sum over $\bm$ is $O(P^{5n\delta_1})$ as before, and the left-hand side is \[ \ll P^nq_1^nq_2^{(1-n)/2}P^{5n\delta_1}\ll P^{n+6n\delta_1-(n-1)(1-4\delta_1)/2}\ll P^{(n+1)/2+8n\delta_1}. \] In the proof of Proposition~\ref{prop:major} the arcs with $q_2>P^{\delta_2}$ now contribute \[ \ll P^{n-2}q_1^n\sum_{q_2>P^{\delta_2}}q_2^{(3-n)/2}\ll P^{n-2+n\delta_1-(n-5)\delta_2/2}, \] and the error terms contribute \[ \ll P^{3\delta_1-3}\bigl(P^{n-2+n\delta_1-(n-5)\delta_2/2}+P^{(n+1)/2+8n\delta_1}\bigr)=P^{n-5-(n-13)/40}+P^{n-5-(12n-103)/40}, \] which is $O(P^{n-5-3/8})$ for $n\geqslant28$. The rest of the proof is unchanged; in particular the sum over the quadruples is $\fS+O(P^{-7\delta_1/6+\eps})$ by Lemma~\ref{lem:SJ}(i). \end{proof} \subsection{The nested \texorpdfstring{$\delta$}{delta}-symbol} Lemma~\ref{lem:nested} and the bound~\eqref{eq:Ndelta} hold as before. We define the blocks $\mathcal B(Q_1,T)$ and the quantities $\cE_{\mathrm{res}}$, $\cE_{\mathrm{non}}$ and $\cE_{\mathrm{tail}}$ as in \S\ref{sec:delta}, except that $|\bu|^{1-n/2}$ is replaced by $|\bu|^{3/2-n/2}$ in the definition of $\cE_{\mathrm{res}}$. By the remark following Lemma~\ref{lem:Jsing}, the contribution of $\mathcal B(Q_1,T)$ to the right-hand side of~\eqref{eq:Ndelta} is again $O(\cE_{\mathrm{res}}+\cE_{\mathrm{non}}+\cE_{\mathrm{tail}}+P^{-N})$. The next three propositions correspond to Propositions~\ref{prop:res}, \ref{prop:non} and~\ref{prop:tail}. In their proofs Proposition~\ref{prop:meansing} takes the place of Proposition~\ref{prop:mean}, and we use the notation and the conventions introduced before Proposition~\ref{prop:res}. \begin{proposition}\label{prop:ressing} Let $Q_1,T$ satisfy~\eqref{eq:block}. Then \[ \cE_{\mathrm{res}}\ll P^{\eps}\Bigl\{P^{\frac n2-\frac72}Q_1^{\frac{n+9}4}T^{\frac{n+7}4}+P^{\frac n2-\frac52}(Q_1T)^{\frac{n+5}4}+P^{\frac{5n}6-\frac83}\Bigr\}. \] \end{proposition} \begin{proof} We proceed as in the proof of Proposition~\ref{prop:res}. With the shells $M'<|\bm|\leqslant2M'$ as before, we have $|\bu|^{3/2-n/2}\ll(PM'/(Q_1Q_2))^{3/2-n/2}$ on a shell, and Proposition~\ref{prop:meansing} with $V=2M'$ gives \begin{align*} \cE_{\mathrm{res}}&\ll P^{n-3+\eps}\cdot\frac{Q_1T}{P^2}\sum_{Q_2,M'}\frac{(Q_1Q_2)^{\frac n2}Q_1^2Q_2^{\frac32}}{(Q_1Q_2)^n}\Bigl(\frac{PM'}{Q_1Q_2}\Bigr)^{\frac32-\frac n2}\\ &\hspace{12em}\times(Q_2+M')\bigl\{M'^{n-1}+Q_1^{\frac n3-\frac23}\bigr\}\\ &=P^{\frac n2-\frac72+\eps}Q_1T\sum_{Q_2,M'}\Bigl\{Q_1^{\frac12}M'^{\frac n2+\frac32}+Q_1^{\frac12}Q_2M'^{\frac n2+\frac12}\\ &\hspace{12em}+Q_1^{\frac n3-\frac16}Q_2M'^{\frac32-\frac n2}+Q_1^{\frac n3-\frac16}M'^{\frac52-\frac n2}\Bigr\}. \end{align*} The first two terms are largest for $M'\asymp M_0$ and $Q_2\asymp R_0$, and give \[ P^{\frac n2-\frac72+\eps}Q_1^{\frac{n+9}4}T^{\frac{n+7}4}\qquad\text{and}\qquad P^{\frac n2-\frac52+\eps}Q_1^{\frac{n+5}4}T^{\frac{n+3}4}. \] In the last two terms let $\xi=TQ_1/P$, and recall~\eqref{eq:Mrange}. If $\xi\leqslant1$, the sum of $Q_2M'^{3/2-n/2}$ over $Q_2$ and $M'$ is $O(\xi^{-1})$, and the sum of $M'^{5/2-n/2}$ is $O(P^\eps)$. The two terms then contribute $O(P^{n/2-5/2+\eps}Q_1^{n/3-1/6})$, which is $O(P^{5n/6-8/3+\eps})$ since $Q_1\leqslant P$. If $\xi>1$, the two sums are $O(\xi^{3/2-n/2})$ and $O(\xi^{5/2-n/2})$, and the two terms contribute \[ \ll P^{\frac n2-\frac72+\eps}Q_1^{\frac n3+\frac56}T\Bigl(\frac P{TQ_1}\Bigr)^{\frac n2-\frac52}=P^{n-6+\eps}Q_1^{\frac{10}3-\frac n6}T^{\frac72-\frac n2}\leqslant P^{n-6+\eps}(Q_1T)^{\frac{10}3-\frac n6}P$, for which $V\ll P^\eps T^{1/2}Q_1Q_2/P$. The terms $V^n$, $Q_2V^{n-1}$, $Q_2Q_1^{n/3-2/3}$ and $VQ_1^{n/3-2/3}$ contribute \begin{gather*} P^{-5+\eps}Q_1^{3+\frac n2}T^{\frac52+\frac n2}Q_2^{\frac32+\frac n2},\qquad P^{-4+\eps}Q_1^{2+\frac n2}T^{2+\frac n2}Q_2^{\frac32+\frac n2},\\ P^{n-5+\eps}Q_1^{\frac73-\frac n6}T^{\frac52}Q_2^{\frac52-\frac n2},\qquad P^{n-6+\eps}Q_1^{\frac{10}3-\frac n6}T^{3}Q_2^{\frac52-\frac n2}. \end{gather*} The first two are largest for $Q_2\asymp R_0$, where they are the first two terms of $\cE_\alpha'$. The last two are largest for the smallest admissible $Q_2$, which is $\asymp\max\{1,P/(T^{1/2}Q_1)\}$; their sum is then $O(P^\eps\mathcal D)$. For the $Q_2$ with $T^{1/2}Q_1Q_2\leqslant P$ we have $V\ll P^\eps$, the number of balls is $O(P^{2\eps}TQ_1Q_2/P)$, and the contribution is \[ \ll P^{n-6+\eps}Q_1^{4-\frac n2}T^3Q_2^{\frac52-\frac n2}\bigl\{Q_2+Q_2Q_1^{\frac n3-\frac23}\bigr\}\ll P^\eps\cE_\beta'. \] This completes the proof. \end{proof} \begin{proposition}\label{prop:tailsing} Let $Q_1,T$ satisfy~\eqref{eq:block}. If $T\geqslant P^{\eps}$, then $\cE_{\mathrm{tail}}\ll P^{-N}$. If $TP$ the terms $V^n$ and $Q_2V^{n-1}$ contribute \[ O\bigl(P^{-5+\eps}Q_1^{3+n/2}Q_2^{3/2+n/2}\bigr)\qquad\text{and}\qquad O\bigl(P^{-4+\eps}Q_1^{2+n/2}Q_2^{3/2+n/2}\bigr); \] with $Q_2\ll PQ_1^{-1/2}$ these are the first two terms of the proposition. For the $Q_2$ with $Q_1Q_2\leqslant P$ the same terms contribute $O(P^{n-5+\eps}Q_1^{3-n/2})$, which is $O(P^{n-5+\eps}Q_1^{7/3-n/6})$. The terms with $Q_1^{n/3-2/3}$ contribute \[ \ll P^{n-5+\eps}Q_1^{\frac73-\frac n6}\sum_{Q_2}Q_2^{\frac32-\frac n2}(Q_2+V)\ll P^{n-5+\eps}Q_1^{\frac73-\frac n6}\Bigl(1+\frac{Q_1}P\Bigr), \] and $P^{n-6}Q_1^{10/3-n/6}\leqslant P^{5n/6-8/3}$ if $Q_1>P$. \end{proof} The next three lemmas take the place of Lemmas~\ref{lem:LPb}, \ref{lem:LPd} and~\ref{lem:LPe}. In their proofs we use the notation of the proofs of Lemmas~\ref{lem:LPa}--\ref{lem:LPe}. \begin{lemma}\label{lem:LPsinga} Suppose that~\eqref{eq:Z} holds. Then \[ P^{\frac n2-\frac52}(Q_1T)^{\frac{n+5}4}\ll P^{n-5-1/2+(11/2)\eta_0}. \] \end{lemma} \begin{proof} Let $\lambda''=2(n+5)/(n-16)=2+42/(n-16)$. In $Z^{\lambda''}$ the exponent of $Q_1$ is $(n+5)/4$ and the exponent of $T$ is $(n+5)(n-8)/(4(n-16))\geqslant(n+5)/4$. Hence $(Q_1T)^{(n+5)/4}\leqslant Z^{\lambda''}P$, then $E'\ll P^{n-6-\kappa}T^{3+\kappa}$, and the argument given there applies. Suppose that $Q_1T\leqslant P$. Since $Q_2\geqslant P^{1-\eps}/(Q_1T)$, we have $E'\leqslant P^{n/2-5/2+n\eps}\,T^{(n-1)/2}Q_1^{n/3-1/6}$. If $n\leqslant32$, then with $\lambda_1$ and $\lambda_2$ as there we have $\lambda_1\geqslant1$ and \[ T^{(n-1)/2}Q_1^{n/3-1/6}=(Q_1T)^{\lambda_1-1/2}Z^{\lambda_2}\leqslant P^{\lambda_1-1/2+\lambda_2(2+\eta_0)}, \] so that the exponent obtained is again $n-5+G(n)+(n-2)\eta_0/6+n\eps$. If $n\geqslant33$, then $T^{(n-1)/2}Q_1^{n/3-1/6}\ll Z^{4(n-1)/(n-8)}$, because $(n-1)(n-16)/(2(n-8))\geqslant n/3-1/6$ for these $n$, and the exponent obtained is $n/2-5/2+n\eps+(4(n-1)/(n-8))(2+\eta_0)\tfrac12P^{\delta_1}$, the first two terms of Proposition~\ref{prop:tailsing} are bounded by Lemmas~\ref{lem:LPa} and~\ref{lem:LPsinga} with $T=1$, and the third is $O(P^{n-5-7/120})$. \end{proof} \subsection{Proof of Theorems~\ref{thm:HP} and~\ref{thm:asymp} for \texorpdfstring{$d_n=0$}{d\_n=0}} \begin{lemma}\label{lem:localsing} For every prime $p$ there is $\bx\in\QQ_p^n\setminus\{\bzero\}$ with $C(\bx)=Q(\bx)=0$. \end{lemma} \begin{proof} The form $Q$ is a non-degenerate quadratic form in the $n-1\geqslant27$ variables $x_1,\dots,x_{n-1}$. As in the proof of Lemma~\ref{lem:local}, it is equivalent over $\QQ_p$ to the orthogonal sum of at least twelve hyperbolic planes and a form in at most four variables. So $Q$ vanishes on a linear subspace of $\QQ_p^n$ of dimension $12$, and the theorem of Lewis applies to the restriction of $C$ to this subspace. \end{proof} The proof of Lemma~\ref{lem:series} uses the forms $C$ and $Q$ only through~\eqref{eq:BDHBmult}, Lemma~\ref{lem:SJ}(i), the existence of a non-trivial zero in $\QQ_p^n$ and the non-singularity of $X$. With Lemma~\ref{lem:localsing} in place of Lemma~\ref{lem:local}, it shows that $\fS=\prod_p\sigma_p$ and $\fS>0$ in the present case as well. By~\eqref{eq:split}, \eqref{eq:Ninfty}, Proposition~\ref{prop:weyl}, Lemma~\ref{lem:majorsing} and Proposition~\ref{prop:deltasing}, \[ N_w(P)=\fS\,\fJ\,P^{n-5}+O\bigl(P^{n-5-1/43+\eps}\bigr), \] and $\fJ>0$ by Lemma~\ref{lem:SJ}(ii). This proves Theorem~\ref{thm:asymp} for $d_n=0$. Theorem~\ref{thm:HP} follows as in \S\ref{sec:proofs}. \begin{remark} We have checked the bounds of Propositions~\ref{prop:ressing}, \ref{prop:nonsing} and~\ref{prop:tailsing}, with $\eta_0=1/43$, by solving the corresponding linear programmes in exact arithmetic for $28\leqslant n\leqslant200$; again this is a check only, and it is not used in the proofs. The smallest saving is again $1/43$, for $n=28$, and it comes from the first term of $\cE_{\mathrm{res}}$ and $\cE_\alpha'$, which is the same as in the case of rank $n$. \end{remark} \section{Weak approximation}\label{sec:WA} In this section we prove Theorem~\ref{thm:WA}. We keep the assumptions of Theorem~\ref{thm:asymp}: $n\geqslant28$, the forms $C$ and $Q$ are as in~\eqref{eq:normal}, $X$ is non-singular and $X(\RR)\neq\emptyset$. Both cases $d_n\neq0$ and $d_n=0$ are allowed; we give the argument for $d_n\neq0$, and indicate at the appropriate places what changes for $d_n=0$. The weight $w$ is as in \S\ref{ss:weight} (with the additional condition of \S\ref{sec:sing} if $d_n=0$). We recall that the point $\bz_0$ in its construction may be any real point with $0<|\bz_0|\leqslant1/4$ and $C(\bz_0)=Q(\bz_0)=0$, since every point of $X(\RR)$ is non-singular, and that $\rho_0$ may be replaced by any smaller positive number, since (U1)--(U3) remain valid for a smaller ball. We fix $H\in\NN$. In this section the implied constants are allowed to depend on $H$, and $P$ is assumed to be sufficiently large in terms of $H$. \subsection{The asymptotic formula with a congruence condition} For $\bb\in\ZZ^n$ let \[ N_w(P;\bb,H)=\sum_{\substack{\bx\in\ZZ^n,\ \bx\equiv\bb\bmod H\\ C(\bx)=Q(\bx)=0}}w(\bx/P). \] For a prime $p$ put $h_p=v_p(H)$, and for $k\geqslant h_p$ let \[ \lambda_{\bb}(p^k)=\#\bigl\{\bx\bmod p^k:\ \bx\equiv\bb\pmod{p^{h_p}},\ C(\bx)\equiv Q(\bx)\equiv0\pmod{p^k}\bigr\}. \] If $p\nmid H$ this is the number $\lambda(p^k)$ of \S\ref{sec:proofs}. \begin{theorem}\label{thm:cong} Let $\bb\in\ZZ^n$. The limits $\sigma_p(\bb)=\lim_{k\to\infty}p^{-k(n-2)}\lambda_{\bb}(p^k)$ exist, the product $\fS(\bb)=\prod_p\sigma_p(\bb)$ converges absolutely, and for every $\eps>0$ \[ N_w(P;\bb,H)=\fS(\bb)\,\fJ\,P^{n-5}+O_\eps\bigl(P^{n-5-1/43+\eps}\bigr). \] Suppose that for every prime $p\mid H$ there is $\by\in\ZZ_p^n\setminus\{\bzero\}$ with $\by\equiv\bb\pmod{p^{h_p}}$ and $C(\by)=Q(\by)=0$. Then $\fS(\bb)>0$. \end{theorem} \subsection{Additive characters} For $\bth\in\RR^n$ we recall the sum $S(\alpha,\beta;\bth)$ of \S\ref{sec:dissection}, and we define \begin{align*} \cH(\alpha;\bth)&=\sum_{\substack{\bx\in\ZZ^n\\ Q(\bx)=0}}w(\bx/P)\,e\bigl(\alpha C(\bx)+\bth\cdot\bx\bigr)=\int_0^1S(\alpha,\beta;\bth)\,d\beta,\\ N_w(P;\bth)&=\sum_{\substack{\bx\in\ZZ^n\\ C(\bx)=Q(\bx)=0}}w(\bx/P)\,e(\bth\cdot\bx). \end{align*} By the orthogonality of the additive characters modulo $H$, \begin{equation}\label{eq:orth} N_w(P;\bb,H)=\frac1{H^n}\sum_{\bc\bmod H}e_H(-\bb\cdot\bc)\,N_w(P;\bc/H). \end{equation} From now on we fix $\bth=\bc/H$ with $\bc\in\ZZ^n$. We have $N_w(P;\bth)=\sum_{Q(\bx)=0}w(\bx/P)e(\bth\cdot\bx)\delta(C(\bx))$, and the proof of Lemma~\ref{lem:identity} gives the formula of that lemma with $N_w(P;\bth)$ and $\cH(\alpha;\bth)$ in place of $N_w(P)$ and $\cH(\alpha)$. With the four sets of \S\ref{sec:dissection} we write, as in~\eqref{eq:split}, \[ N_w(P;\bth)=N_\infty(\bth)+N_{\fM}(\bth)+N_W(\bth)+N_\delta(\bth). \] Since $|\cH(\alpha;\bth)|\leqslant\sum_{\bx}w(\bx/P)$, the bound~\eqref{eq:Ninfty} holds for $N_\infty(\bth)$. \subsection{The Weyl region} \begin{lemma}\label{lem:weylth} We have $N_W(\bth)\ll P^{n-5-\eta_0+\eps}$. \end{lemma} \begin{proof} Lemma~\ref{lem:weyl} holds uniformly in $\bth\in\RR^n$, and $|\cH(\alpha;\bth)|\leqslant\sup_\beta|S(\alpha,\beta;\bth)|$. The proof of Proposition~\ref{prop:weyl} therefore applies without change. \end{proof} \subsection{The major arcs} For $q\in\NN$ put \[ A(q;\bth)=\one[q\bth\in\ZZ^n]\ q^{-n}\sum_{\substack{\ba\bmod q\\ \gcd(q,a_3,a_2)=1}}S(\ba,q;q\bth),\qquad\fS(\bth)=\sum_{q=1}^\infty A(q;\bth). \] By Corollary~\ref{cor:BDHB} with $\bm_0=\bm$ and $V=1$, the bound for $S(\ba,q;\bzero)$ that is used in the proof of Lemma~\ref{lem:SJ}(i) holds for $S(\ba,q;\bm)$, uniformly in $\bm\in\ZZ^n$. That proof therefore gives, for $Y\geqslant1$, \begin{equation}\label{eq:tailth} \sum_{q>Y}q^{-n}\sum_{\substack{\ba\bmod q\\ \gcd(q,a_3,a_2)=1}}\ \max_{\bm\in\ZZ^n}|S(\ba,q;\bm)|\ll Y^{7/6-n/12+\eps}. \end{equation} In particular the series $\fS(\bth)$ converges absolutely. \begin{lemma}\label{lem:majorth} We have $N_{\fM}(\bth)=\fS(\bth)\,\fJ\,P^{n-5}+O(P^{n-5-1/40})$. \end{lemma} \begin{proof} We go through the proofs of Lemma~\ref{lem:majorS} and Proposition~\ref{prop:major}. With the notation used there, Poisson summation is now applied to a function that carries the additional factor $e(\bth\cdot\bx)$, and gives \[ S(\alpha,\beta;\bth)=L^n\sum_{\bm\in\ZZ^n}\fS(\bm)\,J\bigl(\bgam;L(\bm-q\bth)\bigr), \] with the same sums $\fS(\bm)$, for which $\fS(\bm)\ll q_1^{2n}q_2^{n/2}$. A term with $\bm=q\bth$ occurs only if $q\bth\in\ZZ^n$. For all other $\bm$ we have $|\bm-q\bth|\geqslant1/H$, because $H(\bm-q\bth)$ is a non-zero integer vector. The proof of~\eqref{eq:majerr} uses the vectors $L\bm$ with $\bm\neq\bzero$ only through the bound $|\bm|\geqslant1$ and through the number of $\bm$ with $|L\bm|$ in a given range. It therefore applies to the vectors $L(\bm-q\bth)$ with $\bm\neq q\bth$, if $P$ is large enough in terms of $H$. Hence the formula of Lemma~\ref{lem:majorS} holds for $S(\alpha,\beta;\bth)$, with $S^*(a_1,q_1;a_2,q_2)$ replaced by \begin{gather*} S^*(a_1,q_1;a_2,q_2;\bth)=\one[q_1q_2\bth\in\ZZ^n]\sum_{\bk\bmod q_1q_2}\psi(\bk),\\ \psi(\bk)=e\Bigl(\frac{a_1C(\bk)}{q_1}+\frac{a_2Q(\bk)}{q_2}+\bth\cdot\bk\Bigr), \end{gather*} which is again $O(q_1^{2n}q_2^{n/2})$. The proof of Proposition~\ref{prop:major} now shows that \begin{multline*} N_{\fM}(\bth)=P^{n-5}\bigl(\fJ+O(P^{-N})\bigr)\sum_{q_1\leqslant P^{\delta_1}}\ \sum_{q_2\leqslant P^{\delta_2}}\ \sumstar_{a_1\bmod q_1}\ \sumstar_{a_2\bmod q_2}\frac{S^*(a_1,q_1;a_2,q_2;\bth)}{(q_1q_2)^n}\\ +O\bigl(P^{n-5-17/40}\bigr). \end{multline*} Let $(q,\ba)$ correspond to $(q_1,a_1,q_2,a_2)$ as in that proof, so that $q=\operatorname{lcm}(q_1,q_2)$. The function $\psi$ on $\ZZ^n$ satisfies $\psi(\bk+q\mathbf j)=\psi(\bk)e(q\bth\cdot\mathbf j)$ for $\mathbf j\in\ZZ^n$. Suppose that $q_1q_2\bth\in\ZZ^n$. Then $q_1q_2$ is a period of $\psi$, and $(q_1q_2)^{-n}\sum_{\bk\bmod q_1q_2}\psi(\bk)$ is the mean value of $\psi$. If $q\bth\in\ZZ^n$, this mean value is $q^{-n}S(\ba,q;q\bth)$. If $q\bth\notin\ZZ^n$, it vanishes, because $\mathbf j\mapsto e(q\bth\cdot\mathbf j)$ is then a non-trivial character of $(\ZZ/(q_1q_2/q)\ZZ)^n$. Since $q\bth\in\ZZ^n$ implies $q_1q_2\bth\in\ZZ^n$, we conclude that in all cases \[ \frac{S^*(a_1,q_1;a_2,q_2;\bth)}{(q_1q_2)^n}=\one[q\bth\in\ZZ^n]\ q^{-n}S(\ba,q;q\bth). \] The quadruples that are missing from the sum have $q>P^{\delta_1}$. By~\eqref{eq:tailth} the sum is $\fS(\bth)+O(P^{-7\delta_1/6+\eps})$, and the lemma follows. If $d_n=0$, the same argument applies to the proof of Lemma~\ref{lem:majorsing}, with the bounds $O(q_1^{2n}q_2^{(n+1)/2})$ for $\fS(\bm)$ and for $S^*(a_1,q_1;a_2,q_2;\bth)$, and with the error term $O(P^{n-5-3/8})$ in the last display but one. \end{proof} \subsection{The nested \texorpdfstring{$\delta$}{delta}-symbol} For $\bv\in\RR^n$ we define $I_{q_1,q_2}(t;\bv)$ by the formula of Lemma~\ref{lem:nested}, with $\bv$ in place of $\bm$. \begin{lemma}\label{lem:nestedth} Let $(q_1,t)\in\cR_\delta$. Then \[ \sumstar_{a_1\bmod q_1}\cH\Bigl(\frac{a_1}{q_1}+\frac t{P^3};\bth\Bigr)=\frac{c_R\,P^n}{R^2}\sum_{q_2\leqslant4R}\frac1{(q_1q_2)^n}\sum_{\bm\in\ZZ^n}S_{q_1,q_2}(\bm)\,I_{q_1,q_2}(t;\bm-q_1q_2\bth). \] Moreover, Lemmas~\ref{lem:Ii}, \ref{lem:Iii} and~\ref{lem:Iiii} hold for $I_{q_1,q_2}(t;\bv)$ with any $\bv\in\RR^n$ in place of $\bm$, where now $\bu=P\bv/(q_1q_2)$. \end{lemma} \begin{proof} The proof of Lemma~\ref{lem:nested} applies, with the factor $e(\bth\cdot\bx)$ attached to the smooth function. The Fourier transform of $\bx\mapsto w(\bx/P)e(tC(\bx/P))g_{q_2/R}(\Theta Q(\bx/P))e(\bth\cdot\bx)$ at $\bm/(q_1q_2)$ is $P^nI_{q_1,q_2}(t;\bm-q_1q_2\bth)$, and the complete sums are not affected. In the proofs of Lemmas~\ref{lem:Ii}, \ref{lem:Iii} and~\ref{lem:Iiii} it is not used that $\bm$ is an integer vector. \end{proof} The centre of the range of $\bm$ is now $q_1q_2\bth$, which depends on $q_2$. If $d_n=0$ this causes no difficulty, since Proposition~\ref{prop:meansing} allows arbitrary centres. If $d_n\neq0$ we need the following variant of Proposition~\ref{prop:mean}. \begin{proposition}\label{prop:meanth} Suppose that $d_n\neq0$. Let $Q_1,Q_2\geqslant1/2$ and $V\geqslant1$, and for each $q_1$ let $\bm_0(q_1)\in\RR^n$ with $|\bm_0(q_1)|\leqslant V_0$. Then the bound of Proposition~\ref{prop:mean} holds for the sum \[ \sum_{Q_11/2$ are divided into shells $M'<|\bv|\leqslant2M'$ as before. If there are $\bv$ with $0<|\bv|\leqslant1/2$, then $M'=1/2$ satisfies~\eqref{eq:Mrange}; these $\bv$ have $|\bv|\geqslant1/H$, hence $|\bu|^{1-n/2}\ll(P/(Q_1Q_2))^{1-n/2}$, and we include them in the shell with $M'=1/2$. On each shell $|\bm-q_1q_2\bth|\leqslant2M'$, and we apply Proposition~\ref{prop:meanth} with $\bm_0=\bzero$ and $V=2M'$ in place of Proposition~\ref{prop:mean}. In the proof of Proposition~\ref{prop:non} the condition in~\eqref{eq:measure} becomes $|\nabla f_{\bgam}(\bz)-\bu|\leqslant\rho$. It says that $\bm$ lies within $\rho q_1q_2/P$ of the point $(q_1q_2/P)\bw+q_1q_2\bth$. The points $(q_1q_2/P)\bw$ are covered as before, and we find that all the $\bm$ in question, for all $q_2\in(Q_2,2Q_2]$, lie in the union of at most $\Lambda/V+2$ sets of the form $\{\bm:|\bm-\bm_0-q_1q_2\bth|\leqslant2V\}$, where the points $\bm_0$ depend only on $\bz$ and $q_1$ (and on $\bgam$ and $Q_2$). If there is such an $\bm$ with $\bv\neq\bzero$, then $1/H\leqslant|\bv|\leqslant(4Q_1Q_2/P)(c_4\|\bgam\|+\rho)$, so that~\eqref{eq:exist} holds with an additional factor $1/H$ on the right; this is immaterial, since $\eps$ is arbitrary. To each of the sets we apply Proposition~\ref{prop:meanth}, and the rest of the proof is unchanged. In the proof of Proposition~\ref{prop:tail} the condition $|\bu|\leqslant P^\eps\Theta$ implies $|\bm-q_1q_2\bth|\leqslant8P^\eps TQ_1Q_2/P$, and Proposition~\ref{prop:meanth} is applied with $\bm_0=\bzero$. If $d_n=0$, we argue in the same way with the quantities $\cE_{\mathrm{res}}$, $\cE_{\mathrm{non}}$ and $\cE_{\mathrm{tail}}$ of \S\ref{sec:sing}, and claim that the bounds of Propositions~\ref{prop:ressing}, \ref{prop:nonsing} and~\ref{prop:tailsing} remain valid; the proposition then follows as in the proof of Proposition~\ref{prop:deltasing}. In the proofs of these three propositions the ranges of $\bm$ are now centred at the points $\bm_0+q_1q_2\bth$ in place of $\bm_0$, which is permitted in Proposition~\ref{prop:meansing}, and the remarks made above on the $\bv$ with $0<|\bv|\leqslant1/2$ and on~\eqref{eq:exist} apply without change. \end{proof} \subsection{The singular series} \begin{lemma}\label{lem:seriesth} Let $\bb\in\ZZ^n$. The limits $\sigma_p(\bb)$ exist, the product $\fS(\bb)=\prod_p\sigma_p(\bb)$ converges absolutely, and \[ \frac1{H^n}\sum_{\bc\bmod H}e_H(-\bb\cdot\bc)\,\fS(\bc/H)=\fS(\bb). \] Moreover, the last assertion of Theorem~\ref{thm:cong} holds. \end{lemma} \begin{proof} For $q\in\NN$ put $g=(q,H)$ and \[ B(q)=\sum_{\substack{\ba\bmod q\\ \gcd(q,a_3,a_2)=1}}\Bigl(\frac gq\Bigr)^n\sum_{\substack{\by\bmod q\\ \by\equiv\bb\bmod g}}e_q\bigl(a_3C(\by)+a_2Q(\by)\bigr). \] Let $\bc$ be an integer vector. If $A(q;\bc/H)\neq0$, then $H$ divides $q\bc$, that is, $\bc=(H/g)\bc'$ with an integer vector $\bc'$, which is determined modulo $g$ by $\bc$ modulo $H$. In this case $e_H(-\bb\cdot\bc)=e_g(-\bb\cdot\bc')$ and $S(\ba,q;q\bc/H)=\sum_{\by\bmod q}e_q(a_3C(\by)+a_2Q(\by))e_g(\bc'\cdot\by)$. Since $\sum_{\bc'\bmod g}e_g(\bc'\cdot(\by-\bb))$ is $g^n$ if $\by\equiv\bb\pmod g$ and vanishes otherwise, we obtain \begin{equation}\label{eq:AB} \frac1{H^n}\sum_{\bc\bmod H}e_H(-\bb\cdot\bc)\,A(q;\bc/H)=\frac{B(q)}{H^n}. \end{equation} The same computation shows that $|B(q)|\leqslant g^nq^{-n}\sum_{\ba}\max_{\bm}|S(\ba,q;\bm)|$, so that $\sum_q|B(q)|<\infty$ by~\eqref{eq:tailth}. The function $B$ is multiplicative. Indeed, let $q=q'q''$ with $(q',q'')=1$. The residues $\by$ modulo $q$ correspond to the pairs of residues $(\by',\by'')$ modulo $q'$ and $q''$, and $\by\equiv\bb\pmod{(q,H)}$ if and only if $\by'\equiv\bb\pmod{(q',H)}$ and $\by''\equiv\bb\pmod{(q'',H)}$. Moreover $e_q(a_3C(\by)+a_2Q(\by))=e_{q'}(a_3'C(\by')+a_2'Q(\by'))\,e_{q''}(a_3''C(\by'')+a_2''Q(\by''))$, where $\ba'\equiv\overline{q''}\ba\pmod{q'}$ and $\ba''\equiv\overline{q'}\ba\pmod{q''}$, and $\ba\mapsto(\ba',\ba'')$ is a bijection between the pairs that occur in $B(q)$ and those that occur in $B(q')$ and $B(q'')$. Hence $\sum_qB(q)=\prod_p\sum_{j\geqslant0}B(p^j)$, and the product converges absolutely. Let $p$ be a prime, $h=h_p$ and $k\geqslant h$. We detect the congruences $C(\bx)\equiv Q(\bx)\equiv0\pmod{p^k}$ by additive characters and sort the pairs $\ba$ modulo $p^k$ as in the proof of Lemma~\ref{lem:series}: \[ \lambda_{\bb}(p^k)=p^{-2k}\sum_{j=0}^k\ \sum_{\substack{\ba\bmod p^j\\ \gcd(p^j,a_3,a_2)=1}}\ \sum_{\substack{\bx\bmod p^k\\ \bx\equiv\bb\bmod p^h}}e_{p^j}\bigl(a_3C(\bx)+a_2Q(\bx)\bigr). \] The summand depends only on $\bx$ modulo $p^j$. There are $p^{(k-h)n}$ vectors $\bx$ in the inner sum, and they are equally distributed among the classes $\by$ modulo $p^j$ with $\by\equiv\bb\pmod{p^{\min\{h,j\}}}$. Since $(p^j,H)=p^{\min\{h,j\}}$, the sum over $\ba$ and $\bx$ is $p^{(k-h)n}B(p^j)$. Therefore \[ \sum_{j=0}^kB(p^j)=p^{hn}\,p^{-k(n-2)}\lambda_{\bb}(p^k)\qquad(k\geqslant h). \] So the limit $\sigma_p(\bb)$ exists, $\sum_{j\geqslant0}B(p^j)=p^{hn}\sigma_p(\bb)$, and $\sum_qB(q)=H^n\prod_p\sigma_p(\bb)$. Summing~\eqref{eq:AB} over $q$ we obtain the formula of the lemma. For $p\nmid H$ we have $\sigma_p(\bb)=\sigma_p$, so the product over $p$ converges absolutely, by Lemma~\ref{lem:series}. It remains to prove that $\fS(\bb)>0$ under the hypothesis of Theorem~\ref{thm:cong}. For $p\nmid H$ we have $\sigma_p(\bb)=\sigma_p>0$ by Lemma~\ref{lem:series}. Let $p\mid H$, $h=h_p$, and let $\by\in\ZZ_p^n\setminus\{\bzero\}$ with $\by\equiv\bb\pmod{p^h}$ and $C(\by)=Q(\by)=0$. Since $X$ is non-singular, the vectors $\nabla C(\by)$ and $\nabla Q(\by)$ are linearly independent. As in the proof of Lemma~\ref{lem:series} there are indices $i0$. \end{proof} \subsection{Proof of Theorem~\ref{thm:cong}} Let $\bth=\bc/H$ with $\bc\in\ZZ^n$. By the splitting of $N_w(P;\bth)$, the bound~\eqref{eq:Ninfty} for $N_\infty(\bth)$, Lemmas~\ref{lem:weylth} and~\ref{lem:majorth}, and Proposition~\ref{prop:deltath}, \[ N_w(P;\bth)=\fS(\bth)\,\fJ\,P^{n-5}+O\bigl(P^{n-5-1/43+\eps}\bigr). \] We insert this into~\eqref{eq:orth} and apply Lemma~\ref{lem:seriesth}. This proves Theorem~\ref{thm:cong}. \subsection{Proof of Theorem~\ref{thm:WA}} Let $X$ be as in Theorem~\ref{thm:HP}. If $X(\RR)=\emptyset$ there is nothing to prove. A linear change of variables over $\QQ$ induces a bijection on the rational points and homeomorphisms on the real and the $p$-adic points, so that we may suppose that $X$ is given by forms $C$ and $Q$ as in~\eqref{eq:normal}. Let $\mathcal S$ be a finite set of primes, let $\xi_\infty\in X(\RR)$ and $\xi_p\in X(\QQ_p)$ for $p\in\mathcal S$, and let neighbourhoods $\mathcal W_\infty$ of $\xi_\infty$ in $X(\RR)$ and $\mathcal W_p$ of $\xi_p$ in $X(\QQ_p)$ be given. By the definition of the product topology, it suffices to find a point of $X(\QQ)$ that lies in all of these neighbourhoods. We write $\xi_\infty=[\bz_0]$ with $\bz_0\in\RR^n$ and $0<|\bz_0|\leqslant1/4$, and $\xi_p=[\bb_p]$ with a primitive vector $\bb_p\in\ZZ_p^n$. There are $\rho_0>0$ and $k\in\NN$ with the following properties: if $\bz\in\RR^n$ with $|\bz-\bz_0|\leqslant\rho_0$ and $C(\bz)=Q(\bz)=0$, then $[\bz]\in\mathcal W_\infty$; and if $p\in\mathcal S$ and $\by\in\ZZ_p^n$ with $\by\equiv\bb_p\pmod{p^k}$ and $C(\by)=Q(\by)=0$, then $[\by]\in\mathcal W_p$. We may take $\rho_0$ so small that the construction of \S\ref{ss:weight} applies with this $\bz_0$ and $\rho_0$ (together with the additional condition of \S\ref{sec:sing} if $d_n=0$), and we let $w$ be the corresponding weight. Put $H=\prod_{p\in\mathcal S}p^k$, and choose $\bb\in\ZZ^n$ with $\bb\equiv\bb_p\pmod{p^k}$ for all $p\in\mathcal S$. The hypothesis of Theorem~\ref{thm:cong} holds, with $\by=\bb_p$ for $p\in\mathcal S$. Hence $\fS(\bb)>0$, and $\fJ>0$ by Lemma~\ref{lem:SJ}(ii). By Theorem~\ref{thm:cong}, $N_w(P;\bb,H)>0$ if $P$ is large. So there is $\bx\in\ZZ^n$ with $C(\bx)=Q(\bx)=0$, $\bx\equiv\bb\pmod H$ and $|\bx/P-\bz_0|\leqslant\rho_0$. Then $\bx\neq\bzero$, the point $[\bx]=[\bx/P]$ of $X(\QQ)$ lies in $\mathcal W_\infty$, and it lies in $\mathcal W_p$ for every $p\in\mathcal S$. This proves Theorem~\ref{thm:WA}. \subsection*{Acknowledgements} The author is grateful to Prof.~Ritabrata Munshi for suggesting this problem, and for the suggestion that it be approached by the nested $\delta$-method. This work was started at the Indian Statistical Institute, Kolkata, and completed at the Indian Institute of Technology Bombay. The author thanks both institutes for excellent working environments, and acknowledges the support of a Research Associate fellowship at the Indian Statistical Institute, Kolkata, and of a position as Project Research Scientist at the Indian Institute of Technology Bombay (Project Code No.~RD/0525-IRCCSH0-005). \begin{thebibliography}{99} \bibitem{Azn} V.\,N. Aznar, On the Chern classes and the Euler characteristic for non-singular complete intersections, \emph{Proc. Amer. Math. Soc.} \textbf{78} (1980), 143--148. \bibitem{Bir} B.\,J. Birch, Forms in many variables, \emph{Proc. Roy. Soc. Ser. A} \textbf{265} (1961/62), 245--263. \bibitem{BDHB} T.\,D. Browning, R. Dietmann and D.\,R. Heath-Brown, Rational points on intersections of cubic and quadric hypersurfaces, \emph{J. Inst. Math. Jussieu} \textbf{14} (2015), 703--749. \bibitem{BHB} {T.\,D. Browning and D.\,R. Heath-Brown, Forms in many variables and differing degrees, \emph{J. Eur. Math. Soc.} \textbf{19} (2017), 357--394.} \bibitem{CTCS} J.-L. Colliot-Th\'el\`ene, D. Coray and J.-J. Sansuc, Descente et principe de Hasse pour certaines vari\'et\'es rationnelles, \emph{J. reine angew. Math.} \textbf{320} (1980), 150--191. \bibitem{CTSSD} J.-L. Colliot-Th\'el\`ene, J.-J. Sansuc and P. Swinnerton-Dyer, Intersections of two quadrics and Ch\^atelet surfaces. I, \emph{J. reine angew. Math.} \textbf{373} (1987), 37--107. \bibitem{Dav} H. Davenport, \emph{Analytic methods for Diophantine equations and Diophantine inequalities}, 2nd ed., edited by T.\,D. Browning, Cambridge Mathematical Library, Cambridge University Press, Cambridge, 2005. \bibitem{DL} H. Davenport and D.\,J. Lewis, Non-homogeneous cubic equations, \emph{J. London Math. Soc.} \textbf{39} (1964), 657--671. \bibitem{DFI} W. Duke, J.\,B. Friedlander and H. Iwaniec, Bounds for automorphic $L$-functions, \emph{Invent. Math.} \textbf{112} (1993), 1--8. \bibitem{Gla} J. Glas, Rational points on complete intersections of cubic and quadric hypersurfaces over $\mathbb{F}_q(t)$, \emph{J. London Math. Soc.} (2) \textbf{110} (2024), e12991. \bibitem{HB83} D.\,R. Heath-Brown, Cubic forms in ten variables, \emph{Proc. London Math. Soc.} (3) \textbf{47} (1983), 225--257. \bibitem{HB96} D.\,R. Heath-Brown, A new form of the circle method, and its application to quadratic forms, \emph{J. reine angew. Math.} \textbf{481} (1996), 149--206. \bibitem{HB07} D.\,R. Heath-Brown, Cubic forms in 14 variables, \emph{Invent. Math.} \textbf{170} (2007), 199--230. \bibitem{Lew} D.\,J. Lewis, Cubic homogeneous polynomials over $p$-adic number fields, \emph{Ann. of Math.} (2) \textbf{56} (1952), 473--478. \bibitem{LRV} J. Li, S.\,L. Rydin Myerson and P. Vishe, A two-dimensional delta symbol method and its application to pairs of quadratic forms, preprint, arXiv:2411.11355. \bibitem{Mun15} R. Munshi, Pairs of quadrics in $11$ variables, \emph{Compos. Math.} \textbf{151} (2015), 1189--1214. \bibitem{RM17} {S.\,L. Rydin Myerson, Systems of forms in many variables, preprint, arXiv:1709.08917.} \bibitem{RM18} {S.\,L. Rydin Myerson, Quadratic forms and systems of forms in many variables, \emph{Invent. Math.} \textbf{213} (2018), 205--235.} \bibitem{RM19} {S.\,L. Rydin Myerson, Systems of cubic forms in many variables, \emph{J. reine angew. Math.} \textbf{757} (2019), 309--328.} \bibitem{Ser} J.-P. Serre, \emph{A course in arithmetic}, Graduate Texts in Mathematics 7, Springer, New York, 1973. \bibitem{Woo91} T.\,D. Wooley, On simultaneous additive equations, II, \emph{J. reine angew. Math.} \textbf{419} (1991), 141--198. \bibitem{Woo98} T.\,D. Wooley, On simultaneous additive equations, IV, \emph{Mathematika} \textbf{45} (1998), 319--335. \bibitem{Zah} J. Zahid, Simultaneous zeros of a cubic and quadratic form, \emph{J. London Math. Soc.} (2) \textbf{84} (2011), 612--630. \end{thebibliography} \end{document}