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