MathLabs
TheoremProved

Euler's theorem

Statement

If gcd⁡(a,n)=1\gcd(a,n)=1, then aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod{n}, where φ\varphi is Euler's totient function.

Why is it true?

This is exactly Fermat's argument with a general modulus nn: instead of all nonzero residues (which only form a closed multiplicative system when nn is prime), we restrict to the residues actually coprime to nn — the ones that have inverses — and the same shuffling argument applies to that smaller, closed set of size φ(n)\varphi(n).

Proof sketch

Let R={r1,…,rφ(n)}R=\{r_1,\dots,r_{\varphi(n)}\} be a reduced residue system modulo nn: representatives of every residue class coprime to nn.

Multiplication by aa permutes RR: for each rir_i, gcd⁡(ari,n)=1\gcd(ar_i,n)=1 because gcd⁡(a,n)=1\gcd(a,n)=1 and gcd⁡(ri,n)=1\gcd(r_i,n)=1 (a product is coprime to nn iff both factors are), so ari mod nar_i \bmod n is again a member of the coprime residue classes; and the map ri↦ari mod nr_i\mapsto ar_i \bmod n is injective by the cancellation law, since gcd⁡(a,n)=1\gcd(a,n)=1.

An injective map from the finite set RR to itself (up to residue) is a bijection, so {ar1,…,arφ(n)}(modn)\{ar_1,\dots,ar_{\varphi(n)}\} \pmod n is just {r1,…,rφ(n)}\{r_1,\dots,r_{\varphi(n)}\} reordered.

Multiplying all φ(n)\varphi(n) elements of each set: aφ(n) (r1r2⋯rφ(n))≡r1r2⋯rφ(n)(modn)a^{\varphi(n)}\, (r_1 r_2\cdots r_{\varphi(n)}) \equiv r_1 r_2 \cdots r_{\varphi(n)} \pmod n. Since each rir_i is coprime to nn, so is their product R=∏riR=\prod r_i, i.e. gcd⁡(R,n)=1\gcd(R,n)=1.

Cancel RR from both sides (valid since gcd⁡(R,n)=1\gcd(R,n)=1) to get aφ(n)≡1(modn)a^{\varphi(n)}\equiv1\pmod n. ■\blacksquare

This is again Lagrange's theorem in disguise: the residues coprime to nn form a group of order φ(n)\varphi(n) under multiplication (the group of units (Z/nZ)∗(\mathbb{Z}/n\mathbb{Z})^{*}), and the order of any element divides φ(n)\varphi(n).

Topics that use this theorem

Step-by-step proofs

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

References

  1. Ronald L. Rivest, Adi Shamir, Leonard M. Adleman (1978). A Method for Obtaining Digital Signatures and Public-Key Cryptosystems · DOI:10.1145/359340.359342
  2. W. R. Alford, Andrew Granville, Carl Pomerance (1994). There are Infinitely Many Carmichael Numbers · DOI:10.2307/2118576