1

I want to prove the first implication of Wilson's theorem, namely:

For a prime number $p \geq 5$: $$(p-1)! \equiv -1 \mod p$$

I already proved:

  1. $\forall 1 \leq n \leq p-1: \exists1 \leq k \leq p-1: n\cdot k \equiv1 \mod p$
  2. $\forall k \in \mathbb Z: (k^2 \equiv 1 \mod p \implies k \equiv \pm1 \mod p)$

How can I proceed from here?

Maybe write $(p-1)!$ as a product and show that two terms "cancel each other mod $p$" (using 1.). And show that there are a odd number of terms of the form described in 2. The product would then be congruent to $-1 \mod p$, but I don't really know how to fill the steps.

user7802048
  • 1,265

2 Answers2

1

Your idea is right, they " cancel each other " but not every terms, it remains those which are their proper "inverse". In $(p-1)!$ It only stays the number $x$ satisfying $$ x^2=1 \Leftrightarrow \left(x-1\right)\left(x+1\right)=0 $$ which gives you $x=1$ or $x=p-1$. Hence

$$ \left(p-1\right)! \equiv -1 \left[p\right] $$

Atmos
  • 7,369
  • But how can I show that there are an odd number of such $x$ with $x^2 = 1$? And how can I show that $x \equiv -1$ (not $x \equiv 1)$? – user7802048 Feb 04 '18 at 14:10
  • You can solve the equation $x^2=1$, it's not linked with a number of solution – Atmos Feb 04 '18 at 14:13
0

So if $n\neq \pm 1\bmod p$ you can find a number $m\neq n$ with $mn=1 \bmod p$

(if $m=n$ you have $n^2=1\bmod p$ which you have shown occurs only for $\pm 1$)

Let's call $m$ a multiplicative inverse of $n$. What you have not yet done in what you have stated is to show that the multiplicative inverse is unique (modulo $p$). This is a necessary and straightforward thing to show for the proof to be complete.

Once this is done you can pair $2$ with its (unique) inverse, all the way up to $p-2$, at each stage pairing the least number which is not already paired. There are $p-3$ numbers, and since $p$ is odd, $p-3$ is even. Since these paired products are all equal to $1$ so is their total product.

Then you can multiply at the end by the missing numbers $1$ and $p-1=-1\bmod p$ to get your result.

Mark Bennet
  • 100,194