proposition: Lemma wlshift_combine_extz: forall sn sl (wl: word sl) ssu (wu: word (ssu + sn)), existT word (sl + (ssu + sn)) (wlshift (combine wl wu) sn) = existT word (sn + (sl + ssu)) (extz (combine wl (split1 ssu _ wu)) sn).
proof: Proof. intros; apply wordToNat_existT; [lia|]. rewrite wordToNat_wlshift. rewrite wordToNat_combine. rewrite wordToNat_extz. rewrite wordToNat_combine. rewrite wordToNat_split1. replace (sl + (ssu + sn) - sn) with (sl + ssu) by lia. rewrite Nat.mul_comm; f_equal. rewrite pow2_add_mul. pose proof (zero_lt_pow2 sl). pose proof (zero_lt_pow2 ssu). rewrite Nat.mod_mul_r; try lia. rewrite Nat.mul_comm with (n:= pow2 sl) at 1. rewrite Nat.mod_add; [|lia]. rewrite Nat.mod_small by apply wordToNat_bound. do 3 f_equal. rewrite Nat.mul_comm, Nat.div_add; [|lia]. rewrite Nat.div_small by apply wordToNat_bound. 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