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