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