intro. pattern l, (qs leb l).
apply qs_rect...
intros.
simpl.
apply Permutation.Permutation_cons_app.
apply Permutation.perm_trans with (filter (leb h) t ++ filter (gt leb h) t).
apply complementary_filter_perm.
apply Permutation.perm_trans with (qs leb (filter (leb h) t) ++ qs leb (filter (gt leb h) t)).
apply Permutation.Permutation_app...
apply Permutation.Permutation_app_swap.
Qed.
Variable PO: Relation_Definitions.preorder X Xle.

(* Specifications: *)
Lemma  qs_correct: forall l, vec.sorted Xle (qs leb l).
Proof with auto.