While looking for alternative proofs for the theorem, I came across the following link
The proof
Let $p$ be a prime number. By Fermat's little theorem, all non-zero elements of the field must be the roots of the polynomial $P(x)=x^{p-1}-1$.
$x^{p-1}-1= \prod_{r = 1}^{p-1}(x-r)$
Now, either $p=2$, in which case $a \equiv -a \pmod 2$ for any integer $a$, or $p-1$ is even. In either case, $(-1)^{p-1} \equiv 1 \pmod{p}$, so that
$x^{p-1}-1=\prod_{ r=1}^{p-1}(x-r)=\prod(r-x)$
If we set $x=0$ then we get the theorem.
My question is, if we have assumed that $x$ is non-zero in the beginning, how can we substitute it back in the end to get the theorem?
Can someone verify if this proof is correct or not and, if it is, explain why doing this is allowed?
Is my understanding correct?
– LoneStar Mar 06 '19 at 18:28