Fixpoint merge_sort_pop s1 ss :=
  if ss is s2 :: ss' then merge_sort_pop (merge s1 s2) ss' else s1.

(* Specifications: *)
Lemma sort_sorted s : sorted (sort s).
Lemma perm_sort s : perm_eql (sort s) s.
Lemma mem_sort s : sort s =i s.
Lemma size_sort s : size (sort s) = size s.
Lemma sort_uniq s : uniq (sort s) = uniq s.
Lemma perm_sortP : transitive leT -> antisymmetric leT -> forall s1 s2, reflect (sort s1 = sort s2) (perm_eq s1 s2).
Lemma rev_sorted (T : eqType) (leT : rel T) s : sorted leT (rev s) = sorted (fun y x => leT x y) s.
Lemma ltn_sorted_uniq_leq s : sorted ltn s = uniq s && sorted leq s.
Lemma iota_sorted i n : sorted leq (iota i n).
Lemma iota_ltn_sorted i n : sorted ltn (iota i n).