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