# Edge-Parallel Graph Encoder Embedding

Ariel Lubonja  Department of Computer Science
Johns Hopkins University
<EMAIL_ADDRESS>Cencheng Shen  Carey Priebe  Department of Applied Economics
and Statistics
University of Delaware
<EMAIL_ADDRESS>Department of Applied Mathematics and Statistics
Johns Hopkins University
<EMAIL_ADDRESS>Randal Burns  Department of Computer Science
Johns Hopkins University
<EMAIL_ADDRESS>
###### Abstract

New algorithms for embedding graphs have reduced the asymptotic complexity of
finding low-dimensional representations. One-Hot Graph Encoder Embedding (GEE)
uses a single, linear pass over edges and produces an embedding that converges
asymptotically to the spectral embedding. The scaling and performance benefits
of this approach have been limited by a serial implementation in an
interpreted language. We refactor GEE into a parallel program in the Ligra
graph engine that maps functions over the edges of the graph and uses lock-
free atomic instrutions to prevent data races. On a graph with 1.8B edges,
this results in a 500 times speedup over the original implementation and a 17
times speedup over a just-in-time compiled version.

###### Index Terms:

graph embedding, graph processing, parallel programming

##  I Introduction

Graph embedding is a powerful technique for exploring the structure of graphs.
It is the fundamental step in clustering [1, 2], feature learning [3], and
representation learning [4] on graphs. It is used in the analysis of
connectomes [5], cybersecurity threat detection [6], and community detection
in social networks [7].

Spectral embedding learns a low-dimensional euclidean representation of a
graph [5, 8] based on a singular-value decomposition (SVD) graph adjacency or
graph Laplacian matrix. Spectral embedding has strong statistical guarantees;
the resulting vertex embedding asymptotically converges to the latent
positions under random dot product graphs [9] and, thus, is consistent for
subsequent inference tasks such as hypothesis testing and community detection.
However, spectral embedding is only as efficient as the SVD, which is
$O(n^{3})$ for $n$ vertices and can be solved in $O(n^{2}\log n)$ for
restricted cases or in some approximations [10]. Other methods produce good
results empirically, but they require parameter tuning or search spaces that
are computationally expensive. Methods based on random walks [3, 11] are
$O(n)$ but have large constants in the length and number of the walks. Graph
convolutional neural networks [12] are quite expensive in practice.

Our work focuses on improving the computational performance of the recent one-
hot graph encoder embedding (GEE) [13]. The algorithm is desirable for its
convergence guarantees and because it performs a single pass over the edges.
The base implementation is already an order of magnitude faster than spectral
methods, GCN, or node2vec. The remaining gap this paper addresses is
parallelism and memory efficiency. The current GEE implementation takes nearly
an hour on a graph with 1.8B edges. We bring this down to 6.5 seconds.

We contribute an implementation of GEE that fully utilizes shared-memory
hardware and scales to billions of edges. We reformulate the GEE algorithm
into an edge-map program in Ligra’s programming interface [14]. This GEE-Ligra
implementation avoids data races using lock-free atomic updates, resulting in
a 500 times speedup and good scalability. We also provide an optimized version
of the original code using Numba just-in-time compilation. GEE-Ligra is 5 to
20 times faster than Numba, owing to more efficient memory usage and multicore
parallelism. Our code is publicly available on GitHub: Numba and GEE-Ligra.

##  II Background

GEE: For a graph $G(n,s)$ of nodes $n$ connected by edges $s$, the One Hot
Graph Encoder Embedding (Algorithm 1) builds an embedding matrix $\mathbf{Z}$
based on the edge list $s$ and a vector of class labels
$\mathbf{Y}\in\\{0,\ldots,K\\}^{n}$, where $K$ is the number of classes.
$\mathbf{Y}$ may represent the labels of a few known node ground truths or it
may be derived from unsupervised clustering, such as by running the Leiden
community detection algorithm [15]. GEE embeds the $n$ nodes into $k$
dimensions, where $k<<n$. For brevity, our description does not include the
preprocessing steps needed to compute the Laplacian version of the algorithm
[13].

GEE first initiates a projection matrix $\mathbf{W}$ (lines 2-6). Then, in a
single pass over the edges, GEE incrementally builds $\mathbf{Z}$ by adding
the contribution of each edge to the embedding (lines 7-12). This contribution
is a product of the weight $w$ and the corresponding coefficients in the
projection matrix $\mathbf{W}$. The source node contributes to the class of
the destination node (line 10) and vice-versa (line 11). This formulation is
for weighted directed graphs. Unweighted graphs have unit weights. Undirected
graphs are treated as two symmetric directed graphs.

Ligra: The edgeMap, vertexMap interface of Ligra [14] encodes fine-grained,
asynchronous parallelism for shared-memory systems. The interface selects a
vertex subset, called a frontier, and then calls a function for every vertex
(vertexMap) or every outbound edge from the vertex subset (edgeMap). This
captures almost all modern graph algorithms, including PageRank, Connected
Components, and Betweenness Centrality. The frontier subset enables search-
style algorithms like breadth-first search (BFS), that trigger computation on
neighbors.

input : $\mathbf{E}\in\mathbb{R}^{s\times 3}$

$\mathbf{Y}\in\\{0,\ldots,K\\}^{n}$: class labels

output : $\mathbf{Z}\in\mathbb{R}^{n\times K}$: node embeddings

1 Function  _GEE(_$\mathbf{E,Y}$_)_:

2

3 $\mathbf{W}=zeros(n,K)$ // Projection matrix

4 for  _$k=1:K$_ do

5 // $k=0$ means class unknown $idx=n\text{ where }Y[n]=k$

6 $\mathbf{W}(idx,k)=\frac{1}{count(\mathbf{Y}=k)};$

7 end for

8 for  _$i=1:s$_ do

9 // (u-source, v-dest., w-weight)

10 $u=\mathbf{E}(i,1);\ v=\mathbf{E}(i,2);\ w=\mathbf{E}(i,3);$

11
$\mathbf{Z}(u,\mathbf{Y}(v))\mathrel{{+}{=}}\mathbf{W}(v,\mathbf{Y}(v))\cdot
w;$

12
$\mathbf{Z}(v,\mathbf{Y}(u))\mathrel{{+}{=}}\mathbf{W}(u,\mathbf{Y}(u))\cdot
w;$

13 end for

14

15

16EndFunction

Algorithm 1 Semi-Supervised GEE

##  III Methods

The GEE-Ligra implementation (Algorithm 2) runs the same algorithm as GEE,
i.e. computes the same values on same input. Unlike GEE, which loops over the
edges, GEE-Ligra uses a function map over the edges, which is parallelized and
scheduled by the Ligra runtime. the frontier is the entire graph, i.e. all
nodes are active. This invokes the updateEmb function to update the embedding
on all edges in a single step [14]. This parallelizes GEE’s $O(s)$ component.
We also parallelize the initialization of the projection matrix, which costs
$O(nk)$. For most graphs and choices of $K<50$, $s>nk$. However, $O(nk)$
becomes the dominant component of the runtime when graphs have a high $n$ and
a very low average degree.

input : $\mathbf{E}\in\mathbb{R}^{s\times 3}$,
$\mathbf{Y}\in\\{0,\ldots,K\\}^{n}$

output : $\mathbf{Z}\in\mathbb{R}^{n\times K}$,
$\mathbf{W}\in\mathbb{R}^{n\times K}$

1 Function  _GEE(_$\mathbf{E,Y}$_)_:

2

3 $\mathbf{W}=zeros(n,K)$

4 ParallelFor  _$k=1:K$_ do

5 $idx=n\text{ where }Y[n]=k$

6 $\mathbf{W}(idx,k)=\frac{1}{count(\mathbf{Y}=k)};$

7

8 end

9 EdgeMap(updateEmb, $\mathbf{Z,W,Y}$, frontier=$n$)

10

11EndFunction

12Function  _updateEmb(_$\mathbf{Z,W,Y},u,v,w$_)_:

13 writeAdd ($\mathbf{Z}(u,\mathbf{Y}(v)),\leavevmode\nobreak\
\mathbf{W}(v,\mathbf{Y}(v))\cdot w$ );

14 writeAdd ($\mathbf{Z}(v,\mathbf{Y}(u)),\leavevmode\nobreak\
\mathbf{W}(u,\mathbf{Y}(u))\cdot w$ );

15

16

17EndFunction

18

Algorithm 2 GEE-Ligra Figure 1: Race condition in which both inbound and
outbound edges contribute to the emdedding and create conflicting updates.

The updateEmb function is mapped across all nodes and access the edge list of
each node sequentially. Because the frontier is the entire graph, Ligra
evaluates updateEmb using the edgeMapDense algorithm [14]. This schedules one
worker for the edge list of each node to process all edges sourced from that
node sequentially. The read accesses to $\mathbf{W}$ and write accesses to
$\mathbf{Z}$ are fine-grained. $\mathbf{Z}(u,:)$ (line 10) and
$\mathbf{W}(u,:)$ (line 11) are systematically reused during a edgeMapDense,
and will be in the processor cache, however, access to $\mathbf{Z}(v,:)$ and
$\mathbf{W}(v,:)$ will likely result in cache misses.

The Ligra writeAdd() function uses hardware support to perform a lock-free
atomic increment on the embedding field. This protects the data from the race
that occurs when two edges with nodes in the same class update the same entry
(Figure 1). This is caused by GEE propagating class information from source to
destination and destination to source. We expect such conflicts to happen
infrequently, because it requires simultaneous scheduling of two separate
edges on separate nodes with the same class label. Updates from the
$\mathbf{Z}(u,\mathbf{Y}(v_{1}))$ and
$\mathbf{Z}(u,\mathbf{Y}(v_{2}));\leavevmode\nobreak\ v_{1}\neq
v_{2},\mathbf{Y}(v_{1})==\mathbf{Y}(v_{2})$ will not conflict. They are
scheduled serially by edgeMapDense because they are successive entries in
$u$’s edge list.

Figure 2: Runtimes for Friendster, normalized to Numba Serial.  Graph ($|n|,|s|)$ Runtime (sec) |  GEE- Python |  Numba Serial |  GEE-Ligra Serial |  GEE-Ligra Parallel |  Speedup (v. GEE) |  Speedup (v. Numba) |  Speedup (v. Ligra Serial)
---|---|---|---|---|---|---|---
Twitch ($n=168$K, $s=6.8$M) | 12.18 | 0.20 | 0.11 | 0.013 | 936 | 15 | 8.5
soc-Pokec (1.6M, 30M) | 133.21 | 1.68 | 0.99 | 0.12 | 1100 | 14 | 8.25
soc-LiveJournal (6.4M, 69M) | 301.64 | 4.29 | 2.39 | 0.39 | 773 | 11 | 6.12
soc-orkut (3M, 117M) | 499.83 | 4.48 | 2.97 | 0.26 | 1897 | 17 | 11.4
orkut-groups (3M, 327M) | 595.29 | 11.43 | 6.06 | 2.36 | 252 | 4.8 | 2.6
Friendster (65M, 1.8B) | 3374.72 | 112.33 | 77.23 | 6.42 | 525 | 17 | 12
TABLE I: Runtime (seconds) for graphs of various sizes. $k=50$ is used for all
graphs. Speedup (rows 5-7) show the performance improvement of GEE-Ligra run
in parallel on 24 cores to other implementations.

##  IV Findings

We evaluate the parallel implementation of GEE-Ligra against the reference
implementation in Python and our Numba just-in-time compiled implementation.
Experiments were performed using a machine with a 24-core, 48-thread Intel
Xeon Platinum 8259CL with 192GB main memory. We used Python 3.10.12 and
compiled C++ code with the GNU G++ 11.4.0 compiler. Ligra was compiled from
source. We experimented with a variety of graphs collected from the SNAP
repository [16] that vary between 6.8-327M edges and the Friendster graph [17]
as an example of an Internet-scale dataset with 1.8B edges. We generated the
$\mathbf{Y}$ labels uniformly at random from $[0,K=50]$ for 10% of nodes,
which were also selected uniformly at random. This practice aligns with GEE’s
experimental configuration [13].

Table I summarizes performance results. Massive performance gains are realized
by moving to compiled code. This can be seen through our Numba results which
show a 30-50 times speedup. GEE-Ligra obtains a further 10-15 times
performance improvement over Numba. This results from a combination of
asynchronous execution in the Ligra graph engine and parallelism. Ligra run in
serial improves performance over Numba by less than a factor of 2.

Figure 3: Speedup of Ligra on Friendster by nr. cores.

The results comparing compiled code to GEE-Ligra on the largest graph (Figure
2) provide insights into the benefit of using a declarative graph engine. On a
single thread on a single core, GEE-Ligra reduces runtime by 31%. Running GEE-
Ligra in parallel produces a 17 times speedup over Numba and 12 times over
GEE-Ligra serial.

We study the strong-scaling performance of GEE-Ligra on the Friendster graph.
The algorithm exhibits good scalability, realizing 11 times speedup over 24
cores (24 threads with hyperthreading disabled). Atomic updates could lead to
interference between threads and limit scalability. However, we ran the
program with atomics off, performing unsafe updates, and saw no appreciable
performance difference. We expect this workload to be memory bound, because
there is so little computation per edge. GEE-Ligra performs two fused-multiply
adds per edge and two memory writes, one of which is likely to miss. These
scaling results are consistent with other graph algorithms [14, 18] which have
been shown to be memory bound.

We also study a large range of graph sizes to demonstrate that we preserve
performance as inputs grow. We generate Erdős-Rényi random graphs increasing
numbers of edges and run GEE-Ligra using all 24 cores. Figure 4 shows that
GEE-Ligra’s runtime increases linearly with the number of edges.

Figure 4: Runtime as the number of edges increase on Erdős-Rényi graphs.

##  V Conclusion

We present an edge-parallel implementation in a shared-memory graph engine of
the One Hot Graph Encoding Embedding (GEE) algorithm. The original algorithm
provides an order of magnitude performance improvement over spectral methods,
random walks, and graph convolutional networks [13]. Our implementation
provides a speedup of 500 times over the base implementation and 17 times
speedup over a compiled version of the algorithm. This allows us to embed
graphs of 1.8B nodes in 6.5 seconds. Our treatment describes how to
parallelize over the edge lists of each node and use atomic instructions to
avoid race conditions.

