Wilson’s Theorem Lemma Implication

abstract-algebradiscrete mathematicsmodular arithmeticnumber theory

In Dudley's Elementary Number Theory, Wilson's Theorem is preceded by two lemmas.

Lemma 1: $x^2\equiv 1 \pmod{p}$ has exactly two solutions: $1$ and $p-1$.

Lemma 2: Let $p$ be an odd prime and let $a'$ be the solution of $ax\equiv 1 \pmod{p}, a= 1,2,…,p-1.$ $a'\equiv b' \pmod{p}$ if and only if $a\equiv b \pmod{p}$. Furthermore, $a\equiv a' \pmod{p}$ if and only if $a\equiv 1$ or $p-1$.

The proof for Wilson's Theorem starts out by saying "From Lemma 2, we know that we can separate the numbers $2,3,…,p-2$ into $(p-3)/2$ pairs such that each pair consists of an integer $a$ and its associated $a'$".

How is it that Lemma 2 implies this?

Best Answer

Let $p$ be an odd prime. The set $S=\{2,3,\ldots, p-2\}$ contains $p-3$ numbers. For each $a\in S$, there is some $a'$ such that $aa'\equiv 1\pmod p$. We can assume $a'\in\{0,\ldots, p-1\}$, but since $a\not\equiv 1$, we know $a'$ is not $1$ or $p-1\equiv-1$. Clearly also $a'\neq 0$, so $a'\in S$.

Thus $a$ and $a'$ form a pair, and we clam that $a'$ is unique. If $ab'\equiv 1\pmod p$, then $aa'\equiv ab'$. Multiplying both sides by $a'$ gives $a'aa'\equiv a'ab'$, and so $a'\equiv b'$. But we were assuming $a',b'$ are in $\{0,\ldots, p-1\}$, so in fact $a'=b'$.

Next we claim $a'\neq a$. Otherwise $a^2\equiv 1\pmod p$, so by lemma $1$, $a=1$ or $a=p-1$, neither of which are true.

This shows that every element $a\in S$ has exactly one partner $a'\neq a$, and so $S$ can be broken up into $\frac{p-3}{2}$ such pairs.

Related Question