# Lecture 26: Euler's theorem

• Euler's theorem
• statement
• proof

## Statement of Euler's theorem

Here are several different ways of stating Euler's theorem. The first is how I remember it.

version 1: exponentiation mod m is well defined if the base is a unit and the exponent is an equivalence class mod ϕ(m). In other words, if [a] ∈ Zm and [b] ∈ Zϕ(m) then [a][b] = [ab] is well defined.

version 2: if [a] ∈ Zm and b ≡ bʹ mod ϕ(m) then [a]b = [a]bʹ.

version 3: [a]b + kϕ(m) = [a]

version 4: [a]ϕ(m) = [1]

## Proof sketch

Write the set of units of Zm. Consider what happens when you multiply all of the units by [a]. We drew a picture with an arrow from [b] to [c] if [a][b] = [c].

• no two arrows go into the same unit
• the arrows form loops
• the length of all of the loops is the same
• the total number of elements ϕ(m) is thus the length of the loop () times the number of loops (n)
• To compute [a]k we start at [1] and follow k arrows. To compute [a]ϕ(m) we start at [1] and traverse ϕ(m) = n arrows. This goes around the loop n times, so ends up at [1].

## Computing ϕ

You proved on the homework that [a] is a unit mod m if and only if gcd(a, m) = 1.

ϕ(m) is the number of units. If m is prime, then everything except [0] is relatively prime to m so ϕ(m) = m − 1.

If m = pq with p and q prime then ϕ(m) = (p − 1)(q − 1). Proof: start with pq total elements of Zpq. Subtract off p multiples of q and q multiples of p. You double counted 0. Use algebra to get (p − 1)(q − 1).