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