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