# solution count of quadratic form congruences

Let $(L,q)$ be an even Lorentzian lattice of signature $(1,l-1)$, i.e., $q(\lambda) \in \Bbb Z$ for all $\lambda \in L$ and the (non-degenerate) quadratic form $q$ is of type $(1,l-1)$ (the type/signature shouldn't matter here, I think...). Let $p$ be an odd prime that divides $\det L$, that is, the Gram matrix of $q$. I am interested in counting the number of solutions $x \in L/pL$ modulo $a \in \Bbb Z / p \Bbb Z$, $a \neq 0$, in $\Bbb Z / p \Bbb Z$, i.e., what is $$N(a,p) := \# \{ x \in L/pL : q(x) \equiv a \pmod p \}$$

We could rewrite this as $N(a,p) = \# \{ x \in \Bbb Z / p \Bbb Z : q(x) \equiv a \pmod p \}$ again using $q(x)$ for the quadratic form $\frac 1 2 x^t S x$, $S$ the Gram matrix, for vectors $x \in \Bbb Z / p \Bbb Z$

I am looking for an upper bound, independent of $a$, like $N(a,p) \leq 2 p^{l-1}$ or so. Notice $p | \det L$. Thanks!

Edit: An observation I just made: It is known that half, i.e., $(p-1)/2$ elements $a$ of $(\Bbb Z / p \Bbb Z)^{*}$ are quadratic residues modulo $p$, and if $a$ has a solution $x=x_{0}$ for the congruence $x^{2} \equiv a \pmod p$, then so is $x= -x_{0} = p - x_{0}$ a solution.

Now if we can decompose the lattice as $L=\Bbb Z \perp L'$ (resp. modulo $p$) with a sub lattice $L'$, then pick a $x' \in L'/p L'$ (there are $|L'/p L'| = p^{l-1}$ many choices) and look at the new congruence for $x_{1} \in \Bbb Z / p \Bbb Z$: $$\tag{*} \frac{S_{11}}{2}\ {x_1}^2= q((x_{1},0)) \equiv a - q((0,x')) \pmod p$$ By the preceding discussion, if the Gram matrix entry $S_{11}/2$ is coprime to $p$, and $a' := 2(a - q((0,x')))/S_{11}$ is a quadratic residue, there are two solutions for $x_{1}$, and if not, there are none.

Actually, it is easier to say, that the congruence (*) is a quadratic equation in $x_{1}$ over the field $\Bbb F_{p}$, so it has at most two solutions, and we don't need the preceding discussion. (Well, this is the reason for the discussion being true...)

Now always assuming the bad case that $a'$ is a quadratic residue, we would get the estimate I mentioned, $$N(a,p) \leq 2 p^{l-1}.$$

Can we justify such, or a similar, decomposition of the lattice? Not in general. Interestingly, there is a result, that over the $p$-adic integers, one can diagonalize every symmetric matrix.

-
My previous edit was wrong in general. –  sebastian Nov 28 '12 at 14:56