1 Introduction

Let Q(x)=Q( x 1 , x 2 ,, x n )= 1 i j n a i j x i x j be a quadratic form with integer coefficients in n-variables, and V= V p 2 (Q) the algebraic subset of Z p 2 n defined by the equation Q(x)=0. When n is even, we let Δ p (Q)=( ( 1 ) n / 2 det A Q /p) if pdet A Q and Δ p (Q)=0 if p|det A Q , where (/p) denotes the Legendre-Jacobi symbol and A Q is the n×n defining matrix for Q(x). Our interest in this paper is in the problem of finding points in V with the variables restricted to a box of the type

B= { x Z p 2 n | a i x i < a i + m i , 1 i n } ,
(1)

where a i , m i Z, and 0< m i < p 2 for 1in. Consider the congruence

Q(x)0 ( mod p 2 ) .
(2)

The final result of this paper is stated in the following theorem.

Theorem 1 Suppose n is even, Q is nonsingular (modp), and V p 2 , Z = V p 2 , Z (Q) is the set of integer solutions of the congruence (2). Then for any boxof type (1) centered about the origin, if Δ p =±1,

|B V p 2 | γ n ( | B | p 2 + p n ) ,
(3)

where the brackets || are used to denote the cardinality of the set inside the brackets, and

γ n ={ 2 n ( 1 + 2 ( n / 2 ) + 1 p ) , Δ = 1 , 2 n ( 1 + 2 ( n / 2 ) + 1 ) , Δ = + 1 .

We shall devote the rest of Section 4 to the proof of Theorem 1. If V is the set of zeros of a ‘nonsingular’ quadratic form Q(x)(modp), then one can show that

|VB|= | B | p +O ( p n / 2 ( log p ) 2 n ) ,
(4)

for any box ℬ (see [1]). It is apparent from (4) that |VB| is nonempty provided

|B| p ( n / 2 ) + 1 ( log p ) 2 n .

For any x, y in Z p 2 n , we let xy denote the ordinary dot product, xy= i = 1 n x i y i . For any x Z p 2 , let e p 2 (x)= e 2 π i x / p 2 . We use the abbreviation x = x Z p 2 n for complete sums. The key ingredient in obtaining the identity in (4) is a uniform upper bound on the function

ϕ(V,y)={ x V e p 2 ( x y ) for  y 0 , | V | p 2 ( n 1 ) for  y = 0 .
(5)

In order to show that BV is nonempty we can proceed as follows. Let α(x) be a complex valued function on Z p 2 n such that α(x)0 for all x not in ℬ. If we can show that x V α(x)>0, then it will follow that BV is nonempty. Now α(x) has a finite Fourier expansion

α(x)= y a(y) e p 2 (yx),

where

a(y)= p 2 n x α(x) e p 2 (yx),

for all y Z p 2 n . Thus

x V α ( x ) = x V y a ( y ) e p 2 ( y x ) = y a ( y ) x V e p 2 ( y x ) = a ( 0 ) | V | + y 0 a ( y ) x V e p 2 ( y x ) .

Since a(0)= p 2 n x α(x), we obtain

x V α(x)= p 2 n |V| x α(x)+ y 0 a(y)ϕ(V,y),
(6)

where ϕ(V,y) is defined by (5). A variation of (6) that is sometimes more useful is

x V α(x)= p 2 x α(x)+ y a(y)ϕ(V,y),
(7)

which is obtained from (6) by noticing that |V|=ϕ(V,0)+ p 2 ( n 1 ) , whence

x V α ( x ) = a ( 0 ) [ ϕ ( V , 0 ) + p 2 ( n 1 ) ] + y 0 a ( y ) ϕ ( V , y ) = p 2 n 2 a ( 0 ) + y a ( y ) ϕ ( V , y ) .

Equations (6) and (7) express the ‘incomplete’ sum x V α(x) as a fraction of the ‘complete’ sum x α(x) plus an error term. In general |V| p 2 ( n 1 ) so that the fractions in the two equations are about the same. In fact, if V is defined by a ‘nonsingular’ quadratic form Q(x) then |V|= p 2 ( n 1 ) +O( p n ). (That is, |ϕ(V,0)| p n .)

To show that x V α(x) is positive, it suffices to show that the error term is smaller in absolute value than the (positive) main term on the right-hand side of (6) or (7). One tries to make an optimal choice of α(x) in order to minimize the error term. Special cases of (6) and (7) have appeared a number of times in the literature for different types of algebraic sets V; see Chalk [2], Tietäväinen [3], and Myerson [4]. The first case treated was to let α(x) be the characteristic function χ S (x) of a subset S of Z p 2 n , whence (7) gives rise to formulas of the type

|VS|= p 2 |S|+Error.

Equation (4) is obtained in this manner. Particular attention has been given to the case where S=B, a box of points in Z p 2 n . Another popular choice for α is to let it be a convolution of two characteristic functions, α= χ S χ T for S,T Z p 2 n . We recall that if α(x), β(x) are complex valued functions defined on Z p 2 n , then the convolution of α(x), β(x), written αβ(x), is defined by

αβ(x)= u α(u)β(xu)= u + v = x α(u)β(v),

for x Z p 2 n . If we take α(x)= χ S χ T (x) then it is clear from the definition that α(x) is the number of ways of expressing x as a sum s+t with sS and tT. Moreover, (S+T)V is nonempty if and only if x V α(x)>0.

We make use of a number of basic properties of finite Fourier series, which are listed below. They are based on the orthogonality relationship,

x Z p 2 n e p 2 (xy)={ p 2 n if  y = 0 , 0 if  y 0 ,

and they can be routinely checked. By viewing Z p 2 n as a ℤ module, the Gauss sum

S p (Q,y)= x Z p 2 n e p 2 ( Q ( x ) + y x ) ,

is well defined whether we take y Z n or y Z p 2 n . Let α(x), β(x) be complex valued functions on Z p 2 n with Fourier expansions

α(x)= y a(y) e p 2 (xy),β(x)= y b(y) e p 2 (xy).

Then

αβ(x)= y p 2 n a(y)b(y) e p 2 (xy),
(8)
αβ(x)=α(x)β(x)= y (ab)(y) e p 2 (xy),
(9)
x (αβ)(x)= ( x α ( x ) ) ( x β ( x ) ) ,
(10)
x |(αβ)(x)| ( x | α ( x ) | ) ( x | β ( x ) | ) ,
(11)
y |a(y) | 2 = p 2 n x |α(x) | 2 .
(12)

The last identity is Parseval’s equality.

2 Fundamental identity

Let Q(x)=Q( x 1 ,, x n ) be a quadratic form with integer coefficients and p be an odd prime. Consider the congruence (2):

Q(x)0 ( mod p 2 ) .

Using identities for the Gauss sum S= x = 1 p 2 e p 2 (a x 2 +bx), one obtains the following.

Lemma 1 ([[5], Lemma 2.3])

Suppose n is even, Q is nonsingular modulo p, and Δ= Δ p (Q). For y Z n , put y = 1 p y in case p|y. Then for any y,

ϕ(V,y)={ p n p n 1 if  p y i  for some  i  and  p 2 | Q ( y ) , p n 1 if  p y i  for some  i  and  p Q ( y ) , 0 if  p y i  for some  i  and  p Q ( y ) , Δ p ( 3 n / 2 ) 2 + p n 1 ( p 1 ) if  p | y i  for all  i  and  p Q ( y ) , Δ ( p 1 ) p ( 3 n / 2 ) 2 + p n 1 ( p 1 ) if  p | y i  for all  i  and  p | Q ( y ) ,

where Q is the quadratic form associated with the inverse of the matrix for Q modp.

Back to (7): we saw the identity

x V α(x)= p 2 x α(x)+ y 0 a(y)ϕ(V,y).

Inserting the value ϕ(V,y) in Lemma 1 yields (see [6]) the following.

Lemma 2 (The fundamental identity)

For any complex valued α(x) on Z p 2 n ,

x V α ( x ) = p 2 x α ( x ) + p n p 2 | Q ( y ) a ( y ) p n 1 p | Q ( y ) a ( y ) Δ p ( 3 n / 2 ) 2 y ( mod p ) p a ( p y ) + Δ p ( 3 n / 2 ) 1 p | Q ( y ) y ( mod p ) a ( p y ) .
(13)

3 Auxiliary lemma on estimating the sum y i = 1 p a(py)

For later reference, we construct the following lemma on estimating the sum y i p a(py). Let ℬ be a box of points in Z n as in (1) centered about the origin with all m i p 2 , and view this box as a subset of Z p 2 n . Let χ B be its characteristic function with Fourier expansion χ B (x)= y a B (y) e p 2 (xy). Let α(x)= χ B χ B = y a(y) e p 2 (xy). Then for any y Z p 2 n ,

a(y)= p 2 n i = 1 n sin 2 π m i y i / p 2 sin 2 π y i / p 2 ,
(14)

where the term in the product is taken to be m i if y i =0. In particular, if we take | y i | p 2 /2 for all i, then

a(y) p 2 n i = 1 n min { m i 2 , ( p 2 2 y i ) 2 } .

Lemma 3 Letbe any box of type (1) and α(x)= χ B χ B (x). Suppose

m 1 m 2 m l <p m l + 1 m n .
(15)

Then we have

y Z p n a(py) 2 n l p l 2 n |B| i = l + 1 n m i .

Proof We first observe

y i = 1 p a ( p y ) = y i = 1 p x i = 1 p 2 1 p 2 n α ( x ) e p 2 ( x p y ) = x i = 1 p 2 1 p 2 n α ( x ) y i = 1 p e p ( x y ) = x i = 1 x 0 ( mod p ) p 2 p n p 2 n α ( x ) = 1 p n x 0 ( mod p ) α ( x ) = 1 p n u B v B 1 u + v 0 ( mod p ) 1 p n i = 1 n m i ( [ m i p ] + 1 ) .
(16)

To obtain the last inequality in (16) we must count the number of solutions of the congruence

u+v0(modp),

with u,vB. For each choice of v, there are at most i = 1 n ([ m i /p]+1) choices for u. So the total number of solutions is less than or equal to

i = 1 n m i ( [ m i p ] + 1 ) .

Using the hypothesis (15) then, continuing from (16), we have

y i = 1 p a ( p y ) 1 p n i = 1 l m i i = l + 1 n m i ( m i p + 1 ) | B | p n i = l + 1 n ( 2 m i p ) 2 n l | B | p 2 n l i = l + 1 n m i .

The lemma is established. □

4 Proof of Theorem 1

As we mentioned before our interest in this paper is in determining the number of solutions of the congruence (2):

Q(x)0 ( mod p 2 ) ,

with xB, the box of points in Z n given by (1):

B= { x Z n | a i x i < a i + m i , 1 i n } ,

where a i , m i Z, 1 m i p 2 , 1in. Then |B|= i = 1 n m i , the cardinality of ℬ. View the box ℬ as a subset of Z p 2 n and let χ B be the characteristic function with Fourier expansion

χ B (x)= y a B (y) e p 2 (xy).

Lemma 4 Let p be an odd prime, V p 2 = V p 2 (Q) be the set of zeros of (2) in Z p 2 n , andbe a box as given in (1) centered at the origin with all m i p 2 . If Δ p =1, then

|B V p 2 | 2 n γ n ( | B | p 2 + p n ) ,

where

γ n =1+ 2 ( n / 2 ) + 1 p .

Proof We begin by writing (13); we have the fundamental identity (mod p 2 ):

x V p 2 α ( x ) = p 2 x α ( x ) + p n y i = 1 p 2 | Q ( y ) p 2 a ( y ) p n 1 y i = 1 p | Q ( y ) p 2 a ( y ) Δ p ( 3 n / 2 ) 2 y i = 1 p a ( p y ) + Δ p ( 3 n / 2 ) 1 y i = 1 p | Q ( y ) p a ( p y ) .

Set α= χ B χ B = y a(y) e p 2 (xy). Then the Fourier coefficients of α(x) are given by a(y)= p 2 n a B 2 (y) and, since ℬ is centered at the origin, these are positive real numbers. By Parseval’s identity we have

y |a(y)|= p 2 n y | a B (y) | 2 = y | χ B (y) | 2 =|B|.
(17)

Thus, it follows from (17) that

p n y i = 1 p 2 | Q ( y ) p 2 a(y) p n y |a(y)| p n |B|.
(18)

Notice that the main term in (13) is

p 2 x α(x)= p 2 x χ B χ B (x)= | B | 2 p 2 .
(19)

By Lemma 3, we have

p ( 3 n / 2 ) 2 y i = 1 p a ( p y ) 2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i
(20)

and

p ( 3 n / 2 ) 1 y i = 1 p | Q ( y ) p a ( p y ) p ( 3 n / 2 ) 1 y a ( p y ) 2 n l p l ( n / 2 ) 1 |B| i = l + 1 n m i ,
(21)

where l, as defined before, is such that

m 1 m 2 m l <p m l + 1 m n .

Now going back to (13), if Δ=1, we have

x V p 2 α(x) p 2 x α(x)+ p n y i = 1 p 2 | Q ( y ) p 2 a(y)+ p ( 3 n / 2 ) 2 y i = 1 p a ( p y ) .
(22)

Then, by the equality (19) and the inequalities in (18) and (20), we obtain

x V p 2 α(x) | B | 2 p 2 + p n |B|+ 2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i .
(23)

We next determine which of the terms |B | 2 / p 2 , p n |B|, and 2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i in (23) is the dominant term. We consider two cases:

Case (i): Suppose l n 2 1. Then compare

2 n l p l ( n / 2 ) 2 | B | i = l + 1 n m i | B | 2 / p 2 = 1 | B | p l ( n / 2 ) 2 n l i = l + 1 n m i = p l ( n / 2 ) 2 n l i = 1 l m i 2 n l p l ( n / 2 ) = 2 n ( p 2 ) l p n / 2 2 n ( p 2 ) ( n / 2 ) 1 p n / 2 2 ( n / 2 ) + 1 1 p ,

which implies that

2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i 2 ( n / 2 ) + 1 p | B | 2 p 2 .

Case (ii): Suppose l n 2 . Then compare

2 n l p l ( n / 2 ) 2 | B | i = l + 1 n m i p n | B | = 2 n l p l ( 3 n / 2 ) 2 i = l + 1 n m i 2 n l p l ( 3 n / 2 ) 2 p 2 ( n l ) = 2 n l p n / 2 2 l 2 n / 2 p 2 ,

which leads to

2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i 2 n / 2 p 2 p n |B|.

So for any l, always we have

2 n l p l ( n / 2 ) 2 |B| i = l + 1 n m i ( 2 ( n / 2 ) + 1 p | B | 2 p 2 + 2 n / 2 p 2 p n | B | ) .

Returning to (23), we now can write

x V p 2 α ( x ) | B | 2 p 2 + p n | B | + 2 n l p l ( n / 2 ) 2 | B | i = l + 1 n m i | B | 2 p 2 + p n | B | + 2 ( n / 2 ) + 1 p | B | 2 p 2 + 2 n / 2 p 2 p n | B | = ( 1 + 2 ( n / 2 ) + 1 p ) | B | 2 p 2 + ( 1 + 2 n / 2 p 2 ) p n | B | γ n ( | B | 2 p 2 + p n | B | ) ,
(24)

where γ n =1+( 2 ( n / 2 ) + 1 /p). On the other hand,

x V p 2 α(x) 1 2 n |B|| V p 2 B|.
(25)

Hence it follows by combining (24) and (25) we find that

|B V p 2 | 2 n γ n ( | B | p 2 + p n ) .

 □

Lemma 5 Let p be an odd prime, V p 2 = V p 2 (Q) be the set of zeros of (2) in Z p 2 n , andbe a box as given in (1) centered at the origin with all m i p 2 . If Δ p =+1, then

|B V p 2 | 2 n γ n ( | B | p 2 + p n ) ,

where

γ n =1+ 2 ( n / 2 ) + 1 .

Proof If Δ p =+1, again by (13), we have

x V p 2 α ( x ) p 2 x α ( x ) + p n y | a ( y ) | + p ( 3 n / 2 ) 1 y ( mod p ) a ( p y ) | B | 2 p 2 + p n | B | + 2 n l p l ( n / 2 ) 1 | B | i = l + 1 n m i .
(26)

We do a similar investigation (as before) to determine which of the terms |B | 2 / p 2 , p n |B|, and 2 n l p l ( n / 2 ) 1 |B| i = l + 1 n m i of the inequality (26) is the dominant term. In case (i) we find

2 n l p l ( n / 2 ) 1 | B | i = l + 1 n m i | B | 2 / p 2 2 ( n / 2 ) + 1 ,

which means that

2 n l p l ( n / 2 ) 1 |B| i = l + 1 n m i 2 ( n / 2 ) + 1 | B | 2 p 2 .

And in case (ii) we find

2 n l p l ( n / 2 ) 1 | B | i = l + 1 n m i p n | B | 2 n / 2 /p,

which gives us that

2 n l p l ( n / 2 ) 1 |B| i = l + 1 n m i ( 2 n / 2 / p ) p n |B|.

Hence for any l, we always have

2 n l p l ( n / 2 ) 1 |B| i = l + 1 n m i ( 2 ( n / 2 ) + 1 | B | 2 p 2 + 2 n / 2 p p n | B | ) .

Now on looking at (26), one easily deduces

x V p 2 α ( x ) ( 1 + 2 ( n / 2 ) + 1 ) | B | 2 p 2 + ( 1 + 2 n / 2 p ) p n | B | γ n ( | B | 2 p 2 + p n | B | ) ,
(27)

where γ n =1+ 2 ( n / 2 ) + 1 . Thus by (27),

|B V p 2 | 2 n | B | x V p 2 α(x) γ n 2 n ( | B | p 2 + p n ) .

This leads to the proof of the lemma. □

Proof of Theorem 1 This theorem follows immediately from Lemma 4 and Lemma 5 by letting γ n = 2 n γ n if Δ=1 and γ n = 2 n γ n if Δ=+1. Thus we see from (24) and (27) that for Δ=±1, one always has

|B V p 2 | γ n ( | B | p 2 + p n ) .

 □