author | kleing |
Tue, 02 Mar 2004 01:32:23 +0100 | |
changeset 14422 | b8da5f258b04 |
parent 14156 | 2072802ab0e3 |
child 15019 | acf67fa30998 |
permissions | -rw-r--r-- |
9487 | 1 |
(* Title: FOL/FOL.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson and Markus Wenzel |
|
11678 | 4 |
*) |
9487 | 5 |
|
11678 | 6 |
header {* Classical first-order logic *} |
4093 | 7 |
|
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
5887
diff
changeset
|
8 |
theory FOL = IFOL |
9487 | 9 |
files |
10 |
("FOL_lemmas1.ML") ("cladata.ML") ("blastdata.ML") |
|
11 |
("simpdata.ML") ("FOL_lemmas2.ML"): |
|
12 |
||
13 |
||
14 |
subsection {* The classical axiom *} |
|
4093 | 15 |
|
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
5887
diff
changeset
|
16 |
axioms |
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
5887
diff
changeset
|
17 |
classical: "(~P ==> P) ==> P" |
4093 | 18 |
|
9487 | 19 |
|
11678 | 20 |
subsection {* Lemmas and proof tools *} |
9487 | 21 |
|
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
5887
diff
changeset
|
22 |
use "FOL_lemmas1.ML" |
12127
219e543496a3
theorems case_split = case_split_thm [case_names True False, cases type: o];
wenzelm
parents:
11988
diff
changeset
|
23 |
theorems case_split = case_split_thm [case_names True False, cases type: o] |
9525 | 24 |
|
10383 | 25 |
use "cladata.ML" |
26 |
setup Cla.setup |
|
14156 | 27 |
setup cla_setup |
28 |
setup case_setup |
|
10383 | 29 |
|
9487 | 30 |
use "blastdata.ML" |
31 |
setup Blast.setup |
|
13550 | 32 |
|
33 |
||
34 |
lemma ex1_functional: "[| EX! z. P(a,z); P(a,b); P(a,c) |] ==> b = c" |
|
35 |
by blast |
|
36 |
||
37 |
ML {* |
|
38 |
val ex1_functional = thm "ex1_functional"; |
|
39 |
*} |
|
9487 | 40 |
|
41 |
use "simpdata.ML" |
|
42 |
setup simpsetup |
|
43 |
setup "Simplifier.method_setup Splitter.split_modifiers" |
|
44 |
setup Splitter.setup |
|
45 |
setup Clasimp.setup |
|
46 |
||
14085 | 47 |
subsection {* Other simple lemmas *} |
48 |
||
49 |
lemma [simp]: "((P-->R) <-> (Q-->R)) <-> ((P<->Q) | R)" |
|
50 |
by blast |
|
51 |
||
52 |
lemma [simp]: "((P-->Q) <-> (P-->R)) <-> (P --> (Q<->R))" |
|
53 |
by blast |
|
54 |
||
55 |
lemma not_disj_iff_imp: "~P | Q <-> (P-->Q)" |
|
56 |
by blast |
|
57 |
||
58 |
(** Monotonicity of implications **) |
|
59 |
||
60 |
lemma conj_mono: "[| P1-->Q1; P2-->Q2 |] ==> (P1&P2) --> (Q1&Q2)" |
|
61 |
by fast (*or (IntPr.fast_tac 1)*) |
|
62 |
||
63 |
lemma disj_mono: "[| P1-->Q1; P2-->Q2 |] ==> (P1|P2) --> (Q1|Q2)" |
|
64 |
by fast (*or (IntPr.fast_tac 1)*) |
|
65 |
||
66 |
lemma imp_mono: "[| Q1-->P1; P2-->Q2 |] ==> (P1-->P2)-->(Q1-->Q2)" |
|
67 |
by fast (*or (IntPr.fast_tac 1)*) |
|
68 |
||
69 |
lemma imp_refl: "P-->P" |
|
70 |
by (rule impI, assumption) |
|
71 |
||
72 |
(*The quantifier monotonicity rules are also intuitionistically valid*) |
|
73 |
lemma ex_mono: "(!!x. P(x) --> Q(x)) ==> (EX x. P(x)) --> (EX x. Q(x))" |
|
74 |
by blast |
|
75 |
||
76 |
lemma all_mono: "(!!x. P(x) --> Q(x)) ==> (ALL x. P(x)) --> (ALL x. Q(x))" |
|
77 |
by blast |
|
78 |
||
11678 | 79 |
|
80 |
subsection {* Proof by cases and induction *} |
|
81 |
||
82 |
text {* Proper handling of non-atomic rule statements. *} |
|
83 |
||
84 |
constdefs |
|
85 |
induct_forall :: "('a => o) => o" |
|
86 |
"induct_forall(P) == \<forall>x. P(x)" |
|
87 |
induct_implies :: "o => o => o" |
|
88 |
"induct_implies(A, B) == A --> B" |
|
89 |
induct_equal :: "'a => 'a => o" |
|
90 |
"induct_equal(x, y) == x = y" |
|
91 |
||
92 |
lemma induct_forall_eq: "(!!x. P(x)) == Trueprop(induct_forall(\<lambda>x. P(x)))" |
|
93 |
by (simp only: atomize_all induct_forall_def) |
|
94 |
||
95 |
lemma induct_implies_eq: "(A ==> B) == Trueprop(induct_implies(A, B))" |
|
96 |
by (simp only: atomize_imp induct_implies_def) |
|
97 |
||
98 |
lemma induct_equal_eq: "(x == y) == Trueprop(induct_equal(x, y))" |
|
99 |
by (simp only: atomize_eq induct_equal_def) |
|
100 |
||
11988 | 101 |
lemma induct_impliesI: "(A ==> B) ==> induct_implies(A, B)" |
102 |
by (simp add: induct_implies_def) |
|
103 |
||
12164
0b219d9e3384
induct_atomize: include atomize_conj (for mutual induction);
wenzelm
parents:
12160
diff
changeset
|
104 |
lemmas induct_atomize = atomize_conj induct_forall_eq induct_implies_eq induct_equal_eq |
0b219d9e3384
induct_atomize: include atomize_conj (for mutual induction);
wenzelm
parents:
12160
diff
changeset
|
105 |
lemmas induct_rulify1 [symmetric, standard] = induct_forall_eq induct_implies_eq induct_equal_eq |
11678 | 106 |
lemmas induct_rulify2 = induct_forall_def induct_implies_def induct_equal_def |
107 |
||
12240 | 108 |
lemma all_conj_eq: "(ALL x. P(x)) & (ALL y. Q(y)) == (ALL x y. P(x) & Q(y))" |
109 |
by simp |
|
110 |
||
11678 | 111 |
hide const induct_forall induct_implies induct_equal |
112 |
||
113 |
||
114 |
text {* Method setup. *} |
|
115 |
||
116 |
ML {* |
|
117 |
structure InductMethod = InductMethodFun |
|
118 |
(struct |
|
119 |
val dest_concls = FOLogic.dest_concls; |
|
120 |
val cases_default = thm "case_split"; |
|
11988 | 121 |
val local_impI = thm "induct_impliesI"; |
11678 | 122 |
val conjI = thm "conjI"; |
123 |
val atomize = thms "induct_atomize"; |
|
124 |
val rulify1 = thms "induct_rulify1"; |
|
125 |
val rulify2 = thms "induct_rulify2"; |
|
12240 | 126 |
val localize = [Thm.symmetric (thm "induct_implies_def"), |
127 |
Thm.symmetric (thm "atomize_all"), thm "all_conj_eq"]; |
|
11678 | 128 |
end); |
129 |
*} |
|
130 |
||
131 |
setup InductMethod.setup |
|
132 |
||
4854 | 133 |
end |