author | wenzelm |
Sun, 30 Jul 2000 13:02:14 +0200 | |
changeset 9473 | 7d13a5ace928 |
parent 9447 | e5180c869772 |
child 9608 | a50dcf0475ad |
permissions | -rw-r--r-- |
1465 | 1 |
(* Title: HOL/equalities |
923 | 2 |
ID: $Id$ |
1465 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
923 | 4 |
Copyright 1994 University of Cambridge |
5 |
||
6 |
Equalities involving union, intersection, inclusion, etc. |
|
7 |
*) |
|
8 |
||
9 |
writeln"File HOL/equalities"; |
|
10 |
||
1754
852093aeb0ab
Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents:
1748
diff
changeset
|
11 |
AddSIs [equalityI]; |
852093aeb0ab
Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents:
1748
diff
changeset
|
12 |
|
1548 | 13 |
section "{}"; |
14 |
||
7824
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
15 |
(*supersedes Collect_False_empty*) |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
16 |
Goal "{s. P} = (if P then UNIV else {})"; |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
17 |
by (Force_tac 1); |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
18 |
qed "Collect_const"; |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
19 |
Addsimps [Collect_const]; |
1531 | 20 |
|
5069 | 21 |
Goal "(A <= {}) = (A = {})"; |
2891 | 22 |
by (Blast_tac 1); |
1531 | 23 |
qed "subset_empty"; |
9338 | 24 |
Addsimps[subset_empty]; |
1531 | 25 |
|
5069 | 26 |
Goalw [psubset_def] "~ (A < {})"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
27 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
28 |
qed "not_psubset_empty"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
29 |
AddIffs [not_psubset_empty]; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
30 |
|
9206 | 31 |
Goal "(Collect P = {}) = (ALL x. ~ P x)"; |
7958 | 32 |
by Auto_tac; |
33 |
qed "Collect_empty_eq"; |
|
34 |
Addsimps[Collect_empty_eq]; |
|
35 |
||
8993 | 36 |
Goal "{x. ~ (P x)} = - {x. P x}"; |
37 |
by (Blast_tac 1); |
|
38 |
qed "Collect_neg_eq"; |
|
39 |
||
5069 | 40 |
Goal "{x. P x | Q x} = {x. P x} Un {x. Q x}"; |
4748 | 41 |
by (Blast_tac 1); |
42 |
qed "Collect_disj_eq"; |
|
43 |
||
5069 | 44 |
Goal "{x. P x & Q x} = {x. P x} Int {x. Q x}"; |
4748 | 45 |
by (Blast_tac 1); |
46 |
qed "Collect_conj_eq"; |
|
47 |
||
7845 | 48 |
Goal "{x. ALL y. P x y} = (INT y. {x. P x y})"; |
49 |
by (Blast_tac 1); |
|
50 |
qed "Collect_all_eq"; |
|
51 |
||
52 |
Goal "{x. ALL y: A. P x y} = (INT y: A. {x. P x y})"; |
|
53 |
by (Blast_tac 1); |
|
54 |
qed "Collect_ball_eq"; |
|
55 |
||
56 |
Goal "{x. EX y. P x y} = (UN y. {x. P x y})"; |
|
57 |
by (Blast_tac 1); |
|
58 |
qed "Collect_ex_eq"; |
|
59 |
||
60 |
Goal "{x. EX y: A. P x y} = (UN y: A. {x. P x y})"; |
|
61 |
by (Blast_tac 1); |
|
62 |
qed "Collect_bex_eq"; |
|
63 |
||
4748 | 64 |
|
1548 | 65 |
section "insert"; |
923 | 66 |
|
1531 | 67 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a {}*) |
5069 | 68 |
Goal "insert a A = {a} Un A"; |
2891 | 69 |
by (Blast_tac 1); |
1531 | 70 |
qed "insert_is_Un"; |
71 |
||
5069 | 72 |
Goal "insert a A ~= {}"; |
4089 | 73 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
74 |
qed"insert_not_empty"; |
1531 | 75 |
Addsimps[insert_not_empty]; |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
76 |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
77 |
bind_thm("empty_not_insert",insert_not_empty RS not_sym); |
1531 | 78 |
Addsimps[empty_not_insert]; |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
79 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
80 |
Goal "a:A ==> insert a A = A"; |
2891 | 81 |
by (Blast_tac 1); |
923 | 82 |
qed "insert_absorb"; |
6832 | 83 |
(* Addsimps [insert_absorb] causes recursive calls |
84 |
when there are nested inserts, with QUADRATIC running time |
|
4605 | 85 |
*) |
923 | 86 |
|
5069 | 87 |
Goal "insert x (insert x A) = insert x A"; |
2891 | 88 |
by (Blast_tac 1); |
1531 | 89 |
qed "insert_absorb2"; |
90 |
Addsimps [insert_absorb2]; |
|
91 |
||
5069 | 92 |
Goal "insert x (insert y A) = insert y (insert x A)"; |
2891 | 93 |
by (Blast_tac 1); |
1879 | 94 |
qed "insert_commute"; |
95 |
||
5069 | 96 |
Goal "(insert x A <= B) = (x:B & A <= B)"; |
2891 | 97 |
by (Blast_tac 1); |
923 | 98 |
qed "insert_subset"; |
1531 | 99 |
Addsimps[insert_subset]; |
100 |
||
101 |
(* use new B rather than (A-{a}) to avoid infinite unfolding *) |
|
9206 | 102 |
Goal "a:A ==> EX B. A = insert a B & a ~: B"; |
1553 | 103 |
by (res_inst_tac [("x","A-{a}")] exI 1); |
2891 | 104 |
by (Blast_tac 1); |
1531 | 105 |
qed "mk_disjoint_insert"; |
923 | 106 |
|
9422 | 107 |
bind_thm ("insert_Collect", prove_goal (the_context ()) |
5590 | 108 |
"insert a (Collect P) = {u. u ~= a --> P u}" (K [Auto_tac])); |
4882 | 109 |
|
5941
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
110 |
Goal "u: A ==> (UN x:A. insert a (B x)) = insert a (UN x:A. B x)"; |
2891 | 111 |
by (Blast_tac 1); |
1843
a6d7aef48c2f
Removed the unused eq_cs, and added some distributive laws
paulson
parents:
1786
diff
changeset
|
112 |
qed "UN_insert_distrib"; |
a6d7aef48c2f
Removed the unused eq_cs, and added some distributive laws
paulson
parents:
1786
diff
changeset
|
113 |
|
1660 | 114 |
section "``"; |
923 | 115 |
|
5069 | 116 |
Goal "f``{} = {}"; |
2891 | 117 |
by (Blast_tac 1); |
923 | 118 |
qed "image_empty"; |
1531 | 119 |
Addsimps[image_empty]; |
923 | 120 |
|
5069 | 121 |
Goal "f``insert a B = insert (f a) (f``B)"; |
2891 | 122 |
by (Blast_tac 1); |
923 | 123 |
qed "image_insert"; |
1531 | 124 |
Addsimps[image_insert]; |
923 | 125 |
|
6292
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
126 |
Goal "x:A ==> (%x. c) `` A = {c}"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
127 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
128 |
qed "image_constant"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
129 |
|
5069 | 130 |
Goal "f``(g``A) = (%x. f (g x)) `` A"; |
3457 | 131 |
by (Blast_tac 1); |
4059 | 132 |
qed "image_image"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
133 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
134 |
Goal "x:A ==> insert (f x) (f``A) = f``A"; |
2891 | 135 |
by (Blast_tac 1); |
1884 | 136 |
qed "insert_image"; |
137 |
Addsimps [insert_image]; |
|
138 |
||
5069 | 139 |
Goal "(f``A = {}) = (A = {})"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
140 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
3415
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
141 |
qed "image_is_empty"; |
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
142 |
AddIffs [image_is_empty]; |
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
143 |
|
5281 | 144 |
Goal "f `` {x. P x} = {f x | x. P x}"; |
5319
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
145 |
by (Blast_tac 1); |
5281 | 146 |
qed "image_Collect"; |
147 |
Addsimps [image_Collect]; |
|
148 |
||
5590 | 149 |
Goalw [image_def] "(%x. if P x then f x else g x) `` S \ |
150 |
\ = (f `` (S Int {x. P x})) Un (g `` (S Int {x. ~(P x)}))"; |
|
4686 | 151 |
by (Simp_tac 1); |
2891 | 152 |
by (Blast_tac 1); |
1748 | 153 |
qed "if_image_distrib"; |
154 |
Addsimps[if_image_distrib]; |
|
155 |
||
5590 | 156 |
val prems = Goal "[|M = N; !!x. x:N ==> f x = g x|] ==> f``M = g``N"; |
4136 | 157 |
by (simp_tac (simpset() addsimps image_def::prems) 1); |
158 |
qed "image_cong"; |
|
159 |
||
1748 | 160 |
|
7958 | 161 |
section "range"; |
162 |
||
9206 | 163 |
Goal "{u. EX x. u = f x} = range f"; |
7958 | 164 |
by Auto_tac; |
165 |
qed "full_SetCompr_eq"; |
|
166 |
||
8161 | 167 |
Goal "range (%x. f (g x)) = f``range g"; |
168 |
by (stac image_image 1); |
|
169 |
by (Simp_tac 1); |
|
170 |
qed "range_composition"; |
|
171 |
Addsimps[range_composition]; |
|
7958 | 172 |
|
1548 | 173 |
section "Int"; |
923 | 174 |
|
5069 | 175 |
Goal "A Int A = A"; |
2891 | 176 |
by (Blast_tac 1); |
923 | 177 |
qed "Int_absorb"; |
1531 | 178 |
Addsimps[Int_absorb]; |
923 | 179 |
|
5590 | 180 |
Goal "A Int (A Int B) = A Int B"; |
4609 | 181 |
by (Blast_tac 1); |
182 |
qed "Int_left_absorb"; |
|
183 |
||
5590 | 184 |
Goal "A Int B = B Int A"; |
2891 | 185 |
by (Blast_tac 1); |
923 | 186 |
qed "Int_commute"; |
187 |
||
5069 | 188 |
Goal "A Int (B Int C) = B Int (A Int C)"; |
4609 | 189 |
by (Blast_tac 1); |
190 |
qed "Int_left_commute"; |
|
191 |
||
5590 | 192 |
Goal "(A Int B) Int C = A Int (B Int C)"; |
2891 | 193 |
by (Blast_tac 1); |
923 | 194 |
qed "Int_assoc"; |
195 |
||
4609 | 196 |
(*Intersection is an AC-operator*) |
7648 | 197 |
bind_thms ("Int_ac", [Int_assoc, Int_left_absorb, Int_commute, Int_left_commute]); |
4609 | 198 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
199 |
Goal "B<=A ==> A Int B = B"; |
4662 | 200 |
by (Blast_tac 1); |
201 |
qed "Int_absorb1"; |
|
202 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
203 |
Goal "A<=B ==> A Int B = A"; |
4662 | 204 |
by (Blast_tac 1); |
205 |
qed "Int_absorb2"; |
|
206 |
||
5069 | 207 |
Goal "{} Int B = {}"; |
2891 | 208 |
by (Blast_tac 1); |
923 | 209 |
qed "Int_empty_left"; |
1531 | 210 |
Addsimps[Int_empty_left]; |
923 | 211 |
|
5069 | 212 |
Goal "A Int {} = {}"; |
2891 | 213 |
by (Blast_tac 1); |
923 | 214 |
qed "Int_empty_right"; |
1531 | 215 |
Addsimps[Int_empty_right]; |
216 |
||
5490 | 217 |
Goal "(A Int B = {}) = (A <= -B)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
218 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
3356 | 219 |
qed "disjoint_eq_subset_Compl"; |
220 |
||
7877 | 221 |
Goal "(A Int B = {}) = (ALL x:A. ALL y:B. x ~= y)"; |
222 |
by (Blast_tac 1); |
|
223 |
qed "disjoint_iff_not_equal"; |
|
224 |
||
5069 | 225 |
Goal "UNIV Int B = B"; |
2891 | 226 |
by (Blast_tac 1); |
1531 | 227 |
qed "Int_UNIV_left"; |
228 |
Addsimps[Int_UNIV_left]; |
|
229 |
||
5069 | 230 |
Goal "A Int UNIV = A"; |
2891 | 231 |
by (Blast_tac 1); |
1531 | 232 |
qed "Int_UNIV_right"; |
233 |
Addsimps[Int_UNIV_right]; |
|
923 | 234 |
|
5069 | 235 |
Goal "A Int B = Inter{A,B}"; |
4634 | 236 |
by (Blast_tac 1); |
237 |
qed "Int_eq_Inter"; |
|
238 |
||
5590 | 239 |
Goal "A Int (B Un C) = (A Int B) Un (A Int C)"; |
2891 | 240 |
by (Blast_tac 1); |
923 | 241 |
qed "Int_Un_distrib"; |
242 |
||
5590 | 243 |
Goal "(B Un C) Int A = (B Int A) Un (C Int A)"; |
2891 | 244 |
by (Blast_tac 1); |
1618 | 245 |
qed "Int_Un_distrib2"; |
246 |
||
5069 | 247 |
Goal "(A Int B = UNIV) = (A = UNIV & B = UNIV)"; |
4089 | 248 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
1531 | 249 |
qed "Int_UNIV"; |
250 |
Addsimps[Int_UNIV]; |
|
251 |
||
5319
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
252 |
Goal "(C <= A Int B) = (C <= A & C <= B)"; |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
253 |
by (Blast_tac 1); |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
254 |
qed "Int_subset_iff"; |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
255 |
|
7713 | 256 |
Goal "(x : A Int {x. P x}) = (x : A & P x)"; |
257 |
by (Blast_tac 1); |
|
258 |
qed "Int_Collect"; |
|
5319
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
259 |
|
1548 | 260 |
section "Un"; |
923 | 261 |
|
5069 | 262 |
Goal "A Un A = A"; |
2891 | 263 |
by (Blast_tac 1); |
923 | 264 |
qed "Un_absorb"; |
1531 | 265 |
Addsimps[Un_absorb]; |
923 | 266 |
|
5069 | 267 |
Goal " A Un (A Un B) = A Un B"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
268 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
269 |
qed "Un_left_absorb"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
270 |
|
5590 | 271 |
Goal "A Un B = B Un A"; |
2891 | 272 |
by (Blast_tac 1); |
923 | 273 |
qed "Un_commute"; |
274 |
||
5069 | 275 |
Goal "A Un (B Un C) = B Un (A Un C)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
276 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
277 |
qed "Un_left_commute"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
278 |
|
5590 | 279 |
Goal "(A Un B) Un C = A Un (B Un C)"; |
2891 | 280 |
by (Blast_tac 1); |
923 | 281 |
qed "Un_assoc"; |
282 |
||
4609 | 283 |
(*Union is an AC-operator*) |
7648 | 284 |
bind_thms ("Un_ac", [Un_assoc, Un_left_absorb, Un_commute, Un_left_commute]); |
4609 | 285 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
286 |
Goal "A<=B ==> A Un B = B"; |
4662 | 287 |
by (Blast_tac 1); |
288 |
qed "Un_absorb1"; |
|
289 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
290 |
Goal "B<=A ==> A Un B = A"; |
4662 | 291 |
by (Blast_tac 1); |
292 |
qed "Un_absorb2"; |
|
293 |
||
5069 | 294 |
Goal "{} Un B = B"; |
2891 | 295 |
by (Blast_tac 1); |
923 | 296 |
qed "Un_empty_left"; |
1531 | 297 |
Addsimps[Un_empty_left]; |
923 | 298 |
|
5069 | 299 |
Goal "A Un {} = A"; |
2891 | 300 |
by (Blast_tac 1); |
923 | 301 |
qed "Un_empty_right"; |
1531 | 302 |
Addsimps[Un_empty_right]; |
303 |
||
5069 | 304 |
Goal "UNIV Un B = UNIV"; |
2891 | 305 |
by (Blast_tac 1); |
1531 | 306 |
qed "Un_UNIV_left"; |
307 |
Addsimps[Un_UNIV_left]; |
|
308 |
||
5069 | 309 |
Goal "A Un UNIV = UNIV"; |
2891 | 310 |
by (Blast_tac 1); |
1531 | 311 |
qed "Un_UNIV_right"; |
312 |
Addsimps[Un_UNIV_right]; |
|
923 | 313 |
|
5069 | 314 |
Goal "A Un B = Union{A,B}"; |
4634 | 315 |
by (Blast_tac 1); |
316 |
qed "Un_eq_Union"; |
|
317 |
||
5069 | 318 |
Goal "(insert a B) Un C = insert a (B Un C)"; |
2891 | 319 |
by (Blast_tac 1); |
923 | 320 |
qed "Un_insert_left"; |
3384
5ef99c94e1fb
Now Un_insert_left, Un_insert_right are default rewrite rules
paulson
parents:
3356
diff
changeset
|
321 |
Addsimps[Un_insert_left]; |
923 | 322 |
|
5069 | 323 |
Goal "A Un (insert a B) = insert a (A Un B)"; |
2891 | 324 |
by (Blast_tac 1); |
1917 | 325 |
qed "Un_insert_right"; |
3384
5ef99c94e1fb
Now Un_insert_left, Un_insert_right are default rewrite rules
paulson
parents:
3356
diff
changeset
|
326 |
Addsimps[Un_insert_right]; |
1917 | 327 |
|
5069 | 328 |
Goal "(insert a B) Int C = (if a:C then insert a (B Int C) \ |
5590 | 329 |
\ else B Int C)"; |
4686 | 330 |
by (Simp_tac 1); |
3356 | 331 |
by (Blast_tac 1); |
332 |
qed "Int_insert_left"; |
|
333 |
||
5069 | 334 |
Goal "A Int (insert a B) = (if a:A then insert a (A Int B) \ |
5590 | 335 |
\ else A Int B)"; |
4686 | 336 |
by (Simp_tac 1); |
3356 | 337 |
by (Blast_tac 1); |
338 |
qed "Int_insert_right"; |
|
339 |
||
5590 | 340 |
Goal "A Un (B Int C) = (A Un B) Int (A Un C)"; |
2891 | 341 |
by (Blast_tac 1); |
923 | 342 |
qed "Un_Int_distrib"; |
343 |
||
5590 | 344 |
Goal "(B Int C) Un A = (B Un A) Int (C Un A)"; |
4609 | 345 |
by (Blast_tac 1); |
346 |
qed "Un_Int_distrib2"; |
|
347 |
||
5590 | 348 |
Goal "(A Int B) Un (B Int C) Un (C Int A) = \ |
349 |
\ (A Un B) Int (B Un C) Int (C Un A)"; |
|
2891 | 350 |
by (Blast_tac 1); |
923 | 351 |
qed "Un_Int_crazy"; |
352 |
||
5069 | 353 |
Goal "(A<=B) = (A Un B = B)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
354 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 355 |
qed "subset_Un_eq"; |
356 |
||
5069 | 357 |
Goal "(A Un B = {}) = (A = {} & B = {})"; |
4089 | 358 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
923 | 359 |
qed "Un_empty"; |
9098
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
360 |
AddIffs[Un_empty]; |
923 | 361 |
|
5319
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
362 |
Goal "(A Un B <= C) = (A <= C & B <= C)"; |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
363 |
by (Blast_tac 1); |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
364 |
qed "Un_subset_iff"; |
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
365 |
|
5331 | 366 |
Goal "(A - B) Un (A Int B) = A"; |
367 |
by (Blast_tac 1); |
|
368 |
qed "Un_Diff_Int"; |
|
369 |
||
5319
7356d0c88b1b
Moved Un_subset_iff and Int_subset_iff from UNITY to equalities.ML
paulson
parents:
5316
diff
changeset
|
370 |
|
5931 | 371 |
section "Set complement"; |
923 | 372 |
|
8333 | 373 |
Goal "A Int -A = {}"; |
2891 | 374 |
by (Blast_tac 1); |
923 | 375 |
qed "Compl_disjoint"; |
8333 | 376 |
|
377 |
Goal "-A Int A = {}"; |
|
378 |
by (Blast_tac 1); |
|
379 |
qed "Compl_disjoint2"; |
|
380 |
Addsimps[Compl_disjoint, Compl_disjoint2]; |
|
923 | 381 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
382 |
Goal "A Un (-A) = UNIV"; |
2891 | 383 |
by (Blast_tac 1); |
923 | 384 |
qed "Compl_partition"; |
385 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
386 |
Goal "- (-A) = (A:: 'a set)"; |
2891 | 387 |
by (Blast_tac 1); |
923 | 388 |
qed "double_complement"; |
1531 | 389 |
Addsimps[double_complement]; |
923 | 390 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
391 |
Goal "-(A Un B) = (-A) Int (-B)"; |
2891 | 392 |
by (Blast_tac 1); |
923 | 393 |
qed "Compl_Un"; |
394 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
395 |
Goal "-(A Int B) = (-A) Un (-B)"; |
2891 | 396 |
by (Blast_tac 1); |
923 | 397 |
qed "Compl_Int"; |
398 |
||
5490 | 399 |
Goal "-(UN x:A. B(x)) = (INT x:A. -B(x))"; |
2891 | 400 |
by (Blast_tac 1); |
923 | 401 |
qed "Compl_UN"; |
402 |
||
5490 | 403 |
Goal "-(INT x:A. B(x)) = (UN x:A. -B(x))"; |
2891 | 404 |
by (Blast_tac 1); |
923 | 405 |
qed "Compl_INT"; |
406 |
||
4615 | 407 |
Addsimps [Compl_Un, Compl_Int, Compl_UN, Compl_INT]; |
408 |
||
8121 | 409 |
Goal "(A <= -A) = (A = {})"; |
410 |
by (Blast_tac 1); |
|
411 |
qed "subset_Compl_self_eq"; |
|
412 |
||
923 | 413 |
(*Halmos, Naive Set Theory, page 16.*) |
5069 | 414 |
Goal "((A Int B) Un C = A Int (B Un C)) = (C<=A)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
415 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 416 |
qed "Un_Int_assoc_eq"; |
417 |
||
8333 | 418 |
Goal "-UNIV = {}"; |
419 |
by (Blast_tac 1); |
|
420 |
qed "Compl_UNIV_eq"; |
|
421 |
||
422 |
Goal "-{} = UNIV"; |
|
423 |
by (Blast_tac 1); |
|
424 |
qed "Compl_empty_eq"; |
|
425 |
||
426 |
Addsimps [Compl_UNIV_eq, Compl_empty_eq]; |
|
427 |
||
9447 | 428 |
Goal "(-A <= -B) = (B <= (A::'a set))"; |
429 |
by(Blast_tac 1); |
|
430 |
qed "Compl_subset_Compl_iff"; |
|
431 |
AddIffs [Compl_subset_Compl_iff]; |
|
432 |
||
433 |
Goal "(-A = -B) = (A = (B::'a set))"; |
|
434 |
by(Blast_tac 1); |
|
435 |
qed "Compl_eq_Compl_iff"; |
|
436 |
AddIffs [Compl_eq_Compl_iff]; |
|
437 |
||
923 | 438 |
|
1548 | 439 |
section "Union"; |
923 | 440 |
|
5069 | 441 |
Goal "Union({}) = {}"; |
2891 | 442 |
by (Blast_tac 1); |
923 | 443 |
qed "Union_empty"; |
1531 | 444 |
Addsimps[Union_empty]; |
445 |
||
5069 | 446 |
Goal "Union(UNIV) = UNIV"; |
2891 | 447 |
by (Blast_tac 1); |
1531 | 448 |
qed "Union_UNIV"; |
449 |
Addsimps[Union_UNIV]; |
|
923 | 450 |
|
5069 | 451 |
Goal "Union(insert a B) = a Un Union(B)"; |
2891 | 452 |
by (Blast_tac 1); |
923 | 453 |
qed "Union_insert"; |
1531 | 454 |
Addsimps[Union_insert]; |
923 | 455 |
|
5069 | 456 |
Goal "Union(A Un B) = Union(A) Un Union(B)"; |
2891 | 457 |
by (Blast_tac 1); |
923 | 458 |
qed "Union_Un_distrib"; |
1531 | 459 |
Addsimps[Union_Un_distrib]; |
923 | 460 |
|
5069 | 461 |
Goal "Union(A Int B) <= Union(A) Int Union(B)"; |
2891 | 462 |
by (Blast_tac 1); |
923 | 463 |
qed "Union_Int_subset"; |
464 |
||
9098
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
465 |
Goal "(Union A = {}) = (ALL x:A. x={})"; |
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
466 |
by Auto_tac; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
467 |
qed "Union_empty_conv"; |
4003 | 468 |
AddIffs [Union_empty_conv]; |
469 |
||
9206 | 470 |
Goal "(Union(C) Int A = {}) = (ALL B:C. B Int A = {})"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
471 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 472 |
qed "Union_disjoint"; |
473 |
||
1548 | 474 |
section "Inter"; |
475 |
||
5069 | 476 |
Goal "Inter({}) = UNIV"; |
2891 | 477 |
by (Blast_tac 1); |
1531 | 478 |
qed "Inter_empty"; |
479 |
Addsimps[Inter_empty]; |
|
480 |
||
5069 | 481 |
Goal "Inter(UNIV) = {}"; |
2891 | 482 |
by (Blast_tac 1); |
1531 | 483 |
qed "Inter_UNIV"; |
484 |
Addsimps[Inter_UNIV]; |
|
485 |
||
5069 | 486 |
Goal "Inter(insert a B) = a Int Inter(B)"; |
2891 | 487 |
by (Blast_tac 1); |
1531 | 488 |
qed "Inter_insert"; |
489 |
Addsimps[Inter_insert]; |
|
490 |
||
5069 | 491 |
Goal "Inter(A) Un Inter(B) <= Inter(A Int B)"; |
2891 | 492 |
by (Blast_tac 1); |
1564
822575c737bd
Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents:
1553
diff
changeset
|
493 |
qed "Inter_Un_subset"; |
1531 | 494 |
|
5069 | 495 |
Goal "Inter(A Un B) = Inter(A) Int Inter(B)"; |
2891 | 496 |
by (Blast_tac 1); |
923 | 497 |
qed "Inter_Un_distrib"; |
498 |
||
1548 | 499 |
section "UN and INT"; |
923 | 500 |
|
501 |
(*Basic identities*) |
|
502 |
||
5069 | 503 |
Goal "(UN x:{}. B x) = {}"; |
2891 | 504 |
by (Blast_tac 1); |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
505 |
qed "UN_empty"; |
1531 | 506 |
Addsimps[UN_empty]; |
507 |
||
5069 | 508 |
Goal "(UN x:A. {}) = {}"; |
3457 | 509 |
by (Blast_tac 1); |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
510 |
qed "UN_empty2"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
511 |
Addsimps[UN_empty2]; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
512 |
|
5069 | 513 |
Goal "(UN x:A. {x}) = A"; |
4645 | 514 |
by (Blast_tac 1); |
515 |
qed "UN_singleton"; |
|
516 |
Addsimps [UN_singleton]; |
|
517 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
518 |
Goal "k:I ==> A k Un (UN i:I. A i) = (UN i:I. A i)"; |
4634 | 519 |
by (Blast_tac 1); |
520 |
qed "UN_absorb"; |
|
521 |
||
5069 | 522 |
Goal "(INT x:{}. B x) = UNIV"; |
2891 | 523 |
by (Blast_tac 1); |
1531 | 524 |
qed "INT_empty"; |
525 |
Addsimps[INT_empty]; |
|
526 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
527 |
Goal "k:I ==> A k Int (INT i:I. A i) = (INT i:I. A i)"; |
4634 | 528 |
by (Blast_tac 1); |
529 |
qed "INT_absorb"; |
|
530 |
||
5069 | 531 |
Goal "(UN x:insert a A. B x) = B a Un UNION A B"; |
2891 | 532 |
by (Blast_tac 1); |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
533 |
qed "UN_insert"; |
1531 | 534 |
Addsimps[UN_insert]; |
535 |
||
5999 | 536 |
Goal "(UN i: A Un B. M i) = (UN i: A. M i) Un (UN i:B. M i)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
537 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
538 |
qed "UN_Un"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
539 |
|
5069 | 540 |
Goal "(UN x : (UN y:A. B y). C x) = (UN y:A. UN x: B y. C x)"; |
4771 | 541 |
by (Blast_tac 1); |
542 |
qed "UN_UN_flatten"; |
|
543 |
||
6292
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
544 |
Goal "((UN i:I. A i) <= B) = (ALL i:I. A i <= B)"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
545 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
546 |
qed "UN_subset_iff"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
547 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
548 |
Goal "(B <= (INT i:I. A i)) = (ALL i:I. B <= A i)"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
549 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
550 |
qed "INT_subset_iff"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
551 |
|
5069 | 552 |
Goal "(INT x:insert a A. B x) = B a Int INTER A B"; |
2891 | 553 |
by (Blast_tac 1); |
1531 | 554 |
qed "INT_insert"; |
555 |
Addsimps[INT_insert]; |
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
556 |
|
5999 | 557 |
Goal "(INT i: A Un B. M i) = (INT i: A. M i) Int (INT i:B. M i)"; |
558 |
by (Blast_tac 1); |
|
559 |
qed "INT_Un"; |
|
560 |
||
5941
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
561 |
Goal "u: A ==> (INT x:A. insert a (B x)) = insert a (INT x:A. B x)"; |
2891 | 562 |
by (Blast_tac 1); |
2021 | 563 |
qed "INT_insert_distrib"; |
564 |
||
5069 | 565 |
Goal "Union(B``A) = (UN x:A. B(x))"; |
2891 | 566 |
by (Blast_tac 1); |
923 | 567 |
qed "Union_image_eq"; |
6292
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
568 |
Addsimps [Union_image_eq]; |
923 | 569 |
|
6283 | 570 |
Goal "f `` Union S = (UN x:S. f `` x)"; |
571 |
by (Blast_tac 1); |
|
8176 | 572 |
qed "image_Union"; |
6283 | 573 |
|
5069 | 574 |
Goal "Inter(B``A) = (INT x:A. B(x))"; |
2891 | 575 |
by (Blast_tac 1); |
923 | 576 |
qed "Inter_image_eq"; |
6292
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
577 |
Addsimps [Inter_image_eq]; |
923 | 578 |
|
8313
c7a87e79e9b1
replaced UN_constant, INT_constant by unconditional versions that rewrite
paulson
parents:
8176
diff
changeset
|
579 |
Goal "(UN y:A. c) = (if A={} then {} else c)"; |
c7a87e79e9b1
replaced UN_constant, INT_constant by unconditional versions that rewrite
paulson
parents:
8176
diff
changeset
|
580 |
by Auto_tac; |
923 | 581 |
qed "UN_constant"; |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
582 |
Addsimps[UN_constant]; |
923 | 583 |
|
8313
c7a87e79e9b1
replaced UN_constant, INT_constant by unconditional versions that rewrite
paulson
parents:
8176
diff
changeset
|
584 |
Goal "(INT y:A. c) = (if A={} then UNIV else c)"; |
c7a87e79e9b1
replaced UN_constant, INT_constant by unconditional versions that rewrite
paulson
parents:
8176
diff
changeset
|
585 |
by Auto_tac; |
923 | 586 |
qed "INT_constant"; |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
587 |
Addsimps[INT_constant]; |
923 | 588 |
|
9206 | 589 |
Goal "(UN x:A. B(x)) = Union({Y. EX x:A. Y=B(x)})"; |
2891 | 590 |
by (Blast_tac 1); |
923 | 591 |
qed "UN_eq"; |
592 |
||
593 |
(*Look: it has an EXISTENTIAL quantifier*) |
|
9206 | 594 |
Goal "(INT x:A. B(x)) = Inter({Y. EX x:A. Y=B(x)})"; |
2891 | 595 |
by (Blast_tac 1); |
923 | 596 |
qed "INT_eq"; |
597 |
||
9098
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
598 |
Goal "(UNION A B = {}) = (ALL x:A. B x = {})"; |
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
599 |
by Auto_tac; |
9312 | 600 |
qed "UN_empty3"; |
601 |
AddIffs [UN_empty3]; |
|
9098
3a0912a127ec
new theorem UN_empty; it and Un_empty inserted by AddIffs
paulson
parents:
9077
diff
changeset
|
602 |
|
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
603 |
|
923 | 604 |
(*Distributive laws...*) |
605 |
||
5069 | 606 |
Goal "A Int Union(B) = (UN C:B. A Int C)"; |
2891 | 607 |
by (Blast_tac 1); |
923 | 608 |
qed "Int_Union"; |
609 |
||
5069 | 610 |
Goal "Union(B) Int A = (UN C:B. C Int A)"; |
4674 | 611 |
by (Blast_tac 1); |
612 |
qed "Int_Union2"; |
|
613 |
||
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
614 |
(* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: |
923 | 615 |
Union of a family of unions **) |
5069 | 616 |
Goal "(UN x:C. A(x) Un B(x)) = Union(A``C) Un Union(B``C)"; |
2891 | 617 |
by (Blast_tac 1); |
923 | 618 |
qed "Un_Union_image"; |
619 |
||
620 |
(*Equivalent version*) |
|
5069 | 621 |
Goal "(UN i:I. A(i) Un B(i)) = (UN i:I. A(i)) Un (UN i:I. B(i))"; |
2891 | 622 |
by (Blast_tac 1); |
923 | 623 |
qed "UN_Un_distrib"; |
624 |
||
5069 | 625 |
Goal "A Un Inter(B) = (INT C:B. A Un C)"; |
2891 | 626 |
by (Blast_tac 1); |
923 | 627 |
qed "Un_Inter"; |
628 |
||
5069 | 629 |
Goal "(INT x:C. A(x) Int B(x)) = Inter(A``C) Int Inter(B``C)"; |
2891 | 630 |
by (Blast_tac 1); |
923 | 631 |
qed "Int_Inter_image"; |
632 |
||
633 |
(*Equivalent version*) |
|
5069 | 634 |
Goal "(INT i:I. A(i) Int B(i)) = (INT i:I. A(i)) Int (INT i:I. B(i))"; |
2891 | 635 |
by (Blast_tac 1); |
923 | 636 |
qed "INT_Int_distrib"; |
637 |
||
638 |
(*Halmos, Naive Set Theory, page 35.*) |
|
5069 | 639 |
Goal "B Int (UN i:I. A(i)) = (UN i:I. B Int A(i))"; |
2891 | 640 |
by (Blast_tac 1); |
923 | 641 |
qed "Int_UN_distrib"; |
642 |
||
5069 | 643 |
Goal "B Un (INT i:I. A(i)) = (INT i:I. B Un A(i))"; |
2891 | 644 |
by (Blast_tac 1); |
923 | 645 |
qed "Un_INT_distrib"; |
646 |
||
5278 | 647 |
Goal "(UN i:I. A(i)) Int (UN j:J. B(j)) = (UN i:I. UN j:J. A(i) Int B(j))"; |
2891 | 648 |
by (Blast_tac 1); |
923 | 649 |
qed "Int_UN_distrib2"; |
650 |
||
5278 | 651 |
Goal "(INT i:I. A(i)) Un (INT j:J. B(j)) = (INT i:I. INT j:J. A(i) Un B(j))"; |
2891 | 652 |
by (Blast_tac 1); |
923 | 653 |
qed "Un_INT_distrib2"; |
654 |
||
2512 | 655 |
|
656 |
section"Bounded quantifiers"; |
|
657 |
||
3860 | 658 |
(** The following are not added to the default simpset because |
659 |
(a) they duplicate the body and (b) there are no similar rules for Int. **) |
|
2512 | 660 |
|
5069 | 661 |
Goal "(ALL x:A Un B. P x) = ((ALL x:A. P x) & (ALL x:B. P x))"; |
2891 | 662 |
by (Blast_tac 1); |
2519 | 663 |
qed "ball_Un"; |
664 |
||
5069 | 665 |
Goal "(EX x:A Un B. P x) = ((EX x:A. P x) | (EX x:B. P x))"; |
2891 | 666 |
by (Blast_tac 1); |
2519 | 667 |
qed "bex_Un"; |
2512 | 668 |
|
5069 | 669 |
Goal "(ALL z: UNION A B. P z) = (ALL x:A. ALL z:B x. P z)"; |
4771 | 670 |
by (Blast_tac 1); |
671 |
qed "ball_UN"; |
|
672 |
||
5069 | 673 |
Goal "(EX z: UNION A B. P z) = (EX x:A. EX z:B x. P z)"; |
4771 | 674 |
by (Blast_tac 1); |
675 |
qed "bex_UN"; |
|
676 |
||
2512 | 677 |
|
1548 | 678 |
section "-"; |
923 | 679 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
680 |
Goal "A-B = A Int (-B)"; |
4609 | 681 |
by (Blast_tac 1); |
4662 | 682 |
qed "Diff_eq"; |
4609 | 683 |
|
7516 | 684 |
Goal "(A-B = {}) = (A<=B)"; |
685 |
by (Blast_tac 1); |
|
686 |
qed "Diff_eq_empty_iff"; |
|
687 |
Addsimps[Diff_eq_empty_iff]; |
|
688 |
||
5069 | 689 |
Goal "A-A = {}"; |
2891 | 690 |
by (Blast_tac 1); |
923 | 691 |
qed "Diff_cancel"; |
1531 | 692 |
Addsimps[Diff_cancel]; |
923 | 693 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
694 |
Goal "A Int B = {} ==> A-B = A"; |
4674 | 695 |
by (blast_tac (claset() addEs [equalityE]) 1); |
696 |
qed "Diff_triv"; |
|
697 |
||
5069 | 698 |
Goal "{}-A = {}"; |
2891 | 699 |
by (Blast_tac 1); |
923 | 700 |
qed "empty_Diff"; |
1531 | 701 |
Addsimps[empty_Diff]; |
923 | 702 |
|
5069 | 703 |
Goal "A-{} = A"; |
2891 | 704 |
by (Blast_tac 1); |
923 | 705 |
qed "Diff_empty"; |
1531 | 706 |
Addsimps[Diff_empty]; |
707 |
||
5069 | 708 |
Goal "A-UNIV = {}"; |
2891 | 709 |
by (Blast_tac 1); |
1531 | 710 |
qed "Diff_UNIV"; |
711 |
Addsimps[Diff_UNIV]; |
|
712 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
713 |
Goal "x~:A ==> A - insert x B = A-B"; |
2891 | 714 |
by (Blast_tac 1); |
1531 | 715 |
qed "Diff_insert0"; |
716 |
Addsimps [Diff_insert0]; |
|
923 | 717 |
|
718 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*) |
|
5069 | 719 |
Goal "A - insert a B = A - B - {a}"; |
2891 | 720 |
by (Blast_tac 1); |
923 | 721 |
qed "Diff_insert"; |
722 |
||
723 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*) |
|
5069 | 724 |
Goal "A - insert a B = A - {a} - B"; |
2891 | 725 |
by (Blast_tac 1); |
923 | 726 |
qed "Diff_insert2"; |
727 |
||
5069 | 728 |
Goal "insert x A - B = (if x:B then A-B else insert x (A-B))"; |
4686 | 729 |
by (Simp_tac 1); |
2891 | 730 |
by (Blast_tac 1); |
1531 | 731 |
qed "insert_Diff_if"; |
732 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
733 |
Goal "x:B ==> insert x A - B = A-B"; |
2891 | 734 |
by (Blast_tac 1); |
1531 | 735 |
qed "insert_Diff1"; |
736 |
Addsimps [insert_Diff1]; |
|
737 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
738 |
Goal "a:A ==> insert a (A-{a}) = A"; |
2922 | 739 |
by (Blast_tac 1); |
923 | 740 |
qed "insert_Diff"; |
741 |
||
7824
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
742 |
Goal "x ~: A ==> (insert x A) - {x} = A"; |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
743 |
by Auto_tac; |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
744 |
qed "Diff_insert_absorb"; |
1a85ba81d019
new default simprule Collect_const and new them Diff_insert_absorb
paulson
parents:
7713
diff
changeset
|
745 |
|
5069 | 746 |
Goal "A Int (B-A) = {}"; |
2891 | 747 |
by (Blast_tac 1); |
923 | 748 |
qed "Diff_disjoint"; |
1531 | 749 |
Addsimps[Diff_disjoint]; |
923 | 750 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
751 |
Goal "A<=B ==> A Un (B-A) = B"; |
2891 | 752 |
by (Blast_tac 1); |
923 | 753 |
qed "Diff_partition"; |
754 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5069
diff
changeset
|
755 |
Goal "[| A<=B; B<= C |] ==> (B - (C - A)) = (A :: 'a set)"; |
2891 | 756 |
by (Blast_tac 1); |
923 | 757 |
qed "double_diff"; |
758 |
||
5069 | 759 |
Goal "A Un (B-A) = A Un B"; |
4645 | 760 |
by (Blast_tac 1); |
761 |
qed "Un_Diff_cancel"; |
|
762 |
||
5069 | 763 |
Goal "(B-A) Un A = B Un A"; |
4645 | 764 |
by (Blast_tac 1); |
765 |
qed "Un_Diff_cancel2"; |
|
766 |
||
767 |
Addsimps [Un_Diff_cancel, Un_Diff_cancel2]; |
|
768 |
||
5069 | 769 |
Goal "A - (B Un C) = (A-B) Int (A-C)"; |
2891 | 770 |
by (Blast_tac 1); |
923 | 771 |
qed "Diff_Un"; |
772 |
||
5069 | 773 |
Goal "A - (B Int C) = (A-B) Un (A-C)"; |
2891 | 774 |
by (Blast_tac 1); |
923 | 775 |
qed "Diff_Int"; |
776 |
||
5069 | 777 |
Goal "(A Un B) - C = (A - C) Un (B - C)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
778 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
779 |
qed "Un_Diff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
780 |
|
5069 | 781 |
Goal "(A Int B) - C = A Int (B - C)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
782 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
783 |
qed "Int_Diff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
784 |
|
5069 | 785 |
Goal "C Int (A-B) = (C Int A) - (C Int B)"; |
4748 | 786 |
by (Blast_tac 1); |
787 |
qed "Diff_Int_distrib"; |
|
788 |
||
5069 | 789 |
Goal "(A-B) Int C = (A Int C) - (B Int C)"; |
4645 | 790 |
by (Blast_tac 1); |
4748 | 791 |
qed "Diff_Int_distrib2"; |
4645 | 792 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
6832
diff
changeset
|
793 |
Goal "A - (- B) = A Int B"; |
5632 | 794 |
by Auto_tac; |
795 |
qed "Diff_Compl"; |
|
796 |
Addsimps [Diff_Compl]; |
|
797 |
||
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
798 |
|
5238 | 799 |
section "Quantification over type \"bool\""; |
800 |
||
801 |
Goal "(ALL b::bool. P b) = (P True & P False)"; |
|
802 |
by Auto_tac; |
|
803 |
by (case_tac "b" 1); |
|
804 |
by Auto_tac; |
|
805 |
qed "all_bool_eq"; |
|
806 |
||
5762 | 807 |
bind_thm ("bool_induct", conjI RS (all_bool_eq RS iffD2) RS spec); |
808 |
||
5238 | 809 |
Goal "(EX b::bool. P b) = (P True | P False)"; |
810 |
by Auto_tac; |
|
811 |
by (case_tac "b" 1); |
|
812 |
by Auto_tac; |
|
813 |
qed "ex_bool_eq"; |
|
814 |
||
815 |
Goal "A Un B = (UN b. if b then A else B)"; |
|
8026 | 816 |
by (auto_tac(claset(), simpset() addsimps [split_if_mem2])); |
5238 | 817 |
qed "Un_eq_UN"; |
818 |
||
819 |
Goal "(UN b::bool. A b) = (A True Un A False)"; |
|
820 |
by Auto_tac; |
|
821 |
by (case_tac "b" 1); |
|
822 |
by Auto_tac; |
|
823 |
qed "UN_bool_eq"; |
|
824 |
||
825 |
Goal "(INT b::bool. A b) = (A True Int A False)"; |
|
826 |
by Auto_tac; |
|
827 |
by (case_tac "b" 1); |
|
828 |
by Auto_tac; |
|
829 |
qed "INT_bool_eq"; |
|
830 |
||
831 |
||
6292
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
832 |
section "Pow"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
833 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
834 |
Goalw [Pow_def] "Pow {} = {{}}"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
835 |
by Auto_tac; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
836 |
qed "Pow_empty"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
837 |
Addsimps [Pow_empty]; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
838 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
839 |
Goal "Pow (insert a A) = Pow A Un (insert a `` Pow A)"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
840 |
by Safe_tac; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
841 |
by (etac swap 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
842 |
by (res_inst_tac [("x", "x-{a}")] image_eqI 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
843 |
by (ALLGOALS Blast_tac); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
844 |
qed "Pow_insert"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
845 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
846 |
Goal "Pow (- A) = {-B |B. A: Pow B}"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
847 |
by Safe_tac; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
848 |
by (Blast_tac 2); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
849 |
by (res_inst_tac [("x", "-x")] exI 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
850 |
by (ALLGOALS Blast_tac); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
851 |
qed "Pow_Compl"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
852 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
853 |
Goal "Pow UNIV = UNIV"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
854 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
855 |
qed "Pow_UNIV"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
856 |
Addsimps [Pow_UNIV]; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
857 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
858 |
Goal "Pow(A) Un Pow(B) <= Pow(A Un B)"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
859 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
860 |
qed "Un_Pow_subset"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
861 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
862 |
Goal "(UN x:A. Pow(B(x))) <= Pow(UN x:A. B(x))"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
863 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
864 |
qed "UN_Pow_subset"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
865 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
866 |
Goal "A <= Pow(Union(A))"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
867 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
868 |
qed "subset_Pow_Union"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
869 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
870 |
Goal "Union(Pow(A)) = A"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
871 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
872 |
qed "Union_Pow_eq"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
873 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
874 |
Goal "Pow(A Int B) = Pow(A) Int Pow(B)"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
875 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
876 |
qed "Pow_Int_eq"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
877 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
878 |
Goal "Pow(INT x:A. B(x)) = (INT x:A. Pow(B(x)))"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
879 |
by (Blast_tac 1); |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
880 |
qed "Pow_INT_eq"; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
881 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
882 |
Addsimps [Union_Pow_eq, Pow_Int_eq]; |
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
883 |
|
e50e1142dd06
new results e.g. about Pow; new simprules Union_image_eq, Inter_image_eq
paulson
parents:
6283
diff
changeset
|
884 |
|
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
885 |
section "Miscellany"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
886 |
|
5069 | 887 |
Goal "(A = B) = ((A <= (B::'a set)) & (B<=A))"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
888 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
889 |
qed "set_eq_subset"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
890 |
|
9206 | 891 |
Goal "A <= B = (ALL t. t:A --> t:B)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
892 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
893 |
qed "subset_iff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
894 |
|
5069 | 895 |
Goalw [psubset_def] "((A::'a set) <= B) = ((A < B) | (A=B))"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
896 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
897 |
qed "subset_iff_psubset_eq"; |
2021 | 898 |
|
9206 | 899 |
Goal "(ALL x. x ~: A) = (A={})"; |
4423 | 900 |
by (Blast_tac 1); |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3860
diff
changeset
|
901 |
qed "all_not_in_conv"; |
3907 | 902 |
AddIffs [all_not_in_conv]; |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3860
diff
changeset
|
903 |
|
6007 | 904 |
|
5189
362e4d6213c5
Added theorem distinct_lemma (needed for datatypes).
berghofe
parents:
5148
diff
changeset
|
905 |
(** for datatypes **) |
362e4d6213c5
Added theorem distinct_lemma (needed for datatypes).
berghofe
parents:
5148
diff
changeset
|
906 |
Goal "f x ~= f y ==> x ~= y"; |
362e4d6213c5
Added theorem distinct_lemma (needed for datatypes).
berghofe
parents:
5148
diff
changeset
|
907 |
by (Fast_tac 1); |
362e4d6213c5
Added theorem distinct_lemma (needed for datatypes).
berghofe
parents:
5148
diff
changeset
|
908 |
qed "distinct_lemma"; |
362e4d6213c5
Added theorem distinct_lemma (needed for datatypes).
berghofe
parents:
5148
diff
changeset
|
909 |
|
2021 | 910 |
|
911 |
(** Miniscoping: pushing in big Unions and Intersections **) |
|
912 |
local |
|
9422 | 913 |
fun prover s = prove_goal (the_context ()) s (fn _ => [Blast_tac 1]) |
2021 | 914 |
in |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
915 |
val UN_simps = map prover |
5941
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
916 |
["!!C. c: C ==> (UN x:C. insert a (B x)) = insert a (UN x:C. B x)", |
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
917 |
"!!C. c: C ==> (UN x:C. A x Un B) = ((UN x:C. A x) Un B)", |
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
918 |
"!!C. c: C ==> (UN x:C. A Un B x) = (A Un (UN x:C. B x))", |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
919 |
"(UN x:C. A x Int B) = ((UN x:C. A x) Int B)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
920 |
"(UN x:C. A Int B x) = (A Int (UN x:C. B x))", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
921 |
"(UN x:C. A x - B) = ((UN x:C. A x) - B)", |
4231 | 922 |
"(UN x:C. A - B x) = (A - (INT x:C. B x))", |
7914 | 923 |
"(UN x: Union A. B x) = (UN y:A. UN x:y. B x)", |
924 |
"(UN z: UNION A B. C z) = (UN x:A. UN z: B(x). C z)", |
|
4231 | 925 |
"(UN x:f``A. B x) = (UN a:A. B(f a))"]; |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
926 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
927 |
val INT_simps = map prover |
5941
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
928 |
["!!C. c: C ==> (INT x:C. A x Int B) = ((INT x:C. A x) Int B)", |
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
929 |
"!!C. c: C ==> (INT x:C. A Int B x) = (A Int (INT x:C. B x))", |
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
930 |
"!!C. c: C ==> (INT x:C. A x - B) = ((INT x:C. A x) - B)", |
1db9fad40a4f
better miniscoping rules: the premise C~={} is not good
paulson
parents:
5931
diff
changeset
|
931 |
"!!C. c: C ==> (INT x:C. A - B x) = (A - (UN x:C. B x))", |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
932 |
"(INT x:C. insert a (B x)) = insert a (INT x:C. B x)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
933 |
"(INT x:C. A x Un B) = ((INT x:C. A x) Un B)", |
4231 | 934 |
"(INT x:C. A Un B x) = (A Un (INT x:C. B x))", |
7914 | 935 |
"(INT x: Union A. B x) = (INT y:A. INT x:y. B x)", |
936 |
"(INT z: UNION A B. C z) = (INT x:A. INT z: B(x). C z)", |
|
4231 | 937 |
"(INT x:f``A. B x) = (INT a:A. B(f a))"]; |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
938 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
939 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
940 |
val ball_simps = map prover |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
941 |
["(ALL x:A. P x | Q) = ((ALL x:A. P x) | Q)", |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
942 |
"(ALL x:A. P | Q x) = (P | (ALL x:A. Q x))", |
3422 | 943 |
"(ALL x:A. P --> Q x) = (P --> (ALL x:A. Q x))", |
944 |
"(ALL x:A. P x --> Q) = ((EX x:A. P x) --> Q)", |
|
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
945 |
"(ALL x:{}. P x) = True", |
4136 | 946 |
"(ALL x:UNIV. P x) = (ALL x. P x)", |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
947 |
"(ALL x:insert a B. P x) = (P(a) & (ALL x:B. P x))", |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
948 |
"(ALL x:Union(A). P x) = (ALL y:A. ALL x:y. P x)", |
5233
3571ff68ceda
New rewrite rules for quantification over bounded UNIONs
paulson
parents:
5189
diff
changeset
|
949 |
"(ALL x: UNION A B. P x) = (ALL a:A. ALL x: B a. P x)", |
3860 | 950 |
"(ALL x:Collect Q. P x) = (ALL x. Q x --> P x)", |
951 |
"(ALL x:f``A. P x) = (ALL x:A. P(f x))", |
|
952 |
"(~(ALL x:A. P x)) = (EX x:A. ~P x)"]; |
|
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
953 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
954 |
val ball_conj_distrib = |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
955 |
prover "(ALL x:A. P x & Q x) = ((ALL x:A. P x) & (ALL x:A. Q x))"; |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
956 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
957 |
val bex_simps = map prover |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
958 |
["(EX x:A. P x & Q) = ((EX x:A. P x) & Q)", |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
959 |
"(EX x:A. P & Q x) = (P & (EX x:A. Q x))", |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
960 |
"(EX x:{}. P x) = False", |
4136 | 961 |
"(EX x:UNIV. P x) = (EX x. P x)", |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
962 |
"(EX x:insert a B. P x) = (P(a) | (EX x:B. P x))", |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
963 |
"(EX x:Union(A). P x) = (EX y:A. EX x:y. P x)", |
5233
3571ff68ceda
New rewrite rules for quantification over bounded UNIONs
paulson
parents:
5189
diff
changeset
|
964 |
"(EX x: UNION A B. P x) = (EX a:A. EX x: B a. P x)", |
3860 | 965 |
"(EX x:Collect Q. P x) = (EX x. Q x & P x)", |
966 |
"(EX x:f``A. P x) = (EX x:A. P(f x))", |
|
967 |
"(~(EX x:A. P x)) = (ALL x:A. ~P x)"]; |
|
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
968 |
|
3426 | 969 |
val bex_disj_distrib = |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
970 |
prover "(EX x:A. P x | Q x) = ((EX x:A. P x) | (EX x:A. Q x))"; |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
971 |
|
2021 | 972 |
end; |
973 |
||
7648 | 974 |
bind_thms ("UN_simps", UN_simps); |
975 |
bind_thms ("INT_simps", INT_simps); |
|
976 |
bind_thms ("ball_simps", ball_simps); |
|
977 |
bind_thms ("bex_simps", bex_simps); |
|
978 |
bind_thm ("ball_conj_distrib", ball_conj_distrib); |
|
979 |
bind_thm ("bex_disj_distrib", bex_disj_distrib); |
|
980 |
||
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
981 |
Addsimps (UN_simps @ INT_simps @ ball_simps @ bex_simps); |