Definition eqST (cp1 cp2 : tST) :=
eqList (PosSort.sort (CPToList cp1)) (PosSort.sort (CPToList cp2)).

Lemma eqListOK : forall l1 l2, eqList l1 l2 -> l1 = l2.
Fixpoint compareList (l1 l2 : list positive) :=
match l1, l2 with
| nil, nil => Eq
| (hd1 :: tl1), (hd2 :: tl2) => match Pos.compare hd1 hd2 with
| Lt => Lt
| Eq => compareList tl1 tl2
| Gt => Gt
end
| nil, _ => Lt
| _, nil => Gt
end.