1 Introduction and main results

1.1 The Matomäki–Radziwiłł theorem for bounded multiplicative functions

The Matomäki–Radziwiłł theorem, in its various incarnations, gives estimates for the error term in approximating the average of a bounded multiplicative function in a typical short interval by a corresponding long interval average. In the breakthrough paper [26], the authors showed that, uniformly over all real-valued multiplicative functions \(f: \mathbb {N} \rightarrow [-1,1]\), for any \(1 \le h \le X\) such that \(h = h(X) \rightarrow \infty \) as \(X \rightarrow \infty \),

$$\begin{aligned} \frac{1}{h}\sum _{x-h< n \le x} f(n) = \frac{2}{X} \sum _{X/2 < n \le X} f(n) + o(1) \end{aligned}$$
(1.1)

for all but o(X) integers \(x \in [X/2,X]\). A key feature of this result is that the interval length h can grow arbitrarily slowly as a function of X. This result has had countless applications to a variety of problems across mathematics, including to partial results toward Chowla’s conjecture on correlations of the Liouville function [36, 38], the resolution of the famous Erdős discrepancy problem [37], and progress on Sarnak’s Möbius disjointness conjecture (e.g., [3, 35]; see [20] for a more exhaustive list).

Since [26], the result has been extended and generalized in various directions. In [27], a corresponding short interval result was given for non-pretentious complex-valued multiplicative functions \(f:\mathbb {N} \rightarrow \mathbb {U}\), where \(\mathbb {U} := \{z \in \mathbb {C} : |z |\le 1\}\). To be precise, if we define

$$\begin{aligned} D_f(X;T) := \min _{\vert t |\le T} \mathbb {D}(f,n^{it};X)^2 := \min _{ |t |\le T}\sum _{p \le X} \frac{1-\text {Re}(f(p)p^{-it})}{p}, \end{aligned}$$

where \(\mathbb {D}\) denotes the Granville–Soundararajan pretentious distance, they showed that if \(f: \mathbb {N} \rightarrow \mathbb {U}\) satisfies \(D_f(X;X) \rightarrow \infty \) then

$$\begin{aligned} \left|\frac{1}{h} \sum _{x-h < n \le x} f(n) \right|= o(1) \end{aligned}$$

for all but o(X) integers \(x \in [X/2,X]\), whenever \(h = h(X) \rightarrow \infty \). In a different direction, exploring the heuristic relationship between the distributions of arithmetic functions in short intervals and in short arithmetic progressions, Klurman, the author and Teräväinen [19] obtained an analogue of (1.1) for typicalFootnote 1 short arithmetic progressions.

In the recent paper [25], a widely generalized version of the results of [26] was developed, which among other things extended the work of [27]. The authors showed that for a general complex-valued multiplicative function \(f: \mathbb {N} \rightarrow \mathbb {U}\), if \(t_0 = t_0(f,X)\) is a minimizer in the definition of \(D_f(X;X)\) then for all but o(X) integers \(x \in [X/2,X]\), one obtains an asymptotic formula with main term of the form

$$\begin{aligned} \frac{1}{h}\sum _{x-h< n \le x} f(n) = \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X}\sum _{X/2 < n \le X} f(n)n^{-it_0} + o(1), \end{aligned}$$
(1.2)

with a better quantitative dependence of the bound for the exceptional set on the interval length h than in [26].

By Shiu’s theorem (Lemma 3.2), we have

$$\begin{aligned} \frac{1}{X}\sum _{n \le X} \mid f(n) \mid \ll \prod _{p \le X} \left( 1+ \frac{|f(p) |-1}{p}\right) , \end{aligned}$$

so (1.2) is trivial whenever \(\sum _{p \le X} \frac{1-|f(p) \vert }{p} \rightarrow \infty \), for instance, if \(f(p) = 0\) significantly often on the primes. Rectifying this weakness, Matomäki and Radziwiłł improved the quality of the o(1) error term for a large collection of 1-bounded functions with sparse prime support. Specifically, they showed that if there are constants \(A > 0\) and \(\theta \in (0,1]\) such that the sieve-type lower bound condition

$$\begin{aligned} \sum _{z< p \le w} \frac{|f(p) |}{p} \ge A\sum _{z < p \le w} \frac{1}{p} - O\left( \frac{1}{\log z}\right) \text { holds for all } 2 \le z \le w \le X^{\theta } \end{aligned}$$
(1.3)

holds then one can improve the o(1) term to

$$\begin{aligned} o\left( \prod _{p \le X} \left( 1+\frac{|f(p) |-1}{p}\right) \right) . \end{aligned}$$

This savings comes at a natural cost, namely that the length of the interval h is no longer arbitrarily slow growing as a function of X, but must grow in a manner that depends on the sparseness of the supportFootnote 2 of f.

Precisely, the main result of [25] may be stated as follows. In the sequel, for a multiplicative function \(f: \mathbb {N} \rightarrow \mathbb {U}\) we write

$$\begin{aligned} H(f;X) := \prod _{p \le X} \left( 1+\frac{(|f(p) |-1)^2}{p}\right) . \end{aligned}$$

Theorem

(Matomäki–Radziwiłł, [25] Thm. 1.9) Let \(A > 0\) and \(\theta \in (0,1]\). Let \(f: \mathbb {N} \rightarrow \mathbb {U}\) be a multiplicative function such that (1.3) holds for all \(2 \le z\le w \le X^{\theta }\). Let \(2 \le h_0 \le X^{\theta }\) and put \(h := h_0H(f;X)\). Also, set \(t_0 = t_0(f,X)\). Then there are constantsFootnote 3\(C = C(\theta ) > 1\), \(\rho _A > 0\) such that for any \(\delta \in (0,1/1000)\) and \(0< \rho < \rho _A\),

$$\begin{aligned}&\left|\frac{1}{h} \sum _{x-h< n \le x} f(n) - \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X}\sum _{X/2 < n\le X} f(n)n^{-it_0}\right|\\&\quad \le \left( \delta + C\left( \frac{\log \log h_0}{\log h_0}\right) ^A + (\log X)^{-A\rho /36}\right) \prod _{p \le X} \left( 1+\frac{|f(p) |-1}{p}\right) , \end{aligned}$$

for all \(x \in [X/2,X]\) outside of a set of size

$$\begin{aligned} \ll _{\theta } X\left( h^{-(\delta /2000)^{1/A}} + X^{-\theta ^3(\delta /2000)^{6/A}}\right) . \end{aligned}$$

1.2 Divisor-bounded multiplicative functions

Let \(B \ge 1\). We define the generalized B-divisor function \(d_B(n)\) via

$$\begin{aligned} \zeta (s)^B = \sum _{n \ge 1} \frac{d_B(n)}{n^s} \text { for } \text {Re}(s) > 1. \end{aligned}$$

It can be deduced that \(d_B(n)\) is multiplicative, and moreover \(d_B(p^k) = \tfrac{\Gamma (B+k)}{k!\Gamma (B)}\), for all \(k \ge 1\). In particular, \(d_B(p) = B\). For integer values of B this coincides with the usual B-fold divisor functions, e.g., when \(B = 2\) we have \(d_B(n) = d(n)\), and when \(B = 1\) we have \(d_B(n) \equiv 1\).

We say that a multiplicative function \(f: \mathbb {N} \rightarrow \mathbb {C}\) is divisor-bounded if there is a \(B \ge 1\) such that \(|f(n) |\le d_B(n)\) for all n. When \(B = 2\), for example, this includes functions such as the twisted divisor function \(d(n,\theta ) := \sum _{d \mid n} d^{i\theta }\) for \(\theta \in \mathbb {R}\), as well as r(n)/4, where \(r(n) := |\{(a,b) \in \mathbb {Z}^2 : a^2+b^2 =n\} |\).

There is a rich literature about mean values of general, 1-bounded multiplicative functions. The works of Wirsing [43] and Halász [10] are fundamental, with noteworthy developments by Montgomery [29] and Tenenbaum [39, Thm. III.4.7]. The theory has recently undergone an important change in perspective, due in large part to the extensive, pioneering works of Granville and Soundararajan (e.g., [8, 9]). This well-formed theory significantly informs the results of [25, 26].

In comparison, the study of long averages of general unbounded multiplicative functions has only garnered significant interest more recently. Granville, Harper, and Soundararajan [7], in developing a new proof of a quantitative form of Halász’ theorem, were able to obtain bounds for averages of multiplicative functions \(f: \mathbb {N} \rightarrow \mathbb {C}\) for which the coefficients of the Dirichlet seriesFootnote 4

$$\begin{aligned} -\frac{L'}{L}(s,f) = \sum _{n \ge 1} \frac{\Lambda _{f}(n)}{n^s}, \text { where } L(s,f) := \sum _{n \ge 1} \frac{f(n)}{n^s} \text { for } \text {Re}(s) > 1, \end{aligned}$$
(1.4)

satisfy the bound \(|\Lambda _f(n) |\le B \Lambda (n)\) uniformly over \(n \in \mathbb {N}\) for some \(B \ge 1\), where \(\Lambda (n)\) is the von Mangoldt function. Such functions satisfy \(|f(n) |\le d_B(n)\) for all n. In [41], Tenenbaum, improving on qualitative results due to Elliott [1], established quantitative upper bounds and asymptotic formulae for the ratios \(|\sum _{n \le X} f(n) |/(\sum _{n \le X} |f(n) |)\), assuming  f is uniformly bounded on the primes, not too large on average at prime powers, and satisfies a hypothesis like (1.3). See also [22, Ch. 2] for results of a similar kind under stronger hypotheses.

On the basis of these developments, it is reasonable to ask whether the results of [25, 26] can be extended to divisor-bounded functions of a certain type. This was hinted at in [25, p. 9] but, as far as the author is aware, it does not yet exist in the literature. The purpose of this paper is to establish such extensions for a broad class of divisor-bounded multiplicative functions, among other unbounded functions.

In the following subsection, we provide three examples that motivate our main theorem, Theorem 1.7. Besides the applications we give here, this result will also be applied in [23] to study short interval averages of general additive functions.

1.3 Applications

1.3.1 Rankin–Selberg estimates for \(GL_m\) in typical short intervals

Let f be a fixed even weight \(k \ge 2\), level 1 primitive Hecke-normalized holomorphic cusp form without complex multiplication, and write its Fourier expansion at \(\infty \) as

$$\begin{aligned} f(z) = \sum _{n \ge 1} \lambda _f(n)n^{\frac{k-1}{2}}e(nz), \quad \text {Im}(z) > 0, \end{aligned}$$

with \(\lambda _f(1) = 1\). Set also

$$\begin{aligned} g_f(n) := \sum _{d^2 \mid n} |\lambda _f(n/d^2) |^2. \end{aligned}$$

By the Hecke relation

$$\begin{aligned} \lambda _f(m)\lambda _f(n) = \sum _{d \mid (m,n)} \lambda _f\left( \frac{mn}{d^2}\right) , \quad m,n \in \mathbb {N}, \end{aligned}$$

\(|\lambda _f |^2\) and thus also \(g_f\) are multiplicative functions. Deligne showed that \(|\lambda _f(p) |\le 2\) for all primes p, and in general \(|\lambda _f(n) |^2 \le d(n)^2\). Thus \(|\lambda _f |^2\) is bounded by a power of a divisor function, and the same can be shown for \(g_f\).

The classical Rankin–Selberg method shows [18, Sec. 14.9] that asymptotic formulae

$$\begin{aligned} \frac{1}{X}\sum _{n \le X} |\lambda _f(n) |^2 = c_f + O(X^{-2/5}), \quad \quad \frac{1}{X}\sum _{n \le X} g_f(n) = d_f + O(X^{-2/5}), \end{aligned}$$

hold as \(X \rightarrow \infty \), where \(c_f,d_f > 0\) are constants depending on f. The Rankin–Selberg problem is equivalent to asking for an improvement of the error term \(X^{-2/5}\) in both of these estimates, but this is not our point of interest here.

One can ask whether the above asymptotic formulae continue to hold in short intervals. Ivić [17] considered the variance of the error term in short interval averages. Specifically, he showed [17, Cor. 2] on the Lindelöf hypothesis that

$$\begin{aligned} \frac{1}{X} \int _X^{2X} \left( \frac{1}{h} \sum _{x < n \le x+h} g_f(n) - d_f\right) ^2 \hbox {d}x = o(1), \end{aligned}$$
(1.5)

as long as \(h \ge X^{2/5-\varepsilon }\), albeit with a power-saving error term in the latter range.

At the expense of the quality of the error term, we obtain the following improvement in the range where (1.5) holds.

Corollary 1.1

Let \(10 \le h_0 \le X/(10\log X)\) and set \(h := h_0 \log X\). Then there is a constant \(\theta > 0\) such that

$$\begin{aligned} \frac{1}{X}\int _X^{2X} \left( \frac{1}{h} \sum _{x < n \le x+h} |\lambda _f(n) |^2 - c_f\right) ^2 \hbox {d}x \ll \frac{\log \log h_0}{\log h_0} + \frac{\log \log X}{(\log X)^{\theta }}. \end{aligned}$$

The same estimate holds when \(|\lambda _f |^2\) and \(c_f\) are replaced by \(g_f\) and \(d_f\), respectively.

This corollary might appear surprising, given our currently incomplete understanding of the shifted convolution problem

$$\begin{aligned} \sum _{X < n \le 2X} |\lambda _f(n) |^2 |\lambda _f(n+r) |^2, \quad \quad 1 \le |r |\le h. \end{aligned}$$

Actually, our proof of Corollary 1.1 relies only on the multiplicativity of \(|\lambda _f |^2\), Deligne’s theorem, and the prime number theorem for Rankin–Selberg L-functions (see, e.g., Lemma 5.6). This suggestsFootnote 5 that a generalization to coefficients of automorphic L-functions for \(GL_n\) should be possible, provided that these satisfy the generalized Ramanujan conjecture and hence are divisor-bounded.

To be more precise, let \(m \ge 2\), let \(\mathbb {A}\) be the ring of adeles of \(\mathbb {Q}\), and let \(\pi \) be a cuspidal automorphic representation of \(GL_m(\mathbb {A})\) with unitary central character that acts trivially on the diagonally embedded copy of \(\mathbb {R}^+\). We let \(q_{\pi }\) denote the conductor of \(\pi \). The finite part of \(\pi \) factors as a tensor product \(\pi = \otimes _p \pi _p\), with local representations \(\pi _p\) at each prime p. The local L-function at p takes the form

$$\begin{aligned} L(s,\pi _p) = \prod _{1 \le j \le m} \left( 1-\frac{\alpha _{j,\pi }(p)}{p^s}\right) ^{-1} := \sum _{l \ge 0} \frac{\lambda _{\pi }(p^l)}{p^{ls}}, \end{aligned}$$

where \(\{\alpha _{1,\pi }(p),\ldots ,\alpha _{m,\pi }(p)\} \subset \mathbb {C}\) are the Satake parameters of \(\pi _p\). The standard L-function of \(\pi \) is then

$$\begin{aligned} L(s,\pi ) := \prod _p L(s,\pi _p) = \sum _{n \ge 1} \frac{\lambda _{\pi }(n)}{n^s}, \end{aligned}$$

which converges absolutely when \(\text {Re}(s) > 1\). The sequence of coefficients \(\lambda _{\pi }(n)\) thus defined is multiplicative, with the property that

$$\begin{aligned} \lambda _{\pi }(p^r) = \sum _{\begin{array}{c} r_1,\ldots ,r_m \ge 0 \\ r_1 + \cdots + r_m = r \end{array}} \prod _{1 \le j \le m} \alpha _{j,\pi }(p)^{r_j}. \end{aligned}$$

The generalized Ramanujan conjecture (GRC) implies that for all \(1 \le j \le m\), \(|\alpha _{j,\pi }(p) |= 1\) whenever \(p \not \mid q_{\pi }\) and otherwise \(|\alpha _{j,\pi }(p) |\le 1\). It follows that if \(\pi \) satisfies GRC then

$$\begin{aligned} |\lambda _{\pi }(p^r) |\le \sum _{\begin{array}{c} r_1,\ldots ,r_m \ge 0 \\ r_1 + \cdots + r_m = r \end{array}} 1 = \left( {\begin{array}{c}m+r-1\\ r\end{array}}\right) = d_m(p^r), \end{aligned}$$

and therefore that \(|\lambda _{\pi }(n) |\le d_m(n)\). As a consequence of these properties, we will prove the following.

Theorem 1.2

Let \(m \ge 2\) and let \(\pi \) be a fixed cuspidal automorphic representation for \(GL_m(\mathbb {A})\) as above. Assume that \(\pi \) satisfies GRC. Let \(10 \le h_0 \le X/(10(\log X)^{m^2-1})\) and let \(h:= h_0 (\log X)^{m^2-1}\). Then there is a constant \(\theta = \theta (m) > 0\) such that

$$\begin{aligned} \frac{1}{X}\int _X^{2X} \left( \frac{1}{h}\sum _{x< n \le x + h} |\lambda _{\pi }(n) |^2 - \frac{1}{X}\sum _{X < n \le 2X} |\lambda _{\pi }(n) |^2 \right) ^2 \hbox {d}x \ll \frac{\log \log h_0}{\log h_0} + \frac{\log \log X}{(\log X)^{\theta }}. \end{aligned}$$

Remark 1.3

In the case \(m =2\), the parameter h must grow faster than \((\log X)^3\) in Theorem 1.2, whereas Corollary 1.1 allows any h growing faster than \(\log X\). This is due to the fact that the range of h in these estimates depends on the size of \(\sum _{p \le X} |\lambda _{\pi }(p) |^4/p\). When \(\pi = \pi _f\) for a cusp form f on \(GL_2(\mathbb {A})\), we may estimate this sum using the well-known expression

$$\begin{aligned} |\lambda _f(p) |^4 = 2 + 3\lambda _{\text {Sym}^2 f}(p) + \lambda _{\text {Sym}^4 f}(p) \end{aligned}$$

for all primes p, since \(\text {Sym}^r f\) is cuspidal automorphic for \(r = 2,4\) and thus \(\sum _{p \le X} \lambda _{\text {Sym}^r f}(p)/p = O(1)\). When \(m \ge 3\), such data for \(|\lambda _{\pi }(p) |^4\) are not available unconditionally in general, to the best of the author’s knowledge. Assuming the validity of Langlands’ functoriality conjecture, a (likely more complicated) expression would follow from the factorization of the standard L-function L(sf) of the representation \(f = \pi \otimes {\tilde{\pi }} \otimes \pi \otimes {\tilde{\pi }}\), where \({\tilde{\pi }}\) is the contragredient representation of \(\pi \). Using GRC alone, we cheaply obtain the simple upper bound

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _{\pi }(p) |^4}{p} \le m^2 \sum _{p \le X} \frac{|\lambda _{\pi }(p) |^2}{p} = m^2 \log \log X + O(1), \end{aligned}$$

from Rankin–Selberg theory, and this is the source of the exponent \(m^2\) in the range of h.

We will instead deduce Corollary 1.1 from Theorem 1.4 below, which is tailored to \(GL_2\) cusp forms.

1.3.2 Moments of coefficients of \(GL_2\) cusp forms in typical short intervals

Our next application concerns short interval averages of the moments \(n \mapsto |\lambda _f(n) |^{\alpha }\), for any \(\alpha > 0\), with the notation of the previous subsection. This generalizes Corollary 1.1.

Theorem 1.4

Let \(\alpha > 0\) and define

$$\begin{aligned} c_{\alpha } := \frac{2^{\alpha }}{\sqrt{\pi }} \frac{\Gamma \left( \frac{\alpha +1}{2}\right) }{\Gamma (\alpha /2 + 2)}, \quad d_{\alpha } := c_{2\alpha }-2c_{\alpha } + 1. \end{aligned}$$

Let \(10 \le h_0 \le X/(10 (\log X)^{d_{\alpha }})\) and put \(h := h_0 (\log X)^{d_{\alpha }}\). There is a constant \(\theta = \theta (\alpha ) > 0\) such that

$$\begin{aligned}&\frac{1}{X}\int _X^{2X} \left( \frac{1}{h} \sum _{x< n \le x+h} |\lambda _f(n) |^{\alpha } - \frac{1}{X}\sum _{X < n \le 2X} |\lambda _f(n) |^{\alpha }\right) ^2 \hbox {d}x \\&\quad \ll _{\alpha } \left( \left( \frac{\log \log h_0}{\log h_0}\right) ^{c_{\alpha }} + \frac{\log \log X}{(\log X)^{\theta }}\right) (\log X)^{2(c_{\alpha }-1)}. \end{aligned}$$

When \(\alpha \ne 2\), the Rankin–Selberg theory is no longer available. In its place, a crucial role in the proof of this result is played by a quantitative version of the Sato–Tate theorem for non-CM cusp forms, due to Thorner  [42], which uses the deep results of Newton and Thorne [30]; see Sect. 5.1 for the details.

Remark 1.5

Using the Sato–Tate theorem and [22, Thm. 1.2.4], it can be shown that \(\frac{1}{X}\sum _{X < n \le 2X} |\lambda _f(n) |^{\alpha } \gg _{\alpha } (\log X)^{c_{\alpha }-1}\), so the estimate in Theorem 1.4 is indeed non-trivial.

1.3.3 Hooley’s \(\Delta \)-function in short intervals

The distribution of divisors of a typical positive integer is a topic of classical interest and a source of many difficult problems. Given an integer \(n \in \mathbb {N}\), let

$$\begin{aligned} \mathcal {D}_n(v) := \frac{1}{d(n)}\sum _{\begin{array}{c} d \mid n \\ d \le e^v \end{array}} 1, \quad \quad \text { for } v \in \mathbb {R}. \end{aligned}$$

This is a distribution function on the divisors of n. A concentration function for \(\mathcal {D}_n(v)\), in the sense of probability theory, can be given by

$$\begin{aligned} Q(n) := \max _{u \in \mathbb {R}} |\mathcal {D}_n(u+1)-\mathcal {D}_n(u) |= \max _{u \in \mathbb {R}}\frac{1}{d(n)} \sum _{\begin{array}{c} d \mid n \\ e^u < d \le e^{u+1} \end{array}} 1. \end{aligned}$$

Hooley [15] considered the unnormalized variant

$$\begin{aligned} \Delta (n) := d(n) Q(n) = \max _{u \in \mathbb {R}} \sum _{\begin{array}{c} d \mid n \\ e^u < d \le e^{u+1} \end{array}} 1, \end{aligned}$$

