(** The black depth of [treeify l] is actually a log2, but
    we don't need to mention that. *)

#[global]
Instance treeify_rb l : Rbt (treeify l).(** ** Filtering *)

#[global]
Instance filter_rb f s : Rbt (filter f s).#[global]
Instance partition_rb1 f s : Rbt (fst (partition f s)).#[global]
Instance partition_rb2 f s : Rbt (snd (partition f s)).(** ** Union, intersection, difference *)

#[global]
Instance fold_add_rb s1 s2 : Rbt s2 -> Rbt (fold add s1 s2).#[global]
Instance fold_remove_rb s1 s2 : Rbt s2 -> Rbt (fold remove s1 s2).

Lemma inter_rb s1 s2 : Rbt s1 -> Rbt s2 -> Rbt (inter s1 s2).