author | paulson |
Fri, 11 Sep 1998 18:09:54 +0200 | |
changeset 5484 | e9430ed7e8d6 |
parent 5325 | f7a5e06adea1 |
child 5618 | 721671c68324 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/ex/prop-log.ML |
0 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Tobias Nipkow & Lawrence C Paulson |
0 | 4 |
Copyright 1992 University of Cambridge |
5 |
||
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
6 |
Inductive definition of propositional logic. |
0 | 7 |
Soundness and completeness w.r.t. truth-tables. |
8 |
||
9 |
Prove: If H|=p then G|=p where G:Fin(H) |
|
10 |
*) |
|
11 |
||
12 |
open PropLog; |
|
13 |
||
14 |
(*** prop_rec -- by Vset recursion ***) |
|
15 |
||
16 |
(** conversion rules **) |
|
17 |
||
5068 | 18 |
Goal "prop_rec(Fls,b,c,d) = b"; |
0 | 19 |
by (rtac (prop_rec_def RS def_Vrec RS trans) 1); |
515 | 20 |
by (rewrite_goals_tac prop.con_defs); |
2469 | 21 |
by (Simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
22 |
qed "prop_rec_Fls"; |
0 | 23 |
|
5068 | 24 |
Goal "prop_rec(#v,b,c,d) = c(v)"; |
0 | 25 |
by (rtac (prop_rec_def RS def_Vrec RS trans) 1); |
515 | 26 |
by (rewrite_goals_tac prop.con_defs); |
2469 | 27 |
by (Simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
28 |
qed "prop_rec_Var"; |
0 | 29 |
|
5068 | 30 |
Goal "prop_rec(p=>q,b,c,d) = \ |
0 | 31 |
\ d(p, q, prop_rec(p,b,c,d), prop_rec(q,b,c,d))"; |
32 |
by (rtac (prop_rec_def RS def_Vrec RS trans) 1); |
|
515 | 33 |
by (rewrite_goals_tac prop.con_defs); |
7
268f93ab3bc4
Installation of new simplifier for ZF/ex. The hom_ss example in misc.ML is
lcp
parents:
0
diff
changeset
|
34 |
by (simp_tac rank_ss 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
35 |
qed "prop_rec_Imp"; |
0 | 36 |
|
2469 | 37 |
Addsimps [prop_rec_Fls, prop_rec_Var, prop_rec_Imp]; |
0 | 38 |
|
39 |
(*** Semantics of propositional logic ***) |
|
40 |
||
41 |
(** The function is_true **) |
|
42 |
||
5068 | 43 |
Goalw [is_true_def] "is_true(Fls,t) <-> False"; |
4091 | 44 |
by (simp_tac (simpset() addsimps [one_not_0 RS not_sym]) 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
45 |
qed "is_true_Fls"; |
0 | 46 |
|
5068 | 47 |
Goalw [is_true_def] "is_true(#v,t) <-> v:t"; |
4091 | 48 |
by (simp_tac (simpset() addsimps [one_not_0 RS not_sym] |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
49 |
setloop (split_tac [split_if])) 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
50 |
qed "is_true_Var"; |
0 | 51 |
|
5068 | 52 |
Goalw [is_true_def] |
0 | 53 |
"is_true(p=>q,t) <-> (is_true(p,t)-->is_true(q,t))"; |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
54 |
by (simp_tac (simpset() setloop (split_tac [split_if])) 1); |
760 | 55 |
qed "is_true_Imp"; |
0 | 56 |
|
57 |
(** The function hyps **) |
|
58 |
||
5068 | 59 |
Goalw [hyps_def] "hyps(Fls,t) = 0"; |
2469 | 60 |
by (Simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
61 |
qed "hyps_Fls"; |
0 | 62 |
|
5068 | 63 |
Goalw [hyps_def] "hyps(#v,t) = {if(v:t, #v, #v=>Fls)}"; |
2469 | 64 |
by (Simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
65 |
qed "hyps_Var"; |
0 | 66 |
|
5068 | 67 |
Goalw [hyps_def] "hyps(p=>q,t) = hyps(p,t) Un hyps(q,t)"; |
2469 | 68 |
by (Simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
69 |
qed "hyps_Imp"; |
0 | 70 |
|
2469 | 71 |
Addsimps prop.intrs; |
72 |
Addsimps [is_true_Fls, is_true_Var, is_true_Imp, |
|
73 |
hyps_Fls, hyps_Var, hyps_Imp]; |
|
0 | 74 |
|
75 |
(*** Proof theory of propositional logic ***) |
|
76 |
||
5137 | 77 |
Goalw thms.defs "G<=H ==> thms(G) <= thms(H)"; |
0 | 78 |
by (rtac lfp_mono 1); |
515 | 79 |
by (REPEAT (rtac thms.bnd_mono 1)); |
0 | 80 |
by (REPEAT (ares_tac (univ_mono::basic_monos) 1)); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
81 |
qed "thms_mono"; |
0 | 82 |
|
515 | 83 |
val thms_in_pl = thms.dom_subset RS subsetD; |
0 | 84 |
|
515 | 85 |
val ImpE = prop.mk_cases prop.con_defs "p=>q : prop"; |
0 | 86 |
|
515 | 87 |
(*Stronger Modus Ponens rule: no typechecking!*) |
5137 | 88 |
Goal "[| H |- p=>q; H |- p |] ==> H |- q"; |
515 | 89 |
by (rtac thms.MP 1); |
0 | 90 |
by (REPEAT (eresolve_tac [asm_rl, thms_in_pl, thms_in_pl RS ImpE] 1)); |
760 | 91 |
qed "thms_MP"; |
0 | 92 |
|
93 |
(*Rule is called I for Identity Combinator, not for Introduction*) |
|
5137 | 94 |
Goal "p:prop ==> H |- p=>p"; |
515 | 95 |
by (rtac (thms.S RS thms_MP RS thms_MP) 1); |
96 |
by (rtac thms.K 5); |
|
97 |
by (rtac thms.K 4); |
|
98 |
by (REPEAT (ares_tac prop.intrs 1)); |
|
760 | 99 |
qed "thms_I"; |
0 | 100 |
|
101 |
(** Weakening, left and right **) |
|
102 |
||
103 |
(* [| G<=H; G|-p |] ==> H|-p Order of premises is convenient with RS*) |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
104 |
bind_thm ("weaken_left", (thms_mono RS subsetD)); |
0 | 105 |
|
106 |
(* H |- p ==> cons(a,H) |- p *) |
|
107 |
val weaken_left_cons = subset_consI RS weaken_left; |
|
108 |
||
109 |
val weaken_left_Un1 = Un_upper1 RS weaken_left; |
|
110 |
val weaken_left_Un2 = Un_upper2 RS weaken_left; |
|
111 |
||
5137 | 112 |
Goal "[| H |- q; p:prop |] ==> H |- p=>q"; |
515 | 113 |
by (rtac (thms.K RS thms_MP) 1); |
0 | 114 |
by (REPEAT (ares_tac [thms_in_pl] 1)); |
760 | 115 |
qed "weaken_right"; |
0 | 116 |
|
117 |
(*The deduction theorem*) |
|
5137 | 118 |
Goal "[| cons(p,H) |- q; p:prop |] ==> H |- p=>q"; |
515 | 119 |
by (etac thms.induct 1); |
4091 | 120 |
by (fast_tac (claset() addIs [thms_I, thms.H RS weaken_right]) 1); |
121 |
by (fast_tac (claset() addIs [thms.K RS weaken_right]) 1); |
|
122 |
by (fast_tac (claset() addIs [thms.S RS weaken_right]) 1); |
|
123 |
by (fast_tac (claset() addIs [thms.DN RS weaken_right]) 1); |
|
124 |
by (fast_tac (claset() addIs [thms.S RS thms_MP RS thms_MP]) 1); |
|
760 | 125 |
qed "deduction"; |
0 | 126 |
|
127 |
||
128 |
(*The cut rule*) |
|
5137 | 129 |
Goal "[| H|-p; cons(p,H) |- q |] ==> H |- q"; |
0 | 130 |
by (rtac (deduction RS thms_MP) 1); |
131 |
by (REPEAT (ares_tac [thms_in_pl] 1)); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
132 |
qed "cut"; |
0 | 133 |
|
5137 | 134 |
Goal "[| H |- Fls; p:prop |] ==> H |- p"; |
515 | 135 |
by (rtac (thms.DN RS thms_MP) 1); |
0 | 136 |
by (rtac weaken_right 2); |
515 | 137 |
by (REPEAT (ares_tac (prop.intrs@[consI1]) 1)); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
138 |
qed "thms_FlsE"; |
0 | 139 |
|
140 |
(* [| H |- p=>Fls; H |- p; q: prop |] ==> H |- q *) |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
141 |
bind_thm ("thms_notE", (thms_MP RS thms_FlsE)); |
0 | 142 |
|
143 |
(*Soundness of the rules wrt truth-table semantics*) |
|
5137 | 144 |
Goalw [logcon_def] "H |- p ==> H |= p"; |
515 | 145 |
by (etac thms.induct 1); |
4091 | 146 |
by (fast_tac (claset() addSDs [is_true_Imp RS iffD1 RS mp]) 5); |
2469 | 147 |
by (ALLGOALS Asm_simp_tac); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
148 |
qed "soundness"; |
0 | 149 |
|
150 |
(*** Towards the completeness proof ***) |
|
151 |
||
515 | 152 |
val [premf,premq] = goal PropLog.thy |
0 | 153 |
"[| H |- p=>Fls; q: prop |] ==> H |- p=>q"; |
154 |
by (rtac (premf RS thms_in_pl RS ImpE) 1); |
|
155 |
by (rtac deduction 1); |
|
156 |
by (rtac (premf RS weaken_left_cons RS thms_notE) 1); |
|
515 | 157 |
by (REPEAT (ares_tac [premq, consI1, thms.H] 1)); |
760 | 158 |
qed "Fls_Imp"; |
0 | 159 |
|
515 | 160 |
val [premp,premq] = goal PropLog.thy |
0 | 161 |
"[| H |- p; H |- q=>Fls |] ==> H |- (p=>q)=>Fls"; |
162 |
by (cut_facts_tac ([premp,premq] RL [thms_in_pl]) 1); |
|
163 |
by (etac ImpE 1); |
|
164 |
by (rtac deduction 1); |
|
165 |
by (rtac (premq RS weaken_left_cons RS thms_MP) 1); |
|
515 | 166 |
by (rtac (consI1 RS thms.H RS thms_MP) 1); |
0 | 167 |
by (rtac (premp RS weaken_left_cons) 2); |
515 | 168 |
by (REPEAT (ares_tac prop.intrs 1)); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
169 |
qed "Imp_Fls"; |
0 | 170 |
|
171 |
(*Typical example of strengthening the induction formula*) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
172 |
Goal "p: prop ==> hyps(p,t) |- if(is_true(p,t), p, p=>Fls)"; |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
173 |
by (rtac (split_if RS iffD2) 1); |
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
174 |
by (etac prop.induct 1); |
4091 | 175 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [thms_I, thms.H]))); |
176 |
by (safe_tac (claset() addSEs [Fls_Imp RS weaken_left_Un1, |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
177 |
Fls_Imp RS weaken_left_Un2])); |
4091 | 178 |
by (ALLGOALS (fast_tac (claset() addIs [weaken_left_Un1, weaken_left_Un2, |
1461 | 179 |
weaken_right, Imp_Fls]))); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
180 |
qed "hyps_thms_if"; |
0 | 181 |
|
182 |
(*Key lemma for completeness; yields a set of assumptions satisfying p*) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
183 |
Goalw [logcon_def] "[| p: prop; 0 |= p |] ==> hyps(p,t) |- p"; |
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
184 |
by (dtac hyps_thms_if 1); |
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
185 |
by (Asm_full_simp_tac 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
186 |
qed "logcon_thms_p"; |
0 | 187 |
|
188 |
(*For proving certain theorems in our new propositional logic*) |
|
189 |
val thms_cs = |
|
515 | 190 |
ZF_cs addSIs (prop.intrs @ [deduction]) |
191 |
addIs [thms_in_pl, thms.H, thms.H RS thms_MP]; |
|
0 | 192 |
|
193 |
(*The excluded middle in the form of an elimination rule*) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
194 |
Goal "[| p: prop; q: prop |] ==> H |- (p=>q) => ((p=>Fls)=>q) => q"; |
0 | 195 |
by (rtac (deduction RS deduction) 1); |
515 | 196 |
by (rtac (thms.DN RS thms_MP) 1); |
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
197 |
by (ALLGOALS (blast_tac thms_cs)); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
198 |
qed "thms_excluded_middle"; |
0 | 199 |
|
200 |
(*Hard to prove directly because it requires cuts*) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
201 |
Goal "[| cons(p,H) |- q; cons(p=>Fls,H) |- q; p: prop |] ==> H |- q"; |
0 | 202 |
by (rtac (thms_excluded_middle RS thms_MP RS thms_MP) 1); |
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
203 |
by (REPEAT (ares_tac (prop.intrs@[deduction,thms_in_pl]) 1)); |
760 | 204 |
qed "thms_excluded_middle_rule"; |
0 | 205 |
|
206 |
(*** Completeness -- lemmas for reducing the set of assumptions ***) |
|
207 |
||
208 |
(*For the case hyps(p,t)-cons(#v,Y) |- p; |
|
209 |
we also have hyps(p,t)-{#v} <= hyps(p, t-{v}) *) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
210 |
Goal "p: prop ==> hyps(p, t-{v}) <= cons(#v=>Fls, hyps(p,t)-{#v})"; |
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
211 |
by (etac prop.induct 1); |
2469 | 212 |
by (Simp_tac 1); |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
213 |
by (asm_simp_tac (simpset() setloop (split_tac [split_if])) 1); |
4091 | 214 |
by (fast_tac (claset() addSEs prop.free_SEs) 1); |
2469 | 215 |
by (Asm_simp_tac 1); |
216 |
by (Fast_tac 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
217 |
qed "hyps_Diff"; |
0 | 218 |
|
219 |
(*For the case hyps(p,t)-cons(#v => Fls,Y) |- p; |
|
220 |
we also have hyps(p,t)-{#v=>Fls} <= hyps(p, cons(v,t)) *) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
221 |
Goal "p: prop ==> hyps(p, cons(v,t)) <= cons(#v, hyps(p,t)-{#v=>Fls})"; |
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
222 |
by (etac prop.induct 1); |
2469 | 223 |
by (Simp_tac 1); |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
224 |
by (asm_simp_tac (simpset() setloop (split_tac [split_if])) 1); |
4091 | 225 |
by (fast_tac (claset() addSEs prop.free_SEs) 1); |
2469 | 226 |
by (Asm_simp_tac 1); |
227 |
by (Fast_tac 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
228 |
qed "hyps_cons"; |
0 | 229 |
|
230 |
(** Two lemmas for use with weaken_left **) |
|
231 |
||
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
232 |
Goal "B-C <= cons(a, B-cons(a,C))"; |
2469 | 233 |
by (Fast_tac 1); |
760 | 234 |
qed "cons_Diff_same"; |
0 | 235 |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
236 |
Goal "cons(a, B-{c}) - D <= cons(a, B-cons(c,D))"; |
2469 | 237 |
by (Fast_tac 1); |
760 | 238 |
qed "cons_Diff_subset2"; |
0 | 239 |
|
240 |
(*The set hyps(p,t) is finite, and elements have the form #v or #v=>Fls; |
|
241 |
could probably prove the stronger hyps(p,t) : Fin(hyps(p,0) Un hyps(p,nat))*) |
|
5325
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
242 |
Goal "p: prop ==> hyps(p,t) : Fin(UN v:nat. {#v, #v=>Fls})"; |
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents:
5137
diff
changeset
|
243 |
by (etac prop.induct 1); |
4091 | 244 |
by (asm_simp_tac (simpset() addsimps [UN_I] |
5116
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents:
5068
diff
changeset
|
245 |
setloop (split_tac [split_if])) 2); |
2469 | 246 |
by (ALLGOALS Asm_simp_tac); |
4091 | 247 |
by (fast_tac (claset() addIs Fin.intrs) 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
248 |
qed "hyps_finite"; |
0 | 249 |
|
250 |
val Diff_weaken_left = subset_refl RSN (2, Diff_mono) RS weaken_left; |
|
251 |
||
252 |
(*Induction on the finite set of assumptions hyps(p,t0). |
|
253 |
We may repeatedly subtract assumptions until none are left!*) |
|
515 | 254 |
val [premp,sat] = goal PropLog.thy |
0 | 255 |
"[| p: prop; 0 |= p |] ==> ALL t. hyps(p,t) - hyps(p,t0) |- p"; |
256 |
by (rtac (premp RS hyps_finite RS Fin_induct) 1); |
|
4091 | 257 |
by (simp_tac (simpset() addsimps [premp, sat, logcon_thms_p, Diff_0]) 1); |
4152 | 258 |
by Safe_tac; |
0 | 259 |
(*Case hyps(p,t)-cons(#v,Y) |- p *) |
260 |
by (rtac thms_excluded_middle_rule 1); |
|
515 | 261 |
by (etac prop.Var_I 3); |
0 | 262 |
by (rtac (cons_Diff_same RS weaken_left) 1); |
263 |
by (etac spec 1); |
|
264 |
by (rtac (cons_Diff_subset2 RS weaken_left) 1); |
|
265 |
by (rtac (premp RS hyps_Diff RS Diff_weaken_left) 1); |
|
266 |
by (etac spec 1); |
|
267 |
(*Case hyps(p,t)-cons(#v => Fls,Y) |- p *) |
|
268 |
by (rtac thms_excluded_middle_rule 1); |
|
515 | 269 |
by (etac prop.Var_I 3); |
0 | 270 |
by (rtac (cons_Diff_same RS weaken_left) 2); |
271 |
by (etac spec 2); |
|
272 |
by (rtac (cons_Diff_subset2 RS weaken_left) 1); |
|
273 |
by (rtac (premp RS hyps_cons RS Diff_weaken_left) 1); |
|
274 |
by (etac spec 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
275 |
qed "completeness_0_lemma"; |
0 | 276 |
|
277 |
(*The base case for completeness*) |
|
515 | 278 |
val [premp,sat] = goal PropLog.thy "[| p: prop; 0 |= p |] ==> 0 |- p"; |
0 | 279 |
by (rtac (Diff_cancel RS subst) 1); |
280 |
by (rtac (sat RS (premp RS completeness_0_lemma RS spec)) 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
281 |
qed "completeness_0"; |
0 | 282 |
|
283 |
(*A semantic analogue of the Deduction Theorem*) |
|
5137 | 284 |
Goalw [logcon_def] "[| cons(p,H) |= q |] ==> H |= p=>q"; |
2469 | 285 |
by (Simp_tac 1); |
286 |
by (Fast_tac 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
287 |
qed "logcon_Imp"; |
0 | 288 |
|
5137 | 289 |
Goal "H: Fin(prop) ==> ALL p:prop. H |= p --> H |- p"; |
0 | 290 |
by (etac Fin_induct 1); |
4091 | 291 |
by (safe_tac (claset() addSIs [completeness_0])); |
0 | 292 |
by (rtac (weaken_left_cons RS thms_MP) 1); |
5137 | 293 |
by (blast_tac (claset() addSIs (logcon_Imp::prop.intrs)) 1); |
294 |
by (blast_tac thms_cs 1); |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
295 |
qed "completeness_lemma"; |
0 | 296 |
|
297 |
val completeness = completeness_lemma RS bspec RS mp; |
|
298 |
||
515 | 299 |
val [finite] = goal PropLog.thy "H: Fin(prop) ==> H |- p <-> H |= p & p:prop"; |
4091 | 300 |
by (fast_tac (claset() addSEs [soundness, finite RS completeness, |
1461 | 301 |
thms_in_pl]) 1); |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
302 |
qed "thms_iff"; |
0 | 303 |
|
304 |
writeln"Reached end of file."; |