(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* β) : f =∙= g -> Π l, eqβ (f l) (g l). Proof. intros. apply H0. Qed. Program Instance list_monad : ! Monad list_setoid := join α := concat. Next Obligation. Proof. unfold concat_map, composeS. simpl. clear_subset_proofs. intro l. simpl. induction l ; auto; simpl. constructor. unfold compose in *. simpl. rewrite <- IHl. rewrite (map_app f). reflexivity. Qed. Next Obligation. Proof. intro x ; simpl. unfold compose. induction x ; simpl ; trivial. reflexivity. simpl. rewrite IHx. reflexivity. Qed. Next Obligation. Proof. intro x ; simpl. unfold compose ; induction x ; auto. reflexivity. simpl in *. rewrite IHx. reflexivity. Qed. Next Obligation. Proof. intro x ; simpl. unfold compose. induction x ; subst ; auto. reflexivity. simpl ; rewrite <- IHx. typeclass_app concat_app. Qed. Require Import Prelude.MonadPlus. Program Instance list_monad_zero : ! MonadZero list_setoid := mzero A := nil. Next Obligation. Proof. reduce. unfold const. reflexivity. Qed. Next Obligation. Proof. reduce. unfold constS, const, flip. induction x ; compute ; auto. Qed. Program Instance list_monad_plus : ! MonadPlus list_setoid := mplus A x y := x ++ y. Next Obligation. Proof. constructor ; reduce ; autosimpl. reflexivity. unfold flip. typeclass_app right_neutral. Qed.