# Simultaneous $\pmod{p}$ congruences of two ternary quadratic forms

Let $$\displaystyle f(x_1,x_2,x_3) = a_1 x_1^2 + a_2 x_2^2 + a_3 x_3^2,$$ $$\displaystyle g(x_1, x_2, x_3) = b_1 x_1^2 + b_2 x_2^2 + b_3 x_3^2$$

be two integral ternary quadratic forms with $f$ positive definite. Let $p$ be an odd prime and suppose that $f$ and $g$ are not equivalent modulo $p$, i.e., there does not exist an integer $k$ such that

$$\displaystyle f(x_1, x_2, x_3) \equiv k g(x_1, x_2, x_3) \pmod{p}$$

for all $x_1, x_2, x_3 \in \{0, 1, \cdots, p-1\}$. We can further assume that $f,g$ are irreducible modulo $p$. Let $B$ be a positive number, and define

$$\displaystyle N_{f,g,p}(B) = \#\{(x,y,z) \in \mathbb{Z}^3 : f(x,y,z) \equiv g(x,y,z) \equiv 0 \pmod{p}, f(x,y,z) \leq B \}.$$

Put $N_f(B) = \#\{(x,y,z) \in \mathbb{Z}^3 : f(x,y,z) \leq B\}$. Is it true that for some $l \geq 2$ we have

$$\displaystyle \lim_{B \rightarrow \infty} \frac{N_{f,g,p}(B)}{N_f(B)} = \frac{1}{p^l}?$$

If so, what error term can be proved for the expression

$$\displaystyle N_{f,g,p}(B) = \frac{1}{p^l} N_f(B) + o(N_f(B))?$$

Consider the example $f=x_1^2+x_2^2+x_3^2$, $g=x_1^2$. For any prime $p\equiv 3\mod 4$, we have $f\equiv g\equiv 0\mod p\Leftrightarrow x_1\equiv x_2\equiv x_3\equiv 0\mod p$. So for this example $$\lim_{B \to\infty} \frac{N_{f,g,p}(B)}{N_f(B)} = \frac{1}{p^3}.$$
Edit: Write $\overline{f}$ and $\overline{g}$ for the reductions of $f$ and $g$ modulo $p$. The value of the limit is $$\frac{\#\{x,y,z\in\mathbb{F}_p:\overline{f}(x_1,x_2,x_3)=\overline{g}(x_1,x_2,x_3)=0\}}{p^3}.$$ Define curves $X=\mathbb{V}(\overline{f})$ and $Y=\mathbb{V}(\overline{g})\subset\mathbb{P}^2_{\mathbb{F}_p}$. These are irreducible plane curves of degree $2$, and we can also compute the value of the limit as $$\frac{1+(p-1)\cdot\#(X\cap Y)(\mathbb{F}_p)}{p^2}.$$ Bezout's theorem implies there are four points in the intersection (over $\overline{\mathbb{F}}_p$, counting multiplicity), and it is possible to have $0$, $1$, $2$, $3$, or $4$ distinct points over $\mathbb{F}_p$. The values of the limit can be $$\frac{1}{p^3},\hspace{8mm} \frac{1}{p^2},\hspace{8mm} \frac{2}{p^2}-\frac{1}{p^3},\hspace{8mm} \frac{3}{p^2}-\frac{2}{p^3}.$$
We should be able to get an error term $$N_{f,g,p}(B)=L\cdot N_f(B)+O\left(\frac{N_f(B)}{\sqrt{B}}\right),$$ where $L$ is the value of the limit. This is closely related to counting lattice points inside an ellipsoid. I don't know much about this, but a better bound might be possible.
• Two comments. First, you probably mean Bezout's theorem, not Bertini's theorem. Second, if there are four intersection points over $\overline{\mathbb F}_p$, then it is not possible for exactly 3 of them to be defined over $\mathbb F_p$. (The four points form a Galois invariant set, so if three elements are fixed by Galois, then so is the fourth.) – Joe Silverman May 24 '16 at 2:16
• @JoeSilverman Thanks, I definitely meant Bezout's theorem. There could be two intersection points with multiplicity $1$ and another with multiplicity $2$. – Julian Rosen May 24 '16 at 2:19
• @JulianRosen That's true, but it's worth pointing out that unless the multiplicty 2 intersection happens over $\mathbb C$, then it will happen mod $p$ for only finitely many primes, so won't happen for most $p$. So the various possibilities for the limit depend on the geometry of the complex solutions (and more precisely, on the field extension of $\mathbb Q$ generated by the $\overline{\mathbb Q}$ intersection points, via the splitting of $p$ in this field). – Joe Silverman May 24 '16 at 11:46