[Math] Show the congruence $x^{p-1}\equiv 1\pmod{p}$ has $p-1$ solutions

congruenceselementary-number-theorymodular arithmetic

Question: Let $p$ be prime. show the congruence $x^{p-1}\equiv 1\pmod{p}$ has $p-1$ solutions

Attempt: I know by Lagrange's theorem that this congruence will have at most $p-1$ solutions since $p-1$ is the order of the congruence

I know by Fermat's little theorem that if $(x,p)=1$ then $x^{p-1}\equiv 1\pmod{p}$

I know I will have to combine Lagrange's theorem and FLT, but I cant see how there is exactly $p-1$ solutions

Best Answer

Assuming we are working in $\mathbb{Z}/p\mathbb{Z}$.

On the one hand, by Lagrange's Theorem, said congruence has at most $p-1$ solutuions

On the other hand, by Fermat's Little Theorem, if $(x,p) = 1$ then $x^{p-1}\equiv 1\pmod p$.

Since the only element that does not satisfy $(x,p) = 1$ is $0$, then the remaining $p-1$ elements are solutons to the congruence.