aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-01-08 14:56:31 +0100
committerGaëtan Gilbert2019-03-14 15:46:16 +0100
commite239e580ac03cb05df8c344be7df6950a5384554 (patch)
tree411db5dfd7bc2640d0262f224b15d03321f26538
parentab8c27c589ea90ac86518cc7c1b513b740190cdc (diff)
Add StrictProp.v with basic SProp related definitions
-rw-r--r--doc/stdlib/index-list.html.template1
-rw-r--r--theories/Init/Logic.v6
-rw-r--r--theories/Logic/StrictProp.v40
3 files changed, 47 insertions, 0 deletions
diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template
index 7b21b67eea..fd79996bb7 100644
--- a/doc/stdlib/index-list.html.template
+++ b/doc/stdlib/index-list.html.template
@@ -33,6 +33,7 @@ through the <tt>Require Import</tt> command.</p>
</dt>
<dd>
theories/Logic/SetIsType.v
+ theories/Logic/StrictProp.v
theories/Logic/Classical_Pred_Type.v
theories/Logic/Classical_Prop.v
(theories/Logic/Classical.v)
diff --git a/theories/Init/Logic.v b/theories/Init/Logic.v
index b607be4f94..1a391ed799 100644
--- a/theories/Init/Logic.v
+++ b/theories/Init/Logic.v
@@ -402,6 +402,12 @@ Section Logic_lemmas.
End equality.
+ Definition eq_sind_r :
+ forall (A:Type) (x:A) (P:A -> SProp), P x -> forall y:A, y = x -> P y.
+ Proof.
+ intros A x P H y H0. elim eq_sym with (1 := H0); assumption.
+ Defined.
+
Definition eq_ind_r :
forall (A:Type) (x:A) (P:A -> Prop), P x -> forall y:A, y = x -> P y.
intros A x P H y H0. elim eq_sym with (1 := H0); assumption.
diff --git a/theories/Logic/StrictProp.v b/theories/Logic/StrictProp.v
new file mode 100644
index 0000000000..99ee54e42f
--- /dev/null
+++ b/theories/Logic/StrictProp.v
@@ -0,0 +1,40 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+(** Utilities for SProp users. *)
+
+Set Universe Polymorphism.
+Set Polymorphic Inductive Cumulativity.
+
+Record Box (A:SProp) : Prop := box { unbox : A }.
+Arguments box {_} _.
+Arguments unbox {_} _.
+
+Inductive Squash (A:Type) : SProp := squash : A -> Squash A.
+Arguments squash {_} _.
+
+Inductive sEmpty : SProp :=.
+
+Inductive sUnit : SProp := stt.
+Definition sUnit_rect (P:sUnit -> Type) (v:P stt) (u:sUnit) : P u := v.
+Definition sUnit_rec (P:sUnit -> Set) (v:P stt) (u:sUnit) : P u := v.
+Definition sUnit_ind (P:sUnit -> Prop) (v:P stt) (u:sUnit) : P u := v.
+
+Set Primitive Projections.
+Record Ssig {A:Type} (P:A->SProp) := Sexists { Spr1 : A; Spr2 : P Spr1 }.
+Arguments Sexists {_} _ _ _.
+Arguments Spr1 {_ _} _.
+Arguments Spr2 {_ _} _.
+
+Lemma Spr1_inj {A P} {a b : @Ssig A P} (e : Spr1 a = Spr1 b) : a = b.
+Proof.
+ destruct a,b;simpl in e.
+ destruct e. reflexivity.
+Defined.