author | kuncar |
Thu, 10 Apr 2014 17:48:15 +0200 | |
changeset 56519 | c1048f5bbb45 |
parent 51717 | 9e7d1c139569 |
child 58889 | 5b7a9633cfa8 |
permissions | -rw-r--r-- |
31974 | 1 |
(* Title: FOL/ex/Classical.thy |
14236 | 2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
3 |
Copyright 1994 University of Cambridge |
|
4 |
*) |
|
5 |
||
6 |
header{*Classical Predicate Calculus Problems*} |
|
7 |
||
16417 | 8 |
theory Classical imports FOL begin |
14236 | 9 |
|
10 |
lemma "(P --> Q | R) --> (P-->Q) | (P-->R)" |
|
11 |
by blast |
|
12 |
||
13 |
text{*If and only if*} |
|
14 |
||
15 |
lemma "(P<->Q) <-> (Q<->P)" |
|
16 |
by blast |
|
17 |
||
18 |
lemma "~ (P <-> ~P)" |
|
19 |
by blast |
|
20 |
||
21 |
||
22 |
text{*Sample problems from |
|
23 |
F. J. Pelletier, |
|
24 |
Seventy-Five Problems for Testing Automatic Theorem Provers, |
|
25 |
J. Automated Reasoning 2 (1986), 191-216. |
|
26 |
Errata, JAR 4 (1988), 236-236. |
|
27 |
||
28 |
The hardest problems -- judging by experience with several theorem provers, |
|
29 |
including matrix ones -- are 34 and 43. |
|
30 |
*} |
|
31 |
||
32 |
subsection{*Pelletier's examples*} |
|
33 |
||
34 |
text{*1*} |
|
35 |
lemma "(P-->Q) <-> (~Q --> ~P)" |
|
36 |
by blast |
|
37 |
||
38 |
text{*2*} |
|
39 |
lemma "~ ~ P <-> P" |
|
40 |
by blast |
|
41 |
||
42 |
text{*3*} |
|
43 |
lemma "~(P-->Q) --> (Q-->P)" |
|
44 |
by blast |
|
45 |
||
46 |
text{*4*} |
|
47 |
lemma "(~P-->Q) <-> (~Q --> P)" |
|
48 |
by blast |
|
49 |
||
50 |
text{*5*} |
|
51 |
lemma "((P|Q)-->(P|R)) --> (P|(Q-->R))" |
|
52 |
by blast |
|
53 |
||
54 |
text{*6*} |
|
55 |
lemma "P | ~ P" |
|
56 |
by blast |
|
57 |
||
58 |
text{*7*} |
|
59 |
lemma "P | ~ ~ ~ P" |
|
60 |
by blast |
|
61 |
||
62 |
text{*8. Peirce's law*} |
|
63 |
lemma "((P-->Q) --> P) --> P" |
|
64 |
by blast |
|
65 |
||
66 |
text{*9*} |
|
67 |
lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)" |
|
68 |
by blast |
|
69 |
||
70 |
text{*10*} |
|
71 |
lemma "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)" |
|
72 |
by blast |
|
73 |
||
74 |
text{*11. Proved in each direction (incorrectly, says Pelletier!!) *} |
|
75 |
lemma "P<->P" |
|
76 |
by blast |
|
77 |
||
78 |
text{*12. "Dijkstra's law"*} |
|
79 |
lemma "((P <-> Q) <-> R) <-> (P <-> (Q <-> R))" |
|
80 |
by blast |
|
81 |
||
82 |
text{*13. Distributive law*} |
|
83 |
lemma "P | (Q & R) <-> (P | Q) & (P | R)" |
|
84 |
by blast |
|
85 |
||
86 |
text{*14*} |
|
87 |
lemma "(P <-> Q) <-> ((Q | ~P) & (~Q|P))" |
|
88 |
by blast |
|
89 |
||
90 |
text{*15*} |
|
91 |
lemma "(P --> Q) <-> (~P | Q)" |
|
92 |
by blast |
|
93 |
||
94 |
text{*16*} |
|
95 |
lemma "(P-->Q) | (Q-->P)" |
|
96 |
by blast |
|
97 |
||
98 |
text{*17*} |
|
99 |
lemma "((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))" |
|
100 |
by blast |
|
101 |
||
102 |
subsection{*Classical Logic: examples with quantifiers*} |
|
103 |
||
104 |
lemma "(\<forall>x. P(x) & Q(x)) <-> (\<forall>x. P(x)) & (\<forall>x. Q(x))" |
|
105 |
by blast |
|
106 |
||
107 |
lemma "(\<exists>x. P-->Q(x)) <-> (P --> (\<exists>x. Q(x)))" |
|
108 |
by blast |
|
109 |
||
110 |
lemma "(\<exists>x. P(x)-->Q) <-> (\<forall>x. P(x)) --> Q" |
|
111 |
by blast |
|
112 |
||
113 |
lemma "(\<forall>x. P(x)) | Q <-> (\<forall>x. P(x) | Q)" |
|
114 |
by blast |
|
115 |
||
116 |
text{*Discussed in Avron, Gentzen-Type Systems, Resolution and Tableaux, |
|
117 |
JAR 10 (265-281), 1993. Proof is trivial!*} |
|
118 |
lemma "~((\<exists>x.~P(x)) & ((\<exists>x. P(x)) | (\<exists>x. P(x) & Q(x))) & ~ (\<exists>x. P(x)))" |
|
119 |
by blast |
|
120 |
||
121 |
subsection{*Problems requiring quantifier duplication*} |
|
122 |
||
123 |
text{*Theorem B of Peter Andrews, Theorem Proving via General Matings, |
|
124 |
JACM 28 (1981).*} |
|
125 |
lemma "(\<exists>x. \<forall>y. P(x) <-> P(y)) --> ((\<exists>x. P(x)) <-> (\<forall>y. P(y)))" |
|
126 |
by blast |
|
127 |
||
128 |
text{*Needs multiple instantiation of ALL.*} |
|
129 |
lemma "(\<forall>x. P(x)-->P(f(x))) & P(d)-->P(f(f(f(d))))" |
|
130 |
by blast |
|
131 |
||
132 |
text{*Needs double instantiation of the quantifier*} |
|
133 |
lemma "\<exists>x. P(x) --> P(a) & P(b)" |
|
134 |
by blast |
|
135 |
||
136 |
lemma "\<exists>z. P(z) --> (\<forall>x. P(x))" |
|
137 |
by blast |
|
138 |
||
139 |
lemma "\<exists>x. (\<exists>y. P(y)) --> P(x)" |
|
140 |
by blast |
|
141 |
||
142 |
text{*V. Lifschitz, What Is the Inverse Method?, JAR 5 (1989), 1--23. NOT PROVED*} |
|
143 |
lemma "\<exists>x x'. \<forall>y. \<exists>z z'. |
|
144 |
(~P(y,y) | P(x,x) | ~S(z,x)) & |
|
145 |
(S(x,y) | ~S(y,z) | Q(z',z')) & |
|
146 |
(Q(x',y) | ~Q(y,z') | S(x',x'))" |
|
147 |
oops |
|
148 |
||
149 |
||
150 |
||
151 |
subsection{*Hard examples with quantifiers*} |
|
152 |
||
153 |
text{*18*} |
|
154 |
lemma "\<exists>y. \<forall>x. P(y)-->P(x)" |
|
155 |
by blast |
|
156 |
||
157 |
text{*19*} |
|
158 |
lemma "\<exists>x. \<forall>y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))" |
|
159 |
by blast |
|
160 |
||
161 |
text{*20*} |
|
162 |
lemma "(\<forall>x y. \<exists>z. \<forall>w. (P(x)&Q(y)-->R(z)&S(w))) |
|
163 |
--> (\<exists>x y. P(x) & Q(y)) --> (\<exists>z. R(z))" |
|
164 |
by blast |
|
165 |
||
166 |
text{*21*} |
|
167 |
lemma "(\<exists>x. P-->Q(x)) & (\<exists>x. Q(x)-->P) --> (\<exists>x. P<->Q(x))" |
|
168 |
by blast |
|
169 |
||
170 |
text{*22*} |
|
171 |
lemma "(\<forall>x. P <-> Q(x)) --> (P <-> (\<forall>x. Q(x)))" |
|
172 |
by blast |
|
173 |
||
174 |
text{*23*} |
|
175 |
lemma "(\<forall>x. P | Q(x)) <-> (P | (\<forall>x. Q(x)))" |
|
176 |
by blast |
|
177 |
||
178 |
text{*24*} |
|
179 |
lemma "~(\<exists>x. S(x)&Q(x)) & (\<forall>x. P(x) --> Q(x)|R(x)) & |
|
180 |
(~(\<exists>x. P(x)) --> (\<exists>x. Q(x))) & (\<forall>x. Q(x)|R(x) --> S(x)) |
|
181 |
--> (\<exists>x. P(x)&R(x))" |
|
182 |
by blast |
|
183 |
||
184 |
text{*25*} |
|
185 |
lemma "(\<exists>x. P(x)) & |
|
186 |
(\<forall>x. L(x) --> ~ (M(x) & R(x))) & |
|
187 |
(\<forall>x. P(x) --> (M(x) & L(x))) & |
|
188 |
((\<forall>x. P(x)-->Q(x)) | (\<exists>x. P(x)&R(x))) |
|
189 |
--> (\<exists>x. Q(x)&P(x))" |
|
190 |
by blast |
|
191 |
||
192 |
text{*26*} |
|
193 |
lemma "((\<exists>x. p(x)) <-> (\<exists>x. q(x))) & |
|
194 |
(\<forall>x. \<forall>y. p(x) & q(y) --> (r(x) <-> s(y))) |
|
195 |
--> ((\<forall>x. p(x)-->r(x)) <-> (\<forall>x. q(x)-->s(x)))" |
|
196 |
by blast |
|
197 |
||
198 |
text{*27*} |
|
199 |
lemma "(\<exists>x. P(x) & ~Q(x)) & |
|
200 |
(\<forall>x. P(x) --> R(x)) & |
|
201 |
(\<forall>x. M(x) & L(x) --> P(x)) & |
|
202 |
((\<exists>x. R(x) & ~ Q(x)) --> (\<forall>x. L(x) --> ~ R(x))) |
|
203 |
--> (\<forall>x. M(x) --> ~L(x))" |
|
204 |
by blast |
|
205 |
||
206 |
text{*28. AMENDED*} |
|
207 |
lemma "(\<forall>x. P(x) --> (\<forall>x. Q(x))) & |
|
208 |
((\<forall>x. Q(x)|R(x)) --> (\<exists>x. Q(x)&S(x))) & |
|
209 |
((\<exists>x. S(x)) --> (\<forall>x. L(x) --> M(x))) |
|
210 |
--> (\<forall>x. P(x) & L(x) --> M(x))" |
|
211 |
by blast |
|
212 |
||
213 |
text{*29. Essentially the same as Principia Mathematica *11.71*} |
|
214 |
lemma "(\<exists>x. P(x)) & (\<exists>y. Q(y)) |
|
215 |
--> ((\<forall>x. P(x)-->R(x)) & (\<forall>y. Q(y)-->S(y)) <-> |
|
216 |
(\<forall>x y. P(x) & Q(y) --> R(x) & S(y)))" |
|
217 |
by blast |
|
218 |
||
219 |
text{*30*} |
|
220 |
lemma "(\<forall>x. P(x) | Q(x) --> ~ R(x)) & |
|
221 |
(\<forall>x. (Q(x) --> ~ S(x)) --> P(x) & R(x)) |
|
222 |
--> (\<forall>x. S(x))" |
|
223 |
by blast |
|
224 |
||
225 |
text{*31*} |
|
226 |
lemma "~(\<exists>x. P(x) & (Q(x) | R(x))) & |
|
227 |
(\<exists>x. L(x) & P(x)) & |
|
228 |
(\<forall>x. ~ R(x) --> M(x)) |
|
229 |
--> (\<exists>x. L(x) & M(x))" |
|
230 |
by blast |
|
231 |
||
232 |
text{*32*} |
|
233 |
lemma "(\<forall>x. P(x) & (Q(x)|R(x))-->S(x)) & |
|
234 |
(\<forall>x. S(x) & R(x) --> L(x)) & |
|
235 |
(\<forall>x. M(x) --> R(x)) |
|
236 |
--> (\<forall>x. P(x) & M(x) --> L(x))" |
|
237 |
by blast |
|
238 |
||
239 |
text{*33*} |
|
240 |
lemma "(\<forall>x. P(a) & (P(x)-->P(b))-->P(c)) <-> |
|
241 |
(\<forall>x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))" |
|
242 |
by blast |
|
243 |
||
244 |
text{*34 AMENDED (TWICE!!). Andrews's challenge*} |
|
245 |
lemma "((\<exists>x. \<forall>y. p(x) <-> p(y)) <-> |
|
246 |
((\<exists>x. q(x)) <-> (\<forall>y. p(y)))) <-> |
|
247 |
((\<exists>x. \<forall>y. q(x) <-> q(y)) <-> |
|
248 |
((\<exists>x. p(x)) <-> (\<forall>y. q(y))))" |
|
249 |
by blast |
|
250 |
||
251 |
text{*35*} |
|
252 |
lemma "\<exists>x y. P(x,y) --> (\<forall>u v. P(u,v))" |
|
253 |
by blast |
|
254 |
||
255 |
text{*36*} |
|
256 |
lemma "(\<forall>x. \<exists>y. J(x,y)) & |
|
257 |
(\<forall>x. \<exists>y. G(x,y)) & |
|
258 |
(\<forall>x y. J(x,y) | G(x,y) --> (\<forall>z. J(y,z) | G(y,z) --> H(x,z))) |
|
259 |
--> (\<forall>x. \<exists>y. H(x,y))" |
|
260 |
by blast |
|
261 |
||
262 |
text{*37*} |
|
263 |
lemma "(\<forall>z. \<exists>w. \<forall>x. \<exists>y. |
|
264 |
(P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (\<exists>u. Q(u,w)))) & |
|
265 |
(\<forall>x z. ~P(x,z) --> (\<exists>y. Q(y,z))) & |
|
266 |
((\<exists>x y. Q(x,y)) --> (\<forall>x. R(x,x))) |
|
267 |
--> (\<forall>x. \<exists>y. R(x,y))" |
|
268 |
by blast |
|
269 |
||
270 |
text{*38*} |
|
271 |
lemma "(\<forall>x. p(a) & (p(x) --> (\<exists>y. p(y) & r(x,y))) --> |
|
272 |
(\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z))) <-> |
|
273 |
(\<forall>x. (~p(a) | p(x) | (\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z))) & |
|
274 |
(~p(a) | ~(\<exists>y. p(y) & r(x,y)) | |
|
275 |
(\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z))))" |
|
276 |
by blast |
|
277 |
||
278 |
text{*39*} |
|
279 |
lemma "~ (\<exists>x. \<forall>y. F(y,x) <-> ~F(y,y))" |
|
280 |
by blast |
|
281 |
||
282 |
text{*40. AMENDED*} |
|
283 |
lemma "(\<exists>y. \<forall>x. F(x,y) <-> F(x,x)) --> |
|
284 |
~(\<forall>x. \<exists>y. \<forall>z. F(z,y) <-> ~ F(z,x))" |
|
285 |
by blast |
|
286 |
||
287 |
text{*41*} |
|
288 |
lemma "(\<forall>z. \<exists>y. \<forall>x. f(x,y) <-> f(x,z) & ~ f(x,x)) |
|
289 |
--> ~ (\<exists>z. \<forall>x. f(x,z))" |
|
290 |
by blast |
|
291 |
||
292 |
text{*42*} |
|
293 |
lemma "~ (\<exists>y. \<forall>x. p(x,y) <-> ~ (\<exists>z. p(x,z) & p(z,x)))" |
|
294 |
by blast |
|
295 |
||
296 |
text{*43*} |
|
297 |
lemma "(\<forall>x. \<forall>y. q(x,y) <-> (\<forall>z. p(z,x) <-> p(z,y))) |
|
298 |
--> (\<forall>x. \<forall>y. q(x,y) <-> q(y,x))" |
|
299 |
by blast |
|
300 |
||
301 |
(*Other proofs: Can use auto, which cheats by using rewriting! |
|
302 |
Deepen_tac alone requires 253 secs. Or |
|
51717
9e7d1c139569
simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents:
42789
diff
changeset
|
303 |
by (mini_tac @{context} 1 THEN Deepen_tac 5 1) *) |
14236 | 304 |
|
305 |
text{*44*} |
|
306 |
lemma "(\<forall>x. f(x) --> (\<exists>y. g(y) & h(x,y) & (\<exists>y. g(y) & ~ h(x,y)))) & |
|
307 |
(\<exists>x. j(x) & (\<forall>y. g(y) --> h(x,y))) |
|
308 |
--> (\<exists>x. j(x) & ~f(x))" |
|
309 |
by blast |
|
310 |
||
311 |
text{*45*} |
|
312 |
lemma "(\<forall>x. f(x) & (\<forall>y. g(y) & h(x,y) --> j(x,y)) |
|
313 |
--> (\<forall>y. g(y) & h(x,y) --> k(y))) & |
|
314 |
~ (\<exists>y. l(y) & k(y)) & |
|
315 |
(\<exists>x. f(x) & (\<forall>y. h(x,y) --> l(y)) |
|
316 |
& (\<forall>y. g(y) & h(x,y) --> j(x,y))) |
|
317 |
--> (\<exists>x. f(x) & ~ (\<exists>y. g(y) & h(x,y)))" |
|
318 |
by blast |
|
319 |
||
320 |
||
321 |
text{*46*} |
|
322 |
lemma "(\<forall>x. f(x) & (\<forall>y. f(y) & h(y,x) --> g(y)) --> g(x)) & |
|
323 |
((\<exists>x. f(x) & ~g(x)) --> |
|
324 |
(\<exists>x. f(x) & ~g(x) & (\<forall>y. f(y) & ~g(y) --> j(x,y)))) & |
|
325 |
(\<forall>x y. f(x) & f(y) & h(x,y) --> ~j(y,x)) |
|
326 |
--> (\<forall>x. f(x) --> g(x))" |
|
327 |
by blast |
|
328 |
||
329 |
||
330 |
subsection{*Problems (mainly) involving equality or functions*} |
|
331 |
||
332 |
text{*48*} |
|
333 |
lemma "(a=b | c=d) & (a=c | b=d) --> a=d | b=c" |
|
334 |
by blast |
|
335 |
||
336 |
text{*49 NOT PROVED AUTOMATICALLY. Hard because it involves substitution |
|
337 |
for Vars |
|
338 |
the type constraint ensures that x,y,z have the same type as a,b,u. *} |
|
339 |
lemma "(\<exists>x y::'a. \<forall>z. z=x | z=y) & P(a) & P(b) & a~=b |
|
340 |
--> (\<forall>u::'a. P(u))" |
|
341 |
apply safe |
|
342 |
apply (rule_tac x = a in allE, assumption) |
|
343 |
apply (rule_tac x = b in allE, assumption, fast) |
|
344 |
--{*blast's treatment of equality can't do it*} |
|
345 |
done |
|
346 |
||
347 |
text{*50. (What has this to do with equality?) *} |
|
348 |
lemma "(\<forall>x. P(a,x) | (\<forall>y. P(x,y))) --> (\<exists>x. \<forall>y. P(x,y))" |
|
349 |
by blast |
|
350 |
||
351 |
text{*51*} |
|
352 |
lemma "(\<exists>z w. \<forall>x y. P(x,y) <-> (x=z & y=w)) --> |
|
353 |
(\<exists>z. \<forall>x. \<exists>w. (\<forall>y. P(x,y) <-> y=w) <-> x=z)" |
|
354 |
by blast |
|
355 |
||
356 |
text{*52*} |
|
357 |
text{*Almost the same as 51. *} |
|
358 |
lemma "(\<exists>z w. \<forall>x y. P(x,y) <-> (x=z & y=w)) --> |
|
359 |
(\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P(x,y) <-> x=z) <-> y=w)" |
|
360 |
by blast |
|
361 |
||
362 |
text{*55*} |
|
363 |
||
364 |
text{*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988). |
|
365 |
fast DISCOVERS who killed Agatha. *} |
|
36319 | 366 |
schematic_lemma "lives(agatha) & lives(butler) & lives(charles) & |
14236 | 367 |
(killed(agatha,agatha) | killed(butler,agatha) | killed(charles,agatha)) & |
368 |
(\<forall>x y. killed(x,y) --> hates(x,y) & ~richer(x,y)) & |
|
369 |
(\<forall>x. hates(agatha,x) --> ~hates(charles,x)) & |
|
370 |
(hates(agatha,agatha) & hates(agatha,charles)) & |
|
371 |
(\<forall>x. lives(x) & ~richer(x,agatha) --> hates(butler,x)) & |
|
372 |
(\<forall>x. hates(agatha,x) --> hates(butler,x)) & |
|
373 |
(\<forall>x. ~hates(x,agatha) | ~hates(x,butler) | ~hates(x,charles)) --> |
|
374 |
killed(?who,agatha)" |
|
375 |
by fast --{*MUCH faster than blast*} |
|
376 |
||
377 |
||
378 |
text{*56*} |
|
379 |
lemma "(\<forall>x. (\<exists>y. P(y) & x=f(y)) --> P(x)) <-> (\<forall>x. P(x) --> P(f(x)))" |
|
380 |
by blast |
|
381 |
||
382 |
text{*57*} |
|
383 |
lemma "P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & |
|
384 |
(\<forall>x y z. P(x,y) & P(y,z) --> P(x,z)) --> P(f(a,b), f(a,c))" |
|
385 |
by blast |
|
386 |
||
387 |
text{*58 NOT PROVED AUTOMATICALLY*} |
|
388 |
lemma "(\<forall>x y. f(x)=g(y)) --> (\<forall>x y. f(f(x))=f(g(y)))" |
|
389 |
by (slow elim: subst_context) |
|
390 |
||
391 |
||
392 |
text{*59*} |
|
393 |
lemma "(\<forall>x. P(x) <-> ~P(f(x))) --> (\<exists>x. P(x) & ~P(f(x)))" |
|
394 |
by blast |
|
395 |
||
396 |
text{*60*} |
|
397 |
lemma "\<forall>x. P(x,f(x)) <-> (\<exists>y. (\<forall>z. P(z,y) --> P(z,f(x))) & P(x,y))" |
|
398 |
by blast |
|
399 |
||
400 |
text{*62 as corrected in JAR 18 (1997), page 135*} |
|
401 |
lemma "(\<forall>x. p(a) & (p(x) --> p(f(x))) --> p(f(f(x)))) <-> |
|
402 |
(\<forall>x. (~p(a) | p(x) | p(f(f(x)))) & |
|
403 |
(~p(a) | ~p(f(x)) | p(f(f(x)))))" |
|
404 |
by blast |
|
405 |
||
406 |
text{*From Davis, Obvious Logical Inferences, IJCAI-81, 530-531 |
|
407 |
fast indeed copes!*} |
|
408 |
lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) & |
|
409 |
(\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y))) & |
|
410 |
(\<forall>x. K(x) --> ~G(x)) --> (\<exists>x. K(x) & J(x))" |
|
411 |
by fast |
|
412 |
||
413 |
text{*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393. |
|
414 |
It does seem obvious!*} |
|
415 |
lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) & |
|
416 |
(\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y))) & |
|
417 |
(\<forall>x. K(x) --> ~G(x)) --> (\<exists>x. K(x) --> ~G(x))" |
|
418 |
by fast |
|
419 |
||
420 |
text{*Halting problem: Formulation of Li Dafa (AAR Newsletter 27, Oct 1994.) |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
31974
diff
changeset
|
421 |
author U. Egly*} |
14236 | 422 |
lemma "((\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z)))) --> |
423 |
(\<exists>w. C(w) & (\<forall>y. C(y) --> (\<forall>z. D(w,y,z))))) |
|
424 |
& |
|
425 |
(\<forall>w. C(w) & (\<forall>u. C(u) --> (\<forall>v. D(w,u,v))) --> |
|
426 |
(\<forall>y z. |
|
427 |
(C(y) & P(y,z) --> Q(w,y,z) & OO(w,g)) & |
|
428 |
(C(y) & ~P(y,z) --> Q(w,y,z) & OO(w,b)))) |
|
429 |
& |
|
430 |
(\<forall>w. C(w) & |
|
431 |
(\<forall>y z. |
|
432 |
(C(y) & P(y,z) --> Q(w,y,z) & OO(w,g)) & |
|
433 |
(C(y) & ~P(y,z) --> Q(w,y,z) & OO(w,b))) --> |
|
434 |
(\<exists>v. C(v) & |
|
435 |
(\<forall>y. ((C(y) & Q(w,y,y)) & OO(w,g) --> ~P(v,y)) & |
|
436 |
((C(y) & Q(w,y,y)) & OO(w,b) --> P(v,y) & OO(v,b))))) |
|
437 |
--> |
|
438 |
~ (\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z))))" |
|
42789 | 439 |
by (blast 12) |
14236 | 440 |
--{*Needed because the search for depths below 12 is very slow*} |
441 |
||
442 |
||
443 |
text{*Halting problem II: credited to M. Bruschi by Li Dafa in JAR 18(1), p.105*} |
|
444 |
lemma "((\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z)))) --> |
|
445 |
(\<exists>w. C(w) & (\<forall>y. C(y) --> (\<forall>z. D(w,y,z))))) |
|
446 |
& |
|
447 |
(\<forall>w. C(w) & (\<forall>u. C(u) --> (\<forall>v. D(w,u,v))) --> |
|
448 |
(\<forall>y z. |
|
449 |
(C(y) & P(y,z) --> Q(w,y,z) & OO(w,g)) & |
|
450 |
(C(y) & ~P(y,z) --> Q(w,y,z) & OO(w,b)))) |
|
451 |
& |
|
452 |
((\<exists>w. C(w) & (\<forall>y. (C(y) & P(y,y) --> Q(w,y,y) & OO(w,g)) & |
|
453 |
(C(y) & ~P(y,y) --> Q(w,y,y) & OO(w,b)))) |
|
454 |
--> |
|
455 |
(\<exists>v. C(v) & (\<forall>y. (C(y) & P(y,y) --> P(v,y) & OO(v,g)) & |
|
456 |
(C(y) & ~P(y,y) --> P(v,y) & OO(v,b))))) |
|
457 |
--> |
|
458 |
((\<exists>v. C(v) & (\<forall>y. (C(y) & P(y,y) --> P(v,y) & OO(v,g)) & |
|
459 |
(C(y) & ~P(y,y) --> P(v,y) & OO(v,b)))) |
|
460 |
--> |
|
461 |
(\<exists>u. C(u) & (\<forall>y. (C(y) & P(y,y) --> ~P(u,y)) & |
|
462 |
(C(y) & ~P(y,y) --> P(u,y) & OO(u,b))))) |
|
463 |
--> |
|
464 |
~ (\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z))))" |
|
465 |
by blast |
|
466 |
||
467 |
text{* Challenge found on info-hol *} |
|
468 |
lemma "\<forall>x. \<exists>v w. \<forall>y z. P(x) & Q(y) --> (P(v) | R(w)) & (R(z) --> Q(v))" |
|
469 |
by blast |
|
470 |
||
471 |
text{*Attributed to Lewis Carroll by S. G. Pulman. The first or last assumption |
|
472 |
can be deleted.*} |
|
473 |
lemma "(\<forall>x. honest(x) & industrious(x) --> healthy(x)) & |
|
474 |
~ (\<exists>x. grocer(x) & healthy(x)) & |
|
475 |
(\<forall>x. industrious(x) & grocer(x) --> honest(x)) & |
|
476 |
(\<forall>x. cyclist(x) --> industrious(x)) & |
|
477 |
(\<forall>x. ~healthy(x) & cyclist(x) --> ~honest(x)) |
|
478 |
--> (\<forall>x. grocer(x) --> ~cyclist(x))" |
|
479 |
by blast |
|
480 |
||
481 |
||
482 |
(*Runtimes for old versions of this file: |
|
483 |
Thu Jul 23 1992: loaded in 467s using iffE [on SPARC2] |
|
484 |
Mon Nov 14 1994: loaded in 144s [on SPARC10, with deepen_tac] |
|
485 |
Wed Nov 16 1994: loaded in 138s [after addition of norm_term_skip] |
|
486 |
Mon Nov 21 1994: loaded in 131s [DEPTH_FIRST suppressing repetitions] |
|
487 |
||
488 |
Further runtimes on a Sun-4 |
|
489 |
Tue Mar 4 1997: loaded in 93s (version 94-7) |
|
490 |
Tue Mar 4 1997: loaded in 89s |
|
491 |
Thu Apr 3 1997: loaded in 44s--using mostly Blast_tac |
|
492 |
Thu Apr 3 1997: loaded in 96s--addition of two Halting Probs |
|
493 |
Thu Apr 3 1997: loaded in 98s--using lim-1 for all haz rules |
|
494 |
Tue Dec 2 1997: loaded in 107s--added 46; new equalSubst |
|
495 |
Fri Dec 12 1997: loaded in 91s--faster proof reconstruction |
|
496 |
Thu Dec 18 1997: loaded in 94s--two new "obvious theorems" (??) |
|
497 |
*) |
|
498 |
||
499 |
end |
|
500 |