proposition: Lemma wmsb_false_wordToNat_eq: forall sz (w: word (S sz)), wmsb w false = false -> wordToNat w = wordToNat (split1 sz _ (eq_rect _ word w _ (Nat.add_comm 1 sz))).
proof: Proof. intros. remember (eq_rect _ word w _ (Nat.add_comm 1 sz)) as ww. assert (wmsb ww false = false) by (subst; rewrite <-wmsb_eq_rect; assumption). replace (wordToNat w) with (wordToNat ww) by (subst; rewrite wordToNat_eq_rect; reflexivity). clear Heqww H w. apply wmsb_false_split2_wzero in H0. rewrite <-combine_split with (w:= ww) at 1. rewrite wordToNat_combine. rewrite <-H0. cbn; 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