Section Fold_More.
Variables (A:Type)(eqA:A->A->Prop)(st:Equivalence eqA).
Variables (f:elt->A->A)(Comp:Proper (E.eq==>eqA==>eqA) f)(Ass:transpose eqA f).
(** ** Fold is a morphism *)
(** ** Fold and other set operators *)
End Fold_More.
End Fold.
(** * Cardinal *)
(** ** Characterization of cardinal in terms of fold *)
(** ** Old specifications for [cardinal]. *)
(** ** Cardinal and (non-)emptiness *)
Hint Resolve cardinal_inv_1 : core.
(** ** Cardinal is a morphism *)
Instance cardinal_m : Proper (Equal==>Logic.eq) cardinal.
Hint Resolve Add_add Add_remove Equal_remove cardinal_inv_1 Equal_cardinal : core.
(** ** Cardinal and set operators *)
Hint Immediate empty_cardinal cardinal_1 : set.
Hint Resolve singleton_cardinal: set.

Lemma union_cardinal_inter :
forall s s', cardinal (union s s') = cardinal s + cardinal s' - cardinal (inter s s').