induction 1; intuition; simpl in *; intuition.
eapply well_formed_Bind; intuition.
eapply IHwell_formed_oc; intuition.
eapply well_formed_Bind; intuition.
eapply well_formed_Ret.
eapply well_formed_Ret.
eapply well_formed_Bind; intuition.
eapply well_formed_Ret.
eapply well_formed_Bind; intuition.
destruct b.
eauto.
Qed.

(* Specifications: *)
Theorem repeat_fission :
forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(c : Comp A)(P : A -> bool)(f : A -> Comp B) x,
well_formed_comp c ->
(exists a, In a (filter P (getSupport c))) ->
(forall a, In a (getSupport c) -> well_formed_comp (f a)) ->
evalDist (a <-$ Repeat c P; b <-$ f a; ret (a, b)) x ==
evalDist
(Repeat (a <-$ c; b <-$ f a; ret (a, b)) (fun p => P (fst p))) x.