author | wenzelm |
Mon, 19 Oct 2015 00:19:19 +0200 | |
changeset 61481 | 078ec7b710ab |
parent 61378 | 3e04c9ca001a |
child 61798 | 27f3c10b0b50 |
permissions | -rw-r--r-- |
615 | 1 |
(* Title: ZF/ZF.thy |
0 | 2 |
Author: Lawrence C Paulson and Martin D Coen, CU Computer Laboratory |
3 |
Copyright 1993 University of Cambridge |
|
14076 | 4 |
*) |
0 | 5 |
|
60770 | 6 |
section\<open>Zermelo-Fraenkel Set Theory\<close> |
0 | 7 |
|
37781
2fbbf0a48cef
moved misc legacy stuff from OldGoals to Misc_Legacy;
wenzelm
parents:
37405
diff
changeset
|
8 |
theory ZF |
48462
424fd5364f15
clarified "this_name" vs. former "reset" feature -- imitate the latter by loading other session sources directly;
wenzelm
parents:
46972
diff
changeset
|
9 |
imports "~~/src/FOL/FOL" |
37781
2fbbf0a48cef
moved misc legacy stuff from OldGoals to Misc_Legacy;
wenzelm
parents:
37405
diff
changeset
|
10 |
begin |
0 | 11 |
|
39128
93a7365fb4ee
turned eta_contract into proper configuration option;
wenzelm
parents:
38798
diff
changeset
|
12 |
declare [[eta_contract = false]] |
23168 | 13 |
|
14076 | 14 |
typedecl i |
55380
4de48353034e
prefer vacuous definitional type classes over axiomatic ones;
wenzelm
parents:
48733
diff
changeset
|
15 |
instance i :: "term" .. |
0 | 16 |
|
46972 | 17 |
axiomatization |
60770 | 18 |
zero :: "i" ("0") --\<open>the empty set\<close> and |
19 |
Pow :: "i => i" --\<open>power sets\<close> and |
|
20 |
Inf :: "i" --\<open>infinite set\<close> |
|
0 | 21 |
|
60770 | 22 |
text \<open>Bounded Quantifiers\<close> |
14076 | 23 |
consts |
13780 | 24 |
Ball :: "[i, i => o] => o" |
25 |
Bex :: "[i, i => o] => o" |
|
0 | 26 |
|
60770 | 27 |
text \<open>General Union and Intersection\<close> |
46972 | 28 |
axiomatization Union :: "i => i" |
29 |
consts Inter :: "i => i" |
|
0 | 30 |
|
60770 | 31 |
text \<open>Variations on Replacement\<close> |
46972 | 32 |
axiomatization PrimReplace :: "[i, [i, i] => o] => i" |
14076 | 33 |
consts |
13144 | 34 |
Replace :: "[i, [i, i] => o] => i" |
35 |
RepFun :: "[i, i => i] => i" |
|
36 |
Collect :: "[i, i => o] => i" |
|
0 | 37 |
|
60770 | 38 |
text\<open>Definite descriptions -- via Replace over the set "1"\<close> |
14076 | 39 |
consts |
13780 | 40 |
The :: "(i => o) => i" (binder "THE " 10) |
13144 | 41 |
If :: "[o, i, i] => i" ("(if (_)/ then (_)/ else (_))" [10] 10) |
6068 | 42 |
|
24826 | 43 |
abbreviation (input) |
44 |
old_if :: "[o, i, i] => i" ("if '(_,_,_')") where |
|
45 |
"if(P,a,b) == If(P,a,b)" |
|
6068 | 46 |
|
47 |
||
60770 | 48 |
text \<open>Finite Sets\<close> |
6068 | 49 |
consts |
13780 | 50 |
Upair :: "[i, i] => i" |
51 |
cons :: "[i, i] => i" |
|
52 |
succ :: "i => i" |
|
0 | 53 |
|
60770 | 54 |
text \<open>Ordered Pairing\<close> |
14076 | 55 |
consts |
13780 | 56 |
Pair :: "[i, i] => i" |
57 |
fst :: "i => i" |
|
58 |
snd :: "i => i" |
|
60770 | 59 |
split :: "[[i, i] => 'a, i] => 'a::{}" --\<open>for pattern-matching\<close> |
0 | 60 |
|
60770 | 61 |
text \<open>Sigma and Pi Operators\<close> |
14076 | 62 |
consts |
13780 | 63 |
Sigma :: "[i, i => i] => i" |
64 |
Pi :: "[i, i => i] => i" |
|
0 | 65 |
|
60770 | 66 |
text \<open>Relations and Functions\<close> |
14076 | 67 |
consts |
68 |
"domain" :: "i => i" |
|
13144 | 69 |
range :: "i => i" |
70 |
field :: "i => i" |
|
71 |
converse :: "i => i" |
|
60770 | 72 |
relation :: "i => o" --\<open>recognizes sets of pairs\<close> |
73 |
"function" :: "i => o" --\<open>recognizes functions; can have non-pairs\<close> |
|
13144 | 74 |
Lambda :: "[i, i => i] => i" |
75 |
restrict :: "[i, i] => i" |
|
0 | 76 |
|
60770 | 77 |
text \<open>Infixes in order of decreasing precedence\<close> |
14076 | 78 |
consts |
0 | 79 |
|
60770 | 80 |
Image :: "[i, i] => i" (infixl "``" 90) --\<open>image\<close> |
81 |
vimage :: "[i, i] => i" (infixl "-``" 90) --\<open>inverse image\<close> |
|
82 |
"apply" :: "[i, i] => i" (infixl "`" 90) --\<open>function application\<close> |
|
83 |
"Int" :: "[i, i] => i" (infixl "Int" 70) --\<open>binary intersection\<close> |
|
84 |
"Un" :: "[i, i] => i" (infixl "Un" 65) --\<open>binary union\<close> |
|
85 |
Diff :: "[i, i] => i" (infixl "-" 65) --\<open>set difference\<close> |
|
86 |
Subset :: "[i, i] => o" (infixl "<=" 50) --\<open>subset relation\<close> |
|
48733
18e76e2db6d4
proper axiomatization of "mem" -- do not leave it formally unspecified;
wenzelm
parents:
48462
diff
changeset
|
87 |
|
18e76e2db6d4
proper axiomatization of "mem" -- do not leave it formally unspecified;
wenzelm
parents:
48462
diff
changeset
|
88 |
axiomatization |
60770 | 89 |
mem :: "[i, i] => o" (infixl ":" 50) --\<open>membership relation\<close> |
24826 | 90 |
|
91 |
abbreviation |
|
60770 | 92 |
not_mem :: "[i, i] => o" (infixl "~:" 50) --\<open>negated membership relation\<close> |
24826 | 93 |
where "x ~: y == ~ (x : y)" |
94 |
||
95 |
abbreviation |
|
60770 | 96 |
cart_prod :: "[i, i] => i" (infixr "*" 80) --\<open>Cartesian product\<close> |
24826 | 97 |
where "A * B == Sigma(A, %_. B)" |
98 |
||
99 |
abbreviation |
|
60770 | 100 |
function_space :: "[i, i] => i" (infixr "->" 60) --\<open>function space\<close> |
24826 | 101 |
where "A -> B == Pi(A, %_. B)" |
0 | 102 |
|
103 |
||
41229
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
wenzelm
parents:
40714
diff
changeset
|
104 |
nonterminal "is" and patterns |
615 | 105 |
|
106 |
syntax |
|
13144 | 107 |
"" :: "i => is" ("_") |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
108 |
"_Enum" :: "[i, is] => is" ("_,/ _") |
24826 | 109 |
|
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
110 |
"_Finset" :: "is => i" ("{(_)}") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
111 |
"_Tuple" :: "[i, is] => i" ("<(_,/ _)>") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
112 |
"_Collect" :: "[pttrn, i, o] => i" ("(1{_: _ ./ _})") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
113 |
"_Replace" :: "[pttrn, pttrn, i, o] => i" ("(1{_ ./ _: _, _})") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
114 |
"_RepFun" :: "[i, pttrn, i] => i" ("(1{_ ./ _: _})" [51,0,51]) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
115 |
"_INTER" :: "[pttrn, i, i] => i" ("(3INT _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
116 |
"_UNION" :: "[pttrn, i, i] => i" ("(3UN _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
117 |
"_PROD" :: "[pttrn, i, i] => i" ("(3PROD _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
118 |
"_SUM" :: "[pttrn, i, i] => i" ("(3SUM _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
119 |
"_lam" :: "[pttrn, i, i] => i" ("(3lam _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
120 |
"_Ball" :: "[pttrn, i, o] => o" ("(3ALL _:_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
121 |
"_Bex" :: "[pttrn, i, o] => o" ("(3EX _:_./ _)" 10) |
1106
62bdb9e5722b
Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents:
690
diff
changeset
|
122 |
|
62bdb9e5722b
Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents:
690
diff
changeset
|
123 |
(** Patterns -- extends pre-defined type "pttrn" used in abstractions **) |
62bdb9e5722b
Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents:
690
diff
changeset
|
124 |
|
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
125 |
"_pattern" :: "patterns => pttrn" ("<_>") |
13144 | 126 |
"" :: "pttrn => patterns" ("_") |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
127 |
"_patterns" :: "[pttrn, patterns] => patterns" ("_,/_") |
615 | 128 |
|
0 | 129 |
translations |
35068 | 130 |
"{x, xs}" == "CONST cons(x, {xs})" |
131 |
"{x}" == "CONST cons(x, 0)" |
|
132 |
"{x:A. P}" == "CONST Collect(A, %x. P)" |
|
133 |
"{y. x:A, Q}" == "CONST Replace(A, %x y. Q)" |
|
134 |
"{b. x:A}" == "CONST RepFun(A, %x. b)" |
|
135 |
"INT x:A. B" == "CONST Inter({B. x:A})" |
|
136 |
"UN x:A. B" == "CONST Union({B. x:A})" |
|
137 |
"PROD x:A. B" == "CONST Pi(A, %x. B)" |
|
138 |
"SUM x:A. B" == "CONST Sigma(A, %x. B)" |
|
139 |
"lam x:A. f" == "CONST Lambda(A, %x. f)" |
|
140 |
"ALL x:A. P" == "CONST Ball(A, %x. P)" |
|
141 |
"EX x:A. P" == "CONST Bex(A, %x. P)" |
|
37 | 142 |
|
1106
62bdb9e5722b
Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents:
690
diff
changeset
|
143 |
"<x, y, z>" == "<x, <y, z>>" |
35068 | 144 |
"<x, y>" == "CONST Pair(x, y)" |
145 |
"%<x,y,zs>.b" == "CONST split(%x <y,zs>.b)" |
|
146 |
"%<x,y>.b" == "CONST split(%x y. b)" |
|
2286 | 147 |
|
0 | 148 |
|
24826 | 149 |
notation (xsymbols) |
150 |
cart_prod (infixr "\<times>" 80) and |
|
151 |
Int (infixl "\<inter>" 70) and |
|
152 |
Un (infixl "\<union>" 65) and |
|
153 |
function_space (infixr "\<rightarrow>" 60) and |
|
154 |
Subset (infixl "\<subseteq>" 50) and |
|
155 |
mem (infixl "\<in>" 50) and |
|
156 |
not_mem (infixl "\<notin>" 50) and |
|
157 |
Union ("\<Union>_" [90] 90) and |
|
158 |
Inter ("\<Inter>_" [90] 90) |
|
159 |
||
12114
a8e860c86252
eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents:
11322
diff
changeset
|
160 |
syntax (xsymbols) |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
161 |
"_Collect" :: "[pttrn, i, o] => i" ("(1{_ \<in> _ ./ _})") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
162 |
"_Replace" :: "[pttrn, pttrn, i, o] => i" ("(1{_ ./ _ \<in> _, _})") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
163 |
"_RepFun" :: "[i, pttrn, i] => i" ("(1{_ ./ _ \<in> _})" [51,0,51]) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
164 |
"_UNION" :: "[pttrn, i, i] => i" ("(3\<Union>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
165 |
"_INTER" :: "[pttrn, i, i] => i" ("(3\<Inter>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
166 |
"_PROD" :: "[pttrn, i, i] => i" ("(3\<Pi>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
167 |
"_SUM" :: "[pttrn, i, i] => i" ("(3\<Sigma>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
168 |
"_lam" :: "[pttrn, i, i] => i" ("(3\<lambda>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
169 |
"_Ball" :: "[pttrn, i, o] => o" ("(3\<forall>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
170 |
"_Bex" :: "[pttrn, i, o] => o" ("(3\<exists>_\<in>_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
171 |
"_Tuple" :: "[i, is] => i" ("\<langle>(_,/ _)\<rangle>") |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
35068
diff
changeset
|
172 |
"_pattern" :: "patterns => pttrn" ("\<langle>_\<rangle>") |
2540 | 173 |
|
37405 | 174 |
defs (* Bounded Quantifiers *) |
46820 | 175 |
Ball_def: "Ball(A, P) == \<forall>x. x\<in>A \<longrightarrow> P(x)" |
14227 | 176 |
Bex_def: "Bex(A, P) == \<exists>x. x\<in>A & P(x)" |
690 | 177 |
|
46820 | 178 |
subset_def: "A \<subseteq> B == \<forall>x\<in>A. x\<in>B" |
690 | 179 |
|
3906 | 180 |
|
41779 | 181 |
axiomatization where |
0 | 182 |
|
615 | 183 |
(* ZF axioms -- see Suppes p.238 |
184 |
Axioms for Union, Pow and Replace state existence only, |
|
185 |
uniqueness is derivable using extensionality. *) |
|
0 | 186 |
|
46820 | 187 |
extension: "A = B <-> A \<subseteq> B & B \<subseteq> A" and |
188 |
Union_iff: "A \<in> \<Union>(C) <-> (\<exists>B\<in>C. A\<in>B)" and |
|
189 |
Pow_iff: "A \<in> Pow(B) <-> A \<subseteq> B" and |
|
0 | 190 |
|
615 | 191 |
(*We may name this set, though it is not uniquely defined.*) |
41779 | 192 |
infinity: "0\<in>Inf & (\<forall>y\<in>Inf. succ(y): Inf)" and |
0 | 193 |
|
615 | 194 |
(*This formulation facilitates case analysis on A.*) |
46820 | 195 |
foundation: "A=0 | (\<exists>x\<in>A. \<forall>y\<in>x. y\<notin>A)" and |
0 | 196 |
|
615 | 197 |
(*Schema axiom since predicate P is a higher-order variable*) |
46820 | 198 |
replacement: "(\<forall>x\<in>A. \<forall>y z. P(x,y) & P(x,z) \<longrightarrow> y=z) ==> |
14227 | 199 |
b \<in> PrimReplace(A,P) <-> (\<exists>x\<in>A. P(x,b))" |
615 | 200 |
|
14883 | 201 |
|
690 | 202 |
defs |
203 |
||
615 | 204 |
(* Derived form of replacement, restricting P to its functional part. |
205 |
The resulting set (for functional P) is the same as with |
|
206 |
PrimReplace, but the rules are simpler. *) |
|
0 | 207 |
|
13780 | 208 |
Replace_def: "Replace(A,P) == PrimReplace(A, %x y. (EX!z. P(x,z)) & P(x,y))" |
615 | 209 |
|
210 |
(* Functional form of replacement -- analgous to ML's map functional *) |
|
0 | 211 |
|
14227 | 212 |
RepFun_def: "RepFun(A,f) == {y . x\<in>A, y=f(x)}" |
0 | 213 |
|
615 | 214 |
(* Separation and Pairing can be derived from the Replacement |
215 |
and Powerset Axioms using the following definitions. *) |
|
0 | 216 |
|
14227 | 217 |
Collect_def: "Collect(A,P) == {y . x\<in>A, x=y & P(x)}" |
0 | 218 |
|
615 | 219 |
(*Unordered pairs (Upair) express binary union/intersection and cons; |
220 |
set enumerations translate as {a,...,z} = cons(a,...,cons(z,0)...)*) |
|
0 | 221 |
|
14227 | 222 |
Upair_def: "Upair(a,b) == {y. x\<in>Pow(Pow(0)), (x=0 & y=a) | (x=Pow(0) & y=b)}" |
46820 | 223 |
cons_def: "cons(a,A) == Upair(a,a) \<union> A" |
13780 | 224 |
succ_def: "succ(i) == cons(i, i)" |
615 | 225 |
|
2872
ac81a17f86f8
Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents:
2540
diff
changeset
|
226 |
(* Difference, general intersection, binary union and small intersection *) |
ac81a17f86f8
Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents:
2540
diff
changeset
|
227 |
|
14227 | 228 |
Diff_def: "A - B == { x\<in>A . ~(x\<in>B) }" |
46820 | 229 |
Inter_def: "\<Inter>(A) == { x\<in>\<Union>(A) . \<forall>y\<in>A. x\<in>y}" |
230 |
Un_def: "A \<union> B == \<Union>(Upair(A,B))" |
|
231 |
Int_def: "A \<inter> B == \<Inter>(Upair(A,B))" |
|
2872
ac81a17f86f8
Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents:
2540
diff
changeset
|
232 |
|
14883 | 233 |
(* definite descriptions *) |
46820 | 234 |
the_def: "The(P) == \<Union>({y . x \<in> {0}, P(y)})" |
13780 | 235 |
if_def: "if(P,a,b) == THE z. P & z=a | ~P & z=b" |
0 | 236 |
|
615 | 237 |
(* this "symmetric" definition works better than {{a}, {a,b}} *) |
13780 | 238 |
Pair_def: "<a,b> == {{a,a}, {a,b}}" |
14227 | 239 |
fst_def: "fst(p) == THE a. \<exists>b. p=<a,b>" |
240 |
snd_def: "snd(p) == THE b. \<exists>a. p=<a,b>" |
|
13780 | 241 |
split_def: "split(c) == %p. c(fst(p), snd(p))" |
14227 | 242 |
Sigma_def: "Sigma(A,B) == \<Union>x\<in>A. \<Union>y\<in>B(x). {<x,y>}" |
0 | 243 |
|
615 | 244 |
(* Operations on relations *) |
0 | 245 |
|
615 | 246 |
(*converse of relation r, inverse of function*) |
14227 | 247 |
converse_def: "converse(r) == {z. w\<in>r, \<exists>x y. w=<x,y> & z=<y,x>}" |
0 | 248 |
|
14227 | 249 |
domain_def: "domain(r) == {x. w\<in>r, \<exists>y. w=<x,y>}" |
13780 | 250 |
range_def: "range(r) == domain(converse(r))" |
46820 | 251 |
field_def: "field(r) == domain(r) \<union> range(r)" |
14227 | 252 |
relation_def: "relation(r) == \<forall>z\<in>r. \<exists>x y. z = <x,y>" |
13780 | 253 |
function_def: "function(r) == |
46820 | 254 |
\<forall>x y. <x,y>:r \<longrightarrow> (\<forall>y'. <x,y'>:r \<longrightarrow> y=y')" |
255 |
image_def: "r `` A == {y \<in> range(r) . \<exists>x\<in>A. <x,y> \<in> r}" |
|
13780 | 256 |
vimage_def: "r -`` A == converse(r)``A" |
0 | 257 |
|
615 | 258 |
(* Abstraction, application and Cartesian product of a family of sets *) |
0 | 259 |
|
14227 | 260 |
lam_def: "Lambda(A,b) == {<x,b(x)> . x\<in>A}" |
46820 | 261 |
apply_def: "f`a == \<Union>(f``{a})" |
14227 | 262 |
Pi_def: "Pi(A,B) == {f\<in>Pow(Sigma(A,B)). A<=domain(f) & function(f)}" |
0 | 263 |
|
12891 | 264 |
(* Restrict the relation r to the domain A *) |
46820 | 265 |
restrict_def: "restrict(r,A) == {z \<in> r. \<exists>x\<in>A. \<exists>y. z = <x,y>}" |
13780 | 266 |
|
267 |
||
60770 | 268 |
subsection \<open>Substitution\<close> |
13780 | 269 |
|
270 |
(*Useful examples: singletonI RS subst_elem, subst_elem RSN (2,IntI) *) |
|
14227 | 271 |
lemma subst_elem: "[| b\<in>A; a=b |] ==> a\<in>A" |
13780 | 272 |
by (erule ssubst, assumption) |
273 |
||
274 |
||
60770 | 275 |
subsection\<open>Bounded universal quantifier\<close> |
13780 | 276 |
|
14227 | 277 |
lemma ballI [intro!]: "[| !!x. x\<in>A ==> P(x) |] ==> \<forall>x\<in>A. P(x)" |
13780 | 278 |
by (simp add: Ball_def) |
279 |
||
15481 | 280 |
lemmas strip = impI allI ballI |
281 |
||
14227 | 282 |
lemma bspec [dest?]: "[| \<forall>x\<in>A. P(x); x: A |] ==> P(x)" |
13780 | 283 |
by (simp add: Ball_def) |
284 |
||
285 |
(*Instantiates x first: better for automatic theorem proving?*) |
|
46820 | 286 |
lemma rev_ballE [elim]: |
287 |
"[| \<forall>x\<in>A. P(x); x\<notin>A ==> Q; P(x) ==> Q |] ==> Q" |
|
288 |
by (simp add: Ball_def, blast) |
|
13780 | 289 |
|
46820 | 290 |
lemma ballE: "[| \<forall>x\<in>A. P(x); P(x) ==> Q; x\<notin>A ==> Q |] ==> Q" |
13780 | 291 |
by blast |
292 |
||
293 |
(*Used in the datatype package*) |
|
14227 | 294 |
lemma rev_bspec: "[| x: A; \<forall>x\<in>A. P(x) |] ==> P(x)" |
13780 | 295 |
by (simp add: Ball_def) |
296 |
||
46820 | 297 |
(*Trival rewrite rule; @{term"(\<forall>x\<in>A.P)<->P"} holds only if A is nonempty!*) |
298 |
lemma ball_triv [simp]: "(\<forall>x\<in>A. P) <-> ((\<exists>x. x\<in>A) \<longrightarrow> P)" |
|
13780 | 299 |
by (simp add: Ball_def) |
300 |
||
301 |
(*Congruence rule for rewriting*) |
|
302 |
lemma ball_cong [cong]: |
|
14227 | 303 |
"[| A=A'; !!x. x\<in>A' ==> P(x) <-> P'(x) |] ==> (\<forall>x\<in>A. P(x)) <-> (\<forall>x\<in>A'. P'(x))" |
13780 | 304 |
by (simp add: Ball_def) |
305 |
||
18845 | 306 |
lemma atomize_ball: |
307 |
"(!!x. x \<in> A ==> P(x)) == Trueprop (\<forall>x\<in>A. P(x))" |
|
308 |
by (simp only: Ball_def atomize_all atomize_imp) |
|
309 |
||
310 |
lemmas [symmetric, rulify] = atomize_ball |
|
311 |
and [symmetric, defn] = atomize_ball |
|
312 |
||
13780 | 313 |
|
60770 | 314 |
subsection\<open>Bounded existential quantifier\<close> |
13780 | 315 |
|
14227 | 316 |
lemma bexI [intro]: "[| P(x); x: A |] ==> \<exists>x\<in>A. P(x)" |
13780 | 317 |
by (simp add: Bex_def, blast) |
318 |
||
46820 | 319 |
(*The best argument order when there is only one @{term"x\<in>A"}*) |
14227 | 320 |
lemma rev_bexI: "[| x\<in>A; P(x) |] ==> \<exists>x\<in>A. P(x)" |
13780 | 321 |
by blast |
322 |
||
46820 | 323 |
(*Not of the general form for such rules. The existential quanitifer becomes universal. *) |
14227 | 324 |
lemma bexCI: "[| \<forall>x\<in>A. ~P(x) ==> P(a); a: A |] ==> \<exists>x\<in>A. P(x)" |
13780 | 325 |
by blast |
326 |
||
14227 | 327 |
lemma bexE [elim!]: "[| \<exists>x\<in>A. P(x); !!x. [| x\<in>A; P(x) |] ==> Q |] ==> Q" |
13780 | 328 |
by (simp add: Bex_def, blast) |
329 |
||
46820 | 330 |
(*We do not even have @{term"(\<exists>x\<in>A. True) <-> True"} unless @{term"A" is nonempty!!*) |
14227 | 331 |
lemma bex_triv [simp]: "(\<exists>x\<in>A. P) <-> ((\<exists>x. x\<in>A) & P)" |
13780 | 332 |
by (simp add: Bex_def) |
333 |
||
334 |
lemma bex_cong [cong]: |
|
46820 | 335 |
"[| A=A'; !!x. x\<in>A' ==> P(x) <-> P'(x) |] |
14227 | 336 |
==> (\<exists>x\<in>A. P(x)) <-> (\<exists>x\<in>A'. P'(x))" |
13780 | 337 |
by (simp add: Bex_def cong: conj_cong) |
338 |
||
339 |
||
340 |
||
60770 | 341 |
subsection\<open>Rules for subsets\<close> |
13780 | 342 |
|
343 |
lemma subsetI [intro!]: |
|
46820 | 344 |
"(!!x. x\<in>A ==> x\<in>B) ==> A \<subseteq> B" |
345 |
by (simp add: subset_def) |
|
13780 | 346 |
|
347 |
(*Rule in Modus Ponens style [was called subsetE] *) |
|
46820 | 348 |
lemma subsetD [elim]: "[| A \<subseteq> B; c\<in>A |] ==> c\<in>B" |
13780 | 349 |
apply (unfold subset_def) |
350 |
apply (erule bspec, assumption) |
|
351 |
done |
|
352 |
||
353 |
(*Classical elimination rule*) |
|
354 |
lemma subsetCE [elim]: |
|
46820 | 355 |
"[| A \<subseteq> B; c\<notin>A ==> P; c\<in>B ==> P |] ==> P" |
356 |
by (simp add: subset_def, blast) |
|
13780 | 357 |
|
358 |
(*Sometimes useful with premises in this order*) |
|
14227 | 359 |
lemma rev_subsetD: "[| c\<in>A; A<=B |] ==> c\<in>B" |
13780 | 360 |
by blast |
361 |
||
46820 | 362 |
lemma contra_subsetD: "[| A \<subseteq> B; c \<notin> B |] ==> c \<notin> A" |
13780 | 363 |
by blast |
364 |
||
46820 | 365 |
lemma rev_contra_subsetD: "[| c \<notin> B; A \<subseteq> B |] ==> c \<notin> A" |
13780 | 366 |
by blast |
367 |
||
46820 | 368 |
lemma subset_refl [simp]: "A \<subseteq> A" |
13780 | 369 |
by blast |
370 |
||
371 |
lemma subset_trans: "[| A<=B; B<=C |] ==> A<=C" |
|
372 |
by blast |
|
373 |
||
374 |
(*Useful for proving A<=B by rewriting in some cases*) |
|
46820 | 375 |
lemma subset_iff: |
376 |
"A<=B <-> (\<forall>x. x\<in>A \<longrightarrow> x\<in>B)" |
|
13780 | 377 |
apply (unfold subset_def Ball_def) |
378 |
apply (rule iff_refl) |
|
379 |
done |
|
380 |
||
60770 | 381 |
text\<open>For calculations\<close> |
46907
eea3eb057fea
Structured proofs concerning the square of an infinite cardinal
paulson
parents:
46820
diff
changeset
|
382 |
declare subsetD [trans] rev_subsetD [trans] subset_trans [trans] |
eea3eb057fea
Structured proofs concerning the square of an infinite cardinal
paulson
parents:
46820
diff
changeset
|
383 |
|
13780 | 384 |
|
60770 | 385 |
subsection\<open>Rules for equality\<close> |
13780 | 386 |
|
387 |
(*Anti-symmetry of the subset relation*) |
|
46820 | 388 |
lemma equalityI [intro]: "[| A \<subseteq> B; B \<subseteq> A |] ==> A = B" |
389 |
by (rule extension [THEN iffD2], rule conjI) |
|
13780 | 390 |
|
391 |
||
14227 | 392 |
lemma equality_iffI: "(!!x. x\<in>A <-> x\<in>B) ==> A = B" |
13780 | 393 |
by (rule equalityI, blast+) |
394 |
||
45602 | 395 |
lemmas equalityD1 = extension [THEN iffD1, THEN conjunct1] |
396 |
lemmas equalityD2 = extension [THEN iffD1, THEN conjunct2] |
|
13780 | 397 |
|
398 |
lemma equalityE: "[| A = B; [| A<=B; B<=A |] ==> P |] ==> P" |
|
46820 | 399 |
by (blast dest: equalityD1 equalityD2) |
13780 | 400 |
|
401 |
lemma equalityCE: |
|
46820 | 402 |
"[| A = B; [| c\<in>A; c\<in>B |] ==> P; [| c\<notin>A; c\<notin>B |] ==> P |] ==> P" |
403 |
by (erule equalityE, blast) |
|
13780 | 404 |
|
27702 | 405 |
lemma equality_iffD: |
46820 | 406 |
"A = B ==> (!!x. x \<in> A <-> x \<in> B)" |
27702 | 407 |
by auto |
408 |
||
13780 | 409 |
|
60770 | 410 |
subsection\<open>Rules for Replace -- the derived form of replacement\<close> |
13780 | 411 |
|
46820 | 412 |
lemma Replace_iff: |
413 |
"b \<in> {y. x\<in>A, P(x,y)} <-> (\<exists>x\<in>A. P(x,b) & (\<forall>y. P(x,y) \<longrightarrow> y=b))" |
|
13780 | 414 |
apply (unfold Replace_def) |
415 |
apply (rule replacement [THEN iff_trans], blast+) |
|
416 |
done |
|
417 |
||
418 |
(*Introduction; there must be a unique y such that P(x,y), namely y=b. *) |
|
46820 | 419 |
lemma ReplaceI [intro]: |
420 |
"[| P(x,b); x: A; !!y. P(x,y) ==> y=b |] ==> |
|
421 |
b \<in> {y. x\<in>A, P(x,y)}" |
|
422 |
by (rule Replace_iff [THEN iffD2], blast) |
|
13780 | 423 |
|
424 |
(*Elimination; may asssume there is a unique y such that P(x,y), namely y=b. *) |
|
46820 | 425 |
lemma ReplaceE: |
426 |
"[| b \<in> {y. x\<in>A, P(x,y)}; |
|
427 |
!!x. [| x: A; P(x,b); \<forall>y. P(x,y)\<longrightarrow>y=b |] ==> R |
|
13780 | 428 |
|] ==> R" |
429 |
by (rule Replace_iff [THEN iffD1, THEN bexE], simp+) |
|
430 |
||
431 |
(*As above but without the (generally useless) 3rd assumption*) |
|
46820 | 432 |
lemma ReplaceE2 [elim!]: |
433 |
"[| b \<in> {y. x\<in>A, P(x,y)}; |
|
434 |
!!x. [| x: A; P(x,b) |] ==> R |
|
13780 | 435 |
|] ==> R" |
46820 | 436 |
by (erule ReplaceE, blast) |
13780 | 437 |
|
438 |
lemma Replace_cong [cong]: |
|
46820 | 439 |
"[| A=B; !!x y. x\<in>B ==> P(x,y) <-> Q(x,y) |] ==> |
13780 | 440 |
Replace(A,P) = Replace(B,Q)" |
46820 | 441 |
apply (rule equality_iffI) |
442 |
apply (simp add: Replace_iff) |
|
13780 | 443 |
done |
444 |
||
445 |
||
60770 | 446 |
subsection\<open>Rules for RepFun\<close> |
13780 | 447 |
|
46820 | 448 |
lemma RepFunI: "a \<in> A ==> f(a) \<in> {f(x). x\<in>A}" |
13780 | 449 |
by (simp add: RepFun_def Replace_iff, blast) |
450 |
||
451 |
(*Useful for coinduction proofs*) |
|
46820 | 452 |
lemma RepFun_eqI [intro]: "[| b=f(a); a \<in> A |] ==> b \<in> {f(x). x\<in>A}" |
13780 | 453 |
apply (erule ssubst) |
454 |
apply (erule RepFunI) |
|
455 |
done |
|
456 |
||
457 |
lemma RepFunE [elim!]: |
|
46820 | 458 |
"[| b \<in> {f(x). x\<in>A}; |
459 |
!!x.[| x\<in>A; b=f(x) |] ==> P |] ==> |
|
13780 | 460 |
P" |
46820 | 461 |
by (simp add: RepFun_def Replace_iff, blast) |
13780 | 462 |
|
46820 | 463 |
lemma RepFun_cong [cong]: |
14227 | 464 |
"[| A=B; !!x. x\<in>B ==> f(x)=g(x) |] ==> RepFun(A,f) = RepFun(B,g)" |
13780 | 465 |
by (simp add: RepFun_def) |
466 |
||
46820 | 467 |
lemma RepFun_iff [simp]: "b \<in> {f(x). x\<in>A} <-> (\<exists>x\<in>A. b=f(x))" |
13780 | 468 |
by (unfold Bex_def, blast) |
469 |
||
14227 | 470 |
lemma triv_RepFun [simp]: "{x. x\<in>A} = A" |
13780 | 471 |
by blast |
472 |
||
473 |
||
60770 | 474 |
subsection\<open>Rules for Collect -- forming a subset by separation\<close> |
13780 | 475 |
|
476 |
(*Separation is derivable from Replacement*) |
|
46820 | 477 |
lemma separation [simp]: "a \<in> {x\<in>A. P(x)} <-> a\<in>A & P(a)" |
13780 | 478 |
by (unfold Collect_def, blast) |
479 |
||
46820 | 480 |
lemma CollectI [intro!]: "[| a\<in>A; P(a) |] ==> a \<in> {x\<in>A. P(x)}" |
13780 | 481 |
by simp |
482 |
||
46820 | 483 |
lemma CollectE [elim!]: "[| a \<in> {x\<in>A. P(x)}; [| a\<in>A; P(a) |] ==> R |] ==> R" |
13780 | 484 |
by simp |
485 |
||
46820 | 486 |
lemma CollectD1: "a \<in> {x\<in>A. P(x)} ==> a\<in>A" |
13780 | 487 |
by (erule CollectE, assumption) |
488 |
||
46820 | 489 |
lemma CollectD2: "a \<in> {x\<in>A. P(x)} ==> P(a)" |
13780 | 490 |
by (erule CollectE, assumption) |
491 |
||
492 |
lemma Collect_cong [cong]: |
|
46820 | 493 |
"[| A=B; !!x. x\<in>B ==> P(x) <-> Q(x) |] |
13780 | 494 |
==> Collect(A, %x. P(x)) = Collect(B, %x. Q(x))" |
495 |
by (simp add: Collect_def) |
|
496 |
||
497 |
||
60770 | 498 |
subsection\<open>Rules for Unions\<close> |
13780 | 499 |
|
500 |
declare Union_iff [simp] |
|
501 |
||
502 |
(*The order of the premises presupposes that C is rigid; A may be flexible*) |
|
46820 | 503 |
lemma UnionI [intro]: "[| B: C; A: B |] ==> A: \<Union>(C)" |
13780 | 504 |
by (simp, blast) |
505 |
||
46820 | 506 |
lemma UnionE [elim!]: "[| A \<in> \<Union>(C); !!B.[| A: B; B: C |] ==> R |] ==> R" |
13780 | 507 |
by (simp, blast) |
508 |
||
509 |
||
60770 | 510 |
subsection\<open>Rules for Unions of families\<close> |
46820 | 511 |
(* @{term"\<Union>x\<in>A. B(x)"} abbreviates @{term"\<Union>({B(x). x\<in>A})"} *) |
13780 | 512 |
|
46820 | 513 |
lemma UN_iff [simp]: "b \<in> (\<Union>x\<in>A. B(x)) <-> (\<exists>x\<in>A. b \<in> B(x))" |
13780 | 514 |
by (simp add: Bex_def, blast) |
515 |
||
516 |
(*The order of the premises presupposes that A is rigid; b may be flexible*) |
|
14227 | 517 |
lemma UN_I: "[| a: A; b: B(a) |] ==> b: (\<Union>x\<in>A. B(x))" |
13780 | 518 |
by (simp, blast) |
519 |
||
520 |
||
46820 | 521 |
lemma UN_E [elim!]: |
522 |
"[| b \<in> (\<Union>x\<in>A. B(x)); !!x.[| x: A; b: B(x) |] ==> R |] ==> R" |
|
523 |
by blast |
|
13780 | 524 |
|
46820 | 525 |
lemma UN_cong: |
14227 | 526 |
"[| A=B; !!x. x\<in>B ==> C(x)=D(x) |] ==> (\<Union>x\<in>A. C(x)) = (\<Union>x\<in>B. D(x))" |
46820 | 527 |
by simp |
13780 | 528 |
|
529 |
||
46820 | 530 |
(*No "Addcongs [UN_cong]" because @{term\<Union>} is a combination of constants*) |
13780 | 531 |
|
532 |
(* UN_E appears before UnionE so that it is tried first, to avoid expensive |
|
533 |
calls to hyp_subst_tac. Cannot include UN_I as it is unsafe: would enlarge |
|
534 |
the search space.*) |
|
535 |
||
536 |
||
60770 | 537 |
subsection\<open>Rules for the empty set\<close> |
13780 | 538 |
|
46820 | 539 |
(*The set @{term"{x\<in>0. False}"} is empty; by foundation it equals 0 |
13780 | 540 |
See Suppes, page 21.*) |
46820 | 541 |
lemma not_mem_empty [simp]: "a \<notin> 0" |
13780 | 542 |
apply (cut_tac foundation) |
543 |
apply (best dest: equalityD2) |
|
544 |
done |
|
545 |
||
45602 | 546 |
lemmas emptyE [elim!] = not_mem_empty [THEN notE] |
13780 | 547 |
|
548 |
||
46820 | 549 |
lemma empty_subsetI [simp]: "0 \<subseteq> A" |
550 |
by blast |
|
13780 | 551 |
|
14227 | 552 |
lemma equals0I: "[| !!y. y\<in>A ==> False |] ==> A=0" |
13780 | 553 |
by blast |
554 |
||
46820 | 555 |
lemma equals0D [dest]: "A=0 ==> a \<notin> A" |
13780 | 556 |
by blast |
557 |
||
558 |
declare sym [THEN equals0D, dest] |
|
559 |
||
46820 | 560 |
lemma not_emptyI: "a\<in>A ==> A \<noteq> 0" |
13780 | 561 |
by blast |
562 |
||
46820 | 563 |
lemma not_emptyE: "[| A \<noteq> 0; !!x. x\<in>A ==> R |] ==> R" |
13780 | 564 |
by blast |
565 |
||
566 |
||
60770 | 567 |
subsection\<open>Rules for Inter\<close> |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
568 |
|
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
569 |
(*Not obviously useful for proving InterI, InterD, InterE*) |
46820 | 570 |
lemma Inter_iff: "A \<in> \<Inter>(C) <-> (\<forall>x\<in>C. A: x) & C\<noteq>0" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
571 |
by (simp add: Inter_def Ball_def, blast) |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
572 |
|
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
573 |
(* Intersection is well-behaved only if the family is non-empty! *) |
46820 | 574 |
lemma InterI [intro!]: |
575 |
"[| !!x. x: C ==> A: x; C\<noteq>0 |] ==> A \<in> \<Inter>(C)" |
|
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
576 |
by (simp add: Inter_iff) |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
577 |
|
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
578 |
(*A "destruct" rule -- every B in C contains A as an element, but |
14227 | 579 |
A\<in>B can hold when B\<in>C does not! This rule is analogous to "spec". *) |
46820 | 580 |
lemma InterD [elim, Pure.elim]: "[| A \<in> \<Inter>(C); B \<in> C |] ==> A \<in> B" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
581 |
by (unfold Inter_def, blast) |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
582 |
|
46820 | 583 |
(*"Classical" elimination rule -- does not require exhibiting @{term"B\<in>C"} *) |
584 |
lemma InterE [elim]: |
|
585 |
"[| A \<in> \<Inter>(C); B\<notin>C ==> R; A\<in>B ==> R |] ==> R" |
|
586 |
by (simp add: Inter_def, blast) |
|
587 |
||
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
588 |
|
60770 | 589 |
subsection\<open>Rules for Intersections of families\<close> |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
590 |
|
46820 | 591 |
(* @{term"\<Inter>x\<in>A. B(x)"} abbreviates @{term"\<Inter>({B(x). x\<in>A})"} *) |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
592 |
|
46820 | 593 |
lemma INT_iff: "b \<in> (\<Inter>x\<in>A. B(x)) <-> (\<forall>x\<in>A. b \<in> B(x)) & A\<noteq>0" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
594 |
by (force simp add: Inter_def) |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
595 |
|
14227 | 596 |
lemma INT_I: "[| !!x. x: A ==> b: B(x); A\<noteq>0 |] ==> b: (\<Inter>x\<in>A. B(x))" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
597 |
by blast |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
598 |
|
46820 | 599 |
lemma INT_E: "[| b \<in> (\<Inter>x\<in>A. B(x)); a: A |] ==> b \<in> B(a)" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
600 |
by blast |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
601 |
|
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
602 |
lemma INT_cong: |
14227 | 603 |
"[| A=B; !!x. x\<in>B ==> C(x)=D(x) |] ==> (\<Inter>x\<in>A. C(x)) = (\<Inter>x\<in>B. D(x))" |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
604 |
by simp |
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
605 |
|
46820 | 606 |
(*No "Addcongs [INT_cong]" because @{term\<Inter>} is a combination of constants*) |
14095
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
607 |
|
a1ba833d6b61
Changed many Intersection rules from i:I to I~=0 to avoid introducing a new
paulson
parents:
14076
diff
changeset
|
608 |
|
60770 | 609 |
subsection\<open>Rules for Powersets\<close> |
13780 | 610 |
|
46820 | 611 |
lemma PowI: "A \<subseteq> B ==> A \<in> Pow(B)" |
13780 | 612 |
by (erule Pow_iff [THEN iffD2]) |
613 |
||
14227 | 614 |
lemma PowD: "A \<in> Pow(B) ==> A<=B" |
13780 | 615 |
by (erule Pow_iff [THEN iffD1]) |
616 |
||
617 |
declare Pow_iff [iff] |
|
618 |
||
60770 | 619 |
lemmas Pow_bottom = empty_subsetI [THEN PowI] --\<open>@{term"0 \<in> Pow(B)"}\<close> |
620 |
lemmas Pow_top = subset_refl [THEN PowI] --\<open>@{term"A \<in> Pow(A)"}\<close> |
|
13780 | 621 |
|
622 |
||
60770 | 623 |
subsection\<open>Cantor's Theorem: There is no surjection from a set to its powerset.\<close> |
13780 | 624 |
|
46820 | 625 |
(*The search is undirected. Allowing redundant introduction rules may |
13780 | 626 |
make it diverge. Variable b represents ANY map, such as |
14227 | 627 |
(lam x\<in>A.b(x)): A->Pow(A). *) |
46820 | 628 |
lemma cantor: "\<exists>S \<in> Pow(A). \<forall>x\<in>A. b(x) \<noteq> S" |
13780 | 629 |
by (best elim!: equalityCE del: ReplaceI RepFun_eqI) |
630 |
||
0 | 631 |
end |
632 |