1. Introduction

Let \(p_n\) denote the \(n\)th prime. We prove the following result.

Theorem 1.1.

There are positive absolute constants \(c\) and \(C\) such that the following holds. Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Then there is a number \(c_0(\varepsilon)>0,\) depending only on \(\varepsilon,\) such that if \(x\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) satisfy the conditions

$$c_0(\varepsilon) \leq y\leq \ln x,\qquad 1\leq m \leq c \kern1pt \varepsilon\ln y,\qquad 1\leq q \leq y^{1-\varepsilon},\qquad (a,q)=1,$$

then

$$\#\Bigl\{\frac x2< p_n\leq x \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m}-p_n\leq y\Bigr\} \geq\pi(x)\Bigl( \frac{y}{2q\ln x} \Bigr)^{\exp(Cm)}.$$

Theorem 1.1 extends a result of Maynard [5, Theorem 3.3], who established the same result but with \(y=\varepsilon\ln x\).

From Theorem 1.1 we obtain

Corollary 1.1.

There is an absolute constant \(C>0\) such that if \(m\) is a positive integer and \(x\) and \(y\) are real numbers satisfying \(\exp(Cm)\leq y \leq \ln x,\) then

$$\#\Bigl\{\frac x2< p_n\leq x \colon\, \, p_{n+m}-p_n\leq y\Bigr\} \geq \pi(x)\Bigl( \frac{y}{2\ln x} \Bigr)^{\exp(Cm)}.$$

Let us introduce necessary notation. The expression \(b\mid a\) means that \(b\) divides \(a\). For a fixed \(a\) the sum \(\sum_{b\mid a}\) and the product \(\prod_{b\mid a}\) should be interpreted as being over all positive divisors of \(a\).

We will use I. M. Vinogradov’s notation: \(A\ll B\) means that \(|A|\leq cB\) with a positive absolute constant \(c\).

We reserve the letter \(p\) for primes. In particular, the sum \(\sum_{p\leq K}\) should be interpreted as being over all prime numbers not exceeding \(K\).

We will also use the following notation:

\(\#A\) is the number of elements of a finite set \(A\);

\({\mathbb N}\), \({\mathbb Z}\), \({\mathbb R}\), and \({\mathbb C}\) are the sets of all positive integers, integers, real numbers, and complex numbers;

\(\mathbb{P}\) is the set of all prime numbers;

\([x]\) is the integer part of a number \(x\); i.e., \([x]\) is the largest integer \(n\) such that \(n\leq x\);

\(\{x\}\) is the fractional part of a number \(x\); i.e., \(\{x\}=x-[x]\);

\(\lceil x\rceil\) is the smallest integer \(n\) such that \(n\geq x\);

\(\operatorname{Re} s\) and \(\operatorname{Im} s\) are the real and imaginary parts of a complex number \(s\);

\((a_1,\dots,a_n)\) is the greatest common divisor of integers \(a_1,\dots,a_n\);

\([a_1,\dots,a_n]\) is the least common multiple of integers \(a_1,\dots,a_n\);

\( \varphi (n)\) is the Euler totient function: \( \varphi (n)= \#\{1\leq m \leq n \colon\, (m,n)=1\}\);

\(\mu(n)\) is the Möbius function, which is defined as follows:

  1. (i)

    \(\mu(1)=1\),

  2. (ii)

    \(\mu(n)=0\) if there is a prime \(p\) such that \(p^2\mid n\), and

  3. (iii)

    \(\mu(n)=(-1)^s\) if \(n=q_1\dots q_s\), where \(q_1<\dots<q_s\) are primes;

\( \Lambda (n)\) is the von Mangoldt function:

$$\Lambda (n)= \begin{cases} \displaystyle \ln p & \text{ if }\, \displaystyle n=p^k,\\ \displaystyle 0 & \text{ if }\, \displaystyle n\neq p^k; \end{cases}$$

\(P^-(n)\) is the least prime factor of \(n>1\) (by convention \(P^-(1)=+\infty\));

\(\binom{n}{k} = n!/(k!\,(n-k)!)\) is the binomial coefficient.

For real numbers \(a\) and \(b\) we use \((a,b)\) and \([a,b]\) to denote, respectively, the open and closed intervals with endpoints \(a\) and \(b\). By \((a_1,\dots,a_n)\) we also denote a vector; the meaning of the notation should be clear from the context.

By definition, we put

$$\sum_{\varnothing} = 0\qquad\text{and}\qquad \prod_{\varnothing}=1.$$

We define

$${\mathcal M} = \{n\in{\mathbb N} \colon\, \, \mu(n)\neq 0\}.$$

We will use the following functions:

$$\begin{gathered} \, \operatorname{li} (x)=\intop_2^x\!\frac{dt}{\ln t},\qquad \Phi(x,z)=\#\bigl\{1\leq n\leq x \colon\, \, P^-(n)>z\bigr\},\\[4pt] \pi(x)=\sum_{p\leq x} 1,\qquad \theta(x)=\sum_{p\leq x} \ln p,\qquad \psi(x)=\sum_{n\leq x} \Lambda (n),\\[4pt] \pi(x;q,a)=\sum_{p\leq x,\; p\equiv a\pmod{q}} 1,\qquad \psi(x;q,a)=\sum_{n\leq x,\; n\equiv a\pmod{q}} \Lambda (n). \end{gathered}$$

Let \(m>1\) and \(a\) be integers. If \((a,m)=1\), then \(a^{ \varphi (m)}\equiv 1\pmod{m}\) (the Fermat–Euler theorem). Let \(d\) be the smallest positive value of \(\gamma\) for which \(a^{\gamma}\equiv 1\pmod{m}\). We call \(d\) the order of \(a\pmod{m}\) and say that \(a\) belongs to \(d\pmod{m}\).

Let \(q\) be a positive integer. We recall that a Dirichlet character modulo \(q\) is a function \(\chi \colon\, {\mathbb Z}\to{\mathbb C}\) such that

  1. (1)

    \(\chi(n+q)=\chi(n)\) for all \(n\in{\mathbb Z}\) (i.e., \(\chi\) is a periodic function with period \(q\));

  2. (2)

    \(\chi(mn)=\chi(m)\chi(n)\) for all \(m, n\in{\mathbb Z}\) (i.e., \(\chi\) is a totally multiplicative function);

  3. (3)

    \(\chi(1) =1\);

  4. (4)

    \(\chi(n)= 0\) for all \(n\in{\mathbb Z}\) such that \((n,q)>1\).

By \(X_q\) we denote the set of all Dirichlet characters modulo \(q\). We recall that \(\# X_q = \varphi (q)\) and that the principal character modulo \(q\) is

$$\chi^{}_0(n):= \begin{cases} \displaystyle 1 & \text{ if }\, \displaystyle (n,q)=1,\\ \displaystyle 0 & \text{ if }\, \displaystyle (n,q)>1. \end{cases}$$

Let \(\chi\in X_q\). We say that the character \(\chi\) restricted by \((n,q)=1\) has period \(q_1\) if it has the property that \(\chi(m)=\chi(n)\) for all \(m,n\in{\mathbb Z}\) such that \((m,q)=1\), \((n,q)=1\) and \(m\equiv n\pmod{q_1}\). Let \(c(\chi)\) denote the conductor of \(\chi\), which is the least positive integer \(q_1\) such that \(\chi\) restricted by \((n,q)=1\) has period \(q_1\). We say that \(\chi\) is primitive if \(c(\chi)=q\), and imprimitive if \(c(\chi)<q\). By \(X^*_q\) we denote the set of all primitive characters modulo \(q\). We observe that the principal character modulo \(1\) is primitive. On the other hand, any principal character modulo \(q>1\) is imprimitive, since its conductor is clearly \(1\). For \(\chi\in X_q\) we put

$$\begin{gathered} \, E_{\chi^{}_0}(\chi):={ \begin{cases} \displaystyle 1 & \text{ }\, \displaystyle \text{if } \chi \text{ is the principal character modulo } q,\\ \displaystyle 0 & \text{ }\, \displaystyle \text{otherwise}, \end{cases}} \\[5pt] \psi(x,\chi)=\sum_{n\leq x} \Lambda (n)\chi(n),\qquad \psi'(x,\chi)=\psi(x,\chi)-E_{\chi^{}_0}(\chi)x. \end{gathered}$$

A character \(\chi\) is said to be real if \(\chi(n)\in{\mathbb R}\) for all \(n\in{\mathbb Z}\). A character \(\chi\) is said to be complex if there is an integer \(n\) such that \(\operatorname{Im}(\chi(n))\neq 0\).

We say that characters \(\chi^{}_1\) and \(\chi^{}_2\) (modulo \(q_1\) and modulo \(q_2\), respectively) are equal and write \(\chi^{}_1 = \chi^{}_2\) if \(\chi^{}_1(n)=\chi^{}_2(n)\) for any integer \(n\). Otherwise, we say that characters \(\chi^{}_1\) and \(\chi^{}_2\) are not equal and write \(\chi^{}_1 \neq \chi^{}_2\).

Let \(\chi\) be a Dirichlet character modulo \(q\). The corresponding \(L\)-function is defined by the series

$$L(s,\chi)=\sum_{n=1}^{\infty}\frac{\chi(n)}{n^s}$$

for \(s\in{\mathbb C}\) with \(\operatorname{Re} s>1\). It is well known that if \(\chi\) is not the principal character modulo \(q\), then \(L(s,\chi)\) can be analytically continued to \({\mathbb C}\). If \(\chi\) is the principal character modulo \(q\), then \(L(s,\chi)\) can be analytically continued to \({\mathbb C}\setminus \{1\}\) with a simple pole at \(s=1\).

We say that two linear functions \(L_1(n)=a_1n+b_1\) and \(L_2(n)=a_2n+b_2\) with integer coefficients are equal and write \(L_1 = L_2\) if \(a_1=a_2\) and \(b_1=b_2\). Otherwise, we say that the linear functions \(L_1\) and \(L_2\) are not equal and write \(L_1 \neq L_2\).

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be a set of \(k\) linear functions with integer coefficients:

$$L_i(n)=a_i n+b_i,\qquad i=1,\dots,k.$$

For \(L(n)=a n+b,\) \(a,b\in{\mathbb Z}\), we define

$$\Delta_L=|a|\prod_{i=1}^k|a b_i - b a_i|.$$

We say that \(L(n)=an+b\) belongs to \( {\mathcal L} \) (\(L\in {\mathcal L} \)) if there is an \(i\), \(1 \leq i \leq k\), such that \(L=L_i\). Otherwise, we say that \(L(n)=an+b\) does not belong to \( {\mathcal L} \) (\(L\notin {\mathcal L} \)).

This paper is organized as follows. In Sections 24 we give necessary lemmas. In Section 5 we prove Theorem 1.1 and Corollary 1.1.

2. Preparatory lemmas

In this section we present some well-known lemmas which will be used in the following sections.

Lemma 2.1 (see, for example, [6, Ch. 1]).

Let \(x\) be a real number with \(x\geq 2\). Then

$$b_1\ln x \leq \prod_{p\leq x} \biggl( 1-\frac{1}{p} \biggr)^{\!-1}\leq b_2 \ln x \qquad\textit{and}\qquad b_3 \ln x\leq \prod_{p\leq x} \biggl( 1+\frac{1}{p} \biggr)\leq b_4 \ln x,$$

where \(b_i,\) \(i=1,\dots,4,\) are positive absolute constants.

Lemma 2.2 (see, for example, [4, Chs. 1, 2]).

The limits \(\lim_{x\to+\infty}\psi(x)/x,\) \(\lim_{x\to+\infty}\theta(x)/x,\) \(\lim_{x\to+\infty}\pi(x)/(x/ \ln x),\) and \(\lim_{n\to+\infty} p_n/(n\ln n)\) exist and

$$\lim_{x\to +\infty} \frac{\psi(x)}{x}= \lim_{x\to +\infty} \frac{\theta(x)}{x}=\lim_{x\to +\infty}\frac{\pi(x)}{x/ \ln x}=1,\qquad \lim_{n\to +\infty} \frac{p_n}{n\ln n}=1.$$

From Lemma 2.2 we obtain

Lemma 2.3.

It holds that

$$ b_5 x \leq \psi(x) \leq b_6 x,\qquad b_7 x \leq \theta(x) \leq b_8 x\qquad \textit{for}\quad x\geq 2,$$
(2.1)
$$\begin{gathered} \, b_9\frac{x}{\ln x} \leq \pi(x) \leq b_{10}\frac{x}{\ln x}\qquad\textit{for}\quad x\geq 2, \\[4pt] b_{11} n\ln(n+2) \leq p_n \leq b_{12}n\ln(n+2)\qquad\textit{for}\quad n\geq 1,\nonumber \end{gathered}$$
(2.2)

where \(b_i,\) \(i=5,\dots,12,\) are positive absolute constants.

Lemma 2.4 (see, for example, [7, Ch. 2]).

Let \(n\) be an integer with \(n>1\). Then

$$\varphi (n)=n\prod_{p\mid n}\biggl( 1-\frac{1}{p} \biggr).$$

From Lemma 2.4 we readily obtain the following two lemmas.

Lemma 2.5.

Let \(m\) and \(n\) be integers with \(m\geq 1\) and \(n\geq 1\). Then

$$\varphi (mn) \geq \varphi (m) \varphi (n).$$

Lemma 2.6.

Let \(m\) and \(n\) be integers with \(m\geq 1,\) \(n\geq 1,\) and \((m,n)=1\). Then

$$\varphi (mn) = \varphi (m) \varphi (n).$$

Lemma 2.7.

Let \(n\) be an integer with \(n\geq 1\). Then

$$ \frac{n}{ \varphi (n)} = \sum_{d\mid n} \frac{\mu^2(d)}{ \varphi (d)}.$$
(2.3)

Proof.

For \(n=1\), equality (2.3) holds. Let \(n>1\). Let us express \(n\) in the standard form \(n=q_1^{\alpha_1}\dots q_r^{\alpha_r}\), where \(q_1<\dots<q_r\) are prime numbers. Applying Lemmas 2.4 and 2.6, we have

$$\begin{aligned} \, \frac{n}{ \varphi (n)}&=\prod_{p\mid n}\biggl( 1-\frac{1}{p} \biggr)^{\!-1} =\prod_{p\mid n}\biggl( 1+\frac{1}{p-1} \biggr) =\biggl( 1+\frac{1}{q_1-1} \biggr)\dots \biggl( 1+\frac{1}{q_r-1} \biggr) \\[2pt] &=\biggl( 1+\frac{1}{ \varphi (q_1)} \biggr)\dots \biggl( 1+\frac{1}{ \varphi (q_r)} \biggr) =1+ \sum_{s=1}^r\,\sum_{1\leq i_1<\dots< i_s\leq r} \frac{1}{ \varphi (q_{i_1})\dots \varphi (q_{i_s})} \\[2pt] &=1+ \sum_{s=1}^r\,\sum_{1\leq i_1<\dots< i_s\leq r} \frac{1}{ \varphi (q_{i_1}\dots q_{i_s})} =\sum_{d\mid n,\; d\in {\mathcal M} }\frac{1}{ \varphi (d)}= \sum_{d\mid n}\frac{\mu^2(d)}{ \varphi (d)}. \ \quad\Box\end{aligned}$$

Lemma 2.8 (see, for example, [6, Ch. 1]).

Let \(n\) be an integer with \(n\geq 1\). Then

$$\varphi (n)\geq c \kern1pt \frac{n}{\ln\ln(n+2)},$$

where \(c>0\) is an absolute constant.

Lemma 2.9 (see, for example, [1, Ch. 28]).

Let \(x\) be a real number with \(x \geq 2\). Then

$$\sum_{1 \leq n \leq x}\frac{1}{ \varphi (n)} \leq c\ln x,$$

where \(c>0\) is an absolute constant.

Lemma 2.10 (see, for example, [2, Ch. 5]).

Let \(n\) be an integer with \(n\geq 1\). Then

$$\sum_{p\mid n}\frac{\ln p}{p}\leq c \ln\ln(3n),$$

where \(c>0\) is an absolute constant.

Lemma 2.11.

Let \(a,\) \(b,\) and \(c\) be integers such that \((a,b)\mid c\). Then the equation

$$ a x+b y = c$$
(2.4)

has a solution in integers.

Proof.

We put \(d=(a,b)\). Then \(c=dl\) for some \(l\in{\mathbb Z}\). It is well known (see, for example, [7, Ch. 1, Exercise 1]) that the equation

$$ ax+by=d$$
(2.5)

has a solution in integers. Let \(x_0\in{\mathbb Z}\) and \(y_0\in{\mathbb Z}\) be a solution of (2.5). Then the integers \(lx_0\) and \(ly_0\) satisfy (2.4). \(\quad\Box\)

Lemma 2.12.

Let \(n\) and \(k\) be integers such that \(1 \leq k \leq n\). Then

$$ \binom{n}{k} \geq k^{-k} (n-k)^k.$$
(2.6)

Proof.

For \(k=n\) inequality (2.6) holds. Let \(1\leq k < n\). Then

$$\binom{n}{k}=\frac{n!}{k!\,(n-k)!}=\frac{n(n-1)\dots(n-k+1)}{k!}\geq \frac{(n-k)^k}{k!}\geq k^{-k}(n-k)^k.\ \quad\Box$$

Lemma 2.13 (see [3, Ch. 0]).

Let \(x\) and \(z\) be real numbers such that \(2 \leq z \leq x/2\). Then

$$\Phi (x,z) \geq c_0 \frac{x}{\ln z},$$

where \(c_0>0\) is an absolute constant.

3. Lemmas on Dirichlet characters

In this section we give some well-known lemmas on Dirichlet characters which will be used in the following sections.

Lemma 3.1.

Let \(a,\) \(b,\) and \(n\) be integers such that \(1\leq a<b,\) \(a\mid b,\) and \((n,a)=1\). Then there is an integer \(t\) such that \((n+ta,b)=1\).

Proof.

If \((n,b)=1\), we take \(t=0\). Let \((n,b)>1\). Then the set \(\Omega = \{ p\mid b \colon\, p \nmid a\}\) is nonempty. Let \(\Omega = \{ q_1,\dots,q_r\}\) with \(q_1<\dots<q_r\). Let \(1 \leq i \leq r\). Since \((a,q_i)=1\), the congruence

$$n + t a\equiv 1\pmod{q_i}$$

has a solution; i.e., there is an integer \(m_i\) such that \(n+a m_i \equiv 1 \pmod{q_i}\). Consider the system

$$ \begin{cases} \displaystyle t\equiv m_1\pmod{q_1}, \\ \displaystyle \dots\dots\dots\dots\dots\dots \\ \displaystyle t\equiv m_r\pmod{q_r}. \end{cases}$$
(3.1)

Since the numbers \(q_1,\dots,q_r\) are coprime, the system has a solution. Let an integer \(t_0\) satisfy system (3.1). We claim that \(t_0\) is a desired number, i.e., that \((n+t_0a,b)=1\). Assume the contrary: \((n+t_0a,b)>1\). Then there is a prime \(p\) such that \(p\mid b\) and \(p\mid (n+t_0a)\). If \(p\nmid a\), then \(p\in\Omega\), i.e., \(p=q_i\) for some \(1 \leq i \leq r\). However,

$$n+t_0a \equiv 1\pmod{q_i}$$

and hence \(p\nmid (n+t_0a)\). We arrive at a contradiction. Thus this case is impossible. Hence, \(p\mid a\). Since \(p\mid (n+t_0a)\), we see that \(p\mid n\). Hence, \((n,a)>1\). This contradicts the hypothesis of the lemma. Therefore, the assumption \((n+t_0a,b)>1\) is false. Hence, \((n+t_0a,b)=1\). \(\quad\Box\)

Lemma 3.2.

Let \(q\ge 2\) be an integer and \(\chi\in X_q\). Suppose that \(\chi\) restricted by \((n,q)=1\) has period \(q_1\). Then \(\chi\) restricted by \((n,q)=1\) also has period \((q,q_1)\).

Proof.

We put \(\delta = (q,q_1)\). Let \(m\) and \(n\) be integers such that \((m,q)=1\), \((n,q)=1\), and \(m\equiv n\pmod{\delta}\). We need to prove that \(\chi(m) = \chi(n)\). By Lemma 2.11, there are integers \(k\) and \(l\) such that

$$m+ q_1 k= n + q l.$$

We put \(A=m+ q_1 k= n+ql\). Since \((n,q)=1\), we have \((n+ql, q)=1\). Hence, \((A,q) =1\). Since \(\chi\) has period \(q\), it follows that

$$\chi(A)=\chi(n+ql)=\chi(n).$$

Since \((A,q)=1\), \((m,q)=1\), and \(A\equiv m\pmod{q_1}\), we have \(\chi(A) = \chi(m)\). Hence, \(\chi(m)= \chi(n)\). \(\quad\Box\)

Lemma 3.3.

Let \(q\geq 1\) and \(\chi\in X_q\). Then \(c(\chi)\) divides \(q\).

Proof.

If \(q=1\), then \(c(\chi)=1\) and the statement is obvious. Let \(q\geq 2\). By Lemma 3.2, \(\chi\) restricted by \((n,q)=1\) has period \(\delta = (c(\chi), q)\). If \(c(\chi)\) is not a divisor of \(q\), then \(\delta< c(\chi)\), which contradicts the definition of the conductor. \(\quad\Box\)

Lemma 3.4.

Let \(q\geq 1\) and \(\chi\in X_q\). Then there exists a unique Dirichlet character \(\chi^{}_1\in X_{c(\chi)}\) such that

$$ \chi(n)= \begin{cases} \displaystyle \chi^{}_1(n) & \textit{ if }\, \displaystyle (n,q)=1,\\ \displaystyle 0 & \textit{ if }\, \displaystyle (n,q)>1. \end{cases}$$
(3.2)

Furthermore, \(\chi^{}_1\) is primitive.

We say that \(\chi^{}_1\) induces \(\chi\).

Proof of Lemma 3.4 .

I. \(\,\)Let \(q=1\). Then \(c(\chi)=1\), \(\# X_1=1\), and \(\chi^{}_1 = \chi\), so the statement is obvious.

II. \(\,\)Let \(q \geq 2\) and \(\chi\) be a primitive character modulo \(q\). Then \(c(\chi)=q\) and we can take \(\chi^{}_1=\chi\). Let us prove the uniqueness. Suppose that there are two different characters \(\chi^{}_1, \chi^{}_2\in X_q\) satisfying (3.2). Then for any \(n\) such that \((n,q)>1\) we have \(\chi^{}_1(n)=0=\chi^{}_2(n)\). For any \(n\) such that \((n,q)=1\), we have \(\chi^{}_1(n)=\chi(n)=\chi^{}_2(n)\). Therefore, \(\chi^{}_1(n)=\chi^{}_2(n)\) for any integer \(n\); i.e., \(\chi^{}_1=\chi^{}_2\), a contradiction.

III. \(\,\)Let \(q\geq 2\) and \(\chi\) be an imprimitive character modulo \(q\). Then \(1\leq c(\chi) < q\) and by Lemma 3.3 we have \(c(\chi)\mid q\). We define \(\chi^{}_1\). Let \(n\in{\mathbb Z}\). Consider several cases.

If \((n,c(\chi))>1\), then we put \(\chi^{}_1(n)=0\).

If \((n,c(\chi))=1\), then by Lemma 3.1 there is an integer \(t\) such that \((n+tc(\chi),q)=1\). We put

$$\chi^{}_1(n) = \chi(n+tc(\chi)).$$

The choice of \(t\) subject to the indicated condition is immaterial, since \(\chi\) restricted by \((n,q)=1\) has period \(c(\chi)\). Thus, \(\chi^{}_1(n)\) is defined for any integer \(n\). We claim that \(\chi^{}_1\) is a character modulo \(c(\chi)\). By construction,

$$\chi^{}_1(n)=0 \qquad\text{for any }\, n\in{\mathbb Z} \,\text{ such that }\, (n,c(\chi))>1.$$

By Lemma 3.1, there is an integer \(t\) such that \((1+tc(\chi),q)=1\). Since the choice of such a \(t\) is immaterial, we take \(t=0\). We have \(\chi^{}_1(1)=\chi(1)=1\). Now we prove that

$$ \chi^{}_1(n+c(\chi))= \chi^{}_1(n) \qquad\text{for all} \quad n\in{\mathbb Z}.$$
(3.3)

If \((n,c(\chi))>1\), then we have \((n+c(\chi),c(\chi))>1\). Hence,

$$\chi^{}_1(n+c(\chi))=0=\chi^{}_1(n).$$

Let \((n,c(\chi))=1\). Then we have \((n+c(\chi), c(\chi))=1\). By Lemma 3.1, there are integers \(t_1\) and \(t_2\) such that \((n+t_1c(\chi),q)=1\) and \((n+c(\chi)+t_2c(\chi),q)=1\). By construction, we have

$$\chi^{}_1(n) = \chi(n+t_1 c(\chi)) \qquad\text{and}\qquad \chi^{}_1(n+c(\chi)) = \chi(n+c(\chi)+t_2 c(\chi)).$$

Since \(\chi\) restricted by \((n,q)=1\) has period \(c(\chi)\), we have \(\chi(n+t_1 c(\chi))= \chi(n+c(\chi)+t_2 c(\chi))\). Hence, \(\chi^{}_1(n) = \chi^{}_1(n+c(\chi))\) and (3.3) is proved. Now we prove that

$$ \chi^{}_1(m n)=\chi^{}_1(m) \chi^{}_1(n) \qquad \text{for all}\quad m, n\in{\mathbb Z}.$$
(3.4)

If \((m,c(\chi))>1\), then we have \((mn, c(\chi))>1\). Hence, \(\chi^{}_1(mn)=0\) and \(\chi^{}_1(m)=0\). Therefore, relation (3.4) holds. Similarly, (3.4) holds if \((n,c(\chi))>1\). Let \((m,c(\chi))=1\) and \((n,c(\chi))=1\). Then \((mn,c(\chi))= 1\). By Lemma 3.1, there are integers \(t_1\), \(t_2\), and \(t_3\) such that \((m+t_1c(\chi),q)=1\), \((n+t_2c(\chi),q)=1\), and \((mn+t_3c(\chi),q)=1\). We put \(m_1 = m+t_1c(\chi)\), \(n_1 = n+t_2c(\chi)\), and \(u = mn+t_3c(\chi)\). By construction,

$$\chi^{}_1(mn)=\chi(u),\qquad \chi^{}_1(m)=\chi(m_1),\qquad\text{and}\qquad \chi^{}_1(n)=\chi(n_1).$$

Since \(\chi\) is a totally multiplicative function, it follows that

$$\chi^{}_1(m) \chi^{}_1(n)=\chi(m_1)\chi(n_1)=\chi(m_1 n_1).$$

Since \((m_1,q)=1\) and \((n_1,q)=1\), we have \((m_1 n_1,q)=1\). It is clear that \(m_1 n_1 \equiv u\pmod{c(\chi)}\). Since \(\chi\) restricted by \((n,q)=1\) has period \(c(\chi)\), we find that \(\chi(u)=\chi(m_1 n_1)\). Therefore, \(\chi^{}_1(mn)= \chi^{}_1(m)\chi^{}_1(n)\) and (3.4) is proved. Thus, we have proved that \(\chi^{}_1\) is a character modulo \(c(\chi)\), i.e., \(\chi^{}_1 \in X_{c(\chi)}\).

Now we prove that \(\chi^{}_1\) satisfies (3.2). It suffices to show that

$$ \chi^{}_1(n)=\chi(n) \qquad\text{if}\quad (n,q)=1.$$
(3.5)

Since \((n,q)=1\), we have \((n,c(\chi))=1\) (see Lemma 3.3). By Lemma 3.1, there is an integer \(t\) such that \((n+t c(\chi),q)=1\). By construction \(\chi^{}_1(n) = \chi(n+t c(\chi))\). Since \((n+t c(\chi),q)=1\), \((n,q)=1\), and \(n+tc(\chi) \equiv n\pmod{c(\chi)}\), we have \(\chi(n+t c(\chi))=\chi(n)\). Hence, \(\chi^{}_1(n)=\chi(n)\) and (3.5) is proved.

Now we prove that \(\chi^{}_1\) is a primitive character. Suppose that there is a positive integer \(q_2\) such that \(\chi^{}_1\) restricted by \((n,c(\chi))=1\) has period \(q_2\). Let \(m\) and \(n\) be integers such that \((m,q)=1\), \((n,q)=1\), and \(m\equiv n\pmod{q_2}\). By Lemma 3.3, we have \((m,c(\chi))=1\) and \((n,c(\chi))=1\). Then (see (3.5))

$$\chi(m)=\chi^{}_1(m)=\chi^{}_1(n)=\chi(n).$$

Hence, \(\chi\) restricted by \((n,q)=1\) has period \(q_2\). From the definition of a conductor it follows that \(q_2 \geq c(\chi)\). Hence, \(\chi^{}_1\) is a primitive character.

Now we prove the uniqueness. Suppose that there are two different characters \(\chi^{}_1, \chi^{}_2 \in X_{c(\chi)}\) satisfying (3.2). If \((n,c(\chi))>1\), then \(\chi^{}_1(n)=0=\chi^{}_2(n)\). Let \((n,c(\chi))=1\). By Lemma 3.1, there is an integer \(t\) such that \((n+t c(\chi),q)=1\). Since \(\chi^{}_1\) and \(\chi^{}_2\) are periodic functions with period \(c(\chi)\), we have

$$\chi^{}_1(n) = \chi^{}_1(n+tc(\chi))=\chi(n+tc(\chi))=\chi^{}_2(n+tc(\chi))=\chi^{}_2(n).$$

Thus, \(\chi^{}_1(n)=\chi^{}_2(n)\) for any \(n\in{\mathbb Z}\), and so \(\chi^{}_1=\chi^{}_2\). We obtain a contradiction. The uniqueness is proved. \(\quad\Box\)

Lemma 3.5.

Let \(q>1\) be an integer expressed in the standard form as \(q=q_1^{\alpha_1}\dots q_r^{\alpha_r},\) where \(q_1<\dots<q_r\) are primes and \(\alpha_1,\dots,\alpha_r\) are positive integers. Let \(\chi\) be a Dirichlet character modulo \(q\). Then there exist unique characters \(\chi^{}_i\) modulo \(q_i^{\alpha_i},\) \(i=1,\dots,r,\) such that

$$ \chi(n)=\chi^{}_1(n)\dots \chi^{}_r(n)\qquad \textit{for all}\quad n.$$
(3.6)

Furthermore, if the character \(\chi\) is real, then all characters \(\chi^{}_i,\) \(i=1,\dots,r,\) are real. If the character \(\chi\) is primitive, then all characters \(\chi^{}_i,\) \(i=1,\dots,r,\) are primitive.

Proof.

For any \(1\leq i\leq r\) we take \(A_i\) such that

$$ A_i\equiv 1\pmod{q_i^{\alpha_i}}\qquad\text{and}\qquad A_i\equiv 0\pmod{q_j^{\alpha_j}}\quad \text{for any }\ j\neq i,\ \ 1\leq j\leq r.$$
(3.7)

Since the moduli of these congruences are coprime, the system has a solution (see, for example, [7, Ch. 4]). Thus, integers \(A_1,\dots,A_r\) are defined.

Let \(1\leq i \leq r\) and \(n\in{\mathbb Z}\). We put

$$ \chi^{}_i(n)=\chi\Biggl(nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\Biggr).$$
(3.8)

It is easy to show that \(\chi^{}_i\) is a Dirichlet character modulo \(q_i^{\alpha_i}\).

Now we prove that (3.6) holds. Let \(n\in{\mathbb Z}\). Setting

$$n_i=nA_i+\sum_{1\leq j \leq r,\; j\neq i}A_j,\qquad i=1,\dots,r,$$

we have

$$\chi^{}_1(n)\dots\chi^{}_r(n)=\chi(n_1)\dots\chi(n_r)=\chi(n_1\dots n_r).$$

From (3.7) we obtain

$$n_1\dots n_r \equiv n\pmod{q_s^{\alpha_s}}\qquad \text{for any}\quad 1\leq s \leq r.$$

Hence, \(n_1\dots n_r - n\) is divisible by \(q\), i.e.,

$$n_1\dots n_r\equiv n\pmod{q}.$$

Hence, \(\chi(n_1\dots n_r)=\chi(n)\) and (3.6) is proved.

Now we prove the uniqueness of the representation of \(\chi\) in the form (3.6). Suppose that

$$ \chi(n)= \widetilde{\chi}{} _1(n)\dots \widetilde{\chi}{} _r(n),$$
(3.9)

where \( \widetilde{\chi}{} _i\) is a Dirichlet character modulo \(q_i^{\alpha_i}\), \(i= 1,\dots,r\). Let \(1 \leq i \leq r\) and \(n\in{\mathbb Z}\). We have (see (3.7))

$$nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\equiv 1\pmod{q_s^{\alpha_s}}\qquad \text{for any}\quad 1\leq s \leq r,\quad s\neq i,$$

and

$$nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\equiv n\pmod{q_i^{\alpha_i}}.$$

Hence,

$$\widetilde{\chi}{} _s\Biggl(nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\Biggr)=1\qquad \text{for any }\quad 1 \leq s \leq r,\quad s\neq i,$$

and

$$\widetilde{\chi}{} _i\Biggl(nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\Biggr)= \widetilde{\chi}{} _i(n).$$

From (3.9) we obtain

$$\chi\Biggl(nA_i+\sum_{1\leq j\leq r,\; j\neq i}A_j\Biggr)= \widetilde{\chi}{} _i(n).$$

Therefore (see (3.8)), \( \widetilde{\chi}{} _i(n)= \chi^{}_i(n)\). Since this equation holds for any \(n\in{\mathbb Z}\), we have \( \widetilde{\chi}{} _i = \chi^{}_i\), \(i=1,\dots,r\). Thus, the uniqueness of the representation of \(\chi\) in the form (3.6) is proved.

We see from (3.8) that if the character \(\chi\) is real, then all characters \(\chi^{}_i\), \(i=1,\dots,r\), are real. We claim that if the character \(\chi\) is primitive, then all characters \(\chi^{}_i\), \(i=1,\dots,r\), are primitive. Assume the contrary: there is an \(i\), \(1\leq i \leq r\), such that the character \(\chi^{}_i\) is imprimitive. Then \(c(\chi^{}_i)<q_i^{\alpha_i}\). Since \(c(\chi^{}_i)\mid q_i^{\alpha_i}\) (see Lemma 3.3), we have

$$c(\chi^{}_i)=q_i^{\beta},\qquad \beta < \alpha_i.$$

We put

$$\widetilde{q}{} =q_i^{\beta}\prod_{1\leq j \leq r,\; j\neq i}q_j^{\alpha_j}.$$

Let us show that the character \(\chi\) restricted by \((n,q)=1\) has period \( \widetilde{q}{} \). Take integers \(m\) and \(n\) such that \((m,q)=(n,q)=1\) and \(m\equiv n\pmod{ \widetilde{q}{} \,}\). Let \(1\leq j \leq r\), \(j\neq i\). Since

$$m\equiv n\pmod{q_j^{\alpha_j}},$$

we have \(\chi^{}_j(m)=\chi^{}_j(n)\). Since \((m,q_i^{\alpha_i})=(n,q_i^{\alpha_i})=1\),

$$m \equiv n\pmod{q_i^{\beta}},$$

and \(\chi^{}_i\) restricted by \((n,q_i^{\alpha_i})=1\) has period \(q_i^{\beta}\), we have \(\chi^{}_i(m)=\chi^{}_i(n)\). This implies

$$\chi(m)=\chi^{}_i(m)\prod_{1\leq j \leq r,\; j \neq i}\chi^{}_j(m)=\chi^{}_i(n)\prod_{1\leq j \leq r,\; j \neq i}\chi^{}_j(n)=\chi(n).$$

We have proved that \(\chi\) restricted by \((n,q)=1\) has period \( \widetilde{q}{} \). But then \(c(\chi)\leq \widetilde{q}{} <q\). This contradicts the fact that the character \(\chi\) is primitive. Hence, all characters \(\chi^{}_i\), \(i=1,\dots,r\), are primitive. Lemma 3.5 is proved. \(\quad\Box\)

Lemma 3.6.

Let \(q\) be a positive integer such that there exists a real primitive character \(\chi\) modulo \(q\). Then the number \(q\) is of the form \(2^\alpha k,\) where \(\alpha\in\{0,\dots,3\}\) and \(k\geq 1\) is an odd square-free integer.

Proof.

Modulo \(q=1\) there exists a real primitive character; namely, \(\chi(n)=1\) for all \(n\in{\mathbb Z}\). The number \(1\) is of the form \(2^\alpha k\); namely, \(\alpha = 0\) and \(k=1\).

Let \(q>1\) be an integer such that there exists a real primitive character \(\chi\) modulo \(q\). Suppose that \(q=p^rs\), where \(p\geq 3\) is a prime number, \((p,s)=1\), and \(r\geq 2\). Let \( \widetilde{q}{} =p^{r-1}s\). We claim that the character \(\chi\) restricted by \((n,q)=1\) has period \( \widetilde{q}{} \). Let \(m\) and \(n\) be integers such that \((m,q)=(n,q)=1\) and \(m\equiv n\pmod{ \widetilde{q}{} \,}\). We have \(m=n+ \widetilde{q}{} \kern1pt t\), \(t\in{\mathbb Z}\), and

$$ m^{p^{r-1}}=(n+ \widetilde{q}{} \kern1pt t)^{p^{r-1}}=n^{p^{r-1}}+\sum_{i=1}^{p^{r-1}}\binom{p^{r-1}}{i}( \widetilde{q}{} \kern1pt t)^i n^{p^{r-1}-i} =n^{p^{r-1}}+\sum_{i=1}^{p^{r-1}}A_it^i n^{p^{r-1}-i},$$
(3.10)

where

$$A_i = \binom{p^{r-1}}{i}( \widetilde{q}{} \,)^i.$$

Let \(2\leq i \leq p^{r-1}\). Then

$$A_i = \binom{p^{r-1}}{i}(p^{r-1}s)^i=p^rs\binom{p^{r-1}}{i}p^{(i-1)r-i}s^{i-1}.$$

It is clear that \(i-1\geq 1\). We claim that

$$ (i-1)r-i\geq 0$$
(3.11)

or, which is equivalent, \(i(r-1)\geq r\). Indeed, since \(i\geq 2\) and \(r\geq 2\), we have

$$i(r-1)\geq 2(r-1)\geq r.$$

Hence, \(A_i=p^rsN\), where \(N\in{\mathbb N}\). Thus, for any \(2\leq i \leq p^{r-1}\),

$$A_i\equiv 0\pmod{q}.$$

We have \(A_1=p^{r-1}(p^{r-1}s)=p^rs p^{r-2}\). Since \(r\geq 2\), we obtain

$$A_1\equiv 0\pmod{q}.$$

Hence (see (3.10)),

$$m^{p^{r-1}}\equiv n^{p^{r-1}}\pmod{q}.$$

Using the properties of a character, we obtain

$$(\chi(m))^{p^{r-1}}=(\chi(n))^{p^{r-1}}.$$

Since \((m,q)= (n,q)=1\) and the character \(\chi\) is real, we have \(\chi(m),\chi(n)\in\{-1,1\}\). Since \(p\geq3\) is a prime number and \(r\geq 2\) is an integer, it follows that \(p^{r-1}\) is an odd positive integer. Therefore, if \(\chi(m)=1\), then \(\chi(n)=1\), while if \(\chi(m)=-1\), then \(\chi(n)=-1\) as well. Thus, \(\chi(m)=\chi(n)\). We have proved that the character \(\chi\) restricted by \((n,q)=1\) has period \( \widetilde{q}{} \). Consequently,

$$c(\chi) \leq \widetilde{q}{} < q.$$

This contradicts the fact that \(\chi\) is a primitive character. Hence, the number \(q\) is of the form \(2^\alpha k\), where \(\alpha \geq 0\) is an integer and \(k\geq 1\) is an odd square-free integer.

We claim that \(\alpha\leq 3\). Assume the contrary: \(\alpha \geq 4\). Let \(k=q_1\dots q_r\), where \(q_1<\dots<q_r\) are odd primes. By Lemma 3.5, we have

$$ \chi(n)=\chi^{}_1(n)\chi^{}_2(n)\dots\chi^{}_{r+1}(n),$$
(3.12)

where \(\chi^{}_1\) is a real primitive character modulo \(2^\alpha\) and \(\chi^{}_i\) is a real primitive character modulo \(q_{i-1}\), \(i=2,\dots,r+1\) (if \(k=1\), then \(\chi^{}_2,\dots,\chi^{}_{r+1}\) are omitted in (3.12)). It is well known (see, for example, [7, Ch. 6]) that if numbers \(\nu\) and \(\gamma\) run independently through the sets \(\{0,1\}\) and \(\{0,\dots,2^{\alpha-2}-1\}\) respectively, then \((-1)^{\nu}\cdot5^{\gamma}\) runs (without repetitions) through a reduced residue system modulo \(2^\alpha\). Hence, for any \(n\) with \((n,2) = 1\) there are unique numbers \(\nu(n) \in \{0,1\}\) and \(\gamma(n) \in \{0,\dots,2^{\alpha-2}- 1\}\) such that

$$ n \equiv (-1)^{\nu(n)}\cdot 5^{\gamma(n)}\pmod{2^\alpha}.$$
(3.13)

Since \((-1)^2=1\), we have \((\chi^{}_1(-1))^2=1\). Thus,

$$\chi^{}_1(-1)= (-1)^a,\qquad a\in\{0,1\}.$$

It is well known (see, for example, [7, Ch. 6]) that the number \(5\) belongs to \(2^{\alpha-2}\pmod{2^\alpha}\); in particular, \(5^{2^{\alpha-2}}\equiv 1\pmod{2^\alpha}\). Hence,

$$(\chi^{}_1(5))^{2^{\alpha-2}}=1.$$

We obtain

$$\chi^{}_1(5) = \exp\biggl(2\pi i\frac{b}{2^{\alpha-2}} \biggr),\qquad b\in\{0,\dots,2^{\alpha-2}-1\}.$$

We see from (3.13) that if \(n\) is such that \((n,2)=1\), then

$$ \chi^{}_1(n)=(-1)^{a\nu(n)}\exp\biggl(2\pi i\frac{b\gamma(n)}{2^{\alpha-2}} \biggr).$$
(3.14)

We claim that \((b,2)=1\). Indeed, assume the contrary: \((b,2)>1\). We show that then \(\chi^{}_1\) restricted by \((n,2^\alpha)=1\) has period \(2^{\alpha-1}\). Let \(m\) and \(n\) be integers such that \((m,2^\alpha)=(n,2^\alpha)=1\) and \(m\equiv n\pmod{2^{\alpha-1}}\). We have

$$m \equiv (-1)^{\nu(m)}\cdot 5^{\gamma(m)}\pmod{2^\alpha} \qquad\text{and}\qquad n \equiv (-1)^{\nu(n)}\cdot 5^{\gamma(n)}\pmod{2^\alpha}.$$

Since these congruences also hold modulo \(2^{\alpha-1}\), we have

$$ (-1)^{\nu(m)}\cdot 5^{\gamma(m)}\equiv (-1)^{\nu(n)}\cdot 5^{\gamma(n)}\pmod{2^{\alpha -1}}.$$
(3.15)

Since \(\alpha\geq 4\), we obtain

$$(-1)^{\nu(m)}\cdot 5^{\gamma(m)}\equiv (-1)^{\nu(n)}\cdot 5^{\gamma(n)}\pmod{4}.$$

It is clear that

$$(-1)^{\nu(m)}\cdot 5^{\gamma(m)}\equiv (-1)^{\nu(m)}\pmod{4} \qquad\text{and}\qquad (-1)^{\nu(n)}\cdot 5^{\gamma(n)}\equiv (-1)^{\nu(n)}\pmod{4}.$$

Hence,

$$(-1)^{\nu(m)}\equiv (-1)^{\nu(n)}\pmod{4}.$$

If \(\nu(m)=0\), then \(\nu(n)=0\); if \(\nu(m)=1\), then \(\nu(n)=1\). Thus,

$$ \nu(m)=\nu(n).$$
(3.16)

Therefore (see (3.15)),

$$5^{\gamma(m)}\equiv 5^{\gamma(n)}\pmod{2^{\alpha -1}}.$$

Suppose, for definiteness, that \(\gamma(m) \geq \gamma(n)\). We have

$$5^{\gamma(n)}\bigl(5^{\gamma(m)-\gamma(n)}-1\bigr)\equiv0\pmod{2^{\alpha -1}}.$$

Since \((5^{\gamma(n)}, 2^{\alpha-1})=1\), we obtain

$$5^{\gamma(m)-\gamma(n)}-1\equiv0\pmod{2^{\alpha -1}}.$$

Hence,

$$5^{\gamma(m)-\gamma(n)}\equiv 1\pmod{2^{\alpha -1}}.$$

Since \(5\) belongs to \(2^{\alpha-3}\pmod{2^{\alpha-1}}\), we have (see [7, Ch. 6])

$$\gamma(m)-\gamma(n)\equiv 0\pmod{2^{\alpha -3}}.$$

Therefore,

$$ \gamma(m)=\gamma(n)+ 2^{\alpha -3}t,$$
(3.17)

where \(t\geq 0\) is an integer. Since \((b,2)>1\), we have

$$ b=2 \widetilde{b}{} ,$$
(3.18)

where \( \widetilde{b}{} \geq 0\) is an integer. We obtain (see (3.14) and (3.16)–(3.18))

$$\begin{aligned} \, \chi^{}_1(m)&=(-1)^{a\nu(m)}\exp\biggl(2\pi i\frac{ \widetilde{b}{} \gamma(m)}{2^{\alpha-3}} \biggr) =(-1)^{a\nu(n)}\exp\biggl(2\pi i\frac{ \widetilde{b}{} (\gamma(n)+ 2^{\alpha -3}t)}{2^{\alpha-3}} \biggr) \\[3pt] &=(-1)^{a\nu(n)}\exp\biggl(2\pi i\frac{ \widetilde{b}{} \gamma(n)}{2^{\alpha-3}} \biggr)\exp(2\pi i \widetilde{b}{} t) =(-1)^{a\nu(n)}\exp\biggl(2\pi i\frac{ \widetilde{b}{} \gamma(n)}{2^{\alpha-3}} \biggr)= \chi^{}_1(n). \end{aligned}$$

Thus, we have proved that \(\chi^{}_1\) restricted by \((n,2^\alpha)=1\) has period \(2^{\alpha-1}\). Hence,

$$c(\chi^{}_1)\leq 2^{\alpha-1}<2^\alpha.$$

This contradicts the fact that \(\chi^{}_1\) is a primitive character. Hence, \((b,2)=1\).

For \(n=5\) we have \(\nu(5)=0\) and \(\gamma(5)=1\). Therefore (see (3.14)),

$$\chi^{}_1(5)=\exp\biggl(2\pi i\frac{b}{2^{\alpha-2}} \biggr)= \exp\biggl(\pi i\frac{b}{2^{\alpha-3}} \biggr).$$

Since \(\alpha\geq 4\) and \((b,2)=1\), we have \(\operatorname{Im}(\chi^{}_1(5))\neq 0\). This contradicts the fact that \(\chi^{}_1\) is a real character. Hence, \(0 \leq \alpha\leq 3\). Lemma 3.6 is proved. \(\quad\Box\)

Lemma 3.7.

Let \(q_1\) and \(q_2\) be positive integers with \(q_1 \neq q_2,\) \(\chi^{}_1\) be a primitive character modulo \(q_1,\) and \(\chi^{}_2\) be a primitive character modulo \(q_2\). Then \(\chi^{}_1 \neq \chi^{}_2\).

Proof.

Assume the contrary: \(\chi^{}_1=\chi^{}_2\). Let \(m\) and \(n\) be integers such that \((m,q_1)=(n,q_1)=1\) and \(m\equiv n\pmod{q_2}\). Then

$$\chi^{}_1(m)=\chi^{}_2(m)=\chi^{}_2(n)=\chi^{}_1(n).$$

Hence, \(\chi^{}_1\) restricted by \((n,q_1)=1\) has period \(q_2\). Hence, \(c(\chi^{}_1) \leq q_2\). Since \(\chi^{}_1\) is a primitive character modulo \(q_1\), we have \(c(\chi^{}_1)=q_1\). Thus, \(q_1\leq q_2\). Similarly, it can be proved that \(q_2 \leq q_1\). Hence, \(q_1=q_2\). We have arrived at a contradiction, which means that \(\chi^{}_1 \neq \chi^{}_2\). \(\quad\Box\)

4. Lemmas on \(\psi(x,\chi)\)

In this section we present some lemmas on \(\psi(x,\chi)\). Most of these lemmas are well known. The proof of Lemma 4.6 is based on Maynard’s ideas (see the proof of Theorem 3.2 in [5]). The proof of Lemma 4.9 follows a standard proof of the Bombieri–Vinogradov theorem (see, for example, [1, Ch. 28]).

Lemma 4.1.

Let \(u\geq 2\) be a real number, and let \(Q\geq 2\) and \(W\) be integers with \((W,Q)=1\). Then

$$\psi(u;Q,W) - \frac{u}{ \varphi (Q)} = \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \overline{\chi(W)} \psi'(u,\chi)$$

(the overbar denotes complex conjugation).

Proof.

We define

$$I_{Q,W}(n)= \begin{cases} \displaystyle 1 & \text{ }\, \displaystyle \text{if }\, n\equiv W {\textstyle\pmod{Q}} ,\\ \displaystyle 0 & \text{ }\, \displaystyle \text{otherwise}. \end{cases}$$

Since (see, for example, [1, Ch. 4])

$$\frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q}\overline{\chi(W)}\chi(n)= I_{Q,W}(n),$$

we have

$$\begin{aligned} \, \psi(u;Q,W)&= \sum_{\substack{n\leq u\\[1pt] n\equiv W\pmod{Q}}} \Lambda (n) = \sum_{n \leq u} \Lambda (n) I_{Q,W}(n) =\sum_{n \leq u} \Lambda (n) \frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q}\overline{\chi(W)}\chi(n) \\[3pt] &=\frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q}\overline{\chi(W)}\Biggl(\,\sum_{n\leq u} \Lambda (n) \chi(n)\Biggr) = \frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q}\overline{\chi(W)}\psi(u,\chi). \end{aligned}$$

