# Benchmarking Differentially Private Residual
Networks for Medical Imagery

Sahib Singh  Harshvardhan D. Sikka

###### Abstract

Hospitals and other medical institutions often have vast amounts of medical
data which can provide significant value when utilized to advance research.
However, this data is often sensitive in nature, and as such is not readily
available for use in a research setting, often due to privacy concerns. In
this paper, we measure the performance of a deep neural network on
differentially private image datasets pertaining to Pneumonia. We analyze the
trade-off between the model’s accuracy and the scale of perturbation among the
images. Knowing how the model’s accuracy varies among various perturbation
levels in differentially private medical images is useful in these contexts.
This work is contextually significant given the corona-virus pandemic, as
Pneumonia has become an even greater concern owing to its potentially deadly
complication of infection with COVID-19.

Machine Learning, ICML

##  1 Introduction

Pneumonia is an infection that causes inflammation in the alveoli of the
lungs, and can be caused by numerous infectious agents. Often pneumonia is the
resulting complication of an existing infection. Infectious agents include
Corona-viruses, like SARS‑CoV‑2, Influenza Viruses, and various bacterial
species. (Howley, 2020). According to the Centers for Disease Control and
Prevention, there are about 250,000 hospitalization and about 50,000 deaths
every year owing to pneumonia (Howley, 2020). Patient condition and immune
response to pneumonia can vary based on the specific conditions and factors
involved in the patient’s own health and physiology, as well as the
characteristics of the infectious agent. (Howley, 2020). Key contributing
factors include:

  * •

Pre-existing comorbidities and general state of overall health in the infected
individual

  * •

Virulence level of the infectious organism.

  * •

The level of exposure to the infectious agent. Increased proximity leads to
significantly larger risk of infection severity, along with chance of
infection. This is due to the increased inhalation of the infectious agent
through various mediums. (Howley, 2020)

The percentage of deaths attributed to pneumonia and influenza is 8.2% in the
United States, exceeding the threshold of epidemic classification, which is
7.2% (cdc, 2020). Recently, deaths due to pneumonia have sharply increased due
to the worldwide presence of COVID-19 and the SARS‑CoV‑2 virus. The rapid
construction and evaluation of relevant models to track, diagnose, or support
the treatment and mitigation of the COVID-19 is critical given global
circumstances. Given the urgent need for these developments and the inherently
sensitive nature of medical data, training and evaluating models while
maintaining obfuscation of critical personal information in the data corpus is
vital. The field of Differential Privacy approaches these constraints through
various methods, including the direct obfuscation of data (Dwork et al.,
2006a, b). In this work, we analyze the impact of differentially private
datasets on the performance of a popular image classification model, Resnet
(He et al., 2016; Szegedy et al., 2017). We compare the model performance on
the Chest X-Ray Dataset (Kermany et al., 2018) with different levels of
Perturbation while ensuring the images are differentially private. This
analysis aims to aid medical professionals better understand the tradeoff
between accuracy and data privacy, and may serve as a useful reference to
better evaluate how sensitive information must be preserved while still
ensuring the data remains useful for research purposes.

This text is organized as follows: First, we introduce Differential Privacy
methods as they pertain to the our findings. Following this, the Experimental
Design and corresponding Analysis of Results is covered. Finally, we discuss
the significance of these findings and the potential future directions.

We would additionally like to acknowledge similar work which were done earlier
in a more theoretical setting- (Mireshghallah et al., 2020) and (Fan, 2019).
Our paper builds upon their work and applies it towards the Health-care
domain, and is relevant in Medical Research in particular.

##  2 Methods

In this section we discuss the fundamental privacy preserving concepts used
throughout the paper.

###  2.1 Differential Privacy (DP). (Dwork et al., 2006a, b)

The central idea in differential privacy is the introduction of randomized
noise to ensure privacy through plausible deniability. Based on this idea, for
$\epsilon\geq 0$, an algorithm $A$ is understood to satisfy Differential
Privacy if and only if for any pair of datasets that differ in only one
element, the following statement holds true.

$P[A(D)=t]\leq e^{\epsilon}$ $P[A(D^{{}^{\prime}})=t]$ $\;\forall t$

Where $D$ and $D^{\prime}$ are differing datasets by at most one element, and
$P[A(D)=t]$ denotes the probability that $t$ is the output by $A$. This
setting approximates the effect of individual opt-outs by minimizing the
inclusion effect of an individual’s data.

However, one major limitation of this kind of Differential Privacy is that the
data owners will have to trust a central authority, i.e. the database
maintainer, to ensure their privacy. Hence in order to ensure stronger privacy
guarantee we utilize the concept of Local Differential Privacy (LDP)
(Bebensee, 2019). We say that an algorithm $\pi$ satisfies $\epsilon$-Local
Differential Privacy where $\epsilon>0$ if and only if for any input
$v\;and\;v^{{}^{\prime}}$.

$\forall y\;\in Range(\pi):P[\pi(v)=y]\leq e^{\epsilon}$
$P[\pi(v^{{}^{\prime}})=y]$

For $\epsilon-LDP$ the privacy loss is captured by $\epsilon$. Having
$\epsilon=0$ ensures perfect privacy as $e^{(0)}$ = 1, on the other hand,
$\epsilon=\infty$ provides no privacy guarantee. The choice of $\epsilon$ is
quite important as the increase in privacy risks is proportional to
$e^{\epsilon}$.

###  2.2 Laplace Distribution. (Dwork et al., 2014)

The Laplace distribution, also known as the double-exponential distribution,
is a symmetric version of the exponential distribution. The distribution
centered at 0 (i.e. $\mu=0$) with scale $\beta$ has the following probability
density function:

$Lap(x|b)=\frac{1}{2\beta}\;\exp(\frac{-|x|}{\beta})$

The variance of this distribution is $\sigma^{2}=2\beta^{2}$.

###  2.3 Laplace Mechanism. (Dwork et al., 2006b, 2014)

Laplace Mechanism independently perturbs each coordinate of the output with
Laplace noise (from the Laplace distribution having mean zero) scaled to the
sensitivity of the function.

Given $\epsilon\geq 0$ and a target function $f$, the Laplace Mechanism is the
randomizing algorithm

$A_{f}(D)=f(D)+x$

where x is random variable drawn from a Laplace distribution , corresponding
to perturbation. $\Delta f$ corresponds to the global sensitivity of function
$f$, defined as over all dataset pairs that differ in only one element
$(D,D^{\prime})$.

##  3 Experimental Result

The experiments discussed in this section used an 18-Layer Residual Network
(ResNet) previously trained to achieve convergence on the ImageNet task.
ResNets share many ideas with the popular VGG architecture (Simonyan &
Zisserman, 2014; Szegedy et al., 2017), with significantly fewer filters and
overall decreased complexity. They make use of identity connections between
sets of layers as a solution to the common problem of gradient signals
vanishing during backpropagation in very deep networks (He et al., 2016). The
experimental setup consisted of training the selected model on an image
classification task consisting of the Chest X-Ray dataset (Kermany et al.,
2018). The Chest X-Ray dataset consists of approximately 5,800 images sourced
from chest radiography, which is used by medical specialists to confirm
pneumonia and other medical concerns, though they are not often the sole point
of diagnosis. Different radiographic images taken at separate time intervals,
such as before and during an illness, are often useful to physicians during
the diagnosis. In general, these images form up an important part of an often
multi-stage diagnosis process.

The dataset was used in a binary classification setting, with candidate data
samples corresponding to either Normal or Pneumonia classes. The original
Chest X-Ray dataset was directly used in this experiment, as well as 3 other
versions generated by the addition of different perturbations to the images.
These alternate, differentially-private datasets were generated by drawing
random samples from the Laplacian Mechanism mentioned in (Dwork et al., 2006b)
with $\mu=0$ and varying levels of scale i.e. $\beta$.

These perturbations were added directly to the input image to create a noisy
representation for subsequent training. These 4 datasets were used in
different experiments to train the Resnet-18 model to convergence. To train
the model on these images, some pre-processing steps were undertaken. Input
images passed to the deep neural network were scaled to $256\times 256$
pixels, and normalized to 1. Therefore, the function $f$ defined in Section
2.1 is the identity function and the sensitivity $\Delta f$ is 1.

Figure 1: Accuracy vs Training Epochs for Resnet-18

The experiments are all carried out using Python 3.8.2 and PyTorch 1.4.0. We
trained separate instances of the pre-trained Resnet-18 model on these 4 image
datasets, over 120 epochs. The best models from these runs were saved and
analyzed. The tradeoff in accuracy with these varying scales of perturbations
in the images was examined. Best model accuracies on both the train and test
set are included in Table 1, along with the learning curves over 120 epochs of
training in Figure 1. A validation set was used to tweak and improve training
performance over the whole set of training epochs, and was excluded from the
figures for clarity.

There are some interesting insights that emerge from the data included in
Table 1 and Figure 1. These findings emphasize the intuition that accuracy
clearly diminishes as scale of perturbation of the images is increased,
represented by $\beta$. This relationship generalizes to the whole training
process across all 120 epochs. Another interesting finding is the behavior of
the training and test curves at different perturbation levels with respect to
each other. The best trade-off between model bias and variance seems to be
with a $\beta$ value of 2, and the other perturbation levels also seem to
exhibit better general training than that of the model trained on the original
dataset, which demonstrates overfitting to the training data. This may
highlight the potential for differential privacy methods in improving model
generalization to unseen data, which may be useful under certain
considerations.

##  4 Conclusion And Future Directions

In this paper, we provide empirical evaluation of a computationally tractable
18-Layer Resnet on a medically relevant classification task using the publicly
available Chest X-Rays dataset. This is an effective approach in many medical
contexts, where the interactions of the system are sufficiently complex and
avoid easy to capture analysis. We find that differentially private noise
mechanisms lead to generally different results with different perturbation
quantities, and highlight the inherent trade-offs in these decisions. We also
highlight interesting behavior in model performance on unseen data as a
function of perturbation levels. This work also demonstrates the usefulness of
transfer learning in privacy-preserving scenarios, as a pre-trained Resnet
achieved good performance on another classification task across various
perturbations.

There are several useful directions in benchmarking Privacy-Preserving methods
on both medical and non-medical tasks where data is sensitive but progress is
critical. Our future work on this topic will include the profiling of
additional ML models, both Neural Network based systems and otherwise, across
a variety of Privacy-Preserving settings, including Federated Learning. We
also intend on understanding and improving the use of transfer learning in
these settings where privacy is a necessary consideration. Another derivative
research direction we intend on pursuing is the effect of various perturbation
levels on entire neural network topologies, such as those generated through
meta learning methods (Elsken et al., 2018). Furthermore, different data
modalities including audio files, video, text, tabular data, and various forms
of cyber data can also be benchmarked in a similar way.

## References

  * cdc (2020) Covidview week 13.  Technical report, Centers for Disease Control and Prevention(CDC), 2020\.
  * Bebensee (2019) Bebensee, B.  Local differential privacy: a tutorial.  _arXiv preprint arXiv:1907.11908_ , 2019.
  * Dwork et al. (2006a) Dwork, C., Kenthapadi, K., McSherry, F., Mironov, I., and Naor, M.  Our data, ourselves: Privacy via distributed noise generation.  In _Annual International Conference on the Theory and Applications of Cryptographic Techniques_ , pp. 486–503. Springer, 2006a.
  * Dwork et al. (2006b) Dwork, C., McSherry, F., Nissim, K., and Smith, A.  Calibrating noise to sensitivity in private data analysis.  In _Theory of cryptography conference_ , pp. 265–284. Springer, 2006b.
  * Dwork et al. (2014) Dwork, C., Roth, A., et al.  The algorithmic foundations of differential privacy.  _Foundations and Trends® in Theoretical Computer Science_ , 9(3–4):211–407, 2014.
  * Elsken et al. (2018) Elsken, T., Metzen, J. H., and Hutter, F.  Neural architecture search: A survey.  _arXiv preprint arXiv:1808.05377_ , 2018.
  * Fan (2019) Fan, L.  Differential privacy for image publication.  2019\.
  * He et al. (2016) He, K., Zhang, X., Ren, S., and Sun, J.  Deep residual learning for image recognition.  In _Proceedings of the IEEE conference on computer vision and pattern recognition_ , pp. 770–778, 2016.
  * Howley (2020) Howley, E. K.  What is coronavirus pneumonia?  Technical report, US News and World Report, 2020.
  * Kermany et al. (2018) Kermany, D. S., Goldbaum, M., Cai, W., Valentim, C. C., Liang, H., Baxter, S. L., McKeown, A., Yang, G., Wu, X., Yan, F., et al.  Identifying medical diagnoses and treatable diseases by image-based deep learning.  _Cell_ , 172(5):1122–1131, 2018.
  * Mireshghallah et al. (2020) Mireshghallah, F., Taram, M., Jalali, A., Elthakeb, A. T., Tullsen, D., and Esmaeilzadeh, H.  A principled approach to learning stochastic representations for privacy in deep neural inference.  _arXiv preprint arXiv:2003.12154_ , 2020.
  * Simonyan & Zisserman (2014) Simonyan, K. and Zisserman, A.  Very deep convolutional networks for large-scale image recognition.  _arXiv preprint arXiv:1409.1556_ , 2014.
  * Szegedy et al. (2017) Szegedy, C., Ioffe, S., Vanhoucke, V., and Alemi, A. A.  Inception-v4, inception-resnet and the impact of residual connections on learning.  In _Thirty-first AAAI conference on artificial intelligence_ , 2017\.


# Prime Hasse principles via Diophantine second moments

Victor Y. Wang  Department of Mathematics, Princeton University, Princeton,
NJ, USA  Courant Institute of Mathematical Sciences, New York University, New
York, NY, USA<EMAIL_ADDRESS>
###### Abstract.

We show that almost all primes $p\not\equiv\pm 4\bmod{9}$ are sums of three
cubes, assuming a conjecture due to Hooley, Manin, et al. on cubic fourfolds.
This conjecture could be proven under standard number-theoretic hypotheses,
following the author’s thesis work.

###### Key words and phrases:

Integral points, densities, Manin conjectures, representing primes, Selberg
sieve

###### 1991 Mathematics Subject Classification:

Primary 11D85; Secondary 11D25, 11D45, 11N35, 11N36

##  1\. Introduction

Let $F_{0}(\bm{y})=F_{0}(y_{1},y_{2},y_{3})\colonequals
y_{1}^{3}+y_{2}^{3}+y_{3}^{3}$. The _Hasse-exceptional set_

(1.1) $\mathcal{E}\colonequals\\{a\in\mathbb{Z}:a\not\equiv\pm
4\bmod{9}\\}\setminus F_{0}(\mathbb{Z}^{3})$

might be empty [heath1992density]. The analog of $\mathcal{E}$ for
$5y_{1}^{3}+12y_{2}^{3}+9y_{3}^{3}$ contains a sparse sequence (see e.g.
[ghosh2017integral]*p. 691, footnote 3), produced by means that do not apply
to $F_{0}$ [colliot2012groupe]*p. 1304. We confine ourselves to a statistical
analysis of $\mathcal{E}$ relative to $\mathbb{Z}$ and the set of primes. For
“critical” equations such as $F_{0}(\bm{y})=a$, “subcritical” statistical
frameworks (such as those of [vaughan1980ternary, brudern1991ternary,
hooley2016representation]) break down, and new features come into play
[ghosh2017integral, diaconu2019admissible].

Write $\bm{y}=(y_{1},y_{2},y_{3})$, $\bm{z}=(z_{1},z_{2},z_{3})$, and let
$\bm{x}=(x_{1},\dots,x_{6})\colonequals(y_{1},y_{2},y_{3},z_{1},z_{2},z_{3})$.
Let

