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