Let \(\chi^{}_0\) be the principal character modulo \(Q\). Since \((W,Q)=1\), it follows that \(\chi^{}_0(W)=1\). We have

$$\sum_{\chi \in X_Q} \overline{\chi(W)} E_{\chi^{}_0}(\chi) u = \overline{\chi^{}_0(W)} u = u.$$

Hence,

$$\psi(u;Q,W) - \frac{u}{ \varphi (Q)} = \frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q}\overline{\chi(W)} \bigl(\psi(u,\chi) - E_{\chi^{}_0}(\chi) u\bigr) =\frac{1}{ \varphi (Q)}\sum_{\chi \in X_Q} \overline{\chi(W)} \psi'(u,\chi).$$

Lemma 4.1 is proved. \(\quad\Box\)

Lemma 4.2 (see, for example, [1, Ch. 14]).

There is a positive absolute constant \(a>0\) such that if \(\chi\) is a complex character modulo \(q,\) then \(L(s,\chi)\) has no zeros in the region

$$\Omega \colon\, \qquad \sigma \geq \begin{cases} \displaystyle 1- \frac{a}{\ln(q|t|)} & \textit{ if }\, \displaystyle |t|\geq 1,\\ \displaystyle 1- \frac{a}{\ln q} & \textit{ if }\, \displaystyle |t|<1 \end{cases}$$

(here \(s=\sigma + i t,\) \(\sigma = \operatorname{Re} s,\) and \(t=\operatorname{Im} s\)). If \(\chi\) is a real nonprincipal character modulo \(q,\) the only possible zero of \(L(s,\chi)\) in this region is a single (simple) real zero. Furthermore, \(L(s,\chi)\) can have a zero in the region \(\Omega\) for at most one of the real nonprincipal characters \(\chi\pmod{q}\).

Remark.

It is easy to see that the constant \(a\) can be replaced by any constant \(a^*\) such that \(0<a^*<a\).

Lemma 4.3 (see [1, Ch. 20]).

Let \(\chi\) be a nonprincipal character modulo \(q\) and \(2\leq T\leq u\). Then

$$\psi(u,\chi)=-\frac{u^{\beta_1}}{\beta_1}+ R_4(u,T),$$

where

$$|R_4(u,T)| \leq C\biggl(u \ln^2(qu)\exp\biggl(-\frac{a\ln u}{\ln(qT)} \biggr)+uT^{-1}\ln^2(qu)+u^{1/4}\ln u\biggr).$$

Here \(C>0\) is an absolute constant and \(a>0\) is the absolute constant in Lemma 4.2. The term \(-u^{\beta_1}/\beta_1\) should be omitted unless \(\chi\) is a real character for which \(L(s,\chi)\) has a zero \(\beta_1\) (which is necessarily unique, real, and simple) satisfying

$$\beta_1 > 1- \frac{a}{\ln q}.$$

Lemma 4.4 (Page’s theorem; see, for example, [1, Ch. 14]).

