proposition: Lemma sext_sext: forall sz (w: word sz) n1 n2, existT word _ (sext w (n1 + n2)) = existT word _ (sext (sext w n1) n2).
proof: Proof. unfold sext; intros. remember (wmsb w false) as wmsb; destruct wmsb. - destruct n1 as [|n1]. + cbn; rewrite wmsb_combine_WO, <-Heqwmsb. rewrite <-combine_assoc_existT. reflexivity. + rewrite wmsb_combine with (b2:= false) by discriminate. rewrite wmsb_wones. rewrite <-combine_assoc_existT. rewrite combine_wones. reflexivity. - destruct n1 as [|n1]. + cbn; rewrite wmsb_combine_WO, <-Heqwmsb. rewrite <-combine_assoc_existT. reflexivity. + rewrite wmsb_combine with (b2:= false) by discriminate. rewrite wmsb_wzero. rewrite <-combine_assoc_existT. rewrite combine_wzero. 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