now known as Hooley’s \(\Delta \)-function, and used it to attack various problems related, among other things, to inhomogeneous Diophantine approximation by squares, as well as Waring’s problem for cubes. Clearly, \(0 \le \Delta (n) \le d(n)\), but one seeks more refined data about this function. For example, Erdős [2] conjectured in 1948 that, except on a set of natural density 0, \(\Delta (n) > 1\).

Many authors have investigated the average and almost sure behavior of \(\Delta \). Maier and Tenenbaum [21] proved Erdős’ conjecture in a quantitative form. A significant portion of Hall and Tenenbaum’s book [11] is devoted to the \(\Delta \) function, including the currently best known upper bound for its mean value (see also [12]). For a partial survey of these results, see [40] .

Much less has been done concerning the local behavior of the \(\Delta \)-function. To the author’s knowledge, the only result about its short interval behavior was worked out in the setting of polynomials over a finite field by Gorodetsky [5, Cor. 1.5].

By relating \(\Delta (n)\) to integral averages of the characteristic function of \(\mathcal {D}_n\) (which is multiplicative), we can deduce the following lower bound for \(\Delta \) on average over typical short intervals of length \((\log X)^{1/2+\eta }\), for \(\eta \in (0,1/2]\).

Corollary 1.6

Fix \(\delta \in (0,1]\), and let \(10 \le h_0 \le \frac{X}{10(\log X)^{(1+\delta )/2}}\) and set \(h = h_0 (\log X)^{(1+\delta )/2}\). Then for all but \(o_{h_0 \rightarrow \infty }(X)\) integers \(x \in [X/2,X]\) we have

$$\begin{aligned} \frac{1}{h}\sum _{x-h < n \le x} \Delta (n) \gg \delta \log \log X. \end{aligned}$$

1.4 Statement of main results

We fix \(B,C \ge 1\), \(0 < A \le B\), and for X large we define \(\mathcal {M}(X;A,B,C)\) to denote the set of multiplicative functions \(f : \mathbb {N} \rightarrow \mathbb {C}\) such that:

  1. (i)

    \(|f(p) |\le B\) for all primes \(p \le X\),

  2. (ii)

    \(|f(n) |\le d_B(n)^C \text { for all } n\le X\),

  3. (iii)

    for all \(z_0 \le z\le w \le X\), we have

    $$\begin{aligned} \sum _{z< p \le w} \frac{|f(p) |}{p} \ge A \sum _{z < p \le w} \frac{1}{p} - O\left( \frac{1}{\log z}\right) . \end{aligned}$$
    (1.6)

As described above, the work [25] treats 1-bounded multiplicative functions \(f \in \mathcal {M}(X;A,1,1)\). We are interested in generalizing the results from [25] to be applicable to the collection \(\mathcal {M}(X;A,B,C)\), with \(B \ge 1\). For the purpose of applications, we further extend \(\mathcal {M}(X;A,B,C)\) as follows.

Fixing \(\gamma > 0\) and \(0 < \sigma \le A\), we define \(\mathcal {M}(X;A,B,C;\gamma ,\sigma )\) to be the collection of multiplicative functions \(f: \mathbb {N} \rightarrow \mathbb {C}\) satisfying (i) and (ii), as well as the additional hypotheses

  1. (iii’)

    for all \(z_0 \le z \le w \le X\), we have

    $$\begin{aligned} \sum _{z< p \le w} \frac{|f(p) |}{p} \ge A \sum _{z < p \le w} \frac{1}{p} - O\left( \frac{1}{(\log z)^{\gamma }}\right) , \end{aligned}$$
    (1.7)
  2. (iv)

    letting \(t_0 \in [-X,X]\) be a minimizer on \([-X,X]\) of the map

    $$\begin{aligned} t \mapsto \rho (f,n^{it};X)^2 := \sum _{p \le X} \frac{|f(p) |-\text {Re}(f(p)p^{-it})}{p}, \end{aligned}$$

    we have for all \(t \in [-2X,2X]\) that

    $$\begin{aligned} \rho (f,n^{it};X)^2 \ge \sigma \min \{ \log \log X, \log (1+|t-t_0 |\log X)\} - O_{A,B}(1). \end{aligned}$$
    (1.8)

    (We may select \(t_0 = 0\) if \(f \ge 0\).)

Condition (iii’) is a weaker form of (iii). The full strength of (iii) is needed in [25, Lem. A.1] to obtain (iv) for all \(0< \sigma < \sigma _A\) with a particular constant \(\sigma _A > 0\), which is crucial to the proof of [25, Theorem 1.9]. We will show below, as a consequence of [25, Lem. 5.1(i)], that if \(f \in \mathcal {M}(X;A,B,C)\) then condition (iv) here holds for any \(0< \sigma < \sigma _{A,B}\), where

$$\begin{aligned} \sigma _{A,B} := \frac{A}{3} \left( 1- \text {sinc}\left( \frac{\pi A}{2B}\right) \right) , \quad \quad \text {sinc}(t) := \frac{\sin t}{t} \text { for } t \ne 0. \end{aligned}$$
(1.9)

In particular, for any \(0< \sigma < \sigma _{A,B}\), \(\mathcal {M}(X;A,B,C) \subseteq \mathcal {M}(X;A,B,C;1,\sigma )\). In proving Corollary 1.1, for instance, it is profitable to assume (iii’) rather than (iii), given currently available quantitative versions of the Sato–Tate theorem (see (5.1)).

In the sequel, fix \(B,C \ge 1\), \(0 < A \le B\), \(\gamma > 0\) and \(0 < \sigma \le A\). We define

$$\begin{aligned} {\hat{\sigma }} := \min \{1,\sigma \}, \quad \quad \kappa := \frac{{\hat{\sigma }}}{8B+21}. \end{aligned}$$
(1.10)

Given \(T \ge 1\), we set

$$\begin{aligned} M_f(X;T) := \min _{|t |\le T} \rho (f,n^{it};X)^2 = \min _{|t |\le T} \sum _{p \le X} \frac{|f(p) |-\text {Re}(f(p)p^{-it})}{p}. \end{aligned}$$

We select \(t_0(f,T)\) to be a real number \(t \in [-T,T]\) that gives the minimum in the definition of \(M_f(X;T)\).

Finally, for a multiplicative function \(f: \mathbb {N} \rightarrow \mathbb {C}\) we recall that

$$\begin{aligned} H(f;X) := \prod _{p \le X} \left( 1+\frac{(|f(p) |-1)^2}{p}\right) , \end{aligned}$$

observing for future reference that whenever \(|f(p) |\le B\) for all \(p \le X\),

$$\begin{aligned} H(f;X) \asymp _B \prod _{p \le X} \left( 1+\frac{|f(p) |^2-1}{p}\right) \left( 1+\frac{|f(p) |-1}{p}\right) ^{-2}. \end{aligned}$$
(1.11)

The main result of this paper is the following.

Theorem 1.7

Let \(X \ge 100\). Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\), and put \(t_0 = t_0(f,X)\). Let \(10 \le h_0 \le X/10H(f;X)\), and set \(h := h_0H(f;X)\). Then

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^X \left|\frac{1}{h}\sum _{x-h< n \le x} f(n) - \frac{1}{h} \int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X} \sum _{X/2 < n \le X} f(n)n^{-it_0}\right|^2 \hbox {d}x \\&\quad \ll _{A,B,C} \left( \left( \frac{\log \log h_0}{\log h_0}\right) ^A + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \prod _{p \le X} \left( 1+ \frac{|f(p) |-1}{p}\right) ^2. \end{aligned}$$

Remark 1.8

By Shiu’s theorem (Lemma 3.2), it is easy to show that the long sum term in the LHS is

$$\begin{aligned} \ll \frac{1}{X} \left( \sum _{X/3 < n \le X} |f(n) |\right) ^2 \ll _B \prod _{p \le X}\left( 1+\frac{|f(p) |-1}{p}\right) ^2. \end{aligned}$$

Thus, this theorem shows that the variance is smaller than the square of the “trivial” bound for the long sum by a factor tending to 0 provided \(h_0(X) \rightarrow \infty \), as \(X \rightarrow \infty \).

2 Outline of the proof of Theorem 1.7

To prove Theorem 1.7, we will establish two estimates. The first compares typical short averages of \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\) to typical medium-length ones (i.e., of length \(X/(\log X)^c\), for \(c = c(\sigma ) > 0\) small). The techniques involved were developed in [26], using certain corresponding refinements that arose in [25].

Theorem 2.1

Let \(B,C \ge 1\), \(0 < A \le B\), \(\gamma > 0\) and \(0 < \sigma \le A\). Assume that \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Let \(10 \le h_0 \le X/10H(f;X)\), set \(h_1 := h_0 H(f;X)\) and \(h_2 = X/(\log X)^{{\hat{\sigma }}/2}\) and assume that \(h_1 \le h_2\). Finally, put \(t_0 = t_0(f,X)\). Then

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^{X} \left|\frac{1}{h_1} \sum _{x-h_1< m \le x} f(m) - \frac{1}{h_1} \int _{x-h_1}^x u^{it_0} \hbox {d}u \cdot \frac{1}{h_2} \sum _{x-h_2 < m \le x} f(m)m^{-it_0} \right|^2 \hbox {d}x \\&\quad \ll _{A,B,C} \left( \left( \frac{\log \log h_0}{\log h_0}\right) ^A + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \prod _{p \le X} \left( 1+ \frac{|f(p) |-1}{p}\right) ^2. \end{aligned}$$

Essential to the treatment of Theorem 2.1 are strong pointwise upper bounds for Dirichlet polynomials

$$\begin{aligned} \sum _{X/3 < n \le X} \frac{a(n)f(n)}{n^{1+it}}, \end{aligned}$$

where \(\{a(n)\}_n \subset [0,1]\) is a particular sequence of weights, \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\) and \(t \in [-X,X]\). To obtain these estimates, we will apply some of the recent results about unbounded multiplicative functions described in Sect. 1.2. This is carried out at the beginning of Sect. 3.

The second estimate we require toward Theorem 1.7 is a “Lipschitz” bound, approximating the averages of a multiplicative function f on any sufficiently long medium-length interval by a long interval average of f. The techniques involved are different from those used in the proof of Theorem 2.1, and largely follow the work of Granville, Harper, and Soundararajan [7]; see Sect. 3.1 for the details.

Theorem 2.2

Let \(B,C \ge 1\), \(0 < A \le B\), \(\gamma > 0\) and \(0 < \sigma \le A\). Let \(X/(\log X)^{{\hat{\sigma }}/2} \le h \le X/10\), and let \(x \in [X/2,X]\). Assume that \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Then both of

$$\begin{aligned}&\left|\frac{1}{h}\sum _{x-h< n \le x} f(n)n^{-it_0} - \frac{2}{X}\sum _{X/2< n \le X} f(n)n^{-it_0}\right|, \\&\left|\frac{1}{h} \sum _{x-h< n \le x} f(n) - \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X}\sum _{X/2 < n \le X} f(n)n^{-it_0} \right|\end{aligned}$$

are bounded by

$$\begin{aligned} \ll _{A,B,C} \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}/2}} \prod _{p \le X} \left( 1+\frac{|f(p) |-1}{p}\right) . \end{aligned}$$

Proof of Theorem 1.7 assuming Theorems 2.1 and 2.2

Assume the hypotheses of Theorem 1.7. If \(h > h_2\) then Theorem 1.7 follows immediately from the second estimate in Theorem 2.2. Thus, we may assume that \(h \le h'\). Applying the elementary inequality \((a+b)^2 \le 2(a^2 + b^2)\) for \(a,b \ge 0\), we get

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^X\left|\frac{1}{h}\sum _{x-h< n \le x} f(n) - \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X}\sum _{X/2< n \le X} f(n)n^{-it_0}\right|^2 \hbox {d}x \\&\quad \ll \frac{2}{X}\int _{X/2}^X\left|\frac{1}{h}\sum _{x-h< n \le x} f(n) - \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{1}{h_2}\sum _{x-h_2< n \le x} f(n)n^{-it_0}\right|^2 \hbox {d}x \\&\qquad + \sup _{X/2< x \le X} \left|\frac{1}{h_2} \sum _{x-h_2< n \le x} f(n)n^{-it_0} - \frac{2}{X} \sum _{X/2 < n \le X} f(n)n^{-it_0} \right|^2 \\&\quad =: T_1 + T_2, \end{aligned}$$

upon trivially bounding \(h^{-1}|\int _{x-h}^x u^{it_0} \hbox {d}u |\le 1\). By Theorem 2.1 and the first estimate of Theorem 2.2,

$$\begin{aligned} T_1&\ll _{A,B,C} \left( \left( \frac{\log \log h}{\log h}\right) ^A + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \prod _{p \le X} \left( 1+\frac{|f(p) |-1}{p}\right) ^2 \\ T_2&\ll _{A,B,C} \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}/2}} \prod _{p \le X} \left( 1+\frac{|f(p) |-1}{p}\right) ^2. \end{aligned}$$

Combining these bounds proves the claim.\(\square \)

3 Averages of divisor-bounded multiplicative functions and the proof of Theorem 2.2

In the sequel, we will require control over various averages of multiplicative functions \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). In this and the next subsection, such bounds are derived/recorded.

First, we will require some general pointwise estimates for prime power values of \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). In preparation, define

$$\begin{aligned} P(s) := \sum _{\begin{array}{c} n \ge 1 \\ p^k ||n \Rightarrow p^k \le X \end{array}} \frac{f(n)}{n^s} = \prod _{p \le X} \left( 1+\sum _{\begin{array}{c} k \ge 1 \\ p^k \le X \end{array}} \frac{f(p^k)}{p^{ks}}\right) , \quad \text {Re}(s) > 1. \end{aligned}$$

Wherever P is nonzero, we may also write the logarithmic derivative Dirichlet series

$$\begin{aligned} -\frac{P'}{P}(s) = \sum _{n \ge 1} \frac{\Lambda _{f,X}(n)}{n^s}. \end{aligned}$$

Lemma 3.1

Suppose \(f: \mathbb {N} \rightarrow \mathbb {C}\) is multiplicative and satisfies \(|f(n) |\le d_B(n)^C\) for all \(n \le X\).

(a) For any prime power \(p^{\nu } \le X\), we have

$$\begin{aligned} |f(p^{\nu }) |\ll _{B,C} {\left\{ \begin{array}{ll} \left( \frac{5}{4}\right) ^{\nu }\left( 1+\frac{\nu }{B-1}\right) ^{(B-1)C}, &{}\text { if }{} B > 1, \\ 1 &{}\text { if }{} B = 1.\end{array}\right. } \end{aligned}$$

(b) For any \(\eta \in [0,1/2)\), we have

$$\begin{aligned} \sum _{\begin{array}{c} p^{\nu } \le X \\ \nu \ge 2 \end{array}} \frac{|f(p^{\nu }) |}{p^{(1-\eta )\nu }} \ll _{\eta ,B,C} 1. \end{aligned}$$

(c) \(\Lambda _{f,X}(n) = 0\) unless \(n = p^{\nu }\) for some prime power \(p^{\nu }\). In particular, if \(p^{\nu } \le X\) we have \(|\Lambda _f(p) |\le B \log p\) when \(\nu = 1\) and otherwise \( |\Lambda _{f,X}(p^{\nu }) |\ll _{\varepsilon ,B,C} p^{\varepsilon \nu }\).

Proof

(a) If \(B = 1\) then the claim is obvious since \(d_B \equiv 1\). Thus, we may assume that \(B > 1\). We may also assume that \(\nu \) is large relative to BC, for otherwise the estimate is trivial for a suitably large implicit constant.

Given these assumptions, observe that by Stirling’s approximation,

$$\begin{aligned} |f(p^{\nu }) |&\le d_B(p^{\nu })^C = \left( {\begin{array}{c}\nu + B-1\\ \nu \end{array}}\right) ^C \\ {}&\ll _{B,C} \left( \frac{\sqrt{2\pi (\nu +B-1)}}{2\pi \sqrt{\nu (B-1)}} \left( 1+\frac{B-1}{\nu }\right) ^{\nu } \cdot \left( 1+\frac{\nu }{B-1}\right) ^{B-1}\right) ^C \\&\ll _{B,C} \left( \frac{5}{4}\right) ^{\nu } \left( 1+\frac{\nu }{B-1}\right) ^{C(B-1)}, \end{aligned}$$

provided that \(\nu \) is large enough that \(\left( 1+\frac{B-1}{\nu }\right) ^C \le \frac{5}{4}\). This proves a).

(b) Let \(\delta := \frac{1}{2}-\eta \). For each \(2 \le p \le X\), we have \(p^{1/2} > 5/4\), and thus by a),

$$\begin{aligned} \sum _{\begin{array}{c} \nu \ge 2: \\ p^{\nu } \le X \end{array}} \frac{|f(p^{\nu }) |}{p^{(1-\eta )\nu }} \ll _{B,C} \sum _{\nu \ge 2} \left( 1+\frac{\nu }{B-1}\right) ^{BC} \left( \frac{5}{4p^{1/2+\delta }}\right) ^{\nu }&\ll _{B,C,\delta } \sum _{\nu \ge 2} \left( \frac{5}{4p^{(1+\delta )/2}}\right) ^{\nu } \\&\ll p^{-1-\delta }. \end{aligned}$$

We deduce (b) upon summing over \(p \le X\).

(c) We begin by giving an expression for \(\Lambda _{f,X}(p^{\nu })\).

In light of (a), we may deduce that there is \(\sigma = \sigma (B,C) > 1\) such that when \(\text {Re}(s) \ge \sigma \),

$$\begin{aligned} \left|\sum _{p^\nu \le X} \frac{f(p^\nu )}{p^{\nu s}}\right|\le \frac{1}{2} \text { for all }2 \le p \le X. \end{aligned}$$
(3.1)

It follows from the Euler product representation of P(s) that \(P(s) \ne 0\) in the half-plane \(\text {Re}(s) \ge \sigma \). Thus, \(-P'(s)/P(s)\) is also analytic in this half-plane.

Integrating \(-P'/P\) term by term from s to \(\infty \) along a line contained in the half-plane \(\text {Re}(s) \ge \sigma \), we deduce that

$$\begin{aligned} \sum _{n \ge 1} \frac{\Lambda _{f,X}(n)}{n^s \log n} = \log P(s) = \sum _{p \le X} \log \left( 1+\sum _{\begin{array}{c} \nu \ge 1 \\ p^{\nu } \le X \end{array}} \frac{f(p^{\nu })}{p^{\nu s}}\right) . \end{aligned}$$

Given (3.1), we obtain the Taylor expansion

$$\begin{aligned} \sum _{n \ge 1} \frac{\Lambda _{f,X}(n)}{n^s\log n}&= \sum _{p \le X} \sum _{k \ge 1} \frac{(-1)^{k-1}}{k} \sum _{ \begin{array}{c} \nu _1,\ldots ,\nu _k \ge 1 \\ p^{\nu _i} \le X \forall i \end{array}} \frac{f(p^{\nu _1}) \cdots f(p^{\nu _k})}{p^{(\nu _1+\cdots + \nu _k)s}} \\&= \sum _{\begin{array}{c} p^{\nu } \\ p \le X \end{array}} \frac{1}{p^{\nu s} \log p^{\nu }}\left( \log p^{\nu } \cdot \sum _{1 \le k \le \nu } \frac{(-1)^{k-1}}{k} \sum _{\begin{array}{c} \nu _1 + \cdots + \nu _k = \nu \\ \nu _1,\ldots ,\nu _k \ge 1 \\ p^{\nu _i} \le X \forall i \end{array}} \prod _{1 \le i \le k} f(p^{\nu _i})\right) . \end{aligned}$$

By the identity theorem for Dirichlet series, we thus find that \(\Lambda _{f,X}(n) = 0\) unless \(n = p^{\nu }\) for some prime power \(p^{\nu }\) with \(p \le X\), in which case

$$\begin{aligned} \Lambda _{f,X}(p^{\nu }) = \log p^{\nu } \cdot \sum _{1 \le k \le \nu } \frac{(-1)^{k-1}}{k} \sum _{\begin{array}{c} \nu _1 + \cdot + \nu _k = \nu \\ \nu _1,\ldots ,\nu _k \ge 1 \\ p^{\nu _i} \le X \forall i \end{array}} \prod _{1 \le i \le k} f(p^{\nu _i}). \end{aligned}$$
(3.2)

When \(\nu = 1\), we get the expression \(\Lambda _{f,X}(p) = f(p)\log p\), so that \(|\Lambda _f(p) |\le B \log p\).

For \(\nu \ge 2\), we simply note using the uniform bound \(d_B(n)^C \ll _{B,C,\varepsilon } n^{\varepsilon }\) and the triangle inequality in (3.2) that

$$\begin{aligned} |\Lambda _{f,X}(p^{\nu }) |\ll _{B,C,\varepsilon } \sum _{1 \le k \le \nu } \frac{1}{k} \sum _{\begin{array}{c} \nu _1 + \cdots + \nu _k = \nu \\ \nu _1,\ldots ,\nu _k \ge 1 \end{array}} \prod _{1 \le i \le k} p^{\nu _i \varepsilon } \le p^{\nu \varepsilon } \mathfrak {p}(\nu ), \end{aligned}$$

where \(\mathfrak {p}(\nu )\) denotes the number of partitions of the positive integer \(\nu \). By a classical bound of Hardy–Ramanujan [13, Sec. 2.3], there is an absolute constant \(c > 0\) such that

$$\begin{aligned} \mathfrak {p}(\nu ) \ll e^{c\sqrt{\nu }} \ll _{\varepsilon } p^{\nu \varepsilon }, \end{aligned}$$

which implies the claim. \(\square \)

We will use the following upper bound for non-negative functions repeatedly in the sequel. For convenience, given a multiplicative function g and \(Y \ge 2\) we write

$$\begin{aligned} \mathcal {P}_g(Y) := \prod _{p \le Y} \left( 1+ \frac{\vert g(p) \vert -1}{p}\right) . \end{aligned}$$

Lemma 3.2

[P. Shiu; [32], Thm. 1] Let \(f: \mathbb {N} \rightarrow \mathbb {C}\) be a multiplicative function satisfying \(|f(n) |\le d_B(n)^C\) for all \(n \le X\). Let \(\sqrt{X} < Y \le X\), \(\delta \in (0,1)\) and let \(Y^{\delta } \le y \le Y\). Then

$$\begin{aligned} \sum _{Y-y < n \le Y} |f(n) |\ll _{B,C,\delta } y \mathcal {P}_f(X). \end{aligned}$$

Proof

The hypotheses required to apply [32, Thm. 1] are more precisely that \(|f(n) |\ll _{\varepsilon } n^{\varepsilon }\) for all \(n \le X\) and that there is a constant \(A \ge 1\) such that \(|f(p^{\nu }) |\le A^{\nu }\) for all \(p^{\nu } \le X\). The first hypothesis is obvious from \(d_B(n)^C \le d(n)^{\lceil B\rceil C} \ll _{B,C,\varepsilon } n^{\varepsilon }\), while the second is implied by Lemma 3.1 a). \(\square \)

Lemma 3.3

Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\) and let \(t_0 = t_0(f,X)\). Let \(X^{1/5} \le Y \le X\), and let \(2 \le P \le Q \le \exp \left( \frac{\log X}{\log \log X}\right) \). Then for any \(1 \le Z \le \log X\),

