Section SetDenoteLems.
Context (B : Type). Variables (f : clause -> pred B) (b : pred B).
Variable (h : M.t -> clause -> M.t).
Variable (H : forall c cls s, setd f inter b cls s -> f c s ->
setd f inter b (h cls c) s).
Proof with simpl; auto.
revert cls0; induction l... intros s0 [A C] D; apply IHl...
Qed.
Proof with simpl; auto.
rewrite M.fold_spec; intros; apply setd_fold_left; auto.
Qed.
Proof with auto.
intros H1 H2. unfold setd.
apply listd_In_pred; [ | auto]; intros e H3.
assert (H4: M.In e cls1 \/ M.In e cls2) by
(rewrite elements_In in H3; apply M.union_spec; auto).
do 2 rewrite <-elements_In in H4.
destruct H4 as [H4|H4];
[apply listd_In_inv_pred with (l := M.elements cls1)|
apply listd_In_inv_pred with (l := M.elements cls2)]...
Qed.

Lemma setd_add c cls s :
setd f inter b cls s -> f c s -> setd f inter b (M.add c cls) s.