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 := plus_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 plus_assoc.
intros.
rewrite (UIP_dec eq_nat_dec e (refl_equal _)).
rewrite (UIP_dec eq_nat_dec Heq0 (refl_equal _)).
reflexivity.
Qed.

(* Specifications: *)
Theorem eq_rect_combine : forall n1 n2 n2' (w1 : word n1) (w2 : word n2') Heq,
eq_rect (n1 + n2') (fun n => word n)
(combine w1 w2) (n1 + n2) Heq =
combine w1 (eq_rect n2' (fun n => word n) w2 n2 (plus_reg_l _ _ _ Heq)).
Lemma eq_rect_combine_assoc' : forall a b c H wa wb wc,
eq_rect (a + (b + c)) word (combine wa (combine wb wc)) _ H = combine (combine wa wb) wc.
Lemma eq_rect_split2_helper : forall a b c,
a = b -> c + a = c + b.
Theorem eq_rect_split2 : forall n1 n2 n2' (w : word (n1 + n2')) Heq,
eq_rect n2' (fun n => word n)
(split2 n1 n2' w) n2 Heq =
split2 n1 n2 (eq_rect (n1+n2') (fun n => word n) w (n1+n2) (eq_rect_split2_helper _ Heq)).
Theorem eq_rect_split2_eq2 : forall n1 n2 n2' (w : word (n1 + n2)) Heq Heq2,
eq_rect n2 (fun n => word n)
(split2 n1 n2 w) n2' Heq =
split2 n1 n2' (eq_rect (n1+n2) (fun n => word n) w (n1+n2') Heq2).
Theorem eq_rect_split2_eq1 : forall n1 n1' n2 (w: word (n1 + n2)) Heq,
split2 n1 n2 w = split2 n1' n2
(eq_rect (n1 + n2) (fun y : nat => word y) w
(n1' + n2) Heq).
Theorem combine_split_eq_rect2 : forall n1 n2 n2' (w : word (n1 + n2)) Heq,
combine (split1 n1 n2 w)
(eq_rect n2 (fun n => word n) (split2 n1 n2 w)
n2' Heq) =
eq_rect (n1 + n2) (fun n => word n) w
(n1 + n2') (eq_rect_split2_helper _ Heq).
Lemma eq_rect_split1_helper : forall a b c,
a = b -> a + c = b + c.
Lemma eq_rect_split1_eq2_helper : forall a b c,
a = b -> c + a = c + b.
Theorem eq_rect_split1 : forall n1 n1' n2 (w : word (n1' + n2)) Heq,
eq_rect n1' (fun n => word n)
(split1 n1' n2 w) n1 Heq =
split1 n1 n2 (eq_rect (n1'+n2) (fun n => word n) w (n1+n2) (eq_rect_split1_helper _ Heq)).
Theorem eq_rect_split1_eq1 : forall n1 n1' n2 (w : word (n1 + n2)) Heq Heq1,
eq_rect n1 (fun n => word n)
(split1 n1 n2 w) n1' Heq =
split1 n1' n2 (eq_rect (n1+n2) (fun n => word n) w (n1'+n2) Heq1).
Lemma split1_eq_rect_eq1_helper : forall a b c, b = a -> a + c = b + c.
Theorem eq_rect_split1_eq2 : forall n1 n2 n2' (w: word (n1 + n2)) Heq,
split1 n1 n2 w = split1 n1 n2'
(eq_rect (n1 + n2) (fun y : nat => word y) w
(n1 + n2') Heq).