Problem
NT-B2-M04-P017 Proof of Wilson
#17
★★★★★ Level 5 of 5
Prove Wilson's theorem: if \(p\) is prime, then \((p-1)!\equiv-1\pmod p\).
Pair nonzero residues with their inverses.
In the set \(1,2,\ldots,p-1\), every residue has an inverse. Residues equal to their own inverses satisfy \(x^2\equiv1\pmod p\), hence \(x\equiv1\) or \(x\equiv-1\pmod p\). All other residues pair as \(x,x^{-1}\), and each pair has product \(1\). Therefore \((p-1)!\equiv1\cdot(-1)\equiv-1\pmod p\).
This is a full proof, not just an application.