# Thread: prove by wilson theorem

1. ## prove by wilson theorem

2. (i) By Wilson's Theorem: $(p-1)!\equiv{-1}(\bmod.p)$

$(p-1)(p-2)...\left(\frac{p+1}{2}\right)\cdot{\left(\frac{p-1}{2}\right)!}\equiv{-1}(\bmod.p)$

But note that $p-1\equiv{-1}(\bmod.p)$ $p-2\equiv{-2}(\bmod.p)$ and so on... $\frac{p+1}{2}\equiv{-\frac{p-1}{2}}(\bmod.p)$

Thus: $(-1)^{\left(\frac{p-1}{2}\right)}\left[\left(\frac{p-1}{2}\right)!\right]^2\equiv{-1}(\bmod.p)$

Now if $p\equiv{1}(\bmod.4)$ then $(-1)^{\left(\frac{p-1}{2}\right)}=1$

Thus: $\left[\left(\frac{p-1}{2}\right)!\right]^2\equiv{-1}(\bmod.p)$

(iii) This shows that you have at least 2 solutions if $p\equiv{1}(\bmod.4)$ ( a²=(-a)² )

3. (Let $p$ be odd).
Define $f(x) \in \mathbb{Z}_p[x]$ as $f(x) = x^{p-1} -1 - (x-1)(x-2)...(x-(p-1))$.
This polynomial has degree $p-2$. But every $a\in \mathbb{Z}_p^{\text{x}}$ solves this polynomial.
Thus, $\deg f(x) = p-2$ has value of zero for $p-1$ distinct values, and so it must be a zero polynomial.
So let $x=0$ and we get: $-1 - (p-1)! \equiv 0 (\bmod p)\implies (p-1)! \equiv -1(\bmod p)$