| author | paulson |
| Mon, 11 Mar 1996 14:09:50 +0100 | |
| changeset 1564 | 822575c737bd |
| parent 1553 | 4eb4a9c7d736 |
| child 1618 | 372880456b5b |
| 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 |
||
11 |
val eq_cs = set_cs addSIs [equalityI]; |
|
12 |
||
| 1548 | 13 |
section "{}";
|
14 |
||
| 1531 | 15 |
goal Set.thy "{x.False} = {}";
|
| 1553 | 16 |
by (fast_tac eq_cs 1); |
| 1531 | 17 |
qed "Collect_False_empty"; |
18 |
Addsimps [Collect_False_empty]; |
|
19 |
||
20 |
goal Set.thy "(A <= {}) = (A = {})";
|
|
| 1553 | 21 |
by (fast_tac eq_cs 1); |
| 1531 | 22 |
qed "subset_empty"; |
23 |
Addsimps [subset_empty]; |
|
24 |
||
| 1548 | 25 |
section ":"; |
| 923 | 26 |
|
27 |
goal Set.thy "x ~: {}";
|
|
| 1553 | 28 |
by (fast_tac set_cs 1); |
| 923 | 29 |
qed "in_empty"; |
| 1531 | 30 |
Addsimps[in_empty]; |
| 923 | 31 |
|
32 |
goal Set.thy "x : insert y A = (x=y | x:A)"; |
|
| 1553 | 33 |
by (fast_tac set_cs 1); |
| 923 | 34 |
qed "in_insert"; |
| 1531 | 35 |
Addsimps[in_insert]; |
| 923 | 36 |
|
| 1548 | 37 |
section "insert"; |
| 923 | 38 |
|
| 1531 | 39 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a {}*)
|
40 |
goal Set.thy "insert a A = {a} Un A";
|
|
| 1553 | 41 |
by (fast_tac eq_cs 1); |
| 1531 | 42 |
qed "insert_is_Un"; |
43 |
||
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
44 |
goal Set.thy "insert a A ~= {}";
|
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
45 |
by (fast_tac (set_cs addEs [equalityCE]) 1); |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
46 |
qed"insert_not_empty"; |
| 1531 | 47 |
Addsimps[insert_not_empty]; |
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
48 |
|
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
49 |
bind_thm("empty_not_insert",insert_not_empty RS not_sym);
|
| 1531 | 50 |
Addsimps[empty_not_insert]; |
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
51 |
|
| 923 | 52 |
goal Set.thy "!!a. a:A ==> insert a A = A"; |
53 |
by (fast_tac eq_cs 1); |
|
54 |
qed "insert_absorb"; |
|
55 |
||
| 1531 | 56 |
goal Set.thy "insert x (insert x A) = insert x A"; |
| 1553 | 57 |
by (fast_tac eq_cs 1); |
| 1531 | 58 |
qed "insert_absorb2"; |
59 |
Addsimps [insert_absorb2]; |
|
60 |
||
| 923 | 61 |
goal Set.thy "(insert x A <= B) = (x:B & A <= B)"; |
62 |
by (fast_tac set_cs 1); |
|
63 |
qed "insert_subset"; |
|
| 1531 | 64 |
Addsimps[insert_subset]; |
65 |
||
66 |
(* use new B rather than (A-{a}) to avoid infinite unfolding *)
|
|
67 |
goal Set.thy "!!a. a:A ==> ? B. A = insert a B & a ~: B"; |
|
| 1553 | 68 |
by (res_inst_tac [("x","A-{a}")] exI 1);
|
69 |
by (fast_tac eq_cs 1); |
|
| 1531 | 70 |
qed "mk_disjoint_insert"; |
| 923 | 71 |
|
| 1548 | 72 |
section "''"; |
| 923 | 73 |
|
74 |
goal Set.thy "f``{} = {}";
|
|
75 |
by (fast_tac eq_cs 1); |
|
76 |
qed "image_empty"; |
|
| 1531 | 77 |
Addsimps[image_empty]; |
| 923 | 78 |
|
79 |
goal Set.thy "f``insert a B = insert (f a) (f``B)"; |
|
80 |
by (fast_tac eq_cs 1); |
|
81 |
qed "image_insert"; |
|
| 1531 | 82 |
Addsimps[image_insert]; |
| 923 | 83 |
|
| 1548 | 84 |
section "Int"; |
| 923 | 85 |
|
86 |
goal Set.thy "A Int A = A"; |
|
87 |
by (fast_tac eq_cs 1); |
|
88 |
qed "Int_absorb"; |
|
| 1531 | 89 |
Addsimps[Int_absorb]; |
| 923 | 90 |
|
91 |
goal Set.thy "A Int B = B Int A"; |
|
92 |
by (fast_tac eq_cs 1); |
|
93 |
qed "Int_commute"; |
|
94 |
||
95 |
goal Set.thy "(A Int B) Int C = A Int (B Int C)"; |
|
96 |
by (fast_tac eq_cs 1); |
|
97 |
qed "Int_assoc"; |
|
98 |
||
99 |
goal Set.thy "{} Int B = {}";
|
|
100 |
by (fast_tac eq_cs 1); |
|
101 |
qed "Int_empty_left"; |
|
| 1531 | 102 |
Addsimps[Int_empty_left]; |
| 923 | 103 |
|
104 |
goal Set.thy "A Int {} = {}";
|
|
105 |
by (fast_tac eq_cs 1); |
|
106 |
qed "Int_empty_right"; |
|
| 1531 | 107 |
Addsimps[Int_empty_right]; |
108 |
||
109 |
goal Set.thy "UNIV Int B = B"; |
|
110 |
by (fast_tac eq_cs 1); |
|
111 |
qed "Int_UNIV_left"; |
|
112 |
Addsimps[Int_UNIV_left]; |
|
113 |
||
114 |
goal Set.thy "A Int UNIV = A"; |
|
115 |
by (fast_tac eq_cs 1); |
|
116 |
qed "Int_UNIV_right"; |
|
117 |
Addsimps[Int_UNIV_right]; |
|
| 923 | 118 |
|
119 |
goal Set.thy "A Int (B Un C) = (A Int B) Un (A Int C)"; |
|
120 |
by (fast_tac eq_cs 1); |
|
121 |
qed "Int_Un_distrib"; |
|
122 |
||
123 |
goal Set.thy "(A<=B) = (A Int B = A)"; |
|
124 |
by (fast_tac (eq_cs addSEs [equalityE]) 1); |
|
125 |
qed "subset_Int_eq"; |
|
126 |
||
| 1531 | 127 |
goal Set.thy "(A Int B = UNIV) = (A = UNIV & B = UNIV)"; |
128 |
by (fast_tac (eq_cs addEs [equalityCE]) 1); |
|
129 |
qed "Int_UNIV"; |
|
130 |
Addsimps[Int_UNIV]; |
|
131 |
||
| 1548 | 132 |
section "Un"; |
| 923 | 133 |
|
134 |
goal Set.thy "A Un A = A"; |
|
135 |
by (fast_tac eq_cs 1); |
|
136 |
qed "Un_absorb"; |
|
| 1531 | 137 |
Addsimps[Un_absorb]; |
| 923 | 138 |
|
139 |
goal Set.thy "A Un B = B Un A"; |
|
140 |
by (fast_tac eq_cs 1); |
|
141 |
qed "Un_commute"; |
|
142 |
||
143 |
goal Set.thy "(A Un B) Un C = A Un (B Un C)"; |
|
144 |
by (fast_tac eq_cs 1); |
|
145 |
qed "Un_assoc"; |
|
146 |
||
147 |
goal Set.thy "{} Un B = B";
|
|
| 1553 | 148 |
by (fast_tac eq_cs 1); |
| 923 | 149 |
qed "Un_empty_left"; |
| 1531 | 150 |
Addsimps[Un_empty_left]; |
| 923 | 151 |
|
152 |
goal Set.thy "A Un {} = A";
|
|
| 1553 | 153 |
by (fast_tac eq_cs 1); |
| 923 | 154 |
qed "Un_empty_right"; |
| 1531 | 155 |
Addsimps[Un_empty_right]; |
156 |
||
157 |
goal Set.thy "UNIV Un B = UNIV"; |
|
| 1553 | 158 |
by (fast_tac eq_cs 1); |
| 1531 | 159 |
qed "Un_UNIV_left"; |
160 |
Addsimps[Un_UNIV_left]; |
|
161 |
||
162 |
goal Set.thy "A Un UNIV = UNIV"; |
|
| 1553 | 163 |
by (fast_tac eq_cs 1); |
| 1531 | 164 |
qed "Un_UNIV_right"; |
165 |
Addsimps[Un_UNIV_right]; |
|
| 923 | 166 |
|
167 |
goal Set.thy "insert a B Un C = insert a (B Un C)"; |
|
| 1553 | 168 |
by (fast_tac eq_cs 1); |
| 923 | 169 |
qed "Un_insert_left"; |
170 |
||
171 |
goal Set.thy "(A Int B) Un C = (A Un C) Int (B Un C)"; |
|
172 |
by (fast_tac eq_cs 1); |
|
173 |
qed "Un_Int_distrib"; |
|
174 |
||
175 |
goal Set.thy |
|
176 |
"(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)"; |
|
177 |
by (fast_tac eq_cs 1); |
|
178 |
qed "Un_Int_crazy"; |
|
179 |
||
180 |
goal Set.thy "(A<=B) = (A Un B = B)"; |
|
181 |
by (fast_tac (eq_cs addSEs [equalityE]) 1); |
|
182 |
qed "subset_Un_eq"; |
|
183 |
||
184 |
goal Set.thy "(A <= insert b C) = (A <= C | b:A & A-{b} <= C)";
|
|
185 |
by (fast_tac eq_cs 1); |
|
186 |
qed "subset_insert_iff"; |
|
187 |
||
188 |
goal Set.thy "(A Un B = {}) = (A = {} & B = {})";
|
|
189 |
by (fast_tac (eq_cs addEs [equalityCE]) 1); |
|
190 |
qed "Un_empty"; |
|
| 1531 | 191 |
Addsimps[Un_empty]; |
| 923 | 192 |
|
| 1548 | 193 |
section "Compl"; |
| 923 | 194 |
|
195 |
goal Set.thy "A Int Compl(A) = {}";
|
|
196 |
by (fast_tac eq_cs 1); |
|
197 |
qed "Compl_disjoint"; |
|
| 1531 | 198 |
Addsimps[Compl_disjoint]; |
| 923 | 199 |
|
| 1531 | 200 |
goal Set.thy "A Un Compl(A) = UNIV"; |
| 923 | 201 |
by (fast_tac eq_cs 1); |
202 |
qed "Compl_partition"; |
|
203 |
||
204 |
goal Set.thy "Compl(Compl(A)) = A"; |
|
205 |
by (fast_tac eq_cs 1); |
|
206 |
qed "double_complement"; |
|
| 1531 | 207 |
Addsimps[double_complement]; |
| 923 | 208 |
|
209 |
goal Set.thy "Compl(A Un B) = Compl(A) Int Compl(B)"; |
|
210 |
by (fast_tac eq_cs 1); |
|
211 |
qed "Compl_Un"; |
|
212 |
||
213 |
goal Set.thy "Compl(A Int B) = Compl(A) Un Compl(B)"; |
|
214 |
by (fast_tac eq_cs 1); |
|
215 |
qed "Compl_Int"; |
|
216 |
||
217 |
goal Set.thy "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))"; |
|
218 |
by (fast_tac eq_cs 1); |
|
219 |
qed "Compl_UN"; |
|
220 |
||
221 |
goal Set.thy "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))"; |
|
222 |
by (fast_tac eq_cs 1); |
|
223 |
qed "Compl_INT"; |
|
224 |
||
225 |
(*Halmos, Naive Set Theory, page 16.*) |
|
226 |
||
227 |
goal Set.thy "((A Int B) Un C = A Int (B Un C)) = (C<=A)"; |
|
228 |
by (fast_tac (eq_cs addSEs [equalityE]) 1); |
|
229 |
qed "Un_Int_assoc_eq"; |
|
230 |
||
231 |
||
| 1548 | 232 |
section "Union"; |
| 923 | 233 |
|
234 |
goal Set.thy "Union({}) = {}";
|
|
235 |
by (fast_tac eq_cs 1); |
|
236 |
qed "Union_empty"; |
|
| 1531 | 237 |
Addsimps[Union_empty]; |
238 |
||
239 |
goal Set.thy "Union(UNIV) = UNIV"; |
|
240 |
by (fast_tac eq_cs 1); |
|
241 |
qed "Union_UNIV"; |
|
242 |
Addsimps[Union_UNIV]; |
|
| 923 | 243 |
|
244 |
goal Set.thy "Union(insert a B) = a Un Union(B)"; |
|
245 |
by (fast_tac eq_cs 1); |
|
246 |
qed "Union_insert"; |
|
| 1531 | 247 |
Addsimps[Union_insert]; |
| 923 | 248 |
|
249 |
goal Set.thy "Union(A Un B) = Union(A) Un Union(B)"; |
|
250 |
by (fast_tac eq_cs 1); |
|
251 |
qed "Union_Un_distrib"; |
|
| 1531 | 252 |
Addsimps[Union_Un_distrib]; |
| 923 | 253 |
|
254 |
goal Set.thy "Union(A Int B) <= Union(A) Int Union(B)"; |
|
255 |
by (fast_tac set_cs 1); |
|
256 |
qed "Union_Int_subset"; |
|
257 |
||
258 |
val prems = goal Set.thy |
|
259 |
"(Union(C) Int A = {}) = (! B:C. B Int A = {})";
|
|
260 |
by (fast_tac (eq_cs addSEs [equalityE]) 1); |
|
261 |
qed "Union_disjoint"; |
|
262 |
||
| 1548 | 263 |
section "Inter"; |
264 |
||
| 1531 | 265 |
goal Set.thy "Inter({}) = UNIV";
|
266 |
by (fast_tac eq_cs 1); |
|
267 |
qed "Inter_empty"; |
|
268 |
Addsimps[Inter_empty]; |
|
269 |
||
270 |
goal Set.thy "Inter(UNIV) = {}";
|
|
271 |
by (fast_tac eq_cs 1); |
|
272 |
qed "Inter_UNIV"; |
|
273 |
Addsimps[Inter_UNIV]; |
|
274 |
||
275 |
goal Set.thy "Inter(insert a B) = a Int Inter(B)"; |
|
276 |
by (fast_tac eq_cs 1); |
|
277 |
qed "Inter_insert"; |
|
278 |
Addsimps[Inter_insert]; |
|
279 |
||
|
1564
822575c737bd
Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents:
1553
diff
changeset
|
280 |
goal Set.thy "Inter(A) Un Inter(B) <= Inter(A Int B)"; |
|
822575c737bd
Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents:
1553
diff
changeset
|
281 |
by (fast_tac set_cs 1); |
|
822575c737bd
Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents:
1553
diff
changeset
|
282 |
qed "Inter_Un_subset"; |
| 1531 | 283 |
|
| 923 | 284 |
goal Set.thy "Inter(A Un B) = Inter(A) Int Inter(B)"; |
285 |
by (best_tac eq_cs 1); |
|
286 |
qed "Inter_Un_distrib"; |
|
287 |
||
| 1548 | 288 |
section "UN and INT"; |
| 923 | 289 |
|
290 |
(*Basic identities*) |
|
291 |
||
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
292 |
goal Set.thy "(UN x:{}. B x) = {}";
|
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
293 |
by (fast_tac eq_cs 1); |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
294 |
qed "UN_empty"; |
| 1531 | 295 |
Addsimps[UN_empty]; |
296 |
||
297 |
goal Set.thy "(UN x:UNIV. B x) = (UN x. B x)"; |
|
298 |
by (fast_tac eq_cs 1); |
|
299 |
qed "UN_UNIV"; |
|
300 |
Addsimps[UN_UNIV]; |
|
301 |
||
302 |
goal Set.thy "(INT x:{}. B x) = UNIV";
|
|
303 |
by (fast_tac eq_cs 1); |
|
304 |
qed "INT_empty"; |
|
305 |
Addsimps[INT_empty]; |
|
306 |
||
307 |
goal Set.thy "(INT x:UNIV. B x) = (INT x. B x)"; |
|
308 |
by (fast_tac eq_cs 1); |
|
309 |
qed "INT_UNIV"; |
|
310 |
Addsimps[INT_UNIV]; |
|
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
311 |
|
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
312 |
goal Set.thy "(UN x:insert a A. B x) = B a Un UNION A B"; |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
313 |
by (fast_tac eq_cs 1); |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
314 |
qed "UN_insert"; |
| 1531 | 315 |
Addsimps[UN_insert]; |
316 |
||
317 |
goal Set.thy "(INT x:insert a A. B x) = B a Int INTER A B"; |
|
318 |
by (fast_tac eq_cs 1); |
|
319 |
qed "INT_insert"; |
|
320 |
Addsimps[INT_insert]; |
|
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
321 |
|
| 923 | 322 |
goal Set.thy "Union(range(f)) = (UN x.f(x))"; |
323 |
by (fast_tac eq_cs 1); |
|
324 |
qed "Union_range_eq"; |
|
325 |
||
326 |
goal Set.thy "Inter(range(f)) = (INT x.f(x))"; |
|
327 |
by (fast_tac eq_cs 1); |
|
328 |
qed "Inter_range_eq"; |
|
329 |
||
330 |
goal Set.thy "Union(B``A) = (UN x:A. B(x))"; |
|
331 |
by (fast_tac eq_cs 1); |
|
332 |
qed "Union_image_eq"; |
|
333 |
||
334 |
goal Set.thy "Inter(B``A) = (INT x:A. B(x))"; |
|
335 |
by (fast_tac eq_cs 1); |
|
336 |
qed "Inter_image_eq"; |
|
337 |
||
338 |
goal Set.thy "!!A. a: A ==> (UN y:A. c) = c"; |
|
339 |
by (fast_tac eq_cs 1); |
|
340 |
qed "UN_constant"; |
|
341 |
||
342 |
goal Set.thy "!!A. a: A ==> (INT y:A. c) = c"; |
|
343 |
by (fast_tac eq_cs 1); |
|
344 |
qed "INT_constant"; |
|
345 |
||
346 |
goal Set.thy "(UN x.B) = B"; |
|
347 |
by (fast_tac eq_cs 1); |
|
348 |
qed "UN1_constant"; |
|
| 1531 | 349 |
Addsimps[UN1_constant]; |
| 923 | 350 |
|
351 |
goal Set.thy "(INT x.B) = B"; |
|
352 |
by (fast_tac eq_cs 1); |
|
353 |
qed "INT1_constant"; |
|
| 1531 | 354 |
Addsimps[INT1_constant]; |
| 923 | 355 |
|
356 |
goal Set.thy "(UN x:A. B(x)) = Union({Y. ? x:A. Y=B(x)})";
|
|
357 |
by (fast_tac eq_cs 1); |
|
358 |
qed "UN_eq"; |
|
359 |
||
360 |
(*Look: it has an EXISTENTIAL quantifier*) |
|
361 |
goal Set.thy "(INT x:A. B(x)) = Inter({Y. ? x:A. Y=B(x)})";
|
|
362 |
by (fast_tac eq_cs 1); |
|
363 |
qed "INT_eq"; |
|
364 |
||
365 |
(*Distributive laws...*) |
|
366 |
||
367 |
goal Set.thy "A Int Union(B) = (UN C:B. A Int C)"; |
|
368 |
by (fast_tac eq_cs 1); |
|
369 |
qed "Int_Union"; |
|
370 |
||
371 |
(* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: |
|
372 |
Union of a family of unions **) |
|
373 |
goal Set.thy "(UN x:C. A(x) Un B(x)) = Union(A``C) Un Union(B``C)"; |
|
374 |
by (fast_tac eq_cs 1); |
|
375 |
qed "Un_Union_image"; |
|
376 |
||
377 |
(*Equivalent version*) |
|
378 |
goal Set.thy "(UN i:I. A(i) Un B(i)) = (UN i:I. A(i)) Un (UN i:I. B(i))"; |
|
379 |
by (fast_tac eq_cs 1); |
|
380 |
qed "UN_Un_distrib"; |
|
381 |
||
382 |
goal Set.thy "A Un Inter(B) = (INT C:B. A Un C)"; |
|
383 |
by (fast_tac eq_cs 1); |
|
384 |
qed "Un_Inter"; |
|
385 |
||
386 |
goal Set.thy "(INT x:C. A(x) Int B(x)) = Inter(A``C) Int Inter(B``C)"; |
|
387 |
by (best_tac eq_cs 1); |
|
388 |
qed "Int_Inter_image"; |
|
389 |
||
390 |
(*Equivalent version*) |
|
391 |
goal Set.thy "(INT i:I. A(i) Int B(i)) = (INT i:I. A(i)) Int (INT i:I. B(i))"; |
|
392 |
by (fast_tac eq_cs 1); |
|
393 |
qed "INT_Int_distrib"; |
|
394 |
||
395 |
(*Halmos, Naive Set Theory, page 35.*) |
|
396 |
goal Set.thy "B Int (UN i:I. A(i)) = (UN i:I. B Int A(i))"; |
|
397 |
by (fast_tac eq_cs 1); |
|
398 |
qed "Int_UN_distrib"; |
|
399 |
||
400 |
goal Set.thy "B Un (INT i:I. A(i)) = (INT i:I. B Un A(i))"; |
|
401 |
by (fast_tac eq_cs 1); |
|
402 |
qed "Un_INT_distrib"; |
|
403 |
||
404 |
goal Set.thy |
|
405 |
"(UN i:I. A(i)) Int (UN j:J. B(j)) = (UN i:I. UN j:J. A(i) Int B(j))"; |
|
406 |
by (fast_tac eq_cs 1); |
|
407 |
qed "Int_UN_distrib2"; |
|
408 |
||
409 |
goal Set.thy |
|
410 |
"(INT i:I. A(i)) Un (INT j:J. B(j)) = (INT i:I. INT j:J. A(i) Un B(j))"; |
|
411 |
by (fast_tac eq_cs 1); |
|
412 |
qed "Un_INT_distrib2"; |
|
413 |
||
| 1548 | 414 |
section "-"; |
| 923 | 415 |
|
416 |
goal Set.thy "A-A = {}";
|
|
417 |
by (fast_tac eq_cs 1); |
|
418 |
qed "Diff_cancel"; |
|
| 1531 | 419 |
Addsimps[Diff_cancel]; |
| 923 | 420 |
|
421 |
goal Set.thy "{}-A = {}";
|
|
422 |
by (fast_tac eq_cs 1); |
|
423 |
qed "empty_Diff"; |
|
| 1531 | 424 |
Addsimps[empty_Diff]; |
| 923 | 425 |
|
426 |
goal Set.thy "A-{} = A";
|
|
427 |
by (fast_tac eq_cs 1); |
|
428 |
qed "Diff_empty"; |
|
| 1531 | 429 |
Addsimps[Diff_empty]; |
430 |
||
431 |
goal Set.thy "A-UNIV = {}";
|
|
432 |
by (fast_tac eq_cs 1); |
|
433 |
qed "Diff_UNIV"; |
|
434 |
Addsimps[Diff_UNIV]; |
|
435 |
||
436 |
goal Set.thy "!!x. x~:A ==> A - insert x B = A-B"; |
|
| 1553 | 437 |
by (fast_tac eq_cs 1); |
| 1531 | 438 |
qed "Diff_insert0"; |
439 |
Addsimps [Diff_insert0]; |
|
| 923 | 440 |
|
441 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
|
|
442 |
goal Set.thy "A - insert a B = A - B - {a}";
|
|
443 |
by (fast_tac eq_cs 1); |
|
444 |
qed "Diff_insert"; |
|
445 |
||
446 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
|
|
447 |
goal Set.thy "A - insert a B = A - {a} - B";
|
|
448 |
by (fast_tac eq_cs 1); |
|
449 |
qed "Diff_insert2"; |
|
450 |
||
| 1531 | 451 |
goal Set.thy "insert x A - B = (if x:B then A-B else insert x (A-B))"; |
| 1553 | 452 |
by (simp_tac (!simpset setloop split_tac[expand_if]) 1); |
453 |
by (fast_tac eq_cs 1); |
|
| 1531 | 454 |
qed "insert_Diff_if"; |
455 |
||
456 |
goal Set.thy "!!x. x:B ==> insert x A - B = A-B"; |
|
| 1553 | 457 |
by (fast_tac eq_cs 1); |
| 1531 | 458 |
qed "insert_Diff1"; |
459 |
Addsimps [insert_Diff1]; |
|
460 |
||
| 923 | 461 |
val prems = goal Set.thy "a:A ==> insert a (A-{a}) = A";
|
462 |
by (fast_tac (eq_cs addSIs prems) 1); |
|
463 |
qed "insert_Diff"; |
|
464 |
||
465 |
goal Set.thy "A Int (B-A) = {}";
|
|
466 |
by (fast_tac eq_cs 1); |
|
467 |
qed "Diff_disjoint"; |
|
| 1531 | 468 |
Addsimps[Diff_disjoint]; |
| 923 | 469 |
|
470 |
goal Set.thy "!!A. A<=B ==> A Un (B-A) = B"; |
|
471 |
by (fast_tac eq_cs 1); |
|
472 |
qed "Diff_partition"; |
|
473 |
||
474 |
goal Set.thy "!!A. [| A<=B; B<= C |] ==> (B - (C - A)) = (A :: 'a set)"; |
|
475 |
by (fast_tac eq_cs 1); |
|
476 |
qed "double_diff"; |
|
477 |
||
478 |
goal Set.thy "A - (B Un C) = (A-B) Int (A-C)"; |
|
479 |
by (fast_tac eq_cs 1); |
|
480 |
qed "Diff_Un"; |
|
481 |
||
482 |
goal Set.thy "A - (B Int C) = (A-B) Un (A-C)"; |
|
483 |
by (fast_tac eq_cs 1); |
|
484 |
qed "Diff_Int"; |
|
485 |
||
| 1531 | 486 |
Addsimps[subset_UNIV, empty_subsetI, subset_refl]; |