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