(1.2) $F(\bm{x})=F(\bm{y},\bm{z})\colonequals F_{0}(\bm{y})-F_{0}(\bm{z}).$

Let $\Upsilon$ denote the set of $3$-dimensional vector spaces
$L\subseteq\mathbb{Q}^{6}$ over $\mathbb{Q}$ such that $F|_{L}=0$. (The
equation $\bm{y}=\bm{z}$ cuts out one such $L$. All other $L\in\Upsilon$ can
be generated from $\bm{y}=\bm{z}$ by suitable permutations and negations of
variables.) Call a tuple $\bm{x}\in\mathbb{Z}^{6}$ _special_ if

(1.3) $\bm{x}\in\bigcup_{L\in\Upsilon}L.$

Given integers $X,d\geq 1$, and a nice (say $C^{\infty}_{c}$) function
$w\colon\mathbb{R}^{6}\to\mathbb{R}$, let

(1.4)
$N_{w}(X;d)\colonequals\sum_{\bm{x}\in\mathbb{Z}^{6}}w(\bm{x}/X)\cdot\bm{1}_{F(\bm{x})=0}\cdot\bm{1}_{d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}$

(using the indicator notation $\bm{1}_{E}$ defined in §1.1) and

(1.5) $E_{w}(X;d)\colonequals
N_{w}(X;d)-\mathfrak{S}(d)\cdot\sigma_{\infty,w}\cdot
X^{3}-\sum_{\textnormal{special
}\bm{x}\in\mathbb{Z}^{6}}w(\bm{x}/X)\cdot\bm{1}_{d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})},$

where $\mathfrak{S}(d)$, $\sigma_{\infty,w}$ are familiar quantities defined
in (2.9) and (1.9). Based on [hooley1986some]*Conjecture 2,
[franke1989rational], [vaughan1995certain]*Appendix, [peyre1995hauteurs], et
al., one conjectures

(1.6) $\lim_{X\to\infty}X^{-3}E_{w}(X;d)=0.$

Let $\mathbb{Z}_{\geq 0}\colonequals\\{n\in\mathbb{Z}:n\geq 0\\}$, and define
$\mathbb{Z}_{\geq 1},\mathbb{R}_{>0},\ldots$ similarly. The classical “second
moment method” shows that $F_{0}(\mathbb{Z}_{\geq 0}^{3})$ has positive lower
density, assuming $E_{w}(X;1)\ll X^{3}$ holds for a suitable $w$. There are
interesting conjectures on the density of $F_{0}(\mathbb{Z}_{\geq 0}^{3})$
[deshouillers2006density], but we focus on $F_{0}(\mathbb{Z}^{3})$. Diaconu,
building on work of Ghosh–Sarnak published in [ghosh2017integral], showed in
[diaconu2019admissible] that (1.1) has density $0$, assuming a version of
(1.6) for $d=1$ where $N_{w}(X;1)$ is replaced by a point count over a fairly
skew region (see [diaconu2019admissible]*$R^{\ast}_{N}$ on p. 24). The main
goal of the present paper is to say more about (1.1), assuming that there
exists a triple
$(\xi,\delta,k)\in\\{0,1\\}\times\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$ for
which the following holds:

(1.7) $E_{w}(X;d)\ll\lVert
w\rVert_{k,\infty}B(w)^{k}X^{3-\delta},\quad\textnormal{uniformly over $d\leq
X^{\xi\delta}$ and clean $w\in C^{\infty}_{c}(\mathbb{R}^{6})$}.$

(We define the terms $\lVert-\rVert_{k,\infty}$, $B(-)$, and “clean” in §1.1.)

######  Theorem 1.1.

Suppose that (1.6) for $d=1$ holds for all clean functions $w\in
C^{\infty}_{c}(\mathbb{R}^{6})$. Then (1.1) has density $0$ in $\mathbb{Z}$.
Now fix $(\delta,k)\in\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$, and assume
(1.7) for $\xi=0$. Then
$\lvert\mathcal{E}\cap[-A,A]\rvert\ll_{\epsilon}A/(\log{A})^{1-\epsilon}$ for
all integers $A\geq 2$ (for all $\epsilon>0$).

The qualitative density result in Theorem 1.1 was previously worked out by the
author (see e.g. [wang2022thesis]*Theorem 2.1.8), following the main ideas of
[diaconu2019admissible]*§§2–3. Our present approach is, however, stronger and
more flexible.

######  Theorem 1.2.

Fix $(\delta,k)\in\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$. Assume (1.7) for
$\xi=1$. Then (1.1) contains at most $O_{\epsilon}(A/(\log{A})^{2-\epsilon})$
primes $p\leq A$, for any integer $A\geq 2$ (for any $\epsilon>0$).

The hypothesis (1.7) is essentially a version of (1.6) with a specified power
saving, uniform over a specified range of integers $d$ and weights $w$. When
$d=1$, one can prove (1.6) (and in fact $E_{w}(X;1)\ll_{w}X^{3-\delta}$ for
some small $\delta$) for a large class of functions $w$, assuming what
primarily amounts to the Ratios and Square-free Sieve Conjectures. (See
[wang2022thesis]*Theorem 8.4.3(b), which builds on [hooley1986HasseWeil,
hooley_greaves_harman_huxley_1997, heath1998circle].) For some
$(\delta,k)\in\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$, one could similarly
reduce (1.7) to standard number-theoretic conjectures.

Given a compactly supported function $\nu\colon\mathbb{R}^{3}\to\mathbb{R}$,
let

(1.8)
$N_{a,\nu}(X)\colonequals\sum_{\bm{y}\in\mathbb{Z}^{3}:\,F_{0}(\bm{y})=a}\nu(\bm{y}/X).$

To prove Theorem 1.1, we will choose “nice” weights $\nu$ (cf.
[hooley2016representation]) and bound $N_{a,\nu}(X)$ in “approximate variance”
over $a\ll X^{3}$—building on [ghosh2017integral, diaconu2019admissible,
wang2022thesis]. To prove Theorem 1.2, we will also need precise estimates
(not just bounds) for such variances, and not just over $\mathbb{Z}$ but also
over arithmetic progressions $a\equiv 0\bmod{d}$ with $d\leq X^{\delta}$.

In §2, we will define and estimate an approximate variance. In §3, we will
show that certain truncated singular series are typically sizable. In §4, we
will apply our estimates from §§2–3 to prove Theorems 1.1 and 1.2. Here it is
important to allow $\nu$ to deform with $X$. For fixed $\nu$, counting prime
values of $F_{0}$ (with or without multiplicity) up to constant factors
remains a challenge, even conditionally; see
[destagnol2019rational]*Conjecture A.3 (Bateman–Horn in several variables) and
the present §5 for some concrete open questions in this direction. (It might
also be interesting to ask analogous questions for sequences other than the
primes.)

How many solutions to $x^{3}+y^{3}+z^{3}=a$ of a given size can our methods
produce, for typical $a$? By slightly modifying §4, one could provide several
kinds of answers to this question. A comprehensive discussion would be
tedious, so we limit ourselves to a murky remark:

######  Remark 1.3.

In Theorems 1.1 and 1.2, there are three levels of hypotheses in total, say
H1, H2, H3, from weakest to strongest. H1 implies that if $h(a)\to\infty$ as
$\lvert a\rvert\to\infty$, then there exists $f\colon\mathbb{Z}\to\mathbb{R}$,
with $\lim_{\lvert a\rvert\to\infty}f(a)=\infty$, such that for almost all
integers $a\not\equiv\pm 4\bmod{9}$, the equation $x^{3}+y^{3}+z^{3}=a$ has
$\geq f(a)$ solutions with $\max(\lvert x\rvert,\lvert y\rvert,\lvert
z\rvert)\leq h(a)\cdot\lvert a\rvert^{1/3}$. Under H2 (resp. H3), one can show
that if $g(a)\to 0$ as $\lvert a\rvert\to\infty$, then $x^{3}+y^{3}+z^{3}=a$
has $\geq g(a)\cdot\log(1+\lvert a\rvert)$ solutions for almost all integers
(resp. primes) $a\not\equiv\pm 4\bmod{9}$.

We expect that Theorems 1.1 and 1.2 can be generalized from $F_{0}$ to
arbitrary ternary cubic forms $G_{0}$ with nonzero discriminant, if one
modifies (1.11) and (2.27). For (1.11), see [wang2022thesis]*Definition 1.4.3.
For (2.27), one needs that for any $L$ in the (finite) set $\Upsilon$, if
$I(L)$ denotes the ideal of $\mathbb{Q}[\bm{y},\bm{z}]$ defining $L$, then
$I(L)\cap\mathbb{Q}[\bm{y}]$ is a principal ideal of $\mathbb{Q}[\bm{y}]$.

The proof of Theorem 1.2 might also adapt to the Markoff cubic
$x^{2}+y^{2}+z^{2}-xyz$ to _unconditionally_ extend
[ghosh2017integral]*Theorem 1.2(ii) to primes, provided one can handle certain
quadratic subtleties uncovered in [ghosh2017integral]. For practical reasons,
we focus on $x^{3}+y^{3}+z^{3}$.

###  1.1. Conventions

For an event $E$, we let $\bm{1}_{E}\colonequals 1$ if $E$ holds, and
$\bm{1}_{E}\colonequals 0$ otherwise.

For a vector $\bm{u}\in\mathbb{R}^{s}$, we let
$\lVert\bm{u}\rVert\colonequals\max_{i}(\lvert u_{i}\rvert)$ and
$d\bm{u}\colonequals du_{1}\cdots du_{s}$. We let
$C^{\infty}_{c}(\mathbb{R}^{s})$ denote the set of smooth compactly supported
functions $\mathbb{R}^{s}\to\mathbb{R}$. Given a function
$f\colon\mathbb{R}^{s}\to\mathbb{R}$, we let $\operatorname{Supp}{f}$ denote
the closure of $\\{\bm{u}\in\mathbb{R}^{s}:f(\bm{u})\neq 0\\}$ in
$\mathbb{R}^{s}$.

We let $\partial_{x}\colonequals\partial/\partial x$. We write
$\int_{X}dx\,f(x)$ to mean $\int_{X}f(x)\,dx$; we write $\int_{X\times
Y}dx\,dy\,f(x,y)$ to mean $\int_{X}dx\,(\int_{Y}dy\,f(x,y))$. For
$w=w(\bm{x})\in C^{\infty}_{c}(\mathbb{R}^{6})$, we let

(1.9) $\sigma_{\infty,w}\colonequals\lim_{\epsilon\to
0}{(2\epsilon)^{-1}\int_{\lvert
F(\bm{x})\rvert\leq\epsilon}d\bm{x}\,w(\bm{x})}.$

Given $f=f(u_{1},\dots,u_{s})\in C^{\infty}_{c}(\mathbb{R}^{s})$ and
$k\in\mathbb{Z}_{\geq 0}$, we define the Sobolev norm

(1.10) $\lVert
f\rVert_{k,\infty}\colonequals\max_{\begin{subarray}{c}\alpha_{1},\dots,\alpha_{s}\in\mathbb{Z}_{\geq
0}:\\\ \alpha_{1}+\dots+\alpha_{s}\leq
k\end{subarray}}\,\max_{\mathbb{R}^{s}}{\lvert\partial_{u_{1}}^{\alpha_{1}}\cdots\partial_{u_{s}}^{\alpha_{s}}f\rvert}.$

Given a compactly supported function $f\colon\mathbb{R}^{s}\to\mathbb{R}$ with
$\bm{0}\notin\operatorname{Supp}f$, we let $B(f)$ denote the smallest integer
$B\geq 1$ such that $B^{-1}\leq\lVert\bm{u}\rVert\leq B$ for all
$\bm{u}\in\operatorname{Supp}f$.

We call a function $f\colon\mathbb{R}^{s}\to\mathbb{R}$ _clean_ if

(1.11) $(\operatorname{Supp}{f})\cap\\{\bm{u}\in\mathbb{R}^{s}:u_{1}\cdots
u_{s}=0\\}=\emptyset.$

We let $e(t)\colonequals e^{2\pi it}$, and $e_{r}(t)\colonequals e(t/r)$.

For a finite nonempty set $S$, we let $\mathbb{E}_{b\in
S}[f(b)]\colonequals\lvert S\rvert^{-1}\sum_{b\in S}f(b)$.

We write $f\ll_{S}g$, or $g\gg_{S}f$, to mean $\lvert f\rvert\leq Cg$ for some
$C=C(S)>0$. We let $O_{S}(g)$ denote a quantity that is $\ll_{S}g$. We write
$f\asymp_{S}g$ if $f\ll_{S}g\ll_{S}f$.

We let $v_{p}(-)$ denote the usual $p$-adic valuation. For integers $n\geq 1$,
we let $\phi(n)$ denote the totient function, $\tau(n)$ the divisor function,
$\mu(n)$ the Möbius function, $\omega(n)$ the number of distinct prime factors
of $n$, and $\operatorname{rad}(n)$ the radical of $n$.

##  2\. General variance setup and estimation

Given $\nu$, $a$, $X$, we define certain densities $\sigma_{p,a}$,
$\sigma_{\infty,a,\nu}(X)$ in (2.5), (2.22). For
$a\in\mathbb{Z}\setminus\\{0\\}$, informally write
$\mathfrak{S}_{a}\colonequals\prod_{\textnormal{$p$ prime}}\sigma_{p,a}$, and
consider the naive _Hardy–Littlewood prediction_
$\mathfrak{S}_{a}\cdot\sigma_{\infty,a,\nu}(X)$ for $N_{a,\nu}(X)$. Smaller
moduli should have a greater effect in $\mathfrak{S}_{a}$; furthermore,
$\mathfrak{S}_{a}$ itself— _as is_ —can be subtle (see §3). So in (2.4) below,
we use a “restricted” version of
$\mathfrak{S}_{a}\cdot\sigma_{\infty,a,\nu}(X)$. For technical quantitative
reasons, we use an additive approximation to $\mathfrak{S}_{a}$, rather than a
multiplicative approximation as in [ghosh2017integral, diaconu2019admissible,
wang2022thesis].

######  Definition 2.1.

Let $F_{a}\colonequals F_{0}-a$ for $a\in\mathbb{Z}$. For integers $n\geq 1$,
let

(2.1)
$T_{a}(n)\colonequals\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\sum_{\bm{y}\in(\mathbb{Z}/n\mathbb{Z})^{3}}e_{n}(uF_{a}(\bm{y}))=\sum_{\begin{subarray}{c}1\leq
u\leq n:\\\ \gcd(u,n)=1\end{subarray}}\,\sum_{1\leq y_{1},y_{2},y_{3}\leq
n}e_{n}(uF_{a}(y_{1},y_{2},y_{3}))$

(whenever $a$ lies in $\mathbb{Z}$ or $\mathbb{Z}/n\mathbb{Z}$, or maps
canonically into $\mathbb{Z}/n\mathbb{Z}$). Let

(2.2) $s_{a}(K)\colonequals\sum_{n\leq K}n^{-3}T_{a}(n)$

(whenever $a,K\in\mathbb{Z}$ and $K\geq 1$). Given
$\nu\colon\mathbb{R}^{3}\to\mathbb{R}$, let

(2.3) $\nu^{\otimes 2}(\bm{x})=\nu^{\otimes
2}(\bm{y},\bm{z})\colonequals\nu(\bm{y})\nu(\bm{z}),$

and for integers $d\geq 1$, let
$d\mathbb{Z}\colonequals\\{a\in\mathbb{Z}:d\mid a\\}$ and define the _$K$
-approximate variance_

(2.4) $\operatorname{Var}(X,K;d)\colonequals\sum_{a\in
d\mathbb{Z}}[N_{a,\nu}(X)-s_{a}(K)\sigma_{\infty,a,\nu}(X)]^{2}.$

