# Thread: prove by wilson theorem

1. ## prove by wilson theorem

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

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

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

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

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

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

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

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