1

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?

donaastor
  • 1,677
  • I think your answer is basically here: https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem. However, it indicates Ramanujan proved this possible for all positive integers on the RHS, and I don't know if a solution for $n=0$ is part of that. EDIT: obviously if all positive integers are possible, so are all negative integers, simply by switching the signs. – Eric Snyder Mar 02 '21 at 23:16
  • https://math.stackexchange.com/questions/1127654/parametrization-of-solutions-of-diophantine-equation – individ Mar 03 '21 at 05:03

2 Answers2

2

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$.

GreginGre
  • 15,028
  • This is an excellent work, much thanks! I originally started to bother about equation (*) since this post: https://math.stackexchange.com/questions/4039962/do-there-exist-uniform-triangular-prisms-with-all-vertices-in-mathbb-z3. I tried to do the case of $\mathbb{Z}^4$ but it seemed soo much harder than $\mathbb{Z}^3$. If you want to try it, I will look forward for your solution :) Eitherway, you gave me some useful and relevant reference books that I might look at. – donaastor Mar 03 '21 at 19:37
  • There is one thing that is still not clear to me. Coefficients a,b,c and d don't have to be square-free nor coprime. But, Legendre's method assumes that. Does it mean that using methods from the book you mentioned (Serre's "A course in arithmetic") I can state conditions for the case of 3 variables without making assumptions that something is square-free and coprime? – donaastor Mar 03 '21 at 20:12
  • You don't need to assume anything. Nevertheless, you can divide by a common gcd without changing the solutions, and you can absorb squares into the variables if you wish. (it won't change the fact that you have a non trivial solution or not) – GreginGre Mar 04 '21 at 09:22
  • Concerning your other problem, do is translate into an equation of the form $\sum_{i,j}a_{ij}x_ix_j=0$? – GreginGre Mar 04 '21 at 09:37
  • About assuming this and that, I am sorry, but it seems I didn't explain well what I meant. I wanted to check whether I should be able to craft a method to check the existance of solution to $ax^2+by^2+cz^2=0$ that doesn't assume squarefreeness like Legendre's method does. In your book it sais that the condition is equivalent to $(-1,-d)=\varepsilon$, but I can't understand what it means without reading a lot from the book. So I basically ask you is it worth it to read that book to get a condition that I want? I guess it is :) – donaastor Mar 04 '21 at 10:48
  • About that other problem, I am afraid that I get a system of equations of that form. Namely, three diagonalized and three that resemble dot-product. – donaastor Mar 04 '21 at 10:50
  • Can you added the system of equations in your original post ? – GreginGre Mar 04 '21 at 18:59
  • Sure, I will make a separate post about it :) – donaastor Mar 04 '21 at 20:07
  • Could you give me the link here when it's done ? – GreginGre Mar 05 '21 at 09:28
  • You certainly can do the same for 3 variables. You will find anything you need in Serre's book. As before, we can assume $a=1$. THe local HAsse invariant of $x^2+by^2+cz^2$ will be $(b,c)_p$. – GreginGre Mar 05 '21 at 09:32
  • Of course I wll send the link, I am glad that you are interested. I'll also definitely check that book more thoroughly. – donaastor Mar 05 '21 at 15:45
  • It turned out that new post is unnecessary. That my question translates into checking whether two matrices are congruent over $\mathbb{Q}$ or that whether two quadratic forms are equivalent over rationals, in terms of Hasse-Minkowski theorem. So it is just a direct use of that theorem. So now, I just need to check whether there is a natural number $r$ so that $\text{diag}(1,1,1,1)$ and $\text{diag}(r,r,3r,3r)$ are equivalent over rationals and that is the whole problem, no need for a whole new post :) – donaastor Mar 06 '21 at 09:45
  • The answer is no, there is no such $r$ ...For $p=3$, the local Hasse invariant of the first is trivial , while the local invariant of the second one is $-1$, independently of $r$. – GreginGre Mar 06 '21 at 09:51
  • I've just done the same and wanted to write it now. Anyways, thank you very much! – donaastor Mar 06 '21 at 10:05
0

I actually realized some time after my comment above that, because we're trying to hit zero, at least one member of $(a,b,c,d) < 0$. If we assume WLOG that $a \geq b \geq c \geq d$, then at least $d$ is negative. If we set $x = t$ and $a+d = m$, then we can simplify to

$$mx^2 + by^2 + cx^2 = 0$$

But now one of those coefficients still has to be negative if we want to hit $0$. Either $|a| < |d|$ and $m$ is negative, or $b$ and/or $c$ are negative. Again, WLOG we can assume $c$ is negative. Then setting $y = z$ and $b+c-n$, we get:

$$mx^2 + ny^2 = 0$$

And either $m$ or $n$ has to be negative, so we really have

$$mx^2 = ny^2$$

I have to imagine there are solutions for this that don't have $m = n$ and $x = y$. But I'm not sure if there's a generalized form.

Edit: Oh, right. Either $m = n, x = y$, or both $m$ and $n$ must be squares for there to be integer solutions, because (for instance) $2x^2 = 5y^2$ can't have an integer solution, since both $x$ and $y$ have prime factorizations where all the exponents are $2$.

Eric Snyder
  • 3,007
  • 1
    I don't understand how this solve the problem. You found than you have solutions when $x=t$ and $y=z$, unless when $m/n$ is a square(and not, $m$ and $n$ are square, by the way), in which case you have the trivial solution. What about the other cases ? $x\neq t$ or $y\neq z$ ? – GreginGre Mar 03 '21 at 10:09
  • Yes, after thinking about it more I realize this "solution" isn't great and just gives a small subset of solutions. For instance, we know the vast majority of integers can be expressed as $x^2 + y^2$, so it's likely that almost all integers can be expressed as $ax^2 \pm by^2$. And it's likely that almost all (if not all) can be expressed in that form multiple different ways. If we find two different ways to express them, setting those equal to one another gives a solution. But the other solution posted is a lot more thorough. – Eric Snyder Mar 06 '21 at 22:48
  • Oh. That solutions was yours. :). Alas, I kind of stopped understanding it after paragraph 5... my brain hasn't gotten itself wrapped around p-adic numbers yet. I do wonder if there are solution methods that are more elementary. – Eric Snyder Mar 06 '21 at 22:56