Note that $T_{a}(n)$ is always real (since
$-1\in(\mathbb{Z}/n\mathbb{Z})^{\times}$), and $\nu$ maps into $\mathbb{R}$,
so (2.4) is a reasonable definition. For a large class of weights $\nu$, we
can rewrite $\operatorname{Var}(X,K;d)$ after expanding the square; see
Theorem 2.13 below. Due to the nonnegativity of squares in (2.4), the Selberg
sieve can then be used to (conditionally) bound a variant of (2.4) over
primes, after observing a certain multiplicative structure over $d$; see
Theorem 2.14 below. The proofs of Theorems 2.13 and 2.14 rest on a fair amount
of local calculation.

###  2.1. Non-archimedean work

We first define certain $p$-adic densities. For
$a\in\mathbb{Z}\setminus\\{0\\}$, let

(2.5)
$\sigma_{p,a}\colonequals\lim_{l\to\infty}(p^{-2l}\cdot\\#\\{\bm{y}\in(\mathbb{Z}/p^{l}\mathbb{Z})^{3}:F_{a}(\bm{y})=0\\}),$

and for integers $d\geq 1$, let

(2.6)
$\sigma_{p}(d)\colonequals\lim_{l\to\infty}(p^{-5l}\cdot\\#\\{\bm{x}\in(\mathbb{Z}/p^{l}\mathbb{Z})^{6}:F(\bm{x})=0\text{
and }\gcd(p^{l},d)\mid F_{0}(\bm{y}),F_{0}(\bm{z})\\}).$

(It is routine to show that both limits exist and are finite.) Next, for
integers $n,d\geq 1$, let

(2.7) $S^{+}_{\bm{0}}(n;d)\colonequals\sum_{m\geq
1:\,\operatorname{lcm}(m,d)=n}\,\sum_{u\in(\mathbb{Z}/m\mathbb{Z})^{\times}}\sum_{\bm{x}\in(\mathbb{Z}/n\mathbb{Z})^{6}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}e_{m}(uF(\bm{x}));$

then $S^{+}_{\bm{0}}(n;d)=\bm{1}_{d\mid n}\cdot S^{+}_{\bm{0}}(n;d)$, and for
every positive integer $q\in d\mathbb{Z}$ we have

(2.8)
$q^{-6}\sum_{a\in\mathbb{Z}/q\mathbb{Z}}\,\sum_{\bm{x}\in(\mathbb{Z}/q\mathbb{Z})^{6}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}e_{q}(aF(\bm{x}))=\sum_{n\mid
q}n^{-6}S^{+}_{\bm{0}}(n;d).$

Finally, let

(2.9) $\mathfrak{S}(d)\colonequals\prod_{\textnormal{$p$
prime}}\sigma_{p}(d)=\sum_{n\geq 1}n^{-6}S^{+}_{\bm{0}}(n;d)=\sum_{n\geq
1:\,d\mid n}n^{-6}S^{+}_{\bm{0}}(n;d).$

(Using (2.8), Proposition 2.2, and Lemma 2.4, it is routine to show that the
infinite product and sums in (2.9) all converge absolutely, and equal one
another.)

######  Proposition 2.2.

Let $n_{1},n_{2}\geq 1$ be coprime integers. Then
$T_{a}(n_{1}n_{2})=T_{a}(n_{1})T_{a}(n_{2})$. If $d_{1},d_{2}\geq 1$ are
integers with $\gcd(n_{1}d_{1},n_{2}d_{2})=1$, then
$S^{+}_{\bm{0}}(n_{1}n_{2};d_{1}d_{2})=S^{+}_{\bm{0}}(n_{1};d_{1})S^{+}_{\bm{0}}(n_{2};d_{2})$.

###### Proof.

This is routine (by the Chinese remainder theorem). We omit the details. ∎

######  Lemma 2.3.

Let $n,d\geq 1$ be integers. Suppose that the inequality $v_{p}(n)>v_{p}(d)$
holds for all primes $p\mid n$. Then $\lvert
S^{+}_{\bm{0}}(n;d)\rvert\leq\lvert S^{+}_{\bm{0}}(n;1)\rvert$.

###### Proof.

Here $\\{m\geq 1:\operatorname{lcm}(m,d)=n\\}=\\{n\\}$. So by (2.7), the
quantity $d^{2}\cdot S^{+}_{\bm{0}}(n;d)$ equals

$\begin{split}&d^{2}\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\sum_{\bm{y}_{1},\bm{y}_{2}\in(\mathbb{Z}/n\mathbb{Z})^{3}:\,d\mid
F_{0}(\bm{y}_{1}),F_{0}(\bm{y}_{2})}e_{n}(uF_{0}(\bm{y}_{1})-uF_{0}(\bm{y}_{2}))\\\
&=\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\sum_{\bm{y}_{1},\bm{y}_{2}\in(\mathbb{Z}/n\mathbb{Z})^{3}}e_{n}(uF_{0}(\bm{y}_{1})-uF_{0}(\bm{y}_{2}))\sum_{v_{1},v_{2}\in\mathbb{Z}/d\mathbb{Z}}e_{d}(v_{1}F_{0}(\bm{y}_{1})+v_{2}F_{0}(\bm{y}_{2}))\\\
&=\sum_{v_{1},v_{2}\in\mathbb{Z}/d\mathbb{Z}}\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\prod_{1\leq
i\leq
2}\,\biggl{(}\,\sum_{\bm{y}_{i}\in(\mathbb{Z}/n\mathbb{Z})^{3}}e_{n}((-1)^{i-1}uF_{0}(\bm{y}_{i}))e_{d}(v_{i}F_{0}(\bm{y}_{i}))\biggr{)}.\end{split}$

But for any $\epsilon\in\\{-1,1\\}$ and $v\in\mathbb{Z}/d\mathbb{Z}$, we have

$\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\,\Bigl{\lvert}{\sum_{\bm{y}\in(\mathbb{Z}/n\mathbb{Z})^{3}}e_{n}(\epsilon
uF_{0}(\bm{y}))e_{d}(vF_{0}(\bm{y}))}\Bigr{\rvert}^{2}=S^{+}_{\bm{0}}(n;1),$

since the formula $u\mapsto\epsilon u+(n/d)v$ defines a bijection on
$(\mathbb{Z}/n\mathbb{Z})^{\times}$. So by Cauchy (over
$u\in(\mathbb{Z}/n\mathbb{Z})^{\times}$), we have $d^{2}\cdot\lvert
S^{+}_{\bm{0}}(n;d)\rvert\leq\sum_{v_{1},v_{2}\in\mathbb{Z}/d\mathbb{Z}}S^{+}_{\bm{0}}(n;1)=d^{2}\cdot
S^{+}_{\bm{0}}(n;1)$. This suffices. ∎

######  Lemma 2.4.

Let $N,d\geq 1$ be integers. Then the following holds:

$\sum_{n\in[N,2N)}n^{-6}\,\lvert S^{+}_{\bm{0}}(n;d)\rvert\leq
d\sum_{ab\in[N,2N):\,a\mid d}b^{-6}\,\lvert
S^{+}_{\bm{0}}(b;1)\rvert\ll_{\epsilon}d^{5/3}N^{-2/3+\epsilon}.$

###### Proof.

If $e\mid d$, then trivially, $\lvert S^{+}_{\bm{0}}(e;e)\rvert\leq\sum_{m\mid
e}\phi(m)e^{6}=e^{7}$. Proposition 2.2 and Lemma 2.3 then imply that for each
$n\geq 1$, we have $\lvert S^{+}_{\bm{0}}(n;d)\rvert\leq\max_{ef=n:\,e\mid
d}(e^{7}\,\lvert S^{+}_{\bm{0}}(f;1)\rvert)$. Therefore,

$\sum_{n\in[N,2N)}n^{-6}\,\lvert S^{+}_{\bm{0}}(n;d)\rvert\leq\sum_{e\mid
d}e\sum_{f\in[N/e,2N/e)}f^{-6}\,\lvert S^{+}_{\bm{0}}(f;1)\rvert\leq
d\sum_{e\mid d}\sum_{f\in[N/e,2N/e)}f^{-6}\,\lvert S^{+}_{\bm{0}}(f;1)\rvert.$

By [wang2022thesis]*Lemma 3.4.1 (a routine variant of [vaughan1997hardy]*Lemma
4.9), the inner sum over $f$ is $\ll_{\epsilon}(N/e)^{-2/3+\epsilon}$. The
lemma then follows from the bound $\sum_{e\mid d}e^{2/3-\epsilon}\ll d^{2/3}$.
∎

We now prove three results relating $T_{a}(-)$, from (2.1), to
$S^{+}_{\bm{0}}(-;d)$, from (2.7).

######  Lemma 2.5.

Let $d,m\geq 1$ be integers with $d\mid m$. Then

(2.10) $\displaystyle\sum_{n_{1},n_{2}\geq
1:\,\operatorname{lcm}(n_{1},d)=m,\;\operatorname{lcm}(n_{2},d)=m}\frac{1}{m}\sum_{b\in
d\mathbb{Z}/m\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}$
$\displaystyle=\frac{S^{+}_{\bm{0}}(m;d)}{m^{6}},$ (2.11)
$\displaystyle\sum_{n_{1},n_{2}\geq
1:\,\operatorname{lcm}(n_{1},d)=m,\;\operatorname{lcm}(n_{2},d)=m}\,\biggl{\lvert}{\frac{1}{m}\sum_{b\in
d\mathbb{Z}/m\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}}\biggr{\rvert}$
$\displaystyle\leq\tau(m)\sum_{rn=m:\,r\mid d}\frac{\lvert
S^{+}_{\bm{0}}(n;1)\rvert}{n^{6}}.$

###### Proof.

By Proposition 2.2, it suffices to prove the lemma when $m$ is a prime power.
So suppose $(d,m)=(p^{e},p^{f})$, where $p$ is prime and $0\leq e\leq f$.

_Case 1: $e<f$._ Then $\\{n\geq 1:\operatorname{lcm}(n,d)=m\\}=\\{m\\}$. In
particular,

(2.12)
$\begin{split}S^{+}_{\bm{0}}(m;d)&=\sum_{u\in(\mathbb{Z}/m\mathbb{Z})^{\times}}\sum_{\bm{x}\in(\mathbb{Z}/m\mathbb{Z})^{6}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}e_{m}(uF(\bm{x}))\\\
&=p^{e}\sum_{u\in(\mathbb{Z}/p^{f-e}\mathbb{Z})^{\times}}\sum_{\bm{x}\in(\mathbb{Z}/m\mathbb{Z})^{6}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}e_{m}(uF(\bm{x}))\end{split}$

(since $e_{m}(ud)$ depends only on $u\bmod{p^{f-e}}$). And if $b\in
d\mathbb{Z}/m\mathbb{Z}$, then

(2.13)
$\begin{split}T_{b}(m)=\sum_{u\in(\mathbb{Z}/m\mathbb{Z})^{\times}}\sum_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}}e_{m}(uF_{b}(\bm{y}))&=\sum_{u\in(\mathbb{Z}/m\mathbb{Z})^{\times}}\sum_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,d\mid
F_{0}(\bm{y})}e_{m}(uF_{b}(\bm{y}))\\\
&=p^{e}\sum_{u\in(\mathbb{Z}/p^{f-e}\mathbb{Z})^{\times}}\sum_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,d\mid
F_{0}(\bm{y})}e_{m}(uF_{b}(\bm{y}))\end{split}$

(since
$\sum_{u\in(\mathbb{Z}/p^{f}\mathbb{Z})^{\times}}e_{p^{f}}(uF_{b}(\bm{y}))=0$
if $p^{f-1}\nmid F_{b}(\bm{y})$), whence

$T_{b}(m)^{2}=p^{2e}\sum_{u,v\in(\mathbb{Z}/p^{f-e}\mathbb{Z})^{\times}}\sum_{\bm{y},\bm{z}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}e_{m}(uF_{b}(\bm{y})+vF_{b}(\bm{z})).$

But $\sum_{b\in d\mathbb{Z}/m\mathbb{Z}}e_{m}(-ub-
vb)=p^{f-e}\cdot\bm{1}_{p^{f-e}\mid u+v}$. So summing the previous display
over $b\in d\mathbb{Z}/m\mathbb{Z}$, and then using (2.12), we get $\sum_{b\in
d\mathbb{Z}/m\mathbb{Z}}T_{b}(m)^{2}=p^{f}S^{+}_{\bm{0}}(m;d)$. This suffices
for both (2.10), (2.11). (For (2.11), note that $\lvert
S^{+}_{\bm{0}}(m;d)\rvert\leq\lvert S^{+}_{\bm{0}}(m;1)\rvert$ by Lemma 2.3).

_Case 2: $e=f$._ Then $d=m$ and $\\{n\geq
1:\operatorname{lcm}(n,d)=m\\}=\\{n\geq 1:n\mid m\\}$. So

(2.14) $S^{+}_{\bm{0}}(m;d)=\sum_{n\mid
m}\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\sum_{\begin{subarray}{c}\bm{x}\in(\mathbb{Z}/m\mathbb{Z})^{6}:\\\
m\mid
F_{0}(\bm{y}),F_{0}(\bm{z})\end{subarray}}e_{n}(uF(\bm{x}))=m\sum_{\begin{subarray}{c}\bm{x}\in(\mathbb{Z}/m\mathbb{Z})^{6}:\\\
m\mid F_{0}(\bm{y}),F_{0}(\bm{z})\end{subarray}}1.$

But $d\mathbb{Z}/m\mathbb{Z}=0$ (in (2.10), (2.11)), and

(2.15) $\begin{split}\sum_{n\mid m}\frac{T_{0}(n)}{n^{3}}&=\sum_{n\mid
m}\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\mathbb{E}_{\bm{y}\in(\mathbb{Z}/n\mathbb{Z})^{3}}[e_{n}(uF_{0}(\bm{y}))]\\\
&=\sum_{n\mid
m}\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\mathbb{E}_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}}[e_{n}(uF_{0}(\bm{y}))]\\\
&=\sum_{u\in\mathbb{Z}/m\mathbb{Z}}\mathbb{E}_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}}[e_{m}(uF_{0}(\bm{y}))]=m^{-2}\sum_{\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,m\mid
F_{0}(\bm{y})}1.\end{split}$

Upon squaring (2.15), dividing by $m$, and using (2.14), we get (2.10). For
(2.11), note that by Cauchy, $\lvert
T_{0}(n)\rvert^{2}\leq\phi(n)\sum_{u\in(\mathbb{Z}/n\mathbb{Z})^{\times}}\lvert\sum_{\bm{y}\in(\mathbb{Z}/n\mathbb{Z})^{3}}e_{n}(uF_{0}(\bm{y}))\rvert^{2}=\phi(n)S^{+}_{\bm{0}}(n;1)$,
so

(2.16) $\frac{1}{m}\sum_{n_{1},n_{2}\mid m}\frac{\lvert
T_{0}(n_{1})T_{0}(n_{2})\rvert}{(n_{1}n_{2})^{3}}\leq\frac{\tau(m)}{m}\sum_{n\mid
m}\frac{\lvert T_{0}(n)\rvert^{2}}{n^{6}}\leq\frac{\tau(m)}{m}\sum_{n\mid
m}\frac{\phi(n)S^{+}_{\bm{0}}(n;1)}{n^{6}}.$

This suffices for (2.11) (since $\phi(n)\leq n\leq m$, and $(m/n)\mid m=d$). ∎

######  Lemma 2.6.

Let $d,m\geq 1$ be integers with $d\mid m$. Then

