Prove that
\[ \forall p \in \mathcal P, \forall x \in \{x|p\nmid x\ \text{and } x \in N^*\}, x^{p-1} \equiv 1 \pmod p \]
Consider the set of nonzero residue classes modulo p:
\[ S=\{1,2,\dots,p-1\}. \]
Define the map f:S→S by
\[ f(a)\equiv xa\pmod p. \]
Since p∤x, we have gcd(x,p)=1, so x is invertible modulo p. Hence f is a permutation of S. Therefore
\[ \prod_{a=1}^{p-1}a\equiv \prod_{a=1}^{p-1}(xa) = x^{p-1}\prod_{a=1}^{p-1}a \pmod p. \]
Thus
\[ (p-1)!\equiv x^{p-1}(p-1)!\pmod p. \]
Because p is prime, none of 1,2,…,p−1 is divisible by p, so
\[ \gcd((p-1)!,p)=1. \]
Hence $(p-1)!$ is invertible modulo $p$, and we may cancel it from both sides. This gives
\[ x^{p-1}\equiv 1\pmod p. \]
Therefore
\[ \boxed{\forall p\in\mathcal P,\ \forall x\in\mathbb Z\text{ with }p\nmid x,\quad x^{p-1}\equiv 1\pmod p.} \]
0 条讨论