Rational solutions of quadratic forms

number theoryquadratic-forms

Is there an algorithm or a method that one can use to determine whether an equation of the form $(\text{E})$:
$$ax^2+by^2+cz^2+dt^2=0$$
has a solution $(x,y,z,t)$ in whole numbers. In other words, given the tuple $(a,b,c,d)\in\mathbb{Z}^4$, how to determine whether there is a non-trivial tuple $(x,y,z,t)\in\mathbb{Z}^4$ that satisfies $(\text{E})$?

In case when one of $a,b,c$ or $d$ is zero, one can use Legendre's theorem on ternary quadratic forms. This paper shows the full process of how it's done. Is there anything similar for the case of four variables?

Best Answer

Clearly, it is enough to decide whether their is rational solutions or not (multiply by the square of a common denominator to have integer solutions).

I assume that $a,b,c,d$ are all nonzero (otherwise, you are reduced to known cases).

Multiplying by $a$ and replacing $x$ by $ax$, one may assume WLOG that $a=1$, so we are reduced to the equation $x^2+by^2+cz^2+dz^2=0$. (*)

This step is not necessary, but it allows to write down simpler conditions.

Hasse Minkowski says that (*) has a nonzero rational solution if and only if it has a nonzero solution over $\mathbb{R}$ and $\mathbb{Q}_p$ for all $p$.

  1. Having a solution over the reals is equivalent to say that $b,c,d$ are not all $>0$.

  2. For the $p$-adic case, it depends on the determinant and local Hasse invariants of the rational quadratic form $x^2+by^2+cz^2+dt^2$.

Here, the determinant is the square class of $bcd$, and if $p$ is prime , the local Hasse invariant is $(b,cd)_p(c,d)_p$.

I will below how to define $( , )_p$.

If $r,s$ are two non zero rationals, write $r=p^\alpha u, s=p^\beta v, p\nmid u, p\nmid v$.

Then $(r,s)_p=(-1)^{\alpha\beta\cdot\frac{p-1}{2}}\left(\dfrac{u}{p}\right)^\beta \left(\dfrac{v}{p}\right)^\alpha$, if $p\neq 2$, where $\left(\dfrac{\phantom{a}}{p}\right)$ is the Legendre symbol, and $\displaystyle (r,s)_2=(-1)^{\frac{u-1}{2}\cdot \frac{v-1}{2}+\alpha\frac{v^2-1}{8}+\beta\frac{u^2-1}{8}}$

Note for later use that $(-1,-1)_p=1$ if $p\neq 2$ and $(-1,-1)_2=-1$.

Note also that if $p\neq 2$, and the $p$-adic valuations of $r,s$ are both zero, $(r,s)_p=1.$

Recall also the following fact.

Fact. Let $r=p^\alpha u, p\nmid u$. Then $r$ is a square in $\mathbb{Q}_p$ if and only if :

  • $\alpha$ is even and $u$ is a square modulo $p$ if $p\neq 2$ (which can be decided using Legendre symbol)

  • $\alpha$ is even and $u\equiv 1 \ [8]$ if $p=2$.

If we translate Thm 6 of Chapter IV $\S$ 2 of Serre's "A course in arithmetic", we get that (*) has a nonzero solution over $\mathbb{Q}_p$ if and only if one of the following cases hold:

Case 1. $bcd$ is not a square modulo in $\mathbb{Q}_p^\times$

Case 2. $bcd$ is a square in $\mathbb{Q}_p^\times$ and $(b,cd)_p=(c,d)_p$ if $p\neq 2$

Case 3. $bcd$ is a square in $\mathbb{Q}_2^\times$ and $(b,cd)_2=-(c,d)_2$

All these conditions amounts to computations of finitely many Legendre symbols, because if $p\nmid bcd$ and $p\neq 2$, then either $bcd$ is not a square in $\mathbb{Q}_p^\times $, or $bcd$ is a square in $\mathbb{Q}_p^\times$ but in this case both symbols $(b,cd)_p$ and $(c,d)_p$ are equal to $1$ !!

Hence for odd prime which are not divisors of $bcd$, you are automatically in one of the first two cases.

So you only have to test if you are in one of the three previous cases only for $p\mid 2bcd $. Note that if the $p$-adic valuation of $bcd$ is odd, $bcd$ is automatically not a square, so you can reduce to prime numbers $p$ such that $p\mid 2bcd$ and $v_p(bcd)$ is even !

Hence, you have an algorithm to decide the existence of a nontrivial solution over $\mathbb{Q}$ (note that the Legendre symbol coincide with the Jacobi symbol, so you can compute it without factoring you integers). However, it won't give you an explicit solution.

Example. Consider $3x^2+3\cdot 5y^2+7z^2-2\cdot 7\cdot 23 t^2=0$.

This is equivalent to consider $x^2+3^2 \cdot 5y^2+3\cdot 7z^2-2\cdot 3 \cdot 7\cdot 23 t^2=0$.

Here $b=3^2 \cdot 5, c=3\cdot 7, d=-2\cdot 3\cdot 7 \cdot 23, cd=-2\cdot 3^2\cdot 7^2\cdot 23$ , and $bcd=-2\cdot 3^4\cdot 5\cdot 7^2\cdot 23$.

Since $b,c,d$ are not all positive, we have solutions over the reals.

For the $p$-adic case, we just have to check two cases: $p=3,7$ since they are the only prime divisors of $bcd$ with an even valuation.

For $p=3$, we need to check that $-2\cdot 5\cdot 23$ is a square modulo $3$. But $-2\cdot 5\cdot 23=1 \ [3]$, which is a square.

Now since $( r, s)_p$ only depends on the square classes of $r$ and $s$, we have $(b,cd)_3= (5,-2\cdot 23)_3=(-1)^{\frac{5-1}{2}\frac{-46-1}{2}}=1$ and $(c,d)_3=(3\cdot 7,-2\cdot 3\cdot 7\cdot 23)_3 =(-1)^{\frac{3-1}{2}}\left(\dfrac{7}{3}\right) \left(\dfrac{-2\cdot 7\cdot 23}{3}\right)=-1\cdot 1\cdot -1=1.$

Hence we are in Case 2.

For $p=7$, we need to check that $-2\cdot 5\cdot 23$ is a square modulo $7$. But $-2\cdot 5\cdot 23=1 \ [7]$, which is a square.

Since $7\nmid 5,2$ and $3$, $(b,cd)_7=1$. Now $(c,d)_7=(3\cdot 7,-2\cdot 3\cdot 7\cdot 23)_7=(-1)^{\frac{7-1}{2}}\left(\dfrac{3}{7}\right) \left(\dfrac{-2\cdot 3\cdot 23}{7}\right)=-1\cdot -1\cdot 1=1.$

Hence we are in Case 2.

All in all, the original equation must have a non trivial solution.

This is indeed the case since $3\cdot 2^2+3\cdot 5\cdot 3^2+7\cdot 5^2-2\cdot 7\cdot 23\cdot 1^2=0$.

Related Question