Bound for number of points on surface over $\mathbb{F}_p$

I know of the bound for the number of points on an elliptic curve over a finite field: $$|\# E(\mathbb{F}_q) - q - 1| < 2\sqrt{q}$$ where this includes the point at infinity. I have been told that there are higher analogues of this formula which involve $q^{(k-1)/2}$ (instead of $q^{1/2}$ here), but I know very little about the theory so I'm not exactly sure what the $k$ is and all that. Can any one help me out with the formula for this? Thanks!

The general form that this bound takes is known under the term Weil conjectures, which is a theorem of Deligne. Here is how it goes:

if $X$ is non-singular n-dimensional projective variety over $\mathbb{F}_q$ of dimension $n$, (an elliptic curve is the special case $n=1$), then you collect information about the number of points of $X$ over $\mathbb{F}_{q^m}$ for all $m$ in the generating function $$\zeta(X, s) = \exp\left(\sum_{m = 1}^\infty \frac{N_m}{m} (q^{-s})^m\right).$$ This is known as the zeta function of $X$.

The Weil conjectures then say that $\zeta(X, s)$ is a rational function of $T = q^{−s}$ and can be written as $$\prod_{i=0}^{2n} P_i(q^{-s})^{(-1)^{i+1}} = \frac{P_1(T)\dotsb P_{2n-1}(T)}{P_0(T)\dotsb P_{2n}(T)},$$ where each $P_i(T)$ is an integral polynomial that factors over $\mathbb{C}$ as $\prod_j (1 - \alpha_{i,j}T)$. If $X$ came from a projective variety defined over a number field with good reduction at $p=\text{char } \mathbb{F}_q$, then the degree of the $i$-th polynomial is the $i$-th Betty number of $X$. Moreover, $P_0(T) = 1 − T$ and $P_{2n}(T) = 1 − q^nT$. The Riemann hypothesis for these varieties, which is part of Weil's conjectures, says that $$|\alpha_{i,j}| = q^{i/2},$$ and this is the source of the Hasse bound you just cited. Here is what happens in your special case:

Let's assume for the moment that $X$ is a curve, so $n=1$. The degree of $P_1$ is twice the genus $g$ of the curve. If you take the logarithmic derivative of the zeta function and do some rearranging, you will find that $$N_m = 1 + q^m - (\alpha_{1,1}^m+\cdots+\alpha_{1,2g}^m),$$ which gives you the bound $|N_m - q^m - 1|\leq 2g\sqrt{q}^m$ that you quoted in the special case $g=1$.

If $X$ is a higher dimensional variety, then you can try to do the same manipulations, but I believe that the expression for $N_m$ will be less clean. Nevertheless, you should get something to the effect that $N_m = q^{nm} + O(q^{(2n-1)m/2})$. So your $k$ is my $2n$.

• Dear Alex, I think that the bound in the last line actually goes back to Lang--Weil (and in particular, predates Deligne). (You can get it by fibreing a higher dimensional variety by curves, or something similar, and using the Hasse--Weil bound for curves.) Best wishes, – Matt E Apr 21 '11 at 5:47
• @Matt Dear Matthew, thank you, that's very interesting! If you have time to write your comment up as an answer at some point or to provide a reference, I would be very interested. – Alex B. Apr 21 '11 at 6:43
• Dear Alex, See e.g. Theorem 2.1 of these notes by Mustata (where you can also find a reference to the original paper). Best wishes, – Matt E Apr 21 '11 at 7:22
• @Matt Dear Matt, wonderful, thank you! Best wishes, – Alex B. Apr 21 '11 at 8:35

I think what's going on is if you have an equation in $k$ variables over a field of $q$ elements then you expect it to have $q^{k-1}$ solutions and the error term, under suitable hypotheses, is some constant multiple of $q^{(k-1)/2}$.