author | paulson |
Thu, 19 Feb 1998 15:01:25 +0100 | |
changeset 4634 | 83d364462ce1 |
parent 4615 | 67457d16cdbc |
child 4645 | f5f957ab73eb |
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 |
||
4059 | 15 |
goal thy "{x. False} = {}"; |
2891 | 16 |
by (Blast_tac 1); |
1531 | 17 |
qed "Collect_False_empty"; |
18 |
Addsimps [Collect_False_empty]; |
|
19 |
||
4059 | 20 |
goal thy "(A <= {}) = (A = {})"; |
2891 | 21 |
by (Blast_tac 1); |
1531 | 22 |
qed "subset_empty"; |
23 |
Addsimps [subset_empty]; |
|
24 |
||
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
25 |
goalw thy [psubset_def] "~ (A < {})"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
26 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
27 |
qed "not_psubset_empty"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
28 |
AddIffs [not_psubset_empty]; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
29 |
|
1548 | 30 |
section "insert"; |
923 | 31 |
|
1531 | 32 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a {}*) |
4059 | 33 |
goal thy "insert a A = {a} Un A"; |
2891 | 34 |
by (Blast_tac 1); |
1531 | 35 |
qed "insert_is_Un"; |
36 |
||
4059 | 37 |
goal thy "insert a A ~= {}"; |
4089 | 38 |
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
|
39 |
qed"insert_not_empty"; |
1531 | 40 |
Addsimps[insert_not_empty]; |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
41 |
|
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
42 |
bind_thm("empty_not_insert",insert_not_empty RS not_sym); |
1531 | 43 |
Addsimps[empty_not_insert]; |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
44 |
|
4059 | 45 |
goal thy "!!a. a:A ==> insert a A = A"; |
2891 | 46 |
by (Blast_tac 1); |
923 | 47 |
qed "insert_absorb"; |
4605 | 48 |
(* Addsimps [insert_absorb] causes recursive (ie quadtratic) calls |
49 |
in case of nested inserts! |
|
50 |
*) |
|
923 | 51 |
|
4059 | 52 |
goal thy "insert x (insert x A) = insert x A"; |
2891 | 53 |
by (Blast_tac 1); |
1531 | 54 |
qed "insert_absorb2"; |
55 |
Addsimps [insert_absorb2]; |
|
56 |
||
4059 | 57 |
goal thy "insert x (insert y A) = insert y (insert x A)"; |
2891 | 58 |
by (Blast_tac 1); |
1879 | 59 |
qed "insert_commute"; |
60 |
||
4059 | 61 |
goal thy "(insert x A <= B) = (x:B & A <= B)"; |
2891 | 62 |
by (Blast_tac 1); |
923 | 63 |
qed "insert_subset"; |
1531 | 64 |
Addsimps[insert_subset]; |
65 |
||
4059 | 66 |
goal thy "!!a. insert a A ~= insert a B ==> A ~= B"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
67 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
68 |
qed "insert_lim"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
69 |
|
1531 | 70 |
(* use new B rather than (A-{a}) to avoid infinite unfolding *) |
4059 | 71 |
goal thy "!!a. a:A ==> ? B. A = insert a B & a ~: B"; |
1553 | 72 |
by (res_inst_tac [("x","A-{a}")] exI 1); |
2891 | 73 |
by (Blast_tac 1); |
1531 | 74 |
qed "mk_disjoint_insert"; |
923 | 75 |
|
4059 | 76 |
goal thy |
1843
a6d7aef48c2f
Removed the unused eq_cs, and added some distributive laws
paulson
parents:
1786
diff
changeset
|
77 |
"!!A. A~={} ==> (UN x:A. insert a (B x)) = insert a (UN x:A. B x)"; |
2891 | 78 |
by (Blast_tac 1); |
1843
a6d7aef48c2f
Removed the unused eq_cs, and added some distributive laws
paulson
parents:
1786
diff
changeset
|
79 |
qed "UN_insert_distrib"; |
a6d7aef48c2f
Removed the unused eq_cs, and added some distributive laws
paulson
parents:
1786
diff
changeset
|
80 |
|
1660 | 81 |
section "``"; |
923 | 82 |
|
4059 | 83 |
goal thy "f``{} = {}"; |
2891 | 84 |
by (Blast_tac 1); |
923 | 85 |
qed "image_empty"; |
1531 | 86 |
Addsimps[image_empty]; |
923 | 87 |
|
4059 | 88 |
goal thy "f``insert a B = insert (f a) (f``B)"; |
2891 | 89 |
by (Blast_tac 1); |
923 | 90 |
qed "image_insert"; |
1531 | 91 |
Addsimps[image_insert]; |
923 | 92 |
|
4059 | 93 |
goal thy "(f `` (UNION A B)) = (UN x:A.(f `` (B x)))"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
94 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
95 |
qed "image_UNION"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
96 |
|
4059 | 97 |
goal thy "(%x. x) `` Y = Y"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
98 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
99 |
qed "image_id"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
100 |
|
4059 | 101 |
goal thy "f``(g``A) = (%x. f (g x)) `` A"; |
3457 | 102 |
by (Blast_tac 1); |
4059 | 103 |
qed "image_image"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
104 |
|
4059 | 105 |
goal thy "!!x. x:A ==> insert (f x) (f``A) = f``A"; |
2891 | 106 |
by (Blast_tac 1); |
1884 | 107 |
qed "insert_image"; |
108 |
Addsimps [insert_image]; |
|
109 |
||
4059 | 110 |
goal thy "(f``A = {}) = (A = {})"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
111 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
3415
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
112 |
qed "image_is_empty"; |
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
113 |
AddIffs [image_is_empty]; |
c068bd2f0bbd
Moved image_is_empty from Finite.ML to equalities.ML
nipkow
parents:
3384
diff
changeset
|
114 |
|
4059 | 115 |
goalw thy [image_def] |
1763 | 116 |
"(%x. if P x then f x else g x) `` S \ |
4200 | 117 |
\ = (f `` (S Int {x. P x})) Un (g `` (S Int {x. ~(P x)}))"; |
2031 | 118 |
by (split_tac [expand_if] 1); |
2891 | 119 |
by (Blast_tac 1); |
1748 | 120 |
qed "if_image_distrib"; |
121 |
Addsimps[if_image_distrib]; |
|
122 |
||
4136 | 123 |
val prems= goal thy "[|M = N; !!x. x:N ==> f x = g x|] ==> f``M = g``N"; |
124 |
by (rtac set_ext 1); |
|
125 |
by (simp_tac (simpset() addsimps image_def::prems) 1); |
|
126 |
qed "image_cong"; |
|
127 |
||
1748 | 128 |
|
1548 | 129 |
section "Int"; |
923 | 130 |
|
4059 | 131 |
goal thy "A Int A = A"; |
2891 | 132 |
by (Blast_tac 1); |
923 | 133 |
qed "Int_absorb"; |
1531 | 134 |
Addsimps[Int_absorb]; |
923 | 135 |
|
4609 | 136 |
goal thy " A Int (A Int B) = A Int B"; |
137 |
by (Blast_tac 1); |
|
138 |
qed "Int_left_absorb"; |
|
139 |
||
4059 | 140 |
goal thy "A Int B = B Int A"; |
2891 | 141 |
by (Blast_tac 1); |
923 | 142 |
qed "Int_commute"; |
143 |
||
4609 | 144 |
goal thy "A Int (B Int C) = B Int (A Int C)"; |
145 |
by (Blast_tac 1); |
|
146 |
qed "Int_left_commute"; |
|
147 |
||
4059 | 148 |
goal thy "(A Int B) Int C = A Int (B Int C)"; |
2891 | 149 |
by (Blast_tac 1); |
923 | 150 |
qed "Int_assoc"; |
151 |
||
4609 | 152 |
(*Intersection is an AC-operator*) |
153 |
val Int_ac = [Int_assoc, Int_left_absorb, Int_commute, Int_left_commute]; |
|
154 |
||
4059 | 155 |
goal thy "{} Int B = {}"; |
2891 | 156 |
by (Blast_tac 1); |
923 | 157 |
qed "Int_empty_left"; |
1531 | 158 |
Addsimps[Int_empty_left]; |
923 | 159 |
|
4059 | 160 |
goal thy "A Int {} = {}"; |
2891 | 161 |
by (Blast_tac 1); |
923 | 162 |
qed "Int_empty_right"; |
1531 | 163 |
Addsimps[Int_empty_right]; |
164 |
||
4059 | 165 |
goal thy "(A Int B = {}) = (A <= Compl B)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
166 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
3356 | 167 |
qed "disjoint_eq_subset_Compl"; |
168 |
||
4059 | 169 |
goal thy "UNIV Int B = B"; |
2891 | 170 |
by (Blast_tac 1); |
1531 | 171 |
qed "Int_UNIV_left"; |
172 |
Addsimps[Int_UNIV_left]; |
|
173 |
||
4059 | 174 |
goal thy "A Int UNIV = A"; |
2891 | 175 |
by (Blast_tac 1); |
1531 | 176 |
qed "Int_UNIV_right"; |
177 |
Addsimps[Int_UNIV_right]; |
|
923 | 178 |
|
4634 | 179 |
goal thy "A Int B = Inter{A,B}"; |
180 |
by (Blast_tac 1); |
|
181 |
qed "Int_eq_Inter"; |
|
182 |
||
4059 | 183 |
goal thy "A Int (B Un C) = (A Int B) Un (A Int C)"; |
2891 | 184 |
by (Blast_tac 1); |
923 | 185 |
qed "Int_Un_distrib"; |
186 |
||
4059 | 187 |
goal thy "(B Un C) Int A = (B Int A) Un (C Int A)"; |
2891 | 188 |
by (Blast_tac 1); |
1618 | 189 |
qed "Int_Un_distrib2"; |
190 |
||
4059 | 191 |
goal thy "(A<=B) = (A Int B = A)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
192 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 193 |
qed "subset_Int_eq"; |
194 |
||
4059 | 195 |
goal thy "(A Int B = UNIV) = (A = UNIV & B = UNIV)"; |
4089 | 196 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
1531 | 197 |
qed "Int_UNIV"; |
198 |
Addsimps[Int_UNIV]; |
|
199 |
||
1548 | 200 |
section "Un"; |
923 | 201 |
|
4059 | 202 |
goal thy "A Un A = A"; |
2891 | 203 |
by (Blast_tac 1); |
923 | 204 |
qed "Un_absorb"; |
1531 | 205 |
Addsimps[Un_absorb]; |
923 | 206 |
|
4059 | 207 |
goal thy " 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
|
208 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
209 |
qed "Un_left_absorb"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
210 |
|
4059 | 211 |
goal thy "A Un B = B Un A"; |
2891 | 212 |
by (Blast_tac 1); |
923 | 213 |
qed "Un_commute"; |
214 |
||
4609 | 215 |
goal thy "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
|
216 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
217 |
qed "Un_left_commute"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
218 |
|
4059 | 219 |
goal thy "(A Un B) Un C = A Un (B Un C)"; |
2891 | 220 |
by (Blast_tac 1); |
923 | 221 |
qed "Un_assoc"; |
222 |
||
4609 | 223 |
(*Union is an AC-operator*) |
224 |
val Un_ac = [Un_assoc, Un_left_absorb, Un_commute, Un_left_commute]; |
|
225 |
||
4059 | 226 |
goal thy "{} Un B = B"; |
2891 | 227 |
by (Blast_tac 1); |
923 | 228 |
qed "Un_empty_left"; |
1531 | 229 |
Addsimps[Un_empty_left]; |
923 | 230 |
|
4059 | 231 |
goal thy "A Un {} = A"; |
2891 | 232 |
by (Blast_tac 1); |
923 | 233 |
qed "Un_empty_right"; |
1531 | 234 |
Addsimps[Un_empty_right]; |
235 |
||
4059 | 236 |
goal thy "UNIV Un B = UNIV"; |
2891 | 237 |
by (Blast_tac 1); |
1531 | 238 |
qed "Un_UNIV_left"; |
239 |
Addsimps[Un_UNIV_left]; |
|
240 |
||
4059 | 241 |
goal thy "A Un UNIV = UNIV"; |
2891 | 242 |
by (Blast_tac 1); |
1531 | 243 |
qed "Un_UNIV_right"; |
244 |
Addsimps[Un_UNIV_right]; |
|
923 | 245 |
|
4634 | 246 |
goal thy "A Un B = Union{A,B}"; |
247 |
by (Blast_tac 1); |
|
248 |
qed "Un_eq_Union"; |
|
249 |
||
4059 | 250 |
goal thy "(insert a B) Un C = insert a (B Un C)"; |
2891 | 251 |
by (Blast_tac 1); |
923 | 252 |
qed "Un_insert_left"; |
3384
5ef99c94e1fb
Now Un_insert_left, Un_insert_right are default rewrite rules
paulson
parents:
3356
diff
changeset
|
253 |
Addsimps[Un_insert_left]; |
923 | 254 |
|
4059 | 255 |
goal thy "A Un (insert a B) = insert a (A Un B)"; |
2891 | 256 |
by (Blast_tac 1); |
1917 | 257 |
qed "Un_insert_right"; |
3384
5ef99c94e1fb
Now Un_insert_left, Un_insert_right are default rewrite rules
paulson
parents:
3356
diff
changeset
|
258 |
Addsimps[Un_insert_right]; |
1917 | 259 |
|
4059 | 260 |
goal thy "(insert a B) Int C = (if a:C then insert a (B Int C) \ |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
261 |
\ else B Int C)"; |
4089 | 262 |
by (simp_tac (simpset() addsplits [expand_if]) 1); |
3356 | 263 |
by (Blast_tac 1); |
264 |
qed "Int_insert_left"; |
|
265 |
||
4059 | 266 |
goal thy "A Int (insert a B) = (if a:A then insert a (A Int B) \ |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
267 |
\ else A Int B)"; |
4089 | 268 |
by (simp_tac (simpset() addsplits [expand_if]) 1); |
3356 | 269 |
by (Blast_tac 1); |
270 |
qed "Int_insert_right"; |
|
271 |
||
4609 | 272 |
goal thy "A Un (B Int C) = (A Un B) Int (A Un C)"; |
2891 | 273 |
by (Blast_tac 1); |
923 | 274 |
qed "Un_Int_distrib"; |
275 |
||
4609 | 276 |
goal thy "(B Int C) Un A = (B Un A) Int (C Un A)"; |
277 |
by (Blast_tac 1); |
|
278 |
qed "Un_Int_distrib2"; |
|
279 |
||
4059 | 280 |
goal thy |
923 | 281 |
"(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)"; |
2891 | 282 |
by (Blast_tac 1); |
923 | 283 |
qed "Un_Int_crazy"; |
284 |
||
4059 | 285 |
goal thy "(A<=B) = (A Un B = B)"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
286 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 287 |
qed "subset_Un_eq"; |
288 |
||
4059 | 289 |
goal thy "(A <= insert b C) = (A <= C | b:A & A-{b} <= C)"; |
2891 | 290 |
by (Blast_tac 1); |
923 | 291 |
qed "subset_insert_iff"; |
292 |
||
4059 | 293 |
goal thy "(A Un B = {}) = (A = {} & B = {})"; |
4089 | 294 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
923 | 295 |
qed "Un_empty"; |
1531 | 296 |
Addsimps[Un_empty]; |
923 | 297 |
|
1548 | 298 |
section "Compl"; |
923 | 299 |
|
4059 | 300 |
goal thy "A Int Compl(A) = {}"; |
2891 | 301 |
by (Blast_tac 1); |
923 | 302 |
qed "Compl_disjoint"; |
1531 | 303 |
Addsimps[Compl_disjoint]; |
923 | 304 |
|
4059 | 305 |
goal thy "A Un Compl(A) = UNIV"; |
2891 | 306 |
by (Blast_tac 1); |
923 | 307 |
qed "Compl_partition"; |
308 |
||
4059 | 309 |
goal thy "Compl(Compl(A)) = A"; |
2891 | 310 |
by (Blast_tac 1); |
923 | 311 |
qed "double_complement"; |
1531 | 312 |
Addsimps[double_complement]; |
923 | 313 |
|
4059 | 314 |
goal thy "Compl(A Un B) = Compl(A) Int Compl(B)"; |
2891 | 315 |
by (Blast_tac 1); |
923 | 316 |
qed "Compl_Un"; |
317 |
||
4059 | 318 |
goal thy "Compl(A Int B) = Compl(A) Un Compl(B)"; |
2891 | 319 |
by (Blast_tac 1); |
923 | 320 |
qed "Compl_Int"; |
321 |
||
4059 | 322 |
goal thy "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))"; |
2891 | 323 |
by (Blast_tac 1); |
923 | 324 |
qed "Compl_UN"; |
325 |
||
4059 | 326 |
goal thy "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))"; |
2891 | 327 |
by (Blast_tac 1); |
923 | 328 |
qed "Compl_INT"; |
329 |
||
4615 | 330 |
Addsimps [Compl_Un, Compl_Int, Compl_UN, Compl_INT]; |
331 |
||
923 | 332 |
(*Halmos, Naive Set Theory, page 16.*) |
333 |
||
4059 | 334 |
goal thy "((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
|
335 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 336 |
qed "Un_Int_assoc_eq"; |
337 |
||
338 |
||
1548 | 339 |
section "Union"; |
923 | 340 |
|
4059 | 341 |
goal thy "Union({}) = {}"; |
2891 | 342 |
by (Blast_tac 1); |
923 | 343 |
qed "Union_empty"; |
1531 | 344 |
Addsimps[Union_empty]; |
345 |
||
4059 | 346 |
goal thy "Union(UNIV) = UNIV"; |
2891 | 347 |
by (Blast_tac 1); |
1531 | 348 |
qed "Union_UNIV"; |
349 |
Addsimps[Union_UNIV]; |
|
923 | 350 |
|
4059 | 351 |
goal thy "Union(insert a B) = a Un Union(B)"; |
2891 | 352 |
by (Blast_tac 1); |
923 | 353 |
qed "Union_insert"; |
1531 | 354 |
Addsimps[Union_insert]; |
923 | 355 |
|
4059 | 356 |
goal thy "Union(A Un B) = Union(A) Un Union(B)"; |
2891 | 357 |
by (Blast_tac 1); |
923 | 358 |
qed "Union_Un_distrib"; |
1531 | 359 |
Addsimps[Union_Un_distrib]; |
923 | 360 |
|
4059 | 361 |
goal thy "Union(A Int B) <= Union(A) Int Union(B)"; |
2891 | 362 |
by (Blast_tac 1); |
923 | 363 |
qed "Union_Int_subset"; |
364 |
||
4059 | 365 |
goal thy "(Union M = {}) = (! A : M. A = {})"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
366 |
by (blast_tac (claset() addEs [equalityCE]) 1); |
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
367 |
qed "Union_empty_conv"; |
4003 | 368 |
AddIffs [Union_empty_conv]; |
369 |
||
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
370 |
goal thy "(Union(C) Int A = {}) = (! B:C. B Int A = {})"; |
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
371 |
by (blast_tac (claset() addSEs [equalityCE]) 1); |
923 | 372 |
qed "Union_disjoint"; |
373 |
||
1548 | 374 |
section "Inter"; |
375 |
||
4059 | 376 |
goal thy "Inter({}) = UNIV"; |
2891 | 377 |
by (Blast_tac 1); |
1531 | 378 |
qed "Inter_empty"; |
379 |
Addsimps[Inter_empty]; |
|
380 |
||
4059 | 381 |
goal thy "Inter(UNIV) = {}"; |
2891 | 382 |
by (Blast_tac 1); |
1531 | 383 |
qed "Inter_UNIV"; |
384 |
Addsimps[Inter_UNIV]; |
|
385 |
||
4059 | 386 |
goal thy "Inter(insert a B) = a Int Inter(B)"; |
2891 | 387 |
by (Blast_tac 1); |
1531 | 388 |
qed "Inter_insert"; |
389 |
Addsimps[Inter_insert]; |
|
390 |
||
4059 | 391 |
goal thy "Inter(A) Un Inter(B) <= Inter(A Int B)"; |
2891 | 392 |
by (Blast_tac 1); |
1564
822575c737bd
Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents:
1553
diff
changeset
|
393 |
qed "Inter_Un_subset"; |
1531 | 394 |
|
4059 | 395 |
goal thy "Inter(A Un B) = Inter(A) Int Inter(B)"; |
2891 | 396 |
by (Blast_tac 1); |
923 | 397 |
qed "Inter_Un_distrib"; |
398 |
||
1548 | 399 |
section "UN and INT"; |
923 | 400 |
|
401 |
(*Basic identities*) |
|
402 |
||
4200 | 403 |
val not_empty = prove_goal Set.thy "(A ~= {}) = (? x. x:A)" (K [Blast_tac 1]); |
4136 | 404 |
(*Addsimps[not_empty];*) |
405 |
||
4059 | 406 |
goal thy "(UN x:{}. B x) = {}"; |
2891 | 407 |
by (Blast_tac 1); |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
408 |
qed "UN_empty"; |
1531 | 409 |
Addsimps[UN_empty]; |
410 |
||
4059 | 411 |
goal thy "(UN x:A. {}) = {}"; |
3457 | 412 |
by (Blast_tac 1); |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
413 |
qed "UN_empty2"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
414 |
Addsimps[UN_empty2]; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
415 |
|
4634 | 416 |
goal thy "!!k. k:I ==> A k Un (UN i:I. A i) = (UN i:I. A i)"; |
417 |
by (Blast_tac 1); |
|
418 |
qed "UN_absorb"; |
|
419 |
||
4059 | 420 |
goal thy "(INT x:{}. B x) = UNIV"; |
2891 | 421 |
by (Blast_tac 1); |
1531 | 422 |
qed "INT_empty"; |
423 |
Addsimps[INT_empty]; |
|
424 |
||
4634 | 425 |
goal thy "!!k. k:I ==> A k Int (INT i:I. A i) = (INT i:I. A i)"; |
426 |
by (Blast_tac 1); |
|
427 |
qed "INT_absorb"; |
|
428 |
||
4059 | 429 |
goal thy "(UN x:insert a A. B x) = B a Un UNION A B"; |
2891 | 430 |
by (Blast_tac 1); |
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
431 |
qed "UN_insert"; |
1531 | 432 |
Addsimps[UN_insert]; |
433 |
||
4059 | 434 |
goal thy "(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
|
435 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
436 |
qed "UN_Un"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
437 |
|
4059 | 438 |
goal thy "(INT x:insert a A. B x) = B a Int INTER A B"; |
2891 | 439 |
by (Blast_tac 1); |
1531 | 440 |
qed "INT_insert"; |
441 |
Addsimps[INT_insert]; |
|
1179
7678408f9751
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents:
923
diff
changeset
|
442 |
|
4059 | 443 |
goal thy |
2021 | 444 |
"!!A. A~={} ==> (INT x:A. insert a (B x)) = insert a (INT x:A. B x)"; |
2891 | 445 |
by (Blast_tac 1); |
2021 | 446 |
qed "INT_insert_distrib"; |
447 |
||
4059 | 448 |
goal thy "Union(B``A) = (UN x:A. B(x))"; |
2891 | 449 |
by (Blast_tac 1); |
923 | 450 |
qed "Union_image_eq"; |
451 |
||
4059 | 452 |
goal thy "Inter(B``A) = (INT x:A. B(x))"; |
2891 | 453 |
by (Blast_tac 1); |
923 | 454 |
qed "Inter_image_eq"; |
455 |
||
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
456 |
goal thy "!!A. A~={} ==> (UN y:A. c) = c"; |
2891 | 457 |
by (Blast_tac 1); |
923 | 458 |
qed "UN_constant"; |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
459 |
Addsimps[UN_constant]; |
923 | 460 |
|
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
461 |
goal thy "!!A. A~={} ==> (INT y:A. c) = c"; |
2891 | 462 |
by (Blast_tac 1); |
923 | 463 |
qed "INT_constant"; |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
464 |
Addsimps[INT_constant]; |
923 | 465 |
|
4059 | 466 |
goal thy "(UN x:A. B(x)) = Union({Y. ? x:A. Y=B(x)})"; |
2891 | 467 |
by (Blast_tac 1); |
923 | 468 |
qed "UN_eq"; |
469 |
||
470 |
(*Look: it has an EXISTENTIAL quantifier*) |
|
4059 | 471 |
goal thy "(INT x:A. B(x)) = Inter({Y. ? x:A. Y=B(x)})"; |
2891 | 472 |
by (Blast_tac 1); |
923 | 473 |
qed "INT_eq"; |
474 |
||
4059 | 475 |
goalw thy [o_def] "UNION A (g o f) = UNION (f``A) g"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
476 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
477 |
qed "UNION_o"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
478 |
|
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
479 |
|
923 | 480 |
(*Distributive laws...*) |
481 |
||
4059 | 482 |
goal thy "A Int Union(B) = (UN C:B. A Int C)"; |
2891 | 483 |
by (Blast_tac 1); |
923 | 484 |
qed "Int_Union"; |
485 |
||
4306
ddbe1a9722ab
Tidying and using equalityCE instead of the slower equalityE
paulson
parents:
4231
diff
changeset
|
486 |
(* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: |
923 | 487 |
Union of a family of unions **) |
4059 | 488 |
goal thy "(UN x:C. A(x) Un B(x)) = Union(A``C) Un Union(B``C)"; |
2891 | 489 |
by (Blast_tac 1); |
923 | 490 |
qed "Un_Union_image"; |
491 |
||
492 |
(*Equivalent version*) |
|
4059 | 493 |
goal thy "(UN i:I. A(i) Un B(i)) = (UN i:I. A(i)) Un (UN i:I. B(i))"; |
2891 | 494 |
by (Blast_tac 1); |
923 | 495 |
qed "UN_Un_distrib"; |
496 |
||
4059 | 497 |
goal thy "A Un Inter(B) = (INT C:B. A Un C)"; |
2891 | 498 |
by (Blast_tac 1); |
923 | 499 |
qed "Un_Inter"; |
500 |
||
4059 | 501 |
goal thy "(INT x:C. A(x) Int B(x)) = Inter(A``C) Int Inter(B``C)"; |
2891 | 502 |
by (Blast_tac 1); |
923 | 503 |
qed "Int_Inter_image"; |
504 |
||
505 |
(*Equivalent version*) |
|
4059 | 506 |
goal thy "(INT i:I. A(i) Int B(i)) = (INT i:I. A(i)) Int (INT i:I. B(i))"; |
2891 | 507 |
by (Blast_tac 1); |
923 | 508 |
qed "INT_Int_distrib"; |
509 |
||
510 |
(*Halmos, Naive Set Theory, page 35.*) |
|
4059 | 511 |
goal thy "B Int (UN i:I. A(i)) = (UN i:I. B Int A(i))"; |
2891 | 512 |
by (Blast_tac 1); |
923 | 513 |
qed "Int_UN_distrib"; |
514 |
||
4059 | 515 |
goal thy "B Un (INT i:I. A(i)) = (INT i:I. B Un A(i))"; |
2891 | 516 |
by (Blast_tac 1); |
923 | 517 |
qed "Un_INT_distrib"; |
518 |
||
4059 | 519 |
goal thy |
923 | 520 |
"(UN i:I. A(i)) Int (UN j:J. B(j)) = (UN i:I. UN j:J. A(i) Int B(j))"; |
2891 | 521 |
by (Blast_tac 1); |
923 | 522 |
qed "Int_UN_distrib2"; |
523 |
||
4059 | 524 |
goal thy |
923 | 525 |
"(INT i:I. A(i)) Un (INT j:J. B(j)) = (INT i:I. INT j:J. A(i) Un B(j))"; |
2891 | 526 |
by (Blast_tac 1); |
923 | 527 |
qed "Un_INT_distrib2"; |
528 |
||
2512 | 529 |
|
530 |
section"Bounded quantifiers"; |
|
531 |
||
3860 | 532 |
(** The following are not added to the default simpset because |
533 |
(a) they duplicate the body and (b) there are no similar rules for Int. **) |
|
2512 | 534 |
|
4059 | 535 |
goal thy "(ALL x:A Un B. P x) = ((ALL x:A. P x) & (ALL x:B. P x))"; |
2891 | 536 |
by (Blast_tac 1); |
2519 | 537 |
qed "ball_Un"; |
538 |
||
4059 | 539 |
goal thy "(EX x:A Un B. P x) = ((EX x:A. P x) | (EX x:B. P x))"; |
2891 | 540 |
by (Blast_tac 1); |
2519 | 541 |
qed "bex_Un"; |
2512 | 542 |
|
543 |
||
1548 | 544 |
section "-"; |
923 | 545 |
|
4609 | 546 |
goal thy "A-B = A Int Compl B"; |
547 |
by (Blast_tac 1); |
|
548 |
qed "Diff_eq_Int_Compl"; |
|
549 |
||
4059 | 550 |
goal thy "A-A = {}"; |
2891 | 551 |
by (Blast_tac 1); |
923 | 552 |
qed "Diff_cancel"; |
1531 | 553 |
Addsimps[Diff_cancel]; |
923 | 554 |
|
4059 | 555 |
goal thy "{}-A = {}"; |
2891 | 556 |
by (Blast_tac 1); |
923 | 557 |
qed "empty_Diff"; |
1531 | 558 |
Addsimps[empty_Diff]; |
923 | 559 |
|
4059 | 560 |
goal thy "A-{} = A"; |
2891 | 561 |
by (Blast_tac 1); |
923 | 562 |
qed "Diff_empty"; |
1531 | 563 |
Addsimps[Diff_empty]; |
564 |
||
4059 | 565 |
goal thy "A-UNIV = {}"; |
2891 | 566 |
by (Blast_tac 1); |
1531 | 567 |
qed "Diff_UNIV"; |
568 |
Addsimps[Diff_UNIV]; |
|
569 |
||
4059 | 570 |
goal thy "!!x. x~:A ==> A - insert x B = A-B"; |
2891 | 571 |
by (Blast_tac 1); |
1531 | 572 |
qed "Diff_insert0"; |
573 |
Addsimps [Diff_insert0]; |
|
923 | 574 |
|
575 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*) |
|
4059 | 576 |
goal thy "A - insert a B = A - B - {a}"; |
2891 | 577 |
by (Blast_tac 1); |
923 | 578 |
qed "Diff_insert"; |
579 |
||
580 |
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*) |
|
4059 | 581 |
goal thy "A - insert a B = A - {a} - B"; |
2891 | 582 |
by (Blast_tac 1); |
923 | 583 |
qed "Diff_insert2"; |
584 |
||
4059 | 585 |
goal thy "insert x A - B = (if x:B then A-B else insert x (A-B))"; |
4089 | 586 |
by (simp_tac (simpset() addsplits [expand_if]) 1); |
2891 | 587 |
by (Blast_tac 1); |
1531 | 588 |
qed "insert_Diff_if"; |
589 |
||
4059 | 590 |
goal thy "!!x. x:B ==> insert x A - B = A-B"; |
2891 | 591 |
by (Blast_tac 1); |
1531 | 592 |
qed "insert_Diff1"; |
593 |
Addsimps [insert_Diff1]; |
|
594 |
||
4059 | 595 |
goal thy "!!a. a:A ==> insert a (A-{a}) = A"; |
2922 | 596 |
by (Blast_tac 1); |
923 | 597 |
qed "insert_Diff"; |
598 |
||
4059 | 599 |
goal thy "A Int (B-A) = {}"; |
2891 | 600 |
by (Blast_tac 1); |
923 | 601 |
qed "Diff_disjoint"; |
1531 | 602 |
Addsimps[Diff_disjoint]; |
923 | 603 |
|
4059 | 604 |
goal thy "!!A. A<=B ==> A Un (B-A) = B"; |
2891 | 605 |
by (Blast_tac 1); |
923 | 606 |
qed "Diff_partition"; |
607 |
||
4059 | 608 |
goal thy "!!A. [| A<=B; B<= C |] ==> (B - (C - A)) = (A :: 'a set)"; |
2891 | 609 |
by (Blast_tac 1); |
923 | 610 |
qed "double_diff"; |
611 |
||
4059 | 612 |
goal thy "A - (B Un C) = (A-B) Int (A-C)"; |
2891 | 613 |
by (Blast_tac 1); |
923 | 614 |
qed "Diff_Un"; |
615 |
||
4059 | 616 |
goal thy "A - (B Int C) = (A-B) Un (A-C)"; |
2891 | 617 |
by (Blast_tac 1); |
923 | 618 |
qed "Diff_Int"; |
619 |
||
4059 | 620 |
goal thy "(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
|
621 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
622 |
qed "Un_Diff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
623 |
|
4059 | 624 |
goal thy "(A Int B) - C = (A - C) Int (B - C)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
625 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
626 |
qed "Int_Diff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
627 |
|
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
628 |
|
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
629 |
section "Miscellany"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
630 |
|
4059 | 631 |
goal thy "(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
|
632 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
633 |
qed "set_eq_subset"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
634 |
|
4059 | 635 |
goal thy "A <= B = (! t. t:A --> t:B)"; |
3222
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
636 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
637 |
qed "subset_iff"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
638 |
|
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
639 |
goalw thy [psubset_def] "((A::'a set) <= B) = ((A < B) | (A=B))"; |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
640 |
by (Blast_tac 1); |
726a9b069947
Distributed Psubset stuff to basic set theory files, incl Finite.
nipkow
parents:
2922
diff
changeset
|
641 |
qed "subset_iff_psubset_eq"; |
2021 | 642 |
|
4059 | 643 |
goal thy "(!x. x ~: A) = (A={})"; |
4423 | 644 |
by (Blast_tac 1); |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3860
diff
changeset
|
645 |
qed "all_not_in_conv"; |
3907 | 646 |
AddIffs [all_not_in_conv]; |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3860
diff
changeset
|
647 |
|
4059 | 648 |
goalw thy [Pow_def] "Pow {} = {{}}"; |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4423
diff
changeset
|
649 |
by Auto_tac; |
3348
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
650 |
qed "Pow_empty"; |
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
651 |
Addsimps [Pow_empty]; |
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
652 |
|
4059 | 653 |
goal thy "Pow (insert a A) = Pow A Un (insert a `` Pow A)"; |
3724 | 654 |
by Safe_tac; |
3457 | 655 |
by (etac swap 1); |
3348
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
656 |
by (res_inst_tac [("x", "x-{a}")] image_eqI 1); |
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
657 |
by (ALLGOALS Blast_tac); |
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
658 |
qed "Pow_insert"; |
3f9a806f061e
Two useful facts about Powersets suggested by Florian Kammueller
paulson
parents:
3222
diff
changeset
|
659 |
|
2021 | 660 |
|
661 |
(** Miniscoping: pushing in big Unions and Intersections **) |
|
662 |
local |
|
4059 | 663 |
fun prover s = prove_goal thy s (fn _ => [Blast_tac 1]) |
2021 | 664 |
in |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
665 |
val UN_simps = map prover |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
666 |
["!!C. C ~= {} ==> (UN x:C. insert a (B x)) = insert a (UN x:C. B x)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
667 |
"!!C. C ~= {} ==> (UN x:C. A x Un B) = ((UN x:C. A x) Un B)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
668 |
"!!C. C ~= {} ==> (UN x:C. A Un B x) = (A Un (UN x:C. B x))", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
669 |
"(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
|
670 |
"(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
|
671 |
"(UN x:C. A x - B) = ((UN x:C. A x) - B)", |
4231 | 672 |
"(UN x:C. A - B x) = (A - (INT x:C. B x))", |
673 |
"(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
|
674 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
675 |
val INT_simps = map prover |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
676 |
["!!C. C ~= {} ==> (INT x:C. A x Int B) = ((INT x:C. A x) Int B)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
677 |
"!!C. C ~= {} ==> (INT x:C. A Int B x) = (A Int (INT x:C. B x))", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
678 |
"!!C. C ~= {} ==> (INT x:C. A x - B) = ((INT x:C. A x) - B)", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
679 |
"!!C. C ~= {} ==> (INT x:C. A - B x) = (A - (UN x:C. B x))", |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
680 |
"(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
|
681 |
"(INT x:C. A x Un B) = ((INT x:C. A x) Un B)", |
4231 | 682 |
"(INT x:C. A Un B x) = (A Un (INT x:C. B x))", |
683 |
"(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
|
684 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
685 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
686 |
val ball_simps = map prover |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
687 |
["(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
|
688 |
"(ALL x:A. P | Q x) = (P | (ALL x:A. Q x))", |
3422 | 689 |
"(ALL x:A. P --> Q x) = (P --> (ALL x:A. Q x))", |
690 |
"(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
|
691 |
"(ALL x:{}. P x) = True", |
4136 | 692 |
"(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
|
693 |
"(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
|
694 |
"(ALL x:Union(A). P x) = (ALL y:A. ALL x:y. P x)", |
3860 | 695 |
"(ALL x:Collect Q. P x) = (ALL x. Q x --> P x)", |
696 |
"(ALL x:f``A. P x) = (ALL x:A. P(f x))", |
|
697 |
"(~(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
|
698 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
699 |
val ball_conj_distrib = |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
700 |
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
|
701 |
|
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
702 |
val bex_simps = map prover |
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
703 |
["(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
|
704 |
"(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
|
705 |
"(EX x:{}. P x) = False", |
4136 | 706 |
"(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
|
707 |
"(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
|
708 |
"(EX x:Union(A). P x) = (EX y:A. EX x:y. P x)", |
3860 | 709 |
"(EX x:Collect Q. P x) = (EX x. Q x & P x)", |
710 |
"(EX x:f``A. P x) = (EX x:A. P(f x))", |
|
711 |
"(~(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
|
712 |
|
3426 | 713 |
val bex_disj_distrib = |
2513
d708d8cdc8e8
New miniscoping rules for the bounded quantifiers and UN/INT operators
paulson
parents:
2512
diff
changeset
|
714 |
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
|
715 |
|
2021 | 716 |
end; |
717 |
||
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4136
diff
changeset
|
718 |
Addsimps (UN_simps @ INT_simps @ ball_simps @ bex_simps); |