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.

(* Specifications: *)
Lemma list_compare_cons (x : A) (xs ys : list A) :
list_compare (x :: xs) (x :: ys) = list_compare xs ys.
Lemma list_compare_app (xs ys zs : list A) :
list_compare (xs ++ ys) (xs ++ zs) = list_compare ys zs.
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.