summaryrefslogtreecommitdiff
path: root/theories/Setoids
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
committerGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
commit6b649aba925b6f7462da07599fe67ebb12a3460e (patch)
tree43656bcaa51164548f3fa14e5b10de5ef1088574 /theories/Setoids
Imported Upstream version 8.0pl1upstream/8.0pl1
Diffstat (limited to 'theories/Setoids')
-rw-r--r--theories/Setoids/Setoid.v71
1 files changed, 71 insertions, 0 deletions
diff --git a/theories/Setoids/Setoid.v b/theories/Setoids/Setoid.v
new file mode 100644
index 00000000..63f21fed
--- /dev/null
+++ b/theories/Setoids/Setoid.v
@@ -0,0 +1,71 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(*i $Id: Setoid.v,v 1.5.2.1 2004/07/16 19:31:17 herbelin Exp $: i*)
+
+Section Setoid.
+
+Variable A : Type.
+Variable Aeq : A -> A -> Prop.
+
+Record Setoid_Theory : Prop :=
+ {Seq_refl : forall x:A, Aeq x x;
+ Seq_sym : forall x y:A, Aeq x y -> Aeq y x;
+ Seq_trans : forall x y z:A, Aeq x y -> Aeq y z -> Aeq x z}.
+
+End Setoid.
+
+Definition Prop_S : Setoid_Theory Prop iff.
+split; [ exact iff_refl | exact iff_sym | exact iff_trans ].
+Qed.
+
+Add Setoid Prop iff Prop_S.
+
+Hint Resolve (Seq_refl Prop iff Prop_S): setoid.
+Hint Resolve (Seq_sym Prop iff Prop_S): setoid.
+Hint Resolve (Seq_trans Prop iff Prop_S): setoid.
+
+Add Morphism or : or_ext.
+intros.
+inversion H1.
+left.
+inversion H.
+apply (H3 H2).
+
+right.
+inversion H0.
+apply (H3 H2).
+Qed.
+
+Add Morphism and : and_ext.
+intros.
+inversion H1.
+split.
+inversion H.
+apply (H4 H2).
+
+inversion H0.
+apply (H4 H3).
+Qed.
+
+Add Morphism not : not_ext.
+red in |- *; intros.
+apply H0.
+inversion H.
+apply (H3 H1).
+Qed.
+
+Definition fleche (A B:Prop) := A -> B.
+
+Add Morphism fleche : fleche_ext.
+unfold fleche in |- *.
+intros.
+inversion H0.
+inversion H.
+apply (H3 (H1 (H6 H2))).
+Qed.