(2.17) $\displaystyle\sum_{n\geq
1:\,\operatorname{lcm}(n,d)=m}\frac{1}{m^{3}}\sum_{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}$
$\displaystyle=\frac{S^{+}_{\bm{0}}(m;d)}{m^{6}},$ (2.18)
$\displaystyle\sum_{n\geq
1:\,\operatorname{lcm}(n,d)=m}\,\biggl{\lvert}{\frac{1}{m^{3}}\sum_{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}}\biggr{\rvert}$
$\displaystyle\leq d\cdot\tau(m)\sum_{rn=m:\,r\mid d}\frac{\lvert
S^{+}_{\bm{0}}(n;1)\rvert}{n^{6}}.$

###### Proof.

Again, we may assume that $(d,m)=(p^{e},p^{f})$, where $p$ is prime and $0\leq
e\leq f$.

_Case 1: $e<f$._ Then $\\{n\geq 1:\operatorname{lcm}(n,d)=m\\}=\\{m\\}$. But
by (2.13),

$\sum_{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}T_{F_{0}(\bm{e})}(m)=\sum_{u\in(\mathbb{Z}/m\mathbb{Z})^{\times}}\sum_{\bm{e},\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,d\mid
F_{0}(\bm{e}),F_{0}(\bm{y})}e_{m}(u(F_{0}(\bm{y})-F_{0}(\bm{e}))),$

which equals $S^{+}_{\bm{0}}(m;d)$ by (2.12). Both (2.17), (2.18) follow (in
the present case).

_Case 2: $e=f$._ Then $d=m$ and $\\{n\geq
1:\operatorname{lcm}(n,d)=m\\}=\\{n\geq 1:n\mid m\\}$. So (2.17) follows from
(2.15) and (2.14). Also, (2.18) follows from (2.16) (since
$T_{0}(n)=T_{0}(n)T_{0}(1)$ for all $n\geq 1$, and we have
$\\#\\{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:F_{0}(\bm{e})\equiv
0\bmod{d}\\}\leq m^{3}=m^{2}d$ trivially). ∎

######  Lemma 2.7.

Suppose $n_{1},n_{2},d\geq 1$ are integers with
$\operatorname{lcm}(n_{1},d)\neq\operatorname{lcm}(n_{2},d)$. Then

(2.19) $\sum_{b\in
d\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}}T_{b}(n_{1})T_{b}(n_{2})=0.$

###### Proof.

We may assume $\operatorname{lcm}(n_{1},d)<\operatorname{lcm}(n_{2},d)$. Let
$r\colonequals\operatorname{lcm}(n_{1},d)$; then $n_{2}\nmid r$. So
$\sum_{a\in\gcd(n_{2},r)\mathbb{Z}/n_{2}\mathbb{Z}}e_{n_{2}}(-ua)=0$ for all
$u\in(\mathbb{Z}/n_{2}\mathbb{Z})^{\times}$. Thus
$\sum_{b\in\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}:\,b\equiv
c\bmod{r}}T_{b}(n_{2})=0$ for all $c\in\mathbb{Z}/r\mathbb{Z}$. Multiplying by
$T_{c}(n_{1})$ and summing over $c\in d\mathbb{Z}/r\mathbb{Z}$, we get (2.19).
∎

######  Proposition 2.8.

Let $d,K\geq 1$ be integers. Then

(2.20) $\displaystyle\sum_{n_{1},n_{2}\leq K}\frac{1}{n_{1}n_{2}d}\sum_{b\in
d\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}$
$\displaystyle=\mathfrak{S}(d)+O_{\epsilon}(d^{5/3}K^{-2/3+\epsilon}),$ (2.21)
$\displaystyle\sum_{n\leq
K}\frac{1}{(nd)^{3}}\sum_{\bm{e}\in(\mathbb{Z}/nd\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}$
$\displaystyle=\mathfrak{S}(d)+O_{\epsilon}(d^{5/3}K^{-2/3+\epsilon}).$

###### Proof.

If $n_{1},n_{2}\geq 1$ are integers with
$\operatorname{lcm}(n_{1},d)=\operatorname{lcm}(n_{2},d)=m$, say, then $d\mid
m$ and

$\frac{1}{n_{1}n_{2}d}\sum_{b\in
d\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}=\frac{1}{m}\sum_{b\in
d\mathbb{Z}/m\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}.$

By Lemmas 2.7, 2.5, and 2.4 (and eq. (2.9)), it follows that the left-hand
side of (2.20) equals

$\begin{split}&\sum_{m\geq 1:\,d\mid
m}\sum_{\begin{subarray}{c}n_{1},n_{2}\leq K:\\\
\operatorname{lcm}(n_{1},d)=m,\;\operatorname{lcm}(n_{2},d)=m\end{subarray}}\frac{1}{m}\sum_{b\in
d\mathbb{Z}/m\mathbb{Z}}\frac{T_{b}(n_{1})T_{b}(n_{2})}{(n_{1}n_{2})^{3}}\\\
&=\sum_{m\leq K:\,d\mid m}\frac{S^{+}_{\bm{0}}(m;d)}{m^{6}}+\sum_{m>K:\,d\mid
m}\tau(m)\sum_{rn=m:\,r\mid d}\frac{O(\lvert
S^{+}_{\bm{0}}(n;1)\rvert)}{n^{6}}=\mathfrak{S}(d)+O_{\epsilon}(d^{5/3}K^{-2/3+\epsilon}).\end{split}$

The second part, (2.21), is similar, but simpler. If $n\geq 1$ and
$\operatorname{lcm}(n,d)=m$, say, then

$\frac{1}{(nd)^{3}}\sum_{\bm{e}\in(\mathbb{Z}/nd\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}=\frac{1}{m^{3}}\sum_{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}.$

By Lemmas 2.6 and 2.4 (and eq. (2.9)), the left-hand side of (2.21) thus
equals

$\begin{split}&\sum_{m\geq 1:\,d\mid m}\sum_{\begin{subarray}{c}n\leq K:\\\
\operatorname{lcm}(n,d)=m\end{subarray}}\frac{1}{m^{3}}\sum_{\bm{e}\in(\mathbb{Z}/m\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\frac{T_{F_{0}(\bm{e})}(n)}{n^{3}}\\\ &=\sum_{m\leq K:\,d\mid
m}\frac{S^{+}_{\bm{0}}(m;d)}{m^{6}}+\sum_{m>K:\,d\mid
m}d\cdot\tau(m)\sum_{rn=m:\,r\mid d}\frac{O(\lvert
S^{+}_{\bm{0}}(n;1)\rvert)}{n^{6}}=\mathfrak{S}(d)+O_{\epsilon}(d^{5/3}K^{-2/3+\epsilon}).\end{split}$

This completes the proof. ∎

###  2.2. Archimedean work

Let $\nu\in C^{\infty}_{c}(\mathbb{R}^{3})$, and suppose
$\bm{0}\notin\operatorname{Supp}\nu$. Given $X\in\mathbb{R}_{>0}$ and
$(\bm{y},a)\in\mathbb{R}^{3}\times\mathbb{R}$, write
$\tilde{\bm{y}}\colonequals\bm{y}/X$ and $\tilde{a}\colonequals a/X^{3}$.
Also, for all $a\in\mathbb{R}$, let

(2.22) $\sigma_{\infty,a,\nu}(X)\colonequals\lim_{\epsilon\to
0}{(2\epsilon)^{-1}\int_{\lvert
F_{a}(\bm{y})/X^{3}\rvert\leq\epsilon}d(\bm{y}/X)\,\nu(\bm{y}/X)};$

this is real analog of the $p$-adic density $\sigma_{p,a}$ from (2.5). Note
that by definition,

(2.23) $\sigma_{\infty,a,\nu}(X)=\lim_{\epsilon\to
0}{(2\epsilon)^{-1}\int_{\lvert
F_{0}(\tilde{\bm{y}})-\tilde{a}\rvert\leq\epsilon}d\tilde{\bm{y}}\,\nu(\tilde{\bm{y}})=\sigma_{\infty,\tilde{a},\nu}(1)}.$

For convenience (when working with $\sigma_{\infty,a,\nu}(X)$), we now observe
the following:

######  Observation 2.9.

Suppose $\lvert y_{1}\rvert\geq\delta>0$ for all
$\bm{y}\in\operatorname{Supp}\nu$. Let
$(a,X)\in\mathbb{R}\times\mathbb{R}_{>0}$. Then a change of variables in
(2.23) from $\tilde{y}_{1}$ to $F_{0}\colonequals F_{0}(\tilde{\bm{y}})$
proves

(2.24)
$\sigma_{\infty,a,\nu}(X)=\int_{\mathbb{R}^{2}}d\tilde{y}_{2}\,d\tilde{y}_{3}\,\nu(\tilde{\bm{y}})\cdot\lvert\partial
F_{0}/\partial\tilde{y}_{1}\rvert^{-1},$

where $F_{0},\tilde{y}_{1}$ are constrained by the equation $F_{0}=\tilde{a}$
(and thus determined by $\tilde{y}_{1},\tilde{y}_{2}$), and where $\partial
F_{0}/\partial\tilde{y}_{1}=3\tilde{y}_{1}^{2}\geq 3\delta^{2}>0$ over the
support of the integrand.

###### Proof.

Cf. [heath1996new]*proof of Lemma 11. ∎

At least in the absence of better surface coordinates, the earlier
“$\epsilon$-thickening” still provides greater intuition, while the surface
integral allows for effortless rigor.

We now prove three results on real densities. Let $B(\nu)$ and
$\lVert\nu\rVert_{k,\infty}$ be as in §1.1.

######  Proposition 2.10.

For integers $k\geq 0$, we have
$\partial_{\tilde{a}}^{k}[\sigma_{\infty,a,\nu}(X)]\ll_{k}\lVert\nu\rVert_{k,\infty}B(\nu)^{A_{0}+A_{1}k}$
(for some constants $A_{0},A_{1}\in[1,10]$), uniformly over
$(a,X)\in\mathbb{R}\times\mathbb{R}_{>0}$.

###### Proof.

_Case 1: $\lvert y_{1}\rvert\geq 1/3B(\nu)$ for all
$\bm{y}\in\operatorname{Supp}\nu$._ Consider the surface integral in (2.24).
The integrand vanishes unless $\tilde{a}\ll B(\nu)^{3}$ and
$\tilde{y}_{2},\tilde{y}_{3}\ll B(\nu)$. Fix $\tilde{y}_{2},\tilde{y}_{3}\ll
B(\nu)$, and let $\tilde{y}_{1}$ vary with $\tilde{a}$ according to
$F_{0}=\tilde{a}$. Then
$\partial_{\tilde{a}}[\tilde{y}_{1}]=(3\tilde{y}_{1}^{2})^{-1}\ll B(\nu)^{2}$.
Now repeatedly apply $\partial_{\tilde{a}}$ to the integrand (using Leibniz
and the chain rule). This gives
$\partial_{\tilde{a}}^{k}[\sigma_{\infty,a,\nu}(X)]\ll_{k}\lVert\nu\rVert_{k,\infty}B(\nu)^{4+3k}$.

_Case 2: The general case._ Fix $\upsilon_{0}\in
C^{\infty}_{c}(\mathbb{R}^{3})$, supported on $[-1,1]^{3}$, with
$\int_{\mathbb{R}^{3}}d\bm{t}\,\upsilon_{0}(\bm{t})=1$. Let
$\nu_{\bm{t}}(\bm{y})\colonequals\upsilon_{0}(\bm{t}-3B(\nu)\bm{y})\cdot\nu(\bm{y})$,
so that
$\nu(\bm{y})=\int_{\bm{t}\in\mathbb{R}^{3}}d\bm{t}\,\nu_{\bm{t}}(\bm{y})$ for
all $\bm{y}\in\mathbb{R}^{3}$. For each $\bm{t}\in\mathbb{R}^{3}$ and
$\bm{y}\in\operatorname{Supp}{\nu_{\bm{t}}}$, we have
$\lVert\bm{y}\rVert\in\operatorname{Supp}{\nu}$, so $\lVert\bm{t}\rVert\leq
1+3B(\nu)\lVert\bm{y}\rVert\leq 4B(\nu)^{2}$ and $\lVert\bm{y}\rVert\geq
1/B(\nu)$. Since $\operatorname{Supp}{\nu_{\bm{t}}}$ has taxicab diameter
$\leq 2/3B(\nu)$, there exists $j=j_{\bm{t}}\in\\{1,2,3\\}$ such that $\lvert
y_{j}\rvert\geq 1/3B(\nu)$ holds for all
$\bm{y}\in\operatorname{Supp}{\nu_{\bm{t}}}$. Thus
$\partial_{\tilde{a}}^{k}[\sigma_{\infty,a,\nu_{\bm{t}}}(X)]\ll_{k}\lVert\nu_{\bm{t}}\rVert_{k,\infty}B(\nu_{\bm{t}})^{4+3k}\ll_{k}\lVert\nu\rVert_{k,\infty}B(\nu)^{4+4k}$
for all $\bm{t}\in\mathbb{R}^{3}$. Integrating over $\lVert\bm{t}\rVert\leq
4B(\nu)^{2}$, we conclude that
$\partial_{\tilde{a}}^{k}[\sigma_{\infty,a,\nu_{\bm{t}}}(X)]\ll_{k}B(\nu)^{10+4k}$.
Thus we may take $A_{0}=10$, $A_{1}=4$. ∎

######  Proposition 2.11.

Let $X\in\mathbb{R}_{>0}$. The “pure $L^{2}$ moment”
$\int_{a\in\mathbb{R}}d\tilde{a}\,\sigma_{\infty,a,\nu}(X)^{2}$ and the “mixed
$L^{1}$ moment”
$\int_{\tilde{\bm{z}}\in\mathbb{R}^{3}}d\tilde{\bm{z}}\,\nu(\tilde{\bm{z}})\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)$
both equal $\sigma_{\infty,\nu^{\otimes 2}}$ (defined via (1.9)).

###### Proof when $\lvert y_{1}\rvert>0$ for all
$\bm{y}\in\operatorname{Supp}\nu$.

First, $F_{a}=F_{0}-a$, so
$\int_{a\in\mathbb{R}}d\tilde{a}\,\sigma_{\infty,a,\nu}(X)^{2}$ expands (via
(2.24), and a change of variables from $a$ to $\tilde{y}_{1}$) to

$\int_{\mathbb{R}^{4}}d\tilde{y}_{2}\,d\tilde{y}_{3}\,d\tilde{z}_{2}\,d\tilde{z}_{3}\int_{\tilde{y}_{1}\in\mathbb{R}}dF_{0}(\tilde{\bm{y}})\,\frac{\nu(\tilde{\bm{y}})\nu(\tilde{\bm{z}})}{\partial_{\tilde{y}_{1}}F_{0}|_{\tilde{\bm{y}}}}(\partial_{\tilde{z}_{1}}F_{0}|_{\tilde{\bm{z}}})^{-1}|_{F_{0}(\tilde{\bm{y}})=F_{0}(\tilde{\bm{z}})},$

which simplifies to
$\int_{\mathbb{R}^{5}}d\tilde{y}_{2}\,d\tilde{y}_{3}\,d\tilde{z}_{2}\,d\tilde{z}_{3}\,d\tilde{y}_{1}\,\nu^{\otimes
2}(\tilde{\bm{x}})\cdot(\partial_{\tilde{z}_{1}}F_{0}|_{\tilde{\bm{z}}})^{-1}|_{F(\tilde{\bm{x}})=0}$,
which equals $\sigma_{\infty,\nu^{\otimes 2}}$ by an analog of (2.24). Second,
$F_{F_{0}(\bm{z})}=F_{0}(\bm{y})-F_{0}(\bm{z})$, so by (2.24),

$\int_{\tilde{\bm{z}}\in\mathbb{R}^{3}}d\tilde{\bm{z}}\,\nu(\tilde{\bm{z}})\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)=\int_{\mathbb{R}^{3}\times\mathbb{R}^{2}}d\tilde{\bm{z}}\,d\tilde{y}_{2}\,d\tilde{y}_{3}\,\nu(\tilde{\bm{y}})\nu(\tilde{\bm{z}})\cdot(\partial_{\tilde{y}_{1}}F_{0}|_{\tilde{\bm{y}}})^{-1}|_{F_{0}(\tilde{\bm{y}})=F_{0}(\tilde{\bm{z}})},$

which again simplifies to $\sigma_{\infty,\nu^{\otimes 2}}$. ∎

###### Proof in general.

Generalize to a “bilinear” statement (involving _two_ weights
$\nu_{1},\nu_{2}$, rather than just one); then reduce the bilinear statement
to a surface integral computation (based on a general version of (2.24)),
after taking suitable partitions of unity. ∎

######  Proposition 2.12 (Cf. [diaconu2019admissible]*proof of Lemma 3.1).

Let $X,N\geq 1$ be integers. Let $b\in\mathbb{Z}/N\mathbb{Z}$ and
$\bm{e}\in(\mathbb{Z}/N\mathbb{Z})^{3}$. Then for integers $j\geq 4$, we have
(for some constants $A_{2},\dots,A_{5}\in[1,30]$)

(2.25) $\displaystyle\sum_{a\in\mathbb{Z}:\,a\equiv
b\bmod{N}}\sigma_{\infty,a,\nu}(X)^{2}$
$\displaystyle=\frac{X^{3}\sigma_{\infty,\nu^{\otimes
2}}}{N}+\frac{O_{j}(\lVert\nu\rVert_{j,\infty}^{2}B(\nu)^{A_{2}+A_{3}j})}{(X^{3}/N)^{j-1}},$
(2.26)
$\displaystyle\sum_{\bm{z}\in\mathbb{Z}^{3}:\,\bm{z}\equiv\bm{e}\bmod{N}}\nu(\bm{z}/X)\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)$
$\displaystyle=\frac{X^{3}\sigma_{\infty,\nu^{\otimes
2}}}{N^{3}}+\frac{O_{j}(\lVert\nu\rVert_{j,\infty}^{2}B(\nu)^{A_{4}+A_{5}j})}{(X/N)^{j-3}}.$

###### Proof sketch.

Poisson summation, together with Proposition 2.11, gives

$\sum_{a\equiv
b\bmod{N}}\sigma_{\infty,a,\nu}(X)^{2}=\frac{X^{3}\sigma_{\infty,\nu^{\otimes
2}}}{N}+\sum_{c\neq
0}\frac{O(1)}{N}\left\lvert{\int_{a\in\mathbb{R}}da\,\sigma_{\infty,a,\nu}(X)^{2}e(-c\cdot
a/N)}\right\rvert.$

To bound the $c\neq 0$ terms, we plug in $a=X^{3}\tilde{a}$, integrate by
parts $j\geq 2$ times in $\tilde{a}$, and invoke Proposition 2.10. (Note that
$\sigma_{\infty,a,\nu}(X)=0$ unless $\tilde{a}\ll B(\nu)^{3}$.) The estimate
(2.25) follows, with $A_{2}=3+2A_{0}$, $A_{3}=A_{1}$.

The estimate (2.26) similar. Let
$\bm{c}\in\mathbb{Z}^{3}\setminus\\{\bm{0}\\}$. Choose $i\in\\{1,2,3\\}$ with
$\lvert c_{i}\rvert=\lVert\bm{c}\rVert$. Integrating by parts $j\geq 4$ times
in $\tilde{z}_{i}=z_{i}/X$ gives (via Proposition 2.10 with $a=F_{0}(\bm{z})$)

$\frac{1}{N^{3}}\left\lvert{\int_{\bm{z}\in\mathbb{R}^{3}}d\bm{z}\,\nu(\bm{z}/X)\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)e(-\bm{c}\cdot\bm{z}/N)}\right\rvert\ll_{j}\frac{\lVert\nu\rVert_{j,\infty}^{2}B(\nu)^{A_{4}+A_{5}j}}{\lVert\bm{c}\rVert^{j}(X/N)^{j-3}},$

