proposition: Lemma wmsb_false_pos: forall sz (w: word sz), wmsb w false = false <-> (wordToZ w >= 0)%Z.
proof: Proof. unfold wordToZ; split; intros. - rewrite H. destruct (wordToN w). + lia. + pose proof (Zgt_pos_0 p); lia. - remember (wmsb w false) as b; destruct b; auto. remember (wordToN (wneg w)) as n; destruct n. + replace 0%N with (wordToN (wzero sz)) in Heqn. * apply wordToN_inj in Heqn. apply eq_sym, wneg_wzero in Heqn; subst. rewrite wmsb_wzero in Heqb; discriminate. * rewrite <-wzero'_def. apply wordToN_wzero'. + exfalso; pose proof (Zlt_neg_0 p); 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