In an ordered field we have $x^2 \ge 0$, hence the equation $-1 = x^2 + y^2$ has no solution. But what about finite fields in general? What is the solutions set $$ -1 = x^2 + y^2 $$ of this equation?
-
Yes, to be more specific I am interested in all solutions, and I do not know how to determine them? – StefanH Jan 16 '16 at 18:22
-
In $\mathbb F_{2^n}$, you get $y=x+1$ – Xoff Jan 16 '16 at 18:34
-
@Xoff: Thank you! But the more interesting case is for characteristic $\ne 2$. – StefanH Jan 16 '16 at 18:35
-
2$-1$ is a square in $\mathbb{Z}_p$ ($p$ an odd prime) if and only if $p\equiv 1\mod 4$. For such primes, we then have $-1=a^2$ for some $a \in \mathbb{Z}_p$, so $-1=a^2+0^2$. – kccu Jan 16 '16 at 18:39
-
You can guarantee a solution to this equation in $\mathbb F_{p^2}$ by letting $x=0$ or $y=0$. – Jan 16 '16 at 18:40
-
This is a special case of this question. – Jyrki Lahtonen Jan 16 '16 at 19:28
-
@JyrkiLahtonen Thank you for pointing out. But I am not concernced with mere existence, but also want to characterise all solutions. – StefanH Jan 16 '16 at 19:32
-
We still have something useful here. After you find one solution you get all of the time via the usual rational parametrization trick: draw lines of varying slopes through that given point, and solve the other point of intersection. You have surely seen this when the formula for Pythagorean triples was derived. Also, this is a genus zero curve, so such a parametrization is guaranteed to exist. – Jyrki Lahtonen Jan 16 '16 at 19:38
4 Answers
Others have explained why there exists at least one solution $P_0=(x_0,y_0)\in \Bbb{F}_q^2$. The standard trick for finding all the solutions goes as follows (see also Lubin's answer).
If $P=(x,y)\in \Bbb{F}_q^2$ is another point on the curve $x^2+y^2+1=0$, then the line $L$ connecting $P_0$ and $P$ is either vertical, when $x=x_0$ and thus $y=\pm y_0$, or it has a slope $t\in\Bbb{F}_q$. In the latter case the equation of the line $L$ is thus $$ y-y_0=t(x-x_0). $$ Plugging the solution $y=t(x-x_0)+y_0$ into the equation $y^2+x^2+1=0$ gives $$ x^2+t^2(x-x_0)^2+2t(x-x_0)y_0+y_0^2+1=0. $$ After expanding and combining equal degree terms we arrive at $$ (t^2+1)x^2+[2ty_0-2t^2x_0]x+[t^2x_0^2-2tx_0y_0+y_0^2+1]=0. $$ Because $P_0$ is on that quadratic curve $x=x_0$ is one solution. From Vieta relations we see that the other solution is thus $$ x=x(t):=-\frac{2ty_0-2t^2x_0}{t^2+1}-x_0. $$ Because the point $P$ was assumed to be on the line $L$, we get $$ y=y(t):=t(x(t)-x_0)+y_0. $$ So we get all the points $P$ of the curve $x^2+y^2=1$ as $P(t)=(x(t),y(t))$ with $t$ ranging over the field $\Bbb{F}_q$, as well as the point $P(\infty)=(x_0,-y_0)$ corresponding to the case of $L$ having an infinite slope. We also observe that if $t^2+1=0$, then the formulas involve division by zero, so we need to throw those values of $t$ away. As a summary:
- If $t^2+1\neq0$ for all $t\in \Bbb{F}_q$ there are exactly $q+1$ solutions $(x,y)\in\Bbb{F}_q^2$.
- If $t^2+1=0$ has two solutions in $\Bbb{F}_q$, then the number of points with coordinates in $\Bbb{F}_q$ on the curve $x^2+y^2+1=0$ is equal to $q-1$.
It is worth remarking that the curve $x^2+y^2+1=0$ has genus zero, so its projective version $X^2+Y^2+Z^2=0$ always has exactly $q+1$ points in $\Bbb{P}^2(\Bbb{F}_q)$. Two of those points will lie on the line at infinity when $-1$ has a square root in $\Bbb{F}_q$.
- 133,153
-
The same trick is used in parametrizing the points with rational coordinates on the unit circle $x^2+y^2=1$ of the plane $\Bbb{Q}^2$. Namely $x=(1-t^2)/(1+t^2), y=2t/(1+t^2)$ with $t$ ranging over $\Bbb{Q}$, as well as the point $(x,y)=(1,0)$ corresponding to $t=\infty$. – Jyrki Lahtonen Jan 16 '16 at 20:29
-
The argument you provide only seems to show that if $(x,y)$ is another point on the curve then $x=x(t)$ and $y=y(t)$ for some $t$, but how do we know that for every $t\in\mathbb{F}_{q}$, $(x(t),y(t))$ will be on the curve? I tried substituting $x(t)$ and $y(t)$ into the equation for the curve but one thing is that it is a very tedious calculation and another thing is that it doesn't seem like $x(t)^{2}+y(t)^{2}$ will give $-1$. Is there a way to easily prove the converse? – Ishika Sep 21 '17 at 12:40
-
@Ishika If a quadratic equation with coefficients in a given field has one solution in that field, then the other solution is the same field also (as opposed to being in some extension field). Here $(x_0,y_0)$ is one common point shared by the "circle" $x^2+y^2+1$ and the line with slope $t$. So that circle and the line intersect in another point (barring the tangency case). Necessarily the coordinates of that other point then also are in the same field as $x_0,y_0$ and $t$. – Jyrki Lahtonen Sep 21 '17 at 13:28
-
So, if $(x_0,y_0)$ is a solution so is $(x(t),y(t))$. But, we do need that one point on the curve to get going. – Jyrki Lahtonen Sep 21 '17 at 13:30
-
Many thanks for the prompt reply. I think you may have misunderstood my question. I agree that if $t$ is the slope, then $(x(t),y(t))$ is on the curve, but I am not able to see why given an arbitrary $t\in\mathbb{F}{q}$, the line through $(x{0},y_{0})$ with slope $t$ must intersect the curve? – Ishika Sep 21 '17 at 13:47
-
1@Ishika Sorry about not making that clear. Because the curve is quadratic, the line intersects it with either A) at 2 distinct points (with coordinates in the correct field), B) at single point of tangency, or C) at no points. But, no matter the value of $t$, the line will intersect the curve at the point $(x_0,y_0)$, so case C is ruled out. Case B is rare, and happens for a single $t$ only (possibly I should include that cases with $t^2+1=0$ under B, adding at most two other forbidden choices for $t$). This means that for all but at most three values of $t$ we are in case A. – Jyrki Lahtonen Sep 21 '17 at 15:06
Let $p$ be an odd prime because the characteristic $2$ case is trivial.
Let $c=-1$ (this value will not matter). As $x$ ranges from $0$ to $p-1$, the polynomial $x^2$ takes $\frac{1}{2}(p+1)$ values (because each value other than $0$ occurs exactly twice, for $x$ and for $-x$). For the same reason, the polynomial $c-y^2$ takes exactly $\frac{1}{2}(p+1)$ values. Since $2 \times \frac{1}{2}(p+1) = p+1 > p$ these two sets of values cannot be disjoint, so there exist $x,y$ such that $x^2 = c - y^2$, i.e. $x^2 + y^2 = c$. So there are always solutions to this equation in $\mathbb{F}_p$. The same reaasoning holds, mutatis mutandis, in $\mathbb{F}_{p^r}$ (of course, for $c=-1$ if $x^2+y^2=-1$ already has a solution in $\mathbb{F}_p$ it certainly has one in $\mathbb{F}_{p^r}$ and we don't need to think further).
- 5,541
Here’s another argument having some ideas similar to those of Gro-Tsen’s.
We may assume that our finite field $k$ is not of characteristic two, say it has $q$ elements, with $q$ a power of an odd prime. If $k$ has a square root of $-1$, we can take the solution $(0,i)$ of our equation, so we can assume there is no $i$ in $k$. It follows that if $z$ is a nonzero square in $k$, then $-z$ is a nonsquare.
Now there are $\frac{q+1}2$ squares, and $\frac{q-1}2$ nonsquares. Thus the squares do not constitute an additive subgroup (because the nontrivial coset would have the same number of elements). Thus there must be a case where the sum of two squares is a nonsquare, in other words, $a^2+b^2=-c^2$. Dividing both sides by $c^2$, we find a solution to the equation.
- 62,818
-
1To catalog things, with a field of size $q=p^k$, we can assert that there is a square root of $-1$ when either $p\equiv1$ modulo $4$ or when $k$ is even. So if there is no square root of $-1$, then the field must be of order $q=(\text{some $p$ that is $3$ modulo $4$})^{\text{something odd}}$. – 2'5 9'2 Jan 16 '16 at 22:46
-
1@alex.jordan, exactly the way I would have explained that. Then, as I was pouring coffee for myself, I realized that an equivalent way of saying the same thing was simply $q\equiv3\pmod4$ – Lubin Jan 17 '16 at 05:13
-
-
@Vladislav , when $p\equiv3\pmod4$, the two are equivalent for nonzero quantities – Lubin Mar 31 '22 at 23:55
For a field of order $2^k$, for any $x$ you have $x^2+(x+1)^2=1=-1$.
The multiplicative group of a finite field (of order $p^k$) is cyclic of order $p^k-1$. For $p\neq 2$, this means half of the elements of the multiplicative group are squares and half are not. In general the distribution of these squares over the field may not have a pattern that you can analyze consistently from one prime to the next. But if you think of them as randomly distributed, then for any given $x$, there is a $50\%$ chance that $-1-x^2$ is a square (with two distinct square roots). Thinking this way, you would expect an average of $p^k\cdot\left(2\frac{1}{2}\right)=p^{k}/2$ ordered pairs $(x,y)$ that solve $x^2+y^2=-1$.
Of course this is just speculation, since the distribution of squares is not random in a pure sense.
In any case, how to find solutions? I you are able to calculate square roots in the field, you could just enumerate $x$ through all possible values, and check to find square roots ($y$) of $-1-x^2$.
- 54,717
-
3Once you have one point on your conic, you can get all by drawing lines through the known point and seeing where else they intersect the conic. – Lubin Jan 16 '16 at 18:44
-
Thanks for this answer, this seems to be harder than I thought. An algorithm to determine all solutions is nice, but a characterisation as a solution set would be preferable. – StefanH Jan 16 '16 at 18:47