Section Fold_More.
Variables (A:Type)(eqA:A->A->Prop)(st:Equivalence eqA).
Variables (f:elt->A->A)(Comp:compat_op E.eq 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 : fset.
(** ** Cardinal is a morphism *)
Add Morphism cardinal with signature (Equal ==> Logic.eq) as cardinal_m.
Hint Resolve Add_add Add_remove Equal_remove cardinal_inv_1 Equal_cardinal : fset.
(** ** Cardinal and set operators *)
Hint Immediate empty_cardinal cardinal_1 : set.
Hint Resolve singleton_cardinal: set.

Lemma add_cardinal_2 :
forall s x, ~In x s -> cardinal (add x s) = S (cardinal s).