Section DecidableSorting.
Variable A : Type.
Variable leA : relation A.
Hypothesis leA_dec : forall x y, {leA x y} + {~ leA x y}.
Proof with auto.
destruct xs as [ | x xs ]...
destruct (leA_dec a x)...
right. intros J. inversion J...
Defined.

Theorem sort_dec : forall xs,
{sort leA xs} + {~ sort leA xs}.