$$\begin{aligned} \sup _{Z < \vert u |\le X/2} \left|\sum _{\begin{array}{c} n \le Y \\ p \mid n \Rightarrow p \notin [P,Q] \end{array}} f(n)n^{-i(t_0+u)}\right|\ll _{A,B,C} Y \mathcal {P}_f(X) \left( \left( \frac{\log Q}{\log P}\right) ^{2B}\frac{\log \log X}{\log X^{\sigma }} + \frac{1}{\sqrt{Z}} \right) . \end{aligned}$$

Proof

Define \(\beta (n) := f(n)1_{p \mid n \Rightarrow p \notin [P,Q]}\), and for \(t \in \mathbb {R}\) set \(\beta _{t}(n) := \beta (n)n^{-it}\). Note that \(|\beta _t(n) |\le |f(n) |\) for all n and \(t \in \mathbb {R}\). As \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\), we have that

  1. 1.

    \(\max _{p \le X} |f(p) |\le B\)

  2. 2.

    \(\sum _{\begin{array}{c} p^k\le X \\ k \ge 2 \end{array}} \frac{|f(p^k) |\log p^k}{p^k} \ll _{B,C} 1\) by Lemma 3.1b), and

  3. 3.

    \(\sum _{y < p \le X} \frac{|f(p) |}{p} \ge A \log \left( \frac{\log X}{\log y}\right) - O_{A,B}(1)\) uniformly in \(2 \le y \le X\),

for all \(t \in \mathbb {R}\). Thus, the hypotheses of [41, Cor. 2.1] are fulfilled with \(r = |f |\). Applying that result gives, for every \(Z < |u |\le X/2\),

$$\begin{aligned} \left|\sum _{n \le Y} \beta _{t_0+u}(n) \right|\ll _{A,B,C} \left( \sum _{n \le Y} |f(n) |\right) \left( (1+M_{\beta _{t_0+u}(Y;Z/2)}e^{-M_{\beta _{t_0+u}}(Y;Z/2)} + \frac{1}{\sqrt{Z}}\right) . \end{aligned}$$

Let \(t = t(u) \in [-Z/2,Z/2]\) be the minimizer implicit in \(M_{f_{t_0+u}}(Y;Z/2)\), so that

$$\begin{aligned} M_{\beta _{t_0+u}}(Y;Z/2) = \rho (\beta ,n^{i(t_0+u+t)};Y)^2 \le 2B \log \log X. \end{aligned}$$

As \(X^{1/5} \le Y \le X\),

$$\begin{aligned} \rho (\beta ,n^{i(t_0+u+t)}; Y)^2&= \rho (\beta ,n^{i(t_0+u+t)}; X)^2 - O_B(1) \\&\ge \rho (f,n^{i(t_0+u+t)}; X)^2 - 2B \log \left( \frac{\log Q}{\log P}\right) - O_B(1). \end{aligned}$$

Since \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\) and \(|t_0 + u+t |\le 2X\) and \(|u+t |> Z/2\), we have by (1.8) that

$$\begin{aligned} \rho (f,n^{i(t_0+u+t)};X)^2&\ge \sigma \min \{\log \log X, \log (1+|u+t |\log X)\} - O_{A,B}(1) \\&\ge \sigma \log \log X - O_{A,B}(1). \end{aligned}$$

It thus follows that

$$\begin{aligned} \max _{Z < |u |\le X/2} \left|\sum _{n \le Y} \beta _{t_0+u}(n) \right|\ll _{A,B,C} \left( \sum _{n \le Y} |f(n) |\right) \left( \left( \frac{\log Q}{\log P} \right) ^{2B} \frac{\log \log X}{(\log X)^{\sigma }} + \frac{1}{\sqrt{Z}}\right) . \end{aligned}$$

Finally, applying Lemma 3.2 together with Mertens’ theorem, we obtain

$$\begin{aligned} \sum _{n \le Y} |f(n) |\ll _{B,C} Y \prod _{p \le Y} \left( 1+ \frac{|f(p) |-1}{p}\right) \ll _B Y \mathcal {P}_f(X), \end{aligned}$$

and the claim follows. \(\square \)

We need the following estimate for certain divisor-bounded functions on y-smoothFootnote 6 integers, which is essentially due to Song [34]. An important role is played by the function \(\rho _k(u)\) for \(k \in \mathbb {N}\) and \(u \ge 0\), which is a generalization of the classical Dickman–de Bruijn function, defined by the differential delay equation

$$\begin{aligned} u\rho _k'(u) = (k-1)\rho _k(u)-k\rho _k(u-1) \text { if } u \ge 1, \end{aligned}$$

and \(\rho _k(u) := u^{k-1}/\Gamma (k)\) for \(0\le u < 1\).

Lemma 3.4

Let \(g: \mathbb {N} \rightarrow \mathbb {R}\) be a non-negative multiplicative function for which there are real constants \(\delta \in (0,1)\), \(\eta \in (0,1/2)\) and \(D > 0\), and an integer \(k \ge 1\) such that

$$\begin{aligned}&\sum _{p \le z} g(p)\log p = k z + O(z/(\log z)^{\delta }) \text { for all } z \ge 2, \end{aligned}$$
(3.3)
$$\begin{aligned}&\sum _{p^{\nu }, \nu \ge 2} \frac{g(p^{\nu })}{p^{(1-\eta )\nu }} \le D. \end{aligned}$$
(3.4)

Let \(x \ge 3\) and let \(\exp \left( (\log x \log \log x)^{2/(2+\delta )}\right) \le y \le x\). Set \(u := \frac{\log x}{\log y}\). Then

$$\begin{aligned} \sum _{\begin{array}{c} n \le x \\ P^+(n) \le y \end{array}} g(n) = e^{-\gamma k} x \rho _{k}(u) \frac{G(1,y)}{\log y} \left( 1+O\left( \frac{\log (u+1)}{(\log y)^{\delta /2}}\right) \right) , \end{aligned}$$

where \(G(s,y) := \sum _{P^+(n) \le y} g(n)n^{-s}\) for \(\text {Re}(s) > 0\), and \(P^+(n)\) denotes the largest prime factor of n.

In particular, for y in the given range and such that \(u \rightarrow \infty \) we have

$$\begin{aligned} \sum _{\begin{array}{c} n \le x \\ P^+(n) \le y \end{array}} g(n) \ll _{k,D,\delta } x(\log y)^{k-1} \exp \left( -\frac{1}{3}u\log u \right) . \end{aligned}$$

Proof

The first claim is a special case of the main result of [34].

For the second claim, we note that

$$\begin{aligned} G(1,y) \le \exp \left( \sum _{p \le y} \frac{g(p)}{p} + \sum _{\begin{array}{c} p \le y \\ \nu \ge 2 \end{array}} \frac{g(p^{\nu })}{p^{\nu }}\right) \ll _D \exp \left( \sum _{p \le y} \frac{g(p)}{p}\right) \ll _{\delta } (\log y)^{k}, \end{aligned}$$

where the penultimate estimate follows from (3.4), and the last estimate is obtained by partial summation from (3.3). Furthermore, by [33, (3.10)] and well-known upper bounds for the Dickman–de Bruijn function (e.g., [6, (1.6)]), we have

$$\begin{aligned} \rho _k(u) = k^{u+O(u/\log (1+u))} \rho (u) \le \exp \left( 2u \log k - \frac{1}{2}u\log u \right) \le \exp \left( -\frac{1}{3}u\log u\right) , \end{aligned}$$

whenever u is large enough in terms of k, and the claim follows. \(\square \)

By combining the last two lemmas, we may deduce the following upper bound for Dirichlet polynomials of a special type (cf. [26, Lem. 3]).

Corollary 3.5

Let \(10 \le P \le Q \le \exp \left( \frac{\log X}{\log \log X}\right) \), and let \(1 \le Z \le \log X\). Assume the hypotheses of Lemma 3.3, and assume \(X \ge X_0(B,C)\). Then for any \(\sqrt{X} \le Y \le X\),

$$\begin{aligned}&\sup _{Z< |u |\le X/2} \left|\sum _{Y/3 < n \le Y} \frac{f(n)}{n^{1+i(t_0+u)}(1+\omega _{[P,Q]}(n))}\right|\\&\quad \ll _{A,B,C} \mathcal {P}_{f}(X) \left( \left( \frac{\log Q}{\log P}\right) ^{3B}\frac{\log \log X}{(\log X)^{\sigma }} + \left( \frac{\log Q}{\log P}\right) ^{B}\frac{1}{\sqrt{Z}}\right) , \end{aligned}$$

where \(\omega _{[P,Q]}(n) := \sum _{\begin{array}{c} p \mid n \\ P \le p \le Q \end{array}} 1\).

Proof

Fix \(u \in [-X/2,X/2] \backslash [-Z,Z]\) and set \(t := t_0 + u\). Write \(f = \alpha *\beta \), where \(\alpha \) and \(\beta \) are multiplicative functions with \(\alpha (p^k) = f(p^k)\) whenever \(P \le p \le Q\) and \(p^k \le X\), and \(\beta (p^k) = f(p^k)\) for all other primes powers \(p^k \le X\). We apply the hyperbola method with \(M = \sqrt{Y}\) to get

$$\begin{aligned} \left|\sum _{Y/3< n \le Y} \frac{f(n)}{n^{1+it}(1+\omega _{[P,Q]}(n))}\right|&\ll \sum _{a \le M} \frac{|\alpha (a) |}{a(1+\omega (a))} \left|\sum _{Y/(3a)< b \le Y/a} \frac{\beta (b)b^{-it}}{b}\right|\\&\quad + \sum _{b \le Y/M} \frac{\vert \beta (b) \vert }{b}\sum _{\max \{M,Y/(3b)\} < a \le Y/b} \frac{|\alpha (a) |}{a} \\&=: \mathcal {R}_1 + \mathcal {R}_2. \end{aligned}$$

To bound \(\mathcal {R}_1\), we apply partial summation and Lemma 3.3 to obtain, uniformly in u,

$$\begin{aligned} \sum _{Y/(3a) < b \le Y/a} \frac{\beta (b)b^{-it}}{b}&\ll _{A,B,C} \sup _{Y/(3a) \le y \le Y/a} \frac{1}{y} \left|\sum _{n \le y} \beta (b)b^{-it}\right|\\&\ll \mathcal {P}_f(X)\left( \left( \frac{\log Q}{\log P}\right) ^{2B} \frac{\log \log X}{(\log X)^{\sigma }} + \frac{1}{\sqrt{Z}}\right) . \end{aligned}$$

Given the prime power support of \(\alpha \), we have

$$\begin{aligned} \sum _{a \le M} \frac{|\alpha (a)|}{a} \ll _{B,C} \prod _{P \le p \le Q} \left( 1+\frac{|f(p) |}{p}\right) \ll _B \left( \frac{\log Q}{\log P}\right) ^B, \end{aligned}$$

so that on combining this with the previous estimate, we obtain

$$\begin{aligned} \mathcal {R}_1 \ll _{A,B,C} \mathcal {P}_{f}(X) \left( \left( \frac{\log Q}{\log P}\right) ^{3B} \frac{\log \log X}{(\log X)^{\sigma }} + \left( \frac{\log Q}{\log P}\right) ^{B}\frac{1}{\sqrt{Z}}\right) . \end{aligned}$$

Next, consider \(\mathcal {R}_2\). Note that \(\alpha (n) = f(n)1_{p \mid n \Rightarrow p \in [P,Q]}\), and so since \(|f(n) |\le d_{B}(n)^C\) uniformly over \(n \le X\) we have

$$\begin{aligned} \sum _{X/(3b) < a \le X/b} \frac{|\alpha (a) |}{a} \ll \frac{b}{X} \sum _{\begin{array}{c} n \le X/b \\ P^+(n) \le Q \end{array}} g(n), \end{aligned}$$

where \(g(n) := d_{\lceil B\rceil }(n)^{\lceil C\rceil }\). Note that g(n) takes integer values, and in particular taking \(k := \lceil B\rceil ^{\lceil C\rceil } \in \mathbb {Z}\), for each \(XM/Y < z \le X\) we have

$$\begin{aligned} \sum _{p \le z} g(p)\log p = k \sum _{p \le z} \log p = k U + O(z/(\log z)^{1/2}), \end{aligned}$$

say, by the prime number theorem. Furthermore, that g satisfies (3.4) with some \(\eta \in (0,1/2)\) and \(D = O_{B,C}(1)\) is the content of Lemma 3.1b). Hence, as \(u_b := \log (X/b)/\log Q \ge \frac{B\log X}{2\log Q} \ge \frac{B}{2}\log \log X\), Lemma 3.4 implies that when X is sufficiently large in terms of B and C we obtain

$$\begin{aligned} \frac{b}{X} \sum _{\begin{array}{c} n \le X/b \\ P^+(n) \le Q \end{array}} g(n) \ll (\log Q)^{k-1} \exp \left( -\frac{1}{6} u_b \log u_b \right) \ll _{B,C} (\log X)^{-B-100}. \end{aligned}$$

Combining this with the bound

$$\begin{aligned} \sum _{b \le X/M} \frac{|\beta (b)|}{b} \le \sum _{b \le X/M} \frac{|f(b) |}{b} \ll (\log X) \mathcal {P}_{f}(X) \ll (\log X)^B, \end{aligned}$$

which again follows from partial summation and Lemma 3.2, we obtain \(\mathcal {R}_2 \ll (\log X)^{-100}\). Altogether, we conclude that

$$\begin{aligned}&\left|\sum _{Y/3 < n \le Y} \frac{f(n)}{n^{1+i(t_0+u)}(1+\omega _{[P,Q]}(n))}\right|\\&\quad \ll _{B,C} \mathcal {P}_{f}(X) \left( (\log X)^{-100} + \left( \frac{\log Q}{\log P}\right) ^{3B} \frac{\log \log X}{(\log X)^{\sigma }} + \left( \frac{\log Q}{\log P}\right) ^B \frac{1}{\sqrt{Z}}\right) , \end{aligned}$$

uniformly over \(Z < |u |\le X/2\), and the claim follows since \(Z^{-1/2} \ge (\log X)^{-1/2}\). \(\square \)

3.1 Lipschitz bounds and main terms

In this subsection, we derive a slight refinement of the Lipschitz bounds found in [7, Thm. 1.5]. Specifically, our estimates are sensitive to the distribution of values \(|f(p) |\), which will allow us to obtain Theorem 2.2. See also [28] for some related Lipschitz-type bounds for unbounded multiplicative functions that share some overlapFootnote 7 with the general result obtained presently.

Theorem 3.6

[Relative Lipschitz bounds] Let \(1 \le w \le X^{1/3}\) and let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Set \(t_0 = t_0(f,X)\). Then

$$\begin{aligned}&\left|\frac{w}{X} \sum _{n \le X/w} f(n)n^{-it_0} - \frac{1}{X} \sum _{n \le X} f(n)n^{-it_0}\right|\\&\quad \ll _{A,B,C} \log \left( \frac{\log X}{\log (ew)}\right) \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{{\hat{\sigma }}}\mathcal {P}_f(X), \end{aligned}$$

where \({\hat{\sigma }} := \min \{1,\sigma \}\). The same bound holds for the quantity

$$\begin{aligned} \left|\left( \frac{w}{X}\right) ^{1+it_0} \sum _{n \le X/w} f(n) - \frac{1}{X^{1+it_0}} \sum _{n \le X} f(n)\right|. \end{aligned}$$

To this end, we need to introduce some notation that is consistent with the notation from [7]. For \(\text {Re}(s) > 1\), we write

$$\begin{aligned} \mathcal {F}(s) = \sum _{\begin{array}{c} n \ge 1 \\ p^k ||n \Rightarrow p^k \le X \end{array}} \frac{f(n)n^{-it_0}}{n^s}. \end{aligned}$$

For each prime power \(p^k \le X\), \(k \ge 1\), define

$$\begin{aligned} s(p^k) := {\left\{ \begin{array}{ll} f(p^k)p^{-ikt_0} &{}\hbox { if}\ p \le y \\ 0 &{}\hbox { if}\ p> y \end{array}\right. } \quad \quad \ell (p^k) := {\left\{ \begin{array}{ll} 0 &{}\hbox { if}\ p \le y \\ f(p^k)p^{-ikt_0} &{}\text { if }p > y \end{array}\right. }, \end{aligned}$$

where \(y\ge 2\) is a large parameter to be chosen later. We extend s and \(\ell \) multiplicatively to all \(n \in \mathbb {N}\) with \(p^k ||n \Rightarrow p^k \le X\), and set \(s(n) = \ell (n) = 0\) otherwise. For \(\text {Re}(s) > 1\), also define

$$\begin{aligned} \mathcal {S}(s) = \sum _{n \ge 1} \frac{s(n)}{n^s}, \quad \quad \mathcal {L}(s) := \sum _{n \ge 1} \frac{\ell (n)}{n^s}. \end{aligned}$$

We recall that \(\Lambda _{\ell }(n)\) is the nth coefficient of the Dirichlet series \(-\mathcal {L}'/\mathcal {L}(s)\), the logarithmic derivative of \(\mathcal {L}(s)\), which is well defined for all \(\text {Re}(s) > 1\) whenever \(y \ge y_0(B,C)\) by Lemma 3.1 c).

Lemma 3.7

Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Let \(t \in \mathbb {R}\) and \(\xi \ge 1/\log X\). Then

$$\begin{aligned} |\mathcal {F}(1+\xi + it) |\ll _{A,B,C} \xi ^{-1} (1+\xi \log X)^{1-A} \mathcal {P}_f(X) e^{-\rho (fn^{-it_0},n^{it};e^{1/\xi })^2} \ll _B (\log X)^B. \end{aligned}$$

Proof

By Lemma 3.1b) and \(\max _{p \le X} |f(p) |\le B\), we deduce that

$$\begin{aligned} |\mathcal {F}(1+\xi +it) |&\ll _{B} \prod _{p \le X} \left|1+ \frac{f(p)p^{-i(t_0+t)}}{p^{1+\xi }}\right|\exp \left( \sum _{\begin{array}{c} p^k \le X \\ k \ge 2 \end{array}} \frac{|f(p^k) |}{p^{k(1+\xi )}}\right) \\&\ll _{B,C} \prod _{p\le X} \left( 1+\frac{|f(p) |}{p^{1+\xi }}\right) \left( 1+ \frac{\text {Re}(f(p)p^{-i(t_0+t)})-|f(p) |}{p^{1+\xi }}\right) . \end{aligned}$$

By partial summation and the prime number theorem, given any sequence \(\{\alpha _p\}_p \subset \mathbb {C}\) with \(\max _p |\alpha _p |\ll _B 1\) the estimates

$$\begin{aligned}&\sum _{p > e^{1/\xi }} \frac{\alpha _p}{p^{1+\xi }} \ll _B \int _{e^{1/\xi }}^{\infty } e^{-\xi v} \frac{\hbox {d}v}{v} \ll _B 1 \nonumber \\&\quad \sum _{p \le e^{1/\xi }} \left( \frac{\alpha _p}{p}-\frac{\alpha _p}{p^{1\pm \xi }}\right) \ll B\xi \sum _{p \le e^{1/\xi }} \frac{\log p}{p} \ll _B 1, \end{aligned}$$
(3.5)

both hold. It follows that

$$\begin{aligned} |\mathcal {F}(1+\xi +it) |&\ll _{B,C} \prod _{p \le e^{1/\xi }} \left( 1+\frac{|f(p) |}{p}\right) \exp \left( -\sum _{p \le e^{1/\xi }} \frac{|f(p) |-\text {Re}(f(p)p^{-i(t_0+t)})}{p}\right) \\&\ll _B \xi ^{-1} \mathcal {P}_f(X) \exp \left( \sum _{e^{1/\xi } < p \le X} \frac{1-|f(p) |}{p}\right) e^{-\rho (fn^{-it_0},n^{it}; e^{1/\xi })^2}. \end{aligned}$$

Since \(f \in \mathcal {M}(X;A,B;\gamma ,\sigma )\), we have

$$\begin{aligned} \sum _{e^{1/\xi }< p \le X} \frac{1-|f(p) |}{p} \le (1-A) \sum _{e^{1/\xi } < p \le X} \frac{1}{p} +O(\xi ^{\gamma }) = (1-A) \log (\xi \log X) + O_A(1). \end{aligned}$$

We thus obtain

$$\begin{aligned} |\mathcal {F}(1+\xi +it)|\ll _{A,B,C} \xi ^{-1} (1+\xi \log X)^{1-A} \mathcal {P}_f(X)e^{-\rho (fn^{-it_0},n^{it}; e^{1/\xi })^2}, \end{aligned}$$

which proves the first claimed estimate.

To obtain the second, note that \(\rho (fn^{-it_0},n^{it};Y)^2 \ge 0\) for all \(Y \ge 2\), and so using \(|f(p) |\le B\) and \(A \ge 0\) we obtain the further bound

$$\begin{aligned} \ll \xi ^{-1}(\xi \log X)^{1-A} \mathcal {P}_f(X) \ll (\log X) \mathcal {P}_f(X)&\ll _B \exp \left( \sum _{p \le X} \frac{|f(p) |}{p} \right) \ll (\log X)^B, \end{aligned}$$

as claimed. \(\square \)

To bound certain error terms in the proof of Theorem 3.6, we require the following estimate, whose proof largely follows that of [7, Lem. 2.4]

Lemma 3.8

Let \(e^3 \le w \le X^{1/3}\), \(w \le y \le \sqrt{X}\) and \(\eta := 1/\log y \in (0,1/3]\). Then for any \(X/w \le Z \le X\),

$$\begin{aligned} \sum _{mn \le Z} |s(m) |\frac{|\ell (n) |}{n^{\eta }} + \int _0^{\eta }\sum _{mkn \le Z} |s(m)|\frac{|\Lambda _{\ell }(k) \ell (n)|}{k^{\alpha }n^{2\eta + \alpha }}d\alpha \ll _{A,B,C} Z\left( \frac{\log y}{\log Z}\right) ^A \mathcal {P}_f(X). \end{aligned}$$

Proof

In the first sum, the summands arise from a Dirichlet convolution of multiplicative functions \(|s |*|\ell |n^{-\eta }\), and we clearly have \(|s(n) |, |\ell (n) |\le d_B(n)^C\) for all \(n \le X\). By Lemmas 3.2 and (3.5), the first sum is therefore

$$\begin{aligned}&\ll _{B,C} \frac{Z}{\log Z} \exp \left( \sum _{p \le y} \frac{|f(p) |}{p} + \sum _{y< p \le Z} \frac{|f(p) |}{p^{1+\eta }}\right) \\ {}&\ll _B Z\frac{\log y}{\log X} \mathcal {P}_f(X) \exp \left( \sum _{y < p \le X} \frac{1-|f(p) |}{p}\right) . \end{aligned}$$

Arguing as in the previous lemma, since \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\) this is bounded by

$$\begin{aligned} \ll _A Z\frac{\log y}{\log X} \cdot \left( \frac{\log X}{\log y}\right) ^{1-A} \mathcal {P}_f(X) \ll Z\left( \frac{\log y}{\log X}\right) ^A \mathcal {P}_f(X). \end{aligned}$$

For the second term, we use Lemma 3.1c), which shows that \(|\Lambda _{\ell }(p)|\le B \log p \) and \(|\Lambda _{\ell }(p^{\nu })|\ll _{\varepsilon ,B,C} p^{\nu \varepsilon }\). It follows that for \(1 \le K \le X\),

