Proof with auto.
induction xs as [ | x xs [Yes | No] ]...
destruct (lelistA_dec x xs)...
right. intros K. inversion K...
right. intros K. inversion K...
Defined.
End DecidableSorting.
(** Two sorted lists with the same elements are equal to each other.*)
Section SortedListEquality.
Variable A : Type.
Variable ltA : relation A.
Hypothesis ltA_trans : forall x y z, ltA x y -> ltA y z -> ltA x z.
Hypothesis ltA_not_eqA : forall x y, ltA x y -> x <> y.
Hypothesis ltA_eqA : forall x y z, ltA x y -> y = z -> ltA x z.
Hypothesis eqA_ltA : forall x y z, x = y -> ltA y z -> ltA x z.
Hint Resolve ltA_trans.
Hint Immediate ltA_eqA eqA_ltA.
Notation Inf := (lelistA ltA).
Notation Sort := (sort ltA).

Lemma eqlist_eq : forall (xs ys : list A),
eqlistA (@eq _) xs ys ->
xs = ys.