src/FOLP/ex/Quantifiers_Int.thy
 author wenzelm Fri Apr 23 23:35:43 2010 +0200 (2010-04-23) changeset 36319 8feb2c4bef1a parent 35762 af3ff2ba4c54 child 58963 26bf09b95dda permissions -rw-r--r--
mark schematic statements explicitly;
1 (*  Title:      FOLP/ex/Quantifiers_Int.thy
2     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
3     Copyright   1991  University of Cambridge
5 First-Order Logic: quantifier examples (intuitionistic and classical)
6 Needs declarations of the theory "thy" and the tactic "tac".
7 *)
9 theory Quantifiers_Int
10 imports IFOLP
11 begin
13 schematic_lemma "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
14   by (tactic {* IntPr.fast_tac 1 *})
16 schematic_lemma "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
17   by (tactic {* IntPr.fast_tac 1 *})
20 (*Converse is false*)
21 schematic_lemma "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
22   by (tactic {* IntPr.fast_tac 1 *})
24 schematic_lemma "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
25   by (tactic {* IntPr.fast_tac 1 *})
28 schematic_lemma "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
29   by (tactic {* IntPr.fast_tac 1 *})
32 text "Some harder ones"
34 schematic_lemma "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
35   by (tactic {* IntPr.fast_tac 1 *})
37 (*Converse is false*)
38 schematic_lemma "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
39   by (tactic {* IntPr.fast_tac 1 *})
42 text "Basic test of quantifier reasoning"
43 (*TRUE*)
44 schematic_lemma "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
45   by (tactic {* IntPr.fast_tac 1 *})
47 schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
48   by (tactic {* IntPr.fast_tac 1 *})
51 text "The following should fail, as they are false!"
53 schematic_lemma "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
54   apply (tactic {* IntPr.fast_tac 1 *})?
55   oops
57 schematic_lemma "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
58   apply (tactic {* IntPr.fast_tac 1 *})?
59   oops
61 schematic_lemma "?p : P(?a) --> (ALL x. P(x))"
62   apply (tactic {* IntPr.fast_tac 1 *})?
63   oops
65 schematic_lemma "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
66   apply (tactic {* IntPr.fast_tac 1 *})?
67   oops
70 text "Back to things that are provable..."
72 schematic_lemma "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
73   by (tactic {* IntPr.fast_tac 1 *})
76 (*An example of why exI should be delayed as long as possible*)
77 schematic_lemma "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
78   by (tactic {* IntPr.fast_tac 1 *})
80 schematic_lemma "?p : (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 *})
83 schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
84   by (tactic {* IntPr.fast_tac 1 *})
87 text "Some slow ones"
89 (*Principia Mathematica *11.53  *)
90 schematic_lemma "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
91   by (tactic {* IntPr.fast_tac 1 *})
93 (*Principia Mathematica *11.55  *)
94 schematic_lemma "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
95   by (tactic {* IntPr.fast_tac 1 *})
97 (*Principia Mathematica *11.61  *)
98 schematic_lemma "?p : (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 *})
101 end