$$\begin{aligned} \left|\sum _{k \le K} \Lambda _{\ell }(n)n^{-\alpha }\right|\le B\sum _{p \le K} p^{-\alpha } \log p + O_{B,C} \left( \sum _{\begin{array}{c} p^{\nu } \le K \\ \nu \ge 2 \end{array}} p^{\nu /6} \right) \ll _{B,C} K^{1-\alpha } + K^{2/3}, \end{aligned}$$

say, which is acceptable. Therefore taking \(K = Z/mn\), the \(\alpha \) integral in the statement is

$$\begin{aligned} \ll _{B,C} \int _0^{\eta } Z^{1-\alpha }\sum _{mn \le Z} \frac{|s(m)|}{m^{1-\alpha }}\frac{|\ell (n)|}{n^{1+2\eta }} d\alpha . \end{aligned}$$

Extending the inner sum by positivity to all products mn with \(p^k ||mn \Rightarrow p^k \le Z\) and using the estimates (3.5) once again, we may bound the integral using Euler products as

$$\begin{aligned}&\ll _{B,C} \int _0^{\eta } Z^{1-\alpha } \cdot \prod _{p \le y} \left( 1+\frac{|f(p) |}{p^{1-\alpha }}\right) \prod _{y< p \le X} \left( 1+\frac{|f(p) |}{p^{1+2\eta }}\right) d\alpha \\&\ll _B Z\prod _{p \le y} \left( 1+\frac{|f(p) |}{p}\right) \int _0^{\eta } Z^{-\alpha } d\alpha \ll _B Z \frac{\log y}{\log Z} \mathcal {P}_f(X)\exp \left( \sum _{y < p \le X} \frac{1-|f(p) |}{p}\right) \\&\ll _{A,B} Z\left( \frac{\log y}{\log X}\right) ^A\mathcal {P}_f(X). \end{aligned}$$

This completes the proof. \(\square \)

Proof of Theorem 3.6

The proof follows that of [7, Thm. 1.5], and we principally highlight the differences.

We begin with the first claim of the theorem. Let \(T := (\log X)^{B+1}\) and \(y := \max \{ew,T^2\}\). Fix \(\eta := 1/\log y\), \(c_0 := 1+1/\log X\). Then [7, Lem. 2.2] (replacing \(\beta \) by \(\beta /2\)) and Lemma 3.8 combine to show that

$$\begin{aligned}&\frac{1}{X}\sum _{n \le X} f(n)n^{-it_0} - \frac{w}{X}\sum _{n \le X/w} f(n)n^{-it_0} \\&\quad = \int _0^{\eta }\int _0^{\eta } \frac{1}{\pi i} \int _{c_0-i\infty }^{c_0+i\infty } \mathcal {S}(s) \mathcal {L}(s+\alpha ) \frac{\mathcal {L}'}{\mathcal {L}}(s+\alpha )\frac{\mathcal {L}'}{\mathcal {L}}(s+\alpha +2\beta ) \frac{X^{s-1} (1-w^{1-s})}{s} ds d\beta d\alpha \\&\qquad + O_{A,B,C}\left( \left( \frac{\log y}{\log X}\right) ^A\mathcal {P}_f(X)\right) . \end{aligned}$$

Consider the inner integral over s. Shifting \(s \mapsto s - \alpha -\beta \) and applying [7, Lem. 2.5], this is

$$\begin{aligned}&\frac{1}{\pi i} \int _{c_0-iT}^{c_0+iT}&\mathcal {S}(s-\alpha -\beta ) \mathcal {L}(s+\beta ) \left( \sum _{y< m< X/y} \frac{\Lambda _{\ell }(m)}{m^{s-\beta }}\right) \left( \sum _{y< n < X/y} \frac{\Lambda _{\ell }(n)}{n^{s+\beta }}\right) \\{} & {} \cdot \frac{X^{s-1-\alpha -\beta }(1-w^{1+\alpha + \beta -s})}{s-\alpha -\beta } ds + O\left( \frac{1}{\log X}\right) . \end{aligned}$$

Extracting the maximum over \(|t |\le T\), then applying Cauchy–Schwarz and [7, Lem. 2.6], the main term for the s-integral is bounded above by

$$\begin{aligned}&\ll X^{-\alpha -\beta } \left( \max _{|t |\le T} \frac{|\mathcal {S}(c_0-\alpha -\beta +it)\mathcal {L}(c_0+\beta +it)||1-w^{1+\alpha +\beta -c_0-it}|}{|c_0-\alpha -\beta +it |}\right) \\&\quad \times \left( \int _{-T}^{T} \left|\sum _{y< m< X/y} \frac{\Lambda _{\ell }(m)}{m^{c_0-\beta -it}}\right|^2 \hbox {d}t\right) ^{1/2}\left( \int _{-T}^{T} \left|\sum _{y< m< X/y} \frac{\Lambda _{\ell }(m)}{m^{c_0+\beta -it}}\right|^2 \hbox {d}t\right) ^{1/2} \\&\ll _{B,C} X^{-\alpha -\beta } \left( \max _{|t |\le T} \frac{|\mathcal {S}(c_0-\alpha -\beta +it)\mathcal {L}(c_0+\beta +it) ||1-w^{1+\alpha +\beta -c_0-it}|}{|c_0-\alpha -\beta +it|}\right) \\&\quad \times \left( \sum _{y< p< X/y} \frac{\log p}{p^{c_0 -2\beta }} + y^{-1/2+2\beta } \right) ^{1/2}\left( \sum _{y< p < X/y} \frac{\log p}{p^{c_0 +2\beta }} + y^{-1/2-2\beta }\right) ^{1/2} \\&\ll X^{-\alpha -\beta } \left( \frac{X}{y}\right) ^{\beta }\min \{\log X, 1/\beta \}\\&\quad \times \left( \max _{|t |\le T} \frac{|\mathcal {S}(c_0-\alpha -\beta +it)\mathcal {L}(c_0+\beta +it)||1-w^{1+\alpha +\beta -c_0-it} |}{|c_0-\alpha -\beta +it |}\right) . \end{aligned}$$

Furthermore, by (3.5) and \(\alpha ,\beta \le \eta = 1/\log y\), we see that for any \(t \in \mathbb {R}\),

$$\begin{aligned}&X^{-\alpha -\beta }\left( \frac{X}{y}\right) ^{\beta } |\mathcal {S}(c_0-\alpha -\beta +it)\mathcal {L}(c_0+\beta +it)|\\ {}&\ll _{B,C} X^{-\alpha }y^{-\beta } |\mathcal {S}(c_0+\beta +it)\mathcal {L}(c_0+\beta +it) |\\&\ll X^{-\alpha } |\mathcal {F}(c_0+\beta +it)|. \end{aligned}$$

Thus, we have so far shown that

$$\begin{aligned}&\left|\frac{1}{X}\sum _{n \le X} f(n)n^{-it_0} - \frac{w}{X}\sum _{n \le X/w} f(n)n^{-it_0}\right|\nonumber \\&\quad \ll _{A,B,C} \int _0^{\eta }\int _0^{\eta } X^{-\alpha } \min \{\log X,1/\beta \} \max _{|t |\le T} \frac{|\mathcal {F}(c_0+\beta +it)(1-w^{1+\alpha +\beta -c_0-it}) |}{|c_0+\beta +it |} \hbox {d}\beta \hbox {d}\alpha \nonumber \\&\qquad + \left( \frac{\log \log X + \log (ew)}{\log X}\right) ^A\mathcal {P}_f(X) + \frac{1}{\log X}. \end{aligned}$$
(3.6)

Observe next that

$$\begin{aligned} |w^{-\beta -it} - w^{1+\alpha +\beta -c_0-it} |\ll \left( \alpha + \beta + \frac{1}{\log X}\right) \log (ew), \end{aligned}$$

so that we may rewrite the integral expression in (3.6) as

$$\begin{aligned}&\int _0^{\eta } \left( \int _0^{\eta } X^{-\alpha } \hbox {d}x\right) \min \{\log X,1/\beta \} \max _{|t |\le T} \frac{|\mathcal {F}(c_0+\beta +it)(1-w^{-\beta -it}) |}{ |c_0+\beta +it |} \hbox {d}\beta \\&\qquad + (\log (ew))\int _0^{\eta }\max _{|t |\le T} |\mathcal {F}(c_0+\beta +it) |\min \{\log X , \beta ^{-1}\}\\&\qquad \int _0^{\eta } X^{-\alpha } \left( \alpha +\beta + 1/\log X\right) \hbox {d}\alpha \hbox {d}\beta \\&\quad =: T_1 + T_2. \end{aligned}$$

We first estimate \(T_2\). The integral over \(\alpha \) is

$$\begin{aligned} \ll \left( \beta + \frac{1}{\log X}\right) \int _0^{\eta } X^{-\alpha }d\alpha + \int _0^{\eta } \alpha X^{-\alpha } d\alpha \ll \frac{1}{\log X} \left( \beta + \frac{1}{\log X}\right) . \end{aligned}$$

Applying Lemma 3.7 (with \(\xi = 1/\log X + \beta \)) and \(\rho (fn^{-it_0},n^{it};Y)^2 \ge 0\) for all \(Y \ge 2\),

$$\begin{aligned} T_2&\ll _{A,B,C} (\log (ew))\mathcal {P}_f(X)\int _0^{\eta } \min \{1,(\beta \log X)^{-1}\}(1+\beta \log X)^{1-A} d\beta . \end{aligned}$$

Splitting the \(\beta \)-integral at \(1/\log X\) and evaluating, we obtain

$$\begin{aligned} T_2&\ll _{A,B,C} (\log (ew))\mathcal {P}_f(X) \left( \frac{1}{\log X} + \frac{1_{A = 1} \log (\eta \log X) + 1}{(\log X)^A}\left( (\log X)^{A-1} + \eta ^{1-A}\right) \right) \\&\ll _B \mathcal {P}_f(X)\left( \frac{(\log (ew))(1+1_{A = 1} \log (\log X/\log (ew)))}{\log X} + \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^A\right) \\&\ll \mathcal {P}_f(X) \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{\min \{1,A\}} \left( 1+1_{A = 1} \log \left( \frac{\log X}{\log (ew)}\right) \right) . \end{aligned}$$

We now turn to \(T_1\). By evaluating the \(\alpha \) integral, we have

$$\begin{aligned} T_1 \ll \frac{1}{\log X} \int _0^{\eta } \min \{\log X,1/\beta \} \max _{|t |\le T} \frac{|\mathcal {F}(c_0+\beta +it) ||1-w^{-\beta -it} |}{ |c_0+\beta +it |} d\beta . \end{aligned}$$

Put \(T' := \frac{1}{2}(\log X)^B\). If the maximum occurs at \(|t |> T'\) then using the second estimate in Lemma 3.7 we obtain

$$\begin{aligned} T_1 \ll _{B,C} \frac{1}{\log X} \int _0^{\eta } \min \{\log X, 1/\beta \} \cdot \frac{(\log X)^B}{T'} d\beta&\ll \frac{1}{\log X} \left( (\log X) \cdot \frac{1}{\log X } + \log \left( \eta \log X\right) \right) \\&\ll \frac{\log \log X}{\log X}. \end{aligned}$$

Thus, suppose the maximum occurs with \(|t |\le T'\). Applying [7, Lem. 3.1], we get

$$\begin{aligned}&\max _{|t |\le T'} |\mathcal {F}(c_0 + \beta + it)(1-w^{-\beta -it}) |\\&\quad \le \max _{|t |\le (\log X)^B} |\mathcal {F}(c_0 + it)(1-w^{-it})|+ O\left( \frac{\beta }{(\log X)^B} \sum _{n \le X} \frac{|f(n) |}{n^{1+1/\log X}}\right) \\&\quad = \max _{|t |\le (\log X)^B} |\mathcal {F}(c_0 + it)(1-w^{-it})|+ O_{B,C}\left( \frac{\beta }{(\log X)^{B-1}} \mathcal {P}_f(X)\right) . \end{aligned}$$

Inserting this into the \(\beta \) integral yields, in this case,

$$\begin{aligned} T_1&\ll _B \max _{|t |\le (\log X)^B} |\mathcal {F}(c_0+it)(1-w^{-it})|\cdot \frac{1}{\log X} \int _0^{\eta } \min \{\log X, 1/\beta \} d\beta + \frac{\mathcal {P}_f(X)}{(\log X)^B} \\&\ll _B \max _{|t |\le (\log X)^B} |\mathcal {F}(1+1/\log X+it)(1-w^{-it}) |\cdot \frac{\log (\log X/\log (ew))}{\log X} + \frac{\mathcal {P}_f(X)}{(\log X)^B}. \end{aligned}$$

Finally, we focus on the maximum here. Note that \(|1-w^{-it} |\ll \min \{1,|t |\log (ew)\}\), so combining Lemma 3.7 with our hypothesis (1.8), we obtain

$$\begin{aligned}&\max _{|t |\le (\log X)^B} |\mathcal {F}(1+1/\log X + it)(1-w^{-it}) |\\&\quad \ll _{A,B,C} (\log X) \mathcal {P}_f(X) \cdot \max _{|t |\le (\log X)^B}\min \{1,|t |\log (ew)\} e^{-\rho (f,n^{i(t_0+t)};X)^2} \\&\quad \ll _{A,B} (\log X) \mathcal {P}_f(X) \max _{|t |\le (\log X)^B} \min \{1,|t |\log (ew)\} \left( \frac{1}{(\log X)^{\sigma }} + \frac{1}{(1+|t |\log X)^{\sigma }}\right) \\&\quad \ll (\log X) \mathcal {P}_f(X) \cdot \left( \frac{\log (ew)}{\log X}\right) ^{\min \{1,\sigma \}}. \end{aligned}$$

Hence, as \({\hat{\sigma }} = \min \{1,\sigma \} \le A \le B\), and \((\log X)^{-1} \ll _A (\log X)^{-A} \mathcal {P}_f(X)\) by (1.7) we get

$$\begin{aligned} T_1&\ll _{A,B,C} \log \left( \frac{\log X}{\log (ew)}\right) \left( \frac{\log (ew)}{\log X}\right) ^{{\hat{\sigma }}} \mathcal {P}_f(X) + \frac{\mathcal {P}_f(X)}{(\log X)^B} + \frac{\log \log X}{\log X} \\&\ll \log \left( \frac{\log X}{\log (ew)}\right) \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{{\hat{\sigma }}} \mathcal {P}_f(X). \end{aligned}$$

Combining all of these bounds and inserting them into (3.6), we thus find that

$$\begin{aligned}&\left|\frac{1}{X}\sum _{n \le X} f(n)n^{-it_0} - \frac{w}{X}\sum _{n \le X/w} f(n)n^{-it_0}\right|\\&\quad \ll _{A,B,C} \mathcal {P}_f(X) \log \left( \frac{\log X}{\log (ew)}\right) \left( \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{\min \{1,A\}}+ \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{{\hat{\sigma }}}\right) \\&\quad \ll \mathcal {P}_f(X) \log \left( \frac{\log X}{\log (ew)}\right) \left( \frac{\log (ew) + \log \log X}{\log X}\right) ^{{\hat{\sigma }}}. \end{aligned}$$

This proves the first claim.

The second claim can be deduced similarly, since (using the same notation as above) in the first step we have (after shifting \(s \mapsto s-it_0\))

$$\begin{aligned}&\frac{1}{X^{1+it_0}}\sum _{n \le X} f(n) - \left( \frac{w}{X}\right) ^{1+it_0}\sum _{n \le X/w} f(n) \\&\quad = \int _0^{\eta }\int _0^{\eta } \frac{1}{\pi i} \int _{c_0-i\infty }^{c_0+i\infty } \mathcal {S}(s-\alpha -\beta ) \mathcal {L}(s+\beta ) \frac{\mathcal {L}'}{\mathcal {L}}(s+\alpha )\frac{\mathcal {L}'}{\mathcal {L}}(s+\alpha +2\beta ) \frac{X^{s-1} (1-w^{1-s})}{s+it_0} \hbox {d}s \hbox {d}\beta \hbox {d}\alpha \\&\qquad + O_{A,B,C}\left( \left( \frac{\log y}{\log X}\right) ^A\mathcal {P}_f(X)\right) , \end{aligned}$$

which simply localizes the argument above to the range \(|t+t_0 |\le T\) instead. \(\square \)

Theorem 3.6 may be directly applied to obtain the first estimate in Theorem 2.2. To obtain the second, we will use the following corollary of Theorem 3.6 that allows us to pass from \(n^{-it_0}\)-twisted sums to untwisted sums of f(n) on long intervals.

Corollary 3.9

Let \(t_0 = t_0(f,X)\) be as above. Then for any \(x \in (X/2,X]\),

$$\begin{aligned} \frac{1}{x}\sum _{n \le x} f(n)n^{-it_0} = \frac{1+it_0}{x^{1+it_0}} \sum _{n \le x} f(n) + O_{A,B,C}\left( |t_0 |\mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}}}\right) . \end{aligned}$$

Proof

By partial summation, we have

$$\begin{aligned} \frac{1}{x}\sum _{n \le x} f(n)n^{-it_0}&= \frac{1}{x}\int _1^x u^{-it_0} d\{\sum _{n \le x} f(n)\} \nonumber \\&= \frac{1}{x^{1+it_0}} \sum _{n \le x} f(n) +\frac{it_0}{x} \int _1^x \frac{1}{u^{1+it_0}}\sum _{n \le u} f(n) \hbox {d}u. \end{aligned}$$
(3.7)

We split the integral over u at \(x/(\log X)^2\). In the first range, we use the trivial bound together with Lemma 3.2, obtaining

$$\begin{aligned} \le \frac{|t_0 |}{x} \int _1^{x/(\log X)^2} \left( \frac{1}{u} \sum _{n \le u} |f(n) |\right) \hbox {d}u \ll _{B,C} \frac{|t_0 |}{(\log X)^2} \prod _{p \le X} \left( 1+\frac{|f(p) |}{p}\right) \ll \frac{|t_0 |}{\log X}\mathcal {P}_f(X). \end{aligned}$$

In the remaining range \(x/(\log X)^2 < u \le x\), we apply the second claim in Theorem 3.6 (with \(1 \le w \le (\log X)^2\)), which gives

$$\begin{aligned}&\frac{it_0}{x} \int _{x/(\log X)^2}^x \left( \frac{1}{x^{1+it_0}} \sum _{n \le x} f(n) + O_{A,B,C} \left( \mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}}}\right) \right) \hbox {d}u \\&= \left( \frac{1}{x^{1+it_0}}\sum _{n \le x} f(n) \right) \cdot \frac{it_0}{x} \int _{x/(\log X)^2}^x \hbox {d}u + O_{A,B,C} \left( |t_0 |\mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) \\&= \frac{it_0}{x^{1+it_0}} \sum _{n \le x} f(n) + O_{A,B,C} \left( |t_0 |\mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) . \end{aligned}$$

Combining this with the estimate from \(1 \le u \le x/(\log X)^2\), then inserting this into (3.7), we prove the claim. \(\square \)

Proof of Theorem 2.2

We begin by proving the first estimate in the statement of the theorem. Let \(X/(\log X)^{{\hat{\sigma }}/2} \le h \le X/10\). Note that by writing \(x-h = x/w\), where \(w := (1-h/x)^{-1} \in [1,2]\), the sum of \(f(n)n^{-it_0}\) over \((x-h,x]\) is

$$\begin{aligned} \frac{1}{h} \left( \sum _{n \le x} f(n)n^{-it_0} -\sum _{n \le x/w} f(n)n^{-it_0}\right) . \end{aligned}$$
(3.8)

and similarly its sum over (X/2, X] is

$$\begin{aligned} \frac{2}{X}\left( \sum _{n \le X} f(n)n^{-it_0}-\sum _{n \le X/2}f(n)n^{-it_0}\right) . \end{aligned}$$
(3.9)

By Theorem 3.6, (3.8) becomes

$$\begin{aligned}&\frac{1}{h}\left( \left( 1-\frac{1}{w}\right) \sum _{n \le x} f(n)n^{-it_0} \right) + O_{A,B,C} \left( \frac{X}{h} \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}}}\mathcal {P}_f(X)\right) \\&= \frac{1}{x}\sum _{n \le x} f(n)n^{-it_0} + O_{A,B,C} \left( \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}/2}} \mathcal {P}_f(X)\right) . \end{aligned}$$

Similarly, applying Theorem 3.6 twice to (3.9), we also find that

$$\begin{aligned} \frac{2}{X}\sum _{\tfrac{X}{2} < n \le X} f(n)n^{-it_0}&= \frac{2}{X}\left( 1-\frac{1}{2}\right) \sum _{n \le X} f(n)n^{-it_0} + O_{A,B,C} \left( \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}}}\mathcal {P}_f(X)\right) \nonumber \\&= \frac{1}{x} \sum _{n \le x} f(n)n^{-it_0} + O_{A,B,C}\left( \frac{(\log \log X)^{{\hat{\sigma }}+1}}{(\log X)^{{\hat{\sigma }}}}\mathcal {P}_f(X)\right) , \end{aligned}$$
(3.10)

viewing \(x = X/u\) for some \(u \in [1,2]\) in the last step. Combined with the previous estimate, we deduce the first claimed estimate of the theorem.

