proposition: Lemma extz_sext: forall sz (w: word sz) n1 n2, existT word _ (extz (sext w n1) n2) = existT word _ (sext (extz w n2) n1).
proof: Proof. dependent destruction w; cbn; intros. - unfold wzero, extz, sext. rewrite combine_wzero. rewrite combine_wzero. rewrite wmsb_wzero. rewrite combine_wzero. replace (n2 + 0 + n1) with (n2 + n1) by lia. reflexivity. - unfold wzero, extz, sext. rewrite wmsb_combine with (b2:= false) by discriminate. destruct (wmsb (WS b w) false); try (rewrite <-combine_assoc_existT; reflexivity). 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