proposition: Theorem fold_rec_bis : forall (A:Type)(P : t -> A -> Type)(f : elt -> A -> A)(i:A)(s:t), (forall s s' a, s[=]s' -> P s a -> P s' a) -> (P empty i) -> (forall x a s', In x s -> ~In x s' -> P s' a -> P (add x s') (f x a)) -> P s (fold f s i).
proof: Proof. intros A P f i s Pmorphism Pempty Pstep. apply fold_rec; intros. - apply Pmorphism with empty; auto with set. - rewrite Add_Equal in H1; auto with set. apply Pmorphism with (add x s'); auto with set. Qed.
imports: MSetInterface PeanoNat DecidableTypeEx OrdersLists MSetFacts MSetDecide