----
> [!theorem] Theorem. ([[Wilson's theorem]])
> For $p$ a [[prime number|prime]], we have $(p-1)! \equiv -1 \text{ mod }p.$
^ddbc2c
> [!proposition] Lemma.
> The [[symmetric group]] $S_{p}$ contains $(p-2)!$ [[p-Sylow subgroup|p-Sylow subgroups]].
^d55433
> [!proof] Proof of Lemma.
> We will apply [[the Sylow theorems]]. To do so, we need to write $S_{p}$ in the form $p^{r} \cdot m$ for some [[prime number]] $p$ with $p \not{|}m$. Consider $(p-1)! = (p-1)(p-2)\dots(p-p+1) ,$
and observe that, by [[Euclid's Lemma]], if $p | (p-1)!$, then $p$ [[divides]] one of the factors $(p-1),(p-2),\dots$. But clearly it cannot. So $p \not{|}(p-1)!$ Thus when we consider $|S_{p}|= p! = p^{1} \cdot \overbrace{(p-1)}^{m}!,$
we see that $r=1$ in the statement of [[the Sylow theorems]] and therefore $S_{p}$ has some number of [[p-Sylow subgroup]]s of [[order of a group|order]] $p$. We would like to show that there are $(n-2)!$ such [[subgroup]]s.
\
To do so, it suffices to count the number [[subgroup]]s $S_{p}$ has of [[order of a group|order]] $p$. (Note that these subgroups intersect trivially by [[intersection of subgroups is a subgroup]] along with [[Lagrange's Theorem]]). First, we count the number of elements $S_{p}$ contains with [[order of an element in a group|order]] $p$. An element has [[order of an element in a group|order]] $p$ if and only if it is a $p$-cycle. How many $p$-cycles does $S$ contain? There are $p!$ ways to write out a prospective $p$-cycle in symbols. However, we need to avoid overcounting — for example, if $p=5$ then $(13542) \text{ and } (35421)$
are the same [[permutation]], just with a shift in the symbols of the cycle notation. In general, there are $p$ such shifts that can be applied to each of the $p!$ cycles we wrote symbolically, and hence we conclude that there are $\frac{p!}{p}$ distinct $5$-cycles in $S_{p}$ and therefore $\frac{p!}{p}$ elements of [[order of an element in a group|order]] $p$.
\
Now, every [[subgroup]] of [[order of a group|order]] $p$, because it is has [[prime number|prime order]], is [[cyclic group|cyclic]] with all $p-1$ nontrivial elements having order $p$ (see [[order of element in cyclic group]]).
\
Thus we must send each element to the [[subgroup]] to which it belongs (think about [[equivalence relation]]s/[[quotient group]]s). This is a $(p-1)$-to-$1$ [[k-to-1 correspondence|correspondence]] $\{ \text{elements of order }p \} \leftrightarrow \{ \text{subgroups of order }p \}$
implying that the [[cardinality]] of the RHS set is $\frac{p!}{p(p-1)} = (p-2)!$
\
This is the result.
^662f64
> [!proof]- Proof. ([[Wilson's theorem]])
> Note that $\begin{align}
(p-1)! \text{ mod }p = (p-1) \text{ mod }p \iff (p-2)! \equiv 1 \text{ mod }p
\end{align}$
by the [[mod cancellation criterion]], and so the result follows from the lemma.
^980911
----
####
-----
#### References
> [!backlink]
> ```dataview
TABLE rows.file.link as "Further Reading"
FROM [[]]
FLATTEN file.tags
GROUP BY file.tags as Tag
> [!frontlink]
> ```dataview
> TABLE rows.file.link as "Further Reading"
> FROM outgoing([[]])
> FLATTEN file.tags as Tag
> WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom"
> GROUP BY Tag
> ```