proposition: Lemma refine_foldComp_fold : forall A B (st : A) (f : A -> B -> A) (xs : list B), refineEquiv (foldComp (fun st x => ret (f st x)) st xs) (ret (List.fold_left f xs st)).
proof: Proof. intros. generalize dependent st. induction xs; simpl; intros. reflexivity. autorewrite with monad laws. apply IHxs. Qed.
imports: Fiat.Common Fiat.Computation.Core Fiat.Computation.SetoidMorphisms Fiat.ADT