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