4 |
4 |
5 subsection{* Relativized versions of standard set-theoretic concepts *} |
5 subsection{* Relativized versions of standard set-theoretic concepts *} |
6 |
6 |
7 constdefs |
7 constdefs |
8 empty :: "[i=>o,i] => o" |
8 empty :: "[i=>o,i] => o" |
9 "empty(M,z) == \<forall>x. M(x) --> x \<notin> z" |
9 "empty(M,z) == \<forall>x[M]. x \<notin> z" |
10 |
10 |
11 subset :: "[i=>o,i,i] => o" |
11 subset :: "[i=>o,i,i] => o" |
12 "subset(M,A,B) == \<forall>x\<in>A. M(x) --> x \<in> B" |
12 "subset(M,A,B) == \<forall>x\<in>A. M(x) --> x \<in> B" |
13 |
13 |
14 upair :: "[i=>o,i,i,i] => o" |
14 upair :: "[i=>o,i,i,i] => o" |
15 "upair(M,a,b,z) == a \<in> z & b \<in> z & (\<forall>x\<in>z. M(x) --> x = a | x = b)" |
15 "upair(M,a,b,z) == a \<in> z & b \<in> z & (\<forall>x\<in>z. M(x) --> x = a | x = b)" |
16 |
16 |
17 pair :: "[i=>o,i,i,i] => o" |
17 pair :: "[i=>o,i,i,i] => o" |
18 "pair(M,a,b,z) == \<exists>x. M(x) & upair(M,a,a,x) & |
18 "pair(M,a,b,z) == \<exists>x[M]. upair(M,a,a,x) & |
19 (\<exists>y. M(y) & upair(M,a,b,y) & upair(M,x,y,z))" |
19 (\<exists>y[M]. upair(M,a,b,y) & upair(M,x,y,z))" |
20 |
20 |
21 union :: "[i=>o,i,i,i] => o" |
21 union :: "[i=>o,i,i,i] => o" |
22 "union(M,a,b,z) == \<forall>x. M(x) --> (x \<in> z <-> x \<in> a | x \<in> b)" |
22 "union(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a | x \<in> b" |
23 |
23 |
24 successor :: "[i=>o,i,i] => o" |
24 successor :: "[i=>o,i,i] => o" |
25 "successor(M,a,z) == \<exists>x. M(x) & upair(M,a,a,x) & union(M,x,a,z)" |
25 "successor(M,a,z) == \<exists>x[M]. upair(M,a,a,x) & union(M,x,a,z)" |
26 |
26 |
27 powerset :: "[i=>o,i,i] => o" |
27 powerset :: "[i=>o,i,i] => o" |
28 "powerset(M,A,z) == \<forall>x. M(x) --> (x \<in> z <-> subset(M,x,A))" |
28 "powerset(M,A,z) == \<forall>x[M]. x \<in> z <-> subset(M,x,A)" |
29 |
29 |
30 inter :: "[i=>o,i,i,i] => o" |
30 inter :: "[i=>o,i,i,i] => o" |
31 "inter(M,a,b,z) == \<forall>x. M(x) --> (x \<in> z <-> x \<in> a & x \<in> b)" |
31 "inter(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a & x \<in> b" |
32 |
32 |
33 setdiff :: "[i=>o,i,i,i] => o" |
33 setdiff :: "[i=>o,i,i,i] => o" |
34 "setdiff(M,a,b,z) == \<forall>x. M(x) --> (x \<in> z <-> x \<in> a & x \<notin> b)" |
34 "setdiff(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a & x \<notin> b" |
35 |
35 |
36 big_union :: "[i=>o,i,i] => o" |
36 big_union :: "[i=>o,i,i] => o" |
37 "big_union(M,A,z) == \<forall>x. M(x) --> (x \<in> z <-> (\<exists>y\<in>A. M(y) & x \<in> y))" |
37 "big_union(M,A,z) == \<forall>x[M]. x \<in> z <-> (\<exists>y\<in>A. M(y) & x \<in> y)" |
38 |
38 |
39 big_inter :: "[i=>o,i,i] => o" |
39 big_inter :: "[i=>o,i,i] => o" |
40 "big_inter(M,A,z) == |
40 "big_inter(M,A,z) == |
41 (A=0 --> z=0) & |
41 (A=0 --> z=0) & |
42 (A\<noteq>0 --> (\<forall>x. M(x) --> (x \<in> z <-> (\<forall>y\<in>A. M(y) --> x \<in> y))))" |
42 (A\<noteq>0 --> (\<forall>x[M]. x \<in> z <-> (\<forall>y\<in>A. M(y) --> x \<in> y)))" |
43 |
43 |
44 cartprod :: "[i=>o,i,i,i] => o" |
44 cartprod :: "[i=>o,i,i,i] => o" |
45 "cartprod(M,A,B,z) == |
45 "cartprod(M,A,B,z) == |
46 \<forall>u. M(u) --> (u \<in> z <-> (\<exists>x\<in>A. M(x) & (\<exists>y\<in>B. M(y) & pair(M,x,y,u))))" |
46 \<forall>u[M]. u \<in> z <-> (\<exists>x\<in>A. M(x) & (\<exists>y\<in>B. M(y) & pair(M,x,y,u)))" |
47 |
47 |
48 is_converse :: "[i=>o,i,i] => o" |
48 is_converse :: "[i=>o,i,i] => o" |
49 "is_converse(M,r,z) == |
49 "is_converse(M,r,z) == |
50 \<forall>x. M(x) --> |
50 \<forall>x. M(x) --> |
51 (x \<in> z <-> |
51 (x \<in> z <-> |
52 (\<exists>w\<in>r. M(w) & |
52 (\<exists>w\<in>r. M(w) & |
53 (\<exists>u v. M(u) & M(v) & pair(M,u,v,w) & pair(M,v,u,x))))" |
53 (\<exists>u[M]. \<exists>v[M]. pair(M,u,v,w) & pair(M,v,u,x))))" |
54 |
54 |
55 pre_image :: "[i=>o,i,i,i] => o" |
55 pre_image :: "[i=>o,i,i,i] => o" |
56 "pre_image(M,r,A,z) == |
56 "pre_image(M,r,A,z) == |
57 \<forall>x. M(x) --> (x \<in> z <-> (\<exists>w\<in>r. M(w) & (\<exists>y\<in>A. M(y) & pair(M,x,y,w))))" |
57 \<forall>x. M(x) --> (x \<in> z <-> (\<exists>w\<in>r. M(w) & (\<exists>y\<in>A. M(y) & pair(M,x,y,w))))" |
58 |
58 |
222 lemma univ0_Bex_abs [simp]: |
222 lemma univ0_Bex_abs [simp]: |
223 "A \<in> univ(0) ==> (\<exists>x\<in>A. x \<in> univ(0) & P(x)) <-> (\<exists>x\<in>A. P(x))" |
223 "A \<in> univ(0) ==> (\<exists>x\<in>A. x \<in> univ(0) & P(x)) <-> (\<exists>x\<in>A. P(x))" |
224 by (blast intro: univ0_downwards_mem) |
224 by (blast intro: univ0_downwards_mem) |
225 |
225 |
226 text{*Congruence rule for separation: can assume the variable is in @{text M}*} |
226 text{*Congruence rule for separation: can assume the variable is in @{text M}*} |
227 lemma [cong]: |
227 lemma separation_cong [cong]: |
228 "(!!x. M(x) ==> P(x) <-> P'(x)) ==> separation(M,P) <-> separation(M,P')" |
228 "(!!x. M(x) ==> P(x) <-> P'(x)) ==> separation(M,P) <-> separation(M,P')" |
229 by (simp add: separation_def) |
229 by (simp add: separation_def) |
230 |
230 |
231 text{*Congruence rules for replacement*} |
231 text{*Congruence rules for replacement*} |
232 lemma [cong]: |
232 lemma univalent_cong [cong]: |
233 "[| A=A'; !!x y. [| x\<in>A; M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] |
233 "[| A=A'; !!x y. [| x\<in>A; M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] |
234 ==> univalent(M,A,P) <-> univalent(M,A',P')" |
234 ==> univalent(M,A,P) <-> univalent(M,A',P')" |
235 by (simp add: univalent_def) |
235 by (simp add: univalent_def) |
236 |
236 |
237 lemma [cong]: |
237 lemma strong_replacement_cong [cong]: |
238 "[| !!x y. [| M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] |
238 "[| !!x y. [| M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] |
239 ==> strong_replacement(M,P) <-> strong_replacement(M,P')" |
239 ==> strong_replacement(M,P) <-> strong_replacement(M,P')" |
240 by (simp add: strong_replacement_def) |
240 by (simp add: strong_replacement_def) |
241 |
241 |
242 text{*The extensionality axiom*} |
242 text{*The extensionality axiom*} |
396 ==> separation(M, \<lambda>y. \<exists>p\<in>r. M(p) & (\<exists>x\<in>A. M(x) & pair(M,x,y,p)))" |
396 ==> separation(M, \<lambda>y. \<exists>p\<in>r. M(p) & (\<exists>x\<in>A. M(x) & pair(M,x,y,p)))" |
397 and vimage_separation: |
397 and vimage_separation: |
398 "[| M(A); M(r) |] |
398 "[| M(A); M(r) |] |
399 ==> separation(M, \<lambda>x. \<exists>p\<in>r. M(p) & (\<exists>y\<in>A. M(x) & pair(M,x,y,p)))" |
399 ==> separation(M, \<lambda>x. \<exists>p\<in>r. M(p) & (\<exists>y\<in>A. M(x) & pair(M,x,y,p)))" |
400 and converse_separation: |
400 and converse_separation: |
401 "M(r) ==> separation(M, \<lambda>z. \<exists>p\<in>r. M(p) & (\<exists>x y. M(x) & M(y) & |
401 "M(r) ==> separation(M, \<lambda>z. \<exists>p\<in>r. |
402 pair(M,x,y,p) & pair(M,y,x,z)))" |
402 M(p) & (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,p) & pair(M,y,x,z)))" |
403 and restrict_separation: |
403 and restrict_separation: |
404 "M(A) |
404 "M(A) |
405 ==> separation(M, \<lambda>z. \<exists>x\<in>A. M(x) & (\<exists>y. M(y) & pair(M,x,y,z)))" |
405 ==> separation(M, \<lambda>z. \<exists>x\<in>A. M(x) & (\<exists>y. M(y) & pair(M,x,y,z)))" |
406 and comp_separation: |
406 and comp_separation: |
407 "[| M(r); M(s) |] |
407 "[| M(r); M(s) |] |
614 lemma (in M_axioms) lam_closed [intro,simp]: |
614 lemma (in M_axioms) lam_closed [intro,simp]: |
615 "[| strong_replacement(M, \<lambda>x y. y = <x,b(x)>); M(A); \<forall>x\<in>A. M(b(x)) |] |
615 "[| strong_replacement(M, \<lambda>x y. y = <x,b(x)>); M(A); \<forall>x\<in>A. M(b(x)) |] |
616 ==> M(\<lambda>x\<in>A. b(x))" |
616 ==> M(\<lambda>x\<in>A. b(x))" |
617 by (simp add: lam_def, blast dest: transM) |
617 by (simp add: lam_def, blast dest: transM) |
618 |
618 |
619 lemma (in M_axioms) converse_abs [simp]: |
|
620 "[| M(r); M(z) |] ==> is_converse(M,r,z) <-> z = converse(r)" |
|
621 apply (simp add: is_converse_def) |
|
622 apply (rule iffI) |
|
623 apply (rule equalityI) |
|
624 apply (blast dest: transM) |
|
625 apply (clarify, frule transM, assumption, simp, blast) |
|
626 done |
|
627 |
|
628 lemma (in M_axioms) image_abs [simp]: |
619 lemma (in M_axioms) image_abs [simp]: |
629 "[| M(r); M(A); M(z) |] ==> image(M,r,A,z) <-> z = r``A" |
620 "[| M(r); M(A); M(z) |] ==> image(M,r,A,z) <-> z = r``A" |
630 apply (simp add: image_def) |
621 apply (simp add: image_def) |
631 apply (rule iffI) |
622 apply (rule iffI) |
632 apply (blast intro!: equalityI dest: transM, blast) |
623 apply (blast intro!: equalityI dest: transM, blast) |
646 apply (simp add: powerset_def) |
637 apply (simp add: powerset_def) |
647 apply (blast dest: transM) |
638 apply (blast dest: transM) |
648 done |
639 done |
649 |
640 |
650 lemma (in M_axioms) cartprod_iff_lemma: |
641 lemma (in M_axioms) cartprod_iff_lemma: |
651 "[| M(C); \<forall>u. M(u) --> u \<in> C <-> (\<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}); |
642 "[| M(C); \<forall>u[M]. u \<in> C <-> (\<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}); |
652 powerset(M, A \<union> B, p1); powerset(M, p1, p2); M(p2) |] |
643 powerset(M, A \<union> B, p1); powerset(M, p1, p2); M(p2) |] |
653 ==> C = {u \<in> p2 . \<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}}" |
644 ==> C = {u \<in> p2 . \<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}}" |
654 apply (simp add: powerset_def) |
645 apply (simp add: powerset_def) |
655 apply (rule equalityI, clarify, simp) |
646 apply (rule equalityI, clarify, simp) |
|
647 |
|
648 apply (frule transM, assumption) |
|
649 |
656 apply (frule transM, assumption, simp) |
650 apply (frule transM, assumption, simp) |
657 apply blast |
651 apply blast |
658 apply clarify |
652 apply clarify |
659 apply (frule transM, assumption, force) |
653 apply (frule transM, assumption, force) |
660 done |
654 done |
749 |
743 |
750 |
744 |
751 lemma (in M_axioms) M_converse_iff: |
745 lemma (in M_axioms) M_converse_iff: |
752 "M(r) ==> |
746 "M(r) ==> |
753 converse(r) = |
747 converse(r) = |
754 {z \<in> range(r) * domain(r). |
748 {z \<in> range(r) * domain(r). \<exists>p\<in>r. \<exists>x[M]. \<exists>y[M]. p = \<langle>x,y\<rangle> & z = \<langle>y,x\<rangle>}" |
755 \<exists>p\<in>r. \<exists>x. M(x) & (\<exists>y. M(y) & p = \<langle>x,y\<rangle> & z = \<langle>y,x\<rangle>)}" |
|
756 by (blast dest: transM) |
749 by (blast dest: transM) |
757 |
750 |
758 lemma (in M_axioms) converse_closed [intro,simp]: |
751 lemma (in M_axioms) converse_closed [intro,simp]: |
759 "M(r) ==> M(converse(r))" |
752 "M(r) ==> M(converse(r))" |
760 apply (simp add: M_converse_iff) |
753 apply (simp add: M_converse_iff) |
761 apply (insert converse_separation [of r], simp) |
754 apply (insert converse_separation [of r], simp) |
|
755 done |
|
756 |
|
757 lemma (in M_axioms) converse_abs [simp]: |
|
758 "[| M(r); M(z) |] ==> is_converse(M,r,z) <-> z = converse(r)" |
|
759 apply (simp add: is_converse_def) |
|
760 apply (rule iffI) |
|
761 prefer 2 apply (blast intro: elim:); |
|
762 apply (rule M_equalityI) |
|
763 apply (simp add: ) |
|
764 apply (blast dest: transM)+ |
762 done |
765 done |
763 |
766 |
764 lemma (in M_axioms) relation_abs [simp]: |
767 lemma (in M_axioms) relation_abs [simp]: |
765 "M(r) ==> is_relation(M,r) <-> relation(r)" |
768 "M(r) ==> is_relation(M,r) <-> relation(r)" |
766 apply (simp add: is_relation_def relation_def) |
769 apply (simp add: is_relation_def relation_def) |