(* The Quicksort we'll use is the monadic determinstic one that uses a partition pass, instantiated with the SimplyProfiled monad: *)

Definition counted_cmp (x y: X): SimplyProfiled comparison := (1%nat, Ecmp _ x y).

(* Specifications: *)
Lemma partition_cost p l: cost (part p l) = length l.
Lemma partition_result c p l: proj1_sig (result (part p l)) c = filter (fun x => unsumbool (cmp_cmp (Ecmp _ x p) c)) l.
Lemma cost_qs l: cost (qs l) = match l with | nil => 0 | h :: t => length t + cost (qs (filter (Egtb h) t)) + cost (qs (filter (Eltb h) t)) end.