MathLabs
TheoremProved

Euler's criterion

Statement

For an odd prime pp and gcd⁡(a,p)=1\gcd(a,p)=1: (ap)≡ap−12(modp)\left(\dfrac{a}{p}\right) \equiv a^{\frac{p-1}{2}} \pmod{p}; equivalently, aa is a quadratic residue modulo pp if and only if a(p−1)/2≡1(modp)a^{(p-1)/2} \equiv 1 \pmod p.

Why is it true?

It turns an existence question (does some xx square to aa?) into a single modular exponentiation, which is exactly what makes the Legendre symbol computable and multiplicative.

Proof sketch

Since (Z/pZ)∗(\mathbb{Z}/p\mathbb{Z})^{*} is cyclic of order p−1p-1 (a standard fact for prime moduli), fix a primitive root gg and write a≡gk(modp)a \equiv g^k \pmod p for some 0≤k≤p−20 \le k \le p-2. The quadratic residues modulo pp are exactly the even powers of gg: if a=g2ma=g^{2m} then x=gmx=g^m satisfies x2≡ax^2\equiv a, and conversely every square x2=(gj)2=g2jx^2=(g^j)^2=g^{2j} is an even power. So aa is a quadratic residue exactly when kk is even.

Now compute a(p−1)/2≡gk(p−1)/2(modp)a^{(p-1)/2} \equiv g^{k(p-1)/2} \pmod p. If kk is even, write k=2mk=2m; then gk(p−1)/2=gm(p−1)=(gp−1)m≡1m=1(modp)g^{k(p-1)/2}=g^{m(p-1)}=(g^{p-1})^m\equiv 1^m=1\pmod p by Fermat's little theorem, matching the residue case.

If kk is odd, then gk(p−1)/2g^{k(p-1)/2} is a square root of gk(p−1)=(gp−1)k≡1(modp)g^{k(p-1)}=(g^{p-1})^k\equiv 1\pmod p, so a(p−1)/2≡±1a^{(p-1)/2}\equiv \pm 1. It cannot be 11: if it were, the order of gg would have to divide k(p−1)/2k(p-1)/2, but ord⁡(g)=p−1\operatorname{ord}(g)=p-1 and kk is odd means k(p−1)/2k(p-1)/2 is not a multiple of p−1p-1 unless (p−1)/2(p-1)/2 already is, contradicting that gg is a primitive root of exact order p−1p-1. Hence a(p−1)/2≡−1(modp)a^{(p-1)/2}\equiv -1\pmod p exactly when kk is odd, i.e. exactly when aa is a nonresidue.

Combining both cases: a(p−1)/2≡1(modp)a^{(p-1)/2}\equiv 1\pmod p iff aa is a quadratic residue, and ≡−1\equiv -1 otherwise, which is precisely the statement (ap)≡ap−12(modp)\left(\dfrac{a}{p}\right) \equiv a^{\frac{p-1}{2}} \pmod{p}.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. Wikipedia contributors (2024). Quadratic reciprocity
  2. Kenneth Ireland, Michael Rosen (1990). A Classical Introduction to Modern Number Theory