|
2 | 2 | Require Import Relations.
|
3 | 3 |
|
4 | 4 | Set Primitive Projections.
|
5 |
| -Record sigmaP {A : SProp} {B : A -> SProp} : SProp := sigmaPI { prP1 : A; prP2 : B prP1 }. |
6 |
| - |
7 |
| -Arguments sigmaP A B : clear implicits. |
8 |
| -Arguments sigmaPI {A} B prP1 prP2. |
9 |
| - |
10 |
| -Notation "{ x : A & P }" := (sigmaP A (fun x => P)) : type_scope. |
11 |
| -Notation "x .1" := (prP1 x) (at level 3). |
12 |
| -Notation "x .2" := (prP2 x) (at level 3). |
13 |
| -Notation " ( x ; p ) " := (sigmaPI _ x p). |
14 |
| - |
15 |
| -Inductive sFalse : SProp := . |
16 |
| -Inductive sTrue : SProp := I : sTrue. |
17 | 5 |
|
18 | 6 | From Equations Require Import Equations.
|
19 | 7 |
|
| 8 | +Notation "{ x : A & P }" := (sigmaSP A (fun x => P)) : type_scope. |
| 9 | +Notation "x .1" := (prSP1 x) (at level 3). |
| 10 | +Notation "x .2" := (prSP2 x) (at level 3). |
| 11 | +Notation " ( x ; p ) " := (sigmaSPI _ x p). |
| 12 | + |
20 | 13 | (** INTERNAL: Equations binding *)
|
21 | 14 | (** This binds constants to use by Equations, only the sort, true and
|
22 | 15 | false propositions are used by the Derive Invert command. Work is in
|
23 | 16 | progress to use a general registration command as for sigma types below. *)
|
24 | 17 |
|
25 |
| -Equations Logic |
26 |
| - SProp Id Id_rect Id_rect_r Id_rect_dep_r |
27 |
| - sFalse sTrue I prod pair |
28 |
| - relation clos_trans WellFounded well_founded. |
| 18 | +Require Import Equations.ConstantsSProp. |
29 | 19 |
|
30 | 20 | Register sigmaP as equations.sigmasP.type.
|
31 | 21 | Register sigmaPI as equations.sigmasP.intro.
|
@@ -61,7 +51,7 @@ Infix "<=" := invert_le.
|
61 | 51 |
|
62 | 52 | Infix "<" := (fun n m => S n <= m).
|
63 | 53 |
|
64 |
| -Definition le_0 : forall n, 0 <= n := fun n => I. |
| 54 | +Definition le_0 : forall n, 0 <= n := fun n => sI. |
65 | 55 |
|
66 | 56 | Definition le_S : forall {m n}, m <= n -> S m <= S n := fun n m e => e.
|
67 | 57 |
|
@@ -113,7 +103,7 @@ Check eq_refl : invert_Divide =
|
113 | 103 |
|
114 | 104 | Infix "|" := invert_Divide (at level 80).
|
115 | 105 |
|
116 |
| -Definition divide_0 n : n | 0 := I. |
| 106 | +Definition divide_0 n : n | 0 := sI. |
117 | 107 |
|
118 | 108 | Definition divide_S n m (e: S n <= S m) (H: S n | S m - S n) : S n | S m
|
119 | 109 | := (e;H).
|
@@ -168,7 +158,7 @@ Inductive prime (p:nat) : SProp :=
|
168 | 158 | 1 < p -> (forall n, (1 <= n) -> (n < p) -> rel_prime n p) -> prime p.
|
169 | 159 |
|
170 | 160 | Goal prime 13.
|
171 |
| - cbn. econstructor. exact I. intro n. |
| 161 | + cbn. econstructor. exact sI. intro n. |
172 | 162 | destruct n. inversion 1. intros _ e. cbn in e.
|
173 | 163 | repeat (try solve [firstorder];
|
174 | 164 | destruct n; [ cbn; repeat econstructor; repeat (destruct x; firstorder) |]).
|
|
0 commit comments