#[global]
  Instance lt_strorder : StrictOrder lt.Local Instance compare_compat_1 : Proper (eq==>Logic.eq==>Logic.eq) compare.#[global]
  Instance compare_compat : Proper (eq==>eq==>Logic.eq) compare.Local Instance lt_compat : Proper (eq==>eq==>iff) lt.

(* Specifications: *)
Lemma add_spec: forall s x y, In y (add x s) <-> y=x \/ In y s.
Lemma remove_spec: forall s x y, In y (remove x s) <-> In y s /\ y<>x.
Lemma singleton_spec : forall x y, In y (singleton x) <-> y=x.
Lemma union_spec: forall s s' x, In x (union s s') <-> In x s \/ In x s'.
Lemma inter_spec: forall s s' x, In x (inter s s') <-> In x s /\ In x s'.
Lemma diff_spec: forall s s' x, In x (diff s s') <-> In x s /\ ~ In x s'.
Lemma fold_spec: forall s (A : Type) (i : A) (f : elt -> A -> A), fold f s i = fold_left (fun a e => f e a) (elements s) i.
Lemma cardinal_spec: forall s, cardinal s = length (elements s).
Lemma xfilter_spec: forall f s x i, In x (xfilter f s i) <-> In x s /\ f (i@x) = true.
Lemma filter_spec: forall s x f, @compat_bool elt E.eq f -> (In x (filter f s) <-> In x s /\ f x = true).
Lemma xforall_spec: forall f s i, xforall f s i = true <-> For_all (fun x => f (i@x) = true) s.
Lemma for_all_spec: forall s f, @compat_bool elt E.eq f -> (for_all f s = true <-> For_all (fun x => f x = true) s).
Lemma xexists_spec: forall f s i, xexists f s i = true <-> Exists (fun x => f (i@x) = true) s.
Lemma exists_spec : forall s f, @compat_bool elt E.eq f -> (exists_ f s = true <-> Exists (fun x => f x = true) s).
Lemma partition_filter : forall s f, partition f s = (filter f s, filter (fun x => negb (f x)) s).
Lemma partition_spec1 : forall s f, @compat_bool elt E.eq f -> Equal (fst (partition f s)) (filter f s).
Lemma partition_spec2 : forall s f, @compat_bool elt E.eq f -> Equal (snd (partition f s)) (filter (fun x => negb (f x)) s).