Points on a projective variety modulo $p$ Suppose that for $n \geq 4$ we have $F(x_1, \cdots, x_n) \in \mathbb{Z}[x_1, \cdots, x_n]$ is a homogeneous polynomial. Consider a large prime $p$, and suppose that we consider points of the variety $F(x_1, \cdots, x_n) \equiv 0 \pmod{p}$. If we consider non-singular points, then it is easy to see that the number of non-singular points is at most $O(p^{n-2})$, since this is a $(n-2)$-dimensional variety in $\mathbb{P}^{n-1}$. Then can we say that the number of non-singular points subject to the condition that $1 \leq x_1, x_2, \cdots, x_{n-2} \leq \sqrt{p}$ is say $O(p^{d})$, where the bound $d$ is better than simply the measure of the box $[1, \sqrt{p}] \times \cdots [1, \sqrt{p}] \times [1, p] \times [1, p]$?
 A: If we identify $\mathbf{F}_p$ with $X_p=\{0,1,\ldots, (p-1)\}\subset [0,p]$, one can probably show that for many varieties $Y/\mathbf{Z}$ in $\mathbf{A}^n$ (e.g, many hypersurfaces), the intersection $Y\cap [0,B]^n$ has not much more than the expected number $B^{n-1}$ of points, for $B$ slightly larger than $\sqrt{p}$ (e.g., $B$ about $\sqrt{p}\log p$). 
The idea is to use additive characters modulo $p$ to detect the condition that an integer lies in the interval $[0,B]$, and incorporate the corresponding characters in a point-counting formula. For instance, if $Y$ is defined by $F(x_1,\ldots,x_n)=0$, you would write
$$N=\frac{1}{p}\sum_{(a,x_1,\ldots,x_n)\in\mathbf{F}_p^{n+1}}{\exp(2i\pi(aF(x_1,\ldots,x_n))/p)}$$
for the total number of points on the variety modulo $p$, and then
$$
N_B=\frac{1}{p}\sum_{(a,x_1,\ldots,x_n)\in\mathbf{F}_p^{n+1}}{\chi(x_1)\cdots\chi(x_n)\exp(2i\pi(aF(x_1,\ldots,x_n))/p)}
$$
for those where each $x_i$ is between $1$ and $B$, where $\chi(x)$ is the characteristic function of the interval; then write
$$
\chi(x)=\sum_{0\leq b\leq p-1}{\hat{\chi}(b)\exp(2i\pi bx/p)}
$$
by discrete Fourier analysis, and one is led to exponential sums of the type
$$
\frac{1}{p}\sum_{(a,x_1,\ldots,x_n,b_1,\ldots,b_n)\in\mathbf{F}_p^{2n+1}}{\exp(2i\pi(aF(x_1,\ldots,x_n)+b_1x_1+\cdots+b_nx_n)/p)}
$$
which are parameterized by $(b_1,\ldots, b_n)$.
Now if you get most of these sums to be of the right order of magnitude (i.e., squareroot cancellation -- note this will fail in the example of Noam Elkies since $F$ is then linear and will cancel with some of the additively-shifted ones), you should get what I mentioned.
For examples, references and discussion of such results, I recommend the paper "A general stratification theorem for exponential sums and applications", Crelle 540 (2001), 115-166, by E. Fouvry and N. Katz, especially the discussion in Section 10.
A: Just to add to @Denis' references: results of this sort with very mild hypotheses on the variety are proved in Fouvry's paper "Consequences of a result of N. Katz and G. Laumon..." $B$ has to be a fair bit bigger than $\sqrt{p},$ but there are very few hypotheses on the variety. For an example application, see Ahmadi and Shparlinksi's paper on counting matrices with restricted entries.
