Debian Codegraph @

src/Util/ZUtil/Nat2Z.v

raw
1 From Coq Require Import Lia.
2 From Coq Require Import Arith.
3 From Coq Require Import ZArith.
4 Require Import Crypto.Util.ZUtil.Hints.PullPush.
5
6 Module Nat2Z.
7 Lemma inj_pow (n m : nat) : Z.of_nat (n ^ m) = (Z.of_nat n ^ Z.of_nat m)%Z.
8 Proof.
9 induction m as [|m IH].
10 { rewrite Nat.pow_0_r, Z.pow_0_r; reflexivity. }
11 { autorewrite with push_Zof_nat.
12 rewrite Nat.pow_succ_r', Z.pow_succ_r, <- IH by lia.
13 autorewrite with push_Zof_nat.
14 reflexivity. }
15 Qed.
16 #[global]
17 Hint Rewrite inj_pow : push_Zof_nat.
18 #[global]
19 Hint Rewrite <- inj_pow : pull_Zof_nat.
20 End Nat2Z.
21 #[global]
22 Hint Rewrite Nat2Z.inj_pow : push_Zof_nat.
23 #[global]
24 Hint Rewrite <- Nat2Z.inj_pow : pull_Zof_nat.