| 1 |
Require Import Setoid. |
| 2 |
|
| 3 |
Section SetoidBug. |
| 4 |
|
| 5 |
Variable ms : Type. |
| 6 |
Variable ms_type : ms -> Type. |
| 7 |
Variable ms_eq : forall (A:ms), relation (ms_type A). |
| 8 |
|
| 9 |
Variable CR : ms. |
| 10 |
|
| 11 |
Record Ring : Type := |
| 12 |
{Ring_type : Type}. |
| 13 |
|
| 14 |
Variable foo : forall (A:Ring), nat -> Ring_type A. |
| 15 |
Variable IR : Ring. |
| 16 |
Variable IRasCR : Ring_type IR -> ms_type CR. |
| 17 |
|
| 18 |
Definition CRasCRing : Ring := Build_Ring (ms_type CR). |
| 19 |
|
| 20 |
Hypothesis ms_refl : forall A x, ms_eq A x x. |
| 21 |
Hypothesis ms_sym : forall A x y, ms_eq A x y -> ms_eq A y x. |
| 22 |
Hypothesis ms_trans : forall A x y z, ms_eq A x y -> ms_eq A y z -> ms_eq A x z. |
| 23 |
|
| 24 |
Add Parametric Relation A : (ms_type A) (ms_eq A) |
| 25 |
reflexivity proved by (ms_refl A) |
| 26 |
symmetry proved by (ms_sym A) |
| 27 |
transitivity proved by (ms_trans A) |
| 28 |
as ms_Setoid. |
| 29 |
|
| 30 |
Hypothesis foobar : forall n, ms_eq CR (IRasCR (foo IR n)) (foo CRasCRing n). |
| 31 |
|
| 32 |
Goal forall (b:ms_type CR), |
| 33 |
ms_eq CR (IRasCR (foo IR O)) b -> |
| 34 |
ms_eq CR (IRasCR (foo IR O)) b. |
| 35 |
intros b H. |
| 36 |
rewrite foobar. |
| 37 |
rewrite foobar in H. |
| 38 |
assumption. |
| 39 |
Qed. |
| 40 |
|
| 41 |
End SetoidBug. |