Definition sorted s := if s is x :: s' then path leT x s' else true.

(* Specifications: *)
Lemma path_sorted x s : path leT x s -> sorted s.
Lemma subseq_order_path x s1 s2 : subseq s1 s2 -> path leT x s2 -> path leT x s1.
Lemma order_path_min x s : path leT x s -> all (leT x) s.
Lemma subseq_sorted s1 s2 : subseq s1 s2 -> sorted s2 -> sorted s1.
Lemma sorted_filter a s : sorted s -> sorted (filter a s).
Lemma sorted_uniq : irreflexive leT -> forall s, sorted s -> uniq s.
Lemma eq_sorted : antisymmetric leT -> forall s1 s2, sorted s1 -> sorted s2 -> perm_eq s1 s2 -> s1 = s2.
Lemma eq_sorted_irr : irreflexive leT -> forall s1 s2, sorted s1 -> sorted s2 -> s1 =i s2 -> s1 = s2.