Ltac prog_assoc_r :=
    eapply comp_spec_eq_trans_r; [ idtac | eapply comp_spec_assoc].(* A bounded repeat based on fold. *)
Definition repeatMax(A : Set)(eqd : EqDec A)(c : Comp A)(P : A -> bool) def (n : nat):=
  compFold _ (fun a' i => if (P a') then (ret a') else c) def (allNatsLt n).

Lemma map_f_equal : forall (A B : Set)(f1 f2 : A -> B)(ls1 ls2 : list A), (forall a, f1 a = f2 a) -> ls1 = ls2 -> map f1 ls1 = map f2 ls2.