Solution
= Solution
If $p$ is a <prime number> and $p\nmid a$, multiplication by $a$ permutes the nonzero <residue classes> modulo $p$: $ai\equiv aj$ implies $i\equiv j$ because $a$ has a <multiplicative inverse>. Multiplying all the permuted classes gives
$$
a^{p-1}(p-1)!\equiv(p-1)!\pmod p.
$$
The <factorial> is a nonzero element of the <finite field> $\mathbb F_p$, so cancellation is valid. Therefore
$$
\boxed{a^{p-1}\equiv1\pmod p,}
$$
which is <Fermat's little theorem>.