Local Definition Comp' : Proper (E.eq==>Logic.eq) (fun x =>negb (f x)).

(* Specifications: *)
Lemma filter_mem: forall s x, mem x (filter f s)=mem x s && f x.
Lemma for_all_filter: forall s, for_all f s=is_empty (filter (fun x => negb (f x)) s).
Lemma exists_filter : forall s, exists_ f s=negb (is_empty (filter f s)).
Lemma partition_filter_1: forall s, equal (fst (partition f s)) (filter f s)=true.
Lemma partition_filter_2: forall s, equal (snd (partition f s)) (filter (fun x => negb (f x)) s)=true.
Lemma filter_add_1 : forall s x, f x = true -> filter f (add x s) [=] add x (filter f s).
Lemma filter_add_2 : forall s x, f x = false -> filter f (add x s) [=] filter f s.
Lemma add_filter_1 : forall s s' x, f x=true -> (Add x s s') -> (Add x (filter f s) (filter f s')).
Lemma add_filter_2 : forall s s' x, f x=false -> (Add x s s') -> filter f s [=] filter f s'.
Lemma union_filter: forall f g, (compat_bool E.eq f) -> (compat_bool E.eq g) -> forall s, union (filter f s) (filter g s) [=] filter (fun x=>orb (f x) (g x)) s.
Lemma filter_union: forall s s', filter f (union s s') [=] union (filter f s) (filter f s').
Lemma for_all_mem_1: forall s, (forall x, (mem x s)=true->(f x)=true) -> (for_all f s)=true.
Lemma for_all_mem_2: forall s, (for_all f s)=true -> forall x,(mem x s)=true -> (f x)=true.
Lemma for_all_mem_3: forall s x,(mem x s)=true -> (f x)=false -> (for_all f s)=false.
Lemma for_all_mem_4: forall s, for_all f s=false -> {x:elt | mem x s=true /\ f x=false}.
Lemma for_all_exists: forall s, exists_ f s = negb (for_all (fun x =>negb (f x)) s).
Lemma exists_mem_1: forall s, (forall x, mem x s=true->f x=false) -> exists_ f s=false.
Lemma exists_mem_2: forall s, exists_ f s=false -> forall x, mem x s=true -> f x=false.
Lemma exists_mem_3: forall s x, mem x s=true -> f x=true -> exists_ f s=true.
Lemma exists_mem_4: forall s, exists_ f s=true -> {x:elt | (mem x s)=true /\ (f x)=true}.