There are absolute constants \(a_1>0\) and \(a'_1>0\) such that the following holds. Let \(z\geq 3\) be a real number. Then there is at most one real primitive character \(\chi\) to a modulus \(q_0,\) \(3\leq q_0 \leq z,\) for which \(L(s,\chi)\) has a real zero \(\beta\) satisfying

$$\beta> 1 - \frac{a_1}{\ln z}.$$

If such a character \(\chi\) exists, then

$$q_0 \geq \frac{a'_1(\ln z)^2}{(\ln\ln z)^4}.$$

Such a modulus \(q_0\) is said to be an exceptional modulus in the interval \([3,z]\).

Lemma 4.5.

Let \(z\geq 3\) be a real number. If an exceptional modulus \(q_0\) in the interval \([3,z]\) exists, then the number \(q_0\) is of the form \(2^\alpha k,\) where \(\alpha\in\{0,\dots,3\}\) and \(k\geq 1\) is an odd square-free integer.

Proof.

Suppose an exceptional modulus \(q_0\) in the interval \([3,z]\) exists. In particular, this means that there exists a real primitive character \(\chi\) modulo \(q_0\). By Lemma 3.6, the number \(q_0\) is of the form \(2^\alpha k\) with \(\alpha\in\{0,\dots,3\}\) and an odd square-free integer \(k\geq 1\). \(\quad\Box\)

Lemma 4.6.

There are positive absolute constants \(c_0,\) \(c_1,\) \(\gamma_0,\) and \(C\) such that the following holds. Let \(x\geq c_0\) be a real number, \(q_0\) be an exceptional modulus in the interval \([3,\exp(2c_1\sqrt{\ln x})],\) \(Q\) be an integer such that \(3\leq Q\leq \exp(2 c_1 \sqrt{\ln x})\) and \(Q\neq q_0\) (the last inequality should be interpreted as follows: if \(q_0\) exists, then \(Q\neq q_0;\) if \(q_0\) does not exist, then \(Q\) is any integer in the indicated interval), and \(\chi\) be a primitive character modulo \(Q\). Then

$$\max_{2\leq u\leq x^{1+\gamma_0/\sqrt{\ln x}}}|\psi(u,\chi)|\leq C x\exp(-3c_1\sqrt{\ln x}).$$

Proof.

We will choose \(c_1\) and \(\gamma_0\) later. The number \(c_0\) depends on \(c_1\) and \(\gamma_0\) and is large enough, and \(x\geq c_0(c_1,\gamma_0)\). We put

$$z=\exp(2 c_1 \sqrt{\ln x}).$$

We have \(z\geq 3\) if the number \(c_0(c_1,\gamma_0)\) is chosen large enough. By Lemma 4.4, there is at most one real primitive \(\chi\) to a modulus \(q_0\), \(3\leq q_0 \leq z\), for which \(L(s,\chi)\) has a real zero \(\beta\) satisfying

$$ \beta > 1-\frac{a_1}{\ln z}= 1-\frac{a_1}{2c_1 \sqrt{\ln x}}.$$
(4.1)

If such a character \(\chi\) exists, then

$$ q_0 \geq \frac{a'_1(\ln z)^2}{(\ln\ln z)^4}= \frac{a'_1(2c_1\sqrt{\ln x})^2}{((1/2)\ln\ln x+\ln(2c_1))^4} \geq \frac{a'_1c_1^2\ln x}{(\ln\ln x)^4}$$
(4.2)

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough. Let \(Q\) be an integer such that \(3 \leq Q\leq \exp(2 c_1 \sqrt{\ln x})\) and \(Q\neq q_0\), and let \(\chi\) be a primitive character modulo \(Q\). Since \(Q>1\), we see that \(\chi\) is a nonprincipal character. By Lemma 4.3, if \(2 \leq T \leq u\), then

$$ \psi(u,\chi)=-\frac{u^{\beta_1}}{\beta_1}+ R_4(u,T),$$
(4.3)

where

$$ \begin{aligned} \, |R_4(u,T)| &\leq C\biggl(u \ln^2(Qu)\exp\biggl(-\frac{a\ln u}{\ln(QT)} \biggr)+uT^{-1}\ln^2(Qu)+u^{1/4}\ln u\biggr) \\[4pt] &= C(\Delta_1 + \Delta_2 +\Delta_3). \end{aligned}$$
(4.4)

The term \(-u^{\beta_1}/\beta_1\) is to be omitted unless \(\chi\) is a real character modulo \(Q\) for which \(L(s,\chi)\) has a zero \(\beta_1\) (which is necessarily unique, real, and simple) satisfying

$$\beta_1 > 1- \frac{a}{\ln Q}.$$

Let

$$2 \leq u \leq x^{1+ \gamma_0/\sqrt{\ln x}}.$$

Let \(u \geq c_2(c_1)\), where \(c_2(c_1)>0\) is a number depending only on \(c_1\). We choose

$$ T= \exp(4 c_1 \sqrt{\ln u}).$$
(4.5)

Then \(2 \leq T \leq u\) if \(c_2(c_1)\) is chosen large enough.

I. \(\,\)Now we estimate the quantity

$$\Delta_1 = u \ln^2(Qu)\exp\biggl(-\frac{a\ln u}{\ln(QT)} \biggr).$$

If \(c_0(c_1,\gamma_0)\) is chosen large enough, then

$$ 1+\frac{\gamma_0}{\sqrt{\ln x}}\leq 2.$$
(4.6)

Hence,

$$\begin{gathered} \, \ln u \leq \biggl( 1+\frac{\gamma_0}{\sqrt{\ln x}} \biggr)\ln x\leq 2 \ln x, \\[4pt] QT \leq \exp\bigl(2 c_1 \sqrt{\ln x} +4 c_1 \sqrt{\ln u}\,\bigr)\leq\exp\bigl(10 c_1 \sqrt{\ln x}\,\bigr),\nonumber\\[4pt] \ln(QT) \leq 10 c_1 \sqrt{\ln x},\qquad -\frac{a \ln u}{\ln(QT)}\leq -\frac{a\ln u}{10 c_1 \sqrt{\ln x}}.\nonumber \end{gathered}$$
(4.7)

If \(c_0(c_1,\gamma_0)\) is chosen large enough, then

$$\ln Q \leq 2 c_1 \sqrt{\ln x} \leq \ln x.$$

Therefore,

$$ \ln^2(Qu)\leq 2\bigl(\ln^2 Q + \ln^2 u\bigr)\leq 10 \ln^2 x=10\exp(2\ln\ln x).$$
(4.8)

We have

$$\Delta_1 \leq 10 \kern1pt u\exp\biggl(-\frac{a\ln u}{10c_1\sqrt{\ln x}} + 2\ln\ln x \biggr).$$

Consider two cases.

(1) Let \(x^{1/4} \leq u \leq x^{1+ \gamma_0/\sqrt{\ln x}}\). Then

$$\frac{\ln x}{4} \leq \ln u \leq \biggl( 1+ \frac{\gamma_0}{\sqrt{\ln x}} \biggr)\ln x\leq 2 \ln x.$$

Let

$$0<c_1 \leq \sqrt{\frac{a}{160}}\qquad\Rightarrow\qquad -\frac{a}{40 c_1}\leq -4 c_1.$$

Hence,

$$-\frac{a \ln u}{10 c_1 \sqrt{\ln x}} \leq -\frac{(a/4) \ln x}{10 c_1 \sqrt{\ln x}}=-\frac{a \sqrt{\ln x}}{40 c_1}\leq - 4c_1 \sqrt{\ln x}$$

and

$$-\frac{a \ln u}{10 c_1 \sqrt{\ln x}} + 2\ln\ln x \leq -4 c_1 \sqrt{\ln x} + 2\ln\ln x\leq -\frac72 c_1 \sqrt{\ln x}$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough. If \(0<\gamma_0 \leq c_1/2\), then

$$\Delta_1 \leq 10 \kern1pt x^{1+\gamma_0/\sqrt{\ln x}}\exp\biggl(-\frac72 c_1 \sqrt{\ln x}\biggr) =10 \kern1pt x\exp\biggl(-\frac72 c_1 \sqrt{\ln x} + \gamma_0 \sqrt{\ln x}\biggr)\leq 10 \kern1pt x\exp(-3 c_1\sqrt{\ln x}).$$

(2) Let \(c_2(c_1) \leq u < x^{1/4}\) (we may assume that \(c_0(c_1,\gamma_0)>(c_2(c_1))^4\) and \(c_2(c_1)\geq 10\)). We have

$$\begin{aligned} \, \Delta_1 &\leq 10 \kern1pt u\exp\biggl(-\frac{a\ln u}{10c_1\sqrt{\ln x}} + 2\ln\ln x\biggr) \leq 10 \kern1pt u\exp(2\ln\ln x) \\[4pt] &\leq 10 \kern1pt x^{1/4}\exp(2\ln\ln x) \leq 10 \kern1pt x\exp(-3 c_1\sqrt{\ln x}) \end{aligned}$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough.

Thus, if \(0<c_1<\sqrt{a/160}\), \(0<\gamma_0 \leq c_1/2\), \(x \geq c_0(c_1,\gamma_0)\), and \(c_2(c_1) \leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}\), then

$$\Delta_1 \leq 10 \kern1pt x\exp(-3 c_1\sqrt{\ln x}).$$

II. \(\,\)Now we estimate the quantity

$$\Delta_2 = u T^{-1} \ln^2(Qu).$$

From (4.5) and (4.8) we obtain

$$\Delta_2 \leq 10 \kern1pt u\exp\bigl(-4 c_1\sqrt{\ln u} + 2\ln\ln x\bigr).$$

Consider two cases.

(1) Let \(x^{9/10} \leq u \leq x^{1+ \gamma_0/\sqrt{\ln x}}\). Then

$$\frac{9}{10} \ln x \leq \ln u \leq \biggl( 1+\frac{\gamma_0}{\sqrt{\ln x}} \biggr)\ln x \leq 2 \ln x,\qquad -4c_1 \sqrt{\ln u}\leq -4 c_1 \sqrt{\frac{9}{10} \ln x}< - \frac{15}{4} c_1 \sqrt{\ln x}.$$

Since \(0<\gamma_0 \leq c_1/2\), we have

$$\begin{aligned} \, \Delta_2&\leq 10 \kern1pt x^{1+ \gamma_0/\sqrt{\ln x}}\exp\biggl(-\frac{15}{4} c_1 \sqrt{\ln x} + 2\ln\ln x\biggr) = 10 \kern1pt x\exp\biggl(- \frac{15}{4} c_1 \sqrt{\ln x} + 2\ln\ln x+ \gamma_0 \sqrt{\ln x}\biggr) \\[3pt] &\leq 10 \kern1pt x\exp\biggl(- \frac{13}{4} c_1 \sqrt{\ln x} + 2\ln\ln x\biggr) \leq 10 \kern1pt x\exp(- 3 c_1 \sqrt{\ln x}) \end{aligned}$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough.

(2) Let \(c_2(c_1) \leq u < x^{9/10}\). Then

$$\begin{aligned} \, \Delta_2 &\leq 10 \kern1pt u\exp\bigl(-4 c_1\sqrt{\ln u} + 2\ln\ln x\bigr) \leq 10 \kern1pt u\exp(2\ln\ln x) \\[4pt] &\leq 10 \kern1pt x^{9/10}\exp( 2\ln\ln x) \leq 10 \kern1pt x\exp(-3 c_1 \sqrt{\ln x}) \end{aligned}$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough.

Thus, if \(0<c_1<\sqrt{a/160}\), \(0<\gamma_0 \leq c_1/2\), \(x \geq c_0(c_1,\gamma_0)\), and \(c_2(c_1) \leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}\), then

$$\Delta_2 \leq 10 \kern1pt x\exp(-3 c_1\sqrt{\ln x}).$$

III. \(\,\)Now we estimate the quantity

$$\Delta_3 = u^{1/4}\ln u.$$

Since (see (4.6) and (4.7))

$$\ln u\leq 2 \ln x \qquad\text{and}\qquad u^{1/4}\leq x^{(1+\gamma_0/\sqrt{\ln x})/4}\leq x^{1/2},$$

we have

$$\Delta_3 \leq 2 x^{1/2}\ln x \leq x\exp(-3 c_1 \sqrt{\ln x})$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough.

Finally, we obtain the following (see (4.4)): if \(0<c_1<\sqrt{a/160}\), \(0<\gamma_0 \leq c_1/2\), \(x \geq c_0(c_1,\gamma_0)\), and \(c_2(c_1) \leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}\), then

$$ |R_4(u,T)| \leq 21 C x\exp(-3 c_1\sqrt{\ln x}),$$
(4.9)

where \(C>0\) is an absolute constant.

IV. \(\,\)Now we estimate the quantity (see (4.3))

$$\Delta_4 = \biggl|-\frac{u^{\beta_1}}{\beta_1}\biggr|.$$

If \(\chi\) is not a real character modulo \(Q\) for which \(L(s,\chi)\) has a zero \(\beta_1\) (which is necessarily unique, real, and simple) satisfying

$$\beta_1 > 1- \frac{a}{\ln Q},$$

then the term \(-u^{\beta_1}/\beta_1\) in (4.3) is to be omitted, and there is nothing to estimate. Let \(\chi\) be such a character. Then \(\chi\) is a real primitive character modulo \(Q\). Since \(Q\neq q_0\), we have (see Lemma 3.7 and (4.1))

$$\beta_1 \leq 1-\frac{a_1}{\ln z}= 1-\frac{a_1}{2c_1 \sqrt{\ln x}}.$$

Hence,

$$|u^{\beta_1}|= u^{\beta_1} \leq u^{1-a_1/ (2c_1 \sqrt{\ln x})}=u\exp\biggl(-\frac{a_1\ln u}{2 c_1 \sqrt{\ln x}} \biggr).$$

By the remark made after Lemma 4.2, we may assume that \(0<a < 1/2\). Since \(Q\geq 3\), we have

$$\beta_1 > 1 - \frac{a}{\ln Q}> 1-\frac{1}{2\ln 3}> \frac{1}{2}.$$

Hence, \(0<1/{\beta_1}\leq 2\). Thus,

$$ \Delta_4 \leq 2 u\exp\biggl(-\frac{a_1\ln u}{2c_1\sqrt{\ln x}} \biggr).$$
(4.10)

Consider two cases.

(1) Let \(x^{1/2} \leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}\). We have (see (4.6))

$$\frac{\ln x}{2} \leq \ln u \leq \biggl( 1+\frac{\gamma_0}{\sqrt{\ln x}} \biggr)\ln x \leq 2\ln x.$$

We take

$$0<c_1<\sqrt{\frac{\min\{a,a_1\}}{160}}\qquad\Rightarrow\qquad -\frac{a_1}{4c_1}\leq -\frac72 c_1.$$

Then,

$$-\frac{a_1 \ln u}{2 c_1 \sqrt{\ln x}}\leq -\frac{(a_1/2)\ln x}{2 c_1\sqrt{\ln x}} = -\frac{a_1\sqrt{\ln x}}{4 c_1}\leq -\frac72 c_1 \sqrt{\ln x}.$$

Since \(0<\gamma_0 \leq c_1/2\), we obtain (see (4.10))

$$\Delta_4\leq 2 x^{1+\gamma_0/\sqrt{\ln x}}\exp\biggl(-\frac72 c_1 \sqrt{\ln x}\biggr) =2x\exp\biggl(-\frac72 c_1 \sqrt{\ln x}+\gamma_0\sqrt{\ln x}\biggr) \leq 2x\exp(-3 c_1 \sqrt{\ln x}).$$

(2) Let \(c_2(c_1) \leq u < x^{1/2}\). Then (see (4.10))

$$\Delta_4 \leq 2 u \leq 2 x^{1/2}\leq 2 x\exp(-3 c_1 \sqrt{\ln x})$$

provided that \(c_0(c_1,\gamma_0)\) is chosen large enough. Combining the estimates found at steps I–IV together, we obtain the following (see (4.3) and (4.9)): if \(0<c_1<\sqrt{\min\{a,a_1\}/160}\), \(0<\gamma_0 \leq c_1/2\), \(x \geq c_0(c_1,\gamma_0)\), and \(c_2(c_1) \leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}\), then

$$|\psi(u,\chi)| \leq (21 C +2) x\exp(-3 c_1\sqrt{\ln x}),$$

where \(C>0\) is an absolute constant.

There is a number \(d(c_1)>0\), depending only on \(c_1\), such that

$$t\exp(-3 c_1 \sqrt{\ln t})\geq 1\qquad \text{if}\quad t\geq d(c_1).$$

We may assume that \(c_0(c_1,\gamma_0) > d(c_1)\). Hence, if \(2 \leq u < c_2(c_1)\), then (see (2.1))

$$|\psi(u,\chi)|=\Biggl|\sum_{n\leq u} \Lambda (n)\chi(n)\Biggr|\leq \sum_{n\leq u} \Lambda (n)=\psi(u) \leq b_6 u\leq b_6 c_2(c_1) \leq b_6 c_2(c_1) x\exp(-3 c_1 \sqrt{\ln x}).$$

Thus, if \(0<c_1<\sqrt{\min\{a,a_1\}/160}\), \(0<\gamma_0 \leq c_1/2\), and \(x \geq c_0(c_1,\gamma_0)\), then

$$\max_{2\leq u \leq x^{1+\gamma_0/\sqrt{\ln x}}}|\psi(u,\chi)| \leq \bigl(21 C +2+ b_6 c_2(c_1)\bigr) x\exp(-3 c_1\sqrt{\ln x}),$$

where \(C>0\) is an absolute constant. We take

$$c_1=\frac{\sqrt{\min\{a,a_1\}}}{16}\qquad\text{and}\qquad \gamma_0 = \frac{c_1}2= \frac{\sqrt{\min\{a,a_1\}}}{32}.$$

Since \(a>0\) and \(a_1>0\) are absolute constants, we see that \(c_1\), \(\gamma_0\), \(c_0(c_1,\gamma_0)\) and \(c_2(c_1)\) are positive absolute constants. Lemma 4.6 is proved. \(\quad\Box\)

Lemma 4.7 (see [1, Ch. 19]).

Let \(u \geq 2\) be a real number, \(Q\geq 2\) be an integer, \(\chi \in X_Q,\) and \(\chi^{}_1\) be a primitive character modulo \(q_1\) inducing \(\chi\). Then

$$|\psi'(u,\chi) - \psi'(u, \chi^{}_1)|\leq \ln^2(Qu).$$

Lemma 4.8 (see [1, Ch. 28]).

Let \(Q_1,\) \(Q_2,\) and \(t\) be real numbers such that \(1\leq Q_1 < Q_2\) and \(t\geq 2\). Then

$$\sum_{Q_1 < Q \leq Q_2} \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq t} |\psi(u,\chi)| \leq C\ln^4(t Q_2)\biggl( \frac{t}{Q_1}+ t^{5/6} \ln Q_2+ t^{1/2}Q_2\biggr),$$

where \(C>0\) is an absolute constant.

Lemma 4.9.

Let \(\varepsilon\) and \(\delta\) be real numbers such that \(0<\varepsilon<1\) and \(0<\delta<1/2\). Then there exists a number \(c(\varepsilon,\delta)>0,\) depending only on \(\varepsilon\) and \(\delta,\) such that if \(x\in{\mathbb R}\) and \(q\in{\mathbb Z}\) satisfy the conditions \(x\geq c(\varepsilon,\delta)\) and \(1 \leq q \leq (\ln x)^{1-\varepsilon},\) then there is a positive integer \(B\) for which the following relations hold:

$$1\leq B \leq \exp(c_1 \sqrt{\ln x}),\qquad 1\leq \frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1$$

and

$$\sum_{\substack{1\leq Q\leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}} \;\max_{W\in{\mathbb Z} \colon\, \, (W,Q)=1}\biggl|\psi(u;Q,W)-\frac{u}{ \varphi (Q)}\biggr| \leq c_2 x\exp(-c_3\sqrt{\ln x}).$$

Here \(c_1,\) \(\gamma,\) \(c_2,\) and \(c_3\) are positive absolute constants.

Proof.

Let \(c_0\), \(c_1\), \(\gamma_0\) and \(C\) be the positive absolute constants in Lemma 4.6. We will choose \(\gamma\) and \(c(\varepsilon,\delta)=c(\varepsilon,\delta,\gamma)\) later; they are assumed to be small and large enough, respectively; for now, let \(0<\gamma \leq \gamma_0\), \(c(\varepsilon,\delta,\gamma) \geq c_0\), and \(x \geq c(\varepsilon,\delta,\gamma)\). Let \(q_0\) be the exceptional modulus in the interval \([3,\exp(2 c_1 \sqrt{\ln x})]\). If \(q_0\) does not exist, then we take \(B=1\). If \(q_0\) exists, then (see (4.2))

$$q_0 \geq \frac{a'_1c_1^2\ln x}{(\ln\ln x)^4}=\frac{c_4\ln x}{(\ln\ln x)^4},$$

where \(c_4>0\) is an absolute constant. We have \(q_0\geq 24\) if \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. By Lemma 4.5, the number \(q_0\) is of the form \(2^\alpha k\), where \(\alpha\in\{0,\dots,3\}\) and \(k\geq 3\) is an odd square-free integer. We put

$$M_1=\frac{q_0}{2^\alpha}\geq \frac{q_0}{8}\geq \frac{c_4\ln x}{8(\ln\ln x)^4}.$$

Let \(\tau = (M_1,q)\) and \(M_2=M_1/\tau\). Then \((M_2, q)=1\). Since \(\tau \leq q \leq (\ln x)^{1-\varepsilon}\), we have

$$M_2=\frac{M_1}{\tau}\geq \frac{M_1}{(\ln x)^{1-\varepsilon}}\geq \frac{c_4\ln x}{8(\ln\ln x)^4 (\ln x)^{1-\varepsilon}} =\frac{c_4(\ln x)^\varepsilon}{8(\ln\ln x)^4}.$$

If \(c(\varepsilon,\delta,\gamma)\) is chosen large enough, then \(M_2 \geq 3\). Hence, \(M_2\geq 3\) is an odd square-free integer. Furthermore, we have \((M_2, q)=1\) and \(M_2\) divides \(q_0\). Let \(B\) be the largest prime divisor of \(M_2\). Hence, \(B\geq 3\) is a prime number and \(B\) divides \(q_0\). We have (see Lemma 2.4)

$$\frac{B}{ \varphi (B)} = \frac{B}{B(1-1/B)}=\frac{1}{1-1/B}\leq \frac{1}{1-1/3}=\frac{3}{2}.$$

Thus, \(1 \leq B \leq \exp(2c_1 \sqrt{\ln x})\) is an integer, \((B,q)=1\), \(1\leq{B}/{ \varphi (B)} \leq 2\), and \(B\geq 3\) is a prime divisor of \(q_0\) if \(q_0\) exists.

Let \(u\) be a real number such that \(2 \leq u \leq x^{1+\gamma/ \sqrt{\ln x}}\), and let \(Q\) and \(W\) be integers such that \(2\leq Q \leq x^{1/2 - \delta}\), \((Q, B)=1\), and \((W,Q)=1\). By Lemma 4.1, we have

$$\psi(u;Q,W) - \frac{u}{ \varphi (Q)} = \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \overline{\chi(W)} \psi'(u,\chi).$$

Therefore,

$$\biggl|\psi(u;Q,W) - \frac{u}{ \varphi (Q)}\biggr| \leq \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q}\mathopen|\psi'(u,\chi)|.$$

Since the right-hand side of this inequality does not depend on \(W\), we have

$$\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\psi(u;Q,W) - \frac{u}{ \varphi (Q)}\biggr| \leq \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q}\mathopen|\psi'(u,\chi)|.$$

Let \(\chi\in X_Q\), and let \(\chi^{}_1\) be a primitive character modulo \(q_1\) inducing \(\chi\). From Lemma 3.4 and the definition of the inducing character (which is given below Lemma 3.4), we have \(q_1 = c(\chi)\), and hence \(q_1\mid Q\) (see Lemma 3.3). Applying Lemma 4.7, we find

$$|\psi'(u,\chi)| \leq |\psi'(u, \chi^{}_1)| +\ln^2(Qu).$$

Since \(\# X_Q = \varphi (Q)\), we obtain

$$\begin{aligned} \, \max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\psi(u;Q,W) - \frac{u}{ \varphi (Q)}\biggr| &\leq \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \bigl(|\psi'(u,\chi^{}_1)|+\ln^2(Qu)\bigr) \\[3pt] &= \ln^2(Qu) + \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \mathopen|\psi'(u,\chi^{}_1)|. \end{aligned}$$

We can assume that

$$ 1+ \frac{\gamma}{\sqrt{\ln x}} \leq 2$$
(4.11)

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. Hence,

$$\begin{gathered} \, 0<\ln u \leq \biggl( 1+ \frac{\gamma}{\sqrt{\ln x}} \biggr) \ln x \leq 2\ln x,\qquad \ln^2u\leq 4\ln^2x,\\[3pt] 0<\ln Q \leq \biggl( \frac{1}{2} - \delta\biggr)\ln x \leq \ln x,\qquad \ln^2Q \leq \ln^2x,\\[3pt] \ln^2(Qu)\leq 2\bigl(\ln^2Q+\ln^2u\bigr)\leq 10 \ln^2x. \end{gathered}$$

We obtain

$$\max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}\;\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\psi(u;Q,W) - \frac{u}{ \varphi (Q)}\biggr| \leq 10\ln^2x + \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}|\psi'(u,\chi^{}_1)|.$$

Therefore,

