Euler's Criterion/Proof 1

Theorem
Let $p$ be an odd prime.

Let $a \not \equiv 0 \pmod p$.

Then:

Proof
Trivially, any $a \not \equiv 0 \pmod p$ is either a quadratic residue or a quadratic non-residue, modulo $p$.

Therefore, it suffices to check the sufficient condition for both of the equations (i.e., the if parts from the iffs).

So let $a$ be a quadratic non-residue of $p$.

Also, let $b \in \left\{{1, 2, \ldots, p-1}\right\}$.

The congruence $b x \equiv a \pmod p$ has (modulo $p$) a unique solution $b'$ by Solution of Linear Congruence.

Note that $b' \not\equiv b$, because otherwise we would have $b^2 \equiv a \pmod p$ and $a$ would be a quadratic residue of $p$.

It follows that the residue classes $\left\{{1, 2, \ldots, p-1}\right\}$ modulo $p$ fall into $\frac {p-1} 2$ pairs $b, b'$ such that $b b' \equiv a \pmod p$.

Therefore, we have:


 * $\left({p-1}\right)! = 1 \times 2 \times \cdots \times \left({p-1}\right) \equiv a \times a \times \cdots \times a \equiv a^{\frac {p-1}2} \pmod p$

From Wilson's Theorem, we also have $\left({p-1}\right)! \equiv -1 \pmod p$.

And so, for any quadratic non-residue of $p$:


 * $a^{\frac {p-1} 2} \equiv -1 \pmod p$

Subsequently, let $a$ be a quadratic residue of $p$.

By definition of a quadratic residue, the congruence $x^2 \equiv a \pmod p$ has a solution $x$.

Suppose also $y$ is a solution. Then we have:

So either $x + y \equiv 0 \pmod p$ or $x - y \equiv 0 \pmod p$ from Product is Zero Divisor means Zero Divisor.

It follows that when $c \pmod p$ is one solution, $-c \pmod p$ is, too.

Also, these solutions are distinct as $p$ is odd.

Furthermore, we conclude that these are the only two solutions.

Now, remove $c$ and $p - c$ from $\left\{{1, 2, \ldots, p-1}\right\}$.

The remaining integers fall, modulo $p$, into $\frac {p - 3} 2$ pairs $b, b'$ such that $b b' \equiv a \pmod p$ by Solution of Linear Congruence.

Therefore, we can compute the following:

Again applying Wilson's Theorem, we conclude:


 * $- a^{\frac {p-1} 2} \equiv - 1 \pmod p$

The assertion for quadratic residues $a$ of $p$ follows.