summaryrefslogtreecommitdiff
path: root/theories/Logic/Eqdep_dec.v
diff options
context:
space:
mode:
Diffstat (limited to 'theories/Logic/Eqdep_dec.v')
-rw-r--r--theories/Logic/Eqdep_dec.v32
1 files changed, 19 insertions, 13 deletions
diff --git a/theories/Logic/Eqdep_dec.v b/theories/Logic/Eqdep_dec.v
index 0281916e..fc1c4a97 100644
--- a/theories/Logic/Eqdep_dec.v
+++ b/theories/Logic/Eqdep_dec.v
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(*i $Id: Eqdep_dec.v 10144 2007-09-26 15:12:17Z vsiles $ i*)
+(*i $Id$ i*)
(** We prove that there is only one proof of [x=x], i.e [refl_equal x].
This holds if the equality upon the set of [x] is decidable.
@@ -38,7 +38,7 @@ Set Implicit Arguments.
Section EqdepDec.
Variable A : Type.
-
+
Let comp (x y y':A) (eq1:x = y) (eq2:x = y') : y = y' :=
eq_ind _ (fun a => a = y') eq2 _ eq1.
@@ -49,7 +49,7 @@ Section EqdepDec.
Qed.
Variable eq_dec : forall x y:A, x = y \/ x <> y.
-
+
Variable x : A.
Let nu (y:A) (u:x = y) : x = y :=
@@ -63,13 +63,13 @@ Section EqdepDec.
unfold nu in |- *.
case (eq_dec x y); intros.
reflexivity.
-
+
case n; trivial.
Qed.
Let nu_inv (y:A) (v:x = y) : x = y := comp (nu (refl_equal x)) v.
-
+
Remark nu_left_inv : forall (y:A) (u:x = y), nu_inv (nu u) = u.
Proof.
@@ -88,7 +88,7 @@ Section EqdepDec.
reflexivity.
Qed.
- Theorem K_dec :
+ Theorem K_dec :
forall P:x = x -> Prop, P (refl_equal x) -> forall p:x = x, P p.
Proof.
intros.
@@ -118,10 +118,10 @@ Section EqdepDec.
case (eq_dec x x).
intro e.
elim e using K_dec; trivial.
-
+
intros.
case n; trivial.
-
+
case H.
reflexivity.
Qed.
@@ -165,6 +165,12 @@ Theorem eq_dep_eq_dec :
forall (P:A->Type) (p:A) (x y:P p), eq_dep A P p x p y -> x = y.
Proof (fun A eq_dec => eq_rect_eq__eq_dep_eq A (eq_rect_eq_dec eq_dec)).
+Theorem UIP_dec :
+ forall (A:Type),
+ (forall x y:A, {x = y} + {x <> y}) ->
+ forall (x y:A) (p1 p2:x = y), p1 = p2.
+Proof (fun A eq_dec => eq_dep_eq__UIP A (eq_dep_eq_dec eq_dec)).
+
Unset Implicit Arguments.
(************************************************************************)
@@ -173,13 +179,13 @@ Unset Implicit Arguments.
(** The signature of decidable sets in [Type] *)
Module Type DecidableType.
-
+
Parameter U:Type.
Axiom eq_dec : forall x y:U, {x = y} + {x <> y}.
End DecidableType.
-(** The module [DecidableEqDep] collects equality properties for decidable
+(** The module [DecidableEqDep] collects equality properties for decidable
set in [Type] *)
Module DecidableEqDep (M:DecidableType).
@@ -247,7 +253,7 @@ Module Type DecidableSet.
End DecidableSet.
-(** The module [DecidableEqDepSet] collects equality properties for decidable
+(** The module [DecidableEqDepSet] collects equality properties for decidable
set in [Set] *)
Module DecidableEqDepSet (M:DecidableSet).
@@ -307,11 +313,11 @@ End DecidableEqDepSet.
(** From decidability to inj_pair2 **)
Lemma inj_pair2_eq_dec : forall A:Type, (forall x y:A, {x=y}+{x<>y}) ->
( forall (P:A -> Type) (p:A) (x y:P p), existT P p x = existT P p y -> x = y ).
-Proof.
+Proof.
intros A eq_dec.
apply eq_dep_eq__inj_pair2.
apply eq_rect_eq__eq_dep_eq.
- unfold Eq_rect_eq.
+ unfold Eq_rect_eq.
apply eq_rect_eq_dec.
apply eq_dec.
Qed.