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
: Ifx
is coprime ton
, then the modular exponentiationx ^ k % n
can be reduced tox ^ (k % φ n) % n
.
TODOs #
- 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.