## On a symmetric congruence and its applications

### A. A. Karatsuba Steklov Institute of Mathematics Russian Academy of Sciences GSP-1, ul. Gubkina 8 Moscow, Russia karatsuba@mi.ras.ru

Abstract
For a large integer $m,$  we obtain an asymptotic formula for the number of solutions of a certain congruence modulo $m$  with four variables, where the variables belong to special sets of residue classes modulo $m.$  This formula are applied to obtain a new bound for a double trigonometric sum with an exponential function and new information on the exceptional set of the multiplication table problem in a residue ring modulo $m.$  1

1 Introduction

Throughout the paper the implied constants in the Landau ` $O$  ' and ` $o$  ' symbols as well as in the Vinogradov symbols ` $\ll$  ' and ` $\gg$  ' may depend on the small positive quantity $\varepsilon .$  By $p$  and $q$  we will always denote prime numbers.
Let $m$  be an integer parameter, $\mathcal{V}$  be any subset of prime numbers coprime to $m$  and not exceeding ${m}^{1/2},$  and let $S$  and $L$  be any integers with $0  In this paper we obtain an asymptotic formula for the number of solutions of the congruence ${v}_{1}{y}_{1}\equiv {v}_{2}{y}_{2}\left(modm\right),{v}_{1},{v}_{2}\in \mathcal{V},S+1\le {y}_{1},{y}_{2}\le S+L$  and give its applications.
Below $|\mathcal{V}|$  stands for the number of elements in $\mathcal{V}.$  By $\tau \left(m\right)$  we denote the classical divisor function.
Theorem 1. The following asymptotic formula holds:
$J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+|\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+O\left(\frac{{m}^{2}{log}^{2}m}{\phi \left(m\right)}\right),$  where $\phi \left(m\right)$  is the Euler function.
Theorem  1 finds its application in estimating of double trigonometric sums with an exponential function. For a positive integer $m$  we denote by ${\mathbb{Z}}_{m}=\left\{0,1,...,m-1\right\}$  the residue ring modulo $m.$  Let $p$  be a large prime number, $T$  be a divisor of $p-1,$  $\lambda$  be an element of ${\mathbb{Z}}_{p}$  of multiplicative order $T,$  i.e. $\lambda ={g}^{\left(p-1\right)/T}$  for some primitive root $g$  modulo $p,$  $\gamma \left(n\right)$  be any complex coefficients with $|\gamma \left(n\right)|\le 1.$  Denote ${\mathbf{e}}_{m}\left(z\right)=exp\left(2\pi iz/m\right).$
Theorem 2. Let $a$  be any integer coprime to $m.$  For any integers $K$  and $N$  with $0  and any set $\mathcal{X}\subset {\mathbb{Z}}_{p-1},$  the inequality ${\sum }_{x\in \mathcal{X}}|{\sum }_{y=K+1}^{K+N}\gamma \left(y\right){\mathbf{e}}_{p}\left(a{\lambda }^{xy}\right)|\ll \frac{|\mathcal{X}{|}^{1/2}{N}^{3/4}{p}^{\frac{7}{8}+o\left(1\right)}}{{T}^{1/4}}.$  holds, where $|\mathcal{X}|$  denotes the cardinality of the set $\mathcal{X}.$
Corollary 3. Let $a$  be any integer coprime to $m.$  For any integers $K,N,L,M$  with $0  and any coefficients ${\alpha }_{x}$  and ${\beta }_{y}$  with $|{\alpha }_{x}|\le 1,$  $|{\beta }_{y}|\le 1,$  the following inequality holds:
$|{\sum }_{x=L+1}^{L+M}{\sum }_{y=K+1}^{K+N}{\alpha }_{x}{\beta }_{y}{\mathbf{e}}_{p}\left(a{g}^{xy}\right)|\ll {\left(NM\right)}^{5/8}{p}^{5/8+o\left(1\right)}.$
This estimate is nontrivial when $N\ge M\ge {p}^{5/6+\varepsilon }.$  For more information on trigonometric sums with an exponential function and their applications, see [1-[5and therein references.
To prove Corollary  3 we observe that the statement is trivial if $N\le {p}^{2/3}$  or if $M\le {p}^{2/3}.$  Assuming $min\left\{N,M\right\}>{p}^{2/3},$  from Theorem  2 we derive, $|{\sum }_{x=L+1}^{L+M}{\sum }_{y=K+1}^{K+N}{\alpha }_{x}{\beta }_{y}{\mathbf{e}}_{p}\left(a{g}^{xy}\right)|\ll {\sum }_{x=L+1}^{L+M}|{\sum }_{y=K+1}^{K+N}{\beta }_{y}{\mathbf{e}}_{p}\left(a{g}^{xy}\right)|\ll {M}^{1/2}{N}^{3/4}{p}^{5/8+o\left(1\right)},$  $|{\sum }_{x=L+1}^{L+M}{\sum }_{y=K+1}^{K+N}{\alpha }_{x}{\beta }_{y}{\mathbf{e}}_{p}\left(a{g}^{xy}\right)|\ll {\sum }_{y=K+1}^{K+N}|{\sum }_{x=L+1}^{L+M}{\alpha }_{x}{\mathbf{e}}_{p}\left(a{g}^{xy}\right)|\ll {N}^{1/2}{M}^{3/4}{p}^{5/8+o\left(1\right)}.$  The result now follows.
In passing, we remark that Theorem  2 and Corollary  3 remain true if ${\mathbf{e}}_{p}\left(a{g}^{xy}\right)$  is replaced by $\chi \left({g}^{xy}+a\right),$  where $\chi$  is any nonprincipal character modulo $p.$  Theorem  1 also finds its application in the problem of multiplication of intervals in a residue ring modulo $m.$
Corollary 4. For any fixed $\varepsilon >0$  the set $\left\{xy\left(modm\right):1\le x\le {m}^{1/2},S+1\le y\le S+{m}^{1/2}\left(logm{\right)}^{2+\varepsilon }\right\}$  contains $\left(1+O\left(\left(logm{\right)}^{-\varepsilon }\right)\right)m$  residue classes modulo $m.$
The classical conjecture claims that for any prime number $p$  any nonzero residue class modulo $p$  can be represented in the form $xy\left(modp\right),$  where $1\le x,y\le {p}^{1/2+o\left(1\right)}.$  A weaker version of this conjecture has been stated in [6, namely, for any prime $p$  there are $\left(1+o\left(1\right)\right)p$  residue classes modulo $p$  of the form $xy\left(modp\right)$  with $1\le x,y\le {p}^{1/2+o\left(1\right)}.$  Furthermore, in [6it has been proved that for almost all primes $p$  almost all residue classes modulo $p$  are representable in the form $xy\left(modp\right)$  with $1\le x,y\le {p}^{1/2}\left(logp{\right)}^{1,087}.$  The following consequence of Corollary  4 confirms the validity of the weaker version of the classical conjecture and essentially improves one of our results from [8.
Corollary 5. For any fixed $\varepsilon >0$  and any prime number $p$  the set $\left\{xy\left(modp\right):1\le x,y\le {p}^{1/2}\left(logp{\right)}^{2+\varepsilon }\right\}$  contains $\left(1+o\left(1\right)\right)p$  residue classes modulo $p.$
The method of the proof of Theorem  1 combined with an argument similar to that of [7allows to improve the exponent of the logarithmic factor in Corollaries  4 and  5 . More precisely, the following statement takes place.
Theorem 6. Let $\Delta =\Delta \left(m\right)\to \infty$  as $m\to \infty .$  Then the set $\left\{qy\left(modm\right):1\le q\le {m}^{1/2},S+1\le y\le S+\Delta {m}^{1/2}\sqrt{m/\phi \left(m\right)}logm\right\}$  contains $\left(1+O\left({\Delta }^{-1}\right)\right)m$  residue classes modulo $m.$
In particular we have
Corollary 7. Let $\Delta =\Delta \left(p\right)\to \infty$  as $p\to \infty .$  Then the set $\left\{qy\left(modp\right):1\le q\le {p}^{1/2},1\le y\le \Delta {p}^{1/2}logp\right\}$  contains $\left(1+O\left({\Delta }^{-1}\right)\right)p$  residue classes modulo $p.$
Since there are $O\left({p}^{1/2}\left(logp{\right)}^{-1}\right)$  primes not exceeding ${p}^{1/2},$  we see that the set $\left\{qy:1\le x\le {p}^{1/2},S+1\le y\le S+\Delta {p}^{1/2}logp\right\}$  contains only $O\left(p\Delta \right)$  integers. This shows that the ranges of variables in Theorem  6 and Corollary  7 are sufficiently sharp.
We will also prove the corresponding result for the ratio of intervals modulo a prime which improves one of the results of [6.
Theorem 8. Let $\Delta =\Delta \left(p\right)\to \infty$  as $p\to \infty .$  Then the set $\left\{x{y}^{-1}\left(modp\right):N+1\le x\le N+\Delta {p}^{1/2},S+1\le y\le S+\Delta {p}^{1/2}\right\}$  contains $\left(1+O\left({\Delta }^{-2}\right)\right)p$  residue classes modulo $p.$
Note however, that when $N=S=0$  and $\Delta <{p}^{1/2}/2,$  the set described in Theorem  8 misses $\gg {p}^{1/2}{\Delta }^{-1}$  reside classes modulo $p,$  see [6.
For the detailed description on the multiplication table problem modulo a prime, see [6and also [8.
The proofs of the results of [6and [8are based on estimates of multiplicative character sums. The approach we use here is based on trigonometric sums.

2 Proof of Theorem  1

Recall that $J$  denotes the number of solutions to the congruence ${v}_{1}{y}_{1}\equiv {v}_{2}{y}_{2}\left(modm\right),{v}_{1},{v}_{2}\in \mathcal{V},S+1\le {y}_{1},{y}_{2}\le S+L.$  We express $J$  in terms of trigonometric sums. Since ${v}_{1}{v}_{2}^{-1}{y}_{1}\equiv {y}_{2}\left(modm\right),$  then $J=\frac{1}{m}{\sum }_{a=0}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right),$  where $I$  denotes the interval $\left[S+1,S+L\right].$  Picking up the term corresponding to $a=0,$  we obtain $J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right).$  Furthermore,
 $\begin{array}{ccc}\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right)=& & \end{array}$
 $\begin{array}{ccc}& & \frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{v\in \mathcal{V}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({y}_{1}-{y}_{2}\right)\right)+\end{array}$
 $\begin{array}{ccc}& & \frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}{v}_{2}\ne {v}_{1}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right)=\end{array}$
 $\begin{array}{ccc}& & |\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}{v}_{2}\ne {v}_{1}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right).\end{array}$
Therefore $J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+|\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+\frac{{\theta }_{1}}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}{v}_{2}\ne {v}_{1}}|{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}{y}_{1}-{y}_{2}\right)\right)|.$  Here ${\theta }_{1},$  and ${\theta }_{j}$  everywhere below, denote some functions with $|{\theta }_{j}|\le 1.$  For a given $n$  let $r\left(n\right)$  be the number of solutions of the congruence ${v}_{1}{v}_{2}^{-1}\equiv n\left(modm\right),{v}_{1},{v}_{2}\in \mathcal{V},{v}_{1}\ne {v}_{2}.$  In particular $r\left(1\right)=0,$  and if $\left(n,m\right)>1,$  then $r\left(n\right)=0.$  Therefore, the above formula takes the form $J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+|\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+\frac{{\theta }_{1}}{m}{\sum }_{a=1}^{m-1}{\sum }_{1\le n\le m\left(n,m\right)=1}r\left(n\right)|{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left(n{y}_{1}-{y}_{2}\right)\right)|.$  It is important to note that ${v}^{2}\le m$  for any $v\in \mathcal{V}.$  For this reason we have $r\left(n\right)\le 1$  for any $n,1\le n\le m.$  Indeed, if ${v}_{1}{v}_{2}^{-1}\equiv {v}_{3}{v}_{4}^{-1}\left(modm\right)$  for some ${v}_{1},{v}_{2},{v}_{3},{v}_{4}\in \mathcal{V}$  and if ${v}_{1}\ne {v}_{2},$  then ${v}_{1}{v}_{4}\equiv {v}_{3}{v}_{2}\left(modm\right).$  Since ${v}^{2}\le m$  for any $v\in \mathcal{V},$  then we derive that ${v}_{1}{v}_{4}={v}_{3}{v}_{2}.$  But $\mathcal{V}$  consists only on prime numbers and ${v}_{1}\ne {v}_{2}.$  Hence, ${v}_{1}={v}_{3},{v}_{2}={v}_{4}.$  Thus
 $\begin{array}{c}J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+|\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+\frac{{\theta }_{2}}{m}{\sum }_{a=1}^{m-1}{\sum }_{1\le n\le m\left(n,m\right)=1}|{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left(n{y}_{1}-{y}_{2}\right)\right)|.\end{array}$ (1)
It is now useful to recall the bound $|{\sum }_{y\in I}{\mathbf{e}}_{m}\left(by\right)|\le \frac{1}{|sin\left(\pi b/m|},$  which, in application to  1 , yields
 $\begin{array}{c}J=\frac{|\mathcal{V}{|}^{2}{L}^{2}}{m}+|\mathcal{V}|L-\frac{|\mathcal{V}|{L}^{2}}{m}+\frac{{\theta }_{3}}{m}{\sum }_{a=1}^{m-1}{\sum }_{1\le n\le m\left(n,m\right)=1}\frac{1}{|sin\left(\pi an/m|}\frac{1}{|sin\left(\pi a/m|}.\end{array}$ (2)
For each divisor $s|m$  we collect together the values of $a$  with $\left(a,m\right)=s.$  Then
 $\begin{array}{ccc}{\sum }_{a=1}^{m-1}{\sum }_{1\le n\le m\left(n,m\right)=1}\frac{1}{|sin\left(\pi an/m|}\frac{1}{|sin\left(\pi a/m|}=& & \end{array}$
 $\begin{array}{ccc}& & {\sum }_{s|m}{\sum }_{1\le a\le m-1\left(a,m\right)=s}{\sum }_{1\le n\le m\left(n,m\right)=1}\frac{1}{|sin\left(\pi an/m|}\frac{1}{|sin\left(\pi a/m|}\le \end{array}$
 $\begin{array}{ccc}& & {\sum }_{s|ms
 $\begin{array}{ccc}& & {\sum }_{s|ms
 $\begin{array}{ccc}& & {\sum }_{s|ms
where we have used the inequality ${\sum }_{s|m}\frac{1}{s}\le {\prod }_{p|m}\frac{1}{1-{p}^{-1}}=\frac{m}{\phi \left(m\right)}.$  Inserting this bound into  2 , we obtain the required estimate.

3 Proof of Theorem  2

If $|\mathcal{X}{|}^{1/2}{N}^{1/4}{T}^{1/4}{p}^{-7/8}\le 10$  then the estimate of Theorem  2 becomes trivial. Therefore, we can suppose that $Q:=|\mathcal{X}{|}^{1/2}{N}^{1/4}{T}^{1/4}{p}^{-7/8}\ge 10.$  For a given divisor $d|p-1$  let ${\mathcal{ℒ}}_{d}$  be the set of all integers $y$  such that $dy\in \left[K+1,K+N\right]$  and $\left(dy,p-1\right)=d.$  Then
 $\begin{array}{c}{W}_{a}\left(\gamma ;T;\mathcal{X};K,N\right)\le {\sum }_{d|p-1}{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right),\end{array}$ (3)
where ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)$  is defined by ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)={\sum }_{x\in \mathcal{X}}|{\sum }_{y\in {\mathcal{ℒ}}_{d}}\gamma \left(dy\right){\mathbf{e}}_{p}\left(a{g}^{tdxy}\right)|$  Note that $|{\mathcal{ℒ}}_{d}|\le N{d}^{-1}+1$  and that the elements of ${\mathcal{ℒ}}_{d}$  are relatively prime to $\left(p-1\right)/d.$  For the divisors $d|p-1$  with the condition $d\ge Q$  we use the trivial estimate ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)\le |\mathcal{X}||{\mathcal{ℒ}}_{d}|\le \frac{|\mathcal{X}|N}{Q}+|\mathcal{X}|\ll \frac{|\mathcal{X}{|}^{1/2}{N}^{3/4}{p}^{7/8}}{{T}^{1/4}}.$  Therefore, in view of $\tau \left(p-1\right)\le {p}^{o\left(1\right)},$  from  3 we obtain
 $\begin{array}{c}{W}_{a}\left(\gamma ;T;\mathcal{X};K,N\right)\ll {\sum }_{d|p-1d\le Q}{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)+\frac{|\mathcal{X}{|}^{1/2}{N}^{3/4}{p}^{7/8+o\left(1\right)}}{{T}^{1/4}}.\end{array}$ (4)
Below we suppose that $d\le Q$  (and therefore $|{\mathcal{ℒ}}_{d}|\le 2N{d}^{-1}$  ) and our aim is to obtain a suitable upper bound for ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right).$  Observe that if ${p}^{1/4}{T}^{1/2}{N}^{-1/2}{Q}^{-1/2}\le logp$  then the estimate of Theorem  2 becomes trivial. Indeed, in this case we would have that ${p}^{1/4}{T}^{1/2}{N}^{-1/2}|\mathcal{X}{|}^{-1/4}{N}^{-1/8}{T}^{-1/8}{p}^{7/16}\le logp.$  Therefore, ${T}^{1/4}\le |\mathcal{X}{|}^{1/6}{N}^{5/12}{p}^{-11/24+o\left(1\right)},$  whence $\frac{|\mathcal{X}{|}^{1/2}{N}^{3/4}{p}^{7/8+o\left(1\right)}}{{T}^{1/4}}=|\mathcal{X}{|}^{1/3}{N}^{1/3}{p}^{4/3+o\left(1\right)}\ge |\mathcal{X}|N.$  Hence, without loss of generality we may assume that
 $\begin{array}{c}{p}^{1/4}{T}^{1/2}{N}^{-1/2}{Q}^{-1/2}\ge logp.\end{array}$ (5)
Denote by $\mathcal{V}$  the set of the first $\left[{p}^{1/4}{T}^{1/2}{N}^{-1/2}{d}^{-1/2}\right]$  prime numbers which are not divisible by $p-1.$  Since any positive integer $m$  has only $O\left(logm\right)$  (even $O\left(logm/loglogm\right)$  ) different prime divisors, then from  5 we deduce that for any $v\in \mathcal{V}$  we have $v\ll \left(|\mathcal{V}|+logp\right)logp\ll |\mathcal{V}|logp.$  Here $|\mathcal{V}|,$  as before, denotes the cardinality of $\mathcal{V},$  that is $|\mathcal{V}|=\left[{p}^{1/4}{T}^{1/2}{N}^{-1/2}{d}^{-1/2}\right].$  We observe that if $TN\le {p}^{3/2,}$  then the estimate of Theorem  2 again becomes trivial. Hence, we may suppose that
 $\begin{array}{c}TN\ge {p}^{3/2}.\end{array}$ (6)
Now we follow the idea of [5in order to relate the problem of obtaining an upper bound for ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)$  with Theorem  1 . For a given divisor $d|p-1$  denote by ${\mathcal{U}}_{d}$  the set of all elements of the ring ${\mathbb{Z}}_{\left(p-1\right)/d}$  relatively prime to $\left(p-1\right)/d,$  that is ${\mathcal{U}}_{d}={\mathbb{Z}}_{\left(p-1\right)/d}^{*}.$  For any given integer $y$  with $\left(y,\left(p-1\right)/d\right)=1$  consider the congruence
 $\begin{array}{c}uv\equiv y\left(mod\left(\left(p-1\right)/d\right)\right),u\in {\mathcal{U}}_{d},v\in \mathcal{V}.\end{array}$ (7)
The number of solutions of this congruence is exactly equal to $|\mathcal{V}|.$  This follows from the fact that once $v$  is fixed then $u$  is determined uniquely.
We replace $\lambda$  by ${g}^{t},$  where $t=\left(p-1\right)/T,$  and consider the sum ${\sum }_{y\in {\mathcal{ℒ}}_{d}}\gamma \left(dy\right){\mathbf{e}}_{p}\left(a{g}^{tdxy}\right).$  Denote by $\delta \left(y\right):=\delta \left({\mathcal{ℒ}}_{d};y\right)$  the characteristic function of the set ${\mathcal{ℒ}}_{d}$  in the ring ${\mathbb{Z}}_{\left(p-1\right)/d}.$  Since the number of solutions of the congruence ( 7 ) is equal to $|\mathcal{V}|$  for any fixed $y\in {\mathcal{ℒ}}_{d},$  then ${\sum }_{y\in {\mathcal{ℒ}}_{d}}\gamma \left(dy\right){\mathbf{e}}_{p}\left(a{g}^{tdxy}\right)=\frac{1}{|\mathcal{V}|}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{v\in \mathcal{V}}\gamma \left(duv\right)\delta \left(uv\right){\mathbf{e}}_{p}\left(a{g}^{tdxuv}\right).$  Therefore, setting ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{V},{\mathcal{ℒ}}_{d}\right)={\sum }_{x\in \mathcal{X}}|{\sum }_{y\in {\mathcal{ℒ}}_{d}}\gamma \left(dy\right){\mathbf{e}}_{p}\left(a{g}^{tdxy}\right)|$  we see that ${\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)=\frac{1}{|\mathcal{V}|}{\sum }_{x\in \mathcal{X}}|{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{v\in \mathcal{V}}\gamma \left(duv\right)\delta \left(uv\right){\mathbf{e}}_{p}\left(a{g}^{tdxuv}\right)|.$  Application of the Cauchy inequality to the sums over $x$  and $u$  yields $|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}\le \frac{|{\mathcal{U}}_{d}||\mathcal{X}|}{|\mathcal{V}{|}^{2}}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{x=1}^{p-1}|{\sum }_{v\in \mathcal{V}}\gamma \left(duv\right)\delta \left(uv\right){\mathbf{e}}_{p}\left(a{g}^{tdxuv}\right){|}^{2}.$  If $\left(n,p-1\right)=d,$  if $x$  runs through ${\mathbb{Z}}_{p-1}$  and if $z$  runs through the reduced residue system modulo $p,$  then ${g}^{nx}$  and ${z}^{d}$  run the same system of residues modulo $p$  (including the multiplicities). Since $\left(du,p-1\right)=d,$  then $|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}\le \frac{|{\mathcal{U}}_{d}||\mathcal{X}|}{|\mathcal{V}{|}^{2}}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{z=1}^{p-1}|{\sum }_{v\in \mathcal{V}}\gamma \left(duv\right)\delta \left(uv\right){\mathbf{e}}_{p}\left(a{z}^{tdv}\right){|}^{2},$  whence
 $\begin{array}{ccc}& & |{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}\le \end{array}$
 $\begin{array}{ccc}& & \frac{|{\mathcal{U}}_{d}||\mathcal{X}|}{|\mathcal{V}{|}^{2}}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}\gamma \left(du{v}_{1}\right)\overline{\gamma \left(du{v}_{2}\right)}\delta \left(u{v}_{1}\right)\delta \left(u{v}_{2}\right){\sum }_{z=1}^{p-1}{\mathbf{e}}_{p}\left(a\left({z}^{td{v}_{1}}-{z}^{td{v}_{2}}\right)\right).\end{array}$
The rightmost sum is equal to $p-1$  when ${v}_{1}={v}_{2}$  and, according to the Weil estimate, is bounded by $\left(max\left\{{v}_{1},{v}_{2}\right\}\right)td{p}^{1/2}$  when ${v}_{1}\ne {v}_{2}.$  Recall that $max\left\{{v}_{1},{v}_{2}\right\}\ll |\mathcal{V}|logp,$  and $|{\mathcal{U}}_{d}|=\phi \left(\frac{p-1}{d}\right)\le \frac{p}{d}.$  Therefore,
 $\begin{array}{ccc}|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}& & \end{array}$ (8)
 $\begin{array}{ccc}& \ll \frac{{p}^{2}|\mathcal{X}|}{d|\mathcal{V}{|}^{2}}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{v\in \mathcal{V}}{\delta }^{2}\left(uv\right)+\frac{{p}^{3/2}|\mathcal{X}|tlogp}{|\mathcal{V}|}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}\delta \left(u{v}_{1}\right)\delta \left(u{v}_{2}\right).& \end{array}$ (9)
Next, from ( 7 ) we derive the formula
 $\begin{array}{c}{\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{v\in \mathcal{V}}{\delta }^{2}\left(uv\right)=|\mathcal{V}||{\mathcal{ℒ}}_{d}|.\end{array}$ (10)
Now set $J={\sum }_{u\in {\mathcal{U}}_{d}}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}\delta \left(u{v}_{1}\right)\delta \left(u{v}_{2}\right)$  and observe that $J$  is equal to the number of solutions of the system of congruences $\left\{\begin{array}{c}u{v}_{1}\equiv {y}_{2}\left(mod\frac{p-1}{d}\right)\\ u{v}_{2}\equiv {y}_{1}\left(mod\frac{p-1}{d}\right)\end{array}$  subject to the conditions $u\in {U}_{d},{v}_{1},{v}_{2}\in \mathcal{V},{y}_{1},{y}_{2}\in {\mathcal{ℒ}}_{d}.$  It then follows that ${v}_{1}{y}_{1}\equiv {v}_{2}{y}_{2}\left(mod\frac{p-1}{d}\right).$  Therefore, from  8 and  10 , we derive that $|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}\ll \frac{{p}^{2}|\mathcal{X}|}{d|\mathcal{V}{|}^{2}}|\mathcal{V}||{\mathcal{ℒ}}_{d}|+\frac{{p}^{5/2}|\mathcal{X}|logp}{T|\mathcal{V}|}J,$  whence
 $\begin{array}{c}|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right){|}^{2}\ll \frac{{p}^{2}|\mathcal{X}|N}{{d}^{2}|\mathcal{V}|}+\frac{{p}^{5/2}|\mathcal{X}|logp}{T|\mathcal{V}|}{J}_{d},\end{array}$ (11)
where ${J}_{d}$  denotes the number of solutions of the congruence ${v}_{1}{y}_{1}\equiv {v}_{2}{y}_{2}\left(mod\frac{p-1}{d}\right),{v}_{1},{v}_{2}\in \mathcal{V},\frac{K+1}{d}\le {y}_{1},{y}_{2}\le \frac{K+N}{d}.$  It is important to note that the condition of Theorem  2 yields, for any $v\in \mathcal{V},$  the bound ${v}^{2}\le |\mathcal{V}{|}^{2}\left(logp{\right)}^{2+o\left(1\right)}\le {p}^{1/2}\left(logp{\right)}^{2+o\left(1\right)}T{N}^{-1}{d}^{-1}\le \frac{p-1}{d}.$  Hence, we can apply Theorem  1 with $m=\left(p-1\right)/d.$  It gives ${J}_{d}\ll \frac{|\mathcal{V}{|}^{2}{N}^{2}}{\left(p-1\right)d}+\frac{|\mathcal{V}|N}{d}+\frac{|\mathcal{V}|{N}^{2}}{pd}+\frac{p\left(loglogp\right){log}^{2}p}{d},$  whence, using $|\mathcal{V}|\le {p}^{1/4}{T}^{1/2}{N}^{-1/2},$  we obtain ${J}_{d}\ll \frac{{p}^{-1/2+o\left(1\right)}TN}{d}\left(1+\frac{{p}^{3/4}}{{T}^{1/2}{N}^{1/2}}+\frac{{p}^{3/2}}{TN}\right).$  Taking into account  6 , we deduce ${J}_{d}\ll \frac{{p}^{-1/2+o\left(1\right)}TN}{d}.$  Combining this estimate with  11 , we conclude $|{\mathcal{ℛ}}_{a}\left(\gamma ;d,\mathcal{X},{\mathcal{ℒ}}_{d}\right)|\ll \frac{|\mathcal{V}{|}^{1/2}{N}^{3/4}{p}^{7/8+o\left(1\right)}}{{d}^{1/4}{T}^{1/4}}.$  The result now follows in view of  4 .

4 Proof of Theorem  6

Without loss of generality we may suppose that $\Delta {m}^{1/2}\sqrt{m/\phi \left(m\right)}logm  as otherwise the statement of Theorem  6 is trivial.
Denote by $\mathcal{V}$  the set of prime numbers coprime to $m$  and not exceeding ${m}^{1/2}.$  Let $J$  denote the number of solutions to the congruence ${v}_{1}\left({y}_{1}+{z}_{1}\right)\equiv {v}_{2}\left({y}_{2}+{z}_{2}\right)\left(modm\right)$  subject to the conditions ${v}_{1},{v}_{2}\in \mathcal{V},{y}_{1},{y}_{2},{z}_{1},{z}_{2}\in I,$  where $I$  denotes the set of integers $x,\left[S/2\right]+1\le x\le \left[S/2\right]+L,$  and $L=\left[\frac{\Delta {m}^{1/2}\sqrt{m/\phi \left(m\right)}logm}{2}\right].$  Obviously that $S+1\le {y}_{i}+{z}_{i}\le S+\Delta {m}^{1/2}logm,i=1,2.$  Following the lines of the proof of Theorem  1 , we express $J$  in terms of trigonometric sums. Since ${v}_{1}{v}_{2}^{-1}\left({y}_{1}+{z}_{1}\right)\equiv {y}_{2}+{z}_{2}\left(modm\right),$  then $J=\frac{1}{m}{\sum }_{a=0}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1},{z}_{1}\in I}{\sum }_{{y}_{2},{z}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}\left({y}_{1}+{z}_{1}\right)-{y}_{2}-{z}_{2}\right)\right).$  Picking up the term corresponding to $a=0,$  we obtain $J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}+\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1},{z}_{1}\in I}{\sum }_{{y}_{2},{z}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}\left({y}_{1}+{z}_{1}\right)-{y}_{2}-{z}_{2}\right)\right).$  Since the number of solutions of the congruence ${y}_{1}+{z}_{1}\equiv {y}_{2}+{z}_{2}\left(modm\right),{y}_{1},{z}_{1},{y}_{2},{z}_{2}\in I$  is $O\left({L}^{3}\right),$  then we obtain
 $\begin{array}{ccc}\frac{1}{m}|{\sum }_{a=1}^{m-1}{\sum }_{v\in \mathcal{V}}{\sum }_{{y}_{1},{z}_{1}\in I}{\sum }_{{y}_{2},{z}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({y}_{1}+{z}_{1}-{y}_{2}-{z}_{2}\right)\right)|\le & & \end{array}$
 $\begin{array}{ccc}& & \frac{|\mathcal{V}|}{m}{\sum }_{a=0}^{m-1}{|{\sum }_{y\in I}{\mathbf{e}}_{m}\left(a{y}_{1}\right)|}^{4}\ll |\mathcal{V}|{L}^{3}.\end{array}$
Therefore,
 $\begin{array}{ccc}\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}}{\sum }_{{y}_{1},{z}_{1}\in I}{\sum }_{{y}_{2},{z}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}\left({y}_{1}+{z}_{1}\right)-{y}_{2}-{z}_{2}\right)\right)=& & \end{array}$
 $\begin{array}{ccc}O\left(|\mathcal{V}|{L}^{3}\right)+\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{{v}_{1}\in \mathcal{V}}{\sum }_{{v}_{2}\in \mathcal{V}{v}_{2}\ne {v}_{1}}{\sum }_{{y}_{1}\in I}{\sum }_{{y}_{2}\in I}{\mathbf{e}}_{m}\left(a\left({v}_{1}{v}_{2}^{-1}\left({y}_{1}+{z}_{1}\right)-{y}_{2}-{z}_{2}\right)\right).& & \end{array}$
Using exactly the same argument that we used in the proof of Theorem  1 , we derive the formula $J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}+O\left(|\mathcal{V}|{L}^{3}\right)+O\left(R\right),$  where $R=\frac{1}{m}{\sum }_{a=1}^{m-1}{\sum }_{1\le n\le m\left(n,m\right)=1}|{\sum }_{{y}_{1},{z}_{1}\in I}{\sum }_{{y}_{2},{z}_{2}\in I}{\mathbf{e}}_{m}\left(a\left(n\left({y}_{1}+{z}_{1}\right)-{y}_{2}-{z}_{2}\right)\right)|$  Next, introducing $s=\left(a,m\right),$  we obtain
 $\begin{array}{ccc}R=\frac{1}{m}{\sum }_{s|ms
 $\begin{array}{ccc}\frac{1}{m}{\sum }_{s|ms
 $\begin{array}{ccc}\frac{1}{m}{\sum }_{s|ms
 $\begin{array}{ccc}\frac{1}{m}{\sum }_{s|ms
Therefore,
 $\begin{array}{c}J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}+O\left(|\mathcal{V}|{L}^{3}\right)+O\left({R}_{1}\right)+O\left({R}_{2}\right),\end{array}$ (12)
where
 $\begin{array}{c}{R}_{1}=\frac{1}{m}{\sum }_{s|ms (13)
 $\begin{array}{c}{R}_{2}=\frac{1}{m}{\sum }_{s|mm/L\le s (14)
If $s  then $m/s>L$  and therefore, the congruence ${y}_{1}\equiv {y}_{2}\left(modm/s\right),{y}_{1},{y}_{2}\in I$  has $L$  solutions. Hence, ${\sum }_{1\le n\le m/s}{|{\sum }_{y\in I}{\mathbf{e}}_{m/s}\left(ny\right)|}^{2}=\frac{mL}{s},$  whence, using  13 ,
 $\begin{array}{ccc}{R}_{1}\le \frac{1}{m}{\sum }_{s|ms
 $\begin{array}{ccc}m{L}^{2}{\sum }_{s|ms
Inserting this bound into  12 , we deduce
 $\begin{array}{c}J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}+O\left(|\mathcal{V}|{L}^{3}\right)+O\left({m}^{2}{L}^{2}/\phi \left(m\right)\right)+O\left({R}_{2}\right).\end{array}$ (15)
Now we proceed to estimate ${R}_{2}.$  Note that in  14 we have $\left(n,m/s\right)=1.$  Therefore, for any integer $K,$  ${\sum }_{y=K+1}^{K+m/s}{\mathbf{e}}_{m/s}\left(ny\right)=0,$  whence we deduce that there exist integers $A$  and $B$  with $0  such that ${\sum }_{y\in I}{\mathbf{e}}_{m/s}\left(ny\right)={\sum }_{A  Hence
 $\begin{array}{ccc}{\sum }_{1\le n\le m/s\left(n,m/s\right)=1}{|{\sum }_{y\in I}{\mathbf{e}}_{m/s}\left(ny\right)|}^{2}={\sum }_{1\le n\le m/s\left(n,m/s\right)=1}{|{\sum }_{A
 $\begin{array}{ccc}{\sum }_{n=1}^{m/s}{|{\sum }_{A
Taking this into account, from  14 we deduce ${R}_{2}\le \frac{1}{m}{\sum }_{s\ge m/L}s\left({m}^{4}/{s}^{4}\right)\ll m{L}^{2}.$  Therefore, in view of  15 , we obtain the asymptotic formula
 $\begin{array}{ccc}J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}+O\left(|\mathcal{V}|{L}^{3}\right)+O\left({m}^{2}{L}^{2}/\phi \left(m\right)\right)=& & \end{array}$
 $\begin{array}{ccc}\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}\left(1+O\left(\frac{m}{|\mathcal{V}|L}+\frac{{m}^{3}}{\phi \left(m\right)|\mathcal{V}{|}^{2}{L}^{2}}\right)\right).& & \end{array}$
Recalling that $|\mathcal{V}|\gg {m}^{1/2}/logm$  and $L=\left[\frac{\Delta {m}^{1/2}\sqrt{m/\phi \left(m\right)}logm}{2}\right],$  we arrive at the formula $J=\frac{|\mathcal{V}{|}^{2}{L}^{4}}{m}\left(1+O\left({\Delta }^{-1}\right)\right).$  Next, define $H=\left\{q\left(y+z\right)\left(modm\right),q\le {m}^{1/2},\left[S/2\right]+1\le y,z\le \left[S/2\right]+L\right\}.$  Obviously, $S+1\le y+z\le S+\Delta {m}^{1/2}\sqrt{m/\phi \left(m\right)}logm.$  For a given $h\in H,$  by $J\left(h\right)$  we denote the number of solutions of the congruence $q\left(y+z\right)\equiv h\left(modm\right),q\le {m}^{1/2},\left[S/2\right]+1\le y,z\le \left[S/2\right]+L.$  Then $J={\sum }_{h\in H}{J}^{2}\left(h\right)\ge \frac{1}{|H|}{\left({\sum }_{h\in H}J\left(h\right)\right)}^{2}=\frac{1}{|H|}|\mathcal{V}{|}^{2}{L}^{4}.$  Therefore, $|H|\ge \frac{|\mathcal{V}{|}^{2}{L}^{4}}{J}\ge \frac{m}{1+O\left({\Delta }^{-1}\right)}=\left(1+O\left({\Delta }^{-1}\right)\right)m.$  The result now follows in view of $|H|\le m.$

5 Proof of Theorem  8

Without loss of generality we may suppose that $0  Denote $X=\left[\Delta {p}^{1/2}/2\right],$  ${N}_{1}=\left[N/2\right],$  ${S}_{1}=\left[S/2\right],$  and let ${H}^{*}$  be the set of all residue classes of the form $\left(x+t\right)\left(y+z{\right)}^{-1}\left(modp\right),$  where ${N}_{1}+1\le x,t\le {N}_{1}+X,{S}_{1}+1\le y,z\le {S}_{1}+X.$  Obviously, $N+1\le x+t\le N+\Delta {p}^{1/2},S+1\le y+z\le S+\Delta {p}^{1/2}.$  Next, let ${H}_{1}^{*}=\left\{h\left(modp\right):h\notin {H}^{*},h\not\equiv 0\left(modp\right)\right\}.$  Then the congruence $x+t-\left(y+z\right)h\equiv 0\left(modp\right)$  has no solutions in variables $h,x,t,y,z$  subject to the condition $h\in {H}_{1}^{*},{N}_{1}+1\le x,t\le {N}_{1}+X,{S}_{1}+1\le y,z\le {S}_{1}+X.$  Therefore, ${\sum }_{a=0}^{p-1}{\sum }_{h\in {H}_{1}^{*}}{\sum }_{x,t\in {I}_{1}}{\sum }_{y,z\in {I}_{2}}{e}^{2\pi i\frac{a\left(x+t-h\left(y+z\right)\right)}{p}}=0,$  where ${I}_{1}$  and ${I}_{2}$  denote the intervals $\left[{N}_{1}+1,{N}_{1}+X\right]$  and $\left[{S}_{1}+1,{S}_{1}+X\right]$  correspondingly.
Separating the term corresponding to $a=0$  we deduce that $|{H}_{1}^{*}|{X}^{4}\le {\sum }_{a=1}^{p-1}|{\sum }_{x,t\in {I}_{1}}{e}^{2\pi i\frac{a\left(x+t\right)}{p}}||{\sum }_{y,z\in {I}_{2}}{\sum }_{h\in {H}_{1}^{*}}{e}^{2\pi i\frac{ah\left(y+z\right)}{p}}|.$  On the other hand for $\left(a,p\right)=1$  we have
 $\begin{array}{ccc}|{\sum }_{y,z\in {I}_{2}}{\sum }_{h\in {H}_{1}^{*}}{e}^{2\pi i\frac{ah\left(y+z\right)}{p}}|\le {\sum }_{h\in {H}_{1}^{*}}|{\sum }_{y,z\in {I}_{2}}{e}^{2\pi i\frac{ah\left(y+z\right)}{p}}|\le & & \end{array}$
 $\begin{array}{ccc}{\sum }_{h=1}^{p-1}|{\sum }_{y,z\in {I}_{2}}{e}^{2\pi i\frac{ah\left(y+z\right)}{p}}|\le {\sum }_{h=0}^{p-1}|{\sum }_{y,z\in {I}_{2}}{e}^{2\pi i\frac{h\left(y+z\right)}{p}}|=pX,& & \end{array}$
and similarly, ${\sum }_{a=1}^{p-1}|{\sum }_{x,t\in {I}_{1}}{e}^{2\pi i\frac{a\left(x+t\right)}{p}}|\le pX.$  Hence $|{H}_{1}^{*}|{X}^{4}\le {p}^{2}{X}^{2},$  whence $|{H}_{1}^{*}|\le \frac{{p}^{2}}{{X}^{2}}\ll p{\Delta }^{-2}.$  Since $|H|=p-1-|{H}_{1}^{*}|,$  then the result follows.
References

1. W. D. Banks, A. Conflitti, J. B. Friedlander and I. E. Shparlinski, Exponential sums over Mersenne numbers, Compos. Math. 140, no. 1, 15–30 (2004).
2. W. D. Banks, J. B. Friedlander, M. Z. Garaev and I. E. Shparlinski, Exponential sums over smooth numbers, (Preprint).
3. J. Bourgain, New bounds on exponential sums related to Diffie-Hellman distributions, C. R. Math. Acad. Sci. Paris, 338, no. 11, 825–830 (2004).
4. J. B. Friedlander and I. E. Shparlinski Double exponential sums over thin sets, Proc. Amer. Math. Soc., 129, 1617–1621 (2001).
5. M. Z. Garaev, Double exponential sums related to Diffie-Hellman distributions, Int. Math. Res. Notices (to appear).
6. M. Z. Garaev, Character sums in short intervals and the multiplication table modulo a prime, Monatsh. Math. (to appear).
7. M. Z. Garaev, On the logarithmic factor in error term estimates in certain additive congruence problems, Preprint.
8. M. Z. Garaev and A. A. Karatsuba, On character sums and the exceptional set of a congruence problem, J. Number Theory, (to appear).