End Fold.
(** * Cardinal *)
(** ** Characterization of cardinal in terms of fold *)

(* Specifications: *)
Lemma cardinal_fold : forall s, cardinal s = fold (fun _ => S) s 0.
(** ** Old specifications for [cardinal]. *)
Lemma cardinal_0 :
forall s, exists l : list elt,
NoDupA E.eq l /\
(forall x : elt, In x s <-> InA E.eq x l) /\
cardinal s = length l.
Lemma cardinal_1 : forall s, Empty s -> cardinal s = 0.
Lemma cardinal_2 :
forall s s' x, ~ In x s -> Add x s s' -> cardinal s' = S (cardinal s).
Lemma cardinal_fold : forall s, cardinal s = fold (fun _ => S) s 0.
(** ** Old specifications for [cardinal]. *)
Lemma cardinal_0 :
forall s, exists l : list elt,
NoDupA E.eq l /\
(forall x : elt, In x s <-> InA E.eq x l) /\
cardinal s = length l.
Lemma cardinal_1 : forall s, Empty s -> cardinal s = 0.
Lemma cardinal_2 :
forall s s' x, ~ In x s -> Add x s s' -> cardinal s' = S (cardinal s).