-
Notifications
You must be signed in to change notification settings - Fork 9
/
SPropBase.v
76 lines (53 loc) · 1.75 KB
/
SPropBase.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
(*From Coq Require Export Logic.StrictProp.*)
(*This file was originally referring to SProp. Not anymore*)
From SSProve.Mon Require Import Base.
From mathcomp Require Import ssreflect.
From Coq Require ClassicalFacts.
Axiom ax_proof_irrel : ClassicalFacts.proof_irrelevance.
Set Primitive Projections.
Module Redefined_sprop_constructs.
Record Box (A:Prop) : Prop := box { unbox : A }.
End Redefined_sprop_constructs.
Export Redefined_sprop_constructs.
(** Conjunction *)
Definition sand := and.
Module SPropNotations.
Notation "⦑ t ⦒" := (exist _ t _).
Notation " x ∙1" := (proj1_sig x) (at level 2).
Notation " x ∙2" := (proj2_sig x) (at level 2).
End SPropNotations.
Section sigLemmas.
Lemma sig_eq {A} (P : A -> Prop) :
forall (mx my : sig P), proj1_sig mx = proj1_sig my -> mx = my.
Proof.
intros [cx ex] [cy ey]. simpl.
induction 1.
have hintUnif : ex = ey.
by apply ax_proof_irrel.
rewrite hintUnif. reflexivity.
Defined.
Lemma transport_sig :
forall {A B} (F : B -> A -> Prop) {x y} h z,
eq_rect x (fun x => sig (fun b => F b x)) z y h
= exist _ (proj1_sig z) (@eq_ind A x (F (proj1_sig z)) (proj2_sig z) y h).
Proof.
intros.
dependent inversion h. compute. destruct z. reflexivity.
Qed.
Lemma eq_above_sig {A B} (F : B -> A -> Prop)
(G := fun x => sig (fun b => F b x)) {x1 x2 : A} {h : x1 = x2}
{z1 : G x1} {z2 : G x2} :
proj1_sig z1 = proj1_sig z2 -> z1 =⟨ h ⟩ z2.
Proof.
intro Hz.
unfold eq_above.
unfold G.
rewrite (transport_sig F h z1).
apply sig_eq.
assumption.
Qed.
End sigLemmas.
Module SPropAxioms.
Import SPropNotations.
Axiom sprop_ext : forall {p q : Prop}, p = q <-> Box (sand (p -> q) (q -> p)).
End SPropAxioms.