To prove the second claimed estimate, we apply Corollary 3.9 to obtain

$$\begin{aligned} \sum _{x-h < n \le x} f(n)&= \frac{x^{it_0}}{1+it_0} \sum _{n \le x} f(n)n^{-it_0} - \frac{(x-h)^{it_0}}{1+it_0} \sum _{n \le x-h} f(n)n^{-it_0} \\&\quad + O\left( X \mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) . \end{aligned}$$

Setting \(w := (1-h/x)^{-1}\) as in (3.8), we have

$$\begin{aligned}&\frac{x^{it_0}}{1+it_0} \sum _{n \le x} f(n)n^{-it_0} - \frac{(x-h)^{it_0}}{1+it_0} \sum _{n \le x-h} f(n)n^{-it_0} \\&\quad = \left( \frac{x^{it_0}}{1+it_0} - \frac{1}{w} \frac{(x-h)^{it_0}}{1+it_0}\right) \sum _{n \le x} f(n)n^{-it_0} + O\left( X \mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) \\&\quad = \frac{x^{1+it_0} - (x-h)^{1+it_0}}{1+it_0} \cdot \frac{1}{x} \sum _{n \le x} f(n)n^{-it_0} + O\left( X \mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) . \end{aligned}$$

By (3.10), the main term here is

$$\begin{aligned} \int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X}\sum _{X/2 < n \le X} f(n)n^{-it_0} + O\left( X\mathcal {P}_f(X) \frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) . \end{aligned}$$

Combining these estimates, we thus obtain

$$\begin{aligned} \frac{1}{h} \sum _{x-h< n \le x} f(n) = \frac{1}{h}\int _{x-h}^x u^{it_0} \hbox {d}u \cdot \frac{2}{X} \sum _{X/2 < n \le x} f(n)n^{-it_0} + O\left( \frac{X}{h} \mathcal {P}_f(X)\frac{(\log \log X)^{{\hat{\sigma }} + 1}}{(\log X)^{{\hat{\sigma }}}}\right) , \end{aligned}$$

and so the second claimed estimate of the theorem follows from \(h\ge X/(\log X)^{{\hat{\sigma }}/2}\). \(\square \)

4 Applying the Matomäki–Radziwiłł method

In this section, which broadly follows the lines of the proof of [26, Thm. 3], we set out the key elements of the proof of Theorem 2.1.

4.1 Large sieve estimates

The content of this subsection can essentially all be found in [26, Sec. 6 and 7] and in [25, Sec. 3]. In what follows, a set \(\mathcal {T} \subset \mathbb {R}\) is said to be well spaced if \( |t_1-t_2 |\ge 1\) for any distinct \(t_1,t_2 \in \mathcal {T}\).

Lemma 4.1

[Sparse large sieve for multiplicative sequences] Let \(T \ge 1\) and \(2 \le N \le X\). Let \(\{a_n\}_{n \le N}\) be a sequence of complex numbers. Let \(\mathcal {T} \subset [-T,T]\) be well spaced. The following bounds hold:

  1. (a)

    (\(L^2\) mean value theorem, sparse version)

    $$\begin{aligned} \int _{-T}^T |\sum _{n \le N} a_n n^{-it} |^2 \hbox {d}t&\ll T\sum _{n \le N} |a_n |^2 + T\sum _{n \le N} \sum _{1 \le |m |\le n/T} |a_na_{m+n} |. \end{aligned}$$
  2. (b)

    (\(L^2\) mean value theorem with multiplicative majorant) Let \(1 \le M \le N\), and let \(c > 0\). Assume there is a multiplicative function \(f: \mathbb {N} \rightarrow \mathbb {C}\) satisfying \(|f(n) |\le d_B(n)^C\) such that \(|a_n |\le c|f(n) |\) for all \(n\le N\). Then

    $$\begin{aligned} \int _{-T}^T |\sum _{N-M < n \le N} \frac{a_nn^{-it}}{n} |^2 \hbox {d}t&\ll _{B,C} c^2\left( \frac{TM}{N^2} \mathcal {P}_{f^2}(N) + \frac{M}{N}\mathcal {P}_f(N)^2\right) . \end{aligned}$$
  3. (c)

    (Discrete mean value theorem)

    $$\begin{aligned}&\sum _{t \in \mathcal {T}} |\sum _{N/3< n \le N} \frac{a_nn^{-it}}{n} |^2 \\ {}&\ll \min \left\{ \left( 1+\frac{T}{N}\right) \log (2N) , \left( 1+|\mathcal {T} |\frac{T^{1/2}}{N}\right) \log (2T)\right\} \frac{1}{N} \sum _{N/3 < n \le N} |a_n |^2. \end{aligned}$$

Proof

Part (a) is [25, Lem. 3.2], part (b) is proven in the same way asFootnote 8 [25, Lem. 3.4] and part (c) is a combination of [26, Lem. 7 and 9]. \(\square \)

Lemma 4.2

[Large sieve with prime support] Let \(B,T \ge 1\), \(P \ge 10\). Let \(\{a_p\}_{P < p \le 2P}\) be a sequence with \(\max _{P < p \le 2P} |a_p |\le B\). Let \(P(s) := \sum _{P < p \le 2P} a_pp^{-s}\), for \(s \in \mathbb {C}\) and let \(\mathcal {T} \subset [-T,T]\) be a well-spaced set.

  1. (a)

    (Halász–Montgomery estimate for primes)

    $$\begin{aligned} \sum _{t \in \mathcal {T}} |P(1+it) |^2 \ll _B \frac{1}{(\log P)^2} \left( 1+ |\mathcal {T} |(\log T)^2 \exp \left( -\frac{\log P}{(\log T)^{2/3+\varepsilon }}\right) \right) . \end{aligned}$$
  2. (b)

    (Large values estimate) If \(\mathcal {T}\) consists only of \(t \in [-T,T]\) with \(|P(1+it)|\ge V^{-1}\) then

    $$\begin{aligned} |\mathcal {T} |\ll _B T^{2\frac{\log V}{\log P}} V^2 \exp \left( 2B\frac{\log T}{\log P}\log \log T\right) . \end{aligned}$$

Proof

Part (a) is [26, Lem. 11], while part (b) is proven precisely as in [26, Lem. 8], keeping track of the upper bound condition \(|a_p |\le B\). \(\square \)

4.2 Dirichlet polynomial decomposition

The following is a variant of [26, Lem. 12] tailored to elements of \(\mathcal {M}(X;A,B,C;\gamma ,\sigma )\).

Lemma 4.3

Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Let \(T \ge 1\), \(1 \le H \le X^{1/2}\) and \(1 \le P \le Q \le X^{1/2}\). Set \(\mathcal {I}\) to be the interval of integers \(\left\lfloor H\log P \right\rfloor \le v \le H \log Q\), and let \(\mathcal {T} \subset [-T,T]\). Then

$$\begin{aligned} \int _{\mathcal {T}}&\left|\sum _{\begin{array}{c} X/3 < n \le X \\ \omega _{[P,Q]}(n) \ge 1 \end{array}} \frac{f(n)}{n^{1+it}}\right|^2 \hbox {d}t \ll _{B,C} H \log (Q/P) \sum _{v \in \mathcal {I}} \int _{\mathcal {T}} |Q_{v,H}(1+it)R_{v,H}(1+it)|^2 \hbox {d}t \\&\quad + \left( \frac{1}{H}+\frac{1}{P}\right) \left( \frac{T}{X}\mathcal {P}_{f^2}(X) + \mathcal {P}_f(X)^2\right) , \end{aligned}$$

where for \(v \in \mathcal {I}\) and \(s \in \mathbb {C}\) we have set

$$\begin{aligned} Q_{v,H}(s)&:= \sum _{\begin{array}{c} P \le p \le Q \\ v/H \le \log p \le (v+1)/H \end{array}} f(p)p^{-s} \\ R_{v,H}(s)&:= \sum _{Xe^{-v/H}/3 \le m \le Xe^{-v/H}} \frac{f(m)}{m^s(\omega _{[P,Q]}(m) + 1)}. \end{aligned}$$

Proof

The proof is the same as that of [26, Lem. 12] (with \(a_n = f(n)1_{\omega _{[P,Q]} \ge 1}(n)\), \(b_m = f(m)\) and \(c_p = f(p)\) for \(P \le p \le Q\)), with appropriate appeal to Lemma 4.1 in place of the usual mean value theorem. For example (as on [26, top of p.20]), for \(Y \in \{X/(3Q),X/P\}\) we have

$$\begin{aligned} \int _{\mathcal {T}}\left|\sum _{m \in [Ye^{-1/H},Ye^{1/H}]} f(m)m^{-1-it}\right|^2 \hbox {d}t&\ll _{B,C} \frac{T}{XH} \mathcal {P}_{f^2}(X) + \frac{1}{H}\mathcal {P}_f(X)^2. \end{aligned}$$

\(\square \)

Lemma 4.4

Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Let \(T,Y_1,Y_2 \ge 1\), \(1 \le X' \le X/Y_1\) and let \(\ell := \lceil \frac{\log Y_2}{\log Y_1}\rceil \). Define

$$\begin{aligned} Q(s) := \sum _{Y_1/2< p \le Y_1} c_pp^{-s}, \quad \quad A(s) := \sum _{X'/(2Y_2) < m \le X'/Y_2} f(m)m^{-s}, \end{aligned}$$

where \(|c_p |\le B\) for all \(Y_1/2<p \le Y_1\). Finally, let \(\mathcal {T} \subseteq [-T,T]\). Then

$$\begin{aligned} \int _{\mathcal {T}} |Q(1+it)^{\ell }A(1+it) |^2 \hbox {d}t \ll _{B,C} B^{2\ell } (\ell !)^2 \left( \frac{T}{X} \mathcal {P}_{f^2}(X) + \mathcal {P}_f(X)^2\right) . \end{aligned}$$

Proof

Writing \(c_p := B c_p'\), where now \(|c_p' |\le 1\) and letting \({\tilde{Q}}(s)\) denote the Dirichlet polynomial with \(c_p\) replaced by \(c_p'\) for all \(p \in (Y_1/2,Y_1]\), the LHS in the statement is

$$\begin{aligned} \ll B^{2\ell } \int _{\mathcal {T}} |{\tilde{Q}}(1+it) A(1+it)|^2 \hbox {d}t. \end{aligned}$$

The rest of the proof is essentially the same as that of [25, Lem. 7.1], saving that the function \(g^{*}\) is replaced by \(|f|\) (this does not affect the proof, which depends on our Lemma 3.2 and [14, Thm. 3], both of which also apply to \(|f |\).) \(\square \)

4.3 Integral averages of Dirichlet polynomials

As above, we write \(t_0 = t_0(f,X)\) to denote an element of \([-X,X]\) that minimizes the map

$$\begin{aligned} t \mapsto \sum _{p \le X} \frac{|f(p) |- \text {Re}(f(p)p^{-it})}{p} = \rho (f, n^{it};X)^2. \end{aligned}$$

Proposition 4.5

Let \(1/\log X \le \delta \le 1\), and put \(I_{\delta }:= [t_0-\delta ^{-1},t_0 + \delta ^{-1}]\). Let \(\{a_n\}_{n \le X}\) be a sequence of complex numbers. Then

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^X \left|\frac{1}{h}\sum _{\begin{array}{c} x-h < m \le x \end{array}} a_m - \frac{1}{2\pi } \int _{I_{\delta }} A(1+it) \frac{x^{1+it}-(x-h)^{1+it}}{h(1+it)}\hbox {d}t\right|^2\hbox {d}x \\&\quad \ll \int _{[-X/h, X/h] \backslash I_{\delta }} |A(1+it)|^2 \hbox {d}t + \max _{T \ge X/h} \frac{X}{hT}\int _T^{2T} |A(1+it)|^2 \hbox {d}t, \end{aligned}$$

where we have set

$$\begin{aligned} A(s) := \sum _{\begin{array}{c} X/3 < n \le X \end{array}} \frac{a(n)}{n^s}, \quad \quad s \in \mathbb {C}. \end{aligned}$$

Proof

For each \(x \in [X/2,X]\), Perron’s formula gives

$$\begin{aligned} \frac{1}{h}\sum _{x-h < m \le x} a_m = \frac{1}{2\pi } \int _{\mathbb {R}} A(1+it) \frac{x^{1+it}-(x-h)^{1+it}}{h(1+it)} \hbox {d}t. \end{aligned}$$

Subtracting the contribution from \(|t-t_0 |\le \delta ^{-1}\), the LHS in the statement becomes

$$\begin{aligned} \frac{2}{X}\int _{X/2}^X\left|\frac{1}{2\pi } \int _{\mathbb {R} \backslash I_{\delta }} A(1+it) \frac{x^{1+it}-(x-h)^{1+it}}{h(1+it)} \hbox {d}t\right|^2 \hbox {d}x. \end{aligned}$$

The remainder of the proof is identical to that of [26, Lemma 14] (which only uses the boundedness of the coefficients \(\{a_n\}_n\) there for the corresponding contribution of \(I_{\delta }\)). \(\square \)

4.4 Restricting to a “nicely factored” set

We fix parameters \(\eta \in (0,1/12)\), \(Q_1 := h_0\), \(P_1 := (\log h_0)^{40B/\eta }\) and \(P_j := \exp \left( j^{4j/A-2/A} (\log Q_1)^{j-1}(\log P_1)\right) \), \(Q_j := \exp \left( j^{4j/A} (\log Q_1)^j\right) \), for \(1 \le j \le J\), where J is maximal with \(Q_J \le \exp \left( \sqrt{\log X}\right) \). We highlight the different choice of \(P_1\), with all other choices being the same as in [26, Sec. 2 and 8]. We also let

$$\begin{aligned} \mathcal {S} = \mathcal {S}_{X,P_1,Q_1} := \{n \le X : \omega _{[P_j,Q_j]}(n) \ge 1 \text { for all } 1 \le j \le J\}. \end{aligned}$$

Remark 4.6

The following properties may be verified directly, as long as \(h_0\) is sufficiently large (in terms of B):

  1. 1.

    \(\log P_j \ge \frac{8Bj^{2/A}}{\eta } \log \log (2BQ_{j+1})\) for all \(1 \le j \le J\)

  2. 2.

    \(\log Q_j \le 2^{4j} (\log Q_{j-1})(\log Q_1) \le (\log Q_{j-1})^{3} \le Q_{j-1}^{1/24}\)

  3. 3.

    \(\frac{\log P_j}{\log Q_j} = \frac{\log P_1}{j^{2/A} \log Q_1}\) for \(2 \le j \le J\), so the terms \(\{\log P_j/\log Q_j\}_{j \ge 1}\) are summable.

We will use these in due course.

We wish to reduce our work to handling short and long averages with n restricted to the set \(\mathcal {S}\). To handle averages of f(n) for \(n \notin \mathcal {S}\), we use the following result. For a set of integers \(\mathcal {A}\), we write \((n,\mathcal {A}) = 1\) to mean that \((n,a) = 1\) for all \(a \in \mathcal {A}\).

Lemma 4.7

Let \(1 < P \le Q \le X\), and let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Then for any \(10 \le h_0 \le X/10H(f;X)\) and \(h := h_0H(f;X)\),

$$\begin{aligned} \frac{2}{X}\int _{X/2}^{X} \left|\frac{1}{h}\sum _{\begin{array}{c} x-h < m \le x \\ (m,[P,Q]) = 1 \end{array}} f(m)\right|^2 \hbox {d}x \ll _{A,B,C} \left( \left( \frac{\log P}{\log Q} \right) ^A+ \frac{1}{h_0}\right) \mathcal {P}_f(X)^2. \end{aligned}$$

In particular,

$$\begin{aligned} \frac{2}{X} \int _{X/2}^{X} \left|\frac{1}{h} \sum _{\begin{array}{c} x-h < m \le x \\ m \notin \mathcal {S} \end{array}} f(m)\right|^2 \hbox {d}x \ll _{A,B,C} \left( \frac{\log \log h_0}{\log h_0}\right) ^{A} \mathcal {P}_f(X)^2. \end{aligned}$$

Proof

Expanding the square and applying the triangle inequality, the LHS is

$$\begin{aligned}&\le \frac{2}{h^2X} \sum _{\begin{array}{c} X/2-h< m_1,m_2 \le X \\ |m_1-m_2|\le h \\ (m_1m_2,[P,Q]) = 1 \end{array}} |f(m_1)\overline{f(m_2)} |\int _{X/2}^X 1_{[m_1,m_1+h)}(x) 1_{[m_2,m_2+h)}(x) \hbox {d}x \\&\ll \frac{1}{hX} \sum _{\begin{array}{c} X/3< m \le X \end{array}} |f(m) |^2 + \frac{1}{hX} \sum _{1 \le |l |\le h} \sum _{\begin{array}{c} X/3 < m \le X \\ (m,[P,Q]) = 1 \end{array}} |f(m) f(m+l)|. \end{aligned}$$

By Lemmas 3.2 and (1.11), the first term on the RHS is bounded as

$$\begin{aligned} \ll _{B,C} \frac{1}{h_0H(f;X)}\mathcal {P}_{f^2}(X) \ll _B \frac{1}{h_0}\mathcal {P}_f(X)^2. \end{aligned}$$
(4.1)

Next, to bound the correlation sums we applyFootnote 9 [25, Lem. 3.3] (with \(r_1 = r_2 = 1\)) to the pair of multiplicative functions \(f1_{\mathcal {S}^c}\) and f, which gives

$$\begin{aligned} \sum _{1 \le |l |\le h} \sum _{\begin{array}{c} X/3 < n \le X \\ (n,[P,Q]) = 1 \end{array}} |f(n)f(n+l) |\ll _{B,C} hX\mathcal {P}_{f1_{(m,[P,Q]) = 1}}(X)\mathcal {P}_f(X). \end{aligned}$$

Since \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\), by (1.7) we get

$$\begin{aligned} \mathcal {P}_{f1_{(m,[P,Q]) = 1}}(X)&\asymp _B \mathcal {P}_f(X) \prod _{P \le p \le Q}\left( 1+\frac{1-|f(p) |}{p}\right) \left( 1-\frac{1}{p}\right) \\ {}&\ll _{A,B} \mathcal {P}_f(X) \exp \left( A \log \left( \frac{\log P}{\log Q}\right) \right) \\&= \left( \frac{\log P}{\log Q}\right) ^{A} \mathcal {P}_f(X). \end{aligned}$$

It follows that

$$\begin{aligned} \frac{1}{hX}\sum _{1 \le |l |\le h} \sum _{\begin{array}{c} X/3 < n \le X \\ n \notin \mathcal {S} \end{array}} |f(n) f(n+l) |\ll _{A,B} \left( \frac{\log P}{\log Q}\right) ^{A} \mathcal {P}_f(X)^2. \end{aligned}$$

The first claim now follows upon combining this with (4.1). The second claim follows similarly, saving that in the argument above the term \(\mathcal {P}_{f1_{(m,[P,Q]) = 1}}(X)\) is replaced by

$$\begin{aligned} \mathcal {P}_{f1_{\mathcal {S}^c}}(X)&\ll _B \mathcal {P}_f(X)\sum _{1 \le j \le J} \prod _{P_j \le p \le Q_j} \left( 1+\frac{1-|f(p) |}{p}\right) \left( 1-\frac{1}{p}\right) \\&\ll _{A,B} \mathcal {P}_f(X) \sum _{j \ge 1}\exp \left( A \log \left( \frac{\log P_j}{\log Q_j}\right) \right) \ll \sum _{j \ge 1} \frac{1}{j^{2}} \left( \frac{\log P_1}{\log Q_1}\right) ^{A} \mathcal {P}_f(X) \\ {}&\ll _{A,B} \left( \frac{\log \log h_0}{\log h_0}\right) ^A \mathcal {P}_f(X). \end{aligned}$$

\(\square \)

Having disposed of \(n \notin \mathcal {S}\), we now concentrate on \(n \in \mathcal {S}\). To prove Theorem 2.1, we will apply Proposition 4.5 to the sequence \(a_m = f(m)1_{m \in \mathcal {S}}\), in combination with the following key proposition.

Recall that \(\kappa := \frac{\min \{1,\sigma \}}{8B + 21}\). We also define \(\Delta := (2B+5)\kappa \), and

$$\begin{aligned} F(s) := \sum _{\begin{array}{c} X/3 < n \le X \\ n \in \mathcal {S} \end{array}} \frac{f(n)}{n^s}, s \in \mathbb {C}. \end{aligned}$$

Proposition 4.8

Set \(\delta = (\log X)^{-\Delta }\). Then

$$\begin{aligned} \int _{[-X/h,X/h] \backslash I_{\delta }} |F(1+it) |^2 \hbox {d}t \ll _{A,B,C} \left( \frac{(\log Q_1)^{1/3}}{P_1^{1/6-2\eta }} + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}} \right) \mathcal {P}_f(X)^2. \end{aligned}$$

Remark 4.9

We remark that both terms in Proposition 4.5 can be treated using Proposition 4.8. Indeed, by Lemma 4.1(b),

$$\begin{aligned} \frac{1}{T}\int _T^{2T} |F(1+it) |^2 \hbox {d}t \ll _{B,C} \frac{1}{X} \mathcal {P}_{f^2}(X) + \frac{1}{T}\mathcal {P}_f(X)^2. \end{aligned}$$

and therefore

$$\begin{aligned} \max _{T \ge X(\log h_0)^A/h} \frac{X/h}{T} \int _T^{2T} |F(1+it)|^2 \hbox {d}t&\ll _{B,C} \frac{1}{h}\mathcal {P}_{f^2}(X) + \frac{1}{(\log h_0)^A} \mathcal {P}_{f}(X)^2 \\ {}&\ll \frac{1}{(\log h_0)^A} \mathcal {P}_f(X)^2, \end{aligned}$$

which is obviously sufficient in Theorem 2.1. We clearly also have

$$\begin{aligned} \max _{X/h < T \le X(\log h_0)^A/h} \frac{X/h}{T} \int _T^{2T} |F(1+it) |^2 \hbox {d}t \le \int _{X/h}^{X(\log h_0)^A/h} |F(1+it) |^2 \hbox {d}t. \end{aligned}$$

This expression will also be bounded using Proposition 4.8 with h replaced by \(h/(\log h_0)^A\), which does not change the form of the final estimates.

4.5 Proof of Proposition 4.8

The proof follows the same lines as those in [26, Sec. 8], saving that we apply our versions of the corresponding lemmas that address the growth of \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). We sketch the details here, emphasizing the main differences.

We select parameters \(\alpha _1,\ldots ,\alpha _J\) such that \(\alpha _j := \frac{1}{4}-\eta \left( 1+\frac{1}{2j}\right) \). For each \(1 \le j \le J\), let

