proposition: Lemma wneg_wordToZ: forall sz (w: word (S sz)), w <> wpow2 sz -> wordToZ (wneg w) = (- wordToZ w)%Z.
proof: Proof. intros. assert (wordToZ (wneg w) + wordToZ w = 0)%Z. { destruct (weq w (wzero _)). { subst; rewrite wzero_wneg, wordToZ_wzero. reflexivity. } { rewrite <-wordToZ_distr_diff_wmsb. { rewrite wplus_comm, wminus_inv. apply wordToZ_wzero. } { remember (wmsb w false) as msb; destruct msb. { eapply wmsb_wneg_true; eauto. } { eapply wmsb_wneg_false; eauto. intro Hx; elim n. apply wordToNat_inj. rewrite wordToNat_wzero, Hx; reflexivity. } } } } 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