proposition: Lemma ZToWord_Npow2_add_k': forall sz z k, ZToWord sz (z + k * Z.of_N (Npow2 sz)) = ZToWord sz z.
proof: Proof. intros. assert (0 <= k \/ k < 0)%Z as C by lia. destruct C as [C | C]. - pose proof (ZToWord_Npow2_add_k sz z (Z.to_nat k)) as Q. rewrite Znat.Z2Nat.id in Q; assumption. - pose proof (ZToWord_Npow2_sub_k sz z (Z.to_nat (- k))) as Q. rewrite Znat.Z2Nat.id in Q by lia. rewrite <- Q. f_equal. lia. Qed.
imports: Coq.Classes.Morphisms Coq.Classes.Morphisms_Prop Coq.Classes.Equivalence Coq.Arith.PeanoNat Coq.ZArith.BinInt  Coq.Arith.Arith Coq.NArith.NArith Coq.Bool.Bool Coq.ZArith.ZArith Coq.Logic.Eqdep_dec Coq.Logic.EqdepFacts Coq.Program.Tactics Coq.Program.Equality Coq.setoid_ring.Ring Coq.setoid_ring.Ring_polynom bbv.Nomega bbv.ZLib bbv.NatLib bbv.NLib bbv.N_Z_nat_conversions bbv.DepEq bbv.DepEqNat bbv.ReservedNotations Coq.micromega.Lia