proposition: Lemma ZToWord_plus: forall sz a b, ZToWord sz (a + b) = ZToWord sz a ^+ ZToWord sz b.
proof: Proof. destruct sz as [|sz]; intros n m; intuition. rewrite wplus_wplusZ. unfold wplusZ, wordBinZ. destruct (wordToZ_ZToWord' (S sz) n) as [k1 D1]. destruct (wordToZ_ZToWord' (S sz) m) as [k2 D2]. rewrite D1. rewrite D2. replace (n - k1 * Z.of_N (Npow2 (S sz)) + (m - k2 * Z.of_N (Npow2 (S sz))))%Z with (n + m - (k1 + k2) * Z.of_N (Npow2 (S sz)))%Z by nia. symmetry. apply ZToWord_Npow2_sub_z. 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