## References

  * [1] Di Jin, Xinxin You, Weihao Li, Dongxiao He, Peng Cui, Francoise Soulie Fogelman, and Tanmoy Chakraborty,  “Incorporating network embedding into markov random field for better community detection,”  Proceedings of the AAAI Conference on Artificial Intelligence, vol. 33, pp. 160–167, 07 2019.
  * [2] Di Jin, Zhizhi Yu, Pengfei Jiao, Shirui Pan, Dongxiao He, Jia Wu, Philip S. Yu, and Weixiong Zhang,  “A survey of community detection approaches: From statistical modeling to deep learning,”  IEEE Transactions on Knowledge and Data Engineering, vol. 35, no. 2, pp. 1149–1170, 2023.
  * [3] Aditya Grover and Jure Leskovec,  “node2vec: Scalable feature learning for networks,”  in Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, 2016, pp. 855–864.
  * [4] William L. Hamilton, Rex Ying, and Jure Leskovec,  “Representation learning on graphs: Methods and applications,”  IEEE Data Eng. Bull., vol. 40, pp. 52–74, 2017.
  * [5] Carey E. Priebe, Youngser Park, Joshua T. Vogelstein, John M. Conroy, Vince Lyzinski, Minh Tang, Avanti Athreya, Joshua Cape, and Eric Bridgeford,  “On a two-truths phenomenon in spectral graph clustering,”  Proceedings of the National Academy of Sciences, vol. 116, no. 13, pp. 5995–6000, 2019.
  * [6] Benjamin Bowman and H. Howie Huang,  “Towards next-generation cybersecurity with graph AI,”  SIGOPS Oper. Syst. Rev., vol. 55, no. 1, pp. 61–67, jun 2021.
  * [7] Vince Lyzinski, Minh Tang, Avanti Athreya, Youngser Park, and Carey E. Priebe,  “Community detection and classification in hierarchical stochastic blockmodels,”  IEEE Transactions on Network Science and Engineering, vol. 4, no. 1, pp. 13–26, 2017.
  * [8] Daniel L. Sussman, Minh Tang, Donniell E. Fishkind, and Carey E. Priebe,  “A consistent adjacency spectral embedding for stochastic blockmodel graphs,”  Journal of the American Statistical Association, vol. 107, no. 499, pp. 1119–1128, 2012.
  * [9] Avanti Athreya, Donniell E. Fishkind, Minh Tang, Carey E. Priebe, Youngser Park, Joshua T. Vogelstein, Keith Levin, Vince Lyzinski, Yichen Qin, and Daniel L Sussman,  “Statistical inference on random dot product graphs: a survey,”  Journal of Machine Learning Research, vol. 18, no. 226, pp. 1–92, 2018.
  * [10] Dinesh Ramasamy and Upamanyu Madhow,  “Compressive spectral embedding: sidestepping the SVD,”  in Advances in Neural Information Processing Systems, 2015, vol. 28.
  * [11] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena,  “Deepwalk: Online learning of social representations,”  in Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2014, p. 701–710.
  * [12] Thomas N Kipf and Max Welling,  “Semi-supervised classification with graph convolutional networks,”  arXiv preprint arXiv:1609.02907, 2016.
  * [13] Cencheng Shen, Qizhe Wang, and Carey E. Priebe,  “One-hot graph encoder embedding,”  IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 45, no. 6, pp. 7933–7938, 2023.
  * [14] Julian Shun and Guy E. Blelloch,  “Ligra: A lightweight graph processing framework for shared memory,”  SIGPLAN Notices, vol. 48, no. 8, pp. 135–146, 2013.
  * [15] Vincent A Traag, Ludo Waltman, and Nees Jan Van Eck,  “From louvain to leiden: guaranteeing well-connected communities,”  Scientific reports, vol. 9, no. 1, pp. 5233, 2019.
  * [16] Jure Leskovec and Andrej Krevl,  “SNAP Datasets: Stanford large network dataset collection,” http://snap.stanford.edu/data, June 2014.
  * [17] Ryan A. Rossi and Nesreen K. Ahmed,  “The network data repository with interactive graph analytics and visualization,”  in AAAI, 2015.
  * [18] Brian Wheatman, Randal Burns, Aydın Buluç, and Helen Xu,  “CPMA: An efficient batch-parallel compressed set without pointers,”  arXiv preprint arXiv:2305.05055, 2023.


