The areas / V12. Number theory
Mathlib.NumberTheory.PowModTotient
4 declarations. Mathlib docs · Source
Modular exponentiation with the totient function
This file contains lemmas about modular exponentiation. In particular, it contains lemmas showing that an exponent can be reduced modulo the totient function when the base is coprime to the modulus.
Main Results
pow_totient_mod: Ifxis coprime ton, then the modular exponentiationx ^ k % ncan be reduced tox ^ (k % φ n) % n.
TODO
- Extend to results in cases where the base is not coprime to the modulus.
- Write a tactic or simproc that can automatically reduce exponents or towers of exponents using these results.
theorem Nat.pow_totient_mod_eq_one E1 #
∀ {x n : ℕ}, 1 < n → x.Coprime n → x ^ n.totient % n = 1
theorem Nat.pow_add_totient_mod_eq E0 #
∀ {x k n : ℕ}, 1 < n → x.Coprime n → x ^ (k + n.totient) % n = x ^ k % n
theorem Nat.pow_add_mul_totient_mod_eq E0 #
∀ {x k l n : ℕ}, 1 < n → x.Coprime n → x ^ (k + l * n.totient) % n = x ^ k % n
theorem Nat.pow_totient_mod E3 #
∀ {x k n : ℕ}, 1 < n → x.Coprime n → x ^ k % n = x ^ (k % n.totient) % n