4

Prove that $a^2 \equiv b^2 $ (mod $p$) implies that $a \equiv \pm b$ (mod $p$). Where $p$ is a prime number.

So I know that $a^2 \equiv b^2 $ (mod $p$) implies $p|(a^2 -b^2)$ which implies that $a^2 -b^2 = mp$ for some $m \in \mathbb{Z}$. So $a^2 =b^2 +mp$.

But I am not sure where to go from here.

  • 1
    What do you know about number theory ? Because depending on your knowledge, the way to prove this can vastly differ. Do you know about Euclid's lemma ? – Junkyards Sep 28 '17 at 20:31

3 Answers3

7

Since $p\mid(a^2-b^2)$, since $a^2-b^2=(a-b)(a+b)$, and since $p$ is prime, $p\mid(a-b)$ or $p\mid(a+b)$.

2

We can write a congruence $x\equiv y\bmod p$ as an equation $x=y$ in the finite field $\mathbb{F}_p$. Then we have $a^2=b^2$ in $\mathbb{F}_p$, which means $(a-b)(a+b)=0$. Since a field has no (non-trivial) zero divisors, it follows $a=b$ or $a=-b$.

Dietrich Burde
  • 130,978
  • 1
    mmmmm..... wouldn't proving that $\mathbb F_p$ is a field be tantimount to proving the statement. And basically make the circular? – fleablood Sep 28 '17 at 20:39
  • @fleablood Well, that $\mathbb{F}_p$ is a field is of course a duplicate. So we know this already. Oh, here I see a better duplicate: https://math.stackexchange.com/questions/522921/the-ring-%e2%84%a4-n%e2%84%a4-is-a-field-if-and-only-if-n-is-prime?noredirect=1&lq=1. – Dietrich Burde Sep 29 '17 at 07:50
0

Just to be different (but essentially exactly the same):

Obviously if $a\equiv \pm b \mod p$ then $a^2 \equiv b^2 \mod p$. ($a = kp \pm b\implies a^2 = (k^2p \pm 2b)*p + b^2$.)

There are $p$ possible integers, $m$ so that $0\le m < p$ and for all integers $a$, $a \equiv m \mod p$ for one of these.

Let $0 \le n < m \le \frac {p-1}2$ and let $d = m-n>0$. Then $m^2 = (n+d)^2 = n^2 + 2nd + d^2$ so $n^2 \equiv m^2 \mod p \implies p|2nd+d^2=d(2n+d)=d(m+d)$.

But $d< p$ and $m+d<p$ so the prime factors of $d(m+d)$ are less than $p$ and $p|d(m+d)$ is impossible.

Now for any two $a,b$ there are for possibilities:

Either $a \equiv m \mod p$ for some $0\le m \le \frac{p-1}2$ or $a \equiv m \mod p$ for some $\frac{p-1}2 < m < p$. If the latter then $-m \equiv p-m \mod p$ and $0 < p-m < \frac {p-1}2$. So $\pm a\equiv m \mod p$ for some $m;0\le m \le \frac{p-1}2$.

Likewise $\pm b \equiv n \mod p$ for some $n;0\le n \le \frac{p-1}2$.

The if $a^2 \equiv b^2 \mod p$ then $m = n$ and thus $\pm a \equiv \pm b \mod p$ and $a \equiv \pm b \mod p$.

.....

Just as the other answers assuming if $p|(a+b)(a-b)$ then $p|a+b$ or $p|a-b$ (Euclid's lemma), this answer assumes if $p|N$ then $N$ has a unique prime factorization and $p$ is one of the factors, and further if $N$ has factors, that $p$ is a factor of one of the factors (Unique prime factorization theorem).

These are essentially the same assumption.

fleablood
  • 124,253