$$\begin{aligned} \, \nonumber S&=\sum_{\substack{1\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} A_Q = A_1 + \sum_{\substack{2\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} A_Q \\ \nonumber &\leq A_1 + \sum_{\substack{2\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\Biggl( 10\ln^2x + \frac{1}{ \varphi (Q)} \sum_{\chi \in X_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi^{}_1)|\Biggr) \\ \nonumber &\leq 10 \kern1pt x^{1/2 - \delta}\ln^2x+ A_1+ \sum_{\substack{2\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} \,\sum_{\chi \in X_Q}\frac{1}{ \varphi (Q)} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi^{}_1)| \\[2pt] &= 10 \kern1pt x^{1/2 - \delta}\ln^2x+ A_1+ S', \end{aligned}$$
(4.12)

where

$$A_Q:= \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}\;\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\psi(u;Q,W) -\frac{u}{ \varphi (Q)}\biggr|.$$

Let us estimate the sum \(S'\). Let \(Q\) be an integer with \(2 \leq Q \leq x^{1/2 - \delta}\) and \((Q,B)=1\), let \(\chi\in X_Q\), and let \(\chi^{}_1\) be the primitive character modulo \(q_1\) inducing \(\chi\). Since \(q_1\mid Q\), we have \(1\leq q_1 \leq x^{1/2 - \delta}\) and \((q_1,B)=1\). Hence,

$$\begin{aligned} \, S' &= \sum_{\substack{2\leq Q \leq x^{1/2 - \delta}\\[1pt](Q,B)=1}}\; \sum_{\chi \in X_Q}\frac{1}{ \varphi (Q)} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi^{}_1)| \\ &\leq \sum_{\substack{1\leq q_1 \leq x^{1/2 - \delta}\\[1pt] (q_1,B)=1}}\; \sum_{\chi^{}_1 \in X^*_{q_1}} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}|\psi'(u,\chi^{}_1)| \sum_{1 \leq m \leq x^{1/2 - \delta}/q_1}\frac{1}{ \varphi (m q_1)}. \end{aligned}$$

Applying Lemmas 2.5 and 2.9, we obtain

$$\sum_{1 \leq m \leq x^{1/2 - \delta}/q_1}\frac{1}{ \varphi (m q_1)}\leq \frac{1}{ \varphi (q_1)} \sum_{1 \leq m\leq x^{1/2 - \delta}/q_1} \frac{1}{ \varphi (m)} \leq \frac{1}{ \varphi (q_1)} \sum_{1 \leq m \leq x^{1/2}}\frac{1}{ \varphi (m)}\leq \frac{1}{ \varphi (q_1)} C\ln x,$$

where \(C>0\) is an absolute constant. We have

$$S' \leq C\ln x \sum_{\substack{1\leq q_1 \leq x^{1/2 - \delta}\\[1pt] (q_1,B)=1}}\frac{1}{ \varphi (q_1)} \sum_{\chi^{}_1 \in X^*_{q_1}} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi^{}_1)|.$$

Redenoting \(q_1\) by \(Q\) and \(\chi^{}_1\) by \(\chi\), we find

$$S' \leq C\ln x \sum_{\substack{1\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi)| =C\ln x\bigl(S'_1 + S'_2 + S'_3 \bigr), $$
(4.13)

where

$$\begin{gathered} \, S'_1=\sum_{\substack{1\leq Q \leq \ln x\\[1pt] (Q,B)=1}} R_Q,\qquad S'_2=\sum_{\substack{\ln x < Q \leq \exp(c_1\sqrt{\ln x})\\[1pt] (Q,B)=1}}R_Q,\qquad S'_3=\sum_{\substack{\exp(c_1\sqrt{\ln x}) < Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} R_Q, \\[4pt] R_Q:= \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}|\psi'(u,\chi)|, \end{gathered}$$

and \(c_1>0\) is the absolute constant in Lemma 4.6.

I. \(\,\)Now we estimate \(S'_1\). We have

$$ S'_1 = \sum_{\substack{1\leq Q \leq \ln x\\[1pt] (Q,B)=1}} R_Q \leq R_1 + \sum_{2\leq Q \leq \ln x} R_Q = R_1 + S'_4.$$
(4.14)

(1) Let us estimate \(R_1\). Since \(\# X^*_1=1\), we have

$$R_1 = \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi)|,$$

where \(\chi\in X^*_1\), i.e., \(\chi(n)=1\) for any \(n\in{\mathbb Z}\). Since \(\chi\) is the principal character modulo \(1\), it follows that

$$\psi'(u,\chi) = \psi(u,\chi) - u.$$

We have

$$\psi(u,\chi) = \sum_{n\leq u} \Lambda (n)\chi(n)=\sum_{n\leq u} \Lambda (n)=\psi(u),\qquad \psi'(u,\chi) = \psi(u) - u.$$

It is well known (see, for example, [1, Ch. 18]) that

$$ |\psi(u) - u| \leq C u\, \exp(-c\sqrt{\ln u}),\qquad u \geq 2,$$
(4.15)

where \(C>0\) and \(c>0\) are absolute constants. Consider two cases.

(i) Let \(x^{1/4} \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}\) (we may assume that \(c(\varepsilon,\delta,\gamma)>16\)). Then (see (4.11))

$$\frac{1}{4} \ln x \leq \ln u \leq \biggl( 1+ \frac{\gamma}{\sqrt{\ln x}} \biggr)\ln x \leq 2 \ln x,\qquad -c\sqrt{\ln u} \leq -\frac{c}{2} \sqrt{\ln x}.$$

Hence,

$$\begin{aligned} \, |\psi'(u,\chi)|&\leq C u\, \exp(-c\sqrt{\ln u})\leq C x^{1+\gamma/\sqrt{\ln x}} \exp\Bigl(-\frac c2\sqrt{\ln x} \kern1pt \Bigr) \\[3pt] &= Cx\exp\Bigl(\Bigl(\gamma-\frac c2\Bigr)\sqrt{\ln x} \kern1pt \Bigr) \leq Cx\exp \Bigl(-\frac c4\sqrt{\ln x} \kern1pt \Bigr) \end{aligned}$$

provided that \(0<\gamma \leq c/4\).

(ii) Let \(2 \leq u < x^{1/4}\). Then

$$|\psi'(u,\chi)|\leq C u\exp(-c\sqrt{\ln u})\leq Cu \leq C x^{1/4}\leq Cx\exp \Bigl(-\frac c4\sqrt{\ln x} \kern1pt \Bigr)$$

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough.

We obtain

$$ R_1 = \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi)|\leq Cx\exp\Bigl(-\frac c4\sqrt{\ln x} \kern1pt \Bigr).$$
(4.16)

(2) Now we estimate

$$ S'_4 = \sum_{2\leq Q \leq \ln x} \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi'(u,\chi)|.$$
(4.17)

Let \(Q\) be an integer such that \(2 \leq Q \leq \ln x\), and let \(\chi \in X^*_Q\). Then \(\chi\) is a nonprincipal character modulo \(Q\), and hence \(\psi'(u,\chi) = \psi(u,\chi)\). Consider two cases.

(i) Let \(x^{1/4} \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}\). Then (see (4.11))

$$\frac{1}{4} \ln x \leq \ln u\leq \biggl( 1+\frac{\gamma}{\sqrt{\ln x}} \biggr)\ln x \leq 2 \ln x.$$

We may assume that \(c(\varepsilon,\delta,\gamma) \geq e^{16}\). Hence, \(\ln u \geq (\ln x)/4\geq 4\). We have

$$2 \leq Q \leq \ln x \leq 4 \ln u \leq \ln^2 u.$$

Therefore (see, for example, [1, Ch. 22]),

$$|\psi(u,\chi)| \leq C u\exp\bigl(-c(2) \sqrt{\ln u}\bigr),$$

where \(C>0\) and \(c(2)>0\) are absolute constants. We have

$$-c(2)\sqrt{\ln u} \leq -\frac{c(2)}{2}\sqrt{\ln x}$$

and

$$\begin{aligned} \, |\psi(u,\chi)| &\leq C u\exp\biggl(-\frac{c(2)}2 \sqrt{\ln x}\biggr) \leq C x^{1+\gamma/\sqrt{\ln x}}\exp\biggl(-\frac{c(2)}2 \sqrt{\ln x}\biggr) \\[3pt] &= C x\exp\biggl(\!\biggl(\gamma-\frac{c(2)}2 \biggr) \sqrt{\ln x}\biggr) \leq Cx\exp\biggl(-\frac{c(2)}4 \sqrt{\ln x}\biggr) \end{aligned}$$

provided that \(0<\gamma \leq c(2)/4\).

(i) Let \(2 \leq u < x^{1/4}\). Then (see (2.1))

$$\psi(u,\chi) = \sum_{n \leq u} \Lambda (n) \chi(n)$$

and

$$|\psi(u,\chi)|\leq \sum_{n \leq u} \Lambda (n) = \psi(u)\leq b_6 u \leq b_6 x^{1/4} \leq Cx\exp\biggl(- \frac{c(2)}4\sqrt{\ln x}\biggr)$$

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. Hence,

$$\max_{2 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi(u,\chi)| \leq Cx\exp\biggl(- \frac{c(2)}4\sqrt{\ln x}\biggr).$$

Substituting this estimate into (4.17) and using the fact that \(\#X^*_Q\leq \#X_Q= \varphi (Q)\), we obtain

$$\begin{aligned} \, S'_4 &\leq Cx\exp\biggl(- \frac{c(2)}4\sqrt{\ln x}\biggr)\ln x = Cx\exp\biggl(- \frac{c(2)}4\sqrt{\ln x} + \ln\ln x\biggr) \nonumber\\[3pt] &\leq Cx\exp\biggl(- \frac{c(2)}8\sqrt{\ln x}\biggr) \end{aligned}$$
(4.18)

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough.

Substituting (4.16) and (4.18) into (4.14), we find

$$ S'_1 \leq Cx\exp(-c\sqrt{\ln x}),$$
(4.19)

where \(C>0\) and \(c>0\) are absolute constants.

II. \(\,\)Now we estimate the quantity

$$S'_3 = \sum_{\substack{\exp(c_1\sqrt{\ln x}) < Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}|\psi'(u,\chi)|.$$

Let \(Q\) be an integer with \(\exp(c_1\sqrt{\ln x}) < Q \leq x^{1/2 - \delta}\) and \((Q,B)=1\), and let \(\chi\in X^*_Q\). Since \(Q>1\), we see that \(\chi\) is a nonprincipal character modulo \(Q\). Hence,

$$\psi'(u,\chi) = \psi(u,\chi).$$

We have

$$\begin{aligned} \, S'_3 &= \sum_{\substack{\exp(c_1\sqrt{\ln x}) < Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi(u,\chi)| \\ &\leq \sum_{\exp(c_1\sqrt{\ln x}) < Q \leq x^{1/2 - \delta}} \frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi(u,\chi)|. \end{aligned}$$

Applying Lemma 4.8 with \(Q_1 = \exp(c_1\sqrt{\ln x})\), \(Q_2= x^{1/2 - \delta}\), and \(t=x^{1+\gamma/\sqrt{\ln x}}\), we obtain

$$S'_3 \leq C\ln^4\bigl(x^{3/2 - \delta +\gamma/\sqrt{\ln x}}\bigr)\Bigl(x\exp\bigl((\gamma - c_1)\sqrt{\ln x} \kern1pt \bigr) + x^{(5/6)(1+\gamma/\sqrt{\ln x})} \ln(x^{1/2 - \delta})+ x^{1-\delta+ \gamma/(2\sqrt{\ln x})} \Bigr).$$

We can assume that

$$\frac{\gamma}{\sqrt{\ln x}} \leq \delta \qquad\text{and}\qquad \frac{5}{6}\biggl( 1+\frac{\gamma}{\sqrt{\ln x}} \biggr)\leq \frac9{10}$$

if \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. Increasing \(C\) if necessary, we have

$$S'_3 \leq C\ln^4 x\,\bigl(x\exp\bigl((\gamma - c_1)\sqrt{\ln x} \kern1pt \bigr)+ x^{9/10} \ln x+ x^{1-\delta/2}\bigr).$$

Then

$$(\gamma - c_1)\sqrt{\ln x} \leq -\frac{c_1}{2}\sqrt{\ln x}$$

provided that \(0<\gamma\leq c_1/2\). We obtain

$$\begin{gathered} \, x\exp\bigl((\gamma - c_1)\sqrt{\ln x} \kern1pt \bigr)\ln^4x \leq x\exp\Bigl(-\frac{c_1}2 \sqrt{\ln x}+ 4\ln\ln x\Bigr) \leq x\exp\Bigl(-\frac{c_1}4 \sqrt{\ln x} \kern1pt \Bigr),\\[4pt] x^{9/10}\ln^5x\leq x\exp\Bigl(-\frac{c_1}4\sqrt{\ln x} \kern1pt \Bigr),\qquad x^{1-\delta/2}\ln^4 x \leq x\exp\Bigl(-\frac{c_1}4\sqrt{\ln x} \kern1pt \Bigr) \end{gathered}$$

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. Redenoting \(3C\) by \(C\) and \(c_1/4\) by \(c\), we arrive at

$$ S'_3 \leq Cx\exp(-c\sqrt{\ln x}),$$
(4.20)

where \(C>0\) and \(c>0\) are absolute constants.

III. \(\,\)Now we estimate the quantity

$$S'_2= \sum_{\substack{\ln x < Q \leq \exp(c_1\sqrt{\ln x})\\[1pt] (Q,B)=1}}\frac{1}{ \varphi (Q)} \sum_{\chi\in X^*_Q} \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}|\psi'(u,\chi)|.$$

Let \(Q\) be an integer with \(\ln x < Q \leq \exp(c_1\sqrt{\ln x})\) and \((Q,B)=1\), and let \(\chi\in X^*_Q\). Since \(Q>1\), we see that \(\chi\) is a nonprincipal character modulo \(Q\), and hence \(\psi'(u,\chi)= \psi(u,\chi)\). We recall that if an exceptional modulus \(q_0\) in the interval \([3,\exp(2c_1\sqrt{\ln x})]\) does not exist, then \(B=1\); if \(q_0\) exists, then \(B \geq3\) is a prime divisor of \(q_0\), and so \(Q\neq q_0\). Since \(0<\gamma \leq \gamma_0\) and \(c(\varepsilon,\delta,\gamma) \geq c_0\), we see from Lemma 4.6 that

$$\max_{2 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}} |\psi(u,\chi)| \leq Cx\exp(-3c_1\sqrt{\ln x}).$$

Since \(\#X^*_Q\leq \#X_Q= \varphi (Q)\), we obtain

$$\begin{aligned} \, S'_2 &\leq \sum_{\substack{\ln x < Q \leq \exp(c_1\sqrt{\ln x})\\[1pt] (Q,B)=1}} Cx\exp(-3c_1\sqrt{\ln x}) \leq Cx\exp(-3c_1\sqrt{\ln x}) \exp(c_1\sqrt{\ln x}) \nonumber\\[2pt] &= Cx\exp(-2c_1\sqrt{\ln x}). \end{aligned}$$
(4.21)

From (4.19)–(4.21) we find

$$ S'_1 + S'_2+ S'_3 \leq \widetilde{C}{} x\exp(- \widetilde{c}{} \sqrt{\ln x}),$$
(4.22)

where \( \widetilde{C}{} >0\) and \( \widetilde{c}{} > 0\) are absolute constants. Substituting (4.22) into (4.13), we obtain

$$S' \leq C'x\exp\bigl(- \widetilde{c}{} \sqrt{\ln x} + \ln\ln x\bigr)\leq C'x\exp\Bigl(-\frac{ \widetilde{c}{} }2\sqrt{\ln x} \kern1pt \Bigr)$$

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough. Redenoting \(C'\) by \(C\) and \( \widetilde{c}{} /2\) by \(c\), we arrive at

$$ S' \leq Cx\exp(-c\sqrt{\ln x}),$$
(4.23)

where \(C>0\) and \(c>0\) are absolute constants.

IV. \(\,\)We have

$$ x^{1/2 - \delta}\ln^2x\leq x^{1/2}\ln^2x \leq x\exp(-c\sqrt{\ln x})$$
(4.24)

provided that \(c(\varepsilon,\delta,\gamma)\) is chosen large enough (here \(c>0\) is the absolute constant in (4.23)).

V. \(\,\)Now we estimate the quantity

$$A_1= \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}}\;\max_{W\in{\mathbb Z}}|\psi(u;1,W) - u|.$$

Let \(W\in{\mathbb Z}\). We have

$$\psi(u;1,W)=\sum_{n\leq u,\ n\equiv W\pmod{1}} \Lambda (n) = \sum_{n\leq u} \Lambda (n) = \psi(u).$$

Hence,

$$A_1 = \max_{2\leq u \leq x^{1+\gamma/\sqrt{\ln x}}} | \psi(u) - u|.$$

Using (4.15) and arguing as in cases I(1), (i) and I(1), (ii), we obtain

$$ A_1 \leq Cx\exp(-c\sqrt{\ln x}),$$
(4.25)

where \(C>0\) and \(c>0\) are absolute constants.

Substituting (4.23)–(4.25) into (4.12), we find

$$S\leq Cx\exp(-c\sqrt{\ln x}),$$

where \(C>0\) and \(c>0\) are absolute constants. Thus, if \(\gamma\) is a sufficiently small positive absolute constant, \(x \geq c(\varepsilon,\delta,\gamma)\) is a real number, and \(q\) is an integer such that \(1\leq q \leq (\ln x)^{1-\varepsilon}\), then there is an integer \(B\) such that

$$1\leq B \leq \exp(2 c_1\sqrt{\ln x}),\qquad 1\leq \frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1$$

and

$$\sum_{\substack{1\leq Q\leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}} \,\max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}} \;\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\psi(u;Q,W)-\frac{u}{ \varphi (Q)}\biggr| \leq C x\exp(-c\sqrt{\ln x}),$$

where \(c_1\), \(C\), and \(c\) are positive absolute constants. Let us redenote \(2c_1\) by \(c_1\), \(C\) by \(c_2\), and \(c\) by \(c_3\). Since \(\gamma\) is an absolute constant, we see that the positive number \(c(\varepsilon,\delta,\gamma)= c(\varepsilon,\delta)\) depends only on \(\varepsilon\) and \(\delta\). Lemma 4.9 is proved. \(\quad\Box\)

Lemma 4.10.

Let \(\varepsilon\) and \(\delta\) be real numbers such that \(0<\varepsilon<1\) and \(0<\delta<1/2\). Then there is a number \(c(\varepsilon,\delta)>0,\) depending only on \(\varepsilon\) and \(\delta,\) such that if \(x\in{\mathbb R}\) and \(q\in{\mathbb Z}\) satisfy the conditions \(x\geq c(\varepsilon,\delta)\) and \(1 \leq q \leq (\ln x)^{1-\varepsilon},\) then there is a positive integer \(B\) for which the following relations hold:

$$1\leq B \leq \exp(c_1 \sqrt{\ln x}),\qquad 1\leq \frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1$$

and

$$\sum_{\substack{1\leq Q\leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}} \;\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \kern1pt \biggl|\pi(u;Q,W)-\frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq c_2 x\exp(-c_3\sqrt{\ln x}).$$

Here \(c_1,\) \(\gamma,\) \(c_2,\) and \(c_3\) are positive absolute constants.

Proof.

We will choose the number \( \widetilde{c}{} (\varepsilon,\delta)\) later; it is assumed to be large enough. Let \( \widetilde{c}{} (\varepsilon,\delta) \geq c(\varepsilon,\delta)\), where \(c(\varepsilon,\delta)\) is the number in Lemma 4.9. Let \(x\in{\mathbb R}\) and \(q\in{\mathbb Z}\) be such that \(x \geq \widetilde{c}{} (\varepsilon,\delta)\) and \(1 \leq q \leq (\ln x)^{1-\varepsilon}\). Then, by Lemma 4.9, there is a positive integer \(B\) such that

$$ 1\leq B \leq \exp(c_1 \sqrt{\ln x}),\qquad 1\leq \frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1$$
(4.26)

and

$$ \sum_{\substack{1\leq Q\leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}} \;\max_{W\in{\mathbb Z} \colon\, (W,Q)=1} |R(u;Q,W)| \leq c_2 x\exp(-c_3\sqrt{\ln x}),$$
(4.27)

where

$$R(u;Q,W):= \psi(u;Q,W) - \frac{u}{ \varphi (Q)}$$

and \(c_1\), \(\gamma\), \(c_2\), and \(c_3\) are positive absolute constants.

We put

$$ R_1(u;Q,W) := \pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}.$$
(4.28)

Let \(Q\in{\mathbb Z}\), \(W\in{\mathbb Z}\), and \(u\in{\mathbb Z}\) be such that \(1 \leq Q \leq x^{1/2 - \delta}\), \((Q,B)=1\), \((W,Q)=1\), and \(3\leq u \leq x^{1+\gamma/\sqrt{\ln x}}\). We claim that

$$ |R_1(u;Q,W)|\leq C_1 u^{1/2} + |R(u;Q,W)|+ \sum_{2 \leq n \leq u-1} \frac{|R(n;Q,W)|}{n\ln^2n},$$
(4.29)

where \(C_1>0\) is an absolute constant. We define

$$\alpha(n) = \begin{cases} \displaystyle 1 & \text{ }\, \displaystyle \text{if }\, n\equiv W {\textstyle\pmod{Q}} ,\\ \displaystyle 0 & \text{ }\, \displaystyle \text{otherwise} \end{cases}\qquad\text{and}\qquad \pi_1(u;Q,W) = \sum_{n\leq u}\frac{ \Lambda (n) \alpha(n)}{\ln n}.$$

Let us show that

$$ \pi(u;Q,W) = \pi_1(u;Q,W) + \widetilde{R}{} (u;Q,W),\qquad | \widetilde{R}{} (u;Q,W)| \leq C u^{1/2},$$
(4.30)

where \(C>0\) is an absolute constant. Let \(u \geq 8\). Then

$$\begin{aligned} \, \pi_1(u;Q,W) &= \sum_{p^m \leq u} \frac{\alpha(p^m)\ln p}{m\ln p} =\sum_{1 \leq m \leq \ln u/ \ln 2}\; \sum_{p \leq u^{1/m}} \frac{\alpha(p^m)}{m} \\[3pt] &=\sum_{p \leq u} \alpha(p) + \sum_{2 \leq m \leq \ln u/ \ln 2}\frac{1}{m} \sum_{p \leq u^{1/m}}\alpha(p^m)= S_1 + S_2. \end{aligned}$$

We have

$$S_1 = \sum_{p\leq u,\ p\equiv W\pmod{Q}} 1 = \pi(u;Q,W)$$

and

$$\begin{aligned} \, S_2&\leq \sum_{2 \leq m \leq \ln u/ \ln 2} \frac{u^{1/m}}{m} = \frac{1}{2} u^{1/2} + \sum_{3 \leq m \leq \ln u/ \ln 2} \frac{u^{1/m}}{m} \leq \frac{1}{2} u^{1/2} + \frac{1}{3} u^{1/3}\frac{\ln u}{\ln 2} \\[3pt] &\leq u^{1/2} + u^{1/3} \ln u \leq C' u^{1/2}, \end{aligned}$$

where \(C'>0\) is an absolute constant. If \(3 \leq u <8\), then

$$\Biggl|\sum_{2 \leq m \leq \ln u/ \ln 2}\frac{1}{m} \sum_{p \leq u^{1/m}}\alpha(p^m)\Biggr| \leq \frac{1}{2} \sum_{p \leq 8^{1/2}}1 + \frac{1}{3} \sum_{p \leq 8^{1/3}}1 = C'' \leq C'' u^{1/2}.$$

Thus, (4.30) is proved.

Since

$$\psi(x;Q,W) = \sum_{m\leq x} \Lambda (m)\alpha(m),$$

we have

$$\begin{aligned} \, \pi_1(u;Q,W) &= \sum_{2 \leq n \leq u} \frac{\psi(n;Q,W) - \psi(n-1;Q,W)}{\ln n} \\[2pt] &=\sum_{2 \leq n \leq u-1}\psi(n;Q,W)\biggl( \frac{1}{\ln n} - \frac{1}{\ln(n+1)} \biggr)+\frac{\psi(u;Q,W)}{\ln u} \\[2pt] &= \sum_{2 \leq n \leq u-1}\biggl( \frac{n}{ \varphi (Q)}+ R(n;Q,W)\!\biggr) \biggl( \frac{1}{\ln n}-\frac{1}{\ln(n+1)} \biggr)+\frac{u}{ \varphi (Q)\ln u}+ \frac{R(u;Q,W)}{\ln u}. \end{aligned}$$

Further,

$$\begin{aligned} \, \sum_{2 \leq n \leq u-1}\frac{n}{ \varphi (Q)}\biggl( \frac{1}{\ln n} - \frac{1}{\ln(n+1)} \biggr) &=\sum_{2 \leq n \leq u-1}\frac{n}{ \varphi (Q)}\intop_n^{n+1}\frac{dt}{t\ln^2t} =\frac{1}{ \varphi (Q)}\sum_{2 \leq n \leq u-1}\intop_n^{n+1}\frac{t - \{t\}}{t\ln^2t}\,dt \\[3pt] &=\frac{1}{ \varphi (Q)} \left(\intop_2^u \frac{dt}{\ln^2t} - \intop_2^u \frac{\{t\}\,dt}{t\ln^2t} \right). \end{aligned}$$

Since

$$\intop_2^u \frac{dt}{\ln^2t}=\intop_2^ut\,d\biggl(-\frac{1}{\ln t} \biggr)= -\frac{t}{\ln t}\biggr|_2^u+\intop_2^u \frac{dt}{\ln t} =-\frac{u}{\ln u} + \frac{2}{\ln 2} + \operatorname{li} (u),$$

we obtain

$$\begin{aligned} \, \pi_1(u;Q,W) &= \frac{u}{ \varphi (Q)\ln u}+ \frac{R(u;Q,W)}{\ln u} -\frac{u}{ \varphi (Q)\ln u} + \frac{2}{ \varphi (Q)\ln 2} + \frac{ \operatorname{li} (u)}{ \varphi (Q)} \\[3pt] &\phantom{={}}{}- \frac{1}{ \varphi (Q)}\intop_2^u \frac{\{t\}}{t\ln^2t}\,dt+ \sum_{2 \leq n \leq u-1}R(n;Q,W) \biggl( \frac{1}{\ln n} - \frac{1}{\ln(n+1)} \biggr). \end{aligned}$$

We have (see (4.30))

$$\pi(u;Q,W) = \frac{ \operatorname{li} (u)}{ \varphi (Q)}+ R_1(u;Q,W),$$

where

$$\begin{aligned} \, R_1(u;Q,W) &= \frac{2}{ \varphi (Q)\ln 2} - \frac{1}{ \varphi (Q)}\intop_2^u \frac{\{t\}}{t\ln^2t}\,dt + \widetilde{R}{} (u;Q,W) + \frac{R(u;Q,W)}{\ln u} \\[3pt] &\phantom{={}}{} +\sum_{2 \leq n \leq u-1}R(n;Q,W)\biggl( \frac{1}{\ln n} - \frac{1}{\ln(n+1)} \biggr). \end{aligned}$$

We can estimate this quantity as

$$ \begin{aligned} \, |R_1(u;Q,W)| &\leq \frac{2}{\ln 2}+ \left|\intop_2^u\frac{\{t\}}{t\ln^2t}\,dt\right| + | \widetilde{R}{} (u;Q,W)| + \frac{|R(u;Q,W)|}{\ln u} \\[3pt] &\phantom{={}}{} +\sum_{2 \leq n \leq u-1}|R(n;Q,W)|\biggl( \frac{1}{\ln n} - \frac{1}{\ln(n+1)} \biggr). \end{aligned}$$
(4.31)

Since \(u \geq 3\), we have

$$ \frac{|R(u;Q,W)|}{\ln u} \leq |R(u;Q,W)|.$$
(4.32)

Since

$$\left|\intop_2^u \frac{\{t\}}{t\ln^2t}\,dt\right|\leq \intop_2^u \frac{dt}{t\ln^2t} =-\frac{1}{\ln t}\biggr|_2^u=\frac{1}{\ln 2} - \frac{1}{\ln u}\leq \frac{1}{\ln 2},$$

it follows (see (4.30)) that

$$ \frac{2}{\ln 2}+ \left|\intop_2^u \frac{\{t\}}{t\ln^2t}\,dt\right| + | \widetilde{R}{} (u;Q,W)| \leq \frac{3}{\ln 2} + C u^{1/2}\leq \biggl(C+\frac{3}{\ln 2} \biggr)u^{1/2}.$$
(4.33)

Let \(f(x)=-\ln^{-1}x\) and \(n \geq 2\) be an integer. By the mean value theorem, there is a \(\xi\in (n,n+1)\) such that

$$ \frac{1}{\ln n} - \frac{1}{\ln(n+1)} = f(n+1) - f(n) = f'(\xi)=\frac{1}{\xi \ln^2\xi}\leq \frac{1}{n\ln^2n}.$$
(4.34)

Substituting (4.32)–(4.34) into (4.31), we obtain (4.29). Hence,

$$\begin{aligned} \, \nonumber &\sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\[1pt] u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}|R_1(u;Q,W)| \\[2pt] \nonumber &\ \leq \sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\[1pt] u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}} |R(u;Q,W)| +\sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\[1pt] u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}} \bigl|C_1 u^{1/2}\bigr| \\[2pt] \nonumber &\ \phantom{={}}{} + \sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\[1pt] u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}\, \sum_{2 \leq n \leq u-1} \frac{|R(n;Q,W)|}{n\ln^2n} \\[4pt] &\ = S_1 + S_2 + S_3. \end{aligned}$$
(4.35)

I. \(\,\)Now we estimate \(S_1\). We have (see (4.27))

$$ S_1 \leq \sum_{\substack{1\leq Q\leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}} |R(u;Q,W)|\leq c_2 x\exp(-c_3\sqrt{\ln x}).$$
(4.36)

II. \(\,\)Let us estimate \(S_2\). We can assume that

$$\frac{\gamma}{\sqrt{\ln x}} \leq \delta$$

provided that \( \widetilde{c}{} (\varepsilon,\delta)\) is chosen large enough. We have

$$ S_2 \leq C_1 x^{1- \delta + \gamma/(2\sqrt{\ln x})}\leq C_1 x^{1- \delta/2} \leq x\exp(-c_3\sqrt{\ln x})$$
(4.37)

provided that \( \widetilde{c}{} (\varepsilon,\delta)\) is chosen large enough.

III. \(\,\)Now we estimate \(S_3\). Let \(Q\), \(W\), \(u\), and \(n\) be integers such that \(1 \leq Q \leq x^{1/2 - \delta}\), \((Q,B)=1\), \((W,Q)=1\), \(3 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}\), and \(2\leq n \leq u-1\). Then

$$|R(n;Q,W)| \leq \max_{2 \leq m \leq x^{1+\gamma/\sqrt{\ln x}}}\max_{\substack{V\in{\mathbb Z}\\[1pt] (V,Q)=1}}|R(m;Q,V)|.$$

Hence,

$$\begin{aligned} \, \sum_{2 \leq n \leq u-1} \frac{|R(n;Q,W)|}{n\ln^2n} &\leq \max_{2 \leq m \leq x^{1+\gamma/\sqrt{\ln x}}}\max_{\substack{V\in{\mathbb Z}\\[1pt] (V,Q)=1}}\mathopen|R(m;Q,V)| \sum_{2 \leq n \leq u-1} \frac{1}{n\ln^2n} \\[2pt] &\le c_0 \max_{2 \leq m \leq x^{1+\gamma/\sqrt{\ln x}}} \max_{\substack{V\in{\mathbb Z}\\[1pt] (V,Q)=1}}\mathopen|R(m;Q,V)|,\qquad\text{where}\quad c_0:= \sum_{n=2}^{\infty}\frac{1}{n\ln^2n}<+\infty. \end{aligned}$$

We have

$$\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\ u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}} \,\sum_{2 \leq n \leq u-1} \frac{|R(n;Q,W)|}{n\ln^2n} \leq c_0 \max_{2 \leq m \leq x^{1+\gamma/\sqrt{\ln x}}}\max_{\substack{V\in{\mathbb Z}\\[1pt] (V,Q)=1}}\mathopen|R(m;Q,V)|.$$

Therefore (see (4.27)),

$$ S_3 \leq c_0 \sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{2 \leq m \leq x^{1+\gamma/\sqrt{\ln x}}} \max_{\substack{V\in{\mathbb Z}\\[1pt] (V,Q)=1}}\mathopen|R(m;Q,V)| \leq c_0c_2x\exp(-c_3 \sqrt{\ln x}).$$
(4.38)

Substituting (4.36)–(4.38) into (4.35), we obtain (see (4.28))