$$\begin{aligned} \mathcal {I}_j := [\left\lfloor H_j \log P_j \right\rfloor , H_j\log Q_j] \cap \mathbb {Z}, \quad \quad H_j := j^2 \frac{P_1^{1/6-\eta }}{(\log Q_1)^{1/3}}. \end{aligned}$$

Also, with \(s \in \mathbb {C}\) we let

$$\begin{aligned} Q_{v,H_j}(s)&:= \sum _{\begin{array}{c} P_j \le p \le Q_j \\ e^{v/H_j} \le p \le e^{(v+1)/H_j} \end{array}} f(p)p^{-s}, \\ R_{v,H_j}(s)&:= \sum _{\frac{1}{3}Xe^{-v/H_j} < m \le Xe^{-v/H_j}} \frac{f(m)}{m^s(1+\omega _{[P_j,Q_j]}(m))}. \end{aligned}$$

We split the set of \(t \in \mathcal {X} := [-X/h,X/h] \backslash I_{\delta }\) into sets

$$\begin{aligned} \mathcal {T}_1&:= \{t \in \mathcal {X} : |Q_{v,H_1}(1+it)|\le e^{-\alpha _1v/H_1} \forall \, v_1 \in \mathcal {I}_1\} \\ \mathcal {T}_j&:= \{t \in \mathcal {X} : |Q_{v,H_j}(1+it)|\le e^{-\alpha _jv/H_j} \forall \, v_j \in \mathcal {I}_j\} \backslash \bigcup _{1 \le i \le j-1} \mathcal {T}_i, \\&2 \le j \le J, \text { if } J \ge 2 \\ \mathcal {U}&:= \mathcal {X} \backslash \bigcup _{1 \le j \le J} \mathcal {T}_j. \end{aligned}$$

We thus have

$$\begin{aligned} \int _{[-X/h,X/h] \backslash I_{\delta }} |F(1+it) |^2 \hbox {d}t = \sum _{1 \le j \le J} \int _{\mathcal {T}_j} |F(1+it) |^2 \hbox {d}t + \int _{\mathcal {U}} |F(1+it) |^2 \hbox {d}t. \end{aligned}$$

We estimate the contributions from \(\mathcal {T}_j\) as in [26], saving that in the applications of the large sieve inequalities we use Lemma 4.1(b); as an example, we will give full details for \(j = 1\) and highlight the main changes for the corresponding bounds for \(2 \le j \le J\).

In each case, we apply Lemma 4.3 to obtain

$$\begin{aligned} \int _{\mathcal {T}_j} |F(1+it) |^2 \hbox {d}t \ll _{B,C} \mathcal {M}_j + \mathcal {E}_j, \end{aligned}$$

where we set

$$\begin{aligned} \mathcal {M}_j&:= H_j\log (Q_j/P_j) \sum _{v \in \mathcal {I}_j} \int _{\mathcal {T}_j} |Q_{v,H_j}(1+it)R_{v,H_j}(1+it) |^2 \hbox {d}t \\ \mathcal {E}_j&:= \left( \frac{1}{H_j}+\frac{1}{P_j}\right) \left( \frac{T}{X} \mathcal {P}_{f^2}(X) + \mathcal {P}_f(X)^2\right) . \end{aligned}$$

The choice of parameters gives, by (4.1),

$$\begin{aligned} \sum _{1 \le j \le J} \mathcal {E}_j&\ll \frac{(\log Q_1)^{1/3}}{P_1^{1/6-\eta }}\left( \frac{1}{h_0H(f;X)} \mathcal {P}_{f^2}(X) + \mathcal {P}_f(X)^2\right) \nonumber \\&\ll _{B,C} \frac{(\log Q_1)^{1/3}}{P_1^{1/6-\eta }} \mathcal {P}_f(X)^2, \end{aligned}$$
(4.2)

since \(\sum _j P_j^{-1} \ll P_1^{-1}\) and \(H(f;X)^{-1} \mathcal {P}_{f^2}(X) \ll _{B,C} \mathcal {P}_f(X)^2\).

We next consider the contribution from the main terms. When \(j = 1\), since \(v/H_1 \le \log Q_1 = \log h_0\), we have

$$\begin{aligned} \mathcal {M}_1&\le H_1\log Q_1\sum _{v \in \mathcal {I}_1} e^{-2\alpha _1 v/H_1} \int _{-X/h}^{X/h} |R_{v,H_j}(1+it)|^2 \hbox {d}t \\&\ll _{B,C} H_1\log Q_1\sum _{v \in \mathcal {I}_1} e^{-2\alpha _1 v/H_1} \left( \mathcal {P}_f(X)^2+ \frac{e^{v/H_1}}{h_0H(f;X)} \mathcal {P}_{f^2}(X)\right) \\&\ll _{B,C} \frac{H_1^2\log Q_1}{P_1^{2\alpha _1}}\mathcal {P}_{f}(X)^2, \end{aligned}$$

using Lemma 4.1 (b) and treating \(\mathcal {P}_{f^2}(X)\) using (4.1). Since \(H_1^2\log Q_1 = P_1^{1/3-2\eta }(\log Q_1)^{1/3} \le P_1^{1/3-\eta }\), \(P_1^{2\alpha _1} \ge P_1^{1/2-3\eta }\) and \(\eta \in (0,1/12)\), we get

$$\begin{aligned} \mathcal {M}_1 \ll P_1^{-1/6+2\eta } \mathcal {P}_{f}(X)^2. \end{aligned}$$

Let now \(2 \le j \le J\), if \(J \ge 2\). By definition, we have

$$\begin{aligned} \mathcal {T}_j = \bigcup _{r \in \mathcal {I}_{j-1}} \mathcal {T}_{j,r}, \end{aligned}$$

where \(\mathcal {T}_{j,r}\) is the set of all \(t \in \mathcal {T}_j\) such that \(|Q_{r,H_{j-1}}(1+it) |> e^{-\alpha _{j-1} r/H_{j-1}}\). Pointwise bounding \(|Q_{v,H_j}(1+it) |\) for each \(v \in \mathcal {I}_j\) leads to

$$\begin{aligned}&\mathcal {M}_j\le H_j \log Q_j\sum _{v \in \mathcal {I}_j} \sum _{r \in \mathcal {I}_{j-1}} e^{-2\alpha _j v/H_j} \int _{\mathcal {T}_{j,r}} |R_{v,H_j}(1+it)|^2 \hbox {d}t \\&\le (H_j \log Q_j)|\mathcal {I}_j||\mathcal {I}_{j-1}|e^{-2v_0 \alpha _j + 2\ell _j r_0 \alpha _{j-1}} \int _{-X/h}^{X/h} |Q_{r_0,H_{j-1}}(1+it)^{\ell } R_{v,H_j}(1+it)|^2 \hbox {d}t, \end{aligned}$$

where \((r_0,v_0) \in \mathcal {I}_{j-1} \times \mathcal {I}_j\) yield the maximal contribution among all such pairs, and \(\ell _j := \lceil \frac{v/H_j}{r/H_{j-1}}\rceil \). Using Lemma 4.4, we get

$$\begin{aligned} \mathcal {M}_j \ll _{B,C} (H_j \log Q_j)^3 e^{-2v_0\alpha _j + 2\ell _j r_0 \alpha _{j-1}} \exp \left( 2\ell \log (2B\ell )\right) \left( 1 + \frac{1}{h_0}\right) \mathcal {P}_{f}(X)^2. \end{aligned}$$

Minor modifications to the estimates in [26, Sec. 8.2] (with \(h_0\) in place of h there), selecting \(h_0\) sufficiently large in terms of B, show that

$$\begin{aligned} \mathcal {M}_j \ll _{B,C} \frac{1}{j^2P_1}\mathcal {P}_{f}(X)^2, \end{aligned}$$

whence it follows that

$$\begin{aligned} \sum _{2 \le j \le J} \mathcal {M}_j \ll P_1^{-1} \mathcal {P}_{f}(X)^2 \end{aligned}$$

(the requirements of our parameters \(P_j,Q_j\) and \(\alpha _j\) summarized in Remark 4.6 are sufficient for this).

Finally, we consider \(\mathcal {U}\). Set \(H := (\log X)^{\kappa }\), \(P = \exp ((\log X)^{1-\kappa })\) and \(Q = \exp (\log X/\log \log X)\), put \(\mathcal {I} := [\left\lfloor H\log P\right\rfloor , H\log Q] \cap \mathbb {Z}\), and define \(Q_{v,H}\) and \(R_{v,H}\) by

$$\begin{aligned} Q_{v,H}(s)&:= \sum _{\begin{array}{c} P \le p \le Q \\ e^{v/H} \le p \le e^{(v+1)/H} \end{array}} f(p)p^{-s}, \\ R_{v,H}(s)&:= \sum _{\frac{1}{3}Xe^{-v/H} <m \le Xe^{-v/H}} \frac{f(m)}{m^s(1+\omega _{[P,Q]}(m))}. \end{aligned}$$

Combining Lemma 4.3 with 4.1 a) and the proof of Lemma 4.7 to control those n coprime to \(P \le p \le Q\), we get that there is some \(v_0 \in \mathcal {I}\) such that

$$\begin{aligned}&\int _{\mathcal {U}} |F(1+it) |^2 \hbox {d}t \nonumber \\&\quad \ll _{B,C} (H \log X)^2 \int _{\mathcal {U}} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2 \hbox {d}t \nonumber \\&\qquad + \int _{-T}^T \left|\sum _{\begin{array}{c} X/3 < n \le X \\ (n,[P,Q]) = 1 \end{array}} \frac{f(n)}{n^{1+it}}\right|^2 \hbox {d}t + \mathcal {P}_f(X)^2\left( 1+\frac{1}{h_0}\right) \left( \frac{1}{H} + \frac{1}{P}\right) \nonumber \\&\quad \ll _{B,C} (H \log X)^2 \int _{\mathcal {U}} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2 \hbox {d}t \nonumber \\&\qquad + \mathcal {P}_f(X)^2\left( \frac{1}{H} + \frac{1}{P}+ \left( \frac{\log P}{\log Q}\right) ^A\right) \nonumber \\&\quad \ll _{B,C} (H \log X)^2 \int _{\mathcal {U}} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2 \hbox {d}t \nonumber \\&\qquad + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\mathcal {P}_f(X)^2, \end{aligned}$$
(4.3)

As in [26, Sec. 8.3] we may select a discrete subset \(\mathcal {V} \subset \mathcal {U}\) that is well spaced, such that

$$\begin{aligned} \int _{\mathcal {U}} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2 \hbox {d}t \ll \sum _{t \in \mathcal {V}} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2. \end{aligned}$$

By assumption, for each \(t \in \mathcal {V}\) we have \(|Q_{r_0,H}(1+it)|> e^{-\alpha _J r_0/H_J} \ge P_J^{-\alpha _J}\), for some \(r_0 \in \mathcal {I}_J\). We have \(\log Q_{J+1} \ge \sqrt{\log X}\) by definition, and (as mentioned in Remark 4.6) \(\log P_J \ge \frac{4B}{\eta } \log \log Q_{J+1}\), whence \((\log X)^{2B/\eta } \le P_J \le Q_J \le \exp (\sqrt{\log X})\). Applying Lemma 4.2(b) for each \(r_0 \in \mathcal {I}_J\), we thus have

$$\begin{aligned} |\mathcal {V}|&\ll _B |\mathcal {I}_J |\exp \left( 2\alpha _J(\log P_J) \left( 1+\frac{\log X}{\log P_J}\right) + 2B \frac{\log X \log \log X}{\log P_J}\right) \\&\le X^{1/2-2\eta + o(1)} \cdot X^{\eta } = X^{1/2-\eta + o(1)}. \end{aligned}$$

We now split the set \(\mathcal {V}\) into the subsets

$$\begin{aligned} \mathcal {V}_S&:= \{t \in \mathcal {V} : |Q_{v_0,H}(1+it) |\le (\log X)^{-\frac{1}{2}B^2 - 10}\} \\ \mathcal {V}_L&:= \{t \in \mathcal {V} : |Q_{v_0,H}(1+it)|> (\log X)^{-\frac{1}{2}B^2 - 10}\}; \end{aligned}$$

the exponent \(B^2/2\) is present in order to cancel the \(\log X\) power that arises from

$$\begin{aligned} \mathcal {P}_{f^2}(X) \ll _B H(f;X) \mathcal {P}_f(X)^2 \ll _B (\log X)^{B^2} \mathcal {P}_f(X)^2. \end{aligned}$$

By a pointwise bound, Lemma 4.1(c) and the above estimate for \(|\mathcal {V} |\ge |\mathcal {V}_S |\), we obtain

$$\begin{aligned}&\sum _{t \in \mathcal {V}_S} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it)|^2 \\&\quad \ll (\log X)^{-B^2-19}(1+|\mathcal {V}_S |X^{-1/2}) \frac{e^{v_0/H}}{X}\sum _{X/(3e^{v_0/H}) < n \le X/e^{v_0/H}} |f(n) |^2 \\&\quad \ll _{B,C} (\log X)^{-B^2-19} \mathcal {P}_{f^2}(X) \ll _B (\log X)^{-19} \mathcal {P}_f(X)^2. \end{aligned}$$

Consider next the contribution from \(\mathcal {V}_L\). Applying Lemma 4.2(b) once again, this time using the condition \(|Q_{v_0,H}(1+it) |> (\log X)^{-\frac{1}{2}B^2-10}\), to obtain

$$\begin{aligned} |\mathcal {V}_L |&\ll _B \exp \left( (B^2+20) \left( \log \log X\right) \left( 1 + \frac{\log X}{\log P}\right) + 2B \frac{\log X \log \log X}{\log P}\right) \\&= \exp \left( (\log X)^{\kappa + o_B(1)}\right) . \end{aligned}$$

Recall that \(\Delta = (2B+5) \kappa \in (0,1)\). Applying Lemma 3.5 (with \(Z = 1/\delta = (\log X)^{\Delta }\)) to bound \(R_{v_0,H}(1+it)\) pointwise in t, together with Lemma 4.2(a) to estimate \(Q_{v_0,H}(1+it)\) in mean square, noting that \(\kappa < 1/3-\kappa \), we obtain

$$\begin{aligned}&\sum _{t \in \mathcal {V}_L} |Q_{v_0,H}(1+it)R_{v_0,H}(1+it) |^2 \\&\ll _{A,B,C} \mathcal {P}_{f}(X)^2\left( \left( \frac{\log Q}{\log P}\right) ^{B}\delta ^{1/2} + \left( \frac{\log Q}{\log P}\right) ^{3B}\frac{\log \log X}{(\log X)^{\sigma }} \right) ^2 \sum _{t \in \mathcal {V}_L} |Q_{v_0,H}(1+it)|^2 \\&\ll _B \frac{\mathcal {P}_{f}(X)^2}{(\log P)^2} \left( (\log X)^{2B\kappa -\Delta } + (\log X)^{6B\kappa -2\sigma +o(1)}\right) \\&\ll _B \mathcal {P}_{f}(X)^2\left( (\log X)^{2(B+1)\kappa - 2 -\Delta } + (\log X)^{(6B+2)\kappa -2-2\sigma +o(1)}\right) . \end{aligned}$$

Combining this estimate with the one for \(\mathcal {V}_S\), then plugging this back into our estimate (4.3), we get

$$\begin{aligned}&\int _{\mathcal {U}}|F(1+it) |^2 \hbox {d}t\\&\quad \ll _{A,B,C} (\log X)^{2+2\kappa } \left( (\log X)^{2(B+1)\kappa - 2 - \Delta } + (\log X)^{(6B+2)\kappa - 2-2\sigma + o(1)}\right) \mathcal {P}_f(X)^2 \\&\qquad + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\mathcal {P}_{f}(X)^2 \\&\quad \ll \left( (\log X)^{2(B+2)\kappa -\Delta } + (\log X)^{(6B+4)\kappa -2\sigma } + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \mathcal {P}_{f}(X)^2 \\&\quad \ll \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\mathcal {P}_{f}(X)^2, \end{aligned}$$

since \(2(B+2) \kappa - \Delta = -\kappa \), and \(\sigma \ge {\hat{\sigma }} > (3B+5/2)\kappa \) by definition. This completes the proof of Proposition 4.8.

Proof of Theorem 2.1

Let \(f \in \mathcal {M}(X;A,B,C;\gamma ,\sigma )\). Set \(h := h_1/(\log h_0)^A\), and select \(P_1 = (\log h)^{40B/\eta }\) and \(Q_1 = h\). We may assume that X is larger than any constant depending on B, since otherwise Theorem 2.1 follows with a sufficiently large implied constant; we may also assume h is larger than any constant depending on B, since otherwise the theorem follows (again with a large enough implied constant depending at most on B) from Remark 1.8 and Lemma 4.7 (taking \(P = Q = 3/2\), say).

By Lemma 4.7, we have

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^{X} \left|\frac{1}{h_1} \sum _{x-h_1< m \le x} f(m) - \frac{1}{h_1}\int _{x-h_1}^x u^{it_0} \hbox {d}u \cdot \frac{1}{h_2} \sum _{\begin{array}{c} x-h_2< m \le x \end{array}} \frac{f(m)}{m^{it_0}}\right|^2 \hbox {d}x \\&\quad \ll _{A,B,C} \frac{2}{X}\int _{X/2}^{X}\left|\frac{1}{h_1} \sum _{\begin{array}{c} x-h_1< m \le x \\ m \in \mathcal {S} \end{array}} f(m) - \frac{1}{h_1}\int _{x-h_1}^x u^{it_0} \hbox {d}u \cdot \frac{1}{h_2} \sum _{\begin{array}{c} x-h_2 < m \le x \\ m \in \mathcal {S} \end{array}} \frac{f(m)}{m^{it_0}}\right|^2 \hbox {d}x\\&\qquad +\left( \frac{\log \log h_0}{\log h_0}\right) ^A \mathcal {P}_{f}(X)^2. \end{aligned}$$

Set \(\delta := (\log X)^{-(2B+5)\kappa }\) once again, and note that \(t_0(fn^{-it_0},X) = 0\) is admissible. Thus,

$$\begin{aligned} \sum _{\begin{array}{c} X/3 < n \le X \\ n \in \mathcal {S} \end{array}} \frac{f(n)n^{-it_0}}{n^s} = F(s+it_0). \end{aligned}$$

Set \(I(x;t,h) := h^{-1} \int _{x-h}^x u^{it} \hbox {d}u\). By the Cauchy–Schwarz inequality and the trivial bound \(\vert I(x;t,h) \vert \le 1\), we obtain

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^{X} \left|\frac{1}{h_1} \sum _{\begin{array}{c} x-h_1< m \le x \\ m \in \mathcal {S} \end{array}} f(m) - I(x;t_0,h_1) \cdot \frac{1}{h_2} \sum _{\begin{array}{c} x-h_2< m \le x \\ m \in \mathcal {S} \end{array}} f(m)m^{-it_0}\right|^2 \hbox {d}x \\&\quad \ll \frac{1}{X} \int _{X/2}^{X} \left|\frac{1}{h_1} \sum _{\begin{array}{c} x-h_1< m \le x \\ m \in \mathcal {S} \end{array}} f(m) - \frac{1}{2\pi }\int _{I_{\delta }} F(1+it) \frac{x^{1+it} - (x-h_1)^{1+it}}{h_1(1+it)}\hbox {d}t \right|^2 \hbox {d}x\\&\qquad + \frac{1}{X} \int _{X/2}^{X} \left|\frac{1}{h_2}\sum _{\begin{array}{c} x-h_2< m \le x \\ m \in \mathcal {S} \end{array}} \frac{f(m)}{m^{it_0}} - \frac{1}{2\pi }\int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t+t_0)) \frac{x^{1+it} - (x-h_2)^{1+it}}{h_2(1+it)}\hbox {d}t \right|^2 \hbox {d}x\\&\qquad + \max _{X/2 < x \le X} \left| \int _{I_{\delta }} F(1+it) \frac{x^{1+it} - (x-h_1)^{1+it}}{h_1(1+it)} \hbox {d}t \right. \\&\qquad \left. - I(x;t_0,h_1) \int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t+t_0)) \frac{x^{1+it}-(x-h_2)^{1+it}}{h_2(1+it)}\hbox {d}t \right| ^2\\&\quad =: \mathcal {I}_1 + \mathcal {I}_2 + \mathcal {I}_3. \end{aligned}$$

Consider \(\mathcal {I}_3\) first. Making a change of variables \(w = t-t_0\) and using \(u^{iw} = x^{iw} + O(\delta ^{-1} h_1/X)\) for \(|w |\le \delta ^{-1}\) and \(u \in [x-h_1,x]\), we see that

$$\begin{aligned}&\frac{1}{h_1}\int _{I_{\delta }} F(1+it)\frac{x^{1+it}-(x-h_1)^{1+it}}{1+it} \hbox {d}t = \int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t_0+w)) I(x;t_0+w,h_1) \hbox {d}w \\&\quad = I(x;t_0,h_1) \int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t_0+w)) x^{iw} \hbox {d}w + O\left( \delta ^{-2}\frac{h_1}{X}\max _{|w |\le \delta ^{-1}} |F(1+i(t_0+w)) |\right) . \end{aligned}$$

Similarly, we have

$$\begin{aligned}&\frac{1}{h_2} \int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t+t_0)) \frac{x^{1+it}-(x-h_2)^{1+it}}{1+it}\hbox {d}t \\&\quad = \int _{-\delta ^{-1}}^{\delta ^{-1}} F(1+i(t+t_0)) x^{it} \hbox {d}t + O\left( \delta ^{-2} \frac{h_2}{X} \max _{|t |\le \delta ^{-1}} |F(1+i(t+t_0)) |\right) . \end{aligned}$$

Applying partial summation, dropping the condition \(n \in \mathcal {S}\), and then using Lemma 3.2, we find

$$\begin{aligned} \max _{|t |\le \delta ^{-1}} |F(1+i(t+t_0)) |\ll \frac{1}{X} \sum _{X/3 < n \le X} |f(n) |\ll _{B,C} \mathcal {P}_f(X), \end{aligned}$$

and thus, as \(h_1 \le h_2 = X/(\log X)^{{\hat{\sigma }}/2}\), we obtain

$$\begin{aligned} \mathcal {I}_3 \ll _{B,C} \left( \delta ^{-2}\frac{h_2}{X}\right) ^2 \mathcal {P}_f(X)^2 \ll (\log X)^{4(2B+5) \kappa - (8 B + 21) \kappa } \mathcal {P}_{f}(X)^2 = (\log X)^{-\kappa } \mathcal {P}_{f}(X). \end{aligned}$$

