equal
deleted
inserted
replaced
186 qed "ComplD"; |
186 qed "ComplD"; |
187 |
187 |
188 val ComplE = make_elim ComplD; |
188 val ComplE = make_elim ComplD; |
189 |
189 |
190 qed_goal "Compl_iff" Set.thy "(c : Compl(A)) = (c~:A)" |
190 qed_goal "Compl_iff" Set.thy "(c : Compl(A)) = (c~:A)" |
191 (fn _ => [ (fast_tac (HOL_cs addSIs [ComplI] addSEs [ComplE]) 1) ]); |
191 (fn _ => [ (fast_tac (!claset addSIs [ComplI] addSEs [ComplE]) 1) ]); |
192 |
192 |
193 |
193 |
194 section "Binary union -- Un"; |
194 section "Binary union -- Un"; |
195 |
195 |
196 val prems = goalw Set.thy [Un_def] "c:A ==> c : A Un B"; |
196 val prems = goalw Set.thy [Un_def] "c:A ==> c : A Un B"; |
213 by (rtac (major RS CollectD RS disjE) 1); |
213 by (rtac (major RS CollectD RS disjE) 1); |
214 by (REPEAT (eresolve_tac prems 1)); |
214 by (REPEAT (eresolve_tac prems 1)); |
215 qed "UnE"; |
215 qed "UnE"; |
216 |
216 |
217 qed_goal "Un_iff" Set.thy "(c : A Un B) = (c:A | c:B)" |
217 qed_goal "Un_iff" Set.thy "(c : A Un B) = (c:A | c:B)" |
218 (fn _ => [ (fast_tac (HOL_cs addSIs [UnCI] addSEs [UnE]) 1) ]); |
218 (fn _ => [ (fast_tac (!claset addSIs [UnCI] addSEs [UnE]) 1) ]); |
219 |
219 |
220 |
220 |
221 section "Binary intersection -- Int"; |
221 section "Binary intersection -- Int"; |
222 |
222 |
223 val prems = goalw Set.thy [Int_def] |
223 val prems = goalw Set.thy [Int_def] |
239 by (rtac (major RS IntD1) 1); |
239 by (rtac (major RS IntD1) 1); |
240 by (rtac (major RS IntD2) 1); |
240 by (rtac (major RS IntD2) 1); |
241 qed "IntE"; |
241 qed "IntE"; |
242 |
242 |
243 qed_goal "Int_iff" Set.thy "(c : A Int B) = (c:A & c:B)" |
243 qed_goal "Int_iff" Set.thy "(c : A Int B) = (c:A & c:B)" |
244 (fn _ => [ (fast_tac (HOL_cs addSIs [IntI] addSEs [IntE]) 1) ]); |
244 (fn _ => [ (fast_tac (!claset addSIs [IntI] addSEs [IntE]) 1) ]); |
245 |
245 |
246 |
246 |
247 section "Set difference"; |
247 section "Set difference"; |
248 |
248 |
249 qed_goalw "DiffI" Set.thy [set_diff_def] |
249 qed_goalw "DiffI" Set.thy [set_diff_def] |
264 (fn prems=> |
264 (fn prems=> |
265 [ (resolve_tac prems 1), |
265 [ (resolve_tac prems 1), |
266 (REPEAT (ares_tac (prems RL [DiffD1, DiffD2 RS notI]) 1)) ]); |
266 (REPEAT (ares_tac (prems RL [DiffD1, DiffD2 RS notI]) 1)) ]); |
267 |
267 |
268 qed_goal "Diff_iff" Set.thy "(c : A-B) = (c:A & c~:B)" |
268 qed_goal "Diff_iff" Set.thy "(c : A-B) = (c:A & c~:B)" |
269 (fn _ => [ (fast_tac (HOL_cs addSIs [DiffI] addSEs [DiffE]) 1) ]); |
269 (fn _ => [ (fast_tac (!claset addSIs [DiffI] addSEs [DiffE]) 1) ]); |
270 |
270 |
271 section "The empty set -- {}"; |
271 section "The empty set -- {}"; |
272 |
272 |
273 qed_goalw "emptyE" Set.thy [empty_def] "a:{} ==> P" |
273 qed_goalw "emptyE" Set.thy [empty_def] "a:{} ==> P" |
274 (fn [prem] => [rtac (prem RS CollectD RS FalseE) 1]); |
274 (fn [prem] => [rtac (prem RS CollectD RS FalseE) 1]); |
284 qed_goal "equals0D" Set.thy "[| A={}; a:A |] ==> P" |
284 qed_goal "equals0D" Set.thy "[| A={}; a:A |] ==> P" |
285 (fn [major,minor]=> |
285 (fn [major,minor]=> |
286 [ (rtac (minor RS (major RS equalityD1 RS subsetD RS emptyE)) 1) ]); |
286 [ (rtac (minor RS (major RS equalityD1 RS subsetD RS emptyE)) 1) ]); |
287 |
287 |
288 qed_goal "empty_iff" Set.thy "(c : {}) = False" |
288 qed_goal "empty_iff" Set.thy "(c : {}) = False" |
289 (fn _ => [ (fast_tac (HOL_cs addSEs [emptyE]) 1) ]); |
289 (fn _ => [ (fast_tac (!claset addSEs [emptyE]) 1) ]); |
290 |
290 |
291 |
291 |
292 section "Augmenting a set -- insert"; |
292 section "Augmenting a set -- insert"; |
293 |
293 |
294 qed_goalw "insertI1" Set.thy [insert_def] "a : insert a B" |
294 qed_goalw "insertI1" Set.thy [insert_def] "a : insert a B" |
302 (fn major::prems=> |
302 (fn major::prems=> |
303 [ (rtac (major RS UnE) 1), |
303 [ (rtac (major RS UnE) 1), |
304 (REPEAT (eresolve_tac (prems @ [CollectE]) 1)) ]); |
304 (REPEAT (eresolve_tac (prems @ [CollectE]) 1)) ]); |
305 |
305 |
306 qed_goal "insert_iff" Set.thy "a : insert b A = (a=b | a:A)" |
306 qed_goal "insert_iff" Set.thy "a : insert b A = (a=b | a:A)" |
307 (fn _ => [fast_tac (HOL_cs addIs [insertI1,insertI2] addSEs [insertE]) 1]); |
307 (fn _ => [fast_tac (!claset addIs [insertI1,insertI2] addSEs [insertE]) 1]); |
308 |
308 |
309 (*Classical introduction rule*) |
309 (*Classical introduction rule*) |
310 qed_goal "insertCI" Set.thy "(a~:B ==> a=b) ==> a: insert b B" |
310 qed_goal "insertCI" Set.thy "(a~:B ==> a=b) ==> a: insert b B" |
311 (fn [prem]=> |
311 (fn [prem]=> |
312 [ (rtac (disjCI RS (insert_iff RS iffD2)) 1), |
312 [ (rtac (disjCI RS (insert_iff RS iffD2)) 1), |
321 (fn major::prems=> |
321 (fn major::prems=> |
322 [ (rtac (major RS insertE) 1), |
322 [ (rtac (major RS insertE) 1), |
323 (REPEAT (eresolve_tac (prems @ [emptyE]) 1)) ]); |
323 (REPEAT (eresolve_tac (prems @ [emptyE]) 1)) ]); |
324 |
324 |
325 goalw Set.thy [insert_def] "!!a. b : {a} ==> b=a"; |
325 goalw Set.thy [insert_def] "!!a. b : {a} ==> b=a"; |
326 by (fast_tac (HOL_cs addSEs [emptyE,CollectE,UnE]) 1); |
326 by (fast_tac (!claset addSEs [emptyE,CollectE,UnE]) 1); |
327 qed "singletonD"; |
327 qed "singletonD"; |
328 |
328 |
329 val singletonE = make_elim singletonD; |
329 val singletonE = make_elim singletonD; |
330 |
330 |
331 val [major] = goal Set.thy "{a}={b} ==> a=b"; |
331 val [major] = goal Set.thy "{a}={b} ==> a=b"; |