$$ \sum_{\substack{1\leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\ u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}\biggl|\pi(u;Q,W)- \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq c_4x\exp(-c_3 \sqrt{\ln x}),$$
(4.39)

where \(c_4 = c_2+1+ c_0 c_2> 0\) is an absolute constant.

Let \(Q\) and \(W\) be integers such that \(1 \leq Q \leq x^{1/2 - \delta}\), \((Q,B)=1\), and \((W,Q)=1\), and let \(u\) be a real number with \(2 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\). Consider two cases.

(1) Let \(2 \leq u \leq 3\). Then

$$|\pi(u;Q,W)| \leq \pi(u) \leq 2,\qquad \biggl|\frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr|\leq \operatorname{li} (u) \leq \operatorname{li} (3),$$

and so

$$\biggl|\pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq |\pi(u;Q,W)| + \biggl|\frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq 2+ \operatorname{li} (3). $$
(4.40)

(2) Let \(3< u \leq x^{1+\gamma/\sqrt{\ln x}}\). Then

$$\biggl|\frac{ \operatorname{li} (u) - \operatorname{li} ([u])}{ \varphi (Q)}\biggr| \leq \intop_{[u]}^{[u]+1}\frac{dt}{\ln t}\leq \intop_2^3 \frac{dt}{\ln t} = \operatorname{li} (3).$$

Hence,

$$\begin{aligned} \, \nonumber &\biggl| \pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)} \biggr| = \biggl| \pi([u];Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)} - \frac{ \operatorname{li} ([u])}{ \varphi (Q)} + \frac{ \operatorname{li} ([u])}{ \varphi (Q)} \biggr| \\[4pt] &\qquad\leq \biggl| \pi([u];Q,W) - \frac{ \operatorname{li} ([u])}{ \varphi (Q)} \biggr| + \biggl|\frac{ \operatorname{li} (u)- \operatorname{li} ([u])}{ \varphi (Q)} \biggr| \leq \operatorname{li} (3)+ \biggl| \pi([u];Q,W) - \frac{ \operatorname{li} ([u])}{ \varphi (Q)} \biggr|. \end{aligned}$$
(4.41)

From (4.40) and (4.41) we obtain

$$\begin{aligned} \, \nonumber \max_{2 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}\biggl|\pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| &\leq \max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\ u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}} \biggl|\pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \\[4pt] &\phantom{={}}{} +2 \operatorname{li} (3)+ 2. \end{aligned}$$
(4.42)

We can assume that

$$ x^{1/2} \leq x\exp(-c_3\sqrt{\ln x})$$
(4.43)

provided that \( \widetilde{c}{} (\varepsilon,\delta)\) is chosen large enough. From (4.39), (4.42), and (4.43) we obtain

$$\begin{aligned} \, \nonumber &\sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{2 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}\biggl|\pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \\ \nonumber &\qquad\leq \sum_{\substack{1 \leq Q \leq x^{1/2 - \delta}\\[1pt] (Q,B)=1}}\,\max_{\substack{3 \leq u \leq x^{1+\gamma/\sqrt{\ln x}}\\ u\in{\mathbb Z}}} \max_{\substack{W\in{\mathbb Z}\\[1pt] (W,Q)=1}}\biggl|\pi(u;Q,W) - \frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr|+ (2 \operatorname{li} (3)+2) x^{1/2} \\[3pt] &\qquad\leq \bigl(c_4 + 2 \operatorname{li} (3)+2\bigr)x\exp(-c_3\sqrt{\ln x}). \end{aligned}$$
(4.44)

Thus, if \(x \geq \widetilde{c}{} (\varepsilon,\delta)\) is a real number and \(q\) is an integer such that \(1 \leq q \leq (\ln x)^{1-\varepsilon}\), then there is a positive integer \(B\) for which (4.26) and (4.44) hold. Let us redenote \( \widetilde{c}{} (\varepsilon,\delta)\) by \(c(\varepsilon,\delta)\) and \(c_4 + 2 \operatorname{li} (3)+2\) by \(c_2\). Lemma 4.10 is proved. \(\quad\Box\)

5. Proof of Theorem 1.1 and Corollary 1.1

Let us introduce some additional notation. Let \( {\mathcal A} \) be a set of integers, \( {\mathcal P} \) a set of primes, and \(L(n)=l_1 n + l_2\) a linear function with integer coefficients. We define

$$\begin{gathered} \, {\mathcal A} (x)=\bigl\{n\in {\mathcal A} \colon\, \, x\leq n< 2 x\bigr\},\qquad {\mathcal A} (x;q,a)=\bigl\{n\in {\mathcal A} (x) \colon\, \, n\equiv a {\textstyle\pmod{q}} \bigr\},\\[4pt] L( {\mathcal A} )=\{L(n) \colon\, \, n\in {\mathcal A} \},\qquad {\mathcal P} _{L, {\mathcal A} }(x)= L( {\mathcal A} (x))\cap {\mathcal P} ,\qquad {\mathcal P} _{L, {\mathcal A} }(x;q,a)= L( {\mathcal A} (x;q,a))\cap {\mathcal P} ,\\[4pt] \varphi _L(q)=\frac{ \varphi (|l_1|q)}{ \varphi (|l_1|)}. \end{gathered}$$

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be a set of distinct linear functions \(L_i (n) = a_i n+b_i\), \(i=1,\dots,k\), with positive integer coefficients. We say such a set is admissible if for every prime \(p\) there is an integer \(n_p\) such that \(\bigl(\prod_{i=1}^kL_i(n_p),p\bigr)=1\).

We focus on sets satisfying the following hypothesis, which is given in terms of \(( {\mathcal A} , {\mathcal L} , {\mathcal P} ,B,x,\theta)\), where \( {\mathcal L} \) is an admissible set of linear functions, \(B\in{\mathbb N}\), \(x\) is a large real number, and \(0<\theta<1\).

Hypothesis 1.

For \(( {\mathcal A} , {\mathcal L} , {\mathcal P} ,B,x,\theta)\) and \(k=\# {\mathcal L} \), the following holds.

(1) \( {\mathcal A} \) is well distributed in arithmetic progressions:

$$\sum_{1\leq q \leq x^{\theta}}\max_{a\in{\mathbb Z}}\biggl|\# {\mathcal A} (x;q,a) - \frac{\# {\mathcal A} (x)}{q}\biggr|\ll \frac{\# {\mathcal A} (x)}{(\ln x)^{100 k^2}}.$$

(2) The primes in \(L( {\mathcal A} )\cap {\mathcal P} \) are well distributed in most arithmetic progressions: for any \(L\in {\mathcal L} \) we have

$$\sum_{\substack{1\leq q\leq x^{\theta}\\[1pt] (q,B)=1}} \,\max_{\substack{a\in{\mathbb Z}\\[1pt] (L(a),q)=1}} \biggl|\# {\mathcal P} _{L, {\mathcal A} }(x;q,a) - \frac{\# {\mathcal P} _{L, {\mathcal A} }(x)}{ \varphi _L(q)}\biggr|\ll \frac{\# {\mathcal P} _{L, {\mathcal A} }(x)}{(\ln x)^{100 k^2}}.$$

(3) \( {\mathcal A} \) is not too concentrated in any arithmetic progression: for any \(1\leq q< x^{\theta}\) we have

$$\max_{a\in{\mathbb Z}}\# {\mathcal A} (x;q,a) \ll \frac{\# {\mathcal A} (x)}{q}.$$

Maynard proved the following result (see [5, Proposition 6.1]).

Proposition 5.1.

Let \(\alpha\) and \(\theta\) be real numbers such that \(\alpha>0\) and \(0<\theta <1\). Let \( {\mathcal A} \) be a set of integers, \( {\mathcal P} \) a set of primes, and \( {\mathcal L} =\{L_1,\dots,L_k\}\) an admissible set of \(k\) linear functions, and let \(B\) and \(x\) be integers. Let the coefficients of \(L_i(n)= a_in+b_i\in {\mathcal L} \) satisfy \(1\leq a_i,b_i\leq x^\alpha\) for all \(1 \leq i \leq k,\) and let \(k \leq (\ln x)^{1/5}\) and \(1 \leq B \leq x^\alpha\). Let \(x^{\theta/10}\leq R \leq x^{\theta/3}\). Let \(\rho\) and \(\xi\) satisfy \(k(\ln \ln x)^2/ \ln x \leq \rho, \xi \leq \theta/10,\) and define

$${\mathcal S} (\xi;D) = \bigl\{n\in{\mathbb N} \colon\, \, p\mid n\ \Rightarrow\; (p>x^{\xi}\textit{ or }\, p\mid D)\bigr\}.$$

Then there is a number \(C>0\) depending only on \(\alpha\) and \(\theta\) such that the following holds. If \(k \geq C\) and \(( {\mathcal A} , {\mathcal L} , {\mathcal P} ,B,x,\theta)\) satisfy Hypothesis 1, then there exist nonnegative weights \(w_n=w_n( {\mathcal L} )\) satisfying

$$ w_n \ll (\ln R)^{2 k}\prod_{i=1}^k\;\prod_{p\mid L_i(n),\; p \kern1pt \nmid B}4$$
(5.1)

such that the following statements hold.

(1) We have

$$ \sum_{n\in {\mathcal A} (x)}w_n = \biggl( 1+ O\biggl( \frac{1}{(\ln x)^{1/10}} \biggr)\!\biggr) \frac{B^k}{ \varphi (B)^k}\, {\mathfrak S} _B( {\mathcal L} )\,\# {\mathcal A} (x)(\ln R)^kI_k.$$
(5.2)

(2) For \(L(n)=a_Ln+b_L\in {\mathcal L} \) we have

$$\begin{aligned} \, \nonumber \sum_{n\in {\mathcal A} (x)} {\mathbf 1} _{ {\mathcal P} }(L(n))w_n &\geq \biggl( 1+ O\biggl( \frac{1}{(\ln x)^{1/10}} \biggr)\!\biggr) \frac{B^{k-1}}{ \varphi (B)^{k-1}}\, {\mathfrak S} _B( {\mathcal L} ) \frac{ \varphi (a_L)}{a_L}\, \# {\mathcal P} _{L, {\mathcal A} }(x)(\ln R)^{k+1}J_k \\ &\phantom{={}}{} +O\biggl( \frac{B^k}{ \varphi (B)^k}\, {\mathfrak S} _B( {\mathcal L} )\, \# {\mathcal A} (x)(\ln R)^{k-1} I_k\biggr). \end{aligned}$$
(5.3)

(3) For \(L(n)=a_0n+b_0\notin {\mathcal L} \) and \(D \leq x^\alpha,\) if \(\Delta_L\neq 0,\) we have

$$ \sum_{n\in {\mathcal A} (x)} {\mathbf 1} _{ {\mathcal S} (\xi;D)}(L(n))w_n \ll \xi^{-1} \frac{\Delta_L}{ \varphi (\Delta_L)}\frac{D}{ \varphi (D)} \frac{B^k}{ \varphi (B)^k}\, {\mathfrak S} _B( {\mathcal L} )\,\# {\mathcal A} (x) (\ln R)^{k-1} I_k,$$
(5.4)

where

$$\Delta_L=|a_0|\prod_{i=1}^k|a_0b_i - b_0a_i|.$$

(4) For \(L\in {\mathcal L} \) we have

$$ \sum_{n\in {\mathcal A} (x)} w_n \sum_{p\mid L(n),\; p<x^\rho,\; p \kern1pt \nmid B} 1 \ll \rho^2 k^4(\ln k)^2 \frac{B^k}{ \varphi (B)^k}\, {\mathfrak S} _B( {\mathcal L} )\,\# {\mathcal A} (x) (\ln R)^kI_k.$$
(5.5)

Here \(I_k\) and \(J_k\) are quantities depending only on \(k,\) and \( {\mathfrak S} _B( {\mathcal L} )\) is a quantity depending only on \( {\mathcal L} ,\) and these satisfy

$${\mathfrak S} _B( {\mathcal L} ) = \prod_{p \kern1pt \nmid B}\biggl( 1 - \frac{\#\{1\leq n \leq p \colon\, \, p\mid \prod_{i=1}^k L_i(n)\}}{p} \biggr) \biggl( 1-\frac{1}{p} \biggr)^{\!-k} \geq \exp(-ck),$$
(5.6)
$$I_k = \intop_0^{\infty}\dots\intop_0^{\infty} F^2(t_1,\dots,t_k)\,dt_1\dots dt_k\gg (2k\ln k)^{-k},$$
(5.7)
$$J_k = \intop_0^{\infty}\dots\intop_0^{\infty} \left(\intop_0^{\infty} F(t_1,\dots,t_k)\, dt_k\right)^{\!2} dt_1\dots dt_{k-1} \gg \frac{\ln k}{k} I_k$$
(5.8)

for a smooth function \(F=F_k \colon\, {\mathbb R}^k\to{\mathbb R}\) depending only on \(k\). The implied constants here depend only on \(\alpha,\) \(\theta,\) and the implied constants from Hypothesis 1. The constant \(c\) in inequality (5.6) is positive and absolute.

Proof of Theorem 1.1 .

First we prove the following

Lemma 5.1.

Let \(k\) be a positive integer. Let \(a,\) \(q,\) and \(b_1,\dots,b_k\) be positive integers such that \(b_1<\dots<b_k\) and \((a,q) =1\). Let \(L_i(n) = q n+a+ q b_i,\) \(i=1,\dots,k\). Then \( {\mathcal L} =\{L_1,\dots,L_k\}\) is an admissible set if and only if for any prime \(p\) such that \(p\nmid q\) there is an integer \(m_p\) with \(m_p\not\equiv b_i\pmod{p}\) for all \(1\leq i\leq k\).

Proof.

(1) Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be an admissible set. Let \(p\) be a prime such that \(p \nmid q\). Since \( {\mathcal L} \) is an admissible set, there is an integer \(n_p\) such that \(\bigl(\prod_{i=1}^kL_i(n_p),p\bigr)=1\). Since \((q,p)=1\), there is an integer \(q'\) such that \(q q' \equiv 1\pmod{p}\). We put \(m_p = -(n_p+q'a)\). Let \(i\) be an integer with \(1 \leq i \leq k\). Since \((q',p)=1\) and \((L_i(n_p),p)=1\), it follows that \((q'L_i(n_p), p)=1\). We have

$$q'L_i(n_p) \equiv -m_p + b_i\pmod{p}.$$

Hence, \(m_p \not\equiv b_i\pmod{p}\).

(2) Suppose that for any prime \(p\) with \(p\nmid q\) there is an integer \(m_p\) such that \(m_p\not\equiv b_i\pmod{p}\) for all \(1 \leq i\leq k\). Let us show that then \( {\mathcal L} \) is an admissible set. First we observe that \( {\mathcal L} =\{L_1,\dots,L_k\}\) is a set of distinct linear functions \(L_i (n) = q n+l_i\), \(i=1,\dots,k\), with positive integer coefficients. Thus, we need to prove that for any prime \(p\) there is an integer \(n_p\) such that \(\bigl(\prod_{i=1}^k L_i(n_p),p\bigr)=1\). Let \(p\) be a prime number. Consider two cases.

(i) Let \(p\mid q\). Since \((a,q)=1\), we have \((a,p)=1\). Let \(i\) be an integer with \(1 \leq i \leq k\). For any integer \(n\) we have

$$L_i(n)\equiv a\pmod{p},$$

and so \(L_i(n) \not\equiv 0\pmod{p}\). Hence, \(\bigl(\prod_{i=1}^k L_i(n), p\bigr)=1\). Therefore, in this case we may take any integer as \(n_p\).

(ii) Let \(p\nmid q\). Then \((q,p)=1\), and so there is an integer \(c\) such that

$$ qc\equiv a\pmod{p}.$$
(5.9)

By assumption, there is an integer \(m_p\) such that \(m_p\not\equiv b_i\pmod{p}\) for all \(1 \leq i \leq k\). We put \(n_p=-m_p - c\). Let \(i\) be an integer with \(1 \leq i \leq k\). We have

$$n_p+c+ b_i\not\equiv 0\pmod{p}.$$

Since \((q,p)=1\), we obtain

$$qn_p+ qc+ qb_i\not\equiv 0\pmod{p}.$$

In view of (5.9) this yields \(L_i(n_p)\not\equiv 0\pmod{p}\). Hence, \((L_i(n_p), p) =1\). Since this holds for all \(1 \leq i \leq k\), we have \(\bigl(\prod_{i=1}^kL_i(n_p),p\bigr)=1\). Lemma 5.1 is proved. \(\quad\Box\)

The proof of the following lemma is based on Maynard’s ideas used in the proof of Lemma 8.1 in [5] (the notation \(L\in {\mathcal L} \) was explained in the Introduction).

Lemma 5.2.

There are positive absolute constants \(c\) and \(C\) such that the following holds. Let \(x\) and \(\eta\) be real numbers with \(x\geq c\) and \((\ln x)^{-9/10}\leq \eta \leq 1\). Let \(k\) and \(a\) be positive integers. Let \(b_1,\dots,b_k\) be integers with \(1\leq b_i \leq \ln x,\) \(i=1,\dots,k\). Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be a set of \(k\) linear functions \(L_i(n)=an+b_i,\) \(i=1,\dots,k\). For \(L(n)=an+b,\) \(b\in{\mathbb Z},\) we define

$$\Delta_L = a^{k+1}\prod_{i=1}^k|b_i-b|.$$

Then

$$\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)}\leq C\eta\ln\ln(a+2)\ln(k+1)\ln x.$$

Proof.

Consider two cases.

(1) Let \(k> \ln\ln x\). We can assume that \(\ln\ln x \geq 100\) provided that \(c\) is chosen large enough. Therefore, \(k\geq 100\). Let \(b\) be an integer such that \(1 \leq b \leq \eta\ln x\) and \(L=an+b\notin {\mathcal L} \). Then \(\Delta_L\in{\mathbb N}\). Applying Lemma 2.8, we see that

$$ \frac{\Delta_L}{ \varphi (\Delta_L)}\leq c_0\ln\ln(\Delta_L+2),$$
(5.10)

where \(c_0>0\) is an absolute constant. Further,

$$\ln \Delta_L = (k+1)\ln a + \sum_{i=1}^k\ln\mathopen|b_i - b|.$$

For any \(1 \leq i \leq k\) we have \(|b_i - b| \leq \ln x\). Hence,

$$\ln \Delta_L \leq (k+1)\ln a + k \ln\ln x \leq 2 k \ln a + k^2.$$

Since

$$2k\ln a\leq k^2\ln(a+2)\qquad\text{and}\qquad k^2\leq k^2\ln(a+2),$$

we have

$$\ln \Delta_L \leq 2 k^2\ln(a+2).$$

We observe that if \(u\geq 2\) and \(v\geq 2\) are real numbers, then

$$ u+v\leq uv.$$
(5.11)

Applying (5.11), we obtain

$$\ln(\Delta_L+2)\leq \ln(3\Delta_L)=\ln \Delta_L + \ln 3 \leq 2 k^2\ln(a+2) + 3\leq 6k^2\ln(a+2).$$

Applying (5.11) again, we have

$$\begin{aligned} \, \ln\ln(\Delta_L+2)&\leq \ln 6 + 2\ln k+\ln\ln(a+2) \leq 2+2\ln k+25\ln\ln(a+2) \\[4pt] &\leq 4\ln k+ 25\ln\ln(a+2) \leq 100 \ln k \ln\ln(a+2)\leq 100 \ln(k+1)\ln\ln(a+2). \end{aligned}$$

Substituting this estimate into (5.10), we obtain

$$\frac{\Delta_L}{ \varphi (\Delta_L)} \leq 100 c_0\ln\ln(a+2) \ln(k+1)= c_1 \ln\ln(a+2) \ln(k+1),$$

where \(c_1=100 c_0>0\) is an absolute constant. Thus,

$$\begin{aligned} \, \nonumber \sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)} &\leq c_1\ln\ln(a+2)\ln(k+1)\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}1 \leq c_1\ln\ln(a+2)\ln(k+1) [\eta \ln x] \\[3pt] &\leq c_1\eta \ln\ln(a+2)\ln(k+1) \ln x. \end{aligned}$$
(5.12)

(2) Let \(1 \leq k \leq \ln\ln x\). For an integer \(b\) we define

$$\Delta(b):=\prod_{i=1}^k|b-b_i|.$$

Let \(b\) be an integer such that \(1\leq b \leq \eta\ln x\) and \(L=an+b\notin {\mathcal L} \). Applying Lemmas 2.5 and 2.4, we obtain

$$\frac{\Delta_L}{ \varphi (\Delta_L)} = \frac{a^{k+1}\Delta(b)}{ \varphi (a^{k+1}\Delta(b))} \leq \frac{a^{k+1}}{ \varphi (a^{k+1})}\frac{\Delta(b)}{ \varphi (\Delta(b))} =\frac{a}{ \varphi (a)}\frac{\Delta(b)}{ \varphi (\Delta(b))}.$$

Hence,

$$ S=\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)} \leq \frac{a}{ \varphi (a)}\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta(b)}{ \varphi (\Delta(b))} = \frac{a}{ \varphi (a)} \widetilde{S}{} .$$
(5.13)

Applying Lemma 2.7, we have

$$\begin{aligned} \, \nonumber \widetilde{S}{} &=\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta(b)}{ \varphi (\Delta(b))} = \sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\,\sum_{d\mid\Delta(b)} \frac{\mu^2(d)}{ \varphi (d)} \\[3pt] &=\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{\substack{1\leq d\leq \eta\ln x\\ d\mid\Delta(b)}} \frac{\mu^2(d)}{ \varphi (d)} +\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{\substack{d> \eta\ln x\\ d\mid\Delta(b)}}\frac{\mu^2(d)}{ \varphi (d)} = S_1+S_2. \end{aligned}$$
(5.14)

First we estimate the sum \(S_2\). Let \(b\) and \(d\) be positive integers such that \(1\leq b \leq \eta\ln x\), \(L=an+b\notin {\mathcal L} \), \(d> \eta \ln x\), and \(d\mid\Delta(b)\). We claim that

$$ \frac{\mu^2(d)}{ \varphi (d)}\leq \frac{\mu^2(d)\sum_{p\mid d}\ln p}{ \varphi (d)\ln(\eta\ln x)}.$$
(5.15)

We can assume that

$$d>\eta \ln x\geq (\ln x)^{1/10}\geq 100$$

provided that \(c\) is chosen large enough. If \(\mu^2(d)=0\), then inequality (5.15) holds. Let \(\mu^2(d)\neq 0\). Then \(d\) is square-free. Therefore, \(\sum_{p\mid d}\ln p = \ln d\). Inequality (5.15) is equivalent to the inequality

$$\ln(\eta\ln x)\leq \sum_{p\mid d}\ln p = \ln d,$$

which obviously holds. Thus, (5.15) is proved. We have

$$\begin{aligned} \, S_2&= \sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{\substack{d> \eta\ln x\\ d\mid\Delta(b)}} \frac{\mu^2(d)}{ \varphi (d)} \leq \sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{\substack{d> \eta\ln x\\ d\mid\Delta(b)}} \frac{\mu^2(d)\sum_{p\mid d}\ln p}{ \varphi (d)\ln(\eta\ln x)} \\[2pt] &=\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{p\mid \Delta(b)}\frac{\ln p}{\ln(\eta\ln x)} \sum_{\substack{d> \eta\ln x\\ p\mid d,\; d\mid\Delta(b)}}\frac{\mu^2(d)}{ \varphi (d)}. \end{aligned}$$

Let \(b\in{\mathbb N}\), \(d\in{\mathbb N}\), and \(p\in\mathbb{P}\) be such that \(1 \leq b \leq \eta\ln x\), \(L=an+b\notin {\mathcal L} \), \(p\mid \Delta(b)\), \(d>\eta\ln x\), \(d\) is a multiple of \(p\), and \(d\mid\Delta (b)\). Then \(d=pt\), where \(t\in{\mathbb N}\), \(t>(\eta\ln x)/p\), and \(t\mid\Delta(b)\). We have (see Lemmas 2.5 and 2.4)

$$\varphi (d)= \varphi (pt)\geq \varphi (p) \varphi (t)= (p-1) \varphi (t)\geq \frac{p}{2} \varphi (t).$$

Hence,

$$\frac{\mu^2(d)}{ \varphi (d)}= \frac{\mu^2(pt)}{ \varphi (pt)}\leq \frac{2 \mu^2(pt)}{p \varphi (t)}\leq \frac{2 \mu^2(t)}{p \varphi (t)}.$$

We obtain (see Lemma 2.7)

$$\sum_{\substack{d>\eta\ln x\\ p\mid d,\; d\mid\Delta(b)}} \frac{\mu^2(d)}{ \varphi (d)} \leq \frac{2}{p}\sum_{\substack{t> (\eta\ln x)/p\\ t\mid\Delta(b)}}\frac{\mu^2(t)}{ \varphi (t)} \leq \frac{2}{p}\sum_{t\mid\Delta(b)}\frac{\mu^2(t)}{ \varphi (t)}=\frac{2}{p}\frac{\Delta(b)}{ \varphi (\Delta(b))}.$$

Therefore,

$$S_2\leq \sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{p\mid \Delta(b)} \frac{\ln p}{\ln(\eta\ln x)} \frac{2}{p}\frac{\Delta(b)}{ \varphi (\Delta(b))} =\frac{2}{\ln(\eta\ln x)}\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta(b)}{ \varphi (\Delta(b))}\sum_{p\mid \Delta(b)}\frac{\ln p}{p}.$$

Since \(\eta\geq (\ln x)^{-9/10}\), we have

$$\frac{2}{\ln(\eta\ln x)}\leq \frac{2}{\ln((\ln x)^{1/10})}=\frac{20}{\ln\ln x}.$$

Thus,

$$ S_2\leq \frac{20}{\ln\ln x}\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta(b)}{ \varphi (\Delta(b))}\sum_{p\mid \Delta(b)}\frac{\ln p}{p}.$$
(5.16)

Let \(b\) be an integer such that \(1 \leq b \leq \eta\ln x\) and \(L=an+b\notin {\mathcal L} \). Applying Lemmas 2.8 and 2.10, we obtain

$$ \frac{\Delta(b)}{ \varphi (\Delta(b))}\leq c_2\ln\ln(\Delta(b)+2)\leq c_2\ln\ln(3\Delta(b)),\qquad \sum_{p\mid \Delta(b)}\frac{\ln p}{p}\leq c_3\ln\ln(3\Delta(b)),$$
(5.17)

where \(c_2>0\) and \(c_3>0\) are absolute constants. We have

$$ \ln \Delta(b)=\sum_{i=1}^k\ln\mathopen|b_i-b|\leq k \ln\ln x\leq (\ln\ln x)^2.$$
(5.18)

Hence,

$$\ln\ln(3\Delta(b))=\ln(\ln 3 + \ln \Delta(b)) \leq \ln(\ln 3 + (\ln\ln x)^2)\leq 3\ln\ln\ln x $$
(5.19)

provided that \(c\) is chosen large enough. It follows from (5.17) and (5.19) that

$$\frac{\Delta(b)}{ \varphi (\Delta(b))}\sum_{p\mid \Delta(b)}\frac{\ln p}{p}\leq 9c_2c_3 (\ln\ln\ln x)^2=c_4(\ln\ln\ln x)^2,$$

where \(c_4=9c_2c_3>0\) is an absolute constant. Substituting this estimate into (5.16), we obtain

$$S_2 \leq \frac{20 c_4 (\ln\ln\ln x)^2}{\ln\ln x} \eta\ln x.$$

We can assume that

$$\frac{20 c_4 (\ln\ln\ln x)^2}{\ln\ln x} \leq 1$$

provided that \(c\) is chosen large enough. Hence,

$$ S_2 \leq \eta\ln x\leq \frac{1}{\ln 2}\ln(k+1) \eta \ln x\leq 2 \ln(k+1) \eta \ln x.$$
(5.20)

Now we estimate \(S_1\). We have

$$\begin{aligned} \, \nonumber S_1 &= \sum_{\substack{1\leq b \leq \eta\ln x\\ L=an+b\notin {\mathcal L} }}\, \sum_{\substack{1\leq d\leq\eta\ln x\\ d\mid\Delta(b)}} \frac{\mu^2(d)}{ \varphi (d)} = \sum_{1\leq d\leq\eta\ln x}\, \sum_{\substack{1\leq b \leq \eta\ln x\\ L=an+b\notin {\mathcal L} \\ d\mid\Delta(b)}} \frac{\mu^2(d)}{ \varphi (d)} =\sum_{1\leq d\leq\eta\ln x}\frac{\mu^2(d)}{ \varphi (d)} \sum_{\substack{1\leq b \leq \eta\ln x\\ L=an+b\notin {\mathcal L} \\ d\mid\Delta(b)}}1 \\ &=\sum_{1\leq d\leq\eta\ln x}\frac{\mu^2(d)}{ \varphi (d)}N_0(d) =\sum_{\substack{1\leq d\leq\eta\ln x\\ d\in {\mathcal M} }}\frac{1}{ \varphi (d)}N_0(d). \end{aligned}$$
(5.21)

Let \(d\) be an integer such that \(1\leq d \leq \eta\ln x\) and \(d\in {\mathcal M} \). We claim that

