Proof with auto using In_InA, InA_In.
intros ? ? ? ? H.
apply Sort_InA_eq...
intros a; specialize (H a).
split; intros; apply In_InA; intuition...
Qed.
End SortedListEquality.
(* ********************************************************************** *)
(** * Uniqueness of proofs *)
(** Uniqueness of proofs for predicates on lists often comes up when discussing extensional equality on finite sets, as implemented by the FSets library. *)
Section Uniqueness_Of_SetoidList_Proofs.
Variable A : Type.
Variable R : A -> A -> Prop.
Hypothesis R_unique : forall (x y : A) (p q : R x y), p = q.
Hypothesis list_eq_dec : forall (xs ys : list A), {xs = ys} + {xs <> ys}.
Scheme lelistA_ind' := Induction for lelistA Sort Prop.
Scheme sort_ind'    := Induction for sort Sort Prop.
Scheme eqlistA_ind' := Induction for eqlistA Sort Prop.

Theorem lelistA_unique :
forall (x : A) (xs : list A) (p q : lelistA R x xs), p = q.