fact: Fixpoint pow_mod_pos (m : Z) (a : Z) (n : positive) := match n with | xH => a mod m | xO n => pow_mod_pos m ((a * a) mod m) n | xI n => (a * pow_mod_pos m ((a * a) mod m) n) mod m end.
imports: Coq(PArith ZArith Lia Znumtheory) Coqtail(Ztools)