with $A_{4}=3+A_{0}$, $A_{5}=A_{1}+2$ (since a factor of
$\partial_{\tilde{z}_{i}}F_{0}(\tilde{\bm{z}})=3\tilde{z}_{i}^{2}$ appears
each time we differentiate $\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)$). Poisson
summation and Proposition 2.11 then give (2.26). ∎

###  2.3. Final calculations

We are finally ready to establish the main results of §2.

######  Theorem 2.13.

Let $\nu\in C^{\infty}_{c}(\mathbb{R}^{3})$, and suppose
$\bm{0}\notin\operatorname{Supp}\nu$. Let $X,K,d\geq 1$ be integers with
$Kd\leq X^{9/10}$. Let $\mathfrak{S}(d)$ be defined as in (2.9) below. Then
$\operatorname{Var}(X,K;d)$ equals

$[N_{\nu^{\otimes 2}}(X;d)-\mathfrak{S}(d)\cdot\sigma_{\infty,\nu^{\otimes
2}}X^{3}]+O_{\epsilon}(d^{5/3}K^{-2/3+\epsilon}\cdot\sigma_{\infty,\nu^{\otimes
2}}X^{3})+O(\lVert\nu\rVert_{100,\infty}^{2}B(\nu)^{5000}).$

###### Proof.

Squaring out (2.4) yields
$\operatorname{Var}(X,K;d)=\Sigma_{1}-2\Sigma_{2}+\Sigma_{3}$, where

$\Sigma_{1}\colonequals\sum_{a\in
d\mathbb{Z}}N_{a,\nu}(X)^{2},\quad\Sigma_{2}\colonequals\sum_{a\in
d\mathbb{Z}}N_{a,\nu}(X)s_{a}(K)\sigma_{\infty,a,\nu}(X),\quad\Sigma_{3}\colonequals\sum_{a\in
d\mathbb{Z}}[s_{a}(K)\sigma_{\infty,a,\nu}(X)]^{2}.$

By (1.2), (1.4), (1.8), and (2.3), the $\ell^{2}$ moment $\Sigma_{1}$ equals
$N_{\nu^{\otimes 2}}(X;d)$. Next, write

$\Sigma_{3}=\sum_{n_{1},n_{2}\leq K}\sum_{b\in
d\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}}(n_{1}n_{2})^{-3}T_{b}(n_{1})T_{b}(n_{2})\sum_{a\equiv
b\bmod{n_{1}n_{2}d}}\sigma_{\infty,a,\nu}(X)^{2}$

by plugging in (2.2) and then grouping terms by $a\bmod{n_{1}n_{2}d}$; and
write

