proposition: Lemma wones_natToWord: forall sz, wones sz = $ (pow2 sz - 1).
proof: Proof. induction sz. - reflexivity. - unfold wones. fold wones. rewrite IHsz. unfold natToWord at 2. fold natToWord. f_equal. + rewrite mod2sub. * simpl. rewrite mod2_pow2_twice. reflexivity. * pose proof (zero_lt_pow2 (S sz)). lia. + f_equal. unfold pow2 at 2. fold pow2. rewrite <- (div2_S_double (pow2 sz - 1)). f_equal. pose proof (zero_lt_pow2 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