Next, we treat \(\mathcal {I}_1\) and \(\mathcal {I}_2\). Applying Proposition 4.5 to each of these integrals and trivially bounding the u integral in \(\mathcal {I}_2\), we find

$$\begin{aligned} \mathcal {I}_1 + \mathcal {I}_2&\ll \int _{[-X/h_1,X/h_1] \backslash I_{\delta }} |F(1+it) |^2\hbox {d}t + \max _{T \ge X/h_1} \frac{X}{h_1T} \int _T^{2T} |F(1+it) |^2 \hbox {d}t. \end{aligned}$$

By the argument in Remark 4.9 and our choice of h, the latter is bounded by

$$\begin{aligned} \ll \int _{[-X/h,X/h] \backslash I_{\delta }} |F(1+it) |^2 \hbox {d}t + (\log h_0)^{-A} \mathcal {P}_{f}(X)^2. \end{aligned}$$

But by Proposition 4.8, this integral is bounded by

$$\begin{aligned}&\ll _{A,B,C} \left( \frac{(\log Q_1)^{1/3}}{P_1^{1/6-\eta }} + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \mathcal {P}_{f}(X)^2 \\&\quad \ll \left( (\log h)^{-30B} + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}}\right) \mathcal {P}_f(X)^2. \end{aligned}$$

Combining these steps, and using \(A \le B\) and \(\log h \asymp \log h_1\), we obtain

$$\begin{aligned}&\frac{2}{X}\int _{X/2}^{X} \left|\frac{1}{h} \sum _{x-h_1< m \le x} f(m) - \frac{1}{h_1}\int _{x-h_1}^x u^{it_0} \hbox {d}u \cdot \frac{1}{h_2} \sum _{x-h_2 < m \le x} f(m)m^{-it_0}\right|^2 \hbox {d}x \\&\quad \ll _{A,B,C} \left( \left( \frac{\log \log h_0}{\log h_0}\right) ^A + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\min \{1,A\}} \right) \mathcal {P}_{f}(X)^2, \end{aligned}$$

which completes the proof.

5 Applications

5.1 Proof of Theorem 1.4

Let f be a primitive, Hecke-normalized holomorphic cusp form without complex multiplication of fixed even weight \(k \ge 2\) and level 1. Write the Fourier expansion of f at \(\infty \) as

$$\begin{aligned} f(z) = \sum _{n \ge 1} \lambda _f(n) n^{\frac{k-1}{2}} e(nz), \quad \quad \text {Im}(z) > 0, \end{aligned}$$

where \(\{\lambda _f(n)\}_n\) is the sequence of normalized Fourier coefficients with \(\lambda _f(1) = 1\). As noted in Sect. 1.3.2, \(\lambda _f\) is a multiplicative function. Deligne’s proof of the Ramanujan conjecture for f shows that \(|\lambda _f(p) |\le 2\) and \(|\lambda _f(n) |\le d(n)\) for all primes p and positive integers n. Moreover, the quantitative Sato–Tate theorem of Thorner [42], which is based on the deep results of Newton and Thorne [30], shows that for any \([a,b] \subseteq [-2,2]\),

$$\begin{aligned} |\{p \le X: \lambda _f(p) \in [a,b]\} |= \left( \frac{1}{\pi } \int _a^b \sqrt{1-(v/2)^2} \hbox {d}v\right) \int _2^X \frac{\hbox {d}t}{\log t} + O\left( \frac{X\log (k\log X)}{(\log X)^{3/2}}\right) . \end{aligned}$$
(5.1)

Recall that

$$\begin{aligned} c_\alpha = \frac{2^\alpha }{\sqrt{\pi }} \frac{\Gamma \left( \frac{\alpha + 1}{2}\right) }{\Gamma (\alpha /2+2)}. \end{aligned}$$

Using this data, we will prove the following.

Proposition 5.1

Let \(\alpha > 0\) and \(\varepsilon \in (0,1/2)\). There is a constant \(\delta = \delta (\alpha ) > 0\) such that \(|\lambda _f |^{\alpha } \in \mathcal {M}(X;c_{\alpha },2^{\alpha },2;1/2-\varepsilon ,\delta )\).

Using Proposition 5.1, we will be able to apply Theorem 1.7 in order to derive Corollary 1.1.

We will check that \(|\lambda _f |^\alpha \) satisfies the required hypotheses in the following lemmas.

Lemma 5.2

For any \(2 \le z < w\), we have

$$\begin{aligned} \sum _{z< p \le w} \frac{|\lambda _f(p) |^\alpha }{p} = c_\alpha \sum _{z < p \le w} \frac{1}{p} + O((\log z)^{-1/2+o(1)}). \end{aligned}$$

Similarly, we have

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^{2\alpha }}{p} = c_{2\alpha } \log \log X + O(1). \end{aligned}$$

Proof

Let \(\beta \in \{\alpha ,2\alpha \}\). By partial summation,

$$\begin{aligned} \sum _{z< p \le w} \frac{|\lambda _f(p) |^\beta }{p} = \int _0^2 u^{\beta } d\{\sum _{\begin{array}{c} z< p \le w \\ |\lambda _f(p) |\le u \end{array}} \frac{1}{p}\} = 2^\beta \sum _{z< p \le w} \frac{1}{p} - \beta \int _0^2 \left( \sum _{\begin{array}{c} z < p \le w \\ |\lambda _f(p) |\le u \end{array}} \frac{1}{p}\right) u^{\beta -1} \hbox {d}u. \end{aligned}$$

Fix \(u \in (0,2]\), and let \(I_u := [0,u] \cup [-u,0]\) so that \(|\lambda _f(p) |\le u\) if and only if \(\lambda _f(p) \in I_u\). By partial summation and (5.1),

$$\begin{aligned} \sum _{\begin{array}{c} z < p \le w \\ \lambda _f(p) \in I_u \end{array}} \frac{1}{p}&= \frac{2}{\pi } \int _0^u \sqrt{1-(v/2)^2} \hbox {d}v \cdot \int _z^w \frac{dy}{y \log y} + O\left( \frac{\log \log z}{(\log z)^{3/2}} + \int _z^w \frac{\log \log y \, dy}{y(\log y)^{3/2}}\right) \\&= \left( \frac{2}{\pi } \int _0^u \sqrt{1-(v/2)^2} \hbox {d}v\right) \log (\log w/\log z) + O((\log z)^{-1/2+o(1)}). \end{aligned}$$

Multiplying the main term by \(\beta u^{\beta -1}\) and integrating in u, we obtain \(I_\beta \log (\log w/\log z) + O(1/\log z)\), where

$$\begin{aligned} I_\beta&:= \frac{2\beta }{\pi } \int _0^2 u^{\beta -1} \int _0^u \sqrt{1-(v/2)^2} \hbox {d}v \hbox {d}u = \frac{2\beta }{\pi } \int _0^2 \left( \int _v^2 u^{\beta -1} \hbox {d}u \right) \sqrt{1-(v/2)^2} \hbox {d}v \\&= \frac{2^{\beta +1}}{\pi }\int _0^2 (1-(v/2)^\beta ) \sqrt{1-(v/2)^2} \hbox {d}v = 2^{\beta } - \frac{2^{\beta +1}}{\pi } \int _0^2 (v/2)^{\beta }\sqrt{1-(v/2)^2} \hbox {d}v. \end{aligned}$$

Making the change of variables \(t := (v/2)^2\), we find that

$$\begin{aligned}{} & {} 2^{\beta }-I_{\beta } = \frac{2^{\beta +1}}{\pi } \int _0^1 t^{(\beta -1)/2} (1-t)^{1/2} \hbox {d}t = \frac{2^{\beta +1}}{\pi } \frac{\Gamma \left( \frac{\beta + 1}{2}\right) \Gamma (3/2)}{\Gamma (\beta /2 + 2)}\\ {}{} & {} = \frac{2^{\beta }}{\sqrt{\pi }} \frac{\Gamma \left( \frac{\beta +1}{2}\right) }{\Gamma (\beta /2+2)} = c_{\beta }. \end{aligned}$$

It follows, therefore, that when \(\beta \in \{\alpha ,2\alpha \}\),

$$\begin{aligned} \sum _{z< p \le w} \frac{|\lambda _f(p) |^{\beta }}{p}&= I_{\beta } \sum _{z< p \le w} \frac{1}{p} + O((\log z)^{-1/2+o(1)}) \\&= c_{\beta } \sum _{z < p \le w} \frac{1}{p} + O((\log z)^{-1/2+o(1)}). \end{aligned}$$

and both claims follow. \(\square \)

To obtain uniform lower bound estimates for \(\rho (|\lambda _f |^{\alpha },n^{it};X)^2\), we will need some control over the product \(|\lambda _f(p) |^\alpha (1-\cos (t\log p))\), on average over p. In some ranges of t, this is furnished by the following lemma.

Lemma 5.3

Let \(|t |\ge 1\). There is a constant \(c = c(\alpha ) > 0\) such that if \(Y \ge (|t |+3)^2\) and Y is sufficiently large then

$$\begin{aligned} \sum _{Y < p \le 2Y} |\lambda _f(p) |^\alpha |1-p^{it}|^2 \ge c\frac{Y}{\log Y}. \end{aligned}$$

Proof

We adapt an argument due to Goldfeld and Li [4, Lem. 12.12 and 12.15] and Humphries [16, Lem. 2.1]. Let \(\eta \in (0,1/2)\) be a parameter to be chosen later. Using the Sato–Tate law, we have

$$\begin{aligned} |\{Y < p \le 2Y : |\lambda _f(p) |> \eta \}|&= \left( 1-\frac{2}{\pi } \int _{-\eta }^\eta \sqrt{1-(u/2)^2} \hbox {d}u - o(1)\right) \frac{Y}{\log Y} \nonumber \\&\ge \left( 1-\frac{4\eta }{\pi }-o(1)\right) \frac{Y}{\log Y}. \end{aligned}$$
(5.2)

Next, we estimate the cardinality

$$\begin{aligned} |\{Y< p \le 2Y : |1-p^{it} |\le \eta \}|&= |\{Y < p \le 2Y : |\sin ((t\log p)/2) |\le \eta /2\}|. \end{aligned}$$

Set \(\beta := \sin ^{-1}(\eta /2)/\pi \in [0,1/2]\), Whenever \(\sin (t\log p/2) \in [-\eta /2, \eta /2]\) there is \(m \in \mathbb {Z}\) such that \((t \log p)/2 \in [\pi (m - \beta ), \pi (m + \beta )]\). By Jordan’s inequality, \(\beta \le \frac{1}{2} \sin ( \pi \beta ) = \frac{\eta }{4}\), and we see that

$$\begin{aligned} |\{Y< p \le 2Y : |1-p^{it} |\le \eta \}|\le |\{Y < p \le 2Y : \Vert (t\log p)/(2\pi )\Vert \le \eta /4\}|, \end{aligned}$$

where \(\Vert t\Vert := \min _{m \in \mathbb {Z}} \vert t-m \vert \). Splitting up the primes \(Y < p \le 2Y\) according to the nearest integer m to \((t\log p)/(2\pi )\), the latter may be bounded above as

$$\begin{aligned} \le \sum _{\frac{|t |\log Y-\pi \eta /2}{2\pi } \le m \le \frac{|t |\log (2Y) + \pi \eta /2}{2\pi }} \left( \pi \left( e^{\frac{2\pi m+\pi \eta /2}{|t |}}\right) - \pi \left( e^{\frac{2\pi m-\pi \eta /2}{|t |}}\right) \right) . \end{aligned}$$

For each m, we have \(e^{\frac{2\pi m+\pi \eta /2}{|t |}} \le \left( 1+\frac{\pi \eta }{|t |}\right) e^{\frac{2\pi m-\pi \eta /2}{|t |}}\). By the Brun–Titchmarsh theorem, we get, uniformly over all m in the sum,

$$\begin{aligned} \pi \left( e^{\frac{2\pi m+\pi \eta /2}{|t |}}\right) - \pi \left( e^{\frac{2\pi m-\pi \eta /2}{|t |}}\right)&\le \frac{2\pi \eta }{|t |} \frac{e^{2\pi (m-\eta /4)/|t |}}{2\pi (m-\eta /4)/|t |-\log (|t |/\eta )} \\&\le 2\pi \eta \frac{2Y}{|t |(\log Y - (\log Y)/2)} \le 16\pi \eta \frac{Y}{|t |\log Y}, \end{aligned}$$

for Y large enough. Since there are \(\le 1+ |t |(\log (2Y)-\log Y)/(2\pi ) \le 2|t |\) integers in the range of summation, we obtain

$$\begin{aligned} |\{Y < p \le 2Y : |1-p^{it} |\le \eta \}|\le 32\pi \eta \frac{Y}{\log Y}. \end{aligned}$$
(5.3)

We deduce from (5.2) and (5.3) that

$$\begin{aligned}&|\{Y< p \le 2Y : |\lambda _f(p) |> \eta \text { and } |1-p^{it} |> \eta \}|\\&\quad \ge |\{Y< p \le 2Y : |\lambda _f(p) |> \eta \}|- |\{Y < p \le 2Y : |1-p^{it} |\le \eta \}|\\&\quad \ge \max \left\{ 0, 1-\eta \left( \frac{4}{\pi } + 32\pi \right) -o(1)\right\} \cdot \frac{Y}{\log Y}. \end{aligned}$$

Selecting \(\eta = \frac{1}{250}\), say, we get that if Y is sufficiently large,

$$\begin{aligned} |\{Y < p \le 2Y : |\lambda _f(p) |&> \eta \text { and } |1-p^{it} |> \eta \}|\ge \frac{Y}{2 \log Y}. \end{aligned}$$

Finally, we obtain that

$$\begin{aligned} \sum _{Y< p \le 2Y} |\lambda _f(p) |^{\alpha } |1-p^{it} |^2&> \eta ^{2+\alpha }|\{Y < p \le 2Y : |\lambda _f(p) |> \eta \text { and } |1-p^{it} |> \eta \}|\\&\ge \frac{\eta ^{2+\alpha }}{2} \cdot \frac{Y}{\log Y}, \end{aligned}$$

which proves the claim with \(c = \eta ^{2+\alpha }/2\). \(\square \)

We now obtain lower bounds for \(\rho (|\lambda _f |^\alpha ,n^{it};X)^2\) for all \(|t |\le X\).

Lemma 5.4

There is a \(\delta = \delta (\alpha ) > 0\) such that whenever \(|t |\le X\) we have

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^\alpha (1- \cos (t\log p))}{p} \ge \delta \min \{\log \log X, \log (1+|t |\log X)\} - O(1). \end{aligned}$$

Moreover, we may select the minimizing \(t \in [-X,X]\) for \(\vert \lambda _f \vert ^2\) as \(t_0(|\lambda _f |^2,X) = 0\) (see the discussion surrounding (1.8) for the definition of \(t_0\)).

Proof

We may assume that X is sufficiently large, else the estimate given is trivial. When \(|t |\le 1/\log X\) the claim is vacuous. Thus, we may focus on the case \(1/\log X < |t |\le X\). We consider the ranges \(1/\log X < |t |\le 1\), \(1 < |t |\le \log X\) and \(\log X < |t |\le X\) separately. Throughout we will introduce an auxiliary parameter \(2 \le Y \le X\), chosen case by case, and use the inequality

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p} \ge \sum _{Y \le p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p}. \end{aligned}$$

Suppose first that \(1/\log X < |t |\le 1\). Let \(Y := e^{1/|t |}\) and write

$$\begin{aligned} R(X) := \sum _{p \le X} |\lambda _f(p) |^{\alpha } - c_{\alpha } \pi (X), \end{aligned}$$

so that by arguments analogous to those of Lemma 5.2, \(R(X) \ll X/(\log X)^{3/2-o(1)}\). By partial summation and Lemma 5.2,

$$\begin{aligned}&\sum _{Y \le p \le X} \frac{|\lambda _f(p) |^\alpha \cos (t\log p)}{p} \\&\quad = c_{\alpha } \int _Y^X \frac{\cos (t\log u)}{u} \frac{\hbox {d}u}{\log u} + O\left( \frac{1}{\log Y}\right) + \int _Y^X R(u) \left( \cos (t\log u) + t\sin (t\log u)\right) \frac{\hbox {d}u}{u^2} \\&\quad = c_{\alpha }\int _{1}^{|t |\log X} \cos ( tv/|t |) \frac{\hbox {d}v}{v} + O\left( (1+|t |)(\log Y)^{-1/2+o(1)}\right) \ll 1, \end{aligned}$$

the bound in the last step arising from setting \(v := |t |\log u\) and integrating by parts. Thus, in light of Lemma 5.2

$$\begin{aligned} \sum _{Y < p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p} = c_{\alpha }\log (1+ |t |\log X) - O(1). \end{aligned}$$

Next, we consider the intermediate range \(1 < |t |\le \log X\). Here, we set \(Y := (10\log X)^2\), employ a dyadic decomposition and apply Lemma 5.3 to obtain, when X is large enough,

$$\begin{aligned}&\sum _{p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p} \\ {}&\quad \ge \frac{1}{2} \sum _{Y< 2^j \le X/2} 2^{-(j+1)} \sum _{2^j<p \le 2^{j+1}} |\lambda _f(p) |^\alpha |1-p^{it} |^2 \ge \frac{c}{4\log 2} \sum _{Y < 2^j \le X/2} \frac{1}{j} \\&\quad = \frac{c}{4\log 2} \log \left( \frac{\log X}{\log Y}\right) - O(1) \ge \frac{c}{8\log 2} \log \log X - O(1), \end{aligned}$$

for some \(c = c(\alpha ) > 0\).

Finally, assume that \(\log X \le |t |\le X\). In this case, put \(Y := \exp \left( (\log X)^{2/3+\varepsilon }\right) \), where \(\varepsilon > 0\) is small. Let \(m \ge 1\) be an integer parameter to be chosen later. By Hölder’s inequality,

$$\begin{aligned}&\left|\sum _{Y< p \le X} \frac{|\lambda _f(p) |^\alpha \cos (t\log p)}{p}\right|\\&\quad \le \left( \sum _{Y< p \le X} \frac{|\lambda _f(p) |^{\frac{2\alpha m}{2m-1}}}{p}\right) ^{1-\frac{1}{2m}} \cdot \left( \sum _{Y < p \le X} \frac{\cos (t\log p)^{2m}}{p}\right) ^{\frac{1}{2m}}. \end{aligned}$$

We can bound \(|\lambda _f(p) |^{2\alpha m/(2m-1)} \le |\lambda _f(p) |^\alpha 2^{\alpha /(2m-1)}\), so that by Lemma 5.2 the first sum is

$$\begin{aligned} \le 2^{\alpha /(2m)} c_{\alpha }^{1-1/(2m)} (\log (\log X/\log Y))^{1-1/2m} + O_m(1). \end{aligned}$$

Now, we can write

$$\begin{aligned} \cos (t\log p)^{2m}&= 2^{-2m} (p^{it} + p^{-it})^{2m} \\&= 2^{-2m} \left( {\begin{array}{c}2m\\ m\end{array}}\right) + 2^{-2m} \sum _{0 \le j \le m-1} \left( {\begin{array}{c}2m\\ j\end{array}}\right) (p^{2i(m-j)t} +p^{-2i(m-j)t}). \end{aligned}$$

By the zero-free region of the Riemann zeta function (see e.g., [24, Lem. 2]), we have

$$\begin{aligned} \max _{1 \le |l |\le m} \left|\sum _{Y < p \le X} \frac{1}{p^{1+ilt}}\right|\ll \frac{\log X}{1+|t |} + (\log X)^{-10} \ll 1. \end{aligned}$$

It follows that

$$\begin{aligned} \sum _{Y < p \le X} \frac{\cos (t \log p)^{2m}}{p} = 2^{-2m} \left( {\begin{array}{c}2m\\ m\end{array}}\right) \log (\log X/\log Y) + O_m(1), \end{aligned}$$

and therefore in sum we have

$$\begin{aligned} \left|\sum _{Y < p \le X} \frac{|\lambda _f(p) |^\alpha \cos (t\log p)}{p}\right|\le c_{\alpha } \left( \frac{2^{\alpha }}{c_{\alpha }}\right) ^{\tfrac{1}{2m}} \left( 2^{-2m} \left( {\begin{array}{c}2m\\ m\end{array}}\right) \right) ^{\tfrac{1}{2m}} \log \left( \frac{\log X}{\log Y}\right) + O_m(1). \end{aligned}$$

Using the bounds \(\sqrt{2\pi n} (n/e)^n \le n! \le 2\sqrt{2\pi n} (n/e)^n\), valid for all \(n \in \mathbb {N}\) (see e.g., [31]), we get that

$$\begin{aligned} \left( \frac{2^{\alpha }}{c_{\alpha }}\right) ^{1/(2m)} \left( 2^{-2m} \left( {\begin{array}{c}2m\\ m\end{array}}\right) \right) ^{1/(2m)} \le \left( \frac{2^{\alpha +1}}{c_{\alpha }\sqrt{\pi m}}\right) ^{1/(2m)}, \end{aligned}$$

and thus taking \(m \ge m_0(\alpha )\), we obtain

$$\begin{aligned} \left|\sum _{Y < p \le X} \frac{|\lambda _f(p) |^\alpha \cos (t\log p)}{p}\right|\le 2^{-1/(2m)} c_{\alpha } \log (\log X/\log Y) + O(1). \end{aligned}$$

We thus obtain in this case that

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p} \ge c_\alpha (1-2^{-1/(2m)}) \left( \frac{1}{3}-\varepsilon \right) \log \log X - O(1). \end{aligned}$$

Combining our estimates from each of these ranges and putting \(\delta := c_\alpha \min \{c/(8\log 2), \frac{1}{4}(1-2^{-1/(2m)})\}\), we deduce that

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^\alpha (1-\cos (t\log p))}{p} \ge \delta \min \{\log \log X , \log (1+|t |\log X)\} - O(1). \end{aligned}$$

This completes the proof of the lower bound. \(\square \)

Proof of Proposition 5.1

Let X be large. By Deligne’s theorem we have \(|\lambda _f(p) |^\alpha \le 2^\alpha \) for all p. In addition, we have \(|\lambda _f(n) |^\alpha \le d(n)^\alpha \le d_{2^{\alpha +1}}(n)^{\max \{1,\alpha \}}\) for all n. By Lemma 5.2, we see that we can take \(A = c_\alpha \) and any \(\gamma \in (0,1/2)\) in an estimate of the form

