-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkuroda.dk
258 lines (206 loc) · 12.1 KB
/
kuroda.dk
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
(; Base of the encoding ;)
Prop : Type.
injective Prf : Prop -> Type.
Set : Type.
injective El : Set -> Type.
(; Higher order ;)
o : Set.
[ ] El o --> Prop.
fun : Set -> Set -> Set.
[x,y] El (fun x y) --> El x -> El y.
(; Connectives and quantifiers ;)
imp : Prop -> Prop -> Prop.
and : Prop -> Prop -> Prop.
or : Prop -> Prop -> Prop.
top : Prop.
bot : Prop.
all : a : Set -> (El a -> Prop) -> Prop.
ex : a : Set -> (El a -> Prop) -> Prop.
not : Prop -> Prop.
def iff := p : Prop => q : Prop => and (imp p q) (imp q p).
(; Intuitionistic natural deduction rules ;)
imp_i : p : Prop -> q : Prop -> (Prf p -> Prf q) -> Prf (imp p q).
imp_e : p : Prop -> q : Prop -> Prf (imp p q) -> Prf p -> Prf q.
and_i : p : Prop -> Prf p -> q : Prop -> Prf q -> Prf (and p q).
and_el : p : Prop -> q : Prop -> Prf (and p q) -> Prf p.
and_er : p : Prop -> q : Prop -> Prf (and p q) -> Prf q.
or_il : p : Prop -> Prf p -> q : Prop -> Prf (or p q).
or_ir : p : Prop -> q : Prop -> Prf q -> Prf (or p q).
or_e : p : Prop -> q : Prop -> Prf (or p q) -> r : Prop -> (Prf p -> Prf r) -> (Prf q -> Prf r) -> Prf r.
neg_i : p : Prop -> (Prf p -> Prf bot) -> Prf (not p).
neg_e : p : Prop -> Prf (not p) -> Prf p -> Prf bot.
top_i : Prf top.
bot_e : Prf bot -> p : Prop -> Prf p.
all_i : a : Set -> p : (El a -> Prop) -> (x : El a -> Prf (p x)) -> Prf (all a p).
all_e : a : Set -> p : (El a -> Prop) -> Prf (all a p) -> x : El a -> Prf (p x).
ex_i : a : Set -> p : (El a -> Prop) -> t : El a -> Prf (p t) -> Prf (ex a p).
ex_e : a : Set -> p : (El a -> Prop) -> Prf (ex a p) -> r : Prop -> (x : El a -> Prf (p x) -> Prf r) -> Prf r.
(; Some results about double negations ;)
thm prop_double_neg : p : Prop -> Prf (imp p (not (not p)))
:= p => imp_i p (not (not p)) (pP => neg_i (not p) (pNP => neg_e p pNP pP)).
thm prop_neg_imp : p : Prop -> q : Prop -> Prf (imp (imp p q) (imp (not q) (not p)))
:= p => q => imp_i (imp p q) (imp (not q) (not p))
(pPQ => imp_i (not q) (not p) (pNQ => neg_i p (pP => neg_e q pNQ (imp_e p q pPQ pP)))).
thm prop_neg_imp1 : p : Prop -> q : Prop -> Prf (imp (imp (not (not p)) (not (not q))) (not (not (imp p q))))
:= p => q =>
imp_i (imp (not (not p)) (not (not q))) (not (not (imp p q)))
(pPQ => neg_i (not (imp p q))
(pNPQ => neg_e (imp p q) pNPQ
(imp_i p q
(pP => bot_e
(neg_e (not q)
(imp_e (not (not p)) (not (not q)) pPQ (imp_e p (not (not p)) (prop_double_neg p) pP))
(neg_i q (pQ => neg_e (imp p q) pNPQ (imp_i p q (_ => pQ)))))
q)))).
thm prop_neg_imp2 : p : Prop -> q : Prop -> Prf (imp (not (not (imp p q))) (imp (not (not p)) (not (not q))))
:= p => q =>
imp_i (not (not (imp p q))) (imp (not (not p)) (not (not q)))
(pNNPQ => imp_i (not (not p)) (not (not q))
(pNNP => neg_i (not q)
(pNQ => neg_e (not (imp p q)) pNNPQ
(neg_i (imp p q) (pPQ => neg_e (not p) pNNP (neg_i p (pP => neg_e q pNQ (imp_e p q pPQ pP)))))))).
thm prop_neg_and1 : p : Prop -> q : Prop -> Prf (imp (and (not (not p)) (not (not q))) (not (not (and p q))))
:= p => q => imp_i (and (not (not p)) (not (not q))) (not (not (and p q)))
(pNNPQ => neg_i (not (and p q))
(pNPQ => neg_e (not q)
(and_er (not (not p)) (not (not q)) pNNPQ)
(neg_i q (pQ => neg_e (not p)
(and_el (not (not p)) (not (not q)) pNNPQ)
(neg_i p (pP => neg_e (and p q) pNPQ (and_i p pP q pQ))))))).
thm prop_neg_and2 : p : Prop -> q : Prop -> Prf (imp (not (not (and p q))) (and (not (not p)) (not (not q))))
:= p => q => imp_i (not (not (and p q))) (and (not (not p)) (not (not q)))
(pNNPQ => and_i
(not (not p))
(neg_i (not p)
(pNP => neg_e (not (and p q)) pNNPQ
(neg_i (and p q) (pPQ => neg_e p pNP (and_el p q pPQ)))))
(not (not q))
(neg_i (not q)
(pNQ => neg_e (not (and p q)) pNNPQ
(neg_i (and p q) (pPQ => neg_e q pNQ (and_er p q pPQ)))))).
thm prop_neg_or1 : p : Prop -> q : Prop -> Prf (imp (not (or p q)) (and (not p) (not q)))
:= p => q => imp_i (not (or p q)) (and (not p) (not q))
(pNPQ => and_i
(not p)
(neg_i p (pP => neg_e (or p q) pNPQ (or_il p pP q)))
(not q)
(neg_i q (pQ => neg_e (or p q) pNPQ (or_ir p q pQ)))).
thm prop_neg_or2 : p : Prop -> q : Prop -> Prf (imp (and (not p) (not q)) (not (or p q)))
:= p => q => imp_i (and (not p) (not q)) (not (or p q))
(pNPQ => neg_i (or p q)
(pPQ => or_e p q pPQ bot
(pP => neg_e p (and_el (not p) (not q) pNPQ) pP)
(pQ => neg_e q (and_er (not p) (not q) pNPQ) pQ))).
thm prop_neg_all : a : Set -> p : (El a -> Prop) -> Prf (imp (not (not (all a p))) (all a (x : (El a) => (not (not (p x))))))
:= a => p => imp_i (not (not (all a p))) (all a (x => not (not (p x))))
(pNNP => all_i a (x => not (not (p x)))
(x => neg_i (not (p x))
(pNP => neg_e (not (all a p)) pNNP
(neg_i (all a p)
(pP => neg_e (p x) pNP (all_e a p pP x)))))).
thm prop_neg_elim1 : a : Set -> p : (El a -> Prop) -> Prf (imp (not (ex a p)) (all a (x : (El a) => (not (p x)))))
:= a => p => imp_i (not (ex a p)) (all a (x => not (p x)))
(pNP => all_i a (x => not (p x))
(x => neg_i (p x)
(pP => neg_e (ex a p) pNP (ex_i a p x pP)))).
thm prop_neg_elim2 : a : Set -> p : (El a -> Prop) -> Prf (imp (all a (x : (El a) => (not (p x)))) (not (ex a p)))
:= a => p =>
imp_i (all a (x => not (p x))) (not (ex a p))
(pNP => neg_i (ex a p)
(pP => ex_e a p pP bot
(t => pPt => neg_e (p t) (all_e a (x => not (p x)) pNP t) pPt))).
thm prop_triple_neg : p : Prop -> Prf (imp (not (not (not p))) (not p))
:= p => imp_i (not (not (not p))) (not p)
(pNNNP => neg_i p (pP => neg_e (not (not p)) pNNNP (imp_e p (not (not p)) (prop_double_neg p) pP))).
thm prop_neg_bot : Prf (imp (not (not bot)) bot)
:= imp_i (not (not bot)) bot (pB => neg_e (not bot) pB (neg_i bot (pN => pN))).
thm prop_neg_top : Prf (imp (not (not top)) top)
:= imp_i (not (not top)) top (_ => top_i).
(; Kuroda's translation ;)
thm imp_i_i : p : Prop -> q : Prop -> (Prf (not (not p)) -> Prf (not (not q))) -> Prf (not (not (imp p q)))
:= p => q => pPQ => imp_e (imp (not (not p)) (not (not q))) (not (not (imp p q)))
(prop_neg_imp1 p q)
(imp_i (not (not p)) (not (not q)) pPQ).
thm imp_e_i : p : Prop -> q : Prop -> Prf (not (not (imp p q))) -> Prf (not (not p)) -> Prf (not (not q))
:= p => q => pPQ => imp_e (not (not p)) (not (not q))
(imp_e (not (not (imp p q))) (imp (not (not p)) (not (not q))) (prop_neg_imp2 p q) pPQ).
thm and_i_i : p : Prop -> Prf (not (not p)) -> q : Prop -> Prf (not (not q)) -> Prf (not (not (and p q)))
:= p => pP => q => pQ => imp_e (and (not (not p)) (not (not q))) (not (not (and p q)))
(prop_neg_and1 p q)
(and_i (not (not p)) pP (not (not q)) pQ).
thm and_el_i : p : Prop -> q : Prop -> Prf (not (not (and p q))) -> Prf (not (not p))
:= p => q => pPQ => and_el (not (not p)) (not (not q))
(imp_e (not (not (and p q))) (and (not (not p)) (not (not q))) (prop_neg_and2 p q) pPQ).
thm and_er_i : p : Prop -> q : Prop -> Prf (not (not (and p q))) -> Prf (not (not q))
:= p => q => pPQ => and_er (not (not p)) (not (not q))
(imp_e (not (not (and p q))) (and (not (not p)) (not (not q))) (prop_neg_and2 p q) pPQ).
thm or_il_i : p : Prop -> Prf (not (not p)) -> q : Prop -> Prf (not (not (or p q)))
:= p => pP => q => neg_i (not (or p q))
(pPQ => neg_e (not p) pP
(and_el (not p) (not q) (imp_e (not (or p q)) (and (not p) (not q)) (prop_neg_or1 p q) pPQ))).
thm or_ir_i : p : Prop -> q : Prop -> Prf (not (not q)) -> Prf (not (not (or p q)))
:= p=> q => pQ => neg_i (not (or p q))
(pPQ => neg_e (not q) pQ
(and_er (not p) (not q) (imp_e (not (or p q)) (and (not p) (not q)) (prop_neg_or1 p q) pPQ))).
thm or_e_i : p : Prop -> q : Prop -> Prf (not (not (or p q))) -> r : Prop -> (Prf (not (not p)) -> Prf (not (not r))) -> (Prf (not (not q)) -> Prf (not (not r))) -> Prf (not (not r))
:= p => q => pPQ => r => pPR => pQR => neg_i (not r)
(pR => neg_e (not (and (not p) (not q)))
(imp_e (and (not (not (not p))) (not (not (not q)))) (not (not (and (not p) (not q))))
(prop_neg_and1 (not p) (not q))
(and_i
(not (not (not p)))
(neg_i (not (not p)) (pP => neg_e (not r) (pPR pP) pR))
(not (not (not q)))
(neg_i (not (not q)) (pQ => neg_e (not r) (pQR pQ) pR))))
(imp_e (not (not (or p q))) (not (and (not p) (not q)))
(imp_e (imp (and (not p) (not q)) (not (or p q))) (imp (not (not (or p q))) (not (and (not p) (not q))))
(prop_neg_imp (and (not p) (not q)) (not (or p q)))
(imp_i (and (not p) (not q)) (not (or p q))
(pNPNQ => imp_e (and (not p) (not q)) (not (or p q)) (prop_neg_or2 p q) pNPNQ)))
pPQ)).
thm neg_i_i : p : Prop -> (Prf (not (not p)) -> Prf (not (not bot))) -> Prf (not (not (not p)))
:= p => pP => neg_i (not (not p)) (pN => imp_e (not (not bot)) bot (prop_neg_bot) (pP pN)).
thm neg_e_i : p : Prop -> Prf (not (not (not p))) -> Prf (not (not p)) -> Prf (not (not bot))
:= p => pNP => pP => imp_e bot (not (not bot)) (prop_double_neg bot) (neg_e (not (not p)) pNP pP).
thm top_i_i : Prf (not (not top))
:= imp_e top (not (not top)) (prop_double_neg top) top_i.
thm bot_e_i : Prf (not (not bot)) -> p : Prop -> Prf (not (not p))
:= pB => p => bot_e (imp_e (not (not bot)) bot (prop_neg_bot) pB) (not (not p)).
thm all_i_i : a : Set -> p : (El a -> Prop) -> (x : (El a) -> Prf (not (not (p x)))) -> Prf (not (not (all a (x : (El a) => not (not (p x))))))
:= a => p => pPx => imp_e (all a (x : (El a) => not (not (p x)))) (not (not (all a (x : (El a) => not (not (p x))))))
(prop_double_neg (all a (x : (El a) => not (not (p x)))))
(all_i a (x => not (not (p x))) (x => pPx x)).
thm all_e_i : a : Set -> p : (El a -> Prop) -> Prf (not (not (all a (x : (El a) => not (not (p x)))))) -> x : (El a) -> Prf (not (not (p x)))
:= a => p => pP => t => imp_e (not (not (not (not (p t))))) (not (not (p t)))
(prop_triple_neg (not (p t)))
(all_e a (x => not (not (not (not (p x)))))
(imp_e (not (not (all a (x => not (not (p x))))))
(all a (x => not (not (not (not (p x))))))
(prop_neg_all a (x => not (not (p x)))) pP)
t).
thm ex_i_i : a : Set -> p : (El a -> Prop) -> t : (El a) -> Prf (not (not (p t))) -> Prf (not (not (ex a p)))
:= a => p => t => pP => imp_e (not (all a (x => not (p x)))) (not (not (ex a p)))
(imp_e (imp (not (ex a p)) (all a (x => not (p x)))) (imp (not (all a (x => not (p x)))) (not (not (ex a p))))
(prop_neg_imp (not (ex a p)) (all a (x => not (p x))))
(prop_neg_elim1 a p))
(neg_i (all a (x => not (p x)))
(pNP => neg_e (not (p t)) pP (all_e a (x => not (p x)) pNP t))).
thm ex_e_i : a : Set -> p : (El a -> Prop) -> Prf (not (not (ex a p))) -> r : Prop -> (x : (El a) -> Prf (not (not (p x))) -> Prf (not (not r))) -> Prf (not (not r))
:= a => p => pP => r => pPR => neg_i (not r)
(pR => neg_e (not (all a (x => not (p x))))
(imp_e (all a (x => not (p x))) (not (not (all a (x => not (p x)))))
(prop_double_neg (all a (x => not (p x))))
(all_i a (x => not (p x))
(x => imp_e (not (not (not (p x)))) (not (p x))
(prop_triple_neg (p x))
(neg_i (not (not (p x))) (pNP => neg_e (not r) (pPR x pNP) pR)))))
(imp_e (not (not (ex a p))) (not (all a (x => not (p x))))
(imp_e (imp (all a (x => not (p x))) (not (ex a p))) (imp (not (not (ex a p))) (not (all a (x => not (p x)))))
(prop_neg_imp (all a (x => not (p x))) (not (ex a p)))
(prop_neg_elim2 a p))
pP)).
thm pem_i : p : Prop -> Prf (not (not (or p (not p))))
:= p => neg_i (not (or p (not p)))
(pNPNP => neg_e (or p (not p)) pNPNP
(or_ir p (not p)
(neg_i p (pP => neg_e (or p (not p)) pNPNP (or_il p pP (not p)))))).