1 (* Title: ZF/zf.ML |
1 (* Title: ZF/zf.ML |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Lawrence C Paulson and Martin D Coen, CU Computer Laboratory |
3 Author: Lawrence C Paulson and Martin D Coen, CU Computer Laboratory |
4 Copyright 1992 University of Cambridge |
4 Copyright 1994 University of Cambridge |
5 |
5 |
6 Basic introduction and elimination rules for Zermelo-Fraenkel Set Theory |
6 Basic introduction and elimination rules for Zermelo-Fraenkel Set Theory |
7 *) |
7 *) |
8 |
8 |
9 open ZF; |
9 open ZF; |
10 |
10 |
11 signature ZF_LEMMAS = |
11 signature ZF_LEMMAS = |
12 sig |
12 sig |
13 val ballE : thm |
13 val ballE : thm |
14 val ballI : thm |
14 val ballI : thm |
15 val ball_cong : thm |
15 val ball_cong : thm |
16 val ball_simp : thm |
16 val ball_simp : thm |
17 val ball_tac : int -> tactic |
17 val ball_tac : int -> tactic |
18 val bexCI : thm |
18 val bexCI : thm |
19 val bexE : thm |
19 val bexE : thm |
20 val bexI : thm |
20 val bexI : thm |
21 val bex_cong : thm |
21 val bex_cong : thm |
22 val bspec : thm |
22 val bspec : thm |
23 val CollectD1 : thm |
23 val CollectD1 : thm |
24 val CollectD2 : thm |
24 val CollectD2 : thm |
25 val CollectE : thm |
25 val CollectE : thm |
26 val CollectI : thm |
26 val CollectI : thm |
27 val Collect_cong : thm |
27 val Collect_cong : thm |
28 val emptyE : thm |
28 val emptyE : thm |
29 val empty_subsetI : thm |
29 val empty_subsetI : thm |
30 val equalityCE : thm |
30 val equalityCE : thm |
31 val equalityD1 : thm |
31 val equalityD1 : thm |
32 val equalityD2 : thm |
32 val equalityD2 : thm |
33 val equalityE : thm |
33 val equalityE : thm |
34 val equalityI : thm |
34 val equalityI : thm |
35 val equality_iffI : thm |
35 val equality_iffI : thm |
36 val equals0D : thm |
36 val equals0D : thm |
37 val equals0I : thm |
37 val equals0I : thm |
38 val ex1_functional : thm |
38 val ex1_functional : thm |
39 val InterD : thm |
39 val InterD : thm |
40 val InterE : thm |
40 val InterE : thm |
41 val InterI : thm |
41 val InterI : thm |
42 val INT_E : thm |
42 val INT_E : thm |
43 val INT_I : thm |
43 val INT_I : thm |
44 val lemmas_cs : claset |
44 val INT_cong : thm |
45 val PowD : thm |
45 val lemmas_cs : claset |
46 val PowI : thm |
46 val PowD : thm |
47 val RepFunE : thm |
47 val PowI : thm |
48 val RepFunI : thm |
48 val RepFunE : thm |
49 val RepFun_eqI : thm |
49 val RepFunI : thm |
50 val RepFun_cong : thm |
50 val RepFun_eqI : thm |
51 val ReplaceE : thm |
51 val RepFun_cong : thm |
52 val ReplaceI : thm |
52 val ReplaceE : thm |
53 val Replace_iff : thm |
53 val ReplaceI : thm |
54 val Replace_cong : thm |
54 val Replace_iff : thm |
55 val rev_ballE : thm |
55 val Replace_cong : thm |
56 val rev_bspec : thm |
56 val rev_ballE : thm |
57 val rev_subsetD : thm |
57 val rev_bspec : thm |
58 val separation : thm |
58 val rev_subsetD : thm |
59 val setup_induction : thm |
59 val separation : thm |
60 val set_mp_tac : int -> tactic |
60 val setup_induction : thm |
61 val subsetCE : thm |
61 val set_mp_tac : int -> tactic |
62 val subsetD : thm |
62 val subsetCE : thm |
63 val subsetI : thm |
63 val subsetD : thm |
64 val subset_refl : thm |
64 val subsetI : thm |
65 val subset_trans : thm |
65 val subset_iff : thm |
66 val UnionE : thm |
66 val subset_refl : thm |
67 val UnionI : thm |
67 val subset_trans : thm |
68 val UN_E : thm |
68 val UnionE : thm |
69 val UN_I : thm |
69 val UnionI : thm |
|
70 val UN_E : thm |
|
71 val UN_I : thm |
|
72 val UN_cong : thm |
70 end; |
73 end; |
71 |
74 |
72 |
75 |
73 structure ZF_Lemmas : ZF_LEMMAS = |
76 structure ZF_Lemmas : ZF_LEMMAS = |
74 struct |
77 struct |
172 val subset_refl = prove_goal ZF.thy "A <= A" |
175 val subset_refl = prove_goal ZF.thy "A <= A" |
173 (fn _=> [ (rtac subsetI 1), atac 1 ]); |
176 (fn _=> [ (rtac subsetI 1), atac 1 ]); |
174 |
177 |
175 val subset_trans = prove_goal ZF.thy "[| A<=B; B<=C |] ==> A<=C" |
178 val subset_trans = prove_goal ZF.thy "[| A<=B; B<=C |] ==> A<=C" |
176 (fn prems=> [ (REPEAT (ares_tac ([subsetI]@(prems RL [subsetD])) 1)) ]); |
179 (fn prems=> [ (REPEAT (ares_tac ([subsetI]@(prems RL [subsetD])) 1)) ]); |
|
180 |
|
181 (*Useful for proving A<=B by rewriting in some cases*) |
|
182 val subset_iff = prove_goalw ZF.thy [subset_def,Ball_def] |
|
183 "A<=B <-> (ALL x. x:A --> x:B)" |
|
184 (fn _=> [ (rtac iff_refl 1) ]); |
177 |
185 |
178 |
186 |
179 (*** Rules for equality ***) |
187 (*** Rules for equality ***) |
180 |
188 |
181 (*Anti-symmetry of the subset relation*) |
189 (*Anti-symmetry of the subset relation*) |
377 "[| b : (UN x:A. B(x)); !!x.[| x: A; b: B(x) |] ==> R |] ==> R" |
385 "[| b : (UN x:A. B(x)); !!x.[| x: A; b: B(x) |] ==> R |] ==> R" |
378 (fn major::prems=> |
386 (fn major::prems=> |
379 [ (rtac (major RS UnionE) 1), |
387 [ (rtac (major RS UnionE) 1), |
380 (REPEAT (eresolve_tac (prems@[asm_rl, RepFunE, subst]) 1)) ]); |
388 (REPEAT (eresolve_tac (prems@[asm_rl, RepFunE, subst]) 1)) ]); |
381 |
389 |
|
390 val UN_cong = prove_goal ZF.thy |
|
391 "[| A=B; !!x. x:B ==> C(x)=D(x) |] ==> (UN x:A.C(x)) = (UN x:B.D(x))" |
|
392 (fn prems=> [ (simp_tac (FOL_ss addcongs [RepFun_cong] addsimps prems) 1) ]); |
|
393 |
382 |
394 |
383 (*** Rules for Intersections of families ***) |
395 (*** Rules for Intersections of families ***) |
384 (* INT x:A. B(x) abbreviates Inter({B(x). x:A}) *) |
396 (* INT x:A. B(x) abbreviates Inter({B(x). x:A}) *) |
385 |
397 |
386 val INT_I = prove_goal ZF.thy |
398 val INT_I = prove_goal ZF.thy |
392 val INT_E = prove_goal ZF.thy |
404 val INT_E = prove_goal ZF.thy |
393 "[| b : (INT x:A. B(x)); a: A |] ==> b : B(a)" |
405 "[| b : (INT x:A. B(x)); a: A |] ==> b : B(a)" |
394 (fn [major,minor]=> |
406 (fn [major,minor]=> |
395 [ (rtac (major RS InterD) 1), |
407 [ (rtac (major RS InterD) 1), |
396 (rtac (minor RS RepFunI) 1) ]); |
408 (rtac (minor RS RepFunI) 1) ]); |
|
409 |
|
410 val INT_cong = prove_goal ZF.thy |
|
411 "[| A=B; !!x. x:B ==> C(x)=D(x) |] ==> (INT x:A.C(x)) = (INT x:B.D(x))" |
|
412 (fn prems=> [ (simp_tac (FOL_ss addcongs [RepFun_cong] addsimps prems) 1) ]); |
397 |
413 |
398 |
414 |
399 (*** Rules for Powersets ***) |
415 (*** Rules for Powersets ***) |
400 |
416 |
401 val PowI = prove_goal ZF.thy "A <= B ==> A : Pow(B)" |
417 val PowI = prove_goal ZF.thy "A <= B ==> A : Pow(B)" |