$$\begin{aligned} \sum _{z< p \le w} \frac{|\lambda _f(p) |^\alpha }{p} \ge c_\alpha \sum _{z < p \le w} \frac{1}{p} - O\left( \frac{1}{(\log z)^{\gamma }}\right) \text { for } 2 \le z \le w \le X, \end{aligned}$$

and finally, by Lemma 5.4 there is a constant \(\delta > 0\) such that

$$\begin{aligned} \sum _{p \le X} \frac{|\lambda _f(p) |^\alpha -\text {Re}(|\lambda _f(p) |^\alpha p^{-it})}{p} \ge \delta \min \{ \log \log X, \log (1+|t-t_0 |\log X)\} - O(1), \end{aligned}$$

as \(t_0 =0\) is admissible. Thus, by definition, \(|\lambda _f |^\alpha \in \mathcal {M}(X; c_\alpha , 2^\alpha , \max \{1,\alpha \}; 1/2-\varepsilon ,\delta )\) for any \(\varepsilon \in (0,1/2)\) and X large, as claimed.\(\square \)

Proof of Theorem 1.4

In view of Proposition 5.1, we may apply Theorem 1.7 to the function \(|\lambda _f |^\alpha \). We see that if \(h = h_0 H(|\lambda _f |^\alpha ;X)\) and \(h_0 \rightarrow \infty \) then

$$\begin{aligned}&\frac{1}{X}\int _X^{2X} \left|\frac{1}{h} \sum _{x< n \le x+h} |\lambda _f(n) |^\alpha - \frac{1}{X}\sum _{X < n \le 2X} |\lambda _f(n) |^\alpha \right|^2 \hbox {d}x \\&\quad \ll \left( \left( \frac{\log \log h_0}{\log h_0}\right) ^{c_{\alpha }} + \frac{\log \log X}{(\log X)^{\theta }}\right) (\log X)^{2(c_{\alpha }-1)}, \end{aligned}$$

where \(\theta = \theta (\alpha ) > 0\). Furthermore, by Lemma 5.2, we have

$$\begin{aligned} H(|\lambda _f |^\alpha ;X) \asymp \exp \left( \sum _{p \le X} \frac{|\lambda _f(p) |^{2\alpha } - 2|\lambda _f(p) |^\alpha + 1}{p}\right) \asymp d_\alpha \log X, \end{aligned}$$

where \(d_\alpha = c_{2\alpha } - 2c_\alpha + 1\). Thus, changing \(h_0\) by a constant factor, we deduce that \(h = h_0 (\log X)^{d_\alpha }\) can be taken in the above estimate. The claim follows.\(\square \)

Proof of Corollary 1.1

When \(\alpha = 2\), we have \(c_2 = 1\) and \(d_2 = c_4 - 2c_2 + 1 = 1\). Hence, \(H(|\lambda _f |^2;X) \asymp \log X\). Since

$$\begin{aligned} c_f = \frac{1}{X}\sum _{X <n \le 2X} |\lambda _f(n) |^2 + O(X^{-2/5}), \end{aligned}$$

the claim for \(|\lambda _f |^2\) follows immediately from Theorem 1.4.

It remains to consider \(g_f(n) = \sum _{d^2 \mid n} |\lambda _f(n/d^2)|^2\). Clearly, \(g_f(n) \le \sum _{e \mid n} d(n/e)^2 \le d(n)^3\), and \(g_f(p) = |\lambda _f(p) |^2\) for all primes p. By Proposition 5.1, we have \(g_f \in \mathcal {M}(X; 1,4,3;1/2-\varepsilon ,\delta )\) for any \(\varepsilon \in (0,1/2)\), and \(H(g_f;X) = H(|\lambda _f |^2;X)\). The result now follows in the same way as for \(|\lambda _f |^2\), using

$$\begin{aligned} d_f = \frac{1}{X}\sum _{X < n \le 2X} g_f(n) + O(X^{-2/5}) \end{aligned}$$

in this case. \(\square \)

5.2 Proof of Theorem 1.2

Fix \(m \ge 2\), let \(\mathbb {A}\) denote the adeles over \(\mathbb {Q}\), and let \(\pi \) be a fixed cuspidal automorphic representation for \(GL_m(\mathbb {A})\) with unitary central character normalized so that it is trivial on the diagonally embedded copy of \(\mathbb {R}^+\). We write \(q_{\pi }\) to denote the conductor of \(\pi \). We assume that \(\pi \) satisfies GRC, and we write \(\lambda _{\pi }(n)\) to denote the nth coefficient of the standard L-function of \(\pi \). The key result of this subsection is the following analogue of Proposition 5.1.

Proposition 5.5

With the above notation, we have \(|\lambda _{\pi } |^2 \in \mathcal {M}(X; 1, m^2, 2)\) whenever X is sufficiently large in terms of \(q(\pi )\), and \(t_0(|\lambda _{\pi } |^2,X) = 0\) is admissible.

For primes \(p \not \mid q_{\pi }\), we have \(|\lambda _{\pi }(p) |^2 = \lambda _{\pi \otimes {\tilde{\pi }}}(p)\), where \({\tilde{\pi }}\) denotes the contragredient representation of \(\pi \) and \(\pi \otimes {\tilde{\pi }}\) is the Rankin–Selberg convolution of \(\pi \) and \({\tilde{\pi }}\). As \(\pi \) is fixed, the primes \(p \mid q_{\pi }\) will cause no harm to our estimates.

Lemma 5.6

There is a constant \(c = c(m) > 0\) such that

$$\begin{aligned} \sum _{p \le X} |\lambda _\pi (p) |^2 \log p = X + O_{\pi }(X e^{-c\sqrt{\log X}}) \text { as }X \rightarrow \infty . \end{aligned}$$

In particular, we have \(\sum _{z< p \le w} \frac{|\lambda _{\pi }(p) |^2}{p} = \sum _{z < p \le w} \frac{1}{p} + O_{\pi }(\frac{1}{\log z})\) for any \(z < p \le w\).

Proof

Assume X is sufficiently large relative to \(q_{\pi }\). Set \(f := \pi \otimes {\tilde{\pi }}\), and write \(\Lambda _{f,X}(n)\) to denote the nth coefficient of the logarithmic derivative \(-\frac{L'}{L}(s,f)\). Combining [18, Thm. 5.13] (see the remarks that follow the statement for a discussion relevant to the case of a Rankin–Selberg convolution) with [18, Exer. 6], we deduce that

$$\begin{aligned} \sum _{p \le X} |\lambda _{\pi }(p) |^2 \log p = \sum _{n \le X} \Lambda _{f,X}(n) + O_{\pi }(\sqrt{X} \log ^2 X) = X + O_{\pi }\left( X \exp \left( -c'm^{-4} \sqrt{\log X}\right) \right) , \end{aligned}$$

for some absolute constant \(c' > 0\) (note that the exceptional zero plays no role when X is large enough). This implies the first claim. The second follows immediately from the first statement by partial summation. \(\square \)

Proof of Proposition 5.5

Lemma 5.6 implies that (1.6) holds with \(A = 1\), and by GRC we have \(|\lambda _{\pi }(n) |^2 \le d_m(n)^2\). It thus follows that \(|\lambda _{\pi } |^2 \in \mathcal {M}(X;1,m^2,2)\), as claimed. \(\square \)

Proof of Theorem 1.2

Recall that m and \(\pi \) are fixed. A direct application of Theorem 1.7 shows (after replacing X by 2X and \(x-h\) by x) that there is \(\kappa = \kappa (m) > 0\) such that

$$\begin{aligned}&\frac{1}{X}\int _{X}^{2X} \left|\frac{1}{h}\sum _{x< n \le x+h} |\lambda _{\pi }(n) |^2 - \frac{1}{X}\sum _{X < n \le 2X} |\lambda _{\pi }(n) |^2\right|^2 \hbox {d}x \\&\quad \ll _m \left( \frac{\log \log h_0}{\log h_0} + \frac{\log \log X}{(\log X)^{\kappa }}\right) \mathcal {P}_{|\lambda _{\pi } |^2}(X)^2, \end{aligned}$$

where \(h = h_0 H(|\lambda _{\pi } |^2;X)\) and \(10 \le h_0 \le X/(10 H(|\lambda _{\pi } |^2;X))\). By Lemma 5.6\(\mathcal {P}_{|\lambda _{\pi } |^2}(X) \ll _m 1\). We also have

$$\begin{aligned} H(|\lambda _{\pi } |^2;X) \asymp _m \exp \left( \sum _{p \le X} \frac{|\lambda _{\pi }(p) |^4 - 2|\lambda _{\pi }(p) |^2 + 1}{p}\right)&\ll \exp \left( \sum _{p \le X} \frac{m^2 |\lambda _{\pi }(p) |^2 - 1}{p}\right) \\&\ll (\log X)^{m^2-1}. \end{aligned}$$

It follows that our variance estimate holds if \(h \ge h_0 (\log X)^{m^2-1}\) and \(10 \le h_0 \le X/(10(\log X)^{m^2-1})\), and the proof of the theorem is complete.\(\square \)

5.3 Proof of Corollary 1.6

Recall that

$$\begin{aligned} \Delta (n) := \max _{u \in \mathbb {R}} \sum _{ \begin{array}{c} d \mid n \\ e^u \le d < e^{u+1} \end{array}} 1. \end{aligned}$$

Given \(\theta \in \mathbb {R}\), write also

$$\begin{aligned} d(n,\theta ) := \sum _{d \mid n} d^{i\theta }. \end{aligned}$$

This is clearly a multiplicative function, with \(d(n) = d(n,0)\). In probabilistic terms, it is also d(n) times the characteristic function of the distribution function

$$\begin{aligned} \mathcal {D}_n(v) := \frac{1}{d(n)} \sum _{ \begin{array}{c} d \mid n \\ d \le e^v \end{array} } 1, \quad v \in \mathbb {R}. \end{aligned}$$

introduced in Sect. 1.3. The following general bounds for concentration functions in terms of characteristic functions allow us to relate \(\Delta (n)\) with integral averages of \(d(n,\theta )\).

Lemma 5.7

There are constants \(c_2> c_1 > 0\) such that, uniformly in \(n \in \mathbb {N}\),

$$\begin{aligned} c_1\frac{1}{d(n)} \int _0^1 |d(n,\theta ) |^2 \hbox {d}\theta \le \Delta (n) \le c_2\int _0^1 |d(n,\theta ) |\hbox {d}\theta . \end{aligned}$$

Proof

This is Exercise 279 in [39]. \(\square \)

By Lemma 5.7, we find that for any \(x \in [X/2,X]\) and \(10 \le h \le X\),

$$\begin{aligned} \sum _{x-h< n \le x} \Delta (n) \gg \int _0^1 \sum _{x-h < n \le x} \frac{|d(n,\theta ) |^2}{d(n)} \hbox {d}\theta . \end{aligned}$$
(5.4)

For \(\theta \in \mathbb {R}\) and \(n \in \mathbb {N}\), we write \(f_{\theta }(n) := |d(n,\theta ) |^2/d(n)\).

Corollary 5.8

Let \(\theta \in (1/\log X,1]\). Let \(10 \le h_0 \le X/\log X\) and put \(h := h_0 (\theta ^{-1} \log X)^{1/2}\). Then there is a constant \(\kappa _{1,2} > 0\) such that for any \(0< \kappa < \kappa _{1,2}\),

$$\begin{aligned} \frac{2}{X}\int _{X/2}^X \left|\frac{1}{h}\sum _{x-h< n \le x} f_{\theta }(n) - \frac{2}{X} \sum _{X/2 < n \le X} f_{\theta }(n)\right|^2 \hbox {d}x \ll \left( \frac{\log \log h_0}{\log h_0} + \frac{\log \log X}{(\log X)^{\kappa }}\right) , \end{aligned}$$

The implicit constant is independent of \(\theta \).

To this end, we prove that \(f_{\theta } \in \mathcal {M}(X;1,2,1)\) for all \(1/\log X < \theta \le 1\), which is the purpose of the following lemmas.

Lemma 5.9

Let \(\theta \in (0, 1]\), and let \(\beta := \min \{1/\theta ,\log X\}\). Then

$$\begin{aligned} \sum _{p \le X} \frac{f_{\theta }(p)}{p} = \log (\beta \log X) + O(1). \end{aligned}$$

Similarly,

$$\begin{aligned} H(f_{\theta };X) \asymp (\beta \log X)^{1/2}. \end{aligned}$$

Proof

Observe that for each p,

$$\begin{aligned} f_{\theta }(p) = \frac{1}{2}|1+p^{i\theta }|^2 = 1+\cos (\theta \log p). \end{aligned}$$

Put \(Y := \min \{X,\exp (1/\theta )\} = e^{\beta }\). For \(p \le Y\), we have \(\cos (\theta \log p) = 1 +O(\theta ^2(\log p)^2)\), so that by the prime number theorem,

$$\begin{aligned} \sum _{p \le Y} \frac{f_{\theta }(p)}{p} = \sum _{p \le Y} \frac{2}{p} + O\left( \theta ^2 \sum _{p \le e^{1/\theta }} \frac{(\log p)^2}{p}\right) = 2 \log (\min \{1/\theta ,\log X\}) + O(1). \end{aligned}$$

This proves the first claim if \(0 \le \theta \le 1/\log X\), so assume now that \(1/\log X < \theta \le 1\). By partial summation and the prime number theorem, we have

$$\begin{aligned} \sum _{Y < p \le X} \frac{1+\cos (\theta \log p)}{p}&= \int _1^{\theta \log X} (1+\cos v) \frac{\hbox {d}v}{v} + O(1) \\&= \sum _{1 \le k \le \tfrac{\theta \log X}{2\pi }} \int _{0}^{2\pi } (1+\cos v) \frac{\hbox {d}u}{u+2\pi k} + O(1) \\&= \left( \frac{1}{2\pi } \int _0^{2\pi } (1+\cos u) \hbox {d}u\right) \log (\theta \log X) + O(1) \\&= \log (\theta \log X) + O(1). \end{aligned}$$

We thus deduce that

$$\begin{aligned} \sum _{p \le X} \frac{f_{\theta }(p)}{p} = 2\log (1/\theta ) + \log (\theta \log X) = \log (\theta ^{-1} \log X), \end{aligned}$$

and the first claim follows for all \(\frac{1}{\log X} < \theta \le 1\) as well.

For the second claim, we simply note that

$$\begin{aligned} H(f_{\theta };X) \asymp \exp \left( \sum _{p \le X} \frac{(f_{\theta }(p)-1)^2}{p}\right) = \exp \left( \sum _{p \le X} \frac{\cos (\theta \log p)^2}{p}\right) . \end{aligned}$$

A similar partial summation argument shows that

$$\begin{aligned} \sum _{p \le X} \frac{\cos (\theta \log p)^2}{p}&= \log (\min \{\tfrac{1}{\theta },\log X\}) + \left( \frac{1}{2\pi } \int _0^{2\pi } (\cos u)^2 \hbox {d}u\right) \log (1+\theta \log X) + O(1) \\&= \frac{1}{2}\log (\min \{\log X, \tfrac{1}{\theta }\}\log X) + O(1), \end{aligned}$$

and the claim follows. \(\square \)

Lemma 5.10

Let \(\theta \in (0,1]\). Let \(2 \le z \le w \le X\). Then

$$\begin{aligned} \sum _{z< p \le w} \frac{f_{\theta }(p)}{p} \ge \sum _{z < p \le w} \frac{1}{p} + O(1/\log z). \end{aligned}$$

Proof

Set \(Y := \min \{X,e^{1/\theta }\}\) once again. If \(w \le Y\) then \(\cos (\theta \log p) \ge \cos (1) \ge 0\) for all \(z < p \le w\), and thus

$$\begin{aligned} \sum _{z< p \le w} \frac{f_{\theta }(p)}{p} \ge \sum _{z < p \le w} \frac{1}{p} + O(1/\log z). \end{aligned}$$

On the other hand, if \(Y \le z\) (so that \(\theta > 1/\log X\)) then by the same partial summation argument as in Lemma 5.9 we find that

$$\begin{aligned} \sum _{z< p \le w} \frac{f_{\theta }(p)}{p}&= \left( \frac{1}{2\pi } \int _0^{2\pi } (1+\cos u) \hbox {d}u\right) \log (\log w/\log z) + O(1/\log z) \\&= \sum _{z < p \le w} \frac{1}{p} + O(1/\log z). \end{aligned}$$

Finally, suppose \(z< Y < w\). In this case, we split the interval into the segments (zY] and (Yw] and apply the arguments in each of the previous two cases to obtain

$$\begin{aligned} \sum _{z< p \le w} \frac{f_{\theta }(p)}{p}&\ge \sum _{z< p \le Y} \frac{1}{p} + \sum _{Y< p \le w} \frac{1}{p} + O(1/\log z) \\&\ge \sum _{z < p \le w} \frac{1}{p} + O(1/\log z), \end{aligned}$$

as claimed. \(\square \)

Proof of Corollary 5.8

Let \(h = h_0 (\theta ^{-1} \log X)\). Note that \(|d(n,\theta ) |^2/d(n) \le d(n)\) uniformly over n, so that combined with Lemma 5.10 we have that \(f_{\theta } \in \mathcal {M}(X;1,2,1)\) for all \(\theta \in (1/\log X,1]\). Since \(H(f_{\theta };X) \ll (\theta ^{-1} \log X)^{1/2}\) uniformly over all \(\theta \in (1/\log X,1]\) by Lemma 5.9, the claim follows from Theorem 1.7.

Proof of Corollary 1.6

Let \(\delta \in (0,1]\), set \(Y := \exp \left( (\log X)^{\delta }\right) \) and put \(h = h_0 (\log X)^{(1+\delta )/2}\), with \(10 \le h_0 \le X/10(\log X)^{(1+\delta )/2}\). By Lemma 5.9, we have \(H(f_{\theta };X) \gg (\log X)^{(1+\delta )/2}\) for all \(1/\log Y < \theta \le 1\). By Fubini’s theorem, the Cauchy–Schwarz inequality and Corollary 5.8, we thus see that

$$\begin{aligned}&\frac{2}{X}\int _{2/X}^X \left[ \int _{1/\log Y}^1 \left|\frac{1}{h}\sum _{x-h< n \le x} f_{\theta }(n) - \frac{2}{X}\sum _{X/2< n \le X} f_{\theta }(n)\right|\hbox {d}\theta \right] \hbox {d}x \\&\quad \le \int _{1/\log Y}^1 \left( \frac{2}{X}\int _{X/2}^X \left|\frac{1}{h}\sum _{x- h< n \le x} f_{\theta }(n)-\frac{2}{X}\sum _{X/2 < n \le X} f_{\theta }(n)\right|^2 \hbox {d}x\right) ^{1/2} \hbox {d}\theta \\&\quad \ll \left( \sqrt{\frac{\log \log h_0}{\log h_0}} + \left( \frac{\log \log X}{(\log X)^{\kappa }}\right) ^{\frac{1}{2}} \right) \int _{1/\log Y}^1 \mathcal {P}_{f_{\theta }}(X) \hbox {d}\theta , \end{aligned}$$

for any \(0< \kappa < \kappa _{1,2}\). By Lemma 5.9, we have

$$\begin{aligned} \int _{1/\log Y}^1 \mathcal {P}_{f_{\theta }}(X) \hbox {d}\theta \ll \int _{1/\log Y}^1 \exp \left( \sum _{p \le X} \frac{f_{\theta }(p)-1}{p}\right) \hbox {d}\theta \ll \int _{1/\log Y}^1 \frac{\hbox {d}\theta }{\theta } = \log \log Y. \end{aligned}$$

We thus deduce that for all but \(o_{h_0 \rightarrow \infty }(X)\) exceptional integers \(x \in [X/2,X]\), we have that

$$\begin{aligned} \int _{1/\log Y}^1 \left|\frac{1}{h}\sum _{x-h< n \le x} f_{\theta }(n) - \frac{2}{X}\sum _{X/2 < n \le X} f_{\theta }(n)\right|\hbox {d}\theta = o_{h_0 \rightarrow \infty }(\log \log Y). \end{aligned}$$

For any of the non-exceptional x, we apply use (5.4) to give

$$\begin{aligned}&\frac{1}{h} \sum _{x-h< n \le x} \Delta (n) \ge \int _0^1 \left( \frac{1}{h} \sum _{x-h< n \le x} f_{\theta }(n)\right) \hbox {d}\theta \nonumber \\&\ge \int _{\tfrac{1}{\log Y}}^1 \left( \frac{2}{X}\sum _{X/2< n \le X} f_{\theta }(n)\right) \hbox {d}\theta - \int _{\tfrac{1}{\log Y}}^1 \left|\frac{1}{h} \sum _{x-h< n \le x} f_{\theta }(n) - \frac{2}{X}\sum _{X/2< n \le X}f_{\theta }(n)\right|\hbox {d}\theta \nonumber \\&= \int _{\tfrac{1}{\log Y}}^1 \left( \frac{2}{X}\sum _{X/2 < n \le X} f_{\theta }(n)\right) \hbox {d}\theta - o_{h_0 \rightarrow \infty }(\log \log Y). \end{aligned}$$
(5.5)

On the other hand, by [39, Exer. 208] we find that when \(1/\log X \le \theta \le 1\),

$$\begin{aligned} \frac{2}{X}\sum _{X/2< n \le X} \frac{|d(n,\theta ) |^2}{d(n)}&\ge \frac{2}{X}\sum _{X/2 < n \le X} \frac{\mu ^2(n)|d(n,\theta ) |^2}{d(n)} \\&= |\zeta (1+i\theta ) |H_{\theta }(1) + O(|\theta ^{3/2}|/\sqrt{\log X}), \end{aligned}$$

where for \(\text {Re}(s) > 3/4\), \(H_{\theta }(s)\) is some convergent Dirichlet series satisfying \(H_{\theta }(1) \gg 1\) uniformly in \(\theta \in [1/\log X,1]\). Integrating over \(\theta \in [1/\log Y,1]\) and using the Laurent expansion \(\zeta (1+i\theta ) = (i\theta )^{-1} + O(1)\), we deduce that

$$\begin{aligned} \int _{1/\log Y}^1 \left( \frac{2}{X}\sum _{X/2 < n \le X} f_{\theta }(n)\right) \hbox {d}\theta \gg \int _{1/\log Y}^1 \frac{\hbox {d}\theta }{\theta } + O(1) = \delta \log \log X + O(1). \end{aligned}$$
(5.6)

We thus have obtained

$$\begin{aligned} \frac{1}{h}\sum _{x-h < n \le x} \Delta (n) \gg \delta \log \log X \end{aligned}$$

for all but \(o_{h_0 \rightarrow \infty }(X)\) integers \(x \in [X/2,X]\), and the claim follows.\(\square \)