3

The proof is a follows:

Let $p$ be a prime number and $x$ in Z. If $x^2\equiv1\pmod p$ then $x\equiv\pm1\pmod p$.

Proof: By assumption, $p | x^2 - 1 = (x + 1)(x - 1)$. Thus $p | x + 1$ or $p | x - 1$. This completes the proof.


However if $p | x + 1$ then $x$ is congruent to $-1 \mod p$. However why is $p$ congruent to $1 \mod p$ ??

I'm struggling seeing this, and been sitting for some hours now trying to figure it out - please help.

Thomas Andrews
  • 186,215
  • This proof uses "either-or" logic: either $p$ divides $x+1$ or $p$ divides $x-1$. It is not the case that $p|p-1$. – abiessu Sep 04 '13 at 17:44
  • 1
    There are in general two possibilities: (i) $p$ divides $x+1$ or (ii) $p$ divides $x-1$. In Case (i), $x\equiv -1\pmod{p}$. In Case (ii), $x\equiv 1\pmod{p}$. Note that if $p=2$, then Case (i) and (ii) can happen simultaneously. If $p\gt 2$, they cannot. – André Nicolas Sep 04 '13 at 17:48
  • Why does the author use the $+-$ sign in front of $1 \mod p$ ? – Andreas Lykke Iversen Sep 04 '13 at 17:48
  • 2
    To save space. It is an abbreviation for $x\equiv +1\pmod{p}$ or $x\equiv -1\pmod{p}$. Just like in the Quadratic Formula. – André Nicolas Sep 04 '13 at 17:50
  • Thanks for the answer. I've never seen $+-$ being used like this. In the quadratic formula and everywhere else it indicates that both solutions are valid. But maybe it means either or everywhere ? - and it just happens that both solutions are valid where I've seen the symbol used until now ? – Andreas Lykke Iversen Sep 04 '13 at 17:54
  • Here too both solutions are valid. It is just like saying that the solutions of $x^2=16$ are $x=\pm 4$. – André Nicolas Sep 04 '13 at 17:57

2 Answers2

3

To show that the solutions of $x^2\equiv 1\pmod{p}$ are $x\equiv \pm 1$ actually requires that we prove two things.

We must show that (i) $x\equiv 1\pmod{p}$ is a solution, and $x\equiv -1\pmod{p}$ is a solution.

We must also show that (ii) there are no other solutions modulo $p$.

Proving (i) is easy. All we need to do is to verify that $(1)^2\equiv 1\pmod{p}$ and $(-1)^2\equiv 1 \pmod{p}$.

Note that if $p=2$ the two solutions are the same. For $1\equiv -1\pmod{2}$.

We now turn to the proof of (ii). We know that if $x^2\equiv 1\pmod{p}$, then $p$ divides $x^2-1$, and therefore $p$ divides $(x-1)(x+1)$.

Since $p$ is prime, and divides $(x-1)(x+1)$, we must have (a) $p$ divides $x-1$ or (b) $p$ divides $x+1$.

In Cae (a), we have $x\equiv 1\pmod{p}$. In Case (b), we have $x\equiv -1\pmod{p}$. There are no other possibilities.

Remark: Note that if $p$ is composite, then the result can fail. For example, the congruence $x^2\equiv 1\pmod{8}$ has four solutions modulo $8$, namely $x\equiv \pm 1\pmod{8}$, and $x\equiv \pm 3\pmod{8}$.

André Nicolas
  • 514,336
2

Perhaps it is easier to view this as euqation $x^2-1=0$ over the finite field $\mathbb{F}_p$. Since $0=x^2-1=(x+1)(x-1)$, and the field has no zero divisors, we must have either $x=1$ or $x=-1$ in $\mathbb{F}_p$. This means $x\equiv 1(p)$ or $x\equiv -1(p)$.

Dietrich Burde
  • 140,055
  • Thanks, haven't started on field theory yet, but $x\equiv 1(p)$ means $x$ is congruent to $1 \mod p$ just to be sure ? Normally this is written $x\equiv 1 \mod p$ and this is the same as $x\equiv 1(p)$ - just different notation ? – Andreas Lykke Iversen Sep 04 '13 at 18:05
  • Yes. And for $0=(x+1)(x-1)$ you do not need much field theory. Of course, $x=1$ or $x=-1$. – Dietrich Burde Sep 04 '13 at 18:07