A consequence of Wilson’s Theorem for primes $p \equiv 3 \pmod{4}$

elementary-number-theorymodular arithmeticprime numbers

For a prime $p$ of the form $p=4k+3$, prove that either $\big( \frac{p-1}{2} \big)! \equiv 1 \pmod{p}$ or $\big( \frac{p-1}{2} \big)! \equiv -1 \pmod{p}$. In other words, prove that $\big( \frac{p-1}{2} \big)!$ is a solution of the quadratic congruence $x^2 \equiv 1 \pmod{p}$.

How can I show that $\big( \frac{p-1}{2} \big)!$ belongs to those equivalent classes?

I know that $k \equiv -(p-k) \pmod{p}$, and hence that

$$\big( \frac{p-1}{2} \big)! \equiv (1)^{\frac{p-1}{2}} \frac{(p-1)!}{\big(\frac{p-1}{2}\big)!} \pmod{p}$$

Is it correct to argue that since the first factorial is in $\mathbb{Z}$, and $(p-1)!$ is congruent to $-1$ modulo $p$, then $\big( \frac{p-1}{2} \big)!$ can only be $1$ or $-1$?

Otherwise I don't see how I could prove the corollary. I know that the factors of $(p-2)!$ can be paired such that each pair is congruent to 1 modulo $p$, but that doesn't guarantee that the same holds for the factors of $\big( \frac{p-1}{2} \big)!$, does it?

Best Answer

Because $k\equiv -(p-k)$, you correctly concluded (modulo a typo) that $$\left(\frac{p-1}{2}\right)!\equiv (-1)^{(p-1)/2} \frac{(p-1)!}{\left(\frac{p-1}{2}\right)!} \pmod{p}$$ Hence $$\left[\left(\frac{p-1}{2}\right)!\right]^2\equiv (-1)^{(p-1)/2} (p-1)! \pmod{p}$$

But, by Wilson's theorem, $(p-1)!\equiv -1$. Further, since $p=4k+3$, $(p-1)/2=2k+1$ is odd. Hence we conclude $$\left[\left(\frac{p-1}{2}\right)!\right]^2\equiv 1\pmod{p}$$

However, the modular equation $x^2\equiv 1\pmod{p}$ has only two solutions distinct modulo $p$, namely $x=1$ and $x=-1$. For a proof of the more general fact that a degree $n$ polynomial has at most $n$ roots, modulo a prime, see here.