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 compMap_support_app : forall (A B : Set)(eqd : EqDec B)(c : A -> Comp B)(lsa1 lsa2 : list A)(lsb1 lsb2 : list B), In lsb1 (getSupport (compMap _ c lsa1)) -> In lsb2 (getSupport (compMap _ c lsa2)) -> In (lsb1 ++ lsb2) (getSupport (compMap _ c (lsa1 ++ lsa2))).