Definition gtb x y := match E.compare x y with GT _ => true | _ => false end.Definition leb x := fun y => negb (gtb x y).Definition elements_lt x s := List.filter (gtb x) (elements s).Definition elements_ge x s := List.filter (leb x) (elements s).

(* Specifications: *)
Lemma gtb_1 : forall x y, gtb x y = true <-> E.lt y x.
Lemma leb_1 : forall x y, leb x y = true <-> ~E.lt y x.
Lemma gtb_compat : forall x, Proper (E.eq==>Logic.eq) (gtb x).
Lemma leb_compat : forall x, Proper (E.eq==>Logic.eq) (leb x).
Lemma elements_split : forall x s, elements s = elements_lt x s ++ elements_ge x s.
Lemma elements_Add : forall s s' x, ~In x s -> Add x s s' -> eqlistA E.eq (elements s') (elements_lt x s ++ x :: elements_ge x s).