$\begin{split}\Sigma_{2}&=\sum_{\bm{z}\in\mathbb{Z}^{3}:\,F_{0}(\bm{z})\equiv
0\bmod{d}}\nu(\bm{z}/X)s_{F_{0}(\bm{z})}(K)\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)\\\
&=\sum_{n\leq
K}\sum_{\bm{e}\in(\mathbb{Z}/nd\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}n^{-3}T_{F_{0}(\bm{e})}(n)\sum_{\bm{z}\equiv\bm{e}\bmod{nd}}\nu(\bm{z}/X)\sigma_{\infty,F_{0}(\bm{z}),\nu}(X)\end{split}$

by expanding $N_{a,\nu}(X)$, plugging in (2.2), and grouping terms by
$\bm{z}\bmod{nd}$. Then by Proposition 2.12 and the trivial bound $\lvert
T_{b}(n)\rvert\leq n^{4}$, we have (for $j\geq 4$)

$\Sigma_{3}-\sum_{n_{1},n_{2}\leq K}\sum_{b\in
d\mathbb{Z}/n_{1}n_{2}d\mathbb{Z}}(n_{1}n_{2})^{-3}T_{b}(n_{1})T_{b}(n_{2})\cdot\frac{X^{3}\sigma_{\infty,\nu^{\otimes
2}}}{n_{1}n_{2}d}\ll
K^{6}\cdot\frac{O_{j}(\lVert\nu\rVert_{j,\infty}^{2}B(\nu)^{A_{2}+A_{3}j})}{(X^{3}/K^{2}d)^{j-1}}$

by (2.25) (with $N=n_{1}n_{2}d$), and

$\Sigma_{2}-\sum_{n\leq
K}\sum_{\bm{e}\in(\mathbb{Z}/nd\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}n^{-3}T_{F_{0}(\bm{e})}(n)\cdot\frac{X^{3}\sigma_{\infty,\nu^{\otimes
2}}}{(nd)^{3}}\ll
K^{2}(Kd)^{3}\cdot\frac{O_{j}(\lVert\nu\rVert_{j,\infty}^{2}B(\nu)^{A_{4}+A_{5}j})}{(X/Kd)^{j-3}}$

by (2.26) (with $N=nd$), where $A_{2},\dots,A_{5}\leq 30$. Since
$X,K,d,B(\nu)\geq 1$ and $Kd\leq X^{9/10}$ (and thus $K^{6}$, $K^{2}d$,
$K^{2}(Kd)^{3}$ are at most $X^{6}$, $X^{2}$, $X^{5}$, respectively), Theorem
2.13 now follows upon taking $j=100$ above, and plugging in (2.20) and (2.21)
from Proposition 2.8. ∎

For Theorem 2.14, let
$\lVert\nu\rVert_{L^{2}(\mathbb{R}^{3})}^{2}\colonequals\int_{\bm{y}\in\mathbb{R}^{3}}d\bm{y}\,\nu(\bm{y})^{2}$.
Call a function $\nu\colon\mathbb{R}^{3}\to\mathbb{R}$ _very clean_ if

(2.27)
$(\operatorname{Supp}{\nu})\cap\\{\bm{y}\in\mathbb{R}^{3}:y_{1}y_{2}y_{3}(y_{1}+y_{2})(y_{1}+y_{3})(y_{2}+y_{3})=0\\}=\emptyset,$

and _$\operatorname{LinAut}(F_{0})$ -symmetric_ if

(2.28)
$\nu(y_{1},y_{2},y_{3})=\nu(y_{\sigma(1)},y_{\sigma(2)},y_{\sigma(3)})\quad\textnormal{for
all }\sigma\in S_{3}.$

######  Theorem 2.14.

Let $\xi\in\\{0,1\\}$. Fix $\delta\in(0,9/10)$ and an integer $k\geq 5000$,
and assume (1.7) for $\xi$. Let $\nu\in C^{\infty}_{c}(\mathbb{R}^{3})$, and
assume $\nu$ satisfies (2.27) and (2.28). Let $X,K\geq 2$ be integers with
$K\leq X^{9/10-\delta}$. Fix $\hbar\in(0,9\delta/20]$, and let $P$ be the
product of all primes $p<X^{\xi\hbar}$. Then

$\sum_{a\in\mathbb{Z}:\,\gcd(a,P)=1}[N_{a,\nu}(X)-s_{a}(K)\sigma_{\infty,a,\nu}(X)]^{2}\ll\frac{X^{3}\lVert\nu\rVert_{L^{2}(\mathbb{R}^{3})}^{2}}{(\log{X})^{\xi}}+\frac{O(X^{3}\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{k})}{\min(X^{\delta/11},K^{2/3}X^{-3\delta})}.$

###### Proof.

By Propositions 2.11 and 2.10, $\sigma_{\infty,\nu^{\otimes 2}}\ll
B(\nu)^{3}\cdot\lVert\nu\rVert_{0,\infty}^{2}B(\nu)^{8}$. Also,
$\lVert\nu^{\otimes 2}\rVert_{k,\infty}\leq\lVert\nu\rVert_{k,\infty}^{2}$ by
(1.10), and $B(\nu^{\otimes 2})\leq B(\nu)$ since
$\operatorname{Supp}(\nu^{\otimes 2})\subseteq(\operatorname{Supp}\nu)^{2}$.
Now let $d\leq X^{\xi\delta}$ (so that $Kd\leq X^{9/10}$). By Theorem 2.13,
(1.7), and (1.5), we conclude that (since $k\geq 5000$)

$\operatorname{Var}(X,K;d)=\sum_{\textnormal{special
}\bm{x}\in\mathbb{Z}^{6}:\,d\mid F_{0}(\bm{y}),F_{0}(\bm{z})}\nu^{\otimes
2}(\bm{x}/X)+O(X^{3-\delta}+X^{3+2\delta}K^{-2/3})\cdot\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{k}.$

Since $\nu$ satisfies (2.27) and (2.28), a short calculation using (1.3) shows
that

$\sum_{\textnormal{special }\bm{x}\in\mathbb{Z}^{6}:\,d\mid
F_{0}(\bm{y}),F_{0}(\bm{z})}\nu^{\otimes
2}(\bm{x}/X)=3!\sum_{\bm{y}\in\mathbb{Z}^{3}:\,d\mid
F_{0}(\bm{y})}\nu(\bm{y}/X)^{2}+O(\lVert\nu\rVert_{0,\infty}^{2}\cdot[B(\nu)X]^{2}).$

But $\nu\in C^{\infty}_{c}(\mathbb{R}^{3})$, so by Poisson summation (cf. the
proof of (2.26) in Proposition 2.12),

$\sum_{\bm{y}\in\mathbb{Z}^{3}:\,d\mid
F_{0}(\bm{y})}\nu(\bm{y}/X)^{2}=\sum_{\bm{e}\in(\mathbb{Z}/d\mathbb{Z})^{3}:\,F_{0}(\bm{e})\equiv
0\bmod{d}}\left(\frac{X^{3}\lVert\nu\rVert_{L^{2}(\mathbb{R}^{3})}^{2}}{d^{3}}+\frac{O_{k}(\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{3})}{(X/d)^{k-3}}\right),$

since $k\geq 4$. For integers $n\geq 1$, let

$g(n)\colonequals
n^{-3}\cdot\lvert\\{\bm{e}\in(\mathbb{Z}/n\mathbb{Z})^{3}:F_{0}(\bm{e})\equiv
0\bmod{n}\\}\rvert.$

Then our work above (in the the last several displays) implies

(2.29)
$\operatorname{Var}(X,K;d)=3!g(d)X^{3}\lVert\nu\rVert_{L^{2}(\mathbb{R}^{3})}^{2}+r_{d},$

where
$r_{d}\ll(X^{3-\delta}+X^{3+2\delta}K^{-2/3}+X^{2}+d^{3}/(X/d)^{k-3})\cdot\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{k}$.
Since $d\leq X^{9/10}$ and $k\geq 100$, we in fact have

(2.30)
$r_{d}\ll(X^{3-\delta}+X^{3+2\delta}K^{-2/3})\cdot\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{k}.$

But $g$ is multiplicative in $n$, and we have $g(n)\in(0,1)$ for all $n\geq 2$
(because, for instance, $F_{0}(\bm{0})=0$ and $F_{0}(1,0,0)=1$). Directly if
$\xi=0$, and by the Selberg sieve [iwaniec2004analytic]*Theorem 6.4 and (6.80)
if $\xi=1$, we conclude from (2.29) that

(2.31)
$\sum_{a\in\mathbb{Z}:\,\gcd(a,P)=1}[N_{a,\nu}(X)-s_{a}(K)\sigma_{\infty,a,\nu}(X)]^{2}\leq\frac{3!X^{3}\lVert\nu\rVert_{L^{2}(\mathbb{R}^{3})}^{2}}{H^{\xi}}+R(P)$

(upon recalling that $P=\prod_{p<X^{\xi\hbar}}p$), where

$H\colonequals\sum_{d<X^{\hbar}}\mu(d)^{2}\prod_{p\mid
d}\frac{g(p)}{1-g(p)}\geq 1,$

and where (using (2.30) to bound $r_{d}$)

$R(P)\ll_{\epsilon}\sum_{d\leq X^{2\xi\hbar}}d^{\epsilon}\lvert r_{d}\rvert\ll
X^{\epsilon}(X^{3-\delta/10}+X^{3+2.9\delta}K^{-2/3})\cdot\lVert\nu\rVert_{k,\infty}^{2}B(\nu)^{k}.$

But the Hasse bound for elliptic curves implies $g(p)=p^{-1}+O(p^{-3/2})$, so
$\sum_{p\leq x}g(p)\log{p}=\log{x}+O(1)$ (for all real $x\geq 1$, say) and
$\sum_{\textnormal{$p$ prime}}g(p)^{2}\log{p}<\infty$. By
[iwaniec2004analytic]*§6.6, derivation of (6.85) using Theorem 1.1, we have
$H\asymp\log(X^{\hbar})$. Theorem 2.14 follows. ∎

##  3\. Statistics of truncated singular series

For integers $K\geq 1$, recall the definition of $s_{a}(K)$ from (2.2). In
this section, we will prove that $s_{a}(K)$ is typically sizable (see Theorem
3.9 below). The proof makes use of an “approximate inverse” of
$s_{a}(K)=\sum_{n\leq K}n^{-3}T_{a}(n)$. There is some flexibility here; we
let

(3.1) $M_{a}(K)\colonequals\sum_{n\leq K:\,\gcd(n,30)=1}\mu(n)n^{-3}T_{a}(n).$

The strategy for Theorem 3.9 is to show that $s_{a}(K)M_{a}(K)$ is typically
sizable, and that $M_{a}(K)$ is typically bounded. For analytic convenience,
let $T^{\natural}_{a}(n)\colonequals n^{-2}T_{a}(n)$.

For integers $a$ and primes $p\nmid 3a$, Propositions 3.2 and 3.3 below imply
$T^{\natural}_{a}(p)\ll 1$ and $T_{a}(p^{\geq 2})=0$. Indeed, if $a\neq 0$,
then $s_{a}(K)$ resembles the value of an $L$-function at $1$, and in this
sense Theorem 3.9 is related to work such as [granville2003distribution]. But
there are also significant issues with this comparison, because $\lvert
T^{\natural}_{a}(n)\rvert$ can be as large as $n$ or so. (Trivially $\lvert
T^{\natural}_{a}(n)\rvert\leq n^{2}$.) The most serious issues arise when $a$
has a large cube divisor.

For an integer $n\geq 1$, let
$\operatorname{sq}(n)\colonequals\prod_{p^{2}\mid n}p^{v_{p}(n)}$ denote the
_square-full part_ of $n$, and
$\operatorname{cub}(n)\colonequals\prod_{p^{3}\mid n}p^{v_{p}(n)}$ the _cube-
full part_ of $n$. Let $\mathcal{S}(D)$ be the set of nonzero integers $a$
with $\operatorname{sq}(\lvert a\rvert)\leq D$. Let $\mathcal{C}(D)$ be the
set of nonzero integers $a$ with $\operatorname{cub}(\lvert a\rvert)\leq D$.
We call an integer $n\geq 1$ _square-full_ if $n\in\mathcal{S}(1)$, and _cube-
full_ if $n\in\mathcal{C}(1)$.

We now collect some basic facts about $T_{a}(n)$.

######  Lemma 3.1.

Let $a,n\in\mathbb{Z}$ with $n\geq 1$. Let
$n_{3}\colonequals\operatorname{cub}(n)$. Then $\lvert
T^{\natural}_{a}(n)\rvert\leq O(1)^{\omega(n)}(n_{3}n)^{1/2}$.

###### Proof.

By Proposition 2.2, it suffices to prove the lemma when $n=p^{l}$ for some
prime $p$ and integer $l\geq 1$. But by (2.1) and [vaughan1997hardy]*(4.24)
and Lemma 4.7, we have

$p^{3\lfloor(l-1)/3\rfloor}\cdot p^{-3l}T_{a}(p^{l})\ll p^{l-3/2}\bm{1}_{3\mid
l-1}+p^{l-3}\bm{1}_{3\nmid l-1}.$

A short calculation then yields $T^{\natural}_{a}(p^{l})\ll
p^{l/2}\cdot\bm{1}_{l\in\\{1,2\\}}+p^{l}\cdot\bm{1}_{l\geq 3}$. (There should
be more robust proofs, but since $F_{0}$ is diagonal, it is convenient to call
on [vaughan1997hardy].) ∎

For the proofs of the next two results, let $N_{a}(m)$ denote the number of
solutions $\bm{y}\in(\mathbb{Z}/m\mathbb{Z})^{3}$ to $F_{0}(\bm{y})\equiv
a\bmod{m}$.

######  Proposition 3.2.

Let $a\in\mathbb{Z}$. Let $p$ be a prime. Then the following hold:

  1. (1)

If $p\nmid 3a$, then $\lvert T^{\natural}_{a}(p)\rvert\leq 6+2p^{-1/2}$.

  2. (2)

If $p\mid 3a$, then $\lvert T^{\natural}_{a}(p)\rvert\leq 6p^{1/2}$.

  3. (3)

If $p\geq 7$, then $\lvert T^{\natural}_{a}(p)\rvert<0.99p$.

###### Proof.

By (2.1), we have

(3.2) $T_{a}(p)=pN_{a}(p)-p^{3}.$

_Case 1: $p\nmid 3a$._ Then the equation $F_{0}(\bm{y})=aw^{3}$ cuts out a
smooth cubic hypersurface in $\mathbb{P}^{3}$ over $\mathbb{F}_{p}$. The
“curve at infinity” (cut out by $w=0$), namely $F_{0}(\bm{y})=0$ in
$\mathbb{P}^{2}$, is also smooth. So by the Weil conjectures,
$N_{a}(p)=(p^{2}+p+1+\lambda_{1})-(p+1-\lambda_{2})$, where
$\lambda_{1}=\lambda_{1}(a;p)$ and $\lambda_{2}=\lambda_{2}(p)$ are integers
with $\lvert\lambda_{1}\rvert\leq 6p$ and $\lvert\lambda_{2}\rvert\leq
2\sqrt{p}$. Thus $\lvert T_{a}(p)\rvert\leq 6p^{2}+2p^{3/2}$, and $\lvert
T^{\natural}_{a}(p)\rvert\leq 6+2p^{-1/2}$. So (1)–(3) hold (with (2) being
vacuous).

_Case 2: $p=3$._ Then $\lvert T^{\natural}_{a}(p)\rvert\leq p^{2}$ trivially.
(In fact, $T_{a}(p)=0$, but we do not need this special fact.) So (1)–(3) hold
(with (1) and (3) being vacuous).

_Case 2: $p\mid 3a$ and $p\neq 3$._ Then $p\mid a$. So $T_{a}(p)=T_{0}(p)$.
But $F_{0}(\bm{y})=0$ in $\mathbb{A}^{3}$ is an affine cone over a curve. This
curve, $F_{0}(\bm{y})=0$ in $\mathbb{P}^{2}$, is smooth. So by the Weil
conjectures, $N_{0}(p)=1+(p-1)(p+1-\lambda_{2}(p))$, where
$\lvert\lambda_{2}(p)\rvert\leq 2\sqrt{p}$. Thus $\lvert T_{a}(p)\rvert\leq
2p(p-1)\sqrt{p}$, and $\lvert T^{\natural}_{a}(p)\rvert\leq
2(p^{1/2}-p^{-1/2})$. So (1)–(3) hold (with (1) being vacuous). ∎

We now strengthen the vanishing result in [vaughan1997hardy]*Lemma 4.7.

######  Proposition 3.3.

Let $p$ be a prime. Let $a,l\in\mathbb{Z}$ with $l\geq 2$. If $p^{l-1}\nmid
3a$, then $T_{a}(p^{l})=0$.

###### Proof when $p\neq 3$.

By (2.1), we have

(3.3) $T_{a}(p^{l})=p^{l}N_{a}(p^{l})-p^{l-1}p^{3}N_{a}(p^{l-1}).$

Let $N^{0}_{a}(p^{v})$ (for $v\geq 1$) denote the number of solutions
$\bm{y}\in(\mathbb{Z}/p^{v}\mathbb{Z})^{3}$ to $F_{0}(\bm{y})\equiv
a\bmod{p^{v}}$ with $p\mid\nabla{F_{0}}(\bm{y})$. (Here
$\nabla{F_{0}}(\bm{y})=(3y_{1}^{2},3y_{2}^{2},3y_{3}^{2})$.) Then by (3.3) and
Hensel’s lemma,

(3.4) $T_{a}(p^{l})=p^{l}N^{0}_{a}(p^{l})-p^{l-1}p^{3}N^{0}_{a}(p^{l-1}).$

_Case 1: $p^{3}\nmid a$._ Suppose $p^{l-1}\nmid 3a$. Then
$p^{\min(3,l-1)}\nmid a$, so all solutions $\bm{y}\bmod{p^{l-1}}$ to
$F_{0}(\bm{y})\equiv a\bmod{p^{l-1}}$ must be _primitive_ (i.e. satisfy
$p\nmid\bm{y}$), and thus satisfy $p\nmid\nabla{F_{0}}(\bm{y})$. Thus
$N^{0}_{a}(p^{v})=0$ for $v\geq l-1$, whence $T_{a}(p^{l})=0$ by (3.4).

_Case 2: $p^{3}\mid a$._ Suppose $p^{l-1}\nmid 3a$. Then $l\geq 5$. But by a
short calculation, $N^{0}_{a}(p^{v})=p^{6}N_{a/p^{3}}(p^{v-3})$ for $v\geq 4$,
whence $T_{a}(p^{l})=p^{9}T_{a/p^{3}}(p^{l-3})$ by (3.4). Noting that $l-3\geq
2$ and $p^{l-4}\nmid 3a/p^{3}$, a recursive argument now yields
$T_{a}(p^{l})=0$. ∎

###### Proof when $p=3$.

Both (3.3) and (3.4) hold here, but (3.4) is no longer simpler than (3.3).
However, let $N^{1}_{a}(p^{v})$ (for $v\geq 2$) denote the number of solutions
$\bm{y}\in(\mathbb{Z}/p^{v}\mathbb{Z})^{3}$ to $F_{0}(\bm{y})\equiv
a\bmod{p^{v}}$ with $p^{2}\mid\nabla{F_{0}}(\bm{y})$. A routine Hensel
argument (based on writing $\bm{y}=\bm{y}_{0}+p^{l-2}\bm{z}$, rather than
$\bm{y}=\bm{y}_{0}+p^{l-1}\bm{z}$) shows that if $l\geq 3$, then
$T_{a}(p^{l})=p^{l}N^{1}_{a}(p^{l})-p^{l-1}p^{3}N^{1}_{a}(p^{l-1})$. Just as
for $p\neq 3$, one then finishes by casework on whether $p^{3}\nmid a$ or
$p^{3}\mid a$. ∎

Now recall (2.2) and (3.1). For every $a\in\mathbb{Z}$, we have

(3.5) $s_{a}(K)M_{a}(K)=\sum_{n\leq
K}c_{a}(n)+\sum_{\begin{subarray}{c}n_{1},n_{2}\leq K:\\\
n_{1}n_{2}>K,\;\gcd(n_{2},30)=1\end{subarray}}n_{1}^{-3}T_{a}(n_{1})\cdot\mu(n_{2})n_{2}^{-3}T_{a}(n_{2}),$

where for integers $n\geq 1$ we let

$c_{a}(n)\colonequals
n^{-3}\sum_{n_{1}n_{2}=n:\,\gcd(n_{2},30)=1}T_{a}(n_{1})\cdot\mu(n_{2})T_{a}(n_{2}).$

By Proposition 2.2, $c_{a}(n)$ is a Dirichlet convolution of two
multiplicative functions, so $c_{a}(n)$ is multiplicative in $n$. For any
prime $p$ and integer $l\geq 1$, we have

(3.6) $c_{a}(p^{l})=p^{-3l}[T_{a}(p^{l})-T_{a}(p^{l-1})T_{a}(p)\bm{1}_{p\geq
7}]=p^{-l}[T^{\natural}_{a}(p^{l})-T^{\natural}_{a}(p^{l-1})T^{\natural}_{a}(p)\bm{1}_{p\geq
7}].$

We now bound $c_{a}(n)$ using our work above (for convenience;
[vaughan1997hardy]*Lemma 4.7, a “stratification” result for
$p^{-l}T^{\natural}_{a}(p^{l})$ based on $\gcd(p^{l},a)$, might also suffice).

######  Lemma 3.4.

Let $a,n\in\mathbb{Z}$ with $a\neq 0$ and $n\geq 1$. Let
$a_{2}\colonequals\operatorname{sq}(\lvert a\rvert)$ and
$n_{3}\colonequals\operatorname{cub}(n)$. Let
$n_{2}\colonequals\operatorname{sq}(n/n_{3})$ and $n_{1}\colonequals
n/n_{2}n_{3}$. Then $n_{2}$ is a square, and

(3.7) $\lvert c_{a}(n)\rvert\leq O(1)^{\omega(n)}n_{1}^{-2}\cdot
n_{2}^{-1}\gcd(n_{2}^{1/2},3a)\cdot n_{3}^{-1/2}\prod_{p\mid
n_{3}:\,v_{p}(n_{3})\leq 2v_{p}(9a_{2})}p^{v_{p}(n_{3})/2}.$

###### Proof.

Since $n/n_{3}$ is cube-free, $n_{2}=\operatorname{rad}(n_{2})^{2}$. As for
(3.7), note that both sides of (3.7) are multiplicative in $n$, so we may
assume $n=p^{l}$, where $p$ is prime and $l\geq 1$ is an integer.

_Case 1: $l=1$._ By (3.6), $c_{a}(p)=0$ if $p\geq 7$, and $c_{a}(p)\ll p^{-2}$
trivially if $p\leq 5$. So $c_{a}(n)\ll n^{-2}$. This proves (3.7), since
$(n_{1},n_{2},n_{3})=(n,1,1)$.

_Case 2: $l=2$._ Again, use (3.6). If $p\nmid 3a$, then Propositions 3.3 and
3.2 give $c_{a}(p^{2})=p^{-2}[0+O(1)]\ll p^{-2}$. If $p\mid 3a$, then Lemma
3.1 and Proposition 3.2 give $c_{a}(p^{2})\ll p^{-2}[p+O(p)]\ll p^{-1}$.
Either way, $c_{a}(p^{2})\ll n^{-1}\gcd(n^{1/2},3a)$. This proves (3.7), since
$(n_{1},n_{2},n_{3})=(1,n,1)$.

_Case 3: $l\geq 3$._ If $p^{\max(2,l-2)}\nmid 3a$, then (3.6) and Proposition
3.3 (plus Lemma 3.1 if $l=3$) give $c_{a}(p^{l})\ll p^{-l/2}$. In general,
(3.6) and Lemma 3.1 give $c_{a}(p^{l})\ll 1$. Either way,

$c_{a}(n)\ll n^{-1/2}(p^{v_{p}(n)/2})^{\bm{1}_{v_{p}(3a)\geq\max(2,l-2)}}\ll
n^{-1/2}(p^{v_{p}(n)/2})^{\bm{1}_{v_{p}(9a_{2})\geq l/2}},$

where in the final step we have used the fact that $p^{\max(2,l-2)}$ is
square-full, $\operatorname{sq}(3a)\mid\operatorname{sq}(9a_{2})$, and
$\max(2,l-2)\geq l/2$. This proves (3.7), since $(n_{1},n_{2},n_{3})=(1,1,n)$.
∎

In general, the series $\sum_{n\leq K}c_{a}(n)$ behaves better than
$s_{a}(K)$.

######  Proposition 3.5.

Let $a,D,K\in\mathbb{Z}$ with $a\neq 0$ and $D,K\geq 1$. Suppose
$a\not\equiv\pm 4\bmod{9}$.

  1. (1)

For $p$ prime, $1+c_{a}(p)+c_{a}(p^{2})+\cdots$ converges absolutely to a real
number $\gamma_{p}(a)>0$.

  2. (2)

If $p\nmid 3a$, then $\gamma_{p}(a)\geq(1-p^{-2})^{O(1)}$. If $p\mid 3a$, then
$\gamma_{p}(a)\geq(1-p^{-1})^{O(1)}$.

  3. (3)

$\prod_{\textnormal{$p$ prime}}\gamma_{p}(a)$ converges absolutely to a real
number $\gamma(a)\gg\prod_{p\mid a}(1-p^{-1})^{O(1)}$.

  4. (4)

If $a\in\mathcal{S}(D)$, then $\sum_{n\leq
K}c_{a}(n)=\gamma(a)+O_{\epsilon}(\lvert
a\rvert^{\epsilon}K^{\epsilon-1/6}D)$.

###### Proof.

By Proposition 3.3, (3.6), and (2.5), the sum $\sum_{j\geq 0}c_{a}(p^{j})$
converges _absolutely_ to

(3.8)
$\gamma_{p}(a)\colonequals\sigma_{p,a}\cdot(1-p^{-3}T_{a}(p)\bm{1}_{p\geq
7}),$

since $a\neq 0$. Here $\sigma_{p,a}>0$ by [davenport2005analytic]*(5.11) and
Lemma 5.5, since $a\not\equiv\pm 4\bmod{9}$. And

(3.9) $1-p^{-3}T_{a}(p)\bm{1}_{p\geq 7}\in(0.01,1.99)$

by Proposition 3.2. So $\gamma_{p}(a)>0$ by (3.8). This completes the proof of
(1).

Now we bound $\gamma_{p}(a)$ from below. First suppose $p\leq 5$. The proof of
[davenport2005analytic]*Lemma 5.5 shows that $\sigma_{p,a}\gg 1$ (uniformly
over $a$). So $\gamma_{p}(a)\gg 1$ by (3.8) and (3.9). Now suppose $p\geq 7$.
Let $N^{\ast}_{a}(p)$ denote the number of solutions
$\bm{y}\in\mathbb{F}_{p}^{3}\setminus\\{\bm{0}\\}$ to $F_{0}(\bm{y})=a$. By
(2.5) and Hensel’s lemma, $\sigma_{p,a}\geq p^{-2}N^{\ast}_{a}(p)$. But
$N^{\ast}_{a}(p)\geq N_{a}(p)-1$, and $N_{a}(p)=p^{2}+p^{-1}T_{a}(p)$ by
(3.2), so $\sigma_{p,a}\geq 1+p^{-3}T_{a}(p)-p^{-2}$. Since $p\geq 7$, it
follows from (3.8), (3.9), and Proposition 3.2 that $\gamma_{p}(a)\geq
1-p^{-6}T_{a}(p)^{2}-1.99p^{-2}=1-O(p^{-2}\bm{1}_{p\nmid
3a}+p^{-1}\bm{1}_{p\mid 3a})$. Since $\gamma_{p}(a)>0$ by (1), we conclude
that (2) holds for $p\geq 7$. By enlarging the $O(1)$’s in (2) if necessary,
we can then ensure that (2) holds for all primes $p$.

For (3), first note that if $p\geq 7$ and $p\nmid 3a$, then
$N^{\ast}_{a}(p)=N_{a}(p)$, so $\sigma_{p,a}=p^{-2}N_{a}(p)$ by (2.5) and
Hensel’s lemma; and hence the arguments in the previous paragraph imply
$\gamma_{p}(a)=1+O(p^{-2})$ (uniformly over $p\nmid 30a$). Thus
$\prod_{\textnormal{$p$ prime}}\gamma_{p}(a)$ converges absolutely to some
$\gamma(a)\in\mathbb{R}_{>0}$. By (2), then, $\gamma(a)\gg\prod_{p\mid
3a}(1-p^{-1})^{O(1)}$. So (3) holds.

For (4), note that by Lemma 3.4 (and the definition of $\mathcal{S}(D)$),

(3.10) $\sum_{n>K}\lvert
c_{a}(n)\rvert\ll_{\epsilon}\sum_{\begin{subarray}{c}n_{1},m_{2},n_{3}\geq
1:\\\ n_{1}m_{2}^{2}n_{3}\geq
K,\;n_{3}=\operatorname{cub}(n_{3})\end{subarray}}(n_{1}m_{2}^{2}n_{3})^{\epsilon}n_{1}^{-2}m_{2}^{-2}\gcd(m_{2},3a)n_{3}^{-1/2}(9D).$

By dyadic summation, the right-hand side of (3.10) is at most
$O_{\epsilon}(K^{O(\epsilon)}D)$ times

$\sup_{\begin{subarray}{c}N_{1},M_{2},N_{3}\in\mathbb{R}_{\geq 1}:\\\
(2N_{1})(2M_{2})^{2}(2N_{3})\geq K\end{subarray}}\,\sum_{d\mid
3a}N_{1}^{1-2}(M_{2}/d)M_{2}^{-2}dN_{3}^{1/3-1/2}\ll_{\epsilon}\lvert
a\rvert^{\epsilon}K^{-1/6}.$

Thus $\sum_{n\geq 1}c_{a}(n)$ converges absolutely to $\gamma(a)$; and
furthermore, (4) holds. ∎

To bound $M_{a}(K)$ on average, and to handle the sum over $n_{1}n_{2}>K$ in
(3.5), we can use Lemma 3.8 below, whose proof requires the following two
lemmas.

######  Lemma 3.6.

Let $D,n\geq 1$ be integers. Let $a\in\mathcal{S}(D)$. If $T_{a}(n)\neq 0$,
then $n\in\mathcal{C}(27D^{3/2})$.

###### Proof.

Suppose $T_{a}(n)\neq 0$. Let $a_{2}\leq D$ be the square-full part of $\lvert
a\rvert$. Suppose $p$ is a prime dividing the cube-full part $n_{3}$ of $n$.
Since $T_{a}(n)\neq 0$, Proposition 2.2 implies $T_{a}(p^{v_{p}(n)})\neq 0$.
So by Proposition 3.3, $p^{v_{p}(n)-1}\mid 3a$. Here $v_{p}(n)\geq 3$; so
$p^{v_{p}(n)-1}\mid\operatorname{sq}(3a)\mid\operatorname{sq}(9a_{2})$.
Therefore, $9a_{2}$ is divisible by $\prod_{p\mid n_{3}}p^{v_{p}(n)-1}\geq
n_{3}^{2/3}$, whence $n_{3}\leq(9a_{2})^{3/2}\leq 27D^{3/2}$. ∎

The next lemma controls the large values of $\lvert T^{\natural}_{a}(n)\rvert$
on average over $a$. Let

$T^{\natural}_{b}(\bm{m})\colonequals T^{\natural}_{b}(m_{1})\cdots
T^{\natural}_{b}(m_{r}),\quad T^{\natural}_{b}(\bm{n})\colonequals
T^{\natural}_{b}(n_{1})\cdots T^{\natural}_{b}(n_{r}),$

whenever the variables $b$, $r$, $m_{1},\dots,m_{r}$, $n_{1},\dots,n_{r}$ are
clear from context.

######  Lemma 3.7.

Let $r,m_{1},n_{1},\dots,m_{r},n_{r}\geq 1$ be integers. Let $m_{i,3}$,
$n_{i,3}$ denote the cube-full parts of $m_{i}$, $n_{i}$, respectively.
Suppose $m_{1}\cdots m_{r}n_{1}\cdots n_{r}$ is square-full. Then

$\mathbb{E}_{b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}}[\lvert T^{\natural}_{b}(\bm{m})\rvert\cdot\lvert
T^{\natural}_{b}(\bm{n})\rvert]\ll_{r,\epsilon}\frac{\prod_{i=1}^{r}[(m_{i,3}n_{i,3})^{1/2}(m_{i}n_{i})^{1/2+\epsilon}]}{\operatorname{rad}(m_{1}\cdots
m_{r}n_{1}\cdots n_{r})}.$

###### Proof.

By Proposition 2.2, we may assume that $m_{1}\cdots m_{r}n_{1}\cdots n_{r}$ is
a prime power; or equivalently, that $\operatorname{rad}(m_{1}\cdots
m_{r}n_{1}\cdots n_{r})$ equals some prime $p$. Applying Lemma 3.1 to residues
$b$ with $p\mid 3b$, and Propositions 3.2 and 3.3 to residues $b$ with $p\nmid
3b$, gives

$\mathbb{E}_{b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}}[\lvert T^{\natural}_{b}(\bm{m})\rvert\cdot\lvert
T^{\natural}_{b}(\bm{n})\rvert]\ll_{r}\frac{\prod_{i=1}^{r}[(m_{i,3}n_{i,3})^{1/2}(m_{i}n_{i})^{1/2}]}{p/\gcd(3,p)}+1.$

