| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
Require Export Corelib.Classes.SetoidTactics. |
| 12 |
|
| 13 |
Export Morphisms.ProperNotations. |
| 14 |
|
| 15 |
Require Corelib.ssr.ssrsetoid. |
| 16 |
|
| 17 |
(** For backward compatibility *) |
| 18 |
|
| 19 |
Definition Setoid_Theory := @Equivalence. |
| 20 |
Definition Build_Setoid_Theory := @Build_Equivalence. |
| 21 |
|
| 22 |
Register Build_Setoid_Theory as plugins.ring.Build_Setoid_Theory. |
| 23 |
|
| 24 |
Definition Seq_refl A Aeq (s : Setoid_Theory A Aeq) : forall x:A, Aeq x x. |
| 25 |
Proof. |
| 26 |
unfold Setoid_Theory in s. intros ; reflexivity. |
| 27 |
Defined. |
| 28 |
|
| 29 |
Definition Seq_sym A Aeq (s : Setoid_Theory A Aeq) : forall x y:A, Aeq x y -> Aeq y x. |
| 30 |
Proof. |
| 31 |
unfold Setoid_Theory in s. intros ; symmetry ; assumption. |
| 32 |
Defined. |
| 33 |
|
| 34 |
Definition Seq_trans A Aeq (s : Setoid_Theory A Aeq) : forall x y z:A, Aeq x y -> Aeq y z -> Aeq x z. |
| 35 |
Proof. |
| 36 |
unfold Setoid_Theory in s. intros x y z H0 H1 ; transitivity y ; assumption. |
| 37 |
Defined. |
| 38 |
|
| 39 |
(** Some tactics for manipulating Setoid Theory not officially |
| 40 |
declared as Setoid. *) |
| 41 |
|
| 42 |
Ltac trans_st x := |
| 43 |
idtac "trans_st on Setoid_Theory is OBSOLETE"; |
| 44 |
idtac "use transitivity on Equivalence instead"; |
| 45 |
match goal with |
| 46 |
| H : Setoid_Theory _ ?eqA |- ?eqA _ _ => |
| 47 |
apply (Seq_trans _ _ H) with x; auto |
| 48 |
end. |
| 49 |
|
| 50 |
Ltac sym_st := |
| 51 |
idtac "sym_st on Setoid_Theory is OBSOLETE"; |
| 52 |
idtac "use symmetry on Equivalence instead"; |
| 53 |
match goal with |
| 54 |
| H : Setoid_Theory _ ?eqA |- ?eqA _ _ => |
| 55 |
apply (Seq_sym _ _ H); auto |
| 56 |
end. |
| 57 |
|
| 58 |
Ltac refl_st := |
| 59 |
idtac "refl_st on Setoid_Theory is OBSOLETE"; |
| 60 |
idtac "use reflexivity on Equivalence instead"; |
| 61 |
match goal with |
| 62 |
| H : Setoid_Theory _ ?eqA |- ?eqA _ _ => |
| 63 |
apply (Seq_refl _ _ H); auto |
| 64 |
end. |
| 65 |
|
| 66 |
Definition gen_st : forall A : Set, Setoid_Theory _ (@eq A). |
| 67 |
Proof. |
| 68 |
constructor; congruence. |
| 69 |
Qed. |
| 70 |
|