1 (* |
1 (* |
2 File: IntLemmas.ML |
2 File: IntLemmas.ML |
3 Author: Stephan Merz |
3 Author: Stephan Merz |
4 Copyright: 1997 University of Munich |
4 Copyright: 1998 University of Munich |
5 |
5 |
6 Lemmas and tactics for "intensional" logics. |
6 Lemmas and tactics for "intensional" logics. |
7 |
7 |
8 Mostly a lifting of standard HOL lemmas. They are not required in standard |
8 Mostly a lifting of standard HOL lemmas. They are not required in standard |
9 reasoning about intensional logics, which starts by unlifting proof goals |
9 reasoning about intensional logics, which starts by unlifting proof goals |
10 to the HOL level. |
10 to the HOL level. |
11 *) |
11 *) |
12 |
12 |
13 |
13 |
14 qed_goal "substW" Intensional.thy |
14 qed_goal "substW" Intensional.thy |
15 "[| x .= y; w |= (P::[('v::world) => 'a, 'w::world] => bool)(x) |] ==> w |= P(y)" |
15 "[| |- x = y; w |= P(x) |] ==> w |= P(y)" |
16 (fn [prem1,prem2] => [rtac (rewrite_rule ([prem1] RL [inteq_reflection]) prem2) 1]); |
16 (fn [prem1,prem2] => [rtac (rewrite_rule ([prem1] RL [inteq_reflection]) prem2) 1]); |
17 |
17 |
18 |
18 |
19 (* Lift HOL rules to intensional reasoning *) |
19 (* Lift HOL rules to intensional reasoning *) |
20 |
20 |
21 qed_goal "reflW" Intensional.thy "x .= x" |
21 qed_goal "reflW" Intensional.thy "|- x = x" |
22 (fn _ => [ rtac intI 1, |
22 (fn _ => [Simp_tac 1]); |
23 rewrite_goals_tac intensional_rews, |
23 |
24 rtac refl 1 ]); |
24 qed_goal "symW" Intensional.thy "|- s = t ==> |- t = s" |
25 |
|
26 |
|
27 qed_goal "symW" Intensional.thy "s .= t ==> t .= s" |
|
28 (fn prems => [ cut_facts_tac prems 1, |
25 (fn prems => [ cut_facts_tac prems 1, |
29 rtac intI 1, dtac intD 1, |
26 rtac intI 1, dtac intD 1, |
30 rewrite_goals_tac intensional_rews, |
27 rewrite_goals_tac intensional_rews, |
31 etac sym 1 ]); |
28 etac sym 1 ]); |
32 |
29 |
33 qed_goal "not_symW" Intensional.thy "s .~= t ==> t .~= s" |
30 qed_goal "not_symW" Intensional.thy "|- s ~= t ==> |- t ~= s" |
34 (fn prems => [ cut_facts_tac prems 1, |
31 (fn prems => [ cut_facts_tac prems 1, |
35 rtac intI 1, dtac intD 1, |
32 rtac intI 1, dtac intD 1, |
36 rewrite_goals_tac intensional_rews, |
33 rewrite_goals_tac intensional_rews, |
37 etac not_sym 1 ]); |
34 etac not_sym 1 ]); |
38 |
35 |
39 qed_goal "transW" Intensional.thy |
36 qed_goal "transW" Intensional.thy |
40 "[| r .= s; s .= t |] ==> r .= t" |
37 "[| |- r = s; |- s = t |] ==> |- r = t" |
41 (fn prems => [ cut_facts_tac prems 1, |
38 (fn prems => [ cut_facts_tac prems 1, |
42 rtac intI 1, REPEAT (dtac intD 1), |
39 rtac intI 1, REPEAT (dtac intD 1), |
43 rewrite_goals_tac intensional_rews, |
40 rewrite_goals_tac intensional_rews, |
44 etac trans 1, |
41 etac trans 1, |
45 atac 1 ]); |
42 atac 1 ]); |
46 |
43 |
47 qed_goal "box_equalsW" Intensional.thy |
44 qed_goal "box_equalsW" Intensional.thy |
48 "[| a .= b; a .= c; b .= d |] ==> c .= d" |
45 "[| |- a = b; |- a = c; |- b = d |] ==> |- c = d" |
49 (fn prems => [ (rtac transW 1), |
46 (fn prems => [ (rtac transW 1), |
50 (rtac transW 1), |
47 (rtac transW 1), |
51 (rtac symW 1), |
48 (rtac symW 1), |
52 (REPEAT (resolve_tac prems 1)) ]); |
49 (REPEAT (resolve_tac prems 1)) ]); |
53 |
50 |
54 |
51 |
|
52 (* NB: Antecedent is a standard HOL (non-intensional) formula. *) |
55 qed_goal "fun_congW" Intensional.thy |
53 qed_goal "fun_congW" Intensional.thy |
56 "(f::('a => 'b)) = g ==> f[x] .= g[x]" |
54 "f = g ==> |- f<x> = g<x>" |
57 (fn prems => [ cut_facts_tac prems 1, |
55 (fn prems => [ cut_facts_tac prems 1, |
58 rtac intI 1, |
56 rtac intI 1, |
59 rewrite_goals_tac intensional_rews, |
57 rewrite_goals_tac intensional_rews, |
60 etac fun_cong 1 ]); |
58 etac fun_cong 1 ]); |
61 |
59 |
62 qed_goal "fun_cong2W" Intensional.thy |
60 qed_goal "fun_cong2W" Intensional.thy |
63 "(f::(['a,'b] => 'c)) = g ==> f[x,y] .= g[x,y]" |
61 "f = g ==> |- f<x,y> = g<x,y>" |
64 (fn prems => [ cut_facts_tac prems 1, |
62 (fn prems => [ cut_facts_tac prems 1, |
65 rtac intI 1, |
63 rtac intI 1, |
66 rewrite_goals_tac intensional_rews, |
64 Asm_full_simp_tac 1 ]); |
67 asm_full_simp_tac HOL_ss 1 ]); |
|
68 |
65 |
69 qed_goal "fun_cong3W" Intensional.thy |
66 qed_goal "fun_cong3W" Intensional.thy |
70 "(f::(['a,'b,'c] => 'd)) = g ==> f[x,y,z] .= g[x,y,z]" |
67 "f = g ==> |- f<x,y,z> = g<x,y,z>" |
71 (fn prems => [ cut_facts_tac prems 1, |
68 (fn prems => [ cut_facts_tac prems 1, |
72 rtac intI 1, |
69 rtac intI 1, |
73 rewrite_goals_tac intensional_rews, |
70 Asm_full_simp_tac 1 ]); |
74 asm_full_simp_tac HOL_ss 1 ]); |
71 |
75 |
72 |
76 |
73 qed_goal "arg_congW" Intensional.thy "|- x = y ==> |- f<x> = f<y>" |
77 qed_goal "arg_congW" Intensional.thy "x .= y ==> (f::'a=>'b)[x] .= f[y]" |
|
78 (fn prems => [ cut_facts_tac prems 1, |
74 (fn prems => [ cut_facts_tac prems 1, |
79 rtac intI 1, |
75 rtac intI 1, |
80 dtac intD 1, |
76 dtac intD 1, |
81 rewrite_goals_tac intensional_rews, |
77 rewrite_goals_tac intensional_rews, |
82 etac arg_cong 1 ]); |
78 etac arg_cong 1 ]); |
83 |
79 |
84 qed_goal "arg_cong2W" Intensional.thy |
80 qed_goal "arg_cong2W" Intensional.thy |
85 "[| u .= v; x .= y |] ==> (f::['a,'b]=>'c)[u,x] .= f[v,y]" |
81 "[| |- u = v; |- x = y |] ==> |- f<u,x> = f<v,y>" |
86 (fn prems => [ cut_facts_tac prems 1, |
82 (fn prems => [ cut_facts_tac prems 1, |
87 rtac intI 1, |
83 rtac intI 1, |
88 REPEAT (dtac intD 1), |
84 REPEAT (dtac intD 1), |
89 rewrite_goals_tac intensional_rews, |
85 rewrite_goals_tac intensional_rews, |
90 REPEAT (etac subst 1), |
86 REPEAT (etac subst 1), |
91 rtac refl 1 ]); |
87 rtac refl 1 ]); |
92 |
88 |
93 qed_goal "arg_cong3W" Intensional.thy |
89 qed_goal "arg_cong3W" Intensional.thy |
94 "[| r .= s; u .= v; x .= y |] ==> (f::['a,'b,'c]=>'d)[r,u,x] .= f[s,v,y]" |
90 "[| |- r = s; |- u = v; |- x = y |] ==> |- f<r,u,x> = f<s,v,y>" |
95 (fn prems => [ cut_facts_tac prems 1, |
91 (fn prems => [ cut_facts_tac prems 1, |
96 rtac intI 1, |
92 rtac intI 1, |
97 REPEAT (dtac intD 1), |
93 REPEAT (dtac intD 1), |
98 rewrite_goals_tac intensional_rews, |
94 rewrite_goals_tac intensional_rews, |
99 REPEAT (etac subst 1), |
95 REPEAT (etac subst 1), |
100 rtac refl 1 ]); |
96 rtac refl 1 ]); |
101 |
97 |
102 qed_goal "congW" Intensional.thy |
98 qed_goal "congW" Intensional.thy |
103 "[| (f::'a=>'b) = g; x .= y |] ==> f[x] .= g[y]" |
99 "[| f = g; |- x = y |] ==> |- f<x> = g<y>" |
104 (fn prems => [ rtac box_equalsW 1, |
100 (fn prems => [ rtac box_equalsW 1, |
105 rtac reflW 3, |
101 rtac reflW 3, |
106 rtac arg_congW 1, |
102 rtac arg_congW 1, |
107 resolve_tac prems 1, |
103 resolve_tac prems 1, |
108 rtac fun_congW 1, |
104 rtac fun_congW 1, |
109 rtac sym 1, |
105 rtac sym 1, |
110 resolve_tac prems 1 ]); |
106 resolve_tac prems 1 ]); |
111 |
107 |
112 qed_goal "cong2W" Intensional.thy |
108 qed_goal "cong2W" Intensional.thy |
113 "[| (f::['a,'b]=>'c) = g; u .= v; x .= y |] ==> f[u,x] .= g[v,y]" |
109 "[| f = g; |- u = v; |- x = y |] ==> |- f<u,x> = g<v,y>" |
114 (fn prems => [ rtac box_equalsW 1, |
110 (fn prems => [ rtac box_equalsW 1, |
115 rtac reflW 3, |
111 rtac reflW 3, |
116 rtac arg_cong2W 1, |
112 rtac arg_cong2W 1, |
117 REPEAT (resolve_tac prems 1), |
113 REPEAT (resolve_tac prems 1), |
118 rtac fun_cong2W 1, |
114 rtac fun_cong2W 1, |
119 rtac sym 1, |
115 rtac sym 1, |
120 resolve_tac prems 1 ]); |
116 resolve_tac prems 1 ]); |
121 |
117 |
122 qed_goal "cong3W" Intensional.thy |
118 qed_goal "cong3W" Intensional.thy |
123 "[| (f::['a,'b,'c]=>'d) = g; r .= s; u .= v; x .= y |] ==> (f[r,u,x]) .= (g[s,v,y])" |
119 "[| f = g; |- r = s; |- u = v; |- x = y |] ==> |- f<r,u,x> = g<s,v,y>" |
124 (fn prems => [ rtac box_equalsW 1, |
120 (fn prems => [ rtac box_equalsW 1, |
125 rtac reflW 3, |
121 rtac reflW 3, |
126 rtac arg_cong3W 1, |
122 rtac arg_cong3W 1, |
127 REPEAT (resolve_tac prems 1), |
123 REPEAT (resolve_tac prems 1), |
128 rtac fun_cong3W 1, |
124 rtac fun_cong3W 1, |
131 |
127 |
132 |
128 |
133 (** Lifted equivalence **) |
129 (** Lifted equivalence **) |
134 |
130 |
135 (* Note the object-level implication in the hypothesis. Meta-level implication |
131 (* Note the object-level implication in the hypothesis. Meta-level implication |
136 would not be correct! *) |
132 would be incorrect! *) |
137 qed_goal "iffIW" Intensional.thy |
133 qed_goal "iffIW" Intensional.thy |
138 "[| A .-> B; B .-> A |] ==> A .= B" |
134 "[| |- A --> B; |- B --> A |] ==> |- A = B" |
139 (fn prems => [ cut_facts_tac prems 1, |
135 (fn prems => [ cut_facts_tac prems 1, |
140 rtac intI 1, |
136 rewrite_goals_tac (Valid_def::intensional_rews), |
141 REPEAT (dtac intD 1), |
137 Blast_tac 1 ]); |
142 rewrite_goals_tac intensional_rews, |
|
143 (fast_tac prop_cs 1) ]); |
|
144 |
138 |
145 qed_goal "iffD2W" Intensional.thy |
139 qed_goal "iffD2W" Intensional.thy |
146 "[| (P::('w::world) form) .= Q; w |= Q |] ==> w |= P" |
140 "[| |- P = Q; w |= Q |] ==> w |= P" |
147 (fn prems => |
141 (fn prems => [ cut_facts_tac prems 1, |
148 [cut_facts_tac prems 1, |
142 rewrite_goals_tac (Valid_def::intensional_rews), |
149 dtac intD 1, |
143 Blast_tac 1 ]); |
150 rewrite_goals_tac intensional_rews, |
|
151 fast_tac prop_cs 1 ]); |
|
152 |
144 |
153 val iffD1W = symW RS iffD2W; |
145 val iffD1W = symW RS iffD2W; |
154 |
146 |
155 (** #True **) |
147 (** #True **) |
156 |
148 |
157 qed_goal "TrueIW" Intensional.thy "#True" |
149 qed_goal "eqTrueIW" Intensional.thy "|- P ==> |- P = #True" |
158 (fn _ => [rtac intI 1, rewrite_goals_tac intensional_rews, rtac TrueI 1]); |
150 (fn prems => [cut_facts_tac prems 1, |
159 |
151 rtac intI 1, |
160 |
152 dtac intD 1, |
161 qed_goal "eqTrueIW" Intensional.thy "(P::('w::world) form) ==> P .= #True" |
153 Asm_full_simp_tac 1]); |
162 (fn prems => [cut_facts_tac prems 1, |
154 |
163 rtac intI 1, |
155 qed_goal "eqTrueEW" Intensional.thy "|- P = #True ==> |- P" |
164 dtac intD 1, |
156 (fn prems => [cut_facts_tac prems 1, |
165 rewrite_goals_tac intensional_rews, |
157 rtac intI 1, |
166 asm_full_simp_tac HOL_ss 1] ); |
158 dtac intD 1, |
167 |
159 Asm_full_simp_tac 1]); |
168 qed_goal "eqTrueEW" Intensional.thy "P .= #True ==> (P::('w::world) form)" |
|
169 (fn prems => [cut_facts_tac prems 1, |
|
170 rtac intI 1, |
|
171 dtac intD 1, |
|
172 rewrite_goals_tac intensional_rews, |
|
173 asm_full_simp_tac HOL_ss 1] ); |
|
174 |
160 |
175 (** #False **) |
161 (** #False **) |
176 |
162 |
177 qed_goal "FalseEW" Intensional.thy "#False ==> P::('w::world) form" |
163 qed_goal "FalseEW" Intensional.thy "|- #False ==> |- P" |
178 (fn prems => [cut_facts_tac prems 1, |
164 (fn prems => [cut_facts_tac prems 1, |
179 rtac intI 1, |
165 rtac intI 1, |
180 dtac intD 1, |
166 dtac intD 1, |
181 rewrite_goals_tac intensional_rews, |
167 rewrite_goals_tac intensional_rews, |
182 etac FalseE 1]); |
168 etac FalseE 1]); |
183 |
169 |
184 qed_goal "False_neq_TrueW" Intensional.thy |
170 qed_goal "False_neq_TrueW" Intensional.thy |
185 "(#False::('w::world) form) .= #True ==> P::('w::world) form" |
171 "|- #False = #True ==> |- P" |
186 (fn [prem] => [rtac (prem RS eqTrueEW RS FalseEW) 1]); |
172 (fn [prem] => [rtac (prem RS eqTrueEW RS FalseEW) 1]); |
187 |
173 |
188 |
174 |
189 (** Negation **) |
175 (** Negation **) |
190 |
176 |
191 (* Again use object-level implication *) |
177 (* Again use object-level implication *) |
192 qed_goal "notIW" Intensional.thy "(P .-> #False) ==> .~P" |
178 qed_goal "notIW" Intensional.thy "|- P --> #False ==> |- ~P" |
193 (fn prems => [cut_facts_tac prems 1, |
179 (fn prems => [cut_facts_tac prems 1, |
194 rtac intI 1, |
180 rewrite_goals_tac (Valid_def::intensional_rews), |
195 dtac intD 1, |
181 Blast_tac 1]); |
196 rewrite_goals_tac intensional_rews, |
|
197 fast_tac prop_cs 1]); |
|
198 |
|
199 |
182 |
200 qed_goal "notEWV" Intensional.thy |
183 qed_goal "notEWV" Intensional.thy |
201 "[| .~P; P::('w::world) form |] ==> R::('w::world) form" |
184 "[| |- ~P; |- P |] ==> |- R" |
202 (fn prems => [cut_facts_tac prems 1, |
185 (fn prems => [cut_facts_tac prems 1, |
203 rtac intI 1, |
186 rtac intI 1, |
204 REPEAT (dtac intD 1), |
187 REPEAT (dtac intD 1), |
205 rewrite_goals_tac intensional_rews, |
188 rewrite_goals_tac intensional_rews, |
206 etac notE 1, atac 1]); |
189 etac notE 1, atac 1]); |
208 (* The following rule is stronger: It is enough to detect an |
191 (* The following rule is stronger: It is enough to detect an |
209 inconsistency at *some* world to conclude R. Note also that P and R |
192 inconsistency at *some* world to conclude R. Note also that P and R |
210 are allowed to be (intensional) formulas of different types! *) |
193 are allowed to be (intensional) formulas of different types! *) |
211 |
194 |
212 qed_goal "notEW" Intensional.thy |
195 qed_goal "notEW" Intensional.thy |
213 "[| w |= .~P; w |= P |] ==> R::('w::world) form" |
196 "[| w |= ~P; w |= P |] ==> |- R" |
214 (fn prems => [cut_facts_tac prems 1, |
197 (fn prems => [cut_facts_tac prems 1, |
215 rtac intI 1, |
198 rtac intI 1, |
216 rewrite_goals_tac intensional_rews, |
199 rewrite_goals_tac intensional_rews, |
217 etac notE 1, atac 1]); |
200 etac notE 1, atac 1]); |
218 |
201 |
219 (** Implication **) |
202 (** Implication **) |
220 |
203 |
221 qed_goal "impIW" Intensional.thy "(!!w. (w |= A) ==> (w |= B)) ==> A .-> B" |
204 qed_goal "impIW" Intensional.thy "(!!w. (w |= A) ==> (w |= B)) ==> |- A --> B" |
222 (fn [prem] => [ rtac intI 1, |
205 (fn [prem] => [ rtac intI 1, |
223 rewrite_goals_tac intensional_rews, |
206 rewrite_goals_tac intensional_rews, |
224 rtac impI 1, |
207 rtac impI 1, |
225 etac prem 1 ]); |
208 etac prem 1 ]); |
226 |
209 |
227 |
210 |
228 qed_goal "mpW" Intensional.thy "[| A .-> B; w |= A |] ==> w |= B" |
211 qed_goal "mpW" Intensional.thy "[| |- A --> B; w |= A |] ==> w |= B" |
229 (fn prems => [ cut_facts_tac prems 1, |
212 (fn prems => [ cut_facts_tac prems 1, |
230 dtac intD 1, |
213 dtac intD 1, |
231 rewrite_goals_tac intensional_rews, |
214 rewrite_goals_tac intensional_rews, |
232 etac mp 1, |
215 etac mp 1, |
233 atac 1 ]); |
216 atac 1 ]); |
234 |
217 |
235 qed_goal "impEW" Intensional.thy |
218 qed_goal "impEW" Intensional.thy |
236 "[| A .-> B; w |= A; w |= B ==> w |= C |] ==> w |= (C::('w::world) form)" |
219 "[| |- A --> B; w |= A; w |= B ==> w |= C |] ==> w |= C" |
237 (fn prems => [ (REPEAT (resolve_tac (prems@[mpW]) 1)) ]); |
220 (fn prems => [ (REPEAT (resolve_tac (prems@[mpW]) 1)) ]); |
238 |
221 |
239 qed_goal "rev_mpW" Intensional.thy "[| w |= P; P .-> Q |] ==> w |= Q" |
222 qed_goal "rev_mpW" Intensional.thy "[| w |= P; |- P --> Q |] ==> w |= Q" |
240 (fn prems => [ (REPEAT (resolve_tac (prems@[mpW]) 1)) ]); |
223 (fn prems => [ (REPEAT (resolve_tac (prems@[mpW]) 1)) ]); |
241 |
224 |
242 qed_goal "contraposW" Intensional.thy "[| w |= .~Q; P .-> Q |] ==> w |= .~P" |
225 qed_goalw "contraposW" Intensional.thy intensional_rews |
243 (fn [major,minor] => [rewrite_goals_tac intensional_rews, |
226 "[| w |= ~Q; |- P --> Q |] ==> w |= ~P" |
244 rtac contrapos 1, |
227 (fn [major,minor] => [rtac (major RS contrapos) 1, |
245 rtac (rewrite_rule intensional_rews major) 1, |
|
246 etac rev_mpW 1, |
228 etac rev_mpW 1, |
247 rtac minor 1]); |
229 rtac minor 1]); |
248 |
230 |
249 qed_goal "iffEW" Intensional.thy |
231 qed_goal "iffEW" Intensional.thy |
250 "[| (P::('w::world) form) .= Q; [| P .-> Q; Q .-> P |] ==> R::('w::world) form |] ==> R" |
232 "[| |- P = Q; [| |- P --> Q; |- Q --> P |] ==> R |] ==> R" |
251 (fn [p1,p2] => [REPEAT(ares_tac([p1 RS iffD2W, p1 RS iffD1W, p2, impIW])1)]); |
233 (fn [p1,p2] => [REPEAT(ares_tac([p1 RS iffD2W, p1 RS iffD1W, p2, impIW])1)]); |
252 |
234 |
253 |
235 |
254 (** Conjunction **) |
236 (** Conjunction **) |
255 |
237 |
256 qed_goal "conjIW" Intensional.thy "[| w |= P; w |= Q |] ==> w |= P .& Q" |
238 qed_goalw "conjIW" Intensional.thy intensional_rews "[| w |= P; w |= Q |] ==> w |= P & Q" |
257 (fn prems => [rewrite_goals_tac intensional_rews, |
239 (fn prems => [REPEAT (resolve_tac ([conjI]@prems) 1)]); |
258 REPEAT (resolve_tac ([conjI]@prems) 1)]); |
240 |
259 |
241 qed_goal "conjunct1W" Intensional.thy "(w |= P & Q) ==> w |= P" |
260 qed_goal "conjunct1W" Intensional.thy "(w |= P .& Q) ==> w |= P" |
|
261 (fn prems => [cut_facts_tac prems 1, |
242 (fn prems => [cut_facts_tac prems 1, |
262 rewrite_goals_tac intensional_rews, |
243 rewrite_goals_tac intensional_rews, |
263 etac conjunct1 1]); |
244 etac conjunct1 1]); |
264 |
245 |
265 qed_goal "conjunct2W" Intensional.thy "(w |= P .& Q) ==> w |= Q" |
246 qed_goal "conjunct2W" Intensional.thy "(w |= P & Q) ==> w |= Q" |
266 (fn prems => [cut_facts_tac prems 1, |
247 (fn prems => [cut_facts_tac prems 1, |
267 rewrite_goals_tac intensional_rews, |
248 rewrite_goals_tac intensional_rews, |
268 etac conjunct2 1]); |
249 etac conjunct2 1]); |
269 |
250 |
270 qed_goal "conjEW" Intensional.thy |
251 qed_goal "conjEW" Intensional.thy |
271 "[| w |= P .& Q; [| w |= P; w |= Q |] ==> w |= R |] ==> w |= (R::('w::world) form)" |
252 "[| w |= P & Q; [| w |= P; w |= Q |] ==> w |= R |] ==> w |= R" |
272 (fn prems => [cut_facts_tac prems 1, resolve_tac prems 1, |
253 (fn prems => [cut_facts_tac prems 1, resolve_tac prems 1, |
273 etac conjunct1W 1, etac conjunct2W 1]); |
254 etac conjunct1W 1, etac conjunct2W 1]); |
274 |
255 |
275 |
256 |
276 (** Disjunction **) |
257 (** Disjunction **) |
277 |
258 |
278 qed_goal "disjI1W" Intensional.thy "w |= P ==> w |= P .| Q" |
259 qed_goalw "disjI1W" Intensional.thy intensional_rews "w |= P ==> w |= P | Q" |
279 (fn [prem] => [rewrite_goals_tac intensional_rews, |
260 (fn [prem] => [REPEAT (resolve_tac [disjI1,prem] 1)]); |
280 rtac disjI1 1, |
261 |
281 rtac prem 1]); |
262 qed_goalw "disjI2W" Intensional.thy intensional_rews "w |= Q ==> w |= P | Q" |
282 |
263 (fn [prem] => [REPEAT (resolve_tac [disjI2,prem] 1)]); |
283 qed_goal "disjI2W" Intensional.thy "w |= Q ==> w |= P .| Q" |
|
284 (fn [prem] => [rewrite_goals_tac intensional_rews, |
|
285 rtac disjI2 1, |
|
286 rtac prem 1]); |
|
287 |
264 |
288 qed_goal "disjEW" Intensional.thy |
265 qed_goal "disjEW" Intensional.thy |
289 "[| w |= P .| Q; P .-> R; Q .-> R |] ==> w |= R" |
266 "[| w |= P | Q; |- P --> R; |- Q --> R |] ==> w |= R" |
290 (fn prems => [cut_facts_tac prems 1, |
267 (fn prems => [cut_facts_tac prems 1, |
291 REPEAT (dtac intD 1), |
268 REPEAT (dtac intD 1), |
292 rewrite_goals_tac intensional_rews, |
269 rewrite_goals_tac intensional_rews, |
293 fast_tac prop_cs 1]); |
270 Blast_tac 1]); |
294 |
271 |
295 (** Classical propositional logic **) |
272 (** Classical propositional logic **) |
296 |
273 |
297 qed_goal "classicalW" Intensional.thy "(.~P .-> P) ==> P::('w::world)form" |
274 qed_goalw "classicalW" Intensional.thy (Valid_def::intensional_rews) |
298 (fn prems => [cut_facts_tac prems 1, |
275 "!!P. |- ~P --> P ==> |- P" |
299 rtac intI 1, |
276 (fn prems => [Blast_tac 1]); |
300 dtac intD 1, |
277 |
301 rewrite_goals_tac intensional_rews, |
278 qed_goal "notnotDW" Intensional.thy "!!P. |- ~~P ==> |- P" |
302 fast_tac prop_cs 1]); |
279 (fn prems => [rtac intI 1, |
303 |
|
304 qed_goal "notnotDW" Intensional.thy ".~.~P ==> P::('w::world) form" |
|
305 (fn prems => [cut_facts_tac prems 1, |
|
306 rtac intI 1, |
|
307 dtac intD 1, |
280 dtac intD 1, |
308 rewrite_goals_tac intensional_rews, |
281 rewrite_goals_tac intensional_rews, |
309 etac notnotD 1]); |
282 etac notnotD 1]); |
310 |
283 |
311 qed_goal "disjCIW" Intensional.thy "(w |= .~Q .-> P) ==> (w |= P.|Q)" |
284 qed_goal "disjCIW" Intensional.thy "!!P Q. (w |= ~Q --> P) ==> (w |= P|Q)" |
312 (fn prems => [cut_facts_tac prems 1, |
285 (fn prems => [rewrite_goals_tac intensional_rews, |
313 rewrite_goals_tac intensional_rews, |
286 Blast_tac 1]); |
314 fast_tac prop_cs 1]); |
|
315 |
287 |
316 qed_goal "impCEW" Intensional.thy |
288 qed_goal "impCEW" Intensional.thy |
317 "[| P.->Q; (w |= .~P) ==> (w |= R); (w |= Q) ==> (w |= R) |] ==> w |= (R::('w::world) form)" |
289 "[| |- P --> Q; (w |= ~P) ==> (w |= R); (w |= Q) ==> (w |= R) |] ==> w |= R" |
318 (fn [a1,a2,a3] => |
290 (fn [a1,a2,a3] => |
319 [rtac (excluded_middle RS disjE) 1, |
291 [rtac (excluded_middle RS disjE) 1, |
320 etac (rewrite_rule intensional_rews a2) 1, |
292 etac (rewrite_rule intensional_rews a2) 1, |
321 rtac a3 1, |
293 rtac a3 1, |
322 etac (a1 RS mpW) 1]); |
294 etac (a1 RS mpW) 1]); |
323 |
295 |
324 (* The following generates too many parse trees... |
296 qed_goalw "iffCEW" Intensional.thy intensional_rews |
325 |
297 "[| |- P = Q; \ |
326 qed_goal "iffCEW" Intensional.thy |
|
327 "[| P .= Q; \ |
|
328 \ [| (w |= P); (w |= Q) |] ==> (w |= R); \ |
298 \ [| (w |= P); (w |= Q) |] ==> (w |= R); \ |
329 \ [| (w |= .~P); (w |= .~Q) |] ==> (w |= R) \ |
299 \ [| (w |= ~P); (w |= ~Q) |] ==> (w |= R) \ |
330 \ |] ==> w |= (R::('w::world) form)" |
300 \ |] ==> w |= R" |
331 |
301 (fn [a1,a2,a3] => |
332 *) |
302 [rtac iffCE 1, |
|
303 etac a2 2, atac 2, |
|
304 etac a3 2, atac 2, |
|
305 rtac (int_unlift a1) 1]); |
333 |
306 |
334 qed_goal "case_split_thmW" Intensional.thy |
307 qed_goal "case_split_thmW" Intensional.thy |
335 "[| P .-> Q; .~P .-> Q |] ==> Q::('w::world) form" |
308 "!!P. [| |- P --> Q; |- ~P --> Q |] ==> |- Q" |
336 (fn prems => [cut_facts_tac prems 1, |
309 (fn _ => [rewrite_goals_tac (Valid_def::intensional_rews), |
337 rtac intI 1, |
310 Blast_tac 1]); |
338 REPEAT (dtac intD 1), |
|
339 rewrite_goals_tac intensional_rews, |
|
340 fast_tac prop_cs 1]); |
|
341 |
311 |
342 fun case_tacW a = res_inst_tac [("P",a)] case_split_thmW; |
312 fun case_tacW a = res_inst_tac [("P",a)] case_split_thmW; |
343 |
313 |
344 |
314 |
345 (** Rigid quantifiers **) |
315 (** Rigid quantifiers **) |
346 |
316 |
347 qed_goal "allIW" Intensional.thy "(!!x. P(x)) ==> RALL x. P(x)" |
317 qed_goal "allIW" Intensional.thy "(!!x. |- P x) ==> |- ! x. P(x)" |
348 (fn [prem] => [rtac intI 1, |
318 (fn [prem] => [rtac intI 1, |
349 rewrite_goals_tac intensional_rews, |
319 rewrite_goals_tac intensional_rews, |
350 rtac allI 1, |
320 rtac allI 1, |
351 rtac (prem RS intE) 1]); |
321 rtac (prem RS intD) 1]); |
352 |
322 |
353 qed_goal "specW" Intensional.thy "(RALL x. P(x)) ==> P(x)" |
323 qed_goal "specW" Intensional.thy "|- ! x. P x ==> |- P x" |
354 (fn prems => [cut_facts_tac prems 1, |
324 (fn prems => [cut_facts_tac prems 1, |
355 rtac intI 1, |
325 rtac intI 1, |
356 dtac intD 1, |
326 dtac intD 1, |
357 rewrite_goals_tac intensional_rews, |
327 rewrite_goals_tac intensional_rews, |
358 etac spec 1]); |
328 etac spec 1]); |
359 |
329 |
360 |
330 |
361 qed_goal "allEW" Intensional.thy |
331 qed_goal "allEW" Intensional.thy |
362 "[| RALL x. P(x); P(x) ==> R |] ==> R::('w::world) form" |
332 "[| |- ! x. P x; |- P x ==> |- R |] ==> |- R" |
363 (fn major::prems=> |
333 (fn major::prems=> |
364 [ (REPEAT (resolve_tac (prems @ [major RS specW]) 1)) ]); |
334 [ (REPEAT (resolve_tac (prems @ [major RS specW]) 1)) ]); |
365 |
335 |
366 qed_goal "all_dupEW" Intensional.thy |
336 qed_goal "all_dupEW" Intensional.thy |
367 "[| RALL x. P(x); [| P(x); RALL x. P(x) |] ==> R |] ==> R::('w::world) form" |
337 "[| |- ! x. P x; [| |- P x; |- ! x. P x |] ==> |- R |] ==> |- R" |
368 (fn prems => |
338 (fn prems => |
369 [ (REPEAT (resolve_tac (prems @ (prems RL [specW])) 1)) ]); |
339 [ (REPEAT (resolve_tac (prems @ (prems RL [specW])) 1)) ]); |
370 |
340 |
371 |
341 |
372 qed_goal "exIW" Intensional.thy "P(x) ==> REX x. P(x)" |
342 qed_goal "exIW" Intensional.thy "|- P x ==> |- ? x. P x" |
373 (fn [prem] => [rtac intI 1, |
343 (fn [prem] => [rtac intI 1, |
374 rewrite_goals_tac intensional_rews, |
344 rewrite_goals_tac intensional_rews, |
375 rtac exI 1, |
345 rtac exI 1, |
376 rtac (prem RS intD) 1]); |
346 rtac (prem RS intD) 1]); |
377 |
347 |
378 qed_goal "exEW" Intensional.thy |
348 qed_goal "exEW" Intensional.thy |
379 "[| w |= REX x. P(x); !!x. P(x) .-> Q |] ==> w |= Q" |
349 "[| w |= ? x. P x; !!x. |- P x --> Q |] ==> w |= Q" |
380 (fn [major,minor] => [rtac exE 1, |
350 (fn [major,minor] => [rtac exE 1, |
381 rtac (rewrite_rule intensional_rews major) 1, |
351 rtac (rewrite_rule intensional_rews major) 1, |
382 etac rev_mpW 1, |
352 etac rev_mpW 1, |
383 rtac minor 1]); |
353 rtac minor 1]); |
384 |
354 |
385 (** Classical quantifier reasoning **) |
355 (** Classical quantifier reasoning **) |
386 |
356 |
387 qed_goal "exCIW" Intensional.thy |
357 qed_goal "exCIW" Intensional.thy |
388 "(w |= (RALL x. .~P(x)) .-> P(a)) ==> w |= REX x. P(x)" |
358 "!!P. w |= (! x. ~P x) --> P a ==> w |= ? x. P x" |
389 (fn prems => [cut_facts_tac prems 1, |
359 (fn prems => [rewrite_goals_tac intensional_rews, |
390 rewrite_goals_tac intensional_rews, |
360 Blast_tac 1]); |
391 fast_tac HOL_cs 1]); |
361 |
392 |
|