Euler's totient theorem
ProvedFamousTheorems.pow_totientmathlibnumber-theory
Euler's generalisation of Fermat's little theorem.
For ,
where is Euler's totient function.
The units mod form a group of order , so this is Lagrange's theorem applied to the element : the order of divides the order of the group. Taking prime gives and Fermat's little theorem .
It is the arithmetic fact underlying RSA: decryption works because the exponents are inverse modulo .
Preamble
import Mathlib
Formal statement
namespace FamousTheorems
theorem pow_totient : ∀ {x n : ℕ}, Nat.Coprime x n → x ^ n.totient ≡ 1 [MOD n] := by sorry
end FamousTheoremsSource
One of Freek Wiedijk's "100 theorems"; formalized in Mathlib. Proof here reduces to the corresponding Mathlib result.