proposition: Lemma my_powP m p : @my_pow 'M[R]_2 *%R m p = m ^ Pos.to_nat p.
proof: Proof. have cm : 1 * m = m * 1. by rewrite mulr1 mul1r. have:= @fastexp3P 'M[R]_2 *%R 1%R m 0 (Pos.to_nat p) (bits p [::]) (@mulrA _) cm (fun a => mul1r a) (bitsP _). rewrite /my_pow mul0n add0n /=. rewrite [in RHS]headbits /= !mul1r => <-. by rewrite iter_mul mulr1. Qed.
imports: Coq(Extraction ZArith Lia) mathcomp(all_ssreflect all_algebra)