proposition: Theorem combine_end : forall n1 n2 n3 Heq w, combine (split1 n2 n3 (split2 n1 (n2 + n3) w)) (split2 (n1 + n2) n3 (match Heq in _ = N return word N with | refl_equal => w end)) = split2 n1 (n2 + n3) w.
proof: Proof. induction n1 as [|n1 IHn1]; simpl; intros n2 n3 Heq w. rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)). apply combine_split. rewrite (shatter_word w) in *. simpl. eapply trans_eq; [ | apply IHn1 with (Heq := Nat.add_assoc _ _ _) ]; clear IHn1. repeat f_equal. repeat match goal with | [ |- context[match ?pf with refl_equal => _ end] ] => generalize pf end. simpl. generalize dependent w. rewrite Nat.add_assoc. intros. rewrite (UIP_dec eq_nat_dec e (refl_equal _)). rewrite (UIP_dec eq_nat_dec Heq0 (refl_equal _)). 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