Skip to content

Commit 2c58441

Browse files
committed
Update Prime.v
1 parent b097dec commit 2c58441

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

Prime.v

+9-19
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,20 @@
22
Require Import Relations.
33

44
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.
175

186
From Equations Require Import Equations.
197

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+
2013
(** INTERNAL: Equations binding *)
2114
(** This binds constants to use by Equations, only the sort, true and
2215
false propositions are used by the Derive Invert command. Work is in
2316
progress to use a general registration command as for sigma types below. *)
2417

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.
2919

3020
Register sigmaP as equations.sigmasP.type.
3121
Register sigmaPI as equations.sigmasP.intro.
@@ -61,7 +51,7 @@ Infix "<=" := invert_le.
6151

6252
Infix "<" := (fun n m => S n <= m).
6353

64-
Definition le_0 : forall n, 0 <= n := fun n => I.
54+
Definition le_0 : forall n, 0 <= n := fun n => sI.
6555

6656
Definition le_S : forall {m n}, m <= n -> S m <= S n := fun n m e => e.
6757

@@ -113,7 +103,7 @@ Check eq_refl : invert_Divide =
113103

114104
Infix "|" := invert_Divide (at level 80).
115105

116-
Definition divide_0 n : n | 0 := I.
106+
Definition divide_0 n : n | 0 := sI.
117107

118108
Definition divide_S n m (e: S n <= S m) (H: S n | S m - S n) : S n | S m
119109
:= (e;H).
@@ -168,7 +158,7 @@ Inductive prime (p:nat) : SProp :=
168158
1 < p -> (forall n, (1 <= n) -> (n < p) -> rel_prime n p) -> prime p.
169159

170160
Goal prime 13.
171-
cbn. econstructor. exact I. intro n.
161+
cbn. econstructor. exact sI. intro n.
172162
destruct n. inversion 1. intros _ e. cbn in e.
173163
repeat (try solve [firstorder];
174164
destruct n; [ cbn; repeat econstructor; repeat (destruct x; firstorder) |]).

0 commit comments

Comments
 (0)