$$ N_0(d)\leq \frac{2\eta\ln x}{d}\prod_{p\mid d}\min\{p,k\}.$$
(5.22)

If \(d=1\), then the inequality is obvious. Let \(d>1\). We define

$$R(b)=(b-b_1)\dots(b-b_k).$$

Then \(\Delta(b)=|R(b)|\). We have

$$N_0(d)=\sum_{\substack{1\leq b \leq \eta\ln x\\ L=an+b\notin {\mathcal L} \\ d\mid\Delta(b)}}1 =\sum_{\substack{1\leq b \leq \eta\ln x\\ L=an+b\notin {\mathcal L} \\ R(b)\equiv 0\pmod{d}}}1.$$

Let \(d\) be expressed in the standard form as \(d=q_1\dots q_r\), where \(q_1<\dots <q_r\) are prime numbers. It is well known (see, for example, [7, Ch. 4]) that the congruence \(R(b)\equiv 0\pmod{d}\) is equivalent to the system of congruences

$$ \begin{cases} \displaystyle R(b)\equiv 0\pmod{q_1}, \\ \displaystyle \dots\dots\dots\dots\dots\dots \\ \displaystyle R(b)\equiv 0\pmod{q_r}. \end{cases}$$
(5.23)

Let \(1\leq j \leq r\). Let \(\Omega_j\) be the set of numbers of a complete system of residues modulo \(q_j\) satisfying the congruence \(R(b)\equiv 0\pmod{q_j}\). Since \(R(b_1)=0\), we see that \(\Omega_j\neq\varnothing\). Since the leading coefficient of the polynomial \(R(b)\) is \(1\) and the degree of the polynomial \(R(b)\) is \(k\), we have \(\#\Omega_j\leq k\) (see, for example, [7, Ch. 4]). It is also clear that \(\#\Omega_j \leq q_j\). Thus,

$$\#\Omega_j \leq \min\{q_j,k\}.$$

System (5.23) is equivalent to the union of \(T=\#\Omega_1\dots\#\Omega_r\) systems

$$ \begin{cases} \displaystyle b\equiv \tau_1\pmod{q_1}, \\ \displaystyle \dots\dots\dots\dots\dots\dots \\ \displaystyle b\equiv \tau_r\pmod{q_r}, \end{cases}$$
(5.24)

where \(\tau_1\in\Omega_1,\dots,\tau_r\in\Omega_r\). It is well known (see, for example, [7, Ch. 4]) that the system of congruences (5.24) is equivalent to the congruence

$$b\equiv x_0\pmod{d},$$

where \(x_0=x_0(\tau_1,\dots,\tau_r)\). It is also known that the numbers \(x_0(\tau_1,\dots,\tau_r)\), \(\tau_1\in\Omega_1,\dots,\tau_r\in \Omega_r\), are incongruent modulo \(d\). Thus,

$$\bigl\{b\in{\mathbb Z} \colon\, \, R(b)\equiv 0 {\textstyle\pmod{d}} \bigr\}=\bigsqcup_{\tau_1\in\Omega_1,\dots,\tau_r\in\Omega_r} \bigl\{x_0(\tau_1,\dots,\tau_r)+ dt \colon\, \, t\in{\mathbb Z}\bigr\}.$$

Let \(\tau_1\in\Omega_1,\dots,\tau_r\in\Omega_r\) and \(x_0=x_0(\tau_1,\dots,\tau_r)\). We have

$$\begin{aligned} \, \#\bigl\{t\in{\mathbb Z} \colon\, \, 1\leq x_0+dt\leq \eta\ln x\bigr\} &=\biggl[\frac{\eta\ln x-x_0}{d}\biggr]-\biggl\lceil\frac{1-x_0}{d}\biggr\rceil +1 \\[4pt] &=\frac{\eta\ln x-x_0}{d} - \theta_1- \biggl( \frac{1-x_0}{d}+\theta_2\biggr)+1 =\frac{\eta\ln x}{d} + 1 -\theta_1-\theta_2 - \frac{1}{d}, \end{aligned}$$

where \(\theta_1\) and \(\theta_2\) are real numbers with \(0 \leq \theta_1<1\) and \(0 \leq \theta_2<1\). Since \(1 \leq d \leq \eta\ln x\), we obtain

$$\#\bigl\{t\in{\mathbb Z} \colon\, \, 1\leq x_0+dt\leq \eta\ln x\bigr\}\leq \frac{\eta\ln x}{d} + 1\leq 2\frac{\eta\ln x}{d}.$$

Thus,

$$N_0(d)\leq \frac{2\eta\ln x}{d}T\leq \frac{2\eta\ln x}{d}\prod_{p\mid d}\min\{p,k\}.$$

Inequality (5.22) is proved.

Substituting (5.22) into (5.21), we obtain

$$ S_1\leq \sum_{\substack{1\leq d\leq\eta\ln x\\ d\in {\mathcal M} }}\frac{1}{ \varphi (d)}\frac{2\eta\ln x}{d}\prod_{p\mid d}\min\{p,k\} =2\eta\ln x\sum_{\substack{1\leq d\leq\eta\ln x\\ d\in {\mathcal M} }} \frac{\prod_{p\mid d}\min\{p,k\}}{d \varphi (d)}= 2\eta\ln x\,S_3.$$
(5.25)

Let \(d\) be an integer such that \(1\leq d \leq \eta\ln x\) and \(d\in {\mathcal M} \). We have (see Lemmas 2.6 and 2.4)

$$\begin{gathered} \, d=\prod_{p\mid d}p,\qquad \varphi (d)=\prod_{p\mid d} \varphi (p)=\prod_{p\mid d}(p-1),\\[4pt] \frac{\prod_{p\mid d}\min\{p,k\}}{d \varphi (d)}= \frac{\prod_{p\mid d}\min\{p,k\}}{\prod_{p\mid d}p(p-1)} =\prod_{p\mid d,\; p\leq k}\frac{1}{p-1} \prod_{p\mid d,\; p>k}\frac{k}{p(p-1)}. \end{gathered}$$

Hence,

$$S_3=\sum_{\substack{1\leq d\leq\eta\ln x\\ d\in {\mathcal M} }}\, \prod_{p\mid d,\; p\leq k}\frac{1}{p-1} \prod_{p\mid d,\; p>k}\frac{k}{p(p-1)} \leq \prod_{p\leq k} \biggl( 1+\frac{1}{p-1} \biggr)\prod_{p>k}\biggl( 1+\frac{k}{p(p-1)} \biggr)=AB. $$
(5.26)

We have (see Lemma 2.1)

$$A=\prod_{p\leq k}\biggl( 1+\frac{1}{p-1} \biggr) \leq\prod_{p\leq k+1}\biggl( 1+\frac{1}{p-1} \biggr) =\prod_{p\leq k+1}\biggl( 1-\frac{1}{p} \biggr)^{\!-1} \leq c_5\ln(k+1), $$
(5.27)

where \(c_5>0\) is an absolute constant.

Now we estimate \(B\). Since \(\ln(1+u)\leq u\) and \(u>0\), we get

$$\ln B = \sum_{p> k} \ln\biggl( 1+\frac{k}{p(p-1)} \biggr) \leq \sum_{p> k}\frac{k}{p(p-1)} =k\sum_{p\geq k+1}\frac{1}{p(p-1)} \leq k\sum_{n\geq k+1}\frac{1}{n(n-1)}.$$

We define

$$s_m=\sum_{n=k+1}^m\frac{1}{n(n-1)}=\sum_{n=k+1}^m\biggl( \frac{1}{n-1}-\frac{1}{n} \biggr) =\frac{1}{k} - \frac{1}{m},\qquad m\geq k+1.$$

Then,

$$\sum_{n\geq k+1}\frac{1}{n(n-1)}=\lim_{m\to +\infty} s_m=\frac{1}{k}.$$

We obtain \(\ln B\leq 1\), i.e.,

$$ B\leq e<3.$$
(5.28)

It follows from (5.26)–(5.28) that \(S_3 \leq c_6\ln(k+1)\), where \(c_6>0\) is an absolute constant. Substituting this estimate into (5.25), we obtain

$$ S_1 \leq c_7\eta\ln(k+1)\ln x,$$
(5.29)

where \(c_7>0\) is an absolute constant. Therefore (see (5.14), (5.20), and (5.29)),

$$\widetilde{S}{} \leq (c_7+2)\eta\ln(k+1)\ln x = c_8\eta\ln(k+1)\ln x,$$

where \(c_8=c_7+2>0\) is an absolute constant. We obtain (see (5.13) and Lemma 2.8)

$$ S\leq c_8\frac{a}{ \varphi (a)}\eta\ln(k+1)\ln x\leq c_9\eta\ln\ln(a+2)\ln(k+1)\ln x,$$
(5.30)

where \(c_9>0\) is an absolute constant. We put \(C=c_1+c_9\), where \(c_1\) is the constant in (5.12). Then \(C>0\) is an absolute constant and in both cases, \(1\leq k \leq \ln\ln x\) and \(k>\ln\ln x\), we have

$$\sum_{\substack{1\leq b \leq \eta \ln x\\ L=an+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)} \leq C \eta\ln\ln(a+2)\ln(k+1)\ln x.$$

Lemma 5.2 is proved. \(\quad\Box\)

Lemma 5.3.

Let \( {\mathcal A} ={\mathbb N},\) \( {\mathcal P} =\mathbb{P},\) \(\alpha=1/5,\) and \(\theta=1/3,\) and let \(C_0=C(1/5,1/3)>0\) be the absolute constant in Proposition 5.1. Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Then there is a number \(c_0(\varepsilon)>0\) such that the following holds. Let \(x\in{\mathbb N},\) \(y\in{\mathbb R},\) and \(q\in{\mathbb N}\) satisfy the conditions \(x\geq c_0(\varepsilon),\) \(1\leq y \leq \ln x,\) and \(1\leq q \leq y^{1-\varepsilon}\). Then there is a positive integer \(B\) such that

$$ 1\leq B \leq \exp(\vartheta\sqrt{\ln x}),\qquad 1\leq\frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1.$$
(5.31)

Furthermore, let \(k\in{\mathbb N},\) \(\rho\in{\mathbb R},\) \(\xi\in{\mathbb R},\) \(R\in{\mathbb R},\) \(\eta\in{\mathbb R},\) and \(a\in{\mathbb Z},\) be such that

$$C_0\leq k \leq (\ln x)^{1/5},$$
(5.32)
$$\frac{k(\ln\ln x)^2}{\ln x} \leq \rho \leq \frac{1}{30},\qquad \xi = \rho,$$
(5.33)
$$R=x^{1/9},\qquad 0<\eta \leq \frac{1}{2},$$
(5.34)
$$1\leq a \leq q,\qquad (a,q)=1.$$
(5.35)

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be an admissible set of \(k\) linear functions, where \(L_i(n) = q n + a+ q b_i,\) \(i=1,\dots,k,\) \(b_1,\dots,b_k\) are positive integers with \(b_1<\dots<b_k,\) and \(q b_k \leq \eta y\). Then the hypothesis of Proposition 5.1 holds and there exist nonnegative weights \(w_n= w_n( {\mathcal L} )\) with the properties stated in Proposition 5.1; the implied constants in (5.1)(5.5) are positive and absolute. In (5.31), \(\vartheta>0\) is also an absolute constant.

Proof.

We will choose \(c_0(\varepsilon)\) later; this number is assumed to be large enough. We take \(\delta =1/10\) and let \(c_0(\varepsilon)\geq c(\varepsilon,\delta)=c(\varepsilon,1/10)\), where \(c(\varepsilon,\delta)\) is the quantity in Lemma 4.10. Let \(x\in{\mathbb N}\), \(y\in{\mathbb R}\), and \(q\in{\mathbb N}\) be such that \(x\geq c_0(\varepsilon)\), \(1 \leq y \leq \ln x\), and \(1 \leq q \leq y^{1-\varepsilon}\). By Lemma 4.10, there is a positive integer \(B\) such that

$$1\leq B \leq \exp(c_1\sqrt{\ln x}),\qquad 1\leq\frac{B}{ \varphi (B)}\leq 2,\qquad (B,q)=1$$

and

$$ \sum_{\substack{1\leq Q\leq x^{2/5}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}}\; \max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \biggl|\pi(u;Q,W)-\frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq c_2 x\exp(-c_3\sqrt{\ln x}),$$
(5.36)

where \(c_1\), \(\gamma\), \(c_2\), and \(c_3\) are positive absolute constants. Let (5.32)–(5.35) hold. Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be an admissible set of \(k\) linear functions \(L_i(n) = q n + a+ q b_i\), \(i=1,\dots,k\), where \(b_1,\dots,b_k\) are positive integers with \(b_1<\dots<b_k\) and \(q b_k \leq \eta y\). Let us show that the hypothesis of Proposition 5.1 holds. First we show that the set \(( {\mathcal A} , {\mathcal L} , {\mathcal P} ,B,x,1/3)\) satisfies Hypothesis 1.

I. \(\,\)Let us show that condition (2) of Hypothesis 1 holds. Let \(L(n)=l_1 n+l_2\in {\mathcal L} \). Clearly, we have

$$ 1\leq l_1 \leq \ln x \qquad\text{and}\qquad 1\leq l_2 \leq \ln x.$$
(5.37)

Let us show that

$$ S:=\sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\,\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),r)=1}} \biggl|\# {\mathcal P} _{L, {\mathcal A} }(x;r,b) - \frac{\# {\mathcal P} _{L, {\mathcal A} }(x)}{ \varphi _L(r)}\biggr| \leq \frac{\# {\mathcal P} _{L, {\mathcal A} }(x)}{(\ln x)^{100 k^2}}.$$
(5.38)

It is not hard to see that

$$\begin{aligned} \, {\mathcal P} _{L, {\mathcal A} }(x)&=\bigl\{ l_1x+ l_2 \leq p < 2l_1x+ l_2 \colon\, \, p\equiv l_2 {\textstyle\pmod{l_1}} \bigr\},\\[4pt] {\mathcal P} _{L, {\mathcal A} }(x;r,b)&=\bigl\{l_1x + l_2\leq p < 2l_1x+l_2 \colon\, \, p\equiv l_1b+l_2 {\textstyle\pmod{l_1r}} \bigr\} \end{aligned}$$

and hence

$$\begin{aligned} \, \# {\mathcal P} _{L, {\mathcal A} }(x)&= \pi(2l_1x+l_2-1; l_1, l_2) - \pi(l_1x+l_2-1; l_1, l_2), \\[4pt] \# {\mathcal P} _{L, {\mathcal A} }(x;r,b)&=\pi(2l_1x+l_2-1; l_1r, L(b))- \pi(l_1x+l_2-1; l_1r, L(b)).\nonumber \end{aligned}$$
(5.39)

We obtain

$$\begin{aligned} \, S&=\sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\,\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),r)=1}} \biggl|\pi(2l_1x+l_2-1; l_1r, L(b))-\pi(l_1x+l_2-1; l_1r, L(b)) \nonumber\\[3pt] &\phantom{={}}{} - \frac{\pi(2l_1x+l_2-1; l_1, l_2) - \pi(l_1x+l_2-1; l_1, l_2)}{ \varphi (l_1r)/ \varphi (l_1)}\biggr| \leq S_1+S_2+S_3+S_4, \end{aligned}$$
(5.40)

where

$$\begin{aligned} \, S_1 &= \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\,\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),r)=1}} \biggl| \pi(l_1x+l_2-1; l_1r, L(b)) - \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1r)}\biggr|,\\[2pt] S_2 &= \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}} \biggl|\frac{\pi(l_1x+l_2-1; l_1,l_2)}{ \varphi (l_1r)/ \varphi (l_1)} -\frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1r)} \biggr|, \\[2pt] S_3 &= \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\,\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),r)=1}} \biggl| \pi(2l_1x+l_2-1; l_1r, L(b)) - \frac{ \operatorname{li} (2l_1x+l_2-1)}{ \varphi (l_1r)}\biggr|,\\[2pt] S_4 &= \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}} \biggl|\frac{\pi(2l_1x+l_2-1; l_1,l_2)}{ \varphi (l_1r)/ \varphi (l_1)} - \frac{ \operatorname{li} (2l_1x+l_2-1)}{ \varphi (l_1r)} \biggr|. \end{aligned}$$

Let us show that

$$ (L(b),l_1)=1$$
(5.41)

for any \(b\in{\mathbb Z}\). Assume the contrary: there is an integer \(b\) such that \((L(b),l_1)>1\). Then there is a prime \(p\) such that \(p\mid l_1\) and \(p\mid L(b)\). Hence \(p\mid l_2\), and we see that \(p\mid L(n)\) for any integer \(n\). Since \(L\in {\mathcal L} \), we see that \(p\mid L_1(n)\dots L_k(n)\) for any integer \(n\). But this contradicts the fact that \( {\mathcal L} =\{L_1,\dots,L_k\}\) is an admissible set. Thus, (5.41) is proved. We also observe that since \((B,q)=1\) and \(l_1=q\), we have

$$ (B,l_1)=1.$$
(5.42)

Let \(r\) be an integer with \(1\leq r \leq x^{1/3}\) and \((r,B)=1\). Applying (5.37), we have

$$l_1 r\leq x^{1/3} \ln x \leq x^{2/5},\qquad l_1x+l_2-1\geq l_1x\geq x\geq 2,\qquad l_1x+ l_2 -1 \leq 2 x\ln x\leq x^{1+\gamma/\sqrt{\ln x}}$$

provided that \(c_0(\varepsilon)\) is chosen large enough. Hence, we obtain (see (5.41), (5.42) and (5.36))

$$\begin{aligned} \, S_1 &= \sum_{\substack{r \colon\, \, l_1 \leq l_1r \leq l_1x^{1/3}\\[1pt] (l_1r, B)=1}}\;\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),l_1r)=1}} \biggl| \pi(l_1x+l_2-1; l_1r, L(b)) - \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1r)}\biggr| \nonumber\\[2pt] &\leq \sum_{\substack{1\leq Q\leq x^{2/5}\\[1pt] (Q,B)=1}}\, \max_{2 \leq u \leq x^{1+ \gamma/\sqrt{\ln x}}}\; \max_{W\in{\mathbb Z} \colon\, (W,Q)=1} \biggl|\pi(u;Q,W)-\frac{ \operatorname{li} (u)}{ \varphi (Q)}\biggr| \leq c_2 x\exp(-c_3\sqrt{\ln x}). \end{aligned}$$
(5.43)

Applying Lemmas 2.5 and 2.9, we get

$$\begin{aligned} \, S_2&= \varphi (l_1)\biggl|\pi(l_1x+l_2-1; l_1, l_2)- \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)}\biggr| \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\frac{1}{ \varphi (l_1r)} \\[2pt] &\leq \biggl|\pi(l_1x+l_2-1; l_1, l_2)- \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)}\biggr| \sum_{1 \leq r \leq x^{1/3}}\frac{1}{ \varphi (r)} \\[4pt] &\leq \widetilde{c}{} \ln x \biggl|\pi(l_1x+l_2-1; l_1, l_2)- \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)}\biggr|, \end{aligned}$$

where \( \widetilde{c}{} >0\) is an absolute constant. Since \(l_1 x+ l_2-1\geq l_1x\geq x\) (see (5.37)), we obtain

$$1\leq l_1 \leq \ln x \leq \ln(l_1x+l_2 -1).$$

Hence (see, for example, [1, Ch. 22]),

$$\biggl|\pi(l_1x+l_2-1; l_1, l_2) - \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)}\biggr| \leq C(l_1x+l_2-1)\exp\bigl(-c\sqrt{\ln(l_1x+l_2-1)}\,\bigr), $$
(5.44)

where \(C\) and \(c\) are positive absolute constants. We have

$$\exp\bigl(-c\sqrt{\ln(l_1x+l_2-1)}\,\bigr) \leq \exp(-c\sqrt{\ln x}),$$
(5.45)
$$l_1x+l_2-1\leq x\ln x + \ln x \leq 2 x\ln x.$$
(5.46)

We can assume that

$$ -c\sqrt{\ln x} + 2\ln\ln x \leq -\frac{c}{2}\sqrt{\ln x}$$
(5.47)

if \(c_0(\varepsilon)\) is chosen large enough. Hence,

$$S_2 \leq \widetilde{C}{} x\exp\bigl(-c\sqrt{\ln x} + 2\ln\ln x\bigr) \leq \widetilde{C}{} x\exp\Bigl(-\frac c2\sqrt{\ln x} \kern1pt \Bigr), $$
(5.48)

where \( \widetilde{C}{} =2 \widetilde{c}{} \kern1pt C\) is a positive absolute constant. Similarly, it can be shown that

$$ S_3 \leq C x\exp(-c\sqrt{\ln x}) \qquad\text{and}\qquad S_4 \leq C x\exp(-c\sqrt{\ln x}),$$
(5.49)

where \(C\) and \(c\) are positive absolute constants. Substituting (5.43), (5.48), and (5.49) into (5.40), we obtain

$$ \sum_{\substack{1 \leq r \leq x^{1/3}\\[1pt] (r,B)=1}}\,\max_{\substack{b\in{\mathbb Z}\\[1pt] (L(b),r)=1}} \biggl|\# {\mathcal P} _{L, {\mathcal A} }(x;r,b) - \frac{\# {\mathcal P} _{L, {\mathcal A} }(x)}{ \varphi _L(r)}\biggr| \leq c_4 x\exp(-c_5\sqrt{\ln x}),$$
(5.50)

where \(c_4\) and \(c_5\) are positive absolute constants. Applying (5.44)–(5.47), we have

$$\pi(l_1x+l_2-1; l_1, l_2) = \frac{ \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)} + R_1,\qquad |R_1| \leq C x\exp(-c\sqrt{\ln x}),$$

where \(C\) and \(c\) are positive absolute constants. Similarly, it can be shown that

$$\pi(2l_1x+l_2-1; l_1, l_2) = \frac{ \operatorname{li} (2l_1x+l_2-1)}{ \varphi (l_1)} + R_2,\qquad |R_2| \leq C x\exp(-c\sqrt{\ln x}),$$

where \(C\) and \(c\) are positive absolute constants. Therefore (see (5.39)),

$$\# {\mathcal P} _{L, {\mathcal A} }(x) = \frac{ \operatorname{li} (2l_1x+l_2-1) - \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)}+ R,$$
(5.51)
$$|R|\leq c_6 x\exp(-c_7\sqrt{\ln x}),$$
(5.52)

where \(c_6\) and \(c_7\) are positive absolute constants. We have

$$\begin{gathered} \, 2l_1x+l_2 - 1\leq 2x\ln x + \ln x \leq 3 x \ln x,\\[4pt] \ln(2l_1 x+ l_2 -1) \leq \ln x + \ln\ln x + \ln 3\leq 2 \ln x \end{gathered}$$

provided that \(c_0(\varepsilon)\) is chosen large enough. Hence,

$$\begin{aligned} \, \frac{ \operatorname{li} (2l_1x+l_2-1)- \operatorname{li} (l_1x+l_2-1)}{ \varphi (l_1)} &=\frac{1}{ \varphi (l_1)}\intop_{l_1x+l_2-1}^{2l_1x+l_2-1}\frac{dt}{\ln t} \geq \frac{l_1 x}{ \varphi (l_1)\ln(2l_1x+l_2-1)} \nonumber\\[4pt] &\geq \frac{l_1 x}{2 \varphi (l_1)\ln x}. \end{aligned}$$
(5.53)

Let us show that

$$ |R| \leq \frac{l_1 x}{4 \varphi (l_1)\ln x}.$$
(5.54)

Since \(l_1/ \varphi (l_1)\geq 1\), we see from (5.52) that it is sufficient to show that

$$c_6 x\exp(-c_7\sqrt{\ln x}) \leq \frac{x}{4\ln x}.$$

This inequality holds if \(c_0(\varepsilon)\) is chosen large enough. Thus, (5.54) is proved. From (5.51), (5.53), and (5.54) we obtain

$$ \# {\mathcal P} _{L, {\mathcal A} }(x) \geq \frac{l_1 x}{4 \varphi (l_1)\ln x}.$$
(5.55)

Now we prove (5.38). Since \(l_1/ \varphi (l_1)\geq 1\), we see from (5.50) and (5.55) that it suffices to establish the estimate

$$ c_4 x\exp(-c_5\sqrt{\ln x})\leq \frac{x}{4 (\ln x)^{100 k^2+1}}.$$
(5.56)

Taking logarithms, we obtain

$$\ln c_4 +\ln x - c_5\sqrt{\ln x} \leq \ln x - \ln 4 - 100k^2\ln\ln x - \ln\ln x$$

or, which is equivalent,

$$100 k^2\ln\ln x \leq c_5\sqrt{\ln x} - \ln\ln x - \ln(4 c_4).$$

Since \(k \leq (\ln x)^{1/5}\), we have

$$100 k^2\ln\ln x \leq 100 (\ln x)^{2/5}\ln\ln x.$$

The inequality

$$100 (\ln x)^{2/5}\ln\ln x \leq c_5\sqrt{\ln x} - \ln\ln x - \ln(4 c_4)$$

holds if \(c_0(\varepsilon)\) is chosen large enough. Inequality (5.56) is proved. Thus, (5.38) is proved.

II. \(\,\)Let us show that condition (1) of Hypothesis 1 holds. We show that

$$ S:= \sum_{1 \leq r \leq x^{1/3}}\max_{b\in{\mathbb Z}}\biggl|\# {\mathcal A} (x;r,b) - \frac{\# {\mathcal A} (x)}{r}\biggr|\leq \frac{\# {\mathcal A} (x)}{(\ln x)^{100 k^2}}.$$
(5.57)

Let \(1 \leq r \leq x^{1/3}\) and \(b\in{\mathbb Z}\). We have

$${\mathcal A} (x)=\{x\leq n < 2x\} \qquad\text{and}\qquad {\mathcal A} (x;r,b) = \bigl\{x \leq n < 2x \colon\, \, n \equiv b {\textstyle\pmod{r}} \bigr\}.$$

Hence,

$$ \# {\mathcal A} (x)=x \qquad\text{and}\qquad \# {\mathcal A} (x;r,b)=\frac{x}{r}+\rho,\quad |\rho|\leq 1.$$
(5.58)

We obtain

$$ \biggl|\# {\mathcal A} (x;r,b) - \frac{\# {\mathcal A} (x)}{r}\biggr|= |\rho| \leq 1.$$
(5.59)

Hence, \(S \leq x^{1/3}\). Thus, to prove (5.57), it suffices to show that

$$x^{1/3}\leq \frac{x}{(\ln x)^{100 k^2}}$$

or, which is equivalent, \((\ln x)^{100 k^2} \leq x^{2/3}\). Taking logarithms, we obtain

$$100 k^2\ln\ln x \leq \frac{2}{3}\ln x.$$

Since \(k \leq (\ln x)^{1/5}\), we have

$$100 k^2\ln\ln x \leq 100 (\ln x)^{2/5}\ln\ln x.$$

The inequality

$$100 (\ln x)^{2/5}\ln\ln x \leq \frac{2}{3}\ln x$$

holds if \(c_0(\varepsilon)\) is chosen large enough. Thus, (5.57) is proved.

III. \(\,\)Let us show that condition (3) of Hypothesis 1 holds. To this end we show that for any integer \(r\) with \(1\leq r < x^{1/3}\) we have

$$ \max_{b\in{\mathbb Z}}\# {\mathcal A} (x;r,b) \leq 2\frac{\# {\mathcal A} (x)}{r}.$$
(5.60)

Let \(1\leq r < x^{1/3}\) and \(b\in{\mathbb Z}\). We may assume that \(c_0(\varepsilon)\geq 2\). Hence, \(r \leq x^{1/3} \leq x\). Applying (5.58), we obtain

$$\# {\mathcal A} (x;r,b)\leq \frac{x}{r}+1\leq 2\frac{x}{r}= 2\frac{\# {\mathcal A} (x)}{r},$$

and (5.60) is proved. Thus, the set \(( {\mathcal A} , {\mathcal L} , {\mathcal P} ,B,x,1/3)\) satisfies Hypothesis 1.

We can assume that

$$\exp(c_1\sqrt{\ln x}) \leq x^{1/5} \qquad\text{and}\qquad \ln x \leq x^{1/5}$$

