(* 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).

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.