\Pi(\underline{a}_1) &\coloneqq \prod_{\substack{\varpi^k\parallel r_3' \\ \varpi^m\parallel d_3 \\ \varpi \mid r_3}}\Biggl( \sum_{\substack{|b_0'|<|\varpi|^{k'-l-m})\\ F_i(\bm{y})\equiv \varpi^{m}b'_1c_i \:(\varpi^{k'-l})}}\psi\left(\frac{b_0'\underline{a}_1\cdot \underline{c}}{\varpi^{k-m}}\right)-|\varpi|^{-1}\sum_{\substack{|b_1'|<|\varpi|^{k'-l-(m-1)})\\ F_i(\bm{y})\equiv \varpi^{m-1}b'_2c_i \:(\varpi^{k'-l})}}\psi\left(\frac{b_1'\underline{a}_1\cdot \underline{c}}{\varpi^{k-m}}\right)\Biggr)\\
&\times \prod_{\substack{\varpi^k\parallel r_3' \\ \varpi^m\parallel d_3 \\ \varpi \nmid r_3}}\Biggl(\sum_{b_0 \:(\varpi^{k-m})}\psi\left(\frac{b_0\underline{a}_1\cdot \underline{c}}{\varpi^{k-m}}\right)S_0(\varpi)-|\varpi|^{-1}\sum_{b_1 \:(\varpi^{k-m+1})}\psi\left(\frac{b_1\underline{a}_1\cdot \underline{c}}{\varpi^{k-m+1}}\right)S_1(\varpi)\Biggr).
\end{align*}

Moreover, since there is a unique $b_i'$ with $|b_i'|<|\varpi|^{k-l-m-i}$ and $F_i(\bm{y})\equiv \varpi^{m-i}b_i'k_3'c_i \:(\varpi^{k-l})$ it is easy to see that $\Pi(\underline{a}_1)\leq |k_3'|$. After relabelling the variables, (<ref>), (<ref>) and (<ref>) show that we have established the following result.

Let $r'\in \O$ be cube-full, $d\in \O$ with $d \mid r$, $\bm{v}\in \O^n$. Define $r=r'/(r',M)$ and $r=e^2f$ with $f\mid e$ and $f$ given by (<ref>). Then with the notation introduced in (<ref>) for $\bm{y}, \bm{v}\in \O^n$, we have

\begin{align*}
&\sum_{\substack{\underline{a}/r'\in L(d\underline{c}) \\ \nabla (\underline{a}\cdot \underline{F})(\bm{y})\equiv \bm{v} \:(e)}}\psi\left(\frac{\underline{a}\cdot\underline{F}(\bm{y})}{r}\right) = |k_1e_1f_1||e_2f_2k_2'|^2|d_3e_3f_3k_3^2||k_3'|^{-1}\delta_{F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(e_2f_2d_3')}\\ &\times\delta_{F_{\underline{c}}(\bm{y})\equiv 0 \:(e_1f_1e_3f_3)}\sideset{}{^{(1)}}\sum\psi\left(\frac{a_1F_{\underline{c}}(\bm{y})}{r_1}\right)\sideset{}{^{(2)}}\sum\psi\left(\frac{\underline{a}_2\cdot \underline{F}(\bm{y})}{r_2}\right)\sideset{}{^{(3)}}\sum\psi\left(\frac{\underline{a}_3\cdot \underline{c}}{r_3}\right)\Pi(\underline{a}_3)
\end{align*}

where $(1)$ indicates that we are summing over $|a_1|<|e_1k_1'|$ subject to $(a_1,r'_1)=1$, $a_1\nabla F_{\underline{c}} (\bm{y})\equiv \bm{v}\:(e_1)$; $(2)$ that $|\underline{a}_2|<|e_2k_2'|$ with $(\underline{a}_2, r_2')=1$, $\underline{a}_2/r_2'\in L(d_2\underline{c})$ and ${\nabla(\underline{a}_2\cdot \underline{F})(\bm{y})\equiv \bm{v} \:(e_2)}$; and  $(3)$ that $|\underline{a}_3|<|e_3k_3'|$ with $(\underline{a}_3, r_3')=1$, $\nabla (\underline{a}_3\cdot \underline{F})(\bm{y})\equiv \bm{v} \:(e_3)$ and $ \varpi^{\nu_\varpi(k_3e_3)}\parallel \underline{a}_3\cdot \underline{c}$. In addition, $|\Pi(\underline{a}_3)|\leq |k_3'|$.

Recall that $N, k_i, k'_i$ are all $O(1)$. In particular, once we combine Lemmas <ref> and <ref>
with the Chinese remainder theorem, we obtain from (<ref>) that

\begin{align}
\begin{split}\label{Eq: UppberBoundSdc(v).step2}
|S_{d\underline{c},s,\bm{b},N}(\bm{v})|\ll |e|^{n+1}|fe_2f_2d_3| \sideset{}{'}\sum_{|a_1|<|e_1k_1'|}\sideset{}{'}\sum_{\substack{|\underline{a}_2|<|e_2k'_2|\\ \underline{a}_2/r_2'\in L(d_2\underline{c})}} \sideset{}{'}\sum_{\substack{|\underline{a}_3|<|e_3k_3'| \\ \varpi^{\nu_\varpi(k_3e_3)}\parallel \underline{a}_3\cdot \underline{c}}}\left|\sideset{}{^{(4)}}\sum_{\phantom{Ji}|\bm{y}|<|ef|}\psi\left(\frac{\underline{a}\cdot \underline{F}(\bm{y})-t\bm{v}\cdot \bm{y}}{r}\right)\right|,
\end{split}
\end{align}

where $\underline{a}=a_1\underline{c}^\bot r_2r_3+\underline{a}_2r_1r_3+\underline{a}_3r_1r_2$ and $(4)$ denotes the conditions $\nabla(\underline{a}\cdot \underline{F})(\bm{y})\equiv t\bm{v} \:(e)$, $F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(e_2f_2d_3')$ and $F_{\underline{c}}(\bm{y})\equiv 0 \:(e_1f_1e_3f_3)$.

Recall that $r=e^2f$. Next we write $\bm{y}=\bm{y}_1+e\bm{y}_2$ with $|\bm{y}_1|<|e|$ and $|\bm{y}_2|<|f|$. Note that the definition of $r_3$ implies that $\nu_\varpi(d_3')\leq \nu_\varpi(e_3f_3)$. We shall therefore write

\begin{equation}\label{Defi: e3'}
d_3'=e_3'f_3', \quad\text{where}\quad f'_3=\prod_{\nu_\varpi(d_3')=\nu_{\varpi}(e_3)+1}\varpi,
\end{equation}

so that $e_3'\mid e_3$ and $f_3'\mid f_3$. Hence $F_i(\bm{y})\equiv 0 \:(e_2f_2d_3')$ if and only if $F_i(\bm{y}_1)= e_2e_3'm_i$ say and $f_2f'_3 \mid (m_i+e/(e_2e_3')\bm{y}_2\cdot\nabla F_i(\bm{y}_1))$ for $i=1,2$. Similarly, if $F_{\underline{c}}(\bm{y}_1)=e_1e_3n$, then it must hold that $f_1f_3\mid (n+e_2 \bm{y}_2\cdot \nabla F_{\underline{c}}(\bm{y}_1))$. In addition, if $\nabla (\underline{a}\cdot \underline{F})(\bm{y}_1)=t\bm{v}+e\bm{k}$, then upon writing $\underline{a}=(a_1,a_2)$ we have

\[
\underline{a}\cdot \underline{F}(\bm{y}) - t\bm{v}\cdot \bm{y} \equiv \underline{a}\cdot \underline{F}(\bm{y}_1) - t\bm{v}\cdot \bm{y}_1 + e^2\left(a_1\bm{y}_1\cdot \nabla F_1(\bm{y}_2)+a_2F_2(\bm{y}_2) +\bm{y}_2\cdot \bm{k}\right) \: (r).
\]

It thus follows that

\begin{align}
\begin{split}\label{Eq: UpperBoundSdc(v).step3}
\Biggl|\sideset{}{^{(4)}}\sum_{\phantom{Ji}|\bm{y}|<|ef|}\psi &\left(\frac{\underline{a}\cdot \underline{F}(\bm{y})-t\bm{v}\cdot \bm{y}}{r}\right)\Biggr| \\ &\leq \sum_{\substack{|\bm{y}_1|<|e| \\ e_2e_3' \mid F_i(\bm{y}_1), \: i=1,2 \\ e_1e_3\mid F_{\underline{c}}(\bm{y}_1) \\ \nabla(\underline{a}\cdot \underline{F})(\bm{y}_1) \equiv t\bm{v} \:(e)}}\max_{\bm{k}}\left|\sideset{}{^{(5)}}\sum_{\substack{\bm{y}_2 \:(f) }}\psi\left(\frac{a_1\bm{y}_1\cdot \nabla F_1(\bm{y}_2)+a_2F_2(\bm{y}_2) +\bm{y}_2\cdot \bm{k}}{f}\right)\right|
\end{split}
\end{align}

where $(5)$ denotes the conditions

\[f_2f'_3\mid (m_i+e/(e_2e_3')\bm{y}_2\cdot\nabla F_i(\bm{y}_1))\quad\text{and}\quad f_1f_3\mid (n+e_2 \bm{y}_2\cdot \nabla F_{\underline{c}}(\bm{y}_1)).\]

By abuse of notation we denote the sum over $\bm{y}_2$ by $\Sigma^{(5)}$. We can then use orthogonality of characters to detect the congruence conditions in $(5)$. After employing the triangle inequality, a standard squaring and differencing argument delivers

\begin{align}
\begin{split}\label{Eq: UppberBoundSdc(v).step4}
\sideset{}{^{(5)}}\sum & \leq |(f_2f'_3)^2f_1f_3|^{-1} \sum_{b_0 \:(f_1f_3)}\sum_{\underline{b}_2 \:(f_2f'_3)}\left|\sum_{\bm{y}_2 \:(f)}\psi\left(\frac{a_1\bm{y}_1\cdot \nabla F_1(\bm{y}_2) +a_2 F_2(\bm{y}_2) +\bm{y}_2\cdot \bm{k}'}{f}\right)\right|\\
& \leq |f|^{n/2}N_f(\underline{a}, \bm{y}_1)^{1/2},
\end{split}
\end{align}

where $\bm{k}'$ is a term that depends at most on $m_1, m_2, \bm{y}_1$ and the $e_i$'s, and

\begin{equation*}   N_f(\underline{a},\bm{y})\coloneqq \#\{\bm{z} \:(e) \colon (a_1H(\bm{y})+a_2M)\bm{z}\equiv 0 \:(f)\}.
\end{equation*}

We now pause for a moment and collect what we have achieved so far. Inserting (<ref>) and (<ref>) into (<ref>), we get

\begin{align}
\begin{split}\label{Eq: UpperBoundSdc(v).final}
|S_{d\underline{c}, s, \bm{b},N}(\bm{v})|&\ll |e|^{n+1}|f|^{n/2+1}|e_2f_2d_3| \sideset{}{'}\sum_{|a_1|<|e_1k_1'|} \\
&\times\sideset{}{'}\sum_{\substack{|\underline{a}_2|<|e_2k'_2|\\ \underline{a}_2/r_2'\in L(d_2\underline{c})}}\sideset{}{'}\sum_{\substack{|\underline{a}_3|<|e_3k_3'| \\ \varpi^{\nu_\varpi(k_3e_3)}\parallel \underline{a}_3\cdot \underline{c}}}\sum_{\substack{|\bm{y}_1|<|e| \\ e_2e_3' \mid F_i(\bm{y}_1), i=1,2 \\ e_1e_3\mid F_{\underline{c}}(\bm{y}) \\ \nabla(\underline{a}\cdot \underline{F})(\bm{y}_1) \equiv t\bm{v} \:(e)}}N_f(\underline{a},\bm{y})^{1/2}.
\end{split}
\end{align}

The innermost sum is clearly multiplicative, and so our next step is to focus on the sums

\begin{align*}
S_{1}(e_1,f_1) &\coloneqq \sum_{\substack{\bm{y}\:(e_1) \\ F_{\underline{c}}(\bm{y}) \equiv 0 \:(e_1) \\ F_1(\bm{y})F_2(\bm{y})\equiv 0 \:(f_1)}}N_{f_1}(\underline{c}^\bot,\bm{y})^{1/2},\\
S'_{1}(e_1,f_1) &\coloneqq \sum_{\substack{\bm{y}\:(e_1) \\ F_{\underline{c}}(\bm{y}) \equiv 0 \:(e_1) \\ F_1(\bm{y})F_2(\bm{y})\not\equiv 0 \:(f_1)}}N_{f_1}(\underline{c}^\bot,\bm{y})^{1/2},\\
S_2(e_2,f_2) &\coloneqq \sum_{\substack{ \bm{y} \:(e_2) \\ F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(e_2)}}N_{f_2}(\underline{a},\bm{y})^{1/2}\\
S_3(e_3,f_3) &\coloneqq \sum_{\substack{\bm{y} \:(e_3) \\ F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(e_3') \\ F_{\underline{c}}(\bm{y})\equiv 0 \:(e_3)}} N_{f_3}(\underline{a},\bm{y})^{1/2}.
\end{align*}

We will establish sufficiently strong estimates for $S_i(e_i,f_i)$ when $i=1,2,3$, while we will obtain an additional saving by averaging $S'_1(e_1,f_1)$ over $\underline{c}$. Before we can provide upper bounds for them, we prove the following intermediate step.

Let $r', r\in \O$ with $r' \mid r$ and $n\geq 13$.  Then we have

\begin{align*}
N_1(r)&\coloneqq \#\{ \bm{x} \: (r) \colon F_{\underline{c}}(\bm{x})\equiv 0 \: (r)\} \ll |r|^{n-1+\varepsilon},\\
N_2(r) &\coloneqq \#\{ \bm{x}\: (r) \colon F_1(\bm{x})\equiv F_2(\bm{x})\equiv 0 \:(r)\}\ll |r|^{n-2+\varepsilon} \text{ and}\\
N_3(r)&\coloneqq  \#\{\bm{x} \: (r) \colon F_1(\bm{x})\equiv F_2(\bm{x})\equiv 0 \:(r'), F_{\underline{c}}(\bm{x})\equiv 0 \:(r)\} \ll |r|^{n-1+\varepsilon}|r'|^{-1}.
\end{align*}

All the quantities are mutliplicative by the Chinese remainder theorem, and so we may assume that $r=\varpi^k$ and $r'=\varpi^m$ with $m\leq k$ during the proof. Let us begin with the treatment of $N_3(\varpi^k)$ by detecting the congruence condition with character sums:

\begin{align*}
|\varpi|^{2m+k}N_3(\varpi^k) & = \sum_{\underline{a} \: (\varpi^m)}\sum_{b\: (\varpi^k)}\sum_{\bm{x}\:(\varpi^k)}\psi\left(\frac{(\varpi^{k-m}\underline{a}+b\underline{c}^\bot)\cdot \underline{F}(\bm{x})}{\varpi^k}\right)
%    &=|\varpi|^{kn}+|\varpi|^{-(2m+k)}\sum_{l_1=0}^{m-1}\sum_{l_2=0}^{k-1}\sideset{}{'}\sum_{\underline{a} \: (\varpi^{m-l_1})}\sideset{}{'}\sum_{b\:(\varpi^{k-l_2})}\sum_{\bm{x}\:(\varpi^k)}\psi\left(\frac{(\varpi^{k-m+l_1}\underline{a}+\varpi^{l_2}\underline{c}^\bot)\cdot \underline{F}(\bm{x})}{\varpi^k}\right).
\end{align*}

Let us now consider individually the contribution from where $k-m+l_1<l_2$. In this case the sum over $\bm{x}$ above is

\[
|\varpi|^{(k-m+l_1)n}\sum_{\bm{x}\:(\varpi^{m-l_1})}\psi\left(\frac{(\underline{a}+\varpi^{l_2-k+m-l_1}\underline{c})\cdot \underline{F}(\bm{x})}{\varpi^{m-l_1}}\right)\ll|\varpi|^{(k-m+l_1)n+5n(m-l_1)/6}.
\]

Indeed, if $\varpi^{1+v_\varpi}\mid a_1-\varpi^{l_2-k+m-l_1}c_2$, then the sum is actually $O(|\varpi|^{(k-m+l_1)n+(m-l_1)(n+1)/2}$ by Lemma <ref>, while if $\varpi^{1+v_\varpi}\nmid a_1-\varpi^{l_2-k+m-l_1}c_2$, then we can apply Lemma <ref> with $\bm{v_0}=\bm{0}$ and $\widehat{V}=1$ to obtain the claimed estimate. Similarly, if $k-m+l_1>l_2$ we get that the sum over $\bm{x}$ is

\[
|\varpi|^{l_2n}\sum_{\bm{x}\:(\varpi^{k-l_2})}\psi\left(\frac{(\varpi^{k-m+l_1-l_2}\underline{a}+\underline{c})\cdot \underline{F}(\bm{x})}{\varpi^{k-l_2}}\right)\ll|\varpi|^{l_2n +5n(k-l_2)/6}.
\]

When $k-m+l_1=l_2$, then unless $\varpi$ divides both $a_1-c_2$ and $a_2+c_1$, we have

\[
|\varpi|^{(k-l_2)n}\sum_{\bm{x}\:(\varpi^{l_2})}\psi\left(\frac{(\underline{a}+\underline{c}^\bot)\cdot\underline{F}(\bm{x})}{\varpi^{l_2}}\right)\ll |\varpi|^{(k-l_2)n+5l_2n/6}.
\]

Suppose now that $0\leq l \leq k-1$ is such that $\varpi^l\parallel \varpi^{k-m}\underline{a}+b\underline{c}^\bot$. Then we claim that the sum over $\bm{x}$ above is

\[
|\varpi|^{ln}\sum_{\bm{x}\:(\varpi^{k-l})}\psi\left(\frac{\varpi^{-l}(\varpi^{k-m}\underline{a}+b\underline{c}^\bot)\cdot\underline{F}(\bm{x})}{\varpi^{k-l}}\right)\ll |\varpi|^{ln+5(k-l)n/6}.
\]

Indeed, if $\varpi^{1+v_\varpi}\mid \varpi^{-l}(\varpi^{k-m}a_1-bc_2)$, then the sum is $O(|\varpi|^{ln+(k-l)(n+1)/2})$ by Lemma <ref>, while if $\varpi^{1+v_\varpi}\nmid \varpi^{-l}(\varpi^{k-m}a_1-bc_2)$, then we can apply Lemma <ref> with $\bm{v_0}=\bm{0}$ and $\widehat{V}=1$ to obtain the claimed estimate.

For $0\leq l \leq k$ fixed, let us now determine the number of triples $(a_1,a_2, b)$ such that $\varpi^{k-m}\underline{a}+b\underline{c}^\bot\equiv 0 \:(\varpi^l)$. If $l\leq k-m$, then this holds if and only if $\varpi^l\parallel b$ since $\underline{c}$ is primitive, so that the number of available $(a_1, a_2, b)$ is $O(|\varpi|^{2m+k-l})$. On the other hand, if $l>k-m$, then again because $\underline{c}$ is primitive, we can without loss of generality assume that  $(c_1, \varpi)=1$. This implies

\[
\]

which determines $b$ uniquely modulo $\varpi^{l}$. We thus also have

\[
\varpi^{k-m}a_1\equiv -c_2b \equiv \varpi^{k-m}a_2c_2c_1^{-1} \:(\varpi^l),
\]

which determines $a_1$ uniquely modulo $\varpi^{l-k+m}$ provided $a_2$ is given. In total we get that the number of such $(a_1,a_2, b)$ is at most $|\varpi|^{m+k-l+m-(l-k+m)}=|\varpi|^{2(k-l)+m}$. We conclude that

\begin{align*}
|\varpi|^{2m+k}N_3(\varpi^k) \ll |\varpi|^{m+nk}+|\varpi|^{m+nk}\sum_{l=0}^{k-1}|\varpi|^{(n/6-2)(l-k)}\ll |\varpi|^{m+nk}+|\varpi|^{m+nk}
\end{align*}

for $n/6-2>0$.

The proof of the statement for the quantities $N_1(r)$ and $N_2(r)$ runs along the same lines and is in fact less involved. The argument again relies on the estimates provided by Lemmas <ref> and <ref> and we do not provide details here.

Before we continue with our study of the sums $S_i(e_i,f_i)$, we make some preliminary observations. First of all, if $(a_1, f)\ll 1$, then it follows from Equation (6.12) in <cit.> that

\begin{equation}\label{Eq: HessSumf}
\sum_{\bm{y} \:(f)}N_f(\underline{a}, \bm{y})\ll |f|^{n+\varepsilon}.
\end{equation}

Moreover, if $f \mid a_1$, then $\rk (M)\geq n-1$ readily implies $N_f(\underline{a},\bm{y})\ll |f|$.

Let $e_i, f_i\in \O$ with $f_i\mid e_i$ and $f_i$ square-free for $i=1,2,3$. Then for $n\geq 13$, we have

\begin{align*}
S_{1}(e_1,f_1) &\ll |e_1|^{n-1+\varepsilon}|f_1|^{1/2},\\
S_2(e_2,f_2) &\ll |e_2|^{n-2+\varepsilon}|f_2|\text{ and}\\
S_3(e_3,f_3) &\ll |e_3|^{n-1+\varepsilon}|e_3'|^{-1}|f_3|.
\end{align*}

All of the sums under consideration are multiplicative, and so we only have to prove the corresponding estimates when $e_i=\varpi^k$ and $f_i=1,\varpi$. Moreover, we shall write $m=\nu_{\varpi}(e'_3)$, so that $k\geq m \geq 1$.

Let $X_\varpi$ be the reduction of $V(F_1,F_2)$ modulo $\varpi$. When $i=2,3$, we begin with the case when $f_i=1$ or $a_1\equiv 0 \: (\varpi)$, while when $i=1$ we assume $f_i=1$ or $c_2\equiv 0 \:(\varpi)$. Since ${N_\varpi((0, a_2), \bm{y})\ll |\varpi|}$, in our situation we thus see that

\[
S_i(\varpi^k,f_i) \ll |f_i|^{1/2}N_i(\varpi^k).
\]

Lemma <ref> provides estimates for $N_i(\varpi^k)$ that are satisfactory for the statement of the lemma.

Moreover, when $c_1\equiv 0 \:(\varpi)$, then it follows from the second display after Equation (6.15) in <cit.> that $S_1(\varpi^k,f_1)\ll \varpi^{k(n-1)}|f_1|^{1/2}$, which is also sufficient.

We may therefore assume that $f_i=\varpi$ from now on. When $i=1$, we are left with the case $(c_2, \varpi)=(c_1,\varpi)=1$, while for $i=2,3$ we have to deal with the case when $(a_1, \varpi)=1$. Let us first assume that $X_\varpi$, the reduction of $V(F_1,F_2)$ modulo $\varpi$, is singular. Since this can only happen for at most finitely $\varpi$'s, it must hold that $N_\varpi(\underline{a}, \bm{y})\ll 1$. In particular, we obtain

\[
S_i(\varpi^k, f_i) \ll N_i(\varpi)
\]

in this case, which is again satisfactory by Lemma <ref>.

So let us now assume that $X_\varpi$ is non-singular. We first provide an upper bound for the contribution from $\bm{y} \not\equiv \bm{0}\:(\varpi^k)$ to $S_i(\varpi^k, \varpi)$. If $F_{\underline{c}}(\bm{y})\equiv 0 \:(\varpi^l)$ and $F_1(\bm{y})F_2(\bm{y})\equiv 0 \: (\varpi)$, then $F_{\underline{c}}(\bm{y}+\varpi^l\bm{z})\equiv 0 \: (\varpi^{l+1})$ if and only if $\varpi^{-l}F_{\underline{c}}(\bm{y})\equiv - \bm{z}\cdot\nabla F_{{\underline{c}}}(\bm{y})\: (\varpi)$. Since $c_1c_2\not\equiv 0 \:(\varpi)$, the condition $F_1(\bm{y})F_2(\bm{y})\equiv 0 \:(\varpi)$ forces that $\nabla F_{\underline{c}}(\bm{y})\not\equiv \bm{0} \:(\varpi)$ as otherwise $\bm{y}$ would be a singular point of $X_\varpi$. In particular for $\bm{y}\not\equiv \bm{0} \:(\varpi)$, inductively we obtain

\[
M_1(\bm{y})\coloneqq \#\{\bm{z}\: (\varpi^k)\colon \bm{z}\equiv \bm{y} \: (\varpi), F_{\underline{c}}(\bm{z})\equiv 0 \:(\varpi^k)\}\ll |\varpi|^{(k-1)(n-1)}.
\]

Similarly, if $F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(\varpi^l)$, then $F_1(\bm{y}+\varpi^l\bm{z})\equiv F_1(\bm{y}+\varpi^l\bm{z}) \equiv 0 \:(\varpi^{l+1})$ holds if and only if $\varpi^{-l}F_i(\bm{y})\equiv - \bm{z}\cdot \nabla F_i(\bm{y}) \:(\varpi)$. As $X_\varpi$ is non-singular and $\bm{y}\not\equiv  \bm{0} \:(\varpi)$, we must have $\rk(\nabla F_1(\bm{y}), \nabla F_2(\bm{y}))=2$. Therefore, it follows by induction that

\[
M_2(\bm{y})\coloneqq \#\{\bm{z} \:(\varpi^k) \colon \bm{z}\equiv \bm{y} \:(\varpi), F_1(\bm{z})\equiv F_2(\bm{z})\equiv 0 \:(\varpi^k)\} \ll |\varpi|^{(k-1)(n-2)}.
\]

Finally, if $F_1(\bm{y})\equiv F_2(\bm{y})\equiv 0 \:(\varpi^m)$, then $F_{\underline{c}}(\bm{y}+\varpi^m \bm{z})\equiv 0 \:(\varpi^{m+1})$ if and only if $\varpi^{-m}F_{\underline{c}}(\bm{y})\equiv - \bm{z}\cdot \nabla F_{\underline{c}}(\bm{y}) \:(\varpi)$. As $F_1(\bm{y})\equiv F_2(\bm{y}) \equiv 0 \:(\varpi)$, we must have $\nabla F_{\bm{c}}(\bm{y})\not\equiv \bm{0} \:(\varpi)$, as otherwise $\bm{y}$ would be a singular point of $X_\varpi$. Combing this with the arguments that were used to estimate $M_1(\bm{y})$ and $M_2(\bm{y})$, we obtain

\begin{align*}
M_3(\bm{y}) &\coloneqq \{\bm{z} \:(\varpi^k)\colon \bm{z}\equiv \bm{y}, F_1(\bm{z})\equiv F_2(\bm{z})\equiv 0 \:(\varpi^m), F_{\bm{c}}(\bm{z})\equiv 0 \:(\varpi^k)\}\\&\ll |\varpi|^{(m-1)(n-2) +(k-m)(n-1)}.
\end{align*}

It now follows from an application of the Cauchy-Schwarz inequality  that the contribution from $\bm{y}\not\equiv 0 \:(\varpi)$ to $S_i(\varpi^k,\varpi)$ is at most

\begin{align*}
\max_{\bm{y}\not\equiv 0 \:(\varpi)}M_i(\bm{y})N_i(\varpi)^{1/2} \huge(\sum_{\bm{y}\:(\varpi)}N_\varpi(\underline{a},\bm{y})\large)^{1/2}\ll |\varpi|^{n/2}\max_{\bm{y}\not\equiv 0 \:(\varpi)}M_i(\bm{y})N_i(\varpi)^{1/2}
\end{align*}

by (<ref>). Combining the estimates we just provided for $M_i(\bm{y})$ with Lemma <ref> to bound $N_i(\varpi)$, we see that this contribution is sufficient for the conclusion of the lemma to hold.

We are thus left with estimating the contribution from $\bm{y}\equiv \bm{0} \:(\varpi)$ to $S_i(\varpi^k,\varpi)$. In this case we have $N_\varpi(\underline{a}, \bm{y})\ll |\varpi|$, so that

\[
S_i(\varpi^k,\varpi)\ll |\varpi|^{1/2}N_i(\varpi^k),
\]

which is again satisfactory by Lemma <ref>.

We now return to the main task of this section: estimating the quantity $S(V,C_1,C_2)$ that was defined in (<ref>). Equation (<ref>) gives

\begin{align}
\begin{split}\label{Eq: FirstUpperBoundS(V,W)}
S(V,C_1,C_2) \ll|e|^{n+1}|f|^{n/2+1}|e_2f_2d_3|&\sum_{\substack{\underline{c}\in \O^2_{\text{prim}}\\ |c_i|\leq \widehat{C}_i}}\sideset{}{'}\sum_{|a_1|<|e_1k_1'|}\sideset{}{'}\sum_{\substack{|\underline{a}_1|<|e_2k'|\\ \underline{a}_1/r_2'\in L(d_2\underline{c})}}\sideset{}{'}\sum_{\substack{|\underline{a}_1'|<|e_3k_3'| \\ \varpi^{\nu_\varpi(k_3e_3)}\parallel \underline{a}_1\cdot \underline{c}}}\\
&\times\sum_{\substack{\bm{y} \:(e) }}N_f(\underline{a},\bm{y})^{1/2}\sum_{\substack{|\bm{v}-\bm{v}_0|\leq \widehat{V}\\ F_1^*(\bm{v})=0\\ \nabla (\underline{a}\cdot \underline{F})(\bm{y})\equiv t\bm{v} \: (e)}}1.
\end{split}
\end{align}

Let us now write $\bm{v}=\bm{v}_0+\bm{v}_1+\bm{v}_2e$, where $|\bm{v}_1|<|e|$, $t\bm{v}_1\equiv \nabla (\underline{a}\cdot \underline{F})(\bm{y}) \:(e)$ and $|\bm{v}_2|<\widehat{V}|e|^{-1}$. Observe that $(e,t)=1$ implies that $\bm{v}_1$ is unique. Note that $G(\bm{v}_2)=F_1^*(\bm{v}_0+\bm{v}_1+\bm{v}_2e)$ is of degree $3\times 2^{n-2}$ and its leading degree part is absolutely irreducible, so that we may invoke Lemma <ref> to deduce that

\begin{equation}\label{Eq: Estimate.sum.over.v}
\sum_{\substack{|\bm{v}-\bm{v}_0|\leq \widehat{V}\\ F_1^*(\bm{v})=0\\ \nabla (\underline{a}\cdot \underline{F})(\bm{y})\equiv t\bm{v} \: (e)}}1 \ll 1+\left(\frac{\widehat{V}}{|e|}\right)^{n-2}.
\end{equation}

Using the Chinese remainder together with Lemma <ref>, we obtain

\begin{align}
\begin{split}
\sum_{\bm{y}\: (e)}N_f(\underline{a}, \bm{y})^{1/2} & = S_2(e_2,f_2)S_3(e_3,f_3)\left(S_1(e_1,f_1)+S_1'(e_1,f_1)\right)\\
&\ll |e_2|^{n-2+\varepsilon}|f_2||e_3|^{n-1+\varepsilon}|e_3'|^{-1}|f_3|\left(|e_1|^{n-1+\varepsilon}|f_1|^{1/2}+ S_1'(e_1,f_1)\right).
\end{split}
\end{align}

Moreover, the conjunction of the conditions $F_1(\bm{y})F_2(\bm{y})\not\equiv 0 \:(f_1)$ and $F_{\underline{c}}(\bm{y})\equiv 0 \:(f_1)$ can only hold if $(c_1,f_1)=(c_2,f_1)=1$. Therefore, for $C_1\geq C_2\geq 1$ we have

\begin{align}
\begin{split}        \sum_{\substack{\underline{c}\in \O^2_{\text{prim}} \\ |c_i|\leq \widehat{C}_i}}S'_1(e_1,f_1)& \leq \max_{\substack{\underline{a}\: (f_1) \\ (a_1,f_1)=(a_2,f_1)=1}}\sum_{\substack{\bm{y}\: (e_1) \\ F_1(\bm{y})F_2(\bm{y})\not\equiv 0 (f_1)}}N_{f_1}(\underline{a}, \bm{y})^{1/2}\sum_{\substack{ \underline{c}\in \O^2_{\text{prim}}\\ |c_i|\leq \widehat{C}_i \\ F_{\underline{c}}(\bm{y})\equiv 0 \:(e_1) }}1\\
&\leq \widehat{C}_2\left(1+\frac{\widehat{C}_1}{|e_1|}\right)\max_{\substack{\underline{a}\: (f_1) \\ (a_1,f_1)=(a_2,f_1)=1}}\left(\frac{|e_1|}{|f_1|}\right)^n\sum_{\substack{\bm{y}\: (f_1)}}N_{f_1}(\underline{a}, \bm{y})^{1/2}\\
&\ll |e_1|^n\widehat{C}_2\left(1+\frac{\widehat{C}_1}{|e_1|}\right),
\end{split}
\end{align}

where we used (<ref>) together with the Cauchy-Schwarz inequality to arrive at the last estimate.

Next observe that $\underline{a}_2/r_2'\in L(d_2\underline{c})$ implies that $\varpi^{\nu_\varpi(r_2'd_2^{-1})}\mid \underline{a}_2\cdot \underline{c}$, so that that

\begin{equation}\label{Eq: available.a_2}
\#\{|\underline{a}_2|<|e_2k'|\colon \underline{a}_2/r_2' \in L(d_2\underline{c})\}\leq \left(\frac{|e_2k'|}{|r_2'd_2^{-1}|}\right)^{2}|r_2'd_2^{-1}| = |e_2k'|^2|r_2'|^{-1}|d_2|.
\end{equation}

A similar argument delivers

\begin{equation}\label{Eq: available.a_3}
\#\{|\underline{a}_3|<|e_3k'_3|\colon \varpi^{\nu_\varpi(e_3)}\mid \underline{a}_3\cdot \underline{c}\} \leq |k_3'|^2|e_3|.
\end{equation}

Recall that $e=e_1e_2e_3$, $f=f_1f_2f_3$ and $d=d_2d_3$. Then since $k, k'$ are $O(1)$ and $|s|\asymp |r|$, we can combine (<ref>) – (<ref>) with (<ref>) to obtain

\begin{align*}
S(V, C_1, C_2)  \ll &|e|^{n+1}|f|^{n/2+1}|e_1e_3|^2|e_2||f_1|^{1/2}|f_2|^2|f_3||d_2d_3||r_2'|^{-1}|e_3'|^{-1}\left(|e|+\widehat{V}\right)^{n-2}\\
&\times \widehat{C}_2\left(\widehat{C}_1+|e_1||f_1|^{-1/2}+\widehat{C}_1|f_1|^{-1/2}\right)\\
\ll& |d||s|^{(n+3)/2}\frac{|f_2^3f_3|^{1/2}}{|r_2'e_3'|}\widehat{C}_2\left(|e|+\widehat{V}\right)^{n-2}\left(\widehat{C}_1+|e_1||f_1|^{-1/2}\right),
\end{align*}

where we used that $|e^2f|\asymp |s|$ and $d_2d_3=d$. Since $r_2$ is cube-full and $|r_2'|\asymp |r_2|$, we have $f_2^3 \mid r_2$ and thus $|f_2|^{3/2}|r_2'|^{-1}\ll 1$. Moreover, since $\nu_\varpi(d_3')\geq 1$ for all $\varpi \mid e_3$, the definition of $e_3'$ in (<ref>)
implies that $f_3\mid e'_3$ and hence $|f_3|^{1/2}|e_3'|\ll 1$. We have thus established the following result.

Let $s\in \O$ be cube-full and $d\mid s$. Then with the notation of (<ref>), it holds that

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

§ RETURN TO THE CIRCLE METHOD

In this section we combine the estimates for the various exponential sums and integrals that we have produced so far to finish our treatment of $N(P$).  To ease of notation, for $d\in\O$  and $\underline{c}\in \O^2$  we abbreviate the properties $d$ monic, $\underline{c}$ primitive, $|dc_1|\leq \min\{\widehat{T}|r|^{1/2}, \lvert r \rvert\},$ $|dc_2|<\widehat{T}^{-1}|r|^{1/2}$ and $\max\{\widehat{R}_i|dc_i^\bot|\}\geq |r|$ by $P(d,\underline{c})$. In addition, throughout this section we shall assume $n\geq 26$. We will not make the dependence of the implied constants explicit anymore, but allow them to depend at most on $F_1, F_2, w$ and $N$ as well as on $\varepsilon$ if it appears in the inequality. Recall the decomposition of $N(P)$ in (<ref>).

§.§ The main term
We begin to carry out the analysis of $M(P)$. Since we chose $\widehat{R}_2\asymp \widehat{P}^{1/3}$ in (<ref>), it follows from Corollary <ref> that

\begin{equation}\label{Eq: Decomp.M(P)}
M(P)=\widehat{P}^n\sum_{\substack{|r|\ll \widehat{P}^{1/3}\\r\text{ monic}}}|r_N|^{-n}S_rK_r +\widehat{P}^n\sum_{\substack{ \widehat{P}^{1/3}\ll |r|\leq \widehat{R}_1\widehat{R}_2\\r \text{ monic}}}|r_N|^{-1}\sum_{\substack{d\underline{c} \colon  P(d,\underline{c})\\d\mid r}}S_{d\underline{c}, r, \bm{b},N}(\bm{0})K_r,
\end{equation}

\[
S_r=\sideset{}{'}\sum_{\underline{a}\:(r)}\sum_{\substack{|\bm{x}|<|r_N|\\ \bm{x}\equiv \bm{b}\:(N)}}\psi\left(\frac{\underline{a}\cdot\underline{F}(\bm{x})}{r}\right)
\]

\[
\]

It is a consequence of Proposition <ref> that

\begin{equation}\label{MajorInt}
K_r \ll \widehat{P}^{-5+\varepsilon}
\end{equation}

and from Corollary <ref> with $\bm{v}_0=\bm{0}$ and $\widehat{V}=1$
we deduce

\begin{equation}\label{MajorExp}
S_{d\underline{c},r, \bm{b},N}(\bm{v})\ll |d||r|^{5n/6+3/2+\varepsilon}.
\end{equation}

Note that if $c_2\neq 0$, then since $\widehat{T}\asymp \widehat{P}^{1/2}$, the condition $|dc_2|<\widehat{T}^{-1}|r|^{1/2}$  can only hold if $|r|\gg \widehat{P}$. In particular, it is now easy to see that

\begin{equation}\label{sum.dc}
\sum_{\substack{d\underline{c}\colon P(d,\underline{c}) \\ d \mid r}}|d| \ll |r|^{1+\varepsilon}.
\end{equation}

It follows from (<ref>)–(<ref>) that the rightmost term in (<ref>) is of order

\begin{align*}
\widehat{P}^{n-5+\varepsilon}\sum_{\substack{ \widehat{P}^{1/3}\ll|r|\leq \widehat{R}_1\widehat{R}_2\\r \text{ monic}}}\frac{|r|^{5n/6+3/2}}{|r_N|^{n}}\sum_{\substack{d\underline{c}\: P(d,\underline{c})\\d\mid r}}|d| & \ll \widehat{P}^{n-5+\varepsilon}\sum_{\substack{ \widehat{P}^{1/3}\ll|r|\leq \widehat{R}_1\widehat{R}_2\\r \text{ monic}}}|r|^{5/2-n/6}\\
&\ll \widehat{P}^{n-5-(7/2-n/6)/3+\varepsilon},
\end{align*}

where we used that that $7/2-n/6<0$ for $n>21$. Consequently, the contribution from this term is negligible and it remains to investigate the first term on the right hand side of (<ref>).

The first step we take is to analyse the integral $K_r$. Let $C>0$ be a fixed positive integer, whose exact value will be determined in due course. We then split up the integral $K_r$ into

\begin{equation}\label{Eq: Decomp.K_r}
K_r=\int_{|\theta_1|<\widehat{C}^{-1}\widehat{P}^{-3}}\int_{|\theta_2|<\widehat{C}^{-1}\widehat{P}^{-2}}I_{r_N}(\underline{\theta}, \bm{0})\dd\underline{\theta}+\int_{\Xi}I_{r_N}(\underline{\theta},\bm{0})\dd\underline{\theta},
\end{equation}

where $\Xi$ is defined by

\[
\Xi\coloneqq \{\underline{\theta}\in\TT^2\colon |\theta_i|<\widehat{R}_i^{-1}|r|^{-1} \text{ for }i=1,2\text{ and }\widehat{C}^{-1}\widehat{P}^{-3}\leq |\theta_1|\text{ or }\widehat{C}^{-1}\widehat{P}^{-2}\leq |\theta_2|\}.
\]

Note that $\Xi$ is non-empty only if $|r|<\max_{i=1,2}\{\widehat{C}\widehat{R}_i^{-1}\widehat{P}^{4-i}\}$. Since $\widehat{R}_i^{-1}\widehat{P}^{4-i}\asymp \widehat{P}^{5/3}$ by (<ref>), this will certainly hold for $|r|\ll \widehat{P}^{1/3}$ and $P$ sufficiently large. We will show that the second integral vanishes and produce a lower bound for the first one. Beginning with the former task, we have by (<ref>) that the second integral is equal to

\[
\widehat{L}^{-n}\int_{\Xi}\int_{\TT^n}\psi\left(t^{3P}\theta_1G_1(\bm{x})+t^{2P}\theta_2G_2(\bm{x})\right)\dd\bm{x}\dd\underline{\theta},
\]

where $G_i(\bm{x})=F_i(\bm{x}_0+t^{-L}\bm{x})$ for $i=1,2$.
Let $\Gamma = (\{1\}\times \TT) \cup (\TT\times \{1\})$ and define

\[
\lambda =\min_{\underline{\gamma}\in \Gamma}|\gamma_1\nabla F_1(\bm{x}_0)+\gamma_2 \nabla F_2(\bm{x}_0)|.
\]

Observe that $0<\lambda<1$ since $\Gamma$ is compact and $\bm{x}_0$ a non-singular point of the variety defined by $F_1$ and $F_2$ with $|\bm{x}_0|<H_{\underline{F}}^{-1}$. To simplify notation, we write $\gamma_1=t^{3P}\theta_1$ and $\gamma_2=t^{2P}\theta_2$. Let now $\gamma\in \TT$ be such that $|\gamma|=|\underline{\gamma}|$. Then by the ultrametric property we have

\[
|\gamma_1\nabla G_1(\bm{x})+\gamma_2\nabla G_2(\bm{x})|=\widehat{L}^{-1}|\gamma||\gamma_1\nabla F_1(\bm{x}_0)/\gamma +\gamma_2 \nabla F_2(\bm{x}_0)/\gamma |\geq \widehat{L}^{-1}|\gamma|\lambda
\]

provided $L$ is sufficiently large. Moreover, all higher partial derivatives of $\gamma_1G_1(\bm{x})+\gamma_2G_2(\bm{x})$ are of order $O(\widehat{L}^{-2}|\gamma|)$. By the second derivative test <cit.> we thus have $K_r = 0$ if $\widehat{L}^{-1}|\gamma|\lambda \geq 1.$ Since $|\gamma| \geq \widehat{C}^{-1}$, this can be ensured if we make the choice $\widehat{C}=\lambda \widehat{L}^{-1}$, which we henceforth assume.

We proceed to investigate the first integral in (<ref>). After making the change of variables $\gamma_i=t^{(4-i)P}\theta_i$, by (<ref>) we have

\begin{align*}
K_r = \widehat{L}^{-n}\widehat{P}^{-5}\int_{|\underline{\gamma}|<\widehat{C}^{-1}}\int_{\TT^n}\psi\left(\gamma_1G_1(\bm{x})+\gamma_2G_2(\bm{x})\right)\dd\bm{x}\dd\underline{\gamma}.
\end{align*}

It is now clear that $K_r$ is in fact independent of $r$ and to emphasise this, we define

\[
\sigma_\infty\coloneqq \widehat{L}^{-n}\int_{|\underline{\gamma}|<\widehat{C}^{-1}}\int_{\TT^n}\psi\left(\gamma_1G_1(\bm{x})+\gamma_2G_2(\bm{x})\right)\dd\bm{x}\dd\underline{\gamma}.
\]

The integral $\sigma_\infty$ is the singular integral associated to our counting problem and our next step is to show that $\sigma_\infty>0$. To do so, we exchange the order of integration and apply Lemma <ref> to deduce that

\[
\sigma_\infty =\widehat{L}^{-n}\widehat{C}^{-2}\text{meas}\left(\{\bm{x}\in\TT^n\colon |G_i(\bm{x})|<\widehat{C}\text{ for }i=1,2\}\right).
\]

Using Taylor expansion and the fact that $F_i(\bm{x}_0)=0$ for $i=1,2$, it follows that

\[
G_1(\bm{x})=t^{-L}\bm{x}\cdot \nabla F_1(\bm{x}_0) +\frac{1}{2}t^{-2L}\bm{x}^tH(\bm{x}_0)\bm{x}+t^{-3L}F_1(\bm{x})
\]

\[
G_2(\bm{x})=t^{-L}\bm{x}\cdot \nabla F_2(\bm{x}_0)+t^{-2L}F_2(\bm{x}).
\]

Provided $L$ is sufficiently large, we must then have

\[
|G_1(\bm{x})|=\widehat{L}^{-1}|\bm{x}\cdot\nabla F_1(\bm{x}_0)|\quad\text{and}\quad |G_2(\bm{x})|=\widehat{L}^{-1}|\bm{x}\cdot \nabla F_2(\bm{x}_0)|.
\]

However, if we recall that $\widehat{C}=\widehat{L}^{-1}\lambda$, then for $|\bm{x}|< \lambda$ it is clear that

\[
\widehat{L}^{-1}|\bm{x}\cdot \nabla F_i(\bm{x}_0)|<\widehat{L}^{-1}\lambda = \widehat{C},
\]

so that $\sigma_\infty > \widehat{L}^{-n}\widehat{C}^{-2}\lambda^n$. We summarise our investigation of the integral $K_r$ in the following result.

Let $|r|\ll \widehat{P}^{1/3}$. Then

\[
K_r=\sigma_\infty \widehat{P}^{-5},
\]

where $\sigma_\infty >0$ depends only on the weight function $w$.

It follows from Lemma <ref> and the upper bound provided after (<ref>) that

\[
M(P)=\sigma_\infty \mathfrak{S}_{\bm{b},N}(1/3)\widehat{P}^{n-5}+O\left(\widehat{P}^{n-5-\delta'}\right),
\]

for some $\delta'>0$, where for $\Delta>0$ we have defined

\[
\mathfrak{S}_{\bm{b},N}(\Delta)\coloneqq \sum_{\substack{|r|\ll \widehat{P}^{\Delta} \\ r\text{ monic}}}|r_N|^{-N}S_r
\]

to be the truncated singular series associated to our counting problem. Let

\[
\mathfrak{S}_{\bm{b},N}\coloneqq \sum_{r\text{ monic}}|r_N|^{-n}S_r
\]

be the completed singular series. It follows from Lemma <ref> and Lemma <ref> that

\[
S_r = \sideset{}{'}\sum_{\underline{a} \: (r)}T(\underline{a}, r, \bm{0}) \ll |r|^{2+5n/6+\varepsilon}
\]

so that $\mathfrak{S}_{\bm{b},N}$ converges absolutes for $n> 18$ and

\[
\left|\mathfrak{S}_{\bm{b},N}(\Delta)-\mathfrak{S}_{\bm{b},N}\right| \ll \sum_{|r|>\widehat{P}^\Delta}|r|^{2-n/6+\varepsilon} \ll \widehat{P}^{\Delta(3-n/6+\varepsilon)}.
\]

It is a routine exercise to show that $\mathfrak{S}_{\bm{b},N}>0$ provided there exists $\bm{x}_\varpi \in \O^n_\varpi$ such that $F_1(\bm{x}_\varpi)=F_2(\bm{x}_\varpi)=0$ and $|\bm{b}-\bm{x}_\varpi|_\varpi < |N|_\varpi $ for all $\varpi$. In particular, we have established the following result.

For $n>18$ we have

\[
M(P)=\sigma_\infty \mathfrak{S}_{\bm{b},N}\widehat{P}^{n-5}+O\left(\widehat{P}^{n-5-\delta''}\right)
\]

for some $\delta''>0$ with $\sigma_\infty>0$. Moreover, $\mathfrak{S}_{\bm{b},N}>0$ if for every $\varpi$ there exists $\bm{x}_\varpi \in \O^n_\varpi$ such that $F_1(\bm{x}_\varpi)=F_2(\bm{x}_\varpi)=0$ and $|\bm{b}-\bm{x}_\varpi|_\varpi < |N|_\varpi $.

To prove Proposition <ref> and hence also Theorems <ref> and <ref>, it remains to give a satisfactory upper bound for the error term $E_1(P)$ defined in (<ref>). This will occupy the remainder of our work and makes use of the various estimates we have provided for the oscillatory integrals and exponentials sums under consideration.

§.§ Preparation for the error terms
We continue our investigation of the error term $E_1(P)$. Before doing so, we take some preliminary steps. Firstly, we shall fix the absolute value of $r$ to be $\widehat{Y}$ and of $\theta_i$ to be $\widehat{\Theta}_i$ for $i=1,2$ respectively, where

\begin{equation}
1\leq Y\leq R_1+R_2, \quad\quad -9P+R_2 \leq \Theta_1 < -Y- R_1\quad\text{and}\quad -9P+R_1 \leq \Theta_2 < -Y-R_2.
\end{equation}

and neither of the conditions (<ref>) nor (<ref>) recorded after (<ref>) hold. Observe that by our choice of $R_1$ and $R_2$ in (<ref>) the number of admissible triples $(Y,\Theta_1, \Theta_2)$ is $O(\widehat{P}^\varepsilon)$.  Secondly, we treat separately the contribution from $c_2\neq 0$ and $c_2 =0$ and denote the contribution of such $r$'s, $\underline{\theta}$'s and $\underline{c}$'s to $E_1(P)$ by $E_{1,a}(Y, \Theta_1,\Theta_2)$ and $E_{1,b}(Y,\Theta_1, \Theta_2)$ respectively, so that

\begin{equation}\label{Eq: DefE1a}
E_{1,a}(Y, \Theta_1, \Theta_2) = \widehat{P}^n\sum_{\substack{|r|= \widehat{Y}\\ r\text{ monic}}}|r_N|^{-n}\sum_{\substack{d \underline{c}: P(d\underline{c})\\ c_2\neq 0 \\ d\mid r}}\int_{|\theta_i|=\widehat{\Theta}_i}\sum_{\substack{\bm{v}\in \O^n\setminus\{\bm{0}\}}} S_{d\underline{c},r,\bm{b},N}(\bm{v})I_{r_{N}}(\underline{\theta},\bm{v})\dd\underline{\theta}
\end{equation}

\begin{equation}\label{Eq: DefE1b}
E_{1,b}(Y,\Theta_1,\Theta_2) = \widehat{P}^n\sum_{\substack{|r|= \widehat{Y}\\ r\text{ monic}}}|r_N|^{-n}\sum_{\substack{|d|\leq \widehat{Y}^{1/2}P^{1/2} \\ d \mid r}}\int_{|\theta_i|=\widehat{\Theta}_i}\sum_{\substack{\bm{v}\in \O^n\setminus\{\bm{0}\}}} S_{d\underline{c}_0,r,\bm{b},N}(\bm{v})I_{r_{N}}(\underline{\theta},\bm{v})\dd\underline{\theta}
\end{equation}

where $\underline{c}_0=(1,0)$ since by our convention $\underline{c}$ with $c_2=0$ can only be primitive when $c_1=1$. If we can show that $E_{1,i}(Y, \Theta_1,\Theta_2)\ll \widehat{P}^{n-5-\kappa}$ for $i=a,b$ and some $\kappa>0$, then  since the number of admissible triples $(Y,\Theta_1,\Theta_2)$ is $O(\widehat{P}^\varepsilon)$, the same estimate will hold with a new choice of $\kappa$ for $E_{1}(P)$. Moreover, if we let $\widehat{Z}= \max\{1, \widehat{P}^3\widehat{\Theta}_1, \widehat{P}^2\widehat{\Theta}_2\}$, then  (<ref>) implies that the summation range of $\bm{v}$ in the definition of $E_{1, i}(Y,\Theta_1,\Theta_2)$ is empty unless

\begin{equation}\label{Eq: TruncateV}
|\bm{v}|\ll\widehat{V},\quad\text{where} \quad \widehat{V}= \frac{\widehat{Y}\widehat{Z}}{\widehat{P}}.
\end{equation}

In particular, since $\bm{v}\neq \bm{0}$, it must also hold that

\begin{equation}\label{Eq: LowerBoundYZ}
\widehat{Y}\widehat{Z}\gg \widehat{P}.
\end{equation}

Finally, we use the convention that $\varepsilon>0$ is an arbitrarily small real number whose exact value may change from one appearance to the next.

§.§.§ Treatment of $E_{1,a}(Y, \Theta_1,\Theta_2)$
Note that we must have

\begin{equation}\label{Eq: E1a.lowerBoundY}
\widehat{Y}\gg \widehat{P},
\end{equation}

because as $c_2\neq 0$ and $\widehat{T}\asymp \widehat{P}^{1/2}$, the inequality $|dc_2|<\widehat{T}^{-1}\widehat{Y}^{1/2}$ can only hold if $\widehat{Y}\gg \widehat{P}$. Since we assume that $c_2\neq 0$, Lemma <ref> gives strong upper bounds for $S_{\underline{c}, r, \bm{b},N}(\bm{v})$ provided $r$ is square-free and $(r,F_1^*(\bm{v}))=1$. Accordingly, we shall further split up $E_{1,a}(Y, \Theta_1, \Theta_2)$ into the contribution from those $\bm{v}$ with $F_1^*(\bm{v})\neq 0$ and $F_1^*(\bm{v})=0$ and denote it by $E'_1$ and $E'_2$ respectively. In the treatment of $E_2'$ we compensate the worse exponential sum estimates compared to $E_1'$ by exploiting the sparsity of vectors $\bm{v}$ such that $F_1^*(\bm{v})=0$.

Let us begin by dealing with the term $E_1'$. Applying (<ref>) and Lemma <ref> to the integral $I_{r_N}(\underline{\theta}, \bm{v})$ in (<ref>), it follows that

\begin{equation}\label{Eq: E_1a(Y)}
E_1' \leq |N|^n\widehat{L}^{-n} \frac{\widehat{P}^n}{\widehat{Y}^n}\sum_{\substack{d\underline{c}\colon P(d\underline{c})\\ c_2\neq 0}}\int_{|\underline{\theta}|=\underline{\widehat{\Theta}}} \int_{\TT^n}\sum_{\substack{|\bm{v}-\bm{v}_0|<\widehat{V}\widehat{Z}^{-1/2}\\ F_1^*(\bm{v})\neq 0}}\sum_{\substack{|r|=\widehat{Y}\\d\mid r}}|S_{d\underline{c}, r, \bm{b}, M}(\bm{v})|\dd \bm{x}\dd\underline{\theta},
\end{equation}

where $\bm{v}_0=-r_Nt^{L}(t^{3P} \nabla F_1(\bm{x}_0+t^{-L}\bm{x})+t^{2P}\nabla F_2(\bm{x}_0+t^{-L}\bm{x}))$.
Our next goal is to estimate the sum

\[
S\coloneqq \sum_{\substack{|\bm{v}-\bm{v}_0|<\widehat{V}\widehat{Z}^{-1/2}\\ F^*_1(\bm{v})\neq 0}}\sum_{\substack{|r|=\widehat{Y}\\ d\mid r}}|S_{d\underline{c},r,\bm{b},N}(\bm{v})|.
\]

For this we write $r=b_1b_1'b_2b_2'r_3$ into pairwise coprime $b_1,b_1', b_2, b_2', r_3\in \O$, where $b_1b_1'$ is the square-free part of $r$ satisfying $(b_1,dNF_1^*(\bm{v})c_2)=1$; $b_2b_2'$ is such that $\nu_\varpi(b_2b_2')=2$ for all $\varpi \mid b_2b_2'$ and $(b_2, dNc_2)=1$ and $r_3$ is the cube-full part of $r$. Accordingly we shall also write $d=d_1d_2d_3$ with $d_1\mid b_1'$, $d_2\mid b_2'$ and $d_3\mid r_3$. We can then use the multiplicativity of $S_{d\underline{c}, r, \bm{b}, N}(\bm{v})$ recorded in Lemma <ref> to deduce for appropriate $t_1, t_1', t_2, t_2', t_3, N_1, N_2, N_3\in \O$ that

\begin{align}
\begin{split}\label{Eq: E1a.ExpSums}
|S_{d\underline{c}, r, \bm{b}, N}(\bm{v})| & = |S_{b_1}(t_1\bm{v})S_{d_1\underline{c}, b_1', \bm{b}, N_1}(t'_1\bm{v})S_{b_2}(t_2\bm{v})S_{d_2\underline{c}, b'_2, \bm{b}, N_2}(t'_2\bm{v})S_{d_3\underline{c}, r_3, \bm{b}, N_3}(t_3\bm{v})|\\
&\ll |r|^{\varepsilon}|b_1|^{(n+1)/2}|b_2|^{n/2+1}|d_1d_2||b_1'b'_2|^{(n+3)/2}|S_{d_3\underline{c}, r_3, \bm{b}, N_3}(t_3\bm{v})|,
\end{split}
\end{align}

where we used Lemmas <ref>, <ref> and <ref> to estimate the sums corresponding to $b_1$, $b_1'$ and $b_2$ respectively and Corollary <ref> for the sum corresponding to $b_2'$. Moreover, by Corollary <ref> we have

\begin{equation}\label{Eq: E1a.Averagev}
\sum_{\substack{|\bm{v}-\bm{v}_0|<\widehat{V}\widehat{Z}^{-1/2}\\ F^*_1(\bm{v})\neq 0}}|S_{d_3\underline{c}, r_3, \bm{b}, N_3}(t_3\bm{v})|\ll |d_3| |r_3|^{n/2+1+\varepsilon}|r_3''|^{1/2}\left(\widehat{V}^n\widehat{Z}^{-n/2}+|r_3|^{n/3}\right),
\end{equation}

where $r_3=r_3'r_3''$ with $(r_3',d)=1$ are defined in (<ref>). Consequently, plugging (<ref>) and (<ref>) into the definition of $S$ yields

\begin{align*}
S &\ll \widehat{Y}^{(n+1)/2+\varepsilon} |d|\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right)\sum_{\substack{|r|=\widehat{Y} \\ d\mid r}} |b_2r_3'|^{1/2}|b_1'b_2'r_3''|\\
& = \widehat{Y}^{(n+3)/2+\varepsilon} |d|\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right)\sum_{\substack{|r|=\widehat{Y} \\ d\mid r}} |b_1|^{-1}|b_2r'_3|^{-1/2},
\end{align*}

since $|b_1b_1'b_2b_2'r_3'r_3''|=\widehat{Y}$. By definition, we must have $b_1'b_2'r_3''\mid (dNc_2F_1^*(\bm{v}))^\infty$. The number of available $b_1', b_2', r_3''$ with $|b_1'b_2'r_3''|\leq \widehat{Y}$ is hence $O(\widehat{Y}^\varepsilon)$. Moreover, since $b_2r_3'$ is square-full, the number of $b_2$ and $r_3'$'s of fixed absolute value $\widehat{B}$ is $O(\widehat{B}^{1/2}$). After summing over $q$-adic intervals it thus follows that

\[
S \ll \widehat{Y}^{(n+3)/2+\varepsilon}|d|\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right)
\]

and hence

\begin{align*}
E_1' &\ll \widehat{P}^n\widehat{Y}^{3/2-n/2+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\sum_{d\underline{c}\colon P(d\underline{c})}|d|\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right)\\
&\ll \widehat{P}^{n-5}\widehat{Y}^{5/2-n/2+\varepsilon}\widehat{Z}^2\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right),
\end{align*}

where we used that $\widehat{\Theta}_1\widehat{\Theta}_2\ll \widehat{P}^{-5}\widehat{Z}^2$ and $\sum_{d\underline{c}\colon P(d\underline{c})}|d|\ll \widehat{Y}^{1+\varepsilon}$. If the first term in the brackets dominates, we get

\begin{align*}
E_1' \ll \widehat{P}^{-5}\widehat{Y}^{5/2+n/2+\varepsilon}\widehat{Z}^{2+n/2}
\ll \widehat{P}^{5n/6-5 +10/3}\widehat{Y}^{1/2+\varepsilon}
\ll \widehat{P}^{5n/6 - 5/3+5/6+\varepsilon},
\end{align*}

because $\widehat{Z}\ll \widehat{P}^{5/3}\widehat{Y}^{-1}$ and $\widehat{Y}\ll \widehat{P}^{5/3}$. Thus, the contribution from $E_1'$ in this case is $O(\widehat{P}^{n-5-\kappa})$ for some $\kappa>0$ as soon as $n>25$. If the second term dominates, then

\begin{align*}
E_1'\ll \widehat{P}^{n-5}\widehat{Y}^{5/2-n/6+\varepsilon}\widehat{Z}^2\ll \widehat{P}^{n-5+10/3}\widehat{Y}^{1/2-n/6+\varepsilon}\ll \widehat{P}^{n-5 +10/3 +1/2 -n/6+\varepsilon},
\end{align*}

where we used that $\widehat{Y}\gg \widehat{P}$ by (<ref>). This is satisfactory as soon as $n>23$, which completes our treatment of $E_1'$.

Next we consider the contribution from $E_2'$. This time we apply Lemma <ref> to the integral $I_{r_N}(\underline{\theta},\bm{v})$ and obtain

\[
E_2'\ll \frac{\widehat{P}^n}{\widehat{Y}^n}\widehat{Z}^{1-n/2}\widehat{\Theta}_1\widehat{\Theta}_2\sum_{|d|\leq \widehat{T}^{-1/2}|\widehat{Y}|^{1/2}}\sum_{\substack{|c_i|<\widehat{C}_i \\ c_2\neq 0}}\sum_{\substack{0<|\bm{v}|\leq \widehat{V}\\ F_1^*(\bm{v})=0}}\sum_{\substack{|r|=\widehat{Y}\\ d\mid r}}|S_{d\underline{c}, r, \bm{b}, N}(\bm{v})|,
\]

where $\widehat{C}_1=\widehat{T}\widehat{Y}^{1/2}|d|^{-1}$ and $\widehat{C}_2=\widehat{T}^{-1}\widehat{Y}^{1/2}|d|^{-1}$. We proceed to consider the sum

\[
S' \coloneqq \sum_{\substack{|c_i|<\widehat{C}_i \\ c_2\neq 0}}\sum_{\substack{0<|\bm{v}|\leq \widehat{V}\\ F_1^*(\bm{v})=0}}\sum_{\substack{|r|=\widehat{Y}\\ d\mid r}}|S_{d\underline{c}, r, \bm{b}, N}(\bm{v})|.
\]

For this we first factor $r=b_1b_2r_3$ into pairwise coprime $b_1, b_2, r_3\in \O$ and $d=d_2d_3$ with $d_2\mid b_2$ and $d_3\mid r_3$, where $b_1$ is square-free, $b_2$ is cube-free, $(b_1,dNc_2)=1$ and $r_3$ is the cube-full part of $r$.  Parallel to our argument for $E_1'$ we use Lemma <ref> to factor $S_{d\underline{c}, r, \bm{b}, N}(\bm{v})$ and invoke Lemmas <ref> and <ref> to bound the sum corresponding to $b_1$ as well as Lemma <ref> and Corollary <ref> to bound the sum corresponding to $b_2$ to obtain

\[
S_{d\underline{c},r, \bm{b}, N}(\bm{v})\ll |r|^{\varepsilon}|d_2||b_1|^{n/2+1}|b_2|^{(n+3)/2}|S_{d_3\underline{c}, r_3, \bm{b}, N'}(t\bm{v})|
\]

for appropriate $t, N' \in \O$. We wish to apply Lemma <ref> to estimate the average

\[
A\coloneqq \sum_{|c_i|< \widehat{C}_i}\sum_{\substack{0<|\bm{v}|\leq \widehat{V}\\ F_1^*(\bm{v})=0}}|S_{d_3\underline{c}, r_3, \bm{b}, N'}(t\bm{v})|.
\]

For this note that with the notation of Lemma <ref> for $P$ sufficiently large we have ${|e_1|\leq \widehat{Y}^{1/2} \ll\widehat{Y}^{1/2}\widehat{T}|d|^{-1}=\widehat{C}_1}$, since $\widehat{T}\asymp \widehat{P}^{1/2}$ and $|d|\leq \widehat{Y}^{1/2}\widehat{T}^{-1} \ll \widehat{P}^{1/3}$. In particular, Lemma <ref> hands us

\begin{align}
\begin{split}\label{Eq: E1b.A}
A &\ll |d_3||r_3|^{n/2+3/2+\varepsilon}\widehat{C}_1\widehat{C}_2\left(|r_3|^{n/2-1}+\widehat{V}^{n-2}\right)
\end{split}
\end{align}

We may also forget about the condition $F_1^*(\bm{v})=0$ and use Corollary <ref> to obtain the alternative estimate

\begin{equation}\label{Eq: E1b.A'}
A\ll \widehat{C}_1\widehat{C}_2|d_3||r_3|^{n/2+1+\varepsilon}|r_3''|^{1/2}\left(\widehat{V}^n +|r_3|^{n/3}\right),
\end{equation}

where $r_3=r_3'r_3''$ with $r_3'$ given by (<ref>). In particular, we have shown so far that

\begin{equation}\label{Eq: EstimateA}
A \ll \widehat{C}_1\widehat{C}_2|d_3||r_3|^{n/2+1+\varepsilon}\min\left\{|r_3|^{1/2}\left(\widehat{V}^{n-2}+|r_3|^{n/2-1}\right), |r_3''|^{1/2}\left(\widehat{V}^n+|r_3|^{n/3}\right)\right\}.
\end{equation}

We begin with the contribution from $\widehat{V}\geq |r_3|^{1/2}$ or $\widehat{V}\leq |r_3|^{1/3}$. Since $b_2r_3''\mid (Ndc_2)^{\infty}$, there are at most $O(\widehat{P}^\varepsilon)$ pairs $(b_2, r_3'')$. Moreover, since $r_3$ is cube-full, there are  $O(|r_3|^{1/3})$ available $r_3$ of fixed absolute. One now easily derives

\[
\sum_{\substack{|r|=\widehat{Y}\\ d\mid r}}|b_2r_3|^{1/2} \ll \widehat{Y}^{1+\varepsilon}.
\]

In addition, we also have

\begin{equation}\label{Eq: SumdC}
\sum_{|d|\leq \widehat{T}^{-1}\widehat{Y}^{1/2}}\widehat{C}_1\widehat{C}_2|d| = \widehat{Y}\sum_{|d|\leq \widehat{T}^{-1}\widehat{Y}^{1/2}}|d|^{-1} \ll \widehat{Y}^{1+\varepsilon}.
\end{equation}

After employing the estimates $\widehat{\Theta}_1\widehat{\Theta}_2 \ll \widehat{P}^{-5}\widehat{Z}^2$ and $|r_3|\leq \widehat{Y}$, we have in the cases under consideration

\begin{equation}
E_2' \ll \widehat{P}^{n-5}\widehat{Y}^{3-n/2}\widehat{Z}^{3-n/2}\left(\widehat{V}^{n-2}+\widehat{Y}^{n/3}\right).
\end{equation}

If the first term dominates, we obtain

\begin{align*}
E_2'  \ll \widehat{P}^{-3}\widehat{Y}^{1+n/2+\varepsilon}\widehat{Z}^{1+n/2}\ll \widehat{P}^{5n/6-3+5/3+\varepsilon},
\end{align*}

which is satisfactory if $n>22$. On the other hand, if $\widehat{Y}^{n/3}\geq \widehat{V}^{n-2}$, then

\begin{align*}
E_2'  \ll \widehat{P}^{n-5}\widehat{Y}^{3-n/6+\varepsilon}\widehat{Z}^{3-n/2}\ll \widehat{P}^{n-5+(3-n/6)+\varepsilon},
\end{align*}

by (<ref>) and because $\widehat{Z}\geq 1$. Thus this contribution is sufficiently small as soon as $n>18$.

Finally, we have to deal with the contribution from $|r_3|^{1/3}<\widehat{V}<|r_3|^{1/2}$. For this, we use that for any  real numbers $A, B>0$ and $0\leq \kappa \leq 1$ that $\min\{A,B\}\leq A^{1-\kappa}B^\kappa$ with $\kappa=1/(n-2)$ to deduce that

\begin{align*}
S' & \ll \widehat{C}_1\widehat{C}_2 |d| \widehat{V}^{n(1-\kappa)}\widehat{Y}^{n/2+1+\varepsilon}\sum_{\substack{|r|}=\widehat{Y}}|b_2|^{1/2}|r_3''|^{(1-\kappa)/2}|r_3|^{\kappa(n-1)/2}\\
&\ll \widehat{C}_1\widehat{C}_2 |d| \widehat{V}^{n(1-\kappa)}\widehat{Y}^{n/2+2+\varepsilon}\sum_{|b_2r_3'r_3''|\leq \widehat{Y}}|b_2|^{-1/2}|r_3'|^{(n-1)/(2n-4)-1}.
\end{align*}

The number of available $b_2$ of fixed absolute value is $O(|b_2|^{1/2})$. Moreover, there are at most $O(\widehat{Y}^{\varepsilon})$ possibilities for $r_3''$. Since $(n-1)/(2n-4)-1<-1/3$ for $n\geq 6$ and the number of $|r'_3|$ of fixed absolute value is $O(|r'_3|^{1/3})$, it follows that the sum above is $O(\widehat{Y}^\varepsilon)$. Therefore, we have

\begin{equation}
S' \ll \widehat{C}_1\widehat{C}_2 |d| \widehat{V}^{n(1-\kappa)}\widehat{Y}^{n/2+2+\varepsilon}.
\end{equation}

Therefore, the contribution to $E_2'$ is at most

\begin{align*}
\frac{\widehat{P}^n}{\widehat{Y}^n}\widehat{Z}^{1-n/2}\widehat{\Theta}_1\widehat{\Theta}_2 \sum_{d}S' & \ll \widehat{P}^{n-5/3+\varepsilon}\widehat{Y}^{1-n/2}\widehat{Z}^{1-n/2}\widehat{V}^{n(1-\kappa)}\\
&= \widehat{P}^{-5/3 + n\kappa +\varepsilon}\widehat{Y}^{1+n/2-\kappa n}\widehat{Z}^{1+n/2-\kappa n}\\
&\ll \widehat{P}^{5n/6 -2\kappa n /3 +\varepsilon},
\end{align*}

where we used $\widehat{\Theta}_1\widehat{\Theta}_2\ll \widehat{P}^{-5/3}\widehat{Y}^{-2}$ and (<ref>) to estimate the sum over $d$. One can check that $5n/6- 2n/(3n-6)<n-5$ provided $n\geq 26$, which completes our treatment of $E_2'$ and thus also of $E_{1,a}(Y, \Theta_1, \Theta_2)$.

§.§.§ Treatment of $E_{1,b}(Y,\Theta_1,\Theta_2)$
We differ our treatment according to the size of $Y$. When $\widehat{Y}\geq \widehat{P}^{1-\eta}$, where $\eta$ is as in (<ref>) after (<ref>), it is more efficient to estimate the sum over $\bm{v}$ via the same trick that we used to arrive at (<ref>), whereas when $\widehat{Y}\leq \widehat{P}^{1-\eta}$, we estimate the integral directly. Before doing so, for $W\geq 1$ we focus on the sum

\[
\Sigma(W)\coloneqq \sum_{\substack{|\bm{v}-\bm{v}_0|<\widehat{W}}}\sum_{|d|\leq \widehat{K}}\sum_{\substack{|r|=\widehat{Y} \\ d\mid r}}|S_{d\underline{c}_0, r, \bm{b}, N}(\bm{v})|,
\]

where $\widehat{K}=\min\{\widehat{Y}, \widehat{Y}^{1/2}\widehat{T}\}$.

To begin with, let us write $r=sr_3$, where $s$ is the cube-free part of $r$ and $r_3$ is cube-full. Moreover, we write $d=ef_1f_2^2d_3$ into pairwise coprime $e,f_1,f_2, d_3\in \O$, where $ef_1f_2$ is square-free, $e$ is the greatest common divisor of $s$ and the square-free part of $d$, $ef_1^2f_2^2\mid s$ and $d_3\mid r_3$. The multiplicativity of $S_{d\underline{c}_0, r, \bm{b},N}(\bm{v})$ together with Proposition <ref> then imply

\[
S_{d\underline{c}_0, r,\bm{b}, N}(\bm{v})\ll \widehat{Y}^{\varepsilon}|f_1f_2|^{1/2}|s|^{(n+3)/2}|S_{d_3\underline{c}_0,r_3, \bm{b}, N'}(t\bm{v})|,
\]

for some $N'\mid N$ and $t\in \O$ with $(t, r_3)=1$. Moreover, the number of available $s$ is $O(\widehat{Y}|e_1f_1^2f_2^2r_3|^{-1})$, so that

\[
S\ll \widehat{Y}^{(n+5)/2+\varepsilon}\sum_{d}\sum_{\bm{v}}\sum_{d=ef_1f_2^2d_2}|e_1f_1|^{-1}|f_2|^{-1/2}\sum_{\substack{|r_3|\leq \widehat{Y} \\ d_3\mid r_3}}\frac{|S_{d_3\underline{c}_0,r_3, \bm{b}, N'}(t\bm{v})|}{|r_3|^{(n+5)/2}}.
\]

Next we factor $r_3$ into $d_3's_1s_2$ into pairwise coprime $d_3', s_1, s_2$, where $d_3'\mid d_3$, $(s_2, N'\Delta_{F_2})=1$ and $\nu_\varpi(s_2)>\nu_\varpi(d_3)$, so that $s_1\mid (N'\Delta_{F_2})^\infty$. Accordingly we shall also write $d_3=d_3'g_1g_2$, so that $g_i\mid s_i$ for $i=1,2$. Let $u\in \O$ and suppose that

\[
u=\prod b_i^i, \quad (b_i,b_j)=1\text{ if }i\neq j, \quad b_i \text{ square-free}.
\]

We then define the function

\[
m(u)\coloneqq b_1^3b_2^3\prod_{i\geq 3}b_i^{i+1}.
\]

Note that since $s_3$ is cube-full and $\nu_\varpi(s_2)>\nu_\varpi(g_2)$, we must then have $m(g_2)\mid s_2$. By Lemma <ref> we then have for some $t_1, t_2 \in \O$ with $(t_1, d_3's_1)=(t_2,s_2)=1$ and $N''\mid N'$ that

\[
S_{d_3\underline{c}_0, r_3,\bm{b}, N'}(t\bm{v})=S_{d'_3g_1\underline{c}_0, d_3's_1, \bm{b}, N''}(t_1\bm{v})S_{g_2\underline{c}_0, s_2, \bm{0}, 1}(t_2\bm{v}).
\]

Therefore, it follows from Proposition <ref> that

\begin{align*}    \sum_{\substack{|r_3|\leq \widehat{Y} \\ d_3\mid r_3}}\frac{|S_{d_3\underline{c}_0,r_3, \bm{b}, N'}(t\bm{v})|}{|r_3|^{(n+5)/2}} & \ll \widehat{Y}^\varepsilon \sum_{d_3=d_3'g_1g_2}\sum_{\substack{|s_1|\leq \frac{\widehat{Y}}{|d_3'|}\\ g_1\mid s_1}}\frac{|S_{d'_3g_1\underline{c}_0, d_3's_1, \bm{b}, N''}(t_1\bm{v})|}{|d_3's_1|^{(n+5)/2}}\sum_{\substack{|s_2|\leq \widehat{Y}\\ m(g_2)\mid s_2}}|g_2||s_2|^{-1}\\
&\ll\widehat{Y}^\varepsilon \sum_{d_3=d_3'g_1g_2}|g_2||m(g_2)|^{-1}\sum_{\substack{|s_1|\leq \frac{\widehat{Y}}{|d_3'|}\\ g_1\mid s_1}}\frac{|S_{d'_3g_1\underline{c}_0, d_3's_1, \bm{b}, N''}(t_1\bm{v})|}{|d_3's_1|^{(n+5)/2}},
\end{align*}

where we used that there are at most $O(|s_2|^{1/3})$ available $s_2$ of fixed absolute value, because $s_2$ is cube-full. Next we change the order of summation and make the sum over $\bm{v}$ the innermost one. We then use Corollary <ref> to deduce

\begin{align*}
\sum_{\substack{|s_1|\leq\frac{\widehat{Y}}{|d_3'|}\\ g\mid s_1}}\sum_{|\bm{v}-\bm{v}_0|<\widehat{W}}\frac{|S_{d'_3g_1\underline{c}_0, d_3's_1, \bm{b}, N''}(t_1\bm{v})|}{|d_3's_1|^{(n+5)/2}} &\ll|d_3'|^{-1/2}|g_1|\sum_{\substack{|s_1|\leq\frac{\widehat{Y}}{|d_3'|}\\ g_1\mid s_1}}|s_1|^{-1}\left(\widehat{W}^n+|d_3's_1|^{n/3}\right)\\
&\ll |d_3'|^{-1/2}\widehat{W}^n+|d_3'|^{-1/2}\widehat{Y}^{n/3+\varepsilon}.
\end{align*}

From what we have shown so far, it follows that

\[
\Sigma(W)\ll \widehat{Y}^{(n+5)/2+\varepsilon}\sum_{|d|\leq \widehat{K}}\sum_{d=e_1f_1f_2^2d_3}\sum_{d_3=d_3'g_1g_2}|e_1f_1|^{-1}|f_2|^{-1/2}|g_2||m(g_2)|^{-1}|d_3'|^{-1/2}\left(\widehat{W}+\widehat{Y}^{n/3}\right).
\]

Let now $k\in \ZZ_{>0}$ be such that $1/k<\varepsilon$ and write

\[
d=h'h_1h_2^2\cdots h_k^kh_{k+1}, \quad (h', h_i)=(h_i,h_j)=1, h'\mid (N\Delta_{F_2})^\infty \text{ for }i\neq j,
\]

where $h_i$ is square-free for $i=1,\dots, k$ and $h_{k+1}$ is $(k+1)$th-powerful. Recalling the definition of $m(g_2)$ and that $d_3'$ is cube-full, it is then not hard to see that

\begin{align*}
\sum_{|d|\leq \widehat{K}}\sum_{d=e_1f_1f_2^2d_3}\sum_{d_3=d_3'g_1g_2}|e_1f_1|^{-1}|f_2|^{-1/2}|g_2||m(g_2)|^{-1}|d_3'|^{-1/2} & \leq \sum_{|d|\leq \widehat{K}}|h_1\cdots h_k|^{-1}\sum_{d=ef_1f_2^2d_2}\sum_{d_3=d_3'g_1g_2}1\\
&\ll \sum_{|d|\leq \widehat{K}}|d|^\varepsilon |h_1\cdots h_k|^{-1}\\
&\ll \widehat{K}^{1/k+\varepsilon}.
\end{align*}

Therefore, the definition of $S$ and our choice of $k$ implies after redefining $\varepsilon$ that

\begin{equation}\label{Eq: Estimate.Sigma(W)}
\Sigma(W)\ll \widehat{Y}^{(n+5)/2+\varepsilon}\left(\widehat{W}+\widehat{Y}^{n/3}\right).
\end{equation}

We now apply (<ref>) to estimate $E_{1,b}(Y, \Theta_1, \Theta_2)$ in two different ways according to the size of $Y$. Let us begin by assuming that $\widehat{Y}\geq \widehat{P}^{1-\eta}$. In this case, we deduce from (<ref>) and Lemma <ref> that

\[
E_{1,b}(Y,\Theta_1,\Theta_2)\leq |N|^n\widehat{L}^{-n}\frac{\widehat{P}^n}{\widehat{Y}^n}\int_{|\underline{\theta}|=\underline{\widehat{\Theta}}}\int_{\TT^n}\sum_{\substack{|\bm{v}-\bm{v}_0|<\widehat{V}\widehat{Z}^{-1/2}}}\sum_{|d|\leq \widehat{K}}\sum_{\substack{|r|=\widehat{Y} \\ d\mid r}}|S_{d\underline{c}_0, r, \bm{b}, N}(\bm{v})|\dd\bm{x}\dd \underline{\theta},
\]

where $\bm{v}_0=-r_Mt^{L}(t^{3P} \nabla F_1(\bm{x}_0+t^{-L}\bm{x})+t^{2P}\nabla F_2(\bm{x}_0+t^{-L}\bm{x}))$.
We can now use (<ref>) with $\widehat{W}=\widehat{V}\widehat{Z}^{-1/2}$ to deduce that

\begin{align*}
E_{1,b}(Y,\Theta_1,\Theta_2)&\ll \widehat{P}^{n}\widehat{Y}^{5/2-n/2+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\left(\widehat{V}^n\widehat{Z}^{-n/2}+\widehat{Y}^{n/3}\right)\\
&= \widehat{Y}^{5/2+n/2+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\widehat{Z}^{n/2}+\widehat{P}^{n}\widehat{Y}^{5/2-n/6+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\\
&\ll \widehat{P}^{5n/6-5/3}\widehat{Y}^{1/2+\varepsilon}+\widehat{P}^{n-5/3+(1-\eta)(1/2-n/6+\varepsilon)}.
\end{align*}

The first term is $O(\widehat{P}^{5n/6-5/6+\varepsilon})$, which is satisfactory as soon as $n\geq 26$. Moreover, $n-5/3+(1/2-n/6)<n-5$ if $n\geq 24$. In particular, the second term is sufficiently small provided $\varepsilon$ is small.

If $\widehat{Y}\leq \widehat{P}^{1-\eta}$ we instead estimate the integral $I_{r_N}(\underline{\theta}, \bm{v})$ directly via Lemma <ref> to obtain

\begin{align*}
E_{1,b}(Y,\Theta_1,\Theta_2)&\ll \frac{\widehat{P}^n}{\widehat{Y}^n}\widehat{\Theta}_1\widehat{\Theta}_2\widehat{Z}^{1-n/2-\mu}\Sigma(\widehat{V}),
\end{align*}

\[
\mu = \begin{cases} 1/2 &\text{if }\widehat{P}\widehat{\Theta}_1\ll \widehat{\Theta}_2\\
0 &\text{else.}\end{cases}
\]

We can now apply (<ref>) with $\widehat{W}=\widehat{V}$ to deduce that

\begin{align*}
E_{1,b}(Y, \Theta_1,\Theta_2) & \ll \widehat{P}^n \widehat{Y}^{5/2-n/2+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\widehat{Z}^{1-n/2-\mu}\left(\widehat{V}^n+\widehat{Y}^{n/3}\right)\\
&= \widehat{Y}^{5/2+n/2+\varepsilon}\widehat{\Theta}_1\widehat{\Theta}_2\widehat{Z}^{1+n/2-\mu}+\widehat{P}^{n-5}\widehat{Y}^{5/2-n/6+\varepsilon}\widehat{Z}^{3-n/2-\mu}.
\end{align*}

The second term is satisfactory by (<ref>) if $n>15$, so we may assume the first one dominates. Recall that we already dealt with the case when $\widehat{Y}\widehat{\Theta}_1\geq \widehat{P}^{-\delta}$, where $\delta = 8(n-16)/(3n-24)$, since we assume (<ref>) after (<ref>) does not hold. So we may suppose the contrary is true. There are now two cases: First, we assume that $\widehat{\Theta}_2\ll \widehat{P}\widehat{\Theta}_1$. In this situation we have $\widehat{Z}\ll \widehat{P}^{3-\delta}\widehat{Y}^{-1}$ and $\mu=0$, so that

\begin{align*}
E_{1,b}(Y,\Theta_1,\Theta_2)\ll \widehat{P}^{(3-\delta)(1+n/2)+1-2\delta}\widehat{Y}^{-1/2+\varepsilon}.
\end{align*}

A rather involved computation or a check with a computer algebra program verifies that $(3-\delta)(1+n/2)+1-2\delta<n-5$ if $n\geq 25$, which is satisfactory.

The only case that remains is when $\widehat{P}\widehat{\Theta}_1\ll \widehat{\Theta}_2$, in which case $\mu=1/2$ and hence

\[
E_{1,b}(Y,\Theta_1,\Theta_2)\ll \widehat{P}^{5n/6 +5/6 -5/3}\widehat{Y}^{\varepsilon},
\]

which is satisfactory for $n>25$.

so that

\begin{align*}
\sum_{\substack{|r|}=\widehat{Y}}|b_2|^{1/2}|r_3''|^{(1-\delta)/2}|r_3|^{\delta(n-2)/2} & \ll \widehat{Y}\sum_{|r_3'|\leq \widehat{Y}}|r_3'|^{\delta(n-2)/2-1}\sum_{|r_3''b_2|\leq \widehat{Y}|r_3'|^{-1}}|b_2|^{-1/2}|r_3''|^{(\delta(n-3)-1)/2}\\
&\ll \widehat{Y}^{1/2+\delta(n-3)/2}\sum_{|r_3'|\leq \widehat{Y}}|r_3'|^{(\delta-1)/2}
\end{align*}

With $\delta=1/(n-1)$ we thus get

\begin{align*}
E_2' &\ll \widehat{P}^{n-5}\widehat{Y}^{3+-n/2}\widehat{Z}^{3-n/2}\widehat{V}^{n(1-1/n-1))}\\
& = \widehat{P}^{n/3-5}\widehat{Y}^{2+n/3}\widehat{Z}^{3+n/6}\\
& \ll \widehat{P}^{11n/18}\widehat{Y}^{n/6-1}\\
&\ll \widehat{P}^{8n/9 - 5/3}
\end{align*}

\begin{align*}
E_2 & \ll \widehat{P}^{n-5}\widehat{Y}^{4-n/2 -2/n+\varepsilon}\widehat{Z}^{3-n/2}\widehat{V}^{n-2}\\
& = \widehat{P}^{-3}\widehat{Z}^{1+n/2}\widehat{Y}^{2+n/2-2/n +\varepsilon}\\
&\ll \widehat{P}^{5n/6-3 +5/3}\widehat{Y}^{1-2/n+\varepsilon}\\
&\ll \widehat{P}^{5n/6 -3 +10/3 + \varepsilon},
\end{align*}

which is satisfactory provided $n$

of where $r_2$ is square-full and $r_1$ is square-free. Accordingly, we write $d=d_1d_2$ where $d_1\mid r_1$ and $d_2\mid r_2$ and $M=M_1M_2M_3$ with $M_1\mid r_1^\infty$, $M_2\mid r_2^\infty$. Let $S$ be the set of primes dividing $dM\Delta_{F_1}F^*_1(\bm{v})c_2$ together with all primes $\varpi$ such that the reduction of the homogenization of $F_{\underline{c}}$ modulo $\varpi$ is geometrically integral. Then we further write $r_1=s_1s_2$ where $(s_1,S)=1$. For $t_1\in (\O/r_1\O)^\times$, it then follows for some $\tilde{t}_i\in(\O/s_i\O)^\times$ for $i=1,2$ and from Lemma <ref> that

\begin{align*}
S_{d_1\underline{c},r_1, \bm{b}, M_1}(t_1\bm{v})&=S_{s_1}(\tilde{t}_1t_1\bm{ v})S_{d_1\underline{c}, s_2, \bm{b},M_1}(\tilde{t}_2t_1\bm{v})\\
&\ll |s|^{\varepsilon}|d_1||s_1|^{(n+1)/2}|s_2|^{(n+3)/2},
\end{align*}

where we used Lemma <ref> and Lemma <ref> to estimate $S_{s_1}(\bm{v})$ and $S_{d_2\underline{c},s_2,\bm{b},M}(\bm{v})$ respectively. Note that $H_{F_{\underline{c}}}\ll |\underline{c}|$, so that by Lemma <ref> the number of available $s_2$ is $O(\widehat{Y}^{\varepsilon})$. We therefore have for some $t_2\in (\O/r_2 \O)^\times$ and $M=M_1M_2$ that

\begin{align*}
S &\ll \widehat{Y}^\varepsilon\sum_{|\bm{v}-\bm{v}_0|<\widehat{V}}\sum_{d=d_1d_2}|d_1|\sum_{\substack{|r_2|\leq \widehat{Y}\\ d_2\mid t}}|S_{d_2\underline{c},\bm{b}, M_2}(t_2\bm{v})|\sum_{|s_2|\leq \frac{\widehat{Y}}{|r_2|}}|s_2|^{(n+3)/2}\sum_{|s_1|= \frac{\widehat{Y}}{|r_2s_2|}}|s_1|^{(n+1)/2}\\
&\ll \widehat{Y}^{(n+3)/2+\varepsilon}\sum_{|\bm{v}-\bm{v}_0|<\widehat{V}}\sum_{d=d_1d_2}|d_1|\sum_{\substack{|r_2|\leq \widehat{Y}\\ d_2\mid r_2}}\frac{|S_{d_2\underline{c},\bm{b}, M_2}(t_2\bm{v})|}{|r_2|^{(n+3)/2}}.
\end{align*}

Next we write $r_2=st$, where $t$ is cube-full and $\varpi\mid s$ implies $\varpi^2 \parallel s$. Moreover, we also write $d_2=e f$, where $e\mid s$ and $f\mid t$ and similarly $M_2=N_1N_2$ with $N_1\mid s^\infty$ and $N_2\mid t^\infty$. We then further factor $s=b_1b_2$, where $(b_1,N_1ec_2)=1$. We then have for $\tilde{t}\in (\O/s\O)^\times$ and some $\tilde{t}_1\in (\O/s\O)^\times$, $\tilde{t}_2$ that

\begin{align*}
S_{e\underline{c}, s, \bm{b}, N_1}(\tilde{t}\bm{v}) & = S_{b_1}(\tilde{t}_1\bm{v}) S_{e\underline{c}, b_2, \bm{b}, N_1}(\tilde{t_2}\bm{v})\\
&\ll |s|^\varepsilon |e||b_1|^{n/2+1}|b_2|^{(n+3)/2},
\end{align*}

where we used Lemma <ref> in the first line and Lemma <ref> as well as Corollary <ref> to estimate the exponential sums. The number of available $b_2$ is  $O((\widehat{Y}|ec_2N_1|)^\varepsilon)=O(\widehat{Y}^\varepsilon)$, so that for some $t'\in (\O/t\O)^\times$ we have

\begin{align*}
S&\ll \widehat{Y}^{(n+3)/2+\varepsilon}\sum_{|\bm{v}-\bm{v}_0|<\widehat{V}}\sum_{d=d_1d_2}|d_1|\sum_{d_2=ef}|e|\sum_{\substack{|t|\leq \widehat{Y}\\ f\mid t}}\frac{|S_{f\underline{c}, t,\bm{b},N_2}(t'\bm{v})|}{|t|^{(n+3)/2}}\sum_{|b_2|\leq \frac{\widehat{Y}}{|t|}}\sum_{|b_1|\leq\frac{\widehat{Y}}{|tb_2|}}|b_1|^{-1}\\
&\ll \widehat{Y}^{(n+3)/2+\varepsilon}\sum_{|\bm{v}-\bm{v}_0|<\widehat{V}}\sum_{d=d_1d_2}|d_1|\sum_{d_2=ef}|e|\sum_{\substack{|t|\leq \widehat{Y}\\ f\mid t}}\frac{|S_{f\underline{c}, t,\bm{b},N_2}(t'\bm{v})|}{|t|^{(n+3)/2}}.
\end{align*}

Let us now change the order of summation and make the sum over $\bm{v}$ the innermost one. If we write $t=t_1t_2$, where $t_2$ is defined in (<ref>), then it is clear that we can write $t_2=f't'$, where $f'\mid f$ and $t'\mid c_2\Delta_{F_2}$. In particular, the number of available $t_2$ is $O(\widehat{Y}^\varepsilon)$ and we obtain from Corollary <ref> the estimate

\begin{align*}
S & \ll \widehat{Y}^{(n+3)/2+\varepsilon} \sum_{d=d_1d_2}|d_1|\sum_{d_2=ef}|e||f|\sum_{|t_2|\leq \widehat{Y}}\sum_{|t_1|\leq\frac{\widehat{Y}}{|t_2|}}|t_1|^{-1/2}\left(\widehat{V}^n +\widehat{Y}^{n/3}\right)\\
&\ll \widehat{Y}^{(n+3)/2+\varepsilon}|d|\left(\widehat{V}^n +\widehat{Y}^{n/3}\right),
\end{align*}

where we used that $d=d_1ef$ and the usual divisor estimate to bound the sums over $d=d_1d_2$ and $d_2=ef$.

Having estimated $S$, we find ourselves in a position to complete the treatment of $E_1'$. After plugging our estimate for $S$ into (<ref>), we  arrive at

\begin{align*}
E_{1,a}(\widehat{Y}) & \ll \frac{\widehat{P}^{n+\varepsilon}}{\widehat{Y}^n}\widehat{\Theta}_1\widehat{\Theta}_2\widehat{Z}^{-(n-2)/2}\sum_{d\underline{c}:P(d,\underline{c})}\widehat{Y}^{(n+3)/2}|d|\left(\widehat{V}^n+\widehat{Y}^{n/3}\right)\\
&\ll \widehat{P}^{n-5+\varepsilon}\widehat{Z}^{2-(n-2)/2}\widehat{Y}^{5/2-n/2}\left(\widehat{V}^n+\widehat{Y}^{n/3}\right).
\end{align*}

where we used that $\widehat{\Theta}_1\widehat{\Theta}_2\ll \widehat{Z}^2\widehat{P}^{-5}$ and $\sum_{d\underline{c}\colon P(d\underline{c})}|d|\ll \widehat{Y}^{1+\varepsilon}$.
If $\widehat{V}\geq \widehat{Y}^{1/3}$, then

\begin{align*}
S & \ll \widehat{P}^{-5+\varepsilon} \widehat{Y}^{5/2+n/2}\widehat{Z}^{3+n/2}\\
&\ll \widehat{P}^{5n/6}\widehat{Y}^{-1/2}\\
&\ll \widehat{P}^{5n/6 -1/2},
\end{align*}

which is not satisfactory.

Now if $\widehat{P}^{-n/6}\widehat{Y}^{n/2}\geq \widehat{Y}^{n/3}$, then the expression above is bounded from above by $\widehat{P}^{5n/6-5/3+\varepsilon}\widehat{Y}^{1/2}\ll \widehat{P}^{5n/6-5/6+\varepsilon}$, which is sufficient as long as $n\geq 26$. Next observe that since $\bm{v}\neq \bm{0}$ and $\|\bm{v}|\ll \widehat{Y}\widehat{P}^{-1}\widehat{\Theta}$, we must have $\widehat{Y}\gg \widehat{P}\widehat{\Theta}^{-1}$

Missing 'biblatex' package
The bibliography requires the 'biblatex' package.

The Royal Society London

journaltitleProceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences
titleForms in many variables

titleRational points on cubic hypersurfaces over $\FF_q(t)$

seriesProgress in Mathematics
titleCubic Forms and the Circle Method

journaltitleAlgebra Number Theory
titleRational curves on smooth hypersurfaces of low degree

Cambridge University Press

journaltitleJournal of the Institute of Mathematics of Jussieu
titleRational points on intersections of cubic and quadric hypersurfaces

journaltitleJournal of the European Mathematical Society
titleForms in many variables and differing degrees

journaltitleInst. Hautes Études Sci. Publ. Math.
titleLa conjecture de Weil. I

journaltitleInst. Hautes Études Sci. Publ. Math.
titleLa conjecture de Weil. II

journaltitleInventiones mathematicae
titleBounds for automorphic $L$-functions

journaltitleInventiones Mathematicae
titleRational points of bounded height on Fano varieties

journaltitleLecture Notes in Math
titleConnectivity and its applications in algebraic geometry

titleAlgebraic Geometry I: Schemes

W. A. Benjamin

seriesMath Lecture Notes Series
titleLectures on Forms in Many Variables

journaltitleCanad. Math. Bull.
titleA multiple exponential sum to modulus $p^2$

Walter de Gruyter, Berlin/New York Berlin, New York

journaltitleJournal für die reine und angewandte Mathematik
titleA new form of the circle method, and its application to quadratic forms.

Oxford Academic

journaltitleProceedings of the London Mathematical Society
titleCubic forms in ten variables

Oxford University Press

journaltitleProceedings of the London Mathematical Society
titleOn octonary cubic forms

Hindawi Publishing Corporation

journaltitleInternational Mathematics Research Notices
titleEstimates for “singular” exponential sums

Instytut Matematyczny Polskiej Akademi Nauk

titleWaring’s problem for $F_q[x]$
od; asymptotic number of representations; sums of powers

University of Bristol

titleOn the applications of the circle method to function fields, and related topics

journaltitleDuke Math. J.
titleOn the Hasse principle for quartic hypersurfaces

journaltitleInventiones mathematicae
titleQuadratic forms and systems of forms in many variables

De Gruyter

journaltitleJournal für die reine und angewandte Mathematik
titleSystems of cubic forms in many variables

titleSystems of forms in many variables

titleOn the Hasse principle for complete intersections

Mathematical Sciences Publishers

journaltitleAlgebra & Number Theory
titleUniform bounds for the number of rational points on varieties over global fields

Duke University Press

journaltitleDuke Mathematical Journal
titleHauteurs et mesures de Tamagawa sur les variétés de Fano

journaltitleActa Arith.
titlePoints de hauteur bornée sur les variétés de drapeaux en caractéristique finie

journaltitleActa Math.
titleThe density of integer points on homogeneous varieties

journaltitleArchiv der Mathematik
titleAxiomatic theory for transversality and Bertini type theorems

Duke University Press

journaltitleDuke Mathematical Journal
titleHasse principle for three classes of varieties over global function fields

abstractAbstract A 2-dimensional version of Farey dissection for function fields K=Fq(t)$K=𝔽_q(t)$ is developed and used to establish the quantitative arithmetic of the set of rational points on a smooth complete intersection of two quadrics X⊂PKn−1$X⊂ℙ^n-1_K$, under the assumption that q$q$ is odd and n⩾9$n⩾9$.
journaltitleProceedings of the London Mathematical Society
titleRational points on complete intersections over $\mathbb{F}_q(t)$

London Mathematical Society

titleOn simultaneous additive equations, IV

journaltitleJ. Reine Angew. Math.
titleOn simultaneous additive equations. II