proposition: Lemma extz_pow2_wordToZ: forall sz (w: word sz) n, wordToZ (extz w n) = (wordToZ w * Z.of_nat (pow2 n))%Z.
proof: Proof. induction n; [cbn; lia|]. rewrite pow2_S_z. change (wordToZ (extz w (S n))) with (wordToZ (combine (natToWord n 0) w)~0). rewrite wordToZ_WS_0. unfold extz, wzero in IHn. rewrite IHn. rewrite Z.mul_assoc. rewrite Z.mul_comm with (n:= 2%Z). apply eq_sym, Z.mul_assoc. 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