induction n; intuition.
unfold forNats.
unfold compMap.
comp_simp.
simpl.
intuition.
unfold forNats.
fold forNats.
unfold compMap.
fold compMap.
inline_first.
rewrite repeat_unroll_eq.
comp_skip.
inline_first.
case_eq (P x); intuition.
comp_irr_r.
eapply compMap_wf.
intuition.
comp_simp.
simpl.
rewrite H2.
simpl.
reflexivity.
rewrite IHn.
comp_skip.
reflexivity.
comp_simp.
simpl.
rewrite H2.
intuition.
trivial.
trivial.
trivial.
trivial.
Qed.

Theorem compFold_ret_eq :
forall (A B : Set)(eqdb : EqDec B)(ls : list A)(f : B -> A -> B) init,
comp_spec eq
(compFold _ (fun b a => ret (f b a)) init ls)
(ret (fold_left f ls init)).