End NatSeq.
Notation seq := seq.
(***********************)
(** ** List comparison *)
(***********************)
Section Compare.
Variable A : Type.
Variable cmp : A -> A -> comparison.
Local Notation list_compare := (@list_compare A cmp).
Section Lemmas.
Variable Hcmp : forall x y, cmp x y = Eq <-> x = y.

Lemma prefix_eq {prefix1 prefix2 xs1 xs2 ys1 ys2 : list A} {x1 x2 y1 y2 : A} :
prefix1 ++ x1 :: xs1 = prefix2 ++ x2 :: xs2 ->
prefix1 ++ y1 :: ys1 = prefix2 ++ y2 :: ys2 ->
x1 <> y1 ->
x2 <> y2 ->
prefix1 = prefix2.