But $m_{1}\cdots m_{r}n_{1}\cdots n_{r}$ is square-full, so
$\prod_{i=1}^{r}(m_{i}n_{i})^{1/2}\geq p$, and the lemma follows. ∎

The following result can loosely be thought of as an algebro-geometric analog
of [duke2000problem]*Theorem 4, emphasizing a different aspect. It only
applies over relatively small moduli.

######  Lemma 3.8.

Let $A,K_{1},K_{2},D,j\geq 1$ be integers. Let
$\beta\colon\mathbb{Z}^{2}\to\mathbb{R}$ be a function supported on
$[K_{1},2K_{1})\times[K_{2},2K_{2})$. For $a\in\mathbb{Z}$, let

(3.11) $P_{a}\colonequals\sum_{m,n\geq 1:\,n\in\mathcal{S}(1)}\beta(m,n)\cdot
T^{\natural}_{a}(m)T^{\natural}_{a}(n).$

Suppose $A\geq(K_{1}K_{2})^{3j}$. Then

(3.12) $\sum_{a\in[-A,A]\cap\mathcal{S}(D)}\lvert
P_{a}\rvert^{2j}\ll_{j,\epsilon}A\cdot\min(K_{1},D^{3/2})^{j}\cdot(K_{1}K_{2})^{j+\epsilon}\cdot(\max{\lvert\beta\rvert})^{2j}.$

###### Proof.

Let $K\colonequals K_{1}K_{2}$ and $r\colonequals 2j$. For $a\in\mathbb{Z}$,
let

$Q_{a}\colonequals\sum_{m,n\geq
1:\,m\in\mathcal{C}(27D^{3/2}),\;n\in\mathcal{S}(1)}\beta(m,n)\cdot
T^{\natural}_{a}(m)T^{\natural}_{a}(n).$

By (3.11) and Lemma 3.6, we have $P_{a}=Q_{a}$ for all $a\in\mathcal{S}(D)$.
Thus we may replace each $P_{a}$ in (3.12) with $Q_{a}$; and by positivity, we
may then extend $[-A,A]\cap\mathcal{S}(D)$ to the full interval $[-A,A]$. It
follows that the left-hand side of (3.12) is at most

(3.13) $\sum_{a\in[-A,A]}\lvert
Q_{a}\rvert^{r}\ll\sum_{\begin{subarray}{c}m_{1},\dots,m_{r}\in\mathbb{Z}_{\geq
1}\cap\mathcal{C}(27D^{3/2}),\\\ n_{1},\dots,n_{r}\in\mathbb{Z}_{\geq
1}\cap\mathcal{S}(1),\\\ b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}\end{subarray}}\beta(\bm{m},\bm{n})T^{\natural}_{b}(\bm{m})T^{\natural}_{b}(\bm{n})\cdot\frac{A\cdot(1+O_{k}(K^{-k}))}{m_{1}\cdots
m_{r}n_{1}\cdots n_{r}},$

where
$\beta(\bm{m},\bm{n})\colonequals\beta(m_{1},n_{1})\cdots\beta(m_{r},n_{r})$;
the inequality (3.13) follows from Poisson summation after replacing (by
positivity again) the sum over $a\in[-A,A]$ with a smoothed sum over
$a\in\mathbb{Z}$. The total contribution from $O_{k}(K^{-k})$ to the right-
hand side of (3.13) is trivially $\ll
K^{2r}\cdot(\max{\lvert\beta\rvert})^{r}\cdot K^{r}\cdot A\cdot
O_{k}(K^{-k})$, which is satisfactory if $k\colonequals 3r$, say.

It remains to handle the “main” term in (3.13). Given
$m_{1},n_{1},\dots,m_{r},n_{r}\geq 1$, we have

$\sum_{b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}}T^{\natural}_{b}(\bm{m})T^{\natural}_{b}(\bm{n})=0\quad\textnormal{if
$m_{1}\cdots m_{r}n_{1}\cdots n_{r}$ is not square-full}.$

(This follows from Proposition 2.2 and the fact that
$\sum_{a\in\mathbb{Z}/p\mathbb{Z}}T_{a}(p)=0$ for every prime $p$. Cf. the
proof of Lemma 2.7.) On the other hand, if $m_{1}\cdots m_{r}n_{1}\cdots
n_{r}$ is square-full, then Lemma 3.7 delivers the bound

$\mathbb{E}_{b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}}[\lvert T^{\natural}_{b}(\bm{m})\rvert\cdot\lvert
T^{\natural}_{b}(\bm{n})\rvert]\ll_{r,\epsilon}\frac{\min(K_{1},D^{3/2})^{r/2}\cdot
K^{r/2+\epsilon}}{\operatorname{rad}(m_{1}\cdots m_{r}n_{1}\cdots n_{r})},$

provided that we have $m_{1},\dots,m_{r}\in\mathcal{C}(27D^{3/2})$ and
$n_{1},\dots,n_{r}\in\mathcal{S}(1)$. It follows that

(3.14) $\sum_{\begin{subarray}{c}m_{1},\dots,m_{r}\in\mathbb{Z}_{\geq
1}\cap\mathcal{C}(27D^{3/2}),\\\ n_{1},\dots,n_{r}\in\mathbb{Z}_{\geq
1}\cap\mathcal{S}(1),\\\ b\in\mathbb{Z}/m_{1}\cdots m_{r}n_{1}\cdots
n_{r}\mathbb{Z}\end{subarray}}\frac{\beta(\bm{m},\bm{n})T^{\natural}_{b}(\bm{m})T^{\natural}_{b}(\bm{n})}{m_{1}\cdots
m_{r}n_{1}\cdots
n_{r}}\ll\sum_{R\leq(4K)^{r/2}}\sum_{\begin{subarray}{c}m_{1},\dots,m_{r}\mid
R^{\infty},\\\ n_{1},\dots,n_{r}\mid
R^{\infty}\end{subarray}}\frac{C(\bm{m},\bm{n})}{R},$

where
$C(\bm{m},\bm{n})\colonequals\lvert\beta(\bm{m},\bm{n})\rvert\cdot\min(K_{1},D^{3/2})^{r/2}\cdot
K^{r/2+\epsilon}$. (For $u,v\in\mathbb{Z}$, we write $u\mid v^{\infty}$ if
there exists a positive integer $k$ with $u\mid v^{k}$.) But for any integers
$R,N\geq 1$, there are at most $O_{\epsilon}(R^{\epsilon}N^{\epsilon})$
integers $n\in[N,2N)$ with $n\mid R^{\infty}$ (a fact one can prove using
Rankin’s trick); so

(3.15) $\sum_{m_{1},\dots,m_{r},n_{1},\dots,n_{r}\mid
R^{\infty}}\lvert\beta(\bm{m},\bm{n})\rvert\ll_{r,\epsilon}(\max{\lvert\beta\rvert})^{r}(K_{1}R)^{r\epsilon}(K_{2}R)^{r\epsilon}.$

