Is this a good proof of Wilson's theorem? — ($(n-1)!+1 \equiv_n 0 \iff n$ is prime)

433 Views Asked by At

Theorem: $(n - 1)! + 1 \equiv_n 0$ if and only if $n$ is prime.

To prove that if $n$ is not prime this is not true is trivial, so I'm just interested in proving that this is true for all p:

EQ 1: $(n - 1)! \equiv_n - 1 \rightarrow (n-1)! \equiv_n (n-1) $

Now we need Euler's theorem of the Euler totient function:

Lemma 1: if $GCD(a, b) = 1$, then $a^{\varphi(b)} \equiv_b 1$.

By raising each side of EQ 1 to $\varphi(n)$, we see that the equivalence can hold if and only if $n$ is prime:

$(n-1)!^{\varphi(n)} \equiv_n (n-1)^{\varphi(n)}$

Because $(n-1)!$ would certainly have a common divisor with $n$ if n were composite.

1

There are 1 best solutions below

4
On

It seems to me from your last sentence ("if $n$ were composite") you're still showing that if $n$ is composite then the congruence doesn't hold, and that, as you know, is the easy direction. You want to start from the assumption that $n$ is prime, and deduce the congruence.