provided that \(c_0(\varepsilon)\) is chosen large enough. Since \(1\leq B \leq \exp(c_1\sqrt{\ln x})\), we obtain \(1 \leq B \leq x^{1/5}\). Let \(L=l_1n+l_2\in {\mathcal L} \). Applying (5.37), we have \(1\leq l_1 \leq x^{1/5}\) and \(1\leq l_2 \leq x^{1/5}\). Thus, the hypothesis of Proposition 5.1 holds and there are nonnegative weights \(w_n= w_n( {\mathcal L} )\) with the properties stated in Proposition 5.1. In that proposition, the implied constants in (5.1)–(5.5) depend only on \(\alpha\), \(\theta\) and on the implied constants from Hypothesis 1, and in our case these constants are absolute (\(\alpha=1/5\), \(\theta=1/3\), and estimates (5.38), (5.57), and (5.60) hold). Therefore, in our case the implied constants in (5.1)–(5.5) are positive and absolute. Finally, let us denote \(c_1\) by \(\vartheta\). Lemma 5.3 is proved. \(\quad\Box\)

Lemma 5.4.

There are positive absolute constants \(c\) and \(C\) such that the following holds. Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Then there is a number \(c_0(\varepsilon)>0,\) depending only on \(\varepsilon,\) such that if \(x\in{\mathbb N},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) satisfy the conditions \(c_0(\varepsilon) \leq y \leq \ln x,\) \(1 \leq m \leq c \kern1pt \varepsilon\ln y,\) \(1 \leq q \leq y^{1-\varepsilon},\) and \((a,q)=1,\) then

$$\#\bigl\{qx < p_n \leq 2qx - 5q \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \geq \pi(2qx) \biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)}.$$

Proof.

Let \( {\mathcal A} ={\mathbb N}\), \( {\mathcal P} =\mathbb{P}\), \(\alpha=1/5\), and \(\theta=1/3\), and let \(C_0=C(1/5, 1/3)>0\) be the absolute constant in Proposition 5.1. Let \(c_0(\varepsilon)\) be the quantity in Lemma 5.3. We will choose \(c(\varepsilon)\) later; this number is large enough. Let \(c(\varepsilon) \geq c_0(\varepsilon)\). Let \(x\in{\mathbb N}\), \(y\in{\mathbb R}\), and \(q\in{\mathbb Z}\) be such that

$$c(\varepsilon) \leq y \leq \ln x,$$
(5.61)
$$1\leq q \leq y^{1-\varepsilon}.$$
(5.62)

By Lemma 5.3, there is a positive integer \(B\) such that (5.31) holds. We assume that

$$ \widetilde{C}{} _0 \leq k \leq y^{\varepsilon/14},$$
(5.63)

where \( \widetilde{C}{} _0>0\) is an absolute constant. We will choose \( \widetilde{C}{} _0\) later. For now, we assume that \( \widetilde{C}{} _0\) is large enough; in particular, \( \widetilde{C}{} _0 \geq C_0\). It follows from (5.61) and (5.63) that \(k\leq (\ln x)^{1/5}\). Thus, (5.32) holds. Let (5.33)–(5.35) hold. Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be an admissible set of \(k\) linear functions \(L_i(n) = q n + a+ q b_i\), \(i=1,\dots,k\), where \(b_1,\dots,b_k\) are positive integers such that \(b_1< \dots< b_k\) and \(q b_k \leq \eta y\). Then (see Lemma 5.3) the hypothesis of Proposition 5.1 holds and there are nonnegative weights \(w_n= w_n( {\mathcal L} )\) with the properties stated in Proposition 5.1; the implied constants in (5.1)–(5.5) are positive and absolute. We write \( {\mathcal L} = {\mathcal L} (\textbf{b})\) for such a set defined by \(b_1,\dots,b_k\). Denote the class of admissible sets by \( \mathrm{AS} \).

Let \(m\) be a positive integer. We consider

$$\begin{aligned} \, S&=\sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \,\sum_{n\in {\mathcal A} (x)} \! \left(\vphantom{\intop_j}\right.\!\sum_{i=1}^k\textbf{1}_{ {\mathcal P} }(L_i(n)) - m -k\sum_{i=1}^k \sum_{\substack{p\mid L_i(n)\\ p<x^\rho,\; p \kern1pt \nmid B}} 1 -k\sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }} \textbf{1}_{ {\mathcal S} (\rho; B)}(L(n))\!\left.\vphantom{\intop_j}\right) \!w_n( {\mathcal L} ) \nonumber\\[3pt] &=\sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \,\sum_{n\in {\mathcal A} (x)}A_n( {\mathcal L} )w_n( {\mathcal L} ). \end{aligned}$$
(5.64)

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) and \(n\) be in the range of summation of \(S\) and \(A_n( {\mathcal L} )>0\). Then the following statements hold:

  1. (1)

    The number of primes among \(L_1(n),\dots,L_k(n)\) is at least \(m+1\).

  2. (2)

    For any \(1\leq i \leq k\), \(L_i(n)\) has no prime factor \(p\) such that \(p<x^\rho\) and \(p\nmid B\).

  3. (3)

    For any linear function \(L=qt+b\notin {\mathcal L} \), where \(b\) is an integer with \(1\leq b \leq 2\eta y\), \(L(n)\) has a prime factor \(p\) such that \(p<x^\rho\) and \(p\nmid B\) (we choose \(\rho\) so that \(x^\rho\) is not an integer; therefore, the conditions \(p \leq x^\rho\) and \(p<x^\rho\) are equivalent). Since \(L(n)> n\geq x>x^\rho\), we see that \(L(n)\) is not a prime number.

As a consequence we obtain the following statements:

  1. (i)

    None of \(n\in {\mathcal A} (x)\) can make a positive contribution to \(S\) from two different admissible sets (since if \(n\) makes a positive contribution for some admissible set \( {\mathcal L} =\{L_1,\dots,L_k\}\), then the numbers \(L_1(n),\dots,L_k(n)\) are uniquely determined as the integers in \([qn+1, qn+2\eta y]\) with no prime factors \(p\) such that \(p<x^\rho\) and \(p\nmid B\)).

  2. (ii)

    If \( {\mathcal L} =\{L_1,\dots,L_k\}\) and \(n\) are in the range of summation of \(S\) and \(A_n( {\mathcal L} )>0\), then there can be no primes in the interval \([qn+1, qn+2\eta y]\) apart from possibly \(L_1(n),\dots,L_k(n)\), and so the primes counted in this way must be consecutive.

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) and \(n\) be in the range of summation of \(S\) and \(A_n( {\mathcal L} )>0\). Let \(1 \leq i \leq k\). If \(p\mid L_i(n)\) and \(p\nmid B\), then \(p \geq x^\rho\). Setting

$$\Omega = \bigl\{p \colon\, \, p\mid L_i(n)\,\text{ and }\, p\nmid B\bigr\},$$

we have

$$x^{\rho\,\#\Omega}\leq \prod_{p\in\Omega} p \leq L_i(n).$$

Since

$$q\leq y^{1-\varepsilon} \leq y\leq \ln x \qquad\text{and}\qquad a+qb_i\leq 2 \eta y\leq \ln x,$$

we obtain

$$L_i(n) =qn + a+qb_i\leq n\ln x+ \ln x \leq 2x\ln x+\ln x \leq x^2$$

provided that \(c(\varepsilon)\) is chosen large enough. Hence, \(\rho\,\#\Omega \leq 2\), i.e., \(\#\Omega \leq {2}/{\rho}\). We have

$$\prod_{\substack{p\mid L_i(n)\\ p \kern1pt \nmid B}} 4 = \prod_{p\in\Omega} 4 = 4^{\#\Omega}\leq 4^{2/\rho}=e^{(2/\rho)\ln 4}\leq e^{4/\rho} \qquad\text{and}\qquad \prod_{i=1}^k\, \prod_{\substack{p\mid L_i(n)\\ p \kern1pt \nmid B}} 4 \leq e^{(4k)/\rho}.$$

Thus, if \( {\mathcal L} =\{L_1,\dots,L_k\}\) and \(n\) are in the range of summation of \(S\) and \(A_n( {\mathcal L} )>0\), then (see (5.1))

$$ w_n( {\mathcal L} ) \leq C (\ln R)^{2k} e^{(4k)/\rho},$$
(5.65)

where \(C>0\) is an absolute constant.

Let \( {\mathcal L} =\{L_1,\dots,L_k\}\) be in the range of summation of \(S\). We consider

$$\begin{aligned} \, \widetilde{S}{} ( {\mathcal L} )&= \sum_{n\in {\mathcal A} (x)}\! \left(\vphantom{\intop_j}\right.\! \sum_{i=1}^k\textbf{1}_{ {\mathcal P} }(L_i(n)) - m -k\sum_{i=1}^k \sum_{\substack{p\mid L_i(n)\\ p<x^\rho,\; p \kern1pt \nmid B}} 1 -k\sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }} \textbf{1}_{ {\mathcal S} (\rho;B)}(L(n))\!\left.\vphantom{\intop_j}\right)\! w_n( {\mathcal L} ) \\ &=S_1 - S_2 - S_3 - S_4. \end{aligned}$$

Our aim is to obtain a lower bound for \( \widetilde{S}{} ( {\mathcal L} )\). We write \(w_n\) instead of \(w_n( {\mathcal L} )\) for brevity. Let \(1 \leq i \leq k\). Since \(\# {\mathcal A} (x)= x\), we have (see (5.3))

$$\begin{aligned} \, \sum_{n\in {\mathcal A} (x)} {\mathbf 1} _{ {\mathcal P} }(L_i(n))w_n &\geq (1+o(1))\frac{B^{k-1}}{ \varphi (B)^{k-1}} {\mathfrak S} _B( {\mathcal L} )\frac{ \varphi (q)}{q} \,\# {\mathcal P} _{L_i, {\mathcal A} }(x)(\ln R)^{k+1}J_k \\ &\phantom{={}}{} +O\biggl( \frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^{k-1}I_k\biggr). \end{aligned}$$

Hence,

$$\begin{aligned} \, S_1 &= \sum_{n\in {\mathcal A} (x)}\,\sum_{i=1}^k \textbf{1}_{ {\mathcal P} }(L_i(n))w_n =\sum_{i=1}^k\, \sum_{n\in {\mathcal A} (x)} \textbf{1}_{ {\mathcal P} }(L_i(n))w_n \\[2pt] &\geq (1+ o(1))\frac{B^{k-1}}{ \varphi (B)^{k-1}} {\mathfrak S} _B( {\mathcal L} )\frac{ \varphi (q)}{q}(\ln R)^{k+1}J_k \sum_{i=1}^k\# {\mathcal P} _{L_i, {\mathcal A} }(x) +O\biggl(k\frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^{k-1} I_k\biggr) \\[2pt] &=(1+ o(1))\frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} )(\ln R)^{k+1}J_k\frac{ \varphi (B)}{B}\frac{ \varphi (q)}{q}\sum_{i=1}^k\# {\mathcal P} _{L_i, {\mathcal A} }(x) +o\biggl( \frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^k I_k\biggr) \\[3pt] &=S_1'+S_1'', \end{aligned}$$

since

$$0<\frac{k}{\ln R}\leq \frac{(\ln x)^{1/5}}{(1/9)\ln x}\to 0\qquad \text{as}\quad x\to +\infty.$$

We have shown (see (5.55)) that if \(x \geq c_0\), where \(c_0> 0\) is an absolute constant, then for any \(L\in {\mathcal L} \)

$$\# {\mathcal P} _{L, {\mathcal A} }(x) \geq \frac{q x}{4 \varphi (q)\ln x}.$$

We may assume that \(c(\varepsilon) \geq c_0\). Since \( \varphi (B)/B \geq 1/2\) (see (5.31)), we obtain

$$\frac{ \varphi (B)}{B}\frac{ \varphi (q)}{q}\sum_{i=1}^k\# {\mathcal P} _{L_i, {\mathcal A} }(x)\geq \frac{kx}{8\ln x} = \frac{kx}{72\ln R}.$$

We have \(|o(1)|\leq 1/2\) in \(S_1'\) if \(x \geq c'\), where \(c'>0\) is an absolute constant. We may assume that \(c(\varepsilon)\geq c'\). Since (see (5.8))

$$J_k\geq c''\frac{\ln k}{k}I_k,$$

where \(c''>0\) is an absolute constant, we get

$$S_1'\geq \frac{c''}{144}\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k\ln k.$$

We have

$$|S_1''|\leq \frac{c''}{288}\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^k I_k \leq \frac{c''}{288}\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^k I_k\ln k$$

provided that \(c(\varepsilon)\) is chosen large enough. Therefore,

$$S_1 \geq \frac{c''}{288}\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^k I_k\ln k = c\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} ) x(\ln R)^k I_k\ln k, $$
(5.66)

where \(c>0\) is an absolute constant.

We have (see (5.2))

$$S_2 = m\sum_{n\in {\mathcal A} (x)} w_n = m (1+ o(1))\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k \geq \frac{m}{2} \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k $$
(5.67)

provided that \(c(\varepsilon)\) is chosen large enough. Applying (5.5), we obtain

$$S_3 = k \sum_{n\in {\mathcal A} (x)} \,\sum_{i=1}^k\sum_{\substack{p\mid L_i(n)\\ p<x^\rho,\; p \kern1pt \nmid B}}\! w_n =k\sum_{i=1}^k \,\sum_{n\in {\mathcal A} (x)} w_n \sum_{\substack{p\mid L_i(n)\\ p<x^\rho,\; p \kern1pt \nmid B}}\! 1 \leq c_2 \rho^2 k^6(\ln k)^2 \frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} )x (\ln R)^kI_k,$$

where \(c_2>0\) is an absolute constant. Let \(c_3>0\) be an absolute constant such that

$$c_2c_3^2\leq \frac{1}{12}\qquad\text{and}\qquad \frac{c_3}{j^3\ln j}\leq \frac{1}{30} \quad \text{for any }\, j\geq 2.$$

We choose an arbitrary number \(\rho\) in the interval

$$ \Bigl[\frac{c_3}{2k^3\ln k}, \frac{c_3}{k^3\ln k}\Bigr]$$
(5.68)

so that \(x^\rho\) is not an integer. It is clear that \(\rho \leq 1/30\). Let us show that the first inequality in (5.33) holds. It suffices to show that

$$\frac{k(\ln\ln x)^2}{\ln x}\leq \frac{c_3/2}{k^3\ln k}.$$

This inequality is equivalent to

$$k^4\ln k (\ln \ln x)^2 \leq \frac{c_3}{2} \ln x.$$

Since \(k \leq (\ln x)^{1/5}\), we have

$$k^4\ln k (\ln \ln x)^2 \leq \frac{1}{5}(\ln x)^{4/5}(\ln \ln x)^3 \leq \frac{c_3}{2} \ln x$$

provided that \(c(\varepsilon)\) is chosen large enough. Thus, the inequalities in (5.33) hold. We have (see (5.67))

$$\begin{aligned} \, \nonumber S_3 &\leq c_2 \frac{c_3^2}{k^6(\ln k)^2} k^6(\ln k)^2\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x (\ln R)^kI_k \leq \frac{1}{12}\frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} )x (\ln R)^kI_k \\[4pt] &\leq\frac{m}{12}\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x (\ln R)^kI_k \leq \frac{1}{6}S_2. \end{aligned}$$
(5.69)

Now we estimate the quantity

$$S_4 = k\sum_{n\in {\mathcal A} (x)}\sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }} \textbf{1}_{ {\mathcal S} (\rho; B)}(L(n))w_n = k \sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }}\sum_{n\in {\mathcal A} (x)}\textbf{1}_{ {\mathcal S} (\rho; B)}(L(n))w_n.$$

Let \(b\) be in the range of summation of \(S_4\). Then \(L=qt+b\notin {\mathcal L} \) and

$$\Delta_L=q^{k+1}\prod_{i=1}^k|(a+qb_i) - b| \neq 0.$$

Since \(1\leq B \leq x^{1/5}\), we have (see (5.4))

$$\sum_{n\in {\mathcal A} (x)}\textbf{1}_{ {\mathcal S} (\rho; B)}(L(n))w_n \leq \frac{c_4}{\rho}\frac{\Delta_L}{ \varphi (\Delta_L)}\frac{B}{ \varphi (B)} \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^{k-1}I_k,$$

where \(c_4>0\) is an absolute constant. Since \(B/ \varphi (B) \leq 2\) and \(\rho\) lies in the interval (5.68), we obtain

$$\begin{aligned} \, \sum_{n\in {\mathcal A} (x)}\textbf{1}_{ {\mathcal S} (\rho; B)}(L(n))w_n &\leq \frac{4c_4}{c_3}k^3\ln k\frac{\Delta_L}{ \varphi (\Delta_L)} \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^{k-1}I_k \\[1pt] &= c_5 k^3\ln k\frac{\Delta_L}{ \varphi (\Delta_L)} \frac{B^k}{ \varphi (B)^k} {\mathfrak S} _B( {\mathcal L} )x(\ln R)^{k-1}I_k. \end{aligned}$$

Hence,

$$ S_4 \leq c_5 k^4\ln k \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^{k-1}I_k \sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)}.$$
(5.70)

We put

$$ c_6=36Cc_5,$$
(5.71)

where \(C>0\) is the absolute constant in Lemma 5.2, and

$$ \eta = \frac{1}{12 c_6 k^4(\ln k)^2\ln\ln(q+2)}.$$
(5.72)

Let us show that

$$ (\ln x)^{-9/10}\leq 2\eta\leq 1.$$
(5.73)

The second inequality in (5.73) is equivalent to the inequality

$$6c_6 k^4(\ln k)^2\ln\ln(q+2) \geq 1.$$

We may assume that \( \widetilde{C}{} _0\geq 3\); therefore, \(\ln k \geq 1\). We have

$$6c_6 k^4(\ln k)^2\ln\ln(q+2) \geq 6c_6(\ln\ln 3) k^4 \geq 6c_6(\ln\ln 3) { \widetilde{C}{} _0}^4 \geq 1$$

provided that \( \widetilde{C}{} _0\) is chosen large enough. The first inequality in (5.73) is equivalent to the inequality

$$6c_6 k^4(\ln k)^2\ln\ln(q+2) \leq (\ln x)^{9/10}.$$

Since \(q \leq \ln x\) and \(k\leq (\ln x)^{1/5}\), we have

$$6c_6 k^4(\ln k)^2\ln\ln(q+2) \leq 6c_6 (\ln x)^{4/5}\frac{1}{25}(\ln \ln x)^2\ln\ln(\ln x+2) \leq (\ln x)^{9/10}$$

provided that \(c(\varepsilon)\) is chosen large enough. Thus, (5.73) holds. We can assume that \(x \geq c\), where \(c\) is the absolute constant in Lemma 5.2, provided that \(c(\varepsilon)\) is chosen large enough. Applying Lemma 5.2 and taking into account that \(\ln(k+1) \leq 2 \ln k\), we have

$$\sum_{\substack{1\leq b \leq 2\eta y\\ L=qt+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)} \leq \sum_{\substack{1\leq b \leq 2\eta \ln x\\ L=qt+b\notin {\mathcal L} }} \frac{\Delta_L}{ \varphi (\Delta_L)} \leq 4C\ln\ln(q+2)(\ln k) \eta \ln x = 36C \ln\ln(q+2)(\ln k) \eta \ln R.$$

Substituting this estimate into (5.70), we get (see also (5.71), (5.72), and (5.67))

$$\begin{aligned} \, S_4 &\leq 36Cc_5 k^4(\ln k)^2 \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k\eta \ln\ln(q+2) \nonumber\\[4pt] &= c_6 k^4(\ln k)^2 \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k \ln\ln(q+2) \frac{1}{12 c_6 k^4(\ln k)^2\ln\ln(q+2)} \nonumber\\[4pt] &= \frac{1}{12} \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k \leq \frac{m}{12} \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k \leq \frac{1}{6} S_2. \end{aligned}$$
(5.74)

From (5.69) and (5.74) we obtain

$$\widetilde{S}{} ( {\mathcal L} ) = S_1- S_2-S_3-S_4\geq S_1 - \frac{4}{3}S_2.$$

We have (see (5.2))

$$S_2 = m\sum_{n\in {\mathcal A} (x)} w_n = m (1+ o(1))\frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k \leq \frac{3}{2}m \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k$$

provided that \(c(\varepsilon)\) is chosen large enough. Applying (5.66) with \(c\) replaced by \(3c_1\), we obtain

$$\widetilde{S}{} ( {\mathcal L} )\geq \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k(3c_1\ln k - 2m),$$

where \(c_1>0\) is an absolute constant. We put

$$\widetilde{c}{} = \widetilde{C}{} _0+ \frac{1}{c_1},$$
(5.75)
$$k=\lceil \exp( \widetilde{c}{} m)\rceil.$$
(5.76)

It is not hard to see that

$$k\geq \widetilde{C}{} _0\qquad\text{and}\qquad 3c_1\ln k - 2m \geq m.$$

Since \(m\) is a positive integer, we see that \(3c_1\ln k - 2m \geq 1\). Hence,

$$\widetilde{S}{} ( {\mathcal L} )\geq \frac{B^k}{ \varphi (B)^k} \kern1pt {\mathfrak S} _B( {\mathcal L} )x(\ln R)^kI_k.$$

Since \(B^k/ \varphi (B)^k\geq 1\), \(\ln R = (1/9)\ln x\), \( {\mathfrak S} _B( {\mathcal L} )\geq \exp(-c_2k)\), and \(I_k\geq c_3(2k\ln k)^{-k}\), where \(c_2\) and \(c_3\) are positive absolute constants (see (5.6) and (5.7)), it follows that

$$\widetilde{S}{} ( {\mathcal L} )\geq \frac{1}{9^k}c_3(2k\ln k)^{-k}\exp(-c_2k)x(\ln x)^k \geq \exp(-k^2) x(\ln x)^k$$

provided that \( \widetilde{C}{} _0\) is chosen large enough. We obtain

$$\begin{aligned} \, S=\sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \widetilde{S}{} ( {\mathcal L} ) \geq \exp(-k^2) x(\ln x)^k \sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} 1 = \exp(-k^2) x(\ln x)^k S'. \end{aligned}$$
(5.77)

Now we derive a lower bound for \(S'\). First let us show that

$$ 2 \leq k \leq \frac12\biggl[\frac{\eta y}{q}\biggr].$$
(5.78)

The first inequality obviously holds, since we may assume that \( \widetilde{C}{} _0 \geq 2\). To prove the second inequality, it suffices to show that

$$ 2 k \leq \frac{\eta y}{q}.$$
(5.79)

We have (see (5.62) and (5.72))

$$\frac{\eta y}{q} \geq \eta y^\varepsilon= \frac{c_4 y^\varepsilon}{k^4(\ln k)^2\ln\ln(q+2)},$$

where \(c_4>0\) is an absolute constant. Thus, to prove (5.79), it suffices to show that

$$2k^5(\ln k)^2\ln\ln(q+2)\leq c_4 y^\varepsilon.$$

In particular, from (5.62) it follows that \(q\leq y\). Applying (5.63), we have

$$2k^5(\ln k)^2\ln\ln(q+2) \leq 2 y^{5\varepsilon/14}\frac{\varepsilon^2}{196}(\ln y)^2\ln\ln(y+2) \leq c_4 y^\varepsilon$$

provided that \(c(\varepsilon)\) is chosen large enough. Thus, (5.78) is proved.

We put

$$\Omega = \biggl\{ 1 \leq n \leq \biggl[\frac{\eta y}{q}\biggr] \colon\, \, (n,p)=1\ \,\forall p\leq k\biggr\}.$$

Applying Lemma 2.13, we have

$$\#\Omega = \Phi \biggl(\biggl[\frac{\eta y}{q}\biggr], k\biggr)\geq c_0 \frac{[\eta y/q]}{\ln k},$$

where \(c_0>0\) is an absolute constant. In particular, from (5.78) it follows that \(\eta y/ q \geq 4\), and so

$$\biggl[\frac{\eta y}{q}\biggr]\geq \frac{\eta y}{q} - 1\geq \frac{\eta y}{2q}.$$

We obtain

$$ \#\Omega \geq c_5 \frac{\eta y}{q\ln k},$$
(5.80)

where \(c_5>0\) is an absolute constant. Let us show that

$$ c_5 \frac{\eta y}{q\ln k}\geq 2 k.$$
(5.81)

Applying (5.62) and (5.72), we have

$$c_5 \frac{\eta y}{q\ln k}\geq \frac{c_6 y^\varepsilon}{k^4(\ln k)^3\ln\ln(q+2)},$$

where \(c_6>0\) is an absolute constant. Therefore, it suffices to show that

$$2k^5(\ln k)^3\ln\ln(q+2) \leq c_6 y^\varepsilon.$$

Applying (5.63) and taking into account that \(q\leq y\), we have

$$2k^5(\ln k)^3\ln\ln(q+2)\leq 2 y^{5\varepsilon/14}\Bigl( \frac{\varepsilon}{14} \Bigr)^3(\ln y)^3\ln\ln(y+2) \leq c_6 y^\varepsilon$$

provided that \(c(\varepsilon)\) is chosen large enough. Thus, (5.81) is proved.

Let \(b_1 <\dots<b_k\) be positive integers from the set \(\Omega\). Let us show that for any prime \(p\) with \(p\nmid q\) there is an integer \(m_p\) such that \(m_p\not \equiv b_i\pmod{p}\) for all \(1\leq i \leq k\). Let \(p\) be a prime with \(p\nmid q\). If \(p > k\), then the statement is obvious. If \(p \leq k\), then we may put \(m_p=0\); from the definition of the set \(\Omega\) it follows that \(b_i\not\equiv 0\pmod{p}\) for all \(1\leq i \leq k\). Thus, the statement is proved. By Lemma 5.1, \( {\mathcal L} (\textbf{b})\) is an admissible set. Hence (see also Lemma 2.12, (5.80), (5.81), and (5.72)),

$$\begin{aligned} \, S' &\geq \binom{\#\Omega}{k}\geq k^{-k}(\#\Omega - k)^k \geq k^{-k}\biggl(c_5 \frac{\eta y}{q\ln k} - k\biggr)^{\!k} \geq k^{-k}\biggl( \frac{c_5}{2} \frac{\eta y}{q\ln k} \biggr)^{\!k} \\[4pt] &=k^{-k}\biggl(c_6 \frac{y}{q\ln\ln(q+2)k^4(\ln k)^3} \biggr)^{\!k} = \biggl( \frac{y}{q\ln\ln(q+2)} \biggr)^{\!k}\biggl( \frac{c_6}{k^5(\ln k)^3} \biggr)^{\!k}, \end{aligned}$$

where \(c_6>0\) is an absolute constant. We have

$$\biggl( \frac{c_6}{k^5(\ln k)^3} \biggr)^{\!k} \geq \exp(-k^2)$$

provided that \( \widetilde{C}{} _0\) is chosen large enough. Hence,

$$S' \geq \biggl( \frac{y}{q\ln\ln(q+2)} \biggr)^{\!k} \exp(-k^2).$$

Substituting this estimate into (5.77), we obtain

$$S\geq \exp(-2k^2)x (\ln x)^k \biggl( \frac{y}{q\ln\ln(q+2)} \biggr)^{\!k} \geq \exp(-2k^5)x (\ln x)^k \biggl( \frac{y}{q\ln\ln(q+2)} \biggr)^{\!k}. $$
(5.82)

Now we obtain an upper bound for \(S\). Applying (5.64) and (5.65), we get

$$S\leq \sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \,\sum_{\substack{n\in {\mathcal A} (x) \colon\, A_n( {\mathcal L} )>0}}A_n( {\mathcal L} )w_n( {\mathcal L} ) \leq Ck (\ln R)^{2k} e^{(4k)/\rho}\sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \,\sum_{\substack{n\in {\mathcal A} (x) \colon\, A_n( {\mathcal L} )>0}} 1.$$

We have (see assertions (1)–(3), (i), and (ii) at the beginning of the proof)

$$\begin{aligned} \, &\sum_{\substack{1\leq b_1<\dots< b_k\\ qb_k\leq \eta y\\[1pt] {\mathcal L} = {\mathcal L} (\textbf{b})\in \mathrm{AS} }} \,\sum_{\substack{n\in {\mathcal A} (x) \colon\, A_n( {\mathcal L} )>0}} 1 \\[4pt] &\leq\#\bigl\{ x\leq n < 2x \colon\, \,\exists p_j,p_{j+1},\dots,p_{j+m}\in[qn+1, qn + 2\eta y],\ p_j,p_{j+1},\dots,p_{j+m}\equiv a {\textstyle\pmod{q}} \bigr\} \\[4pt] &\leq\#\bigl\{ x\leq n < 2x \colon\, \,\exists p_j,p_{j+1},\dots,p_{j+m}\in[qn+1, qn + y],\ p_j,p_{j+1},\dots,p_{j+m}\equiv a {\textstyle\pmod{q}} \bigr\}:=N_1. \end{aligned}$$

Hence,

$$S \leq Ck (\ln R)^{2k} e^{(4k)/\rho} N_1.$$

Since \(\rho\) lies in the interval (5.68), we have

$$\frac{4k}{\rho} \leq \frac{8 k^4\ln k}{c_3}= c_4k^4\ln k,$$

where \(c_4>0\) is an absolute constant. Since \(\ln R = (1/9)\ln x\), it follows that

$$Ck (\ln R)^{2k} e^{(4k)/\rho}\leq C\frac{k}{9^{2k}}\exp(c_4k^4\ln k) (\ln x)^{2k}\leq \exp(k^5)(\ln x)^{2k}$$

provided that \( \widetilde{C}{} _0\) is chosen large enough. Hence,

$$ S \leq \exp(k^5)(\ln x)^{2k} N_1.$$
(5.83)

From (5.82) and (5.83) we obtain

$$ N_1\geq x \Bigl( \frac{y}{\ln x} \Bigr)^{k}\biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5).$$
(5.84)