By (3.15) and the bound
$\sum_{R\leq(4K)^{r/2}}R^{2r\epsilon-1}\ll_{r,\epsilon}K^{r^{2}\epsilon}$, the
right-hand side of (3.14) is
$\ll_{r,\epsilon}(\max{\lvert\beta\rvert})^{r}\min(K_{1},D^{3/2})^{r/2}K^{r/2+(1+r+r^{2})\epsilon}$.
Plugging this into (3.13) gives (3.12). ∎

For integers $K\geq 1$ and reals $\eta>0$, let

(3.16) $\mathscr{E}(K;\eta)\colonequals\\{a\in\mathbb{Z}:a\not\equiv\pm
4\bmod{9}\\}\cap\\{a\in\mathbb{Z}:\lvert s_{a}(K)\rvert\leq\eta\\}.$

######  Theorem 3.9.

Let $A,K,j\geq 1$ be integers. Let $\epsilon,\eta>0$ be reals. If $A\geq
K^{6j}$, then

$A^{-1}\cdot\lvert\mathscr{E}(K;\eta)\cap[-A,A]\rvert\ll_{j,\epsilon}\eta^{1.8j}+A^{\epsilon}K^{-1.5j}+\eta^{-0.2j}K^{-0.8j}+K^{-1/24}.$

###### Proof.

By Proposition 3.5, there exists a constant $C=C(\epsilon)>0$ such that every
element of $\mathscr{E}(K;\eta)\cap[-A,A]\cap\mathcal{S}(D)$ lies in one of
the following sets:

  1. (1)

$\mathscr{E}_{1}\colonequals\\{a\in\mathcal{S}(D):\lvert
M_{a}(K)\rvert\geq\eta^{-9/10}\\}$.

  2. (2)

$\mathscr{E}_{2}\colonequals\\{a\in\mathcal{S}(D):\prod_{p\mid
a}(1-p^{-1})^{C}\leq C\cdot(\eta^{1/10}+A^{\epsilon}K^{\epsilon-1/6}D)\\}$.

  3. (3)

$\mathscr{E}_{3}\colonequals\\{a\in\mathcal{S}(D):\lvert
s_{a}(K)M_{a}(K)-\sum_{n\leq K}c_{a}(n)\rvert\geq\eta^{1/10}\\}$.

Indeed, if $C$ is sufficiently large and
$a\in\mathscr{E}(K;\eta)\cap[-A,A]\cap\mathcal{S}(D)\setminus(\mathscr{E}_{1}\cup\mathscr{E}_{2})$,
then $\lvert s_{a}(K)\rvert\leq\eta$ (since $a\in\mathscr{E}(K;\eta)$) and
$\lvert M_{a}(K)\rvert\leq\eta^{-9/10}$ (since $n\notin\mathscr{E}_{1}$), and
$\sum_{n\leq K}c_{a}(n)\geq 2\eta^{1/10}$ (by Proposition 3.5, since
$n\notin\mathscr{E}_{2}$), so $a\in\mathscr{E}_{3}$.

We now bound $\mathscr{E}_{1}$, $\mathscr{E}_{2}$, $\mathscr{E}_{3}$. By Lemma
3.8 (with $K_{1}=1$ and $1\leq K_{2}\leq K$), we have

(3.17) $\eta^{-1.8j}\cdot\lvert\mathscr{E}_{1}\cap[-A,A]\rvert\ll_{j}A,$

provided $A\geq K^{3j}$. By (3.5) and Lemma 3.8 (with $1\leq K_{2},K_{2}\leq
K$ and $(2K_{1})(2K_{2})\geq K$),

(3.18)
$\eta^{0.2j}\cdot\lvert\mathscr{E}_{3}\cap[-A,A]\rvert\ll_{j,\epsilon}AD^{3j/2}K^{-j+\epsilon},$

provided $A\geq K^{6j}$. And $\prod_{p\mid a}(1-p^{-1})=\phi(\lvert
a\rvert)/\lvert a\rvert$, so [montgomery2007multiplicative]*p. 61, (2.32)
implies

(3.19)
$(\eta^{1/10}+A^{\epsilon}K^{\epsilon-1/6}D)^{-18j}\cdot\lvert\mathscr{E}_{2}\cap[-A,A]\rvert\ll_{j,\epsilon,C}A.$

Since $[-A,A]\setminus\mathcal{S}(D)$ has size $\ll D^{-1/2}A$, we conclude
that

$A^{-1}\lvert\mathscr{E}(K;\eta)\cap[-A,A]\rvert\ll_{j,\epsilon}\eta^{1.8j}+(A^{\epsilon}K^{\epsilon-1/6}D)^{18j}+\eta^{-0.2j}D^{3j/2}K^{-j+\epsilon}+D^{-1/2},$

provided $A\geq K^{6j}$. Taking $D=\lfloor K^{1/12}\rfloor$ gives Theorem 3.9.
∎

##  4\. Applying increasingly cuspidal weights

To prove Theorems 1.1 and 1.2, we will combine Theorems 2.13, 2.14, and 3.9.
To apply Theorems 2.13 and 2.14, we need to choose a suitable weight $\nu$.
Fix a function $w_{0}\in C^{\infty}_{c}(\mathbb{R})$ with $w_{0}\geq 0$
everywhere, and $w_{0}\geq 1$ on $[-2,2]$. Fix a function $w_{2}\in
C^{\infty}_{c}(\mathbb{R})$ with $w_{2}\geq 0$ everywhere, $w_{2}\geq 1$ on
$[1,10]$, and $\operatorname{Supp}{w_{2}}\subseteq\mathbb{R}_{>0}$. Given a
real $R\geq 2$, set

(4.1) $\nu^{\star}(\bm{y})\colonequals
w_{0}(F_{0}(\bm{y}))\int_{r\in[1,R]}d^{\times}{r}\prod_{1\leq l\leq
3}w_{2}(\lvert y_{l}\rvert/r)\prod_{1\leq i<j\leq 3}w_{2}(\lvert
y_{i}+y_{j}\rvert/r),$

where $d^{\times}{r}\colonequals dr/r$. Clearly $\nu^{\star}\in
C^{\infty}_{c}(\mathbb{R}^{3})$, and $\nu^{\star}$ satisfies (2.27) and
(2.28).

Let us consider what happens as we vary $R$. Since $w_{0}$, $w_{2}$ are fixed,
we have

(4.2) $\nu^{\star}(\bm{y})\ll\int_{\mathbb{R}_{>0}}d^{\times}{r}\,w_{2}(\lvert
y_{1}\rvert/r)=\lVert w_{2}\circ\log\rVert_{L^{1}(\mathbb{R})}\ll 1$

uniformly over $\bm{y}\in\mathbb{R}^{3}$ and $R\geq 2$. Similarly in general,
for integers $k\geq 0$, we have $\lVert\nu^{\star}\rVert_{k,\infty}\ll_{k}1$,
by a short calculation using (1.10), (4.1), and the fact that $r\geq 1$ for
all $r\in[1,R]$. Also, it is clear from (4.1) that $B(\nu^{\star})\ll R$.
Furthermore,

(4.3)
$\operatorname{vol}(\operatorname{Supp}\nu^{\star})\ll\int_{r\in[1,R]}d^{\times}{r}\int_{y_{1},y_{2}\in\mathbb{R}}dy_{1}\,dy_{2}\,\bm{1}_{\lvert
y_{1}\rvert,\lvert y_{2}\rvert\in r\cdot\operatorname{Supp}{w_{2}}}\cdot
r^{-2}\ll\log{R},$

because for any $r\in[1,R]$ and $y_{1},y_{2}\in\pm
r\cdot\operatorname{Supp}{w_{2}}$, the set $\\{y_{3}\in\pm
r\cdot\operatorname{Supp}{w_{2}}:F_{0}(\bm{y})\in\operatorname{Supp}{w_{0}}\\}$
has measure $\ll r^{-2}$. We also have the following key lemma.

######  Lemma 4.1.

Let $a\in\mathbb{R}$ with $\lvert a\rvert\leq X^{3}$. Then
$\sigma_{\infty,a,\nu^{\star}}(X)\gg\log{R}$.

###### Proof.

Let $\tilde{a}\colonequals a/X^{3}$. Given $(y_{2},y_{3})$, let
$y_{1}\colonequals(\tilde{a}-y_{2}^{3}-y_{3}^{3})^{1/3}$. For $r\geq 1$, let
$D_{r}\colonequals[3.99r,4r]^{2}$. Then for all $(y_{2},y_{3})\in D_{r}$, we
have $F_{0}(\bm{y})=\tilde{a}\in[-1,1]$ and $y_{1}\in[-6r,-5r]$, and thus

$w_{0}(F_{0}(\bm{y}))\prod_{1\leq l\leq 3}w_{2}(\lvert
y_{l}\rvert/r)\prod_{1\leq i<j\leq 3}w_{2}(\lvert y_{i}+y_{j}\rvert/r)\geq 1.$

By (2.24), (4.1), and the nonnegativity of $w_{0}$, $w_{2}$, it follows that

$\sigma_{\infty,a,\nu^{\star}}(X)=\int_{\mathbb{R}^{2}}dy_{2}\,dy_{3}\,\nu^{\star}(\bm{y})\cdot(3y_{1}^{2})^{-1}\gg\int_{r\in[1,R]}d^{\times}{r}\,\operatorname{vol}(D_{r})\cdot
r^{-2}\gg\log{R},$

since $\operatorname{vol}(D_{r})\gg r^{2}$. ∎

###### Proof of Theorems 1.1 and 1.2.

We gradually increase our hypotheses. First assume that (1.6) for $d=1$ holds
for all clean functions $w\in C^{\infty}_{c}(\mathbb{R}^{6})$. Using Theorem
2.13 (with $d=1$), one can prove (cf. (2.29) and (2.30)) that for integers
$X,K\geq 1$ with $K\leq X^{9/10}$, we have

(4.4)
$X^{-3}\operatorname{Var}(X,K;1)\ll\lVert\nu^{\star}\rVert_{L^{2}(\mathbb{R}^{3})}^{2}+o_{\nu^{\star};X\to\infty}(1)+O(K^{-1/2}\cdot\lVert\nu^{\star}\rVert_{100,\infty}^{2}B(\nu^{\star})^{5000}),$

where $o_{\nu^{\star};X\to\infty}(1)$ denotes a quantity that tends to $0$ as
$X\to\infty$ (for any fixed $\nu^{\star}$). Here
$\lVert\nu^{\star}\rVert_{L^{2}(\mathbb{R}^{3})}^{2}\ll\log{R}$, and
$\lVert\nu^{\star}\rVert_{100,\infty}\ll 1$ and $B(\nu^{\star})\ll R$. On the
other hand, by Theorem 3.9 with $\eta=(\log{R})^{-10/j}$ (for an integer
$j\geq 1$), we have

(4.5)
$A^{-1}\cdot\lvert\mathscr{E}(K;\eta)\cap[-A,A]\rvert\ll_{j,\epsilon}(\log{R})^{-18}+A^{\epsilon}K^{-1.5j}+(\log{R})^{2}K^{-0.8j}+K^{-1/24}$

for integers $A\geq K^{6j}$. By (2.4), (3.16), and Lemma 4.1, we conclude (by
letting $A,X\to\infty$ with $A\in[X^{3}/2,X^{3}]$, taking $K=\lfloor
A^{1/6j}\rfloor$, taking $\epsilon=1/6$, and taking $R\leq K^{1/20000}$) that

(4.6)
$A^{-1}\cdot\lvert\mathcal{E}\cap[-A,A]\rvert\ll_{j}(\log{R})^{-18}+(\log{R})^{-2+20/j}\cdot[(\log{R})+o_{R;A\to\infty}(1)]$

as $A\to\infty$. Taking $j=40$ and $R\to\infty$ proves the first part of
Theorem 1.1.

What remains is similar, so we merely sketch the main points. Fix
$(\delta,k)\in\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$, and assume (1.7) for
$\xi=0$. Note that (1.7) remains true if we decrease $\delta$ or increase $k$.
In any case, Theorem 2.14 for $\xi=0$ now implies (assuming $X,K\geq 2$ and
$K\leq X^{9/10-\delta}$)

(4.7)
$X^{-3}\operatorname{Var}(X,K;1)\ll\lVert\nu^{\star}\rVert_{L^{2}(\mathbb{R}^{3})}^{2}+\frac{O(\lVert\nu^{\star}\rVert_{k,\infty}^{2}B(\nu^{\star})^{k})}{\min(X^{\delta/11},K^{2/3}X^{-3\delta})}.$

We now apply Theorem 3.9 and Lemma 4.1 as before. Let $A,X\to\infty$ with
$A\in[X^{3}/2,X^{3}]$; let $(K,\epsilon,R,\eta)=(\lfloor
A^{2\delta}\rfloor,\delta,X^{\delta/30k},(\log{R})^{-10/j})$. Assuming
$2\delta\leq 1/6j$ (so $A\geq K^{6j}$), we get

(4.8)
$A^{-1}\cdot\lvert\mathcal{E}\cap[-A,A]\rvert\ll_{j}(\log{R})^{-18}+(\log{R})^{-2+20/j}\cdot(\log{R})+X^{-\delta/20}$

as $A\to\infty$. Taking $j\to\infty$ proves the second part of Theorem 1.1.

Finally, fix $(\delta,k)\in\mathbb{R}_{>0}\times\mathbb{Z}_{\geq 1}$, and
assume (1.7) for $\xi=1$. Theorem 2.14 for $\xi=1$ (when combined with Theorem
3.9 and Lemma 4.1) then implies Theorem 1.2. ∎

##  5\. Nonnegative cubes

Let $A\geq 2$. For integers $a\geq 0$, let
$r_{3}(a)\colonequals\\#\\{(x,y,z)\in\mathbb{Z}_{\geq
0}^{3}:x^{3}+y^{3}+z^{3}=a\\}$. The Selberg sieve implies $\sum_{p\leq
A}r_{3}(p)\ll A/\log{A}$. Assuming something like (1.7) (ideally for
arbitrarily small $\delta>0$), can one show that $\sum_{p\leq A}r_{3}(p)\gg
A/\log{A}$? Something like (1.7) might let one handle certain “Type II” sums.
The main difficulty might instead lie in “Type Ij” estimates (roughly
corresponding to counting solutions to $dn_{1}n_{2}\cdots
n_{j}=x^{3}+y^{3}+z^{3}$ for $j$ large, where $d$ is fixed). One may be able
to handle “Type Ij” sums for $j\leq 2$ using the methods of
[hooley1981waring], but it would be nice to treat larger $j$, even
conditionally.

Or, assuming precise asymptotic second moments for $r_{3}(a)$ over $\\{a\leq
A:a\equiv 0\bmod{d}\\}$ for $d\leq A^{\delta}$, can one show that $\sum_{p\leq
A}r_{3}(p)^{2}\ll A/\log{A}$? Note the lack of exact multiplicative structure
in $d$ in the expected main term over $\\{a\leq A:a\equiv 0\bmod{d}\\}$. (For
$d=1$, see [hooley1986some]*Conjecture 2.) This may or may not be a serious
obstacle.

Finally, in the conditional sense above, can one show that a positive
proportion of primes $p$ have $r_{3}(p)\neq 0$ (i.e. are sums of three
nonnegative cubes)?

## Acknowledgements

I thank Valeriya Kovaleva, Sarah Peluse, and Peter Sarnak for inspiring me to
extend my thesis work on $x^{3}+y^{3}+z^{3}$ from integer values to prime
values. I thank Manjul Bhargava, Tim Browning, Valeriya Kovaleva, Peter
Sarnak, Katy Woo, and Liyang Yang for some nice conversations on closely
related topics. Finally, I thank Simona Diaconu for sharing an early draft of
her enlightening senior thesis, [diaconu2019admissible], several years ago.

## References