23914
|
1 |
(* Title: FOL/ex/Quantifiers_Int.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1991 University of Cambridge
|
|
5 |
*)
|
|
6 |
|
|
7 |
header {* First-Order Logic: quantifier examples (intuitionistic version) *}
|
|
8 |
|
|
9 |
theory Quantifiers_Int
|
|
10 |
imports IFOL
|
|
11 |
begin
|
|
12 |
|
|
13 |
lemma "(ALL x y. P(x,y)) --> (ALL y x. P(x,y))"
|
|
14 |
by (tactic "IntPr.fast_tac 1")
|
|
15 |
|
|
16 |
lemma "(EX x y. P(x,y)) --> (EX y x. P(x,y))"
|
|
17 |
by (tactic "IntPr.fast_tac 1")
|
|
18 |
|
|
19 |
|
|
20 |
-- {* Converse is false *}
|
|
21 |
lemma "(ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
|
|
22 |
by (tactic "IntPr.fast_tac 1")
|
|
23 |
|
|
24 |
lemma "(ALL x. P-->Q(x)) <-> (P--> (ALL x. Q(x)))"
|
|
25 |
by (tactic "IntPr.fast_tac 1")
|
|
26 |
|
|
27 |
|
|
28 |
lemma "(ALL x. P(x)-->Q) <-> ((EX x. P(x)) --> Q)"
|
|
29 |
by (tactic "IntPr.fast_tac 1")
|
|
30 |
|
|
31 |
|
|
32 |
text {* Some harder ones *}
|
|
33 |
|
|
34 |
lemma "(EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
|
|
35 |
by (tactic "IntPr.fast_tac 1")
|
|
36 |
|
|
37 |
-- {* Converse is false *}
|
|
38 |
lemma "(EX x. P(x)&Q(x)) --> (EX x. P(x)) & (EX x. Q(x))"
|
|
39 |
by (tactic "IntPr.fast_tac 1")
|
|
40 |
|
|
41 |
|
|
42 |
text {* Basic test of quantifier reasoning *}
|
|
43 |
|
|
44 |
-- {* TRUE *}
|
|
45 |
lemma "(EX y. ALL x. Q(x,y)) --> (ALL x. EX y. Q(x,y))"
|
|
46 |
by (tactic "IntPr.fast_tac 1")
|
|
47 |
|
|
48 |
lemma "(ALL x. Q(x)) --> (EX x. Q(x))"
|
|
49 |
by (tactic "IntPr.fast_tac 1")
|
|
50 |
|
|
51 |
|
|
52 |
text {* The following should fail, as they are false! *}
|
|
53 |
|
|
54 |
lemma "(ALL x. EX y. Q(x,y)) --> (EX y. ALL x. Q(x,y))"
|
|
55 |
apply (tactic "IntPr.fast_tac 1")?
|
|
56 |
oops
|
|
57 |
|
|
58 |
lemma "(EX x. Q(x)) --> (ALL x. Q(x))"
|
|
59 |
apply (tactic "IntPr.fast_tac 1")?
|
|
60 |
oops
|
|
61 |
|
|
62 |
lemma "P(?a) --> (ALL x. P(x))"
|
|
63 |
apply (tactic "IntPr.fast_tac 1")?
|
|
64 |
oops
|
|
65 |
|
|
66 |
lemma "(P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
|
|
67 |
apply (tactic "IntPr.fast_tac 1")?
|
|
68 |
oops
|
|
69 |
|
|
70 |
|
|
71 |
text {* Back to things that are provable \dots *}
|
|
72 |
|
|
73 |
lemma "(ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
|
|
74 |
by (tactic "IntPr.fast_tac 1")
|
|
75 |
|
|
76 |
-- {* An example of why exI should be delayed as long as possible *}
|
|
77 |
lemma "(P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
|
|
78 |
by (tactic "IntPr.fast_tac 1")
|
|
79 |
|
|
80 |
lemma "(ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
|
|
81 |
by (tactic "IntPr.fast_tac 1")
|
|
82 |
|
|
83 |
lemma "(ALL x. Q(x)) --> (EX x. Q(x))"
|
|
84 |
by (tactic "IntPr.fast_tac 1")
|
|
85 |
|
|
86 |
|
|
87 |
text {* Some slow ones *}
|
|
88 |
|
|
89 |
-- {* Principia Mathematica *11.53 *}
|
|
90 |
lemma "(ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
|
|
91 |
by (tactic "IntPr.fast_tac 1")
|
|
92 |
|
|
93 |
(*Principia Mathematica *11.55 *)
|
|
94 |
lemma "(EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
|
|
95 |
by (tactic "IntPr.fast_tac 1")
|
|
96 |
|
|
97 |
(*Principia Mathematica *11.61 *)
|
|
98 |
lemma "(EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
|
|
99 |
by (tactic "IntPr.fast_tac 1")
|
|
100 |
|
|
101 |
end
|