We define

$$\begin{aligned} \, \Omega_1 &= \bigl\{ x\leq n \leq 2x-1 \colon\, \,\exists p_j,p_{j+1},\dots,p_{j+m}\in[qn+1, qn + y],\ p_j,p_{j+1},\dots,p_{j+m}\equiv a {\textstyle\pmod{q}} \bigr\},\\[5pt] \Omega_2 &= \bigl\{qx+1\leq p_n \leq q(2x-1)+y \colon\, \, p_n\equiv \dots \equiv p_{n+m} \equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \end{aligned}$$

and put \(N_2=\#\Omega_2\). Since \(x\) is a positive integer, we have \(N_1=\#\Omega_1\). Let us show that

$$ N_1 \leq (\lceil y\rceil +1)N_2.$$
(5.85)

Let \(n\in\Omega_1\). Then there are at least \(m+1\) consecutive primes all congruent to \(a\pmod{q}\) in the interval \([qn+1, qn + y]\). Let \(p\) be the first of them. Then \(p\in\Omega_2\). We put

$$\Lambda = \bigl\{j\in{\mathbb Z} \colon\, \, qj+ 1 \leq p \leq qj+y\bigr\}$$

and claim that

$$ \# \Lambda \leq \lceil y \rceil +1.$$
(5.86)

Let \(I_j= [qj+1, qj+y]\), \(j\in{\mathbb Z}\). Since \(p\in I_n\), we have \( \Lambda \neq \varnothing\). Let \(l\) be the minimal element in \( \Lambda \). We put \(t=\lceil y\rceil + 1\). Then \(t>y\) and

$$q(l+t)+1> q(l+t)=ql+qt\geq ql +t> ql+y\geq p.$$

Hence, \(p\notin I_j\) for \(j \geq l+t\) and \(j\leq l-1\). We obtain \(\# \Lambda \leq t\). Thus, (5.86) is proved; (5.85) follows from (5.86). We have \(\lceil y\rceil + 1\leq y+2 \leq 2y\) provided that \(c(\varepsilon)\) is chosen large enough. Since

$$N_2 \leq \#\bigl\{qx+1\leq p_n \leq 2qx+y \colon\, \, p_n\equiv \dots \equiv p_{n+m} \equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\}=:N_3,$$

we obtain (see (5.84))

$$ N_3\geq \frac{1}{2}\frac{x}{y} \Bigl( \frac{y}{\ln x} \Bigr)^{k} \biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5).$$
(5.87)

We put

$$\begin{aligned} \, N_4 &= \#\bigl\{qx< p_n \leq 2qx - 5q \colon\, \, p_n\equiv \dots \equiv p_{n+m} \equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\}, \\[5pt] N_5 &= \#\bigl\{2qx -5q<p_n \leq 2qx + y \colon\, \, p_n\equiv \dots \equiv p_{n+m} \equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\}.\nonumber \end{aligned}$$
(5.88)

Then

$$ N_3= N_4+N_5.$$
(5.89)

Since \(q \leq y\), we have

$$ N_5 \leq 5q+ [y]\leq 5q+ y\leq 6 y.$$
(5.90)

Let us show that

$$ y \leq \frac{1}{24}\frac{x}{y} \Bigl( \frac{y}{\ln x} \Bigr)^{k}\biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5) :=T_1.$$
(5.91)

Since \(q\leq y^{1-\varepsilon}\leq y\) and \(k \leq y^{\varepsilon/14}\), we have

$$T_1 \geq \frac{1}{24}\frac{x}{y} \biggl( \frac{y^\varepsilon}{\ln x\ln\ln(y+2)} \biggr)^{\!k}\exp\bigl(-3y^{5\varepsilon/14}\bigr).$$

Therefore, to prove (5.91), it suffices to show that

$$y \leq \frac{1}{24}\frac{x}{y} \biggl( \frac{y^\varepsilon}{\ln x\ln\ln(y+2)} \biggr)^{\!k}\exp\bigl(-3y^{5\varepsilon/14}\bigr).$$

Taking logarithms, we obtain

$$\ln y \leq -\ln 24 + \ln x-\ln y + k\bigl(\varepsilon\ln y-\ln\ln x-\ln\ln\ln(y+2)\bigr) - 3y^{5\varepsilon/14}$$

or, which is equivalent,

$$T_2:= 2\ln y + \ln 24 - \varepsilon k \ln y + k\ln\ln x + k\ln\ln\ln(y+2) + 3y^{5\varepsilon/14} \leq \ln x.$$

Since \(y \leq \ln x\) and \(0<\varepsilon<1\), we have \(k \leq (\ln x)^{\varepsilon/14}\leq (\ln x)^{1/14}\). Then

$$T_2 \leq 2 \ln\ln x + \ln 24 + (\ln x)^{1/14}\ln\ln x+ (\ln x)^{1/14} \ln\ln\ln(\ln x+2) + 3 (\ln x)^{5/14} \leq \ln x$$

provided that \(c(\varepsilon)\) is chosen large enough. Thus, (5.91) is proved. From (5.90) and (5.91) it follows that

$$ N_5 \leq \frac{1}{4}\frac{x}{y} \Bigl( \frac{y}{\ln x} \Bigr)^{k}\biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5).$$
(5.92)

Applying (5.87), (5.89), and (5.92), we obtain

$$ N_4 \geq \frac{1}{4}\frac{x}{y} \Bigl( \frac{y}{\ln x} \Bigr)^{k}\biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5)=: T_3.$$
(5.93)

We have (see (2.2))

$$\pi(2qx) \leq c_1 \frac{2qx}{\ln(2qx)}\leq c_1 \frac{2qx}{\ln x}=c_2\frac{qx}{\ln x},$$

where \(c_1>0\) and \(c_2=2c_1>0\) are absolute constants. Therefore,

$$\begin{aligned} \, T_3 &= \frac{qx}{\ln x}\frac{\ln x}{qx} \frac{1}{4}\frac{x}{y} \Bigl( \frac{y}{\ln x} \Bigr)^{k} \biggl( \frac{1}{q\ln\ln(q+2)} \biggr)^{\!k}\exp(-3k^5) \\[4pt] &\geq \frac{1}{4c_2} \kern1pt \pi(2qx)\Bigl( \frac{y}{\ln x} \Bigr)^{k-1}\frac{1}{q^{k+1}(\ln\ln(q+2))^k}\exp(-3k^5). \end{aligned}$$

Using the inequality \(\ln(1+x)\leq x\), \(x>0\), we obtain \(\ln\ln(q+2)\leq \ln(1+q)\leq q\). Hence,

$$\frac{1}{q^{k+1} (\ln\ln(q+2))^k}\geq \frac{1}{q^{2k+1}} \geq \frac{1}{q^{3k^5}}.$$

We can assume that \(4c_2 \leq 2^{3k^5}\) if \( \widetilde{C}{} _0\) is chosen large enough. We have

$$T_3 \geq \pi(2qx)\Bigl( \frac{y}{\ln x} \Bigr)^{k-1}\frac{1}{(2eq)^{3k^5}}.$$

We can also assume that \(3k^5\leq k^6\) if \( \widetilde{C}{} _0\) is chosen large enough. Hence,

$$\frac{1}{(2eq)^{3k^5}}\geq \frac{1}{(2eq)^{k^6}}.$$

We have \((2e)^{k^6} \leq 2^{k^7}\) if \( \widetilde{C}{} _0\) is chosen large enough. It is clear that \(q^{k^6} \leq q^{k^7}\). Then

$$\frac{1}{(2eq)^{k^6}} \geq \frac{1}{(2q)^{k^7}}.$$

Further (see (5.61)),

$$0<\frac{y}{\ln x} \leq 1\qquad\Rightarrow\qquad \Bigl( \frac{y}{\ln x} \Bigr)^{k-1} \geq \Bigl( \frac{y}{\ln x} \Bigr)^{k^7}.$$

We obtain

$$T_3 \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{k^7}.$$

From (5.75) and (5.76) we find

$$ k= \lceil \exp( \widetilde{c}{} m)\rceil \leq \exp( \widetilde{c}{} m) +1 \leq \exp(2 \widetilde{c}{} m)$$
(5.94)

provided that \( \widetilde{C}{} _0\) is chosen large enough. Therefore, \(k^7 \leq \exp(14 \widetilde{c}{} m)\). Since \( \widetilde{C}{} _0\) is a positive absolute constant, we see from (5.75) that \( \widetilde{c}{} \) is a positive absolute constant. We have

$$ T_3 \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(14 \widetilde{c}{} m)}=\pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)},$$
(5.95)

where \(C=14 \widetilde{c}{} >0\) is an absolute constant. Combining (5.88), (5.93), and (5.95) we obtain

$$\begin{aligned} \, \#\bigl\{qx< p_n \leq 2qx - 5q \colon\, \, p_n\equiv \dots \equiv p_{n+m} \equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)}. \end{aligned}$$

Applying (5.94), we see that the inequality \(k\leq y^{\varepsilon/14}\) holds if \(\exp(2 \widetilde{c}{} m) \leq y^{\varepsilon/14}\). This inequality is equivalent to

$$m \leq \frac{\varepsilon}{28 \kern1pt \widetilde{c}{} } \ln y =c \kern1pt \varepsilon\ln y,$$

where \(c= 1/(28 \widetilde{c}{} \kern1pt )>0\) is an absolute constant. Let us redenote \(c(\varepsilon)\) by \(c_0(\varepsilon)\). Lemma 5.4 is proved. \(\quad\Box\)

Lemma 5.5.

There are positive absolute constants \(c\) and \(C\) such that the following holds. Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Then there is a number \(c_0(\varepsilon)>0,\) depending only on \(\varepsilon,\) such that if \(x\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) satisfy the conditions \(c_0(\varepsilon)\leq y \leq \ln x,\) \(1 \leq m \leq c \kern1pt \varepsilon\ln y,\) \(1 \leq q \leq y^{1-\varepsilon},\) and \((a,q)=1,\) then

$$\#\bigl\{qx< p_n\leq 2qx \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)}.$$

Proof.

Let \(c\), \(C\), and \(c_0(\varepsilon)\) be the quantities mentioned in Lemma 5.4. We will choose a quantity \( \widetilde{c}{} _0(\varepsilon)\) and an absolute constant \( \widetilde{C}{} \) later; they will be large enough. In particular, let \( \widetilde{c}{} _0(\varepsilon) \geq c_0(\varepsilon)\) and \( \widetilde{C}{} \geq C\). Let \(x\in{\mathbb R}\), \(y\in{\mathbb R}\), \(m\in{\mathbb Z}\), \(q\in{\mathbb Z}\), and \(a\in{\mathbb Z}\) be such that \( \widetilde{c}{} _0(\varepsilon)\leq y \leq \ln x\), \(1\leq m \leq c \kern1pt \varepsilon\ln y\), \(1\leq q \leq y^{1-\varepsilon}\), and \((a,q)=1\). We put \(l=\lceil x\rceil\). Then, by Lemma 5.4, we have

$$\begin{aligned} \, \nonumber N_1&=\#\bigl\{ql< p_n\leq 2ql - 5q \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \\[4pt] &\geq \pi(2ql)\biggl( \frac{y}{2q\ln l} \biggr)^{\!\exp(Cm)}=:T_1. \end{aligned}$$
(5.96)

Since \(x \leq l < x+1\), we have

$$ql\geq qx \qquad\text{and}\qquad 2ql - 5q\leq 2q(x+1)-5q=2qx - 3q< 2qx.$$

Therefore,

$$N_1\leq\#\bigl\{qx< p_n\leq 2qx \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\}=: N_2. $$
(5.97)

We have \(x+1 \leq x^2\) provided that \( \widetilde{c}{} _0(\varepsilon)\) is chosen large enough. Hence,

$$\ln l \leq \ln(x+1)\leq 2\ln x.$$

Since \(\pi(2ql)\geq \pi(2qx)\), we have

$$T_1 \geq \pi(2qx)\biggl( \frac{y}{4q\ln x} \biggr)^{\!\exp(Cm)} =\pi(2qx)\biggl( \frac{y}{q\ln x} \biggr)^{\!\exp(Cm)} \biggl( \frac{1}{4} \biggr)^{\!\exp(Cm)}.$$

Then

$$2\exp( \widetilde{C}{} m)\leq \exp(2 \widetilde{C}{} m)$$

provided that \( \widetilde{C}{} \) is chosen large enough. Since \( \widetilde{C}{} \geq C\), we have

$$\biggl( \frac{1}{4} \biggr)^{\!\exp(Cm)} \geq \biggl( \frac{1}{4} \biggr)^{\!\exp( \widetilde{C}{} m)} =\biggl( \frac{1}{2} \biggr)^{\!2\exp( \widetilde{C}{} m)}\geq \biggl( \frac{1}{2} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

Further,

$$0<\frac{y}{q\ln x}\leq 1 \qquad\Rightarrow\qquad \biggl( \frac{y}{q\ln x} \biggr)^{\!\exp(Cm)} \geq \biggl( \frac{y}{q\ln x} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

Hence,

$$ T_1 \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$
(5.98)

From (5.96)–(5.98) we obtain

$$\#\bigl\{qx< p_n\leq 2qx \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

Let us denote \( \widetilde{c}{} _0(\varepsilon)\) by \(c_0(\varepsilon)\) and \(2 \widetilde{C}{} \) by \(C\). Lemma 5.5 is proved. \(\quad\Box\)

Let us complete the proof of Theorem 1.1. Let \(c_0(\varepsilon)\), \(c\), \(C\) be the quantities in Lemma 5.5. We will choose a quantity \( \widetilde{c}{} _0(\varepsilon)\) and an absolute constant \( \widetilde{C}{} \) later; they will be large enough. Let \( \widetilde{c}{} _0(\varepsilon) \geq c_0(\varepsilon)\) and \( \widetilde{C}{} \geq C\).

Let us prove the following statement.

Proposition 5.2.

Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Let \(t\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) be such that

$$t\geq 100,\qquad \widetilde{c}{} _0(\varepsilon) \leq y \leq \ln \frac{t}{2\ln t},\qquad 1\leq m \leq c \kern1pt \varepsilon\ln y,\qquad 1\leq q \leq y^{1-\varepsilon},\qquad (a,q)=1.$$

Then

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{2q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}. $$
(5.99)

Proof.

Indeed, since \(t\geq 100\), we have \(2\ln t \geq 1\). Hence,

$$y\leq \ln \frac{t}{2\ln t} \leq \ln t.$$

We have \(q\leq y^{1-\varepsilon} \leq y \leq \ln t\). Therefore,

$$y\leq \ln \frac{t}{2\ln t} \leq \ln \frac{t}{2q}.$$

We put \(x={t}/{2q}\). Then \(x\in{\mathbb R}\), \(y\in{\mathbb R}\), \(m\in{\mathbb Z}\), \(q\in{\mathbb Z}\), and \(a\in{\mathbb Z}\) are such that

$$c_0(\varepsilon)\leq y \leq \ln x,\qquad 1\leq m \leq c \kern1pt \varepsilon\ln y,\qquad 1\leq q \leq y^{1-\varepsilon},\qquad (a,q)=1.$$

By Lemma 5.5, we have

$$\begin{aligned} \, &\#\bigl\{qx< p_n\leq 2qx \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\bigr\} \\[4pt] &\qquad\geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)} \geq \pi(2qx)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp( \widetilde{C}{} m)} \geq \pi(2qx)\biggl( \frac{y}{2q\ln(2qx)} \biggr)^{\!\exp( \widetilde{C}{} m)}. \end{aligned}$$

Returning to the variable \(t\), we obtain (5.99). \(\quad\Box\)

Let us prove the following statement.

Proposition 5.3.

Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Let \(t\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) be such that

$$t\geq 100,\qquad \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr) \leq \ln \frac{t}{2\ln t},\qquad 1\leq m \leq \frac{c}{4} \kern1pt \varepsilon\ln\ln t,\qquad 1\leq q \leq (\ln t)^{1-\varepsilon},\qquad (a,q)=1.$$

Then

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq \ln \frac{t}{2\ln t}\biggr\} \geq \pi(t)\biggl( \frac{1}{4q} \biggr)^{\!\exp( \widetilde{C}{} m)}.$$

Proof.

We need the following

Lemma 5.6.

Let \(t\) be a real number with \(t \geq 100\). Then

$$2\ln t \leq \sqrt{t},\qquad \ln \frac{t}{2\ln t}\geq \frac{1}{2}\ln t,\qquad \ln\ln \frac{t}{2\ln t}\geq \frac{1}{2}\ln\ln t,\qquad 1-\frac{\ln(2\ln t)}{\ln t} \geq \frac{1}{2}.$$

The proof of lemma 5.6 is a simple exercise in calculus, and we omit it.

We put

$$y=\ln \frac{t}{2\ln t}.$$

Since \(t\geq 100\), we have (see Lemma 5.6)

$$\ln y = \ln\ln \frac{t}{2\ln t}\geq \frac{1}{2}\ln\ln t.$$

Therefore,

$$1\leq m\leq c \kern1pt \frac{\varepsilon}{2}\ln y.$$

We may assume that \( \widetilde{c}{} _0(\varepsilon) \geq 2^{1/\varepsilon}\). Since \(t \geq 100\), we have \(t/(2\ln t)\leq t\) and

$$\widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr) \leq \ln \frac{t}{2\ln t} \leq \ln t.$$

Hence,

$$t \geq \exp\Bigl( \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr) \Bigr) \geq \exp\bigl(2^{2/\varepsilon}\bigr).$$

Therefore,

$$ \frac{1}{2} (\ln t)^{1- \varepsilon/2}\geq (\ln t)^{1-\varepsilon}.$$
(5.100)

From (5.100) and the last inequality in Lemma 5.6 we find

$$\begin{aligned} \, y^{1 - \varepsilon/2} &= \biggl( \ln \frac{t}{2\ln t} \biggr)^{\!1- \varepsilon/2} =(\ln t)^{1- \varepsilon/2} \biggl( 1- \frac{\ln(2\ln t)}{\ln t} \biggr)^{\!1-\varepsilon/2} \geq (\ln t)^{1- \varepsilon/2} \biggl( \frac{1}{2} \biggr)^{\!1-\varepsilon/2} \\[4pt] &\geq \frac{1}{2}(\ln t)^{1-\varepsilon/2} \geq (\ln t)^{1-\varepsilon}. \end{aligned}$$

Since \(1 \leq q \leq (\ln t)^{1-\varepsilon}\), we have \(1 \leq q \leq y^{1 - \varepsilon/2}\). Applying Proposition 5.2 with \(\varepsilon/2\) and the second inequality of Lemma 5.6, we have

$$\begin{aligned} \, &\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq \ln \frac{t}{2\ln t}\biggr\} \\[4pt] &\qquad\geq \pi(t)\biggl( \frac{\ln(t/(2\ln t))}{2q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)} \geq \pi(t)\biggl( \frac{1}{4q} \biggr)^{\!\exp( \widetilde{C}{} m)}. \end{aligned}$$

The statement is proved. \(\quad\Box\)

Proposition 5.4.

Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Let \(t\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) be such that

$$t\geq 100,\qquad \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr) \leq \ln \frac{t}{2\ln t} \leq y \leq \ln t,\qquad 1\leq m \leq \frac{c}{4} \kern1pt \varepsilon\ln y,\qquad 1\leq q \leq y^{1-\varepsilon},\qquad (a,q)=1.$$

Then

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}.$$

Proof.

Since \(y \leq \ln t\), we have

$$1\leq m \leq \frac{c}{4} \kern1pt \varepsilon\ln \ln t \qquad\text{and}\qquad 1\leq q \leq (\ln t)^{1-\varepsilon}.$$

Applying Proposition 5.3, we obtain

$$\begin{aligned} \, &\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \\[2pt] &\qquad\geq \#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m}-p_n\leq \ln \frac{t}{2\ln t}\biggr\} \\[2pt] &\qquad\geq \pi(t)\biggl( \frac{1}{4q} \biggr)^{\!\exp( \widetilde{C}{} m)} \geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}. \ \quad\Box\end{aligned}$$

For \(0<\varepsilon<1\) we define the quantity \(t_0(\varepsilon)\) as follows:

$$t_0(\varepsilon) \geq 100,\qquad \ln \frac{t}{2\ln t} \geq \max\Bigl\{ \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr), \widetilde{c}{} _0(\varepsilon)\Bigr\}\quad \text{for any }\ t \geq t_0(\varepsilon).$$

Let us prove the following statement.

Proposition 5.5.

Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Let \(t\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) be such that

$$t\geq t_0(\varepsilon),\ \quad \max\Bigl\{ \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr), \widetilde{c}{} _0(\varepsilon)\Bigr\} \leq y \leq \ln t,\ \quad 1\leq m \leq \frac{c}{4} \kern1pt \varepsilon\ln y,\ \quad 1\leq q \leq y^{1-\varepsilon},\ \quad (a,q)=1.$$

Then

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}.$$

Proof.

Consider two cases. If

$$\ln \frac{t}{2\ln t} < y \leq \ln t,$$

then \(t\), \(y\), \(m\), \(q\), and \(a\) satisfy the hypothesis of Proposition 5.4, which yields

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}.$$

If

$$y \leq \ln \frac{t}{2\ln t},$$

then \(t\), \(y\), \(m\), \(q\), and \(a\) satisfy the hypothesis of Proposition 5.2, which yields

$$\begin{aligned} \, \#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} &\geq \pi(t)\biggl( \frac{y}{2q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)} \\[2pt] &\geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}. \ \quad\Box\end{aligned}$$

For \(0<\varepsilon<1\) we put

$$\rho(\varepsilon) = \max\Bigl\{ \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr), \widetilde{c}{} _0(\varepsilon)\Bigr\} + t_0(\varepsilon).$$

Let us prove the following statement.

Proposition 5.6.

Let \(\varepsilon\) be a real number with \(0<\varepsilon<1\). Let \(t\in{\mathbb R},\) \(y\in{\mathbb R},\) \(m\in{\mathbb Z},\) \(q\in{\mathbb Z},\) and \(a\in{\mathbb Z}\) be such that

$$\rho(\varepsilon) \leq y \leq \ln t,\qquad 1\leq m \leq \frac{c}{4} \kern1pt \varepsilon\ln y,\qquad 1\leq q \leq y^{1-\varepsilon},\qquad (a,q)=1.$$

Then

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{2q\ln t} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

Proof.

We have

$$\max\Bigl\{ \widetilde{c}{} _0\Bigl( \frac{\varepsilon}{2} \Bigr), \widetilde{c}{} _0(\varepsilon)\Bigr\}\leq y \leq \ln t \qquad\text{and}\qquad t\geq \exp(\rho(\varepsilon))\geq \rho(\varepsilon)\geq t_0(\varepsilon).$$

Applying Proposition 5.5, we obtain

$$\#\biggl\{\frac t2< p_n\leq t \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ \ p_{n+m} - p_n \leq y\biggr\} \geq \pi(t)\biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)}. $$
(5.101)

We may assume that \( \widetilde{C}{} \geq 2\). Therefore, \(\exp( \widetilde{C}{} m)\geq \widetilde{C}{} m\geq \widetilde{C}{} \geq 2\). Hence, \(2\exp( \widetilde{C}{} m)\leq \exp(2 \widetilde{C}{} m)\). We have

$$\biggl( \frac{1}{4} \biggr)^{\!\exp( \widetilde{C}{} m)}=\biggl( \frac{1}{2} \biggr)^{\!2\exp( \widetilde{C}{} m)} \geq\biggl( \frac{1}{2} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

Further,

$$0<\frac{y}{q\ln t}\leq 1\qquad\Rightarrow\qquad \biggl( \frac{y}{q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)} \geq \biggl( \frac{y}{q\ln t} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$

We obtain

$$ \biggl( \frac{y}{4q\ln t} \biggr)^{\!\exp( \widetilde{C}{} m)} \geq \biggl( \frac{y}{2q\ln t} \biggr)^{\!\exp(2 \widetilde{C}{} m)}.$$
(5.102)

Relations (5.101) and (5.102) imply the required assertion. \(\quad\Box\)

Let us denote \(\rho(\varepsilon)\) by \(c_0(\varepsilon)\), \(c/4\) by \(c\), and \(2 \widetilde{C}{} \) by \(C\). Theorem 1.1 is proved. \(\quad\Box\)

Proof of Corollary 1.1 .

Let \(c_0(\varepsilon)\), \(c\), and \(C\) be the quantities in Theorem 1.1. We put

$$C_1= \max\biggl\{ \frac{2}{c}, c_0\biggl( \frac{1}{2} \biggr), C\biggr\}.$$

Let \(m\) be a positive integer. Let \(x\in{\mathbb R}\) and \(y\in{\mathbb R}\) be such that \(\exp(C_1m) \leq y \leq \ln x\). Then

$$y\geq \exp(C_1m) \geq C_1m\geq C_1 \geq c_0\biggl( \frac{1}{2} \biggr)\qquad\text{and}\qquad y\geq \exp(C_1m)\geq \exp\biggl( \frac{2}{c}m \biggr).$$

The last inequality implies

$$m\leq c \kern1pt \frac{1}{2}\ln y.$$

Putting \(q=1\) and \(a=1\), we have

$$c_0\biggl( \frac{1}{2} \biggr)\leq y \leq \ln x,\qquad 1\leq m \leq c \kern1pt \frac{1}{2}\ln y,\qquad 1\leq q\leq y^{1/2},\qquad (a,q)=1.$$

Applying Theorem 1.1 with \(\varepsilon=1/2\), we see that

$$\begin{aligned} \, &\#\Bigl\{\frac x2< p_n\leq x \colon\, \, p_{n+m} - p_n \leq y\Bigr\} \\[4pt] &\qquad=\#\Bigl\{\frac x2< p_n\leq x \colon\, \, p_n\equiv\dots\equiv p_{n+m}\equiv a {\textstyle\pmod{q}} ,\ p_{n+m} - p_n \leq y\Bigr\} \\[4pt] &\qquad\geq \pi(x)\biggl( \frac{y}{2q\ln x} \biggr)^{\!\exp(Cm)} =\pi(x)\Bigl( \frac{y}{2\ln x} \Bigr)^{\exp(Cm)} \geq \pi(x)\Bigl( \frac{y}{2\ln x} \Bigr)^{\exp(C_1m)}. \end{aligned}$$

Let us redenote \(C_1\) by \(C\). Corollary 1.1 is proved. \(\quad\Box\)