Section CompareLists.
Variable X : eqType.
Definition list_comperasion (xs ys : list X) : Prop :=
xs = ys \/
(exists a b l1 l2 l3, a <> b /\ xs = l1 ++ a :: l2 /\ ys = l1 ++ b :: l3) \/
(exists a l1 l2, xs = l1 ++ a :: l2 /\ ys = l1) \/
(exists a l1 l2, xs = l1 /\ ys = l1 ++ a :: l2).
Definition list_comperasion_cons xs ys x :
list_comperasion xs ys ->
list_comperasion (x :: xs) (x :: ys).

Lemma compare_lists (xs ys : list X) :
list_comperasion xs ys.