*)

Lemma semFoldGen_right :
forall {A B : Type} (f : A -> B -> G A) (bs : list B) (a0 : A) (s : nat),
semGenSize (foldGen f bs a0) s <-->
[ set an |
foldr (fun b p => [set a_prev | exists a, a \in (semGenSize (f a_prev b) s :&: p)])
[set an] bs a0].