proposition: Lemma wplus_wplusZ: forall sz (w1 w2: word sz), w1 ^+ w2 = wplusZ w1 w2.
proof: Proof. unfold wplus, wplusZ, wordBin, wordBinZ; intros. do 2 rewrite wordToZ_wordToN. match goal with | [ |- context[(?z1 - ?z2 + (?z3 - ?z4))%Z] ] => replace (z1 - z2 + (z3 - z4))%Z with (z1 + z3 - z2 - z4)%Z by lia end. rewrite <-N2Z.inj_add. destruct (wmsb w1 false); destruct (wmsb w2 false). - simpl; do 2 rewrite ZToWord_Npow2_sub. apply eq_sym, ZToWord_Z_of_N. - simpl; rewrite Z.sub_0_r, ZToWord_Npow2_sub. apply eq_sym, ZToWord_Z_of_N. - simpl; rewrite Z.sub_0_r, ZToWord_Npow2_sub. apply eq_sym, ZToWord_Z_of_N. - simpl; do 2 rewrite Z.sub_0_r. apply eq_sym, ZToWord_Z_of_N. 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