Definition unordered_nat_pair (x y: nat): nat * nat :=
    if le_lt_dec x y then (x, y) else (y, x).Definition cmp (x y: Index e ol): M comparison
    := ret (unordered_nat_pair x y :: nil, Ecmp e (subscript x) (subscript y)).Definition homo: monoidHomo monoid NatAddMonoid (fun x => length x).Definition pick := monoid_tree_monad.pick monoid.

(* Specifications: *)
Lemma partition d (l: list (Index e ol)): partition M cmp d l = ne_tree.Leaf (map (fun i: Index e ol => unordered_nat_pair i d) l, simplerPartition (UE e ol) d l).
Lemma simplePartition_component (ee: E) i cr l: proj1_sig (simplerPartition ee i l) cr = filter (fun f => unsum_bool (cmp_cmp (Ecmp ee f i) cr)) l.
Theorem qs_ind: forall l, P l (qs cmp pick l).
Lemma UcmpDec (x y: nat * nat): { x = y } + { x <> y }.