proposition: Lemma wordToNat_wneg_non_0 sz: forall (a: word sz), a <> natToWord _ 0 -> # (wneg a) = pow2 sz - #a.
proof: Proof. intros. unfold wneg. rewrite pow2_N. rewrite NToWord_nat. rewrite Nnat.N2Nat.inj_sub. rewrite wordToN_to_nat. rewrite Nnat.Nat2N.id. simpl. rewrite wordToNat_natToWord_idempotent'; auto. assert (#a <> 0) by word_lia. pose proof (pow2_zero sz). 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