Ltac ct := trivial with ct.Inductive ct: comparison -> comparison -> comparison -> Prop :=
  | ct_xxx: forall x, ct x  x  x
  | ct_xex: forall x, ct x  Eq x
  | ct_exx: forall x, ct Eq x  x
  | ct_glx: forall x, ct Gt Lt x
  | ct_lgx: forall x, ct Lt Gt x.Inductive ct: comparison -> comparison -> comparison -> Prop :=
  | ct_xxx: forall x, ct x  x  x
  | ct_xex: forall x, ct x  Eq x
  | ct_exx: forall x, ct Eq x  x
  | ct_glx: forall x, ct Gt Lt x
  | ct_lgx: forall x, ct Lt Gt x.Inductive ct: comparison -> comparison -> comparison -> Prop :=
  | ct_xxx: forall x, ct x  x  x
  | ct_xex: forall x, ct x  Eq x
  | ct_exx: forall x, ct Eq x  x
  | ct_glx: forall x, ct Gt Lt x
  | ct_lgx: forall x, ct Lt Gt x.Inductive ct: comparison -> comparison -> comparison -> Prop :=
  | ct_xxx: forall x, ct x  x  x
  | ct_xex: forall x, ct x  Eq x
  | ct_exx: forall x, ct Eq x  x
  | ct_glx: forall x, ct Gt Lt x
  | ct_lgx: forall x, ct Lt Gt x.Inductive ct: comparison -> comparison -> comparison -> Prop :=
  | ct_xxx: forall x, ct x  x  x
  | ct_xex: forall x, ct x  Eq x
  | ct_exx: forall x, ct Eq x  x
  | ct_glx: forall x, ct Gt Lt x
  | ct_lgx: forall x, ct Lt Gt x.

(* Specifications: *)
Lemma ct_cxe: forall x, ct (CompOpp x) x Eq.
Lemma ct_xce: forall x, ct x (CompOpp x) Eq.
Lemma ct_lxl: forall x, ct Lt x Lt.
Lemma ct_gxg: forall x, ct Gt x Gt.
Lemma ct_xll: forall x, ct x Lt Lt.
Lemma ct_xgg: forall x, ct x Gt Gt.
Lemma ct_lex: forall u v w u' v' w', ct u v w -> ct u' v' w' -> ct (lex u u') (lex v v') (lex w w').
Lemma ct_compare_bool: forall a b c, ct (compare_bool a b) (compare_bool b c) (compare_bool a c).
Lemma compare_x_Leaf: forall s, compare_fun s Leaf = if is_empty s then Eq else Gt.
Lemma compare_empty_x: forall a, is_empty a = true -> forall b, compare_fun a b = if is_empty b then Eq else Lt.
Lemma compare_x_empty: forall a, is_empty a = true -> forall b, compare_fun b a = if is_empty b then Eq else Gt.
Lemma ct_compare_fun: forall a b c, ct (compare_fun a b) (compare_fun b c) (compare_fun a c).
Lemma lt_trans: forall s s' s'', lt s s' -> lt s' s'' -> lt s s''.
Lemma lt_not_eq: forall s s', lt s s' -> ~ eq s s'.
Lemma add_spec: forall x y s, In y (add x s) <-> x=y \/ In y s.
Lemma add_1: forall s x y, x = y -> In y (add x s).
Lemma add_2: forall s x y, In y s -> In y (add x s).
Lemma add_3: forall s x y, x<>y -> In y (add x s) -> In y s.
Lemma remove_spec: forall x y s, In y (remove x s) <-> x<>y /\ In y s.
Lemma remove_1: forall s x y, x=y -> ~ In y (remove x s).
Lemma remove_2: forall s x y, x<>y -> In y s -> In y (remove x s).
Lemma remove_3: forall s x y, In y (remove x s) -> In y s.
Lemma singleton_1: forall x y, In y (singleton x) -> x=y.
Lemma singleton_2: forall x y, x = y -> In y (singleton x).
Lemma union_spec: forall x s s', In x (union s s') <-> In x s \/ In x s'.
Lemma union_1: forall s s' x, In x (union s s') -> In x s \/ In x s'.
Lemma union_2: forall s s' x, In x s -> In x (union s s').
Lemma union_3: forall s s' x, In x s' -> In x (union s s').
Lemma inter_spec: forall x s s', In x (inter s s') <-> In x s /\ In x s'.
Lemma inter_1: forall s s' x, In x (inter s s') -> In x s.
Lemma inter_2: forall s s' x, In x (inter s s') -> In x s'.
Lemma inter_3: forall s s' x, In x s -> In x s' -> In x (inter s s').
Lemma diff_spec: forall x s s', In x (diff s s') <-> In x s /\ ~ In x s'.
Lemma diff_1: forall s s' x, In x (diff s s') -> In x s.
Lemma diff_2: forall s s' x, In x (diff s s') -> ~ In x s'.
Lemma diff_3: forall s s' x, In x s -> ~ In x s' -> In x (diff s s').
Lemma fold_1: 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_1: 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_1 : forall s x f, @compat_bool elt E.eq f -> In x (filter f s) -> In x s.
Lemma filter_2 : forall s x f, @compat_bool elt E.eq f -> In x (filter f s) -> f x = true.
Lemma filter_3 : forall s x f, @compat_bool elt E.eq f -> In x s -> f x = true -> In x (filter f s).
Lemma xforall_spec: forall f s i, xforall f s i = true <-> For_all (fun x => f (i@x) = true) s.
Lemma for_all_1 : forall s f, @compat_bool elt E.eq f -> For_all (fun x => f x = true) s -> for_all f s = true.
Lemma for_all_2 : 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_1 : forall s f, @compat_bool elt E.eq f -> Exists (fun x => f x = true) s -> exists_ f s = true.
Lemma exists_2 : 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_1 : forall s f, @compat_bool elt E.eq f -> Equal (fst (partition f s)) (filter f s).
Lemma partition_2 : forall s f, @compat_bool elt E.eq f -> Equal (snd (partition f s)) (filter (fun x => negb (f x)) s).
Lemma ct_cxe: forall x, ct (CompOpp x) x Eq.
Lemma ct_xce: forall x, ct x (CompOpp x) Eq.
Lemma ct_lxl: forall x, ct Lt x Lt.
Lemma ct_gxg: forall x, ct Gt x Gt.
Lemma ct_xll: forall x, ct x Lt Lt.
Lemma ct_xgg: forall x, ct x Gt Gt.
Lemma ct_lex: forall u v w u' v' w', ct u v w -> ct u' v' w' -> ct (lex u u') (lex v v') (lex w w').
Lemma ct_compare_bool: forall a b c, ct (compare_bool a b) (compare_bool b c) (compare_bool a c).
Lemma compare_x_Leaf: forall s, compare s Leaf = if is_empty s then Eq else Gt.
Lemma compare_empty_x: forall a, is_empty a = true -> forall b, compare a b = if is_empty b then Eq else Lt.
Lemma compare_x_empty: forall a, is_empty a = true -> forall b, compare b a = if is_empty b then Eq else Gt.
Lemma ct_compare: forall a b c, ct (compare a b) (compare b c) (compare a c).