| 1 |
Require Import ListDef Morphisms Setoid. |
| 2 |
|
| 3 |
Global Generalizable All Variables. |
| 4 |
|
| 5 |
Class Equiv A := equiv: relation A. |
| 6 |
|
| 7 |
Section ops. |
| 8 |
Context (M : Type -> Type). |
| 9 |
|
| 10 |
Class MonadReturn := ret: forall {A}, A -> M A. |
| 11 |
|
| 12 |
End ops. |
| 13 |
|
| 14 |
Arguments ret {M MonadReturn A} _. |
| 15 |
|
| 16 |
|
| 17 |
Class Monad (M : Type -> Type) `{forall A, Equiv A -> Equiv (M A)} |
| 18 |
`{MonadReturn M} : Prop := |
| 19 |
{ |
| 20 |
mon_ret_proper `{Equiv A} :: Proper (equiv ==> equiv) (@ret _ _ A) |
| 21 |
}. |
| 22 |
|
| 23 |
|
| 24 |
Section S. |
| 25 |
Context `{Equivalence A eqA}. |
| 26 |
|
| 27 |
Inductive PermutationA : list A -> list A -> Prop := . |
| 28 |
|
| 29 |
Global Instance: Equivalence PermutationA. |
| 30 |
Admitted. |
| 31 |
|
| 32 |
Global Instance PermutationA_cons : |
| 33 |
Proper (eqA ==> PermutationA ==> PermutationA) (@cons A). |
| 34 |
Admitted. |
| 35 |
|
| 36 |
Lemma foo a l x (IHl : PermutationA (x::l) (l ++ (x :: nil))) : PermutationA (x::a::l) (a::l++(x :: nil)). |
| 37 |
Proof. |
| 38 |
rewrite <-IHl. |
| 39 |
Abort. |
| 40 |
End S. |