$X^2 + Y^2 \equiv 0 \pmod p$ implies that $-1$ is a square in $\mathbb{Z}/p\mathbb{Z}$

47 Views Asked by At

I know that similar questions have been asked several times in the past but I want a precision on a part of the proof.

Let $n = x^2 + y^2$ and $p$ be a prime factor of $n$. Let $d = \text{gcd}(x,y)$ where $x=dX$ and $y=dY$ with $(X, Y)$ being coprime integers.

I have shown that $X^2 + Y^2 \equiv 0 \pmod p$.

Now I want to show that $\bar{-1}$ is a square in $\mathbb{Z}/p\mathbb{Z}$.

Here is a sketch of my proof:

\begin{align*} X^2 + Y^2 &\equiv 0 \pmod p \\ \iff X^2 &\equiv - Y^2 \pmod p \\ \iff \Biggl(\frac{X}{Y}\Biggr)^2 &\equiv -1 \pmod p \end{align*}

where $Y^{-2}$ exists since we know that for $p$ a prime, $\mathbb{Z}/p\mathbb{Z}$ is a field.

My question is: how do we justify that $Y \not\equiv 0 \pmod p$ ? (or alternatively $X \not\equiv 0 \pmod p$). It has to do with $X$ and $Y$ being coprime integers I guess.

1

There are 1 best solutions below

0
On BEST ANSWER

If $Y\equiv0\pmod p$, then $X^2\equiv-Y^2\equiv0\pmod p$,

so $p|X^2$, so $p|X$,

so $p|X$ and $p|Y$,

so $X$ and $Y$ are not co-prime, as you surmised.