author | berghofe |
Thu, 10 Oct 2002 14:21:49 +0200 | |
changeset 13638 | 2b234b079245 |
parent 13624 | 17684cf64fda |
child 13653 | ef123b9e8089 |
permissions | -rw-r--r-- |
923 | 1 |
(* Title: HOL/Set.thy |
2 |
ID: $Id$ |
|
12257 | 3 |
Author: Tobias Nipkow, Lawrence C Paulson and Markus Wenzel |
12020 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
923 | 5 |
*) |
6 |
||
11979 | 7 |
header {* Set theory for higher-order logic *} |
8 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
9 |
theory Set = HOL: |
11979 | 10 |
|
11 |
text {* A set in HOL is simply a predicate. *} |
|
923 | 12 |
|
2261 | 13 |
|
11979 | 14 |
subsection {* Basic syntax *} |
2261 | 15 |
|
3947 | 16 |
global |
17 |
||
11979 | 18 |
typedecl 'a set |
12338
de0f4a63baa5
renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents:
12257
diff
changeset
|
19 |
arities set :: (type) type |
3820 | 20 |
|
923 | 21 |
consts |
11979 | 22 |
"{}" :: "'a set" ("{}") |
23 |
UNIV :: "'a set" |
|
24 |
insert :: "'a => 'a set => 'a set" |
|
25 |
Collect :: "('a => bool) => 'a set" -- "comprehension" |
|
26 |
Int :: "'a set => 'a set => 'a set" (infixl 70) |
|
27 |
Un :: "'a set => 'a set => 'a set" (infixl 65) |
|
28 |
UNION :: "'a set => ('a => 'b set) => 'b set" -- "general union" |
|
29 |
INTER :: "'a set => ('a => 'b set) => 'b set" -- "general intersection" |
|
30 |
Union :: "'a set set => 'a set" -- "union of a set" |
|
31 |
Inter :: "'a set set => 'a set" -- "intersection of a set" |
|
32 |
Pow :: "'a set => 'a set set" -- "powerset" |
|
33 |
Ball :: "'a set => ('a => bool) => bool" -- "bounded universal quantifiers" |
|
34 |
Bex :: "'a set => ('a => bool) => bool" -- "bounded existential quantifiers" |
|
35 |
image :: "('a => 'b) => 'a set => 'b set" (infixr "`" 90) |
|
36 |
||
37 |
syntax |
|
38 |
"op :" :: "'a => 'a set => bool" ("op :") |
|
39 |
consts |
|
40 |
"op :" :: "'a => 'a set => bool" ("(_/ : _)" [50, 51] 50) -- "membership" |
|
41 |
||
42 |
local |
|
43 |
||
12338
de0f4a63baa5
renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents:
12257
diff
changeset
|
44 |
instance set :: (type) ord .. |
de0f4a63baa5
renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents:
12257
diff
changeset
|
45 |
instance set :: (type) minus .. |
923 | 46 |
|
47 |
||
11979 | 48 |
subsection {* Additional concrete syntax *} |
2261 | 49 |
|
923 | 50 |
syntax |
11979 | 51 |
range :: "('a => 'b) => 'b set" -- "of function" |
923 | 52 |
|
11979 | 53 |
"op ~:" :: "'a => 'a set => bool" ("op ~:") -- "non-membership" |
54 |
"op ~:" :: "'a => 'a set => bool" ("(_/ ~: _)" [50, 51] 50) |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
55 |
|
11979 | 56 |
"@Finset" :: "args => 'a set" ("{(_)}") |
57 |
"@Coll" :: "pttrn => bool => 'a set" ("(1{_./ _})") |
|
58 |
"@SetCompr" :: "'a => idts => bool => 'a set" ("(1{_ |/_./ _})") |
|
923 | 59 |
|
11979 | 60 |
"@INTER1" :: "pttrns => 'b set => 'b set" ("(3INT _./ _)" 10) |
61 |
"@UNION1" :: "pttrns => 'b set => 'b set" ("(3UN _./ _)" 10) |
|
62 |
"@INTER" :: "pttrn => 'a set => 'b set => 'b set" ("(3INT _:_./ _)" 10) |
|
63 |
"@UNION" :: "pttrn => 'a set => 'b set => 'b set" ("(3UN _:_./ _)" 10) |
|
923 | 64 |
|
11979 | 65 |
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3ALL _:_./ _)" [0, 0, 10] 10) |
66 |
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3EX _:_./ _)" [0, 0, 10] 10) |
|
923 | 67 |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
68 |
syntax (HOL) |
11979 | 69 |
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3! _:_./ _)" [0, 0, 10] 10) |
70 |
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3? _:_./ _)" [0, 0, 10] 10) |
|
923 | 71 |
|
72 |
translations |
|
10832 | 73 |
"range f" == "f`UNIV" |
923 | 74 |
"x ~: y" == "~ (x : y)" |
75 |
"{x, xs}" == "insert x {xs}" |
|
76 |
"{x}" == "insert x {}" |
|
77 |
"{x. P}" == "Collect (%x. P)" |
|
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4151
diff
changeset
|
78 |
"UN x y. B" == "UN x. UN y. B" |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4151
diff
changeset
|
79 |
"UN x. B" == "UNION UNIV (%x. B)" |
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
80 |
"INT x y. B" == "INT x. INT y. B" |
4159
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4151
diff
changeset
|
81 |
"INT x. B" == "INTER UNIV (%x. B)" |
4aff9b7e5597
UNIV now a constant; UNION1, INTER1 now translations and no longer have
paulson
parents:
4151
diff
changeset
|
82 |
"UN x:A. B" == "UNION A (%x. B)" |
923 | 83 |
"INT x:A. B" == "INTER A (%x. B)" |
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
84 |
"ALL x:A. P" == "Ball A (%x. P)" |
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
85 |
"EX x:A. P" == "Bex A (%x. P)" |
923 | 86 |
|
12633 | 87 |
syntax (output) |
11979 | 88 |
"_setle" :: "'a set => 'a set => bool" ("op <=") |
89 |
"_setle" :: "'a set => 'a set => bool" ("(_/ <= _)" [50, 51] 50) |
|
90 |
"_setless" :: "'a set => 'a set => bool" ("op <") |
|
91 |
"_setless" :: "'a set => 'a set => bool" ("(_/ < _)" [50, 51] 50) |
|
923 | 92 |
|
12114
a8e860c86252
eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents:
12023
diff
changeset
|
93 |
syntax (xsymbols) |
11979 | 94 |
"_setle" :: "'a set => 'a set => bool" ("op \<subseteq>") |
95 |
"_setle" :: "'a set => 'a set => bool" ("(_/ \<subseteq> _)" [50, 51] 50) |
|
96 |
"_setless" :: "'a set => 'a set => bool" ("op \<subset>") |
|
97 |
"_setless" :: "'a set => 'a set => bool" ("(_/ \<subset> _)" [50, 51] 50) |
|
98 |
"op Int" :: "'a set => 'a set => 'a set" (infixl "\<inter>" 70) |
|
99 |
"op Un" :: "'a set => 'a set => 'a set" (infixl "\<union>" 65) |
|
100 |
"op :" :: "'a => 'a set => bool" ("op \<in>") |
|
101 |
"op :" :: "'a => 'a set => bool" ("(_/ \<in> _)" [50, 51] 50) |
|
102 |
"op ~:" :: "'a => 'a set => bool" ("op \<notin>") |
|
103 |
"op ~:" :: "'a => 'a set => bool" ("(_/ \<notin> _)" [50, 51] 50) |
|
104 |
"@UNION1" :: "pttrns => 'b set => 'b set" ("(3\<Union>_./ _)" 10) |
|
105 |
"@INTER1" :: "pttrns => 'b set => 'b set" ("(3\<Inter>_./ _)" 10) |
|
106 |
"@UNION" :: "pttrn => 'a set => 'b set => 'b set" ("(3\<Union>_\<in>_./ _)" 10) |
|
107 |
"@INTER" :: "pttrn => 'a set => 'b set => 'b set" ("(3\<Inter>_\<in>_./ _)" 10) |
|
108 |
Union :: "'a set set => 'a set" ("\<Union>_" [90] 90) |
|
109 |
Inter :: "'a set set => 'a set" ("\<Inter>_" [90] 90) |
|
110 |
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3\<forall>_\<in>_./ _)" [0, 0, 10] 10) |
|
111 |
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10) |
|
2261 | 112 |
|
2412 | 113 |
translations |
11979 | 114 |
"op \<subseteq>" => "op <= :: _ set => _ set => bool" |
115 |
"op \<subset>" => "op < :: _ set => _ set => bool" |
|
2261 | 116 |
|
117 |
||
11979 | 118 |
typed_print_translation {* |
119 |
let |
|
120 |
fun le_tr' _ (Type ("fun", (Type ("set", _) :: _))) ts = |
|
121 |
list_comb (Syntax.const "_setle", ts) |
|
122 |
| le_tr' _ _ _ = raise Match; |
|
123 |
||
124 |
fun less_tr' _ (Type ("fun", (Type ("set", _) :: _))) ts = |
|
125 |
list_comb (Syntax.const "_setless", ts) |
|
126 |
| less_tr' _ _ _ = raise Match; |
|
127 |
in [("op <=", le_tr'), ("op <", less_tr')] end |
|
128 |
*} |
|
2261 | 129 |
|
11979 | 130 |
text {* |
131 |
\medskip Translate between @{text "{e | x1...xn. P}"} and @{text |
|
132 |
"{u. EX x1..xn. u = e & P}"}; @{text "{y. EX x1..xn. y = e & P}"} is |
|
133 |
only translated if @{text "[0..n] subset bvs(e)"}. |
|
134 |
*} |
|
135 |
||
136 |
parse_translation {* |
|
137 |
let |
|
138 |
val ex_tr = snd (mk_binder_tr ("EX ", "Ex")); |
|
3947 | 139 |
|
11979 | 140 |
fun nvars (Const ("_idts", _) $ _ $ idts) = nvars idts + 1 |
141 |
| nvars _ = 1; |
|
142 |
||
143 |
fun setcompr_tr [e, idts, b] = |
|
144 |
let |
|
145 |
val eq = Syntax.const "op =" $ Bound (nvars idts) $ e; |
|
146 |
val P = Syntax.const "op &" $ eq $ b; |
|
147 |
val exP = ex_tr [idts, P]; |
|
148 |
in Syntax.const "Collect" $ Abs ("", dummyT, exP) end; |
|
149 |
||
150 |
in [("@SetCompr", setcompr_tr)] end; |
|
151 |
*} |
|
923 | 152 |
|
11979 | 153 |
print_translation {* |
154 |
let |
|
155 |
val ex_tr' = snd (mk_binder_tr' ("Ex", "DUMMY")); |
|
156 |
||
157 |
fun setcompr_tr' [Abs (_, _, P)] = |
|
158 |
let |
|
159 |
fun check (Const ("Ex", _) $ Abs (_, _, P), n) = check (P, n + 1) |
|
160 |
| check (Const ("op &", _) $ (Const ("op =", _) $ Bound m $ e) $ P, n) = |
|
161 |
if n > 0 andalso m = n andalso not (loose_bvar1 (P, n)) andalso |
|
162 |
((0 upto (n - 1)) subset add_loose_bnos (e, 0, [])) then () |
|
163 |
else raise Match; |
|
923 | 164 |
|
11979 | 165 |
fun tr' (_ $ abs) = |
166 |
let val _ $ idts $ (_ $ (_ $ _ $ e) $ Q) = ex_tr' [abs] |
|
167 |
in Syntax.const "@SetCompr" $ e $ idts $ Q end; |
|
168 |
in check (P, 0); tr' P end; |
|
169 |
in [("Collect", setcompr_tr')] end; |
|
170 |
*} |
|
171 |
||
172 |
||
173 |
subsection {* Rules and definitions *} |
|
174 |
||
175 |
text {* Isomorphisms between predicates and sets. *} |
|
923 | 176 |
|
11979 | 177 |
axioms |
178 |
mem_Collect_eq [iff]: "(a : {x. P(x)}) = P(a)" |
|
179 |
Collect_mem_eq [simp]: "{x. x:A} = A" |
|
180 |
||
181 |
defs |
|
182 |
Ball_def: "Ball A P == ALL x. x:A --> P(x)" |
|
183 |
Bex_def: "Bex A P == EX x. x:A & P(x)" |
|
184 |
||
185 |
defs (overloaded) |
|
186 |
subset_def: "A <= B == ALL x:A. x:B" |
|
187 |
psubset_def: "A < B == (A::'a set) <= B & ~ A=B" |
|
188 |
Compl_def: "- A == {x. ~x:A}" |
|
12257 | 189 |
set_diff_def: "A - B == {x. x:A & ~x:B}" |
923 | 190 |
|
191 |
defs |
|
11979 | 192 |
Un_def: "A Un B == {x. x:A | x:B}" |
193 |
Int_def: "A Int B == {x. x:A & x:B}" |
|
194 |
INTER_def: "INTER A B == {y. ALL x:A. y: B(x)}" |
|
195 |
UNION_def: "UNION A B == {y. EX x:A. y: B(x)}" |
|
196 |
Inter_def: "Inter S == (INT x:S. x)" |
|
197 |
Union_def: "Union S == (UN x:S. x)" |
|
198 |
Pow_def: "Pow A == {B. B <= A}" |
|
199 |
empty_def: "{} == {x. False}" |
|
200 |
UNIV_def: "UNIV == {x. True}" |
|
201 |
insert_def: "insert a B == {x. x=a} Un B" |
|
202 |
image_def: "f`A == {y. EX x:A. y = f(x)}" |
|
203 |
||
204 |
||
205 |
subsection {* Lemmas and proof tool setup *} |
|
206 |
||
207 |
subsubsection {* Relating predicates and sets *} |
|
208 |
||
12257 | 209 |
lemma CollectI: "P(a) ==> a : {x. P(x)}" |
11979 | 210 |
by simp |
211 |
||
212 |
lemma CollectD: "a : {x. P(x)} ==> P(a)" |
|
213 |
by simp |
|
214 |
||
12937
0c4fd7529467
clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents:
12897
diff
changeset
|
215 |
lemma set_ext: assumes prem: "(!!x. (x:A) = (x:B))" shows "A = B" |
12257 | 216 |
apply (rule prem [THEN ext, THEN arg_cong, THEN box_equals]) |
217 |
apply (rule Collect_mem_eq) |
|
218 |
apply (rule Collect_mem_eq) |
|
219 |
done |
|
11979 | 220 |
|
221 |
lemma Collect_cong: "(!!x. P x = Q x) ==> {x. P(x)} = {x. Q(x)}" |
|
222 |
by simp |
|
223 |
||
12257 | 224 |
lemmas CollectE = CollectD [elim_format] |
11979 | 225 |
|
226 |
||
227 |
subsubsection {* Bounded quantifiers *} |
|
228 |
||
229 |
lemma ballI [intro!]: "(!!x. x:A ==> P x) ==> ALL x:A. P x" |
|
230 |
by (simp add: Ball_def) |
|
231 |
||
232 |
lemmas strip = impI allI ballI |
|
233 |
||
234 |
lemma bspec [dest?]: "ALL x:A. P x ==> x:A ==> P x" |
|
235 |
by (simp add: Ball_def) |
|
236 |
||
237 |
lemma ballE [elim]: "ALL x:A. P x ==> (P x ==> Q) ==> (x ~: A ==> Q) ==> Q" |
|
238 |
by (unfold Ball_def) blast |
|
239 |
||
240 |
text {* |
|
241 |
\medskip This tactic takes assumptions @{prop "ALL x:A. P x"} and |
|
242 |
@{prop "a:A"}; creates assumption @{prop "P a"}. |
|
243 |
*} |
|
244 |
||
245 |
ML {* |
|
246 |
local val ballE = thm "ballE" |
|
247 |
in fun ball_tac i = etac ballE i THEN contr_tac (i + 1) end; |
|
248 |
*} |
|
249 |
||
250 |
text {* |
|
251 |
Gives better instantiation for bound: |
|
252 |
*} |
|
253 |
||
254 |
ML_setup {* |
|
255 |
claset_ref() := claset() addbefore ("bspec", datac (thm "bspec") 1); |
|
256 |
*} |
|
257 |
||
258 |
lemma bexI [intro]: "P x ==> x:A ==> EX x:A. P x" |
|
259 |
-- {* Normally the best argument order: @{prop "P x"} constrains the |
|
260 |
choice of @{prop "x:A"}. *} |
|
261 |
by (unfold Bex_def) blast |
|
262 |
||
13113 | 263 |
lemma rev_bexI [intro?]: "x:A ==> P x ==> EX x:A. P x" |
11979 | 264 |
-- {* The best argument order when there is only one @{prop "x:A"}. *} |
265 |
by (unfold Bex_def) blast |
|
266 |
||
267 |
lemma bexCI: "(ALL x:A. ~P x ==> P a) ==> a:A ==> EX x:A. P x" |
|
268 |
by (unfold Bex_def) blast |
|
269 |
||
270 |
lemma bexE [elim!]: "EX x:A. P x ==> (!!x. x:A ==> P x ==> Q) ==> Q" |
|
271 |
by (unfold Bex_def) blast |
|
272 |
||
273 |
lemma ball_triv [simp]: "(ALL x:A. P) = ((EX x. x:A) --> P)" |
|
274 |
-- {* Trival rewrite rule. *} |
|
275 |
by (simp add: Ball_def) |
|
276 |
||
277 |
lemma bex_triv [simp]: "(EX x:A. P) = ((EX x. x:A) & P)" |
|
278 |
-- {* Dual form for existentials. *} |
|
279 |
by (simp add: Bex_def) |
|
280 |
||
281 |
lemma bex_triv_one_point1 [simp]: "(EX x:A. x = a) = (a:A)" |
|
282 |
by blast |
|
283 |
||
284 |
lemma bex_triv_one_point2 [simp]: "(EX x:A. a = x) = (a:A)" |
|
285 |
by blast |
|
286 |
||
287 |
lemma bex_one_point1 [simp]: "(EX x:A. x = a & P x) = (a:A & P a)" |
|
288 |
by blast |
|
289 |
||
290 |
lemma bex_one_point2 [simp]: "(EX x:A. a = x & P x) = (a:A & P a)" |
|
291 |
by blast |
|
292 |
||
293 |
lemma ball_one_point1 [simp]: "(ALL x:A. x = a --> P x) = (a:A --> P a)" |
|
294 |
by blast |
|
295 |
||
296 |
lemma ball_one_point2 [simp]: "(ALL x:A. a = x --> P x) = (a:A --> P a)" |
|
297 |
by blast |
|
298 |
||
299 |
ML_setup {* |
|
13462 | 300 |
local |
11979 | 301 |
val Ball_def = thm "Ball_def"; |
302 |
val Bex_def = thm "Bex_def"; |
|
303 |
||
304 |
val prove_bex_tac = |
|
305 |
rewrite_goals_tac [Bex_def] THEN Quantifier1.prove_one_point_ex_tac; |
|
306 |
val rearrange_bex = Quantifier1.rearrange_bex prove_bex_tac; |
|
307 |
||
308 |
val prove_ball_tac = |
|
309 |
rewrite_goals_tac [Ball_def] THEN Quantifier1.prove_one_point_all_tac; |
|
310 |
val rearrange_ball = Quantifier1.rearrange_ball prove_ball_tac; |
|
311 |
in |
|
13462 | 312 |
val defBEX_regroup = Simplifier.simproc (Theory.sign_of (the_context ())) |
313 |
"defined BEX" ["EX x:A. P x & Q x"] rearrange_bex; |
|
314 |
val defBALL_regroup = Simplifier.simproc (Theory.sign_of (the_context ())) |
|
315 |
"defined BALL" ["ALL x:A. P x --> Q x"] rearrange_ball; |
|
11979 | 316 |
end; |
13462 | 317 |
|
318 |
Addsimprocs [defBALL_regroup, defBEX_regroup]; |
|
11979 | 319 |
*} |
320 |
||
321 |
||
322 |
subsubsection {* Congruence rules *} |
|
323 |
||
324 |
lemma ball_cong [cong]: |
|
325 |
"A = B ==> (!!x. x:B ==> P x = Q x) ==> |
|
326 |
(ALL x:A. P x) = (ALL x:B. Q x)" |
|
327 |
by (simp add: Ball_def) |
|
328 |
||
329 |
lemma bex_cong [cong]: |
|
330 |
"A = B ==> (!!x. x:B ==> P x = Q x) ==> |
|
331 |
(EX x:A. P x) = (EX x:B. Q x)" |
|
332 |
by (simp add: Bex_def cong: conj_cong) |
|
1273 | 333 |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
334 |
|
11979 | 335 |
subsubsection {* Subsets *} |
336 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
337 |
lemma subsetI [intro!]: "(!!x. x:A ==> x:B) ==> A \<subseteq> B" |
11979 | 338 |
by (simp add: subset_def) |
339 |
||
340 |
text {* |
|
341 |
\medskip Map the type @{text "'a set => anything"} to just @{typ |
|
342 |
'a}; for overloading constants whose first argument has type @{typ |
|
343 |
"'a set"}. |
|
344 |
*} |
|
345 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
346 |
lemma subsetD [elim]: "A \<subseteq> B ==> c \<in> A ==> c \<in> B" |
11979 | 347 |
-- {* Rule in Modus Ponens style. *} |
348 |
by (unfold subset_def) blast |
|
349 |
||
350 |
declare subsetD [intro?] -- FIXME |
|
351 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
352 |
lemma rev_subsetD: "c \<in> A ==> A \<subseteq> B ==> c \<in> B" |
11979 | 353 |
-- {* The same, with reversed premises for use with @{text erule} -- |
354 |
cf @{text rev_mp}. *} |
|
355 |
by (rule subsetD) |
|
356 |
||
357 |
declare rev_subsetD [intro?] -- FIXME |
|
358 |
||
359 |
text {* |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
360 |
\medskip Converts @{prop "A \<subseteq> B"} to @{prop "x \<in> A ==> x \<in> B"}. |
11979 | 361 |
*} |
362 |
||
363 |
ML {* |
|
364 |
local val rev_subsetD = thm "rev_subsetD" |
|
365 |
in fun impOfSubs th = th RSN (2, rev_subsetD) end; |
|
366 |
*} |
|
367 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
368 |
lemma subsetCE [elim]: "A \<subseteq> B ==> (c \<notin> A ==> P) ==> (c \<in> B ==> P) ==> P" |
11979 | 369 |
-- {* Classical elimination rule. *} |
370 |
by (unfold subset_def) blast |
|
371 |
||
372 |
text {* |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
373 |
\medskip Takes assumptions @{prop "A \<subseteq> B"}; @{prop "c \<in> A"} and |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
374 |
creates the assumption @{prop "c \<in> B"}. |
11979 | 375 |
*} |
376 |
||
377 |
ML {* |
|
378 |
local val subsetCE = thm "subsetCE" |
|
379 |
in fun set_mp_tac i = etac subsetCE i THEN mp_tac i end; |
|
380 |
*} |
|
381 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
382 |
lemma contra_subsetD: "A \<subseteq> B ==> c \<notin> B ==> c \<notin> A" |
11979 | 383 |
by blast |
384 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
385 |
lemma subset_refl: "A \<subseteq> A" |
11979 | 386 |
by fast |
387 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
388 |
lemma subset_trans: "A \<subseteq> B ==> B \<subseteq> C ==> A \<subseteq> C" |
11979 | 389 |
by blast |
923 | 390 |
|
2261 | 391 |
|
11979 | 392 |
subsubsection {* Equality *} |
393 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
394 |
lemma subset_antisym [intro!]: "A \<subseteq> B ==> B \<subseteq> A ==> A = B" |
11979 | 395 |
-- {* Anti-symmetry of the subset relation. *} |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
396 |
by (rules intro: set_ext subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
397 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
398 |
lemmas equalityI [intro!] = subset_antisym |
11979 | 399 |
|
400 |
text {* |
|
401 |
\medskip Equality rules from ZF set theory -- are they appropriate |
|
402 |
here? |
|
403 |
*} |
|
404 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
405 |
lemma equalityD1: "A = B ==> A \<subseteq> B" |
11979 | 406 |
by (simp add: subset_refl) |
407 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
408 |
lemma equalityD2: "A = B ==> B \<subseteq> A" |
11979 | 409 |
by (simp add: subset_refl) |
410 |
||
411 |
text {* |
|
412 |
\medskip Be careful when adding this to the claset as @{text |
|
413 |
subset_empty} is in the simpset: @{prop "A = {}"} goes to @{prop "{} |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
414 |
\<subseteq> A"} and @{prop "A \<subseteq> {}"} and then back to @{prop "A = {}"}! |
11979 | 415 |
*} |
416 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
417 |
lemma equalityE: "A = B ==> (A \<subseteq> B ==> B \<subseteq> A ==> P) ==> P" |
11979 | 418 |
by (simp add: subset_refl) |
923 | 419 |
|
11979 | 420 |
lemma equalityCE [elim]: |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
421 |
"A = B ==> (c \<in> A ==> c \<in> B ==> P) ==> (c \<notin> A ==> c \<notin> B ==> P) ==> P" |
11979 | 422 |
by blast |
423 |
||
424 |
text {* |
|
425 |
\medskip Lemma for creating induction formulae -- for "pattern |
|
426 |
matching" on @{text p}. To make the induction hypotheses usable, |
|
427 |
apply @{text spec} or @{text bspec} to put universal quantifiers over the free |
|
428 |
variables in @{text p}. |
|
429 |
*} |
|
430 |
||
431 |
lemma setup_induction: "p:A ==> (!!z. z:A ==> p = z --> R) ==> R" |
|
432 |
by simp |
|
923 | 433 |
|
11979 | 434 |
lemma eqset_imp_iff: "A = B ==> (x : A) = (x : B)" |
435 |
by simp |
|
436 |
||
437 |
||
438 |
subsubsection {* The universal set -- UNIV *} |
|
439 |
||
440 |
lemma UNIV_I [simp]: "x : UNIV" |
|
441 |
by (simp add: UNIV_def) |
|
442 |
||
443 |
declare UNIV_I [intro] -- {* unsafe makes it less likely to cause problems *} |
|
444 |
||
445 |
lemma UNIV_witness [intro?]: "EX x. x : UNIV" |
|
446 |
by simp |
|
447 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
448 |
lemma subset_UNIV: "A \<subseteq> UNIV" |
11979 | 449 |
by (rule subsetI) (rule UNIV_I) |
2388 | 450 |
|
11979 | 451 |
text {* |
452 |
\medskip Eta-contracting these two rules (to remove @{text P}) |
|
453 |
causes them to be ignored because of their interaction with |
|
454 |
congruence rules. |
|
455 |
*} |
|
456 |
||
457 |
lemma ball_UNIV [simp]: "Ball UNIV P = All P" |
|
458 |
by (simp add: Ball_def) |
|
459 |
||
460 |
lemma bex_UNIV [simp]: "Bex UNIV P = Ex P" |
|
461 |
by (simp add: Bex_def) |
|
462 |
||
463 |
||
464 |
subsubsection {* The empty set *} |
|
465 |
||
466 |
lemma empty_iff [simp]: "(c : {}) = False" |
|
467 |
by (simp add: empty_def) |
|
468 |
||
469 |
lemma emptyE [elim!]: "a : {} ==> P" |
|
470 |
by simp |
|
471 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
472 |
lemma empty_subsetI [iff]: "{} \<subseteq> A" |
11979 | 473 |
-- {* One effect is to delete the ASSUMPTION @{prop "{} <= A"} *} |
474 |
by blast |
|
475 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
476 |
lemma equals0I: "(!!y. y \<in> A ==> False) ==> A = {}" |
11979 | 477 |
by blast |
2388 | 478 |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
479 |
lemma equals0D: "A = {} ==> a \<notin> A" |
11979 | 480 |
-- {* Use for reasoning about disjointness: @{prop "A Int B = {}"} *} |
481 |
by blast |
|
482 |
||
483 |
lemma ball_empty [simp]: "Ball {} P = True" |
|
484 |
by (simp add: Ball_def) |
|
485 |
||
486 |
lemma bex_empty [simp]: "Bex {} P = False" |
|
487 |
by (simp add: Bex_def) |
|
488 |
||
489 |
lemma UNIV_not_empty [iff]: "UNIV ~= {}" |
|
490 |
by (blast elim: equalityE) |
|
491 |
||
492 |
||
12023 | 493 |
subsubsection {* The Powerset operator -- Pow *} |
11979 | 494 |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
495 |
lemma Pow_iff [iff]: "(A \<in> Pow B) = (A \<subseteq> B)" |
11979 | 496 |
by (simp add: Pow_def) |
497 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
498 |
lemma PowI: "A \<subseteq> B ==> A \<in> Pow B" |
11979 | 499 |
by (simp add: Pow_def) |
500 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
501 |
lemma PowD: "A \<in> Pow B ==> A \<subseteq> B" |
11979 | 502 |
by (simp add: Pow_def) |
503 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
504 |
lemma Pow_bottom: "{} \<in> Pow B" |
11979 | 505 |
by simp |
506 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
507 |
lemma Pow_top: "A \<in> Pow A" |
11979 | 508 |
by (simp add: subset_refl) |
2684 | 509 |
|
2388 | 510 |
|
11979 | 511 |
subsubsection {* Set complement *} |
512 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
513 |
lemma Compl_iff [simp]: "(c \<in> -A) = (c \<notin> A)" |
11979 | 514 |
by (unfold Compl_def) blast |
515 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
516 |
lemma ComplI [intro!]: "(c \<in> A ==> False) ==> c \<in> -A" |
11979 | 517 |
by (unfold Compl_def) blast |
518 |
||
519 |
text {* |
|
520 |
\medskip This form, with negated conclusion, works well with the |
|
521 |
Classical prover. Negated assumptions behave like formulae on the |
|
522 |
right side of the notional turnstile ... *} |
|
523 |
||
524 |
lemma ComplD: "c : -A ==> c~:A" |
|
525 |
by (unfold Compl_def) blast |
|
526 |
||
527 |
lemmas ComplE [elim!] = ComplD [elim_format] |
|
528 |
||
529 |
||
530 |
subsubsection {* Binary union -- Un *} |
|
923 | 531 |
|
11979 | 532 |
lemma Un_iff [simp]: "(c : A Un B) = (c:A | c:B)" |
533 |
by (unfold Un_def) blast |
|
534 |
||
535 |
lemma UnI1 [elim?]: "c:A ==> c : A Un B" |
|
536 |
by simp |
|
537 |
||
538 |
lemma UnI2 [elim?]: "c:B ==> c : A Un B" |
|
539 |
by simp |
|
923 | 540 |
|
11979 | 541 |
text {* |
542 |
\medskip Classical introduction rule: no commitment to @{prop A} vs |
|
543 |
@{prop B}. |
|
544 |
*} |
|
545 |
||
546 |
lemma UnCI [intro!]: "(c~:B ==> c:A) ==> c : A Un B" |
|
547 |
by auto |
|
548 |
||
549 |
lemma UnE [elim!]: "c : A Un B ==> (c:A ==> P) ==> (c:B ==> P) ==> P" |
|
550 |
by (unfold Un_def) blast |
|
551 |
||
552 |
||
12023 | 553 |
subsubsection {* Binary intersection -- Int *} |
923 | 554 |
|
11979 | 555 |
lemma Int_iff [simp]: "(c : A Int B) = (c:A & c:B)" |
556 |
by (unfold Int_def) blast |
|
557 |
||
558 |
lemma IntI [intro!]: "c:A ==> c:B ==> c : A Int B" |
|
559 |
by simp |
|
560 |
||
561 |
lemma IntD1: "c : A Int B ==> c:A" |
|
562 |
by simp |
|
563 |
||
564 |
lemma IntD2: "c : A Int B ==> c:B" |
|
565 |
by simp |
|
566 |
||
567 |
lemma IntE [elim!]: "c : A Int B ==> (c:A ==> c:B ==> P) ==> P" |
|
568 |
by simp |
|
569 |
||
570 |
||
12023 | 571 |
subsubsection {* Set difference *} |
11979 | 572 |
|
573 |
lemma Diff_iff [simp]: "(c : A - B) = (c:A & c~:B)" |
|
574 |
by (unfold set_diff_def) blast |
|
923 | 575 |
|
11979 | 576 |
lemma DiffI [intro!]: "c : A ==> c ~: B ==> c : A - B" |
577 |
by simp |
|
578 |
||
579 |
lemma DiffD1: "c : A - B ==> c : A" |
|
580 |
by simp |
|
581 |
||
582 |
lemma DiffD2: "c : A - B ==> c : B ==> P" |
|
583 |
by simp |
|
584 |
||
585 |
lemma DiffE [elim!]: "c : A - B ==> (c:A ==> c~:B ==> P) ==> P" |
|
586 |
by simp |
|
587 |
||
588 |
||
589 |
subsubsection {* Augmenting a set -- insert *} |
|
590 |
||
591 |
lemma insert_iff [simp]: "(a : insert b A) = (a = b | a:A)" |
|
592 |
by (unfold insert_def) blast |
|
593 |
||
594 |
lemma insertI1: "a : insert a B" |
|
595 |
by simp |
|
596 |
||
597 |
lemma insertI2: "a : B ==> a : insert b B" |
|
598 |
by simp |
|
923 | 599 |
|
11979 | 600 |
lemma insertE [elim!]: "a : insert b A ==> (a = b ==> P) ==> (a:A ==> P) ==> P" |
601 |
by (unfold insert_def) blast |
|
602 |
||
603 |
lemma insertCI [intro!]: "(a~:B ==> a = b) ==> a: insert b B" |
|
604 |
-- {* Classical introduction rule. *} |
|
605 |
by auto |
|
606 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
607 |
lemma subset_insert_iff: "(A \<subseteq> insert x B) = (if x:A then A - {x} \<subseteq> B else A \<subseteq> B)" |
11979 | 608 |
by auto |
609 |
||
610 |
||
611 |
subsubsection {* Singletons, using insert *} |
|
612 |
||
613 |
lemma singletonI [intro!]: "a : {a}" |
|
614 |
-- {* Redundant? But unlike @{text insertCI}, it proves the subgoal immediately! *} |
|
615 |
by (rule insertI1) |
|
616 |
||
617 |
lemma singletonD: "b : {a} ==> b = a" |
|
618 |
by blast |
|
619 |
||
620 |
lemmas singletonE [elim!] = singletonD [elim_format] |
|
621 |
||
622 |
lemma singleton_iff: "(b : {a}) = (b = a)" |
|
623 |
by blast |
|
624 |
||
625 |
lemma singleton_inject [dest!]: "{a} = {b} ==> a = b" |
|
626 |
by blast |
|
627 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
628 |
lemma singleton_insert_inj_eq [iff]: "({b} = insert a A) = (a = b & A \<subseteq> {b})" |
11979 | 629 |
by blast |
630 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
631 |
lemma singleton_insert_inj_eq' [iff]: "(insert a A = {b}) = (a = b & A \<subseteq> {b})" |
11979 | 632 |
by blast |
633 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
634 |
lemma subset_singletonD: "A \<subseteq> {x} ==> A = {} | A = {x}" |
11979 | 635 |
by fast |
636 |
||
637 |
lemma singleton_conv [simp]: "{x. x = a} = {a}" |
|
638 |
by blast |
|
639 |
||
640 |
lemma singleton_conv2 [simp]: "{x. a = x} = {a}" |
|
641 |
by blast |
|
923 | 642 |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
643 |
lemma diff_single_insert: "A - {x} \<subseteq> B ==> x \<in> A ==> A \<subseteq> insert x B" |
11979 | 644 |
by blast |
645 |
||
646 |
||
647 |
subsubsection {* Unions of families *} |
|
648 |
||
649 |
text {* |
|
650 |
@{term [source] "UN x:A. B x"} is @{term "Union (B`A)"}. |
|
651 |
*} |
|
652 |
||
653 |
lemma UN_iff [simp]: "(b: (UN x:A. B x)) = (EX x:A. b: B x)" |
|
654 |
by (unfold UNION_def) blast |
|
655 |
||
656 |
lemma UN_I [intro]: "a:A ==> b: B a ==> b: (UN x:A. B x)" |
|
657 |
-- {* The order of the premises presupposes that @{term A} is rigid; |
|
658 |
@{term b} may be flexible. *} |
|
659 |
by auto |
|
660 |
||
661 |
lemma UN_E [elim!]: "b : (UN x:A. B x) ==> (!!x. x:A ==> b: B x ==> R) ==> R" |
|
662 |
by (unfold UNION_def) blast |
|
923 | 663 |
|
11979 | 664 |
lemma UN_cong [cong]: |
665 |
"A = B ==> (!!x. x:B ==> C x = D x) ==> (UN x:A. C x) = (UN x:B. D x)" |
|
666 |
by (simp add: UNION_def) |
|
667 |
||
668 |
||
669 |
subsubsection {* Intersections of families *} |
|
670 |
||
671 |
text {* @{term [source] "INT x:A. B x"} is @{term "Inter (B`A)"}. *} |
|
672 |
||
673 |
lemma INT_iff [simp]: "(b: (INT x:A. B x)) = (ALL x:A. b: B x)" |
|
674 |
by (unfold INTER_def) blast |
|
923 | 675 |
|
11979 | 676 |
lemma INT_I [intro!]: "(!!x. x:A ==> b: B x) ==> b : (INT x:A. B x)" |
677 |
by (unfold INTER_def) blast |
|
678 |
||
679 |
lemma INT_D [elim]: "b : (INT x:A. B x) ==> a:A ==> b: B a" |
|
680 |
by auto |
|
681 |
||
682 |
lemma INT_E [elim]: "b : (INT x:A. B x) ==> (b: B a ==> R) ==> (a~:A ==> R) ==> R" |
|
683 |
-- {* "Classical" elimination -- by the Excluded Middle on @{prop "a:A"}. *} |
|
684 |
by (unfold INTER_def) blast |
|
685 |
||
686 |
lemma INT_cong [cong]: |
|
687 |
"A = B ==> (!!x. x:B ==> C x = D x) ==> (INT x:A. C x) = (INT x:B. D x)" |
|
688 |
by (simp add: INTER_def) |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
5931
diff
changeset
|
689 |
|
923 | 690 |
|
11979 | 691 |
subsubsection {* Union *} |
692 |
||
693 |
lemma Union_iff [simp]: "(A : Union C) = (EX X:C. A:X)" |
|
694 |
by (unfold Union_def) blast |
|
695 |
||
696 |
lemma UnionI [intro]: "X:C ==> A:X ==> A : Union C" |
|
697 |
-- {* The order of the premises presupposes that @{term C} is rigid; |
|
698 |
@{term A} may be flexible. *} |
|
699 |
by auto |
|
700 |
||
701 |
lemma UnionE [elim!]: "A : Union C ==> (!!X. A:X ==> X:C ==> R) ==> R" |
|
702 |
by (unfold Union_def) blast |
|
703 |
||
704 |
||
705 |
subsubsection {* Inter *} |
|
706 |
||
707 |
lemma Inter_iff [simp]: "(A : Inter C) = (ALL X:C. A:X)" |
|
708 |
by (unfold Inter_def) blast |
|
709 |
||
710 |
lemma InterI [intro!]: "(!!X. X:C ==> A:X) ==> A : Inter C" |
|
711 |
by (simp add: Inter_def) |
|
712 |
||
713 |
text {* |
|
714 |
\medskip A ``destruct'' rule -- every @{term X} in @{term C} |
|
715 |
contains @{term A} as an element, but @{prop "A:X"} can hold when |
|
716 |
@{prop "X:C"} does not! This rule is analogous to @{text spec}. |
|
717 |
*} |
|
718 |
||
719 |
lemma InterD [elim]: "A : Inter C ==> X:C ==> A:X" |
|
720 |
by auto |
|
721 |
||
722 |
lemma InterE [elim]: "A : Inter C ==> (X~:C ==> R) ==> (A:X ==> R) ==> R" |
|
723 |
-- {* ``Classical'' elimination rule -- does not require proving |
|
724 |
@{prop "X:C"}. *} |
|
725 |
by (unfold Inter_def) blast |
|
726 |
||
727 |
text {* |
|
728 |
\medskip Image of a set under a function. Frequently @{term b} does |
|
729 |
not have the syntactic form of @{term "f x"}. |
|
730 |
*} |
|
731 |
||
732 |
lemma image_eqI [simp, intro]: "b = f x ==> x:A ==> b : f`A" |
|
733 |
by (unfold image_def) blast |
|
734 |
||
735 |
lemma imageI: "x : A ==> f x : f ` A" |
|
736 |
by (rule image_eqI) (rule refl) |
|
737 |
||
738 |
lemma rev_image_eqI: "x:A ==> b = f x ==> b : f`A" |
|
739 |
-- {* This version's more effective when we already have the |
|
740 |
required @{term x}. *} |
|
741 |
by (unfold image_def) blast |
|
742 |
||
743 |
lemma imageE [elim!]: |
|
744 |
"b : (%x. f x)`A ==> (!!x. b = f x ==> x:A ==> P) ==> P" |
|
745 |
-- {* The eta-expansion gives variable-name preservation. *} |
|
746 |
by (unfold image_def) blast |
|
747 |
||
748 |
lemma image_Un: "f`(A Un B) = f`A Un f`B" |
|
749 |
by blast |
|
750 |
||
751 |
lemma image_iff: "(z : f`A) = (EX x:A. z = f x)" |
|
752 |
by blast |
|
753 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
754 |
lemma image_subset_iff: "(f`A \<subseteq> B) = (\<forall>x\<in>A. f x \<in> B)" |
11979 | 755 |
-- {* This rewrite rule would confuse users if made default. *} |
756 |
by blast |
|
757 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
758 |
lemma subset_image_iff: "(B \<subseteq> f`A) = (EX AA. AA \<subseteq> A & B = f`AA)" |
11979 | 759 |
apply safe |
760 |
prefer 2 apply fast |
|
761 |
apply (rule_tac x = "{a. a : A & f a : B}" in exI) |
|
762 |
apply fast |
|
763 |
done |
|
764 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
765 |
lemma image_subsetI: "(!!x. x \<in> A ==> f x \<in> B) ==> f`A \<subseteq> B" |
11979 | 766 |
-- {* Replaces the three steps @{text subsetI}, @{text imageE}, |
767 |
@{text hypsubst}, but breaks too many existing proofs. *} |
|
768 |
by blast |
|
769 |
||
770 |
text {* |
|
771 |
\medskip Range of a function -- just a translation for image! |
|
772 |
*} |
|
773 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
774 |
lemma range_eqI: "b = f x ==> b \<in> range f" |
11979 | 775 |
by simp |
776 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
777 |
lemma rangeI: "f x \<in> range f" |
11979 | 778 |
by simp |
779 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
780 |
lemma rangeE [elim?]: "b \<in> range (\<lambda>x. f x) ==> (!!x. b = f x ==> P) ==> P" |
11979 | 781 |
by blast |
782 |
||
783 |
||
784 |
subsubsection {* Set reasoning tools *} |
|
785 |
||
786 |
text {* |
|
787 |
Rewrite rules for boolean case-splitting: faster than @{text |
|
788 |
"split_if [split]"}. |
|
789 |
*} |
|
790 |
||
791 |
lemma split_if_eq1: "((if Q then x else y) = b) = ((Q --> x = b) & (~ Q --> y = b))" |
|
792 |
by (rule split_if) |
|
793 |
||
794 |
lemma split_if_eq2: "(a = (if Q then x else y)) = ((Q --> a = x) & (~ Q --> a = y))" |
|
795 |
by (rule split_if) |
|
796 |
||
797 |
text {* |
|
798 |
Split ifs on either side of the membership relation. Not for @{text |
|
799 |
"[simp]"} -- can cause goals to blow up! |
|
800 |
*} |
|
801 |
||
802 |
lemma split_if_mem1: "((if Q then x else y) : b) = ((Q --> x : b) & (~ Q --> y : b))" |
|
803 |
by (rule split_if) |
|
804 |
||
805 |
lemma split_if_mem2: "(a : (if Q then x else y)) = ((Q --> a : x) & (~ Q --> a : y))" |
|
806 |
by (rule split_if) |
|
807 |
||
808 |
lemmas split_ifs = if_bool_eq_conj split_if_eq1 split_if_eq2 split_if_mem1 split_if_mem2 |
|
809 |
||
810 |
lemmas mem_simps = |
|
811 |
insert_iff empty_iff Un_iff Int_iff Compl_iff Diff_iff |
|
812 |
mem_Collect_eq UN_iff Union_iff INT_iff Inter_iff |
|
813 |
-- {* Each of these has ALREADY been added @{text "[simp]"} above. *} |
|
814 |
||
815 |
(*Would like to add these, but the existing code only searches for the |
|
816 |
outer-level constant, which in this case is just "op :"; we instead need |
|
817 |
to use term-nets to associate patterns with rules. Also, if a rule fails to |
|
818 |
apply, then the formula should be kept. |
|
819 |
[("uminus", Compl_iff RS iffD1), ("op -", [Diff_iff RS iffD1]), |
|
820 |
("op Int", [IntD1,IntD2]), |
|
821 |
("Collect", [CollectD]), ("Inter", [InterD]), ("INTER", [INT_D])] |
|
822 |
*) |
|
823 |
||
824 |
ML_setup {* |
|
825 |
val mksimps_pairs = [("Ball", [thm "bspec"])] @ mksimps_pairs; |
|
826 |
simpset_ref() := simpset() setmksimps (mksimps mksimps_pairs); |
|
827 |
*} |
|
828 |
||
829 |
declare subset_UNIV [simp] subset_refl [simp] |
|
830 |
||
831 |
||
832 |
subsubsection {* The ``proper subset'' relation *} |
|
833 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
834 |
lemma psubsetI [intro!]: "A \<subseteq> B ==> A \<noteq> B ==> A \<subset> B" |
11979 | 835 |
by (unfold psubset_def) blast |
836 |
||
13624 | 837 |
lemma psubsetE [elim!]: |
838 |
"[|A \<subset> B; [|A \<subseteq> B; ~ (B\<subseteq>A)|] ==> R|] ==> R" |
|
839 |
by (unfold psubset_def) blast |
|
840 |
||
11979 | 841 |
lemma psubset_insert_iff: |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
842 |
"(A \<subset> insert x B) = (if x \<in> B then A \<subset> B else if x \<in> A then A - {x} \<subset> B else A \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
843 |
by (auto simp add: psubset_def subset_insert_iff) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
844 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
845 |
lemma psubset_eq: "(A \<subset> B) = (A \<subseteq> B & A \<noteq> B)" |
11979 | 846 |
by (simp only: psubset_def) |
847 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
848 |
lemma psubset_imp_subset: "A \<subset> B ==> A \<subseteq> B" |
11979 | 849 |
by (simp add: psubset_eq) |
850 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
851 |
lemma psubset_subset_trans: "A \<subset> B ==> B \<subseteq> C ==> A \<subset> C" |
11979 | 852 |
by (auto simp add: psubset_eq) |
853 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
854 |
lemma subset_psubset_trans: "A \<subseteq> B ==> B \<subset> C ==> A \<subset> C" |
11979 | 855 |
by (auto simp add: psubset_eq) |
856 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
857 |
lemma psubset_imp_ex_mem: "A \<subset> B ==> \<exists>b. b \<in> (B - A)" |
11979 | 858 |
by (unfold psubset_def) blast |
859 |
||
860 |
lemma atomize_ball: |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
861 |
"(!!x. x \<in> A ==> P x) == Trueprop (\<forall>x\<in>A. P x)" |
11979 | 862 |
by (simp only: Ball_def atomize_all atomize_imp) |
863 |
||
864 |
declare atomize_ball [symmetric, rulify] |
|
865 |
||
866 |
||
867 |
subsection {* Further set-theory lemmas *} |
|
868 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
869 |
subsubsection {* Derived rules involving subsets. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
870 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
871 |
text {* @{text insert}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
872 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
873 |
lemma subset_insertI: "B \<subseteq> insert a B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
874 |
apply (rule subsetI) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
875 |
apply (erule insertI2) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
876 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
877 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
878 |
lemma subset_insert: "x \<notin> A ==> (A \<subseteq> insert x B) = (A \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
879 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
880 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
881 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
882 |
text {* \medskip Big Union -- least upper bound of a set. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
883 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
884 |
lemma Union_upper: "B \<in> A ==> B \<subseteq> Union A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
885 |
by (rules intro: subsetI UnionI) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
886 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
887 |
lemma Union_least: "(!!X. X \<in> A ==> X \<subseteq> C) ==> Union A \<subseteq> C" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
888 |
by (rules intro: subsetI elim: UnionE dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
889 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
890 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
891 |
text {* \medskip General union. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
892 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
893 |
lemma UN_upper: "a \<in> A ==> B a \<subseteq> (\<Union>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
894 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
895 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
896 |
lemma UN_least: "(!!x. x \<in> A ==> B x \<subseteq> C) ==> (\<Union>x\<in>A. B x) \<subseteq> C" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
897 |
by (rules intro: subsetI elim: UN_E dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
898 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
899 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
900 |
text {* \medskip Big Intersection -- greatest lower bound of a set. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
901 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
902 |
lemma Inter_lower: "B \<in> A ==> Inter A \<subseteq> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
903 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
904 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
905 |
lemma Inter_greatest: "(!!X. X \<in> A ==> C \<subseteq> X) ==> C \<subseteq> Inter A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
906 |
by (rules intro: InterI subsetI dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
907 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
908 |
lemma INT_lower: "a \<in> A ==> (\<Inter>x\<in>A. B x) \<subseteq> B a" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
909 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
910 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
911 |
lemma INT_greatest: "(!!x. x \<in> A ==> C \<subseteq> B x) ==> C \<subseteq> (\<Inter>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
912 |
by (rules intro: INT_I subsetI dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
913 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
914 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
915 |
text {* \medskip Finite Union -- the least upper bound of two sets. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
916 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
917 |
lemma Un_upper1: "A \<subseteq> A \<union> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
918 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
919 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
920 |
lemma Un_upper2: "B \<subseteq> A \<union> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
921 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
922 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
923 |
lemma Un_least: "A \<subseteq> C ==> B \<subseteq> C ==> A \<union> B \<subseteq> C" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
924 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
925 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
926 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
927 |
text {* \medskip Finite Intersection -- the greatest lower bound of two sets. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
928 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
929 |
lemma Int_lower1: "A \<inter> B \<subseteq> A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
930 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
931 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
932 |
lemma Int_lower2: "A \<inter> B \<subseteq> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
933 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
934 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
935 |
lemma Int_greatest: "C \<subseteq> A ==> C \<subseteq> B ==> C \<subseteq> A \<inter> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
936 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
937 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
938 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
939 |
text {* \medskip Set difference. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
940 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
941 |
lemma Diff_subset: "A - B \<subseteq> A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
942 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
943 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
944 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
945 |
text {* \medskip Monotonicity. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
946 |
|
13421 | 947 |
lemma mono_Un: includes mono shows "f A \<union> f B \<subseteq> f (A \<union> B)" |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
948 |
apply (rule Un_least) |
13421 | 949 |
apply (rule Un_upper1 [THEN mono]) |
950 |
apply (rule Un_upper2 [THEN mono]) |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
951 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
952 |
|
13421 | 953 |
lemma mono_Int: includes mono shows "f (A \<inter> B) \<subseteq> f A \<inter> f B" |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
954 |
apply (rule Int_greatest) |
13421 | 955 |
apply (rule Int_lower1 [THEN mono]) |
956 |
apply (rule Int_lower2 [THEN mono]) |
|
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
957 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
958 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
959 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
960 |
subsubsection {* Equalities involving union, intersection, inclusion, etc. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
961 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
962 |
text {* @{text "{}"}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
963 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
964 |
lemma Collect_const [simp]: "{s. P} = (if P then UNIV else {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
965 |
-- {* supersedes @{text "Collect_False_empty"} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
966 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
967 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
968 |
lemma subset_empty [simp]: "(A \<subseteq> {}) = (A = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
969 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
970 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
971 |
lemma not_psubset_empty [iff]: "\<not> (A < {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
972 |
by (unfold psubset_def) blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
973 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
974 |
lemma Collect_empty_eq [simp]: "(Collect P = {}) = (\<forall>x. \<not> P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
975 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
976 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
977 |
lemma Collect_neg_eq: "{x. \<not> P x} = - {x. P x}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
978 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
979 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
980 |
lemma Collect_disj_eq: "{x. P x | Q x} = {x. P x} \<union> {x. Q x}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
981 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
982 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
983 |
lemma Collect_conj_eq: "{x. P x & Q x} = {x. P x} \<inter> {x. Q x}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
984 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
985 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
986 |
lemma Collect_all_eq: "{x. \<forall>y. P x y} = (\<Inter>y. {x. P x y})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
987 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
988 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
989 |
lemma Collect_ball_eq: "{x. \<forall>y\<in>A. P x y} = (\<Inter>y\<in>A. {x. P x y})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
990 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
991 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
992 |
lemma Collect_ex_eq: "{x. \<exists>y. P x y} = (\<Union>y. {x. P x y})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
993 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
994 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
995 |
lemma Collect_bex_eq: "{x. \<exists>y\<in>A. P x y} = (\<Union>y\<in>A. {x. P x y})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
996 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
997 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
998 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
999 |
text {* \medskip @{text insert}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1000 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1001 |
lemma insert_is_Un: "insert a A = {a} Un A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1002 |
-- {* NOT SUITABLE FOR REWRITING since @{text "{a} == insert a {}"} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1003 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1004 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1005 |
lemma insert_not_empty [simp]: "insert a A \<noteq> {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1006 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1007 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1008 |
lemmas empty_not_insert [simp] = insert_not_empty [symmetric, standard] |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1009 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1010 |
lemma insert_absorb: "a \<in> A ==> insert a A = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1011 |
-- {* @{text "[simp]"} causes recursive calls when there are nested inserts *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1012 |
-- {* with \emph{quadratic} running time *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1013 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1014 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1015 |
lemma insert_absorb2 [simp]: "insert x (insert x A) = insert x A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1016 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1017 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1018 |
lemma insert_commute: "insert x (insert y A) = insert y (insert x A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1019 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1020 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1021 |
lemma insert_subset [simp]: "(insert x A \<subseteq> B) = (x \<in> B & A \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1022 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1023 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1024 |
lemma mk_disjoint_insert: "a \<in> A ==> \<exists>B. A = insert a B & a \<notin> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1025 |
-- {* use new @{text B} rather than @{text "A - {a}"} to avoid infinite unfolding *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1026 |
apply (rule_tac x = "A - {a}" in exI) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1027 |
apply blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1028 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1029 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1030 |
lemma insert_Collect: "insert a (Collect P) = {u. u \<noteq> a --> P u}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1031 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1032 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1033 |
lemma UN_insert_distrib: "u \<in> A ==> (\<Union>x\<in>A. insert a (B x)) = insert a (\<Union>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1034 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1035 |
|
13103
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1036 |
lemma insert_disjoint[simp]: |
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1037 |
"(insert a A \<inter> B = {}) = (a \<notin> B \<and> A \<inter> B = {})" |
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1038 |
by blast |
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1039 |
|
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1040 |
lemma disjoint_insert[simp]: |
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1041 |
"(B \<inter> insert a A = {}) = (a \<notin> B \<and> B \<inter> A = {})" |
66659a4b16f6
Added insert_disjoint and disjoint_insert [simp], and simplified proofs
nipkow
parents:
12937
diff
changeset
|
1042 |
by blast |
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1043 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1044 |
text {* \medskip @{text image}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1045 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1046 |
lemma image_empty [simp]: "f`{} = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1047 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1048 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1049 |
lemma image_insert [simp]: "f ` insert a B = insert (f a) (f`B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1050 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1051 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1052 |
lemma image_constant: "x \<in> A ==> (\<lambda>x. c) ` A = {c}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1053 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1054 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1055 |
lemma image_image: "f ` (g ` A) = (\<lambda>x. f (g x)) ` A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1056 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1057 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1058 |
lemma insert_image [simp]: "x \<in> A ==> insert (f x) (f`A) = f`A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1059 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1060 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1061 |
lemma image_is_empty [iff]: "(f`A = {}) = (A = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1062 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1063 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1064 |
lemma image_Collect: "f ` {x. P x} = {f x | x. P x}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1065 |
-- {* NOT suitable as a default simprule: the RHS isn't simpler than the LHS, *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1066 |
-- {* with its implicit quantifier and conjunction. Also image enjoys better *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1067 |
-- {* equational properties than does the RHS. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1068 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1069 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1070 |
lemma if_image_distrib [simp]: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1071 |
"(\<lambda>x. if P x then f x else g x) ` S |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1072 |
= (f ` (S \<inter> {x. P x})) \<union> (g ` (S \<inter> {x. \<not> P x}))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1073 |
by (auto simp add: image_def) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1074 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1075 |
lemma image_cong: "M = N ==> (!!x. x \<in> N ==> f x = g x) ==> f`M = g`N" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1076 |
by (simp add: image_def) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1077 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1078 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1079 |
text {* \medskip @{text range}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1080 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1081 |
lemma full_SetCompr_eq: "{u. \<exists>x. u = f x} = range f" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1082 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1083 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1084 |
lemma range_composition [simp]: "range (\<lambda>x. f (g x)) = f`range g" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1085 |
apply (subst image_image) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1086 |
apply simp |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1087 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1088 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1089 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1090 |
text {* \medskip @{text Int} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1091 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1092 |
lemma Int_absorb [simp]: "A \<inter> A = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1093 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1094 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1095 |
lemma Int_left_absorb: "A \<inter> (A \<inter> B) = A \<inter> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1096 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1097 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1098 |
lemma Int_commute: "A \<inter> B = B \<inter> A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1099 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1100 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1101 |
lemma Int_left_commute: "A \<inter> (B \<inter> C) = B \<inter> (A \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1102 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1103 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1104 |
lemma Int_assoc: "(A \<inter> B) \<inter> C = A \<inter> (B \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1105 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1106 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1107 |
lemmas Int_ac = Int_assoc Int_left_absorb Int_commute Int_left_commute |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1108 |
-- {* Intersection is an AC-operator *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1109 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1110 |
lemma Int_absorb1: "B \<subseteq> A ==> A \<inter> B = B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1111 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1112 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1113 |
lemma Int_absorb2: "A \<subseteq> B ==> A \<inter> B = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1114 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1115 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1116 |
lemma Int_empty_left [simp]: "{} \<inter> B = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1117 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1118 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1119 |
lemma Int_empty_right [simp]: "A \<inter> {} = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1120 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1121 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1122 |
lemma disjoint_eq_subset_Compl: "(A \<inter> B = {}) = (A \<subseteq> -B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1123 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1124 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1125 |
lemma disjoint_iff_not_equal: "(A \<inter> B = {}) = (\<forall>x\<in>A. \<forall>y\<in>B. x \<noteq> y)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1126 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1127 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1128 |
lemma Int_UNIV_left [simp]: "UNIV \<inter> B = B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1129 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1130 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1131 |
lemma Int_UNIV_right [simp]: "A \<inter> UNIV = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1132 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1133 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1134 |
lemma Int_eq_Inter: "A \<inter> B = \<Inter>{A, B}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1135 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1136 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1137 |
lemma Int_Un_distrib: "A \<inter> (B \<union> C) = (A \<inter> B) \<union> (A \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1138 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1139 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1140 |
lemma Int_Un_distrib2: "(B \<union> C) \<inter> A = (B \<inter> A) \<union> (C \<inter> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1141 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1142 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1143 |
lemma Int_UNIV [simp]: "(A \<inter> B = UNIV) = (A = UNIV & B = UNIV)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1144 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1145 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1146 |
lemma Int_subset_iff: "(C \<subseteq> A \<inter> B) = (C \<subseteq> A & C \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1147 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1148 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1149 |
lemma Int_Collect: "(x \<in> A \<inter> {x. P x}) = (x \<in> A & P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1150 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1151 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1152 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1153 |
text {* \medskip @{text Un}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1154 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1155 |
lemma Un_absorb [simp]: "A \<union> A = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1156 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1157 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1158 |
lemma Un_left_absorb: "A \<union> (A \<union> B) = A \<union> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1159 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1160 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1161 |
lemma Un_commute: "A \<union> B = B \<union> A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1162 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1163 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1164 |
lemma Un_left_commute: "A \<union> (B \<union> C) = B \<union> (A \<union> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1165 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1166 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1167 |
lemma Un_assoc: "(A \<union> B) \<union> C = A \<union> (B \<union> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1168 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1169 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1170 |
lemmas Un_ac = Un_assoc Un_left_absorb Un_commute Un_left_commute |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1171 |
-- {* Union is an AC-operator *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1172 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1173 |
lemma Un_absorb1: "A \<subseteq> B ==> A \<union> B = B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1174 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1175 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1176 |
lemma Un_absorb2: "B \<subseteq> A ==> A \<union> B = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1177 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1178 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1179 |
lemma Un_empty_left [simp]: "{} \<union> B = B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1180 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1181 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1182 |
lemma Un_empty_right [simp]: "A \<union> {} = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1183 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1184 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1185 |
lemma Un_UNIV_left [simp]: "UNIV \<union> B = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1186 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1187 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1188 |
lemma Un_UNIV_right [simp]: "A \<union> UNIV = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1189 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1190 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1191 |
lemma Un_eq_Union: "A \<union> B = \<Union>{A, B}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1192 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1193 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1194 |
lemma Un_insert_left [simp]: "(insert a B) \<union> C = insert a (B \<union> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1195 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1196 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1197 |
lemma Un_insert_right [simp]: "A \<union> (insert a B) = insert a (A \<union> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1198 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1199 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1200 |
lemma Int_insert_left: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1201 |
"(insert a B) Int C = (if a \<in> C then insert a (B \<inter> C) else B \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1202 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1203 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1204 |
lemma Int_insert_right: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1205 |
"A \<inter> (insert a B) = (if a \<in> A then insert a (A \<inter> B) else A \<inter> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1206 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1207 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1208 |
lemma Un_Int_distrib: "A \<union> (B \<inter> C) = (A \<union> B) \<inter> (A \<union> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1209 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1210 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1211 |
lemma Un_Int_distrib2: "(B \<inter> C) \<union> A = (B \<union> A) \<inter> (C \<union> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1212 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1213 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1214 |
lemma Un_Int_crazy: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1215 |
"(A \<inter> B) \<union> (B \<inter> C) \<union> (C \<inter> A) = (A \<union> B) \<inter> (B \<union> C) \<inter> (C \<union> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1216 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1217 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1218 |
lemma subset_Un_eq: "(A \<subseteq> B) = (A \<union> B = B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1219 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1220 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1221 |
lemma Un_empty [iff]: "(A \<union> B = {}) = (A = {} & B = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1222 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1223 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1224 |
lemma Un_subset_iff: "(A \<union> B \<subseteq> C) = (A \<subseteq> C & B \<subseteq> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1225 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1226 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1227 |
lemma Un_Diff_Int: "(A - B) \<union> (A \<inter> B) = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1228 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1229 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1230 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1231 |
text {* \medskip Set complement *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1232 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1233 |
lemma Compl_disjoint [simp]: "A \<inter> -A = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1234 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1235 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1236 |
lemma Compl_disjoint2 [simp]: "-A \<inter> A = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1237 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1238 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1239 |
lemma Compl_partition: "A \<union> (-A) = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1240 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1241 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1242 |
lemma double_complement [simp]: "- (-A) = (A::'a set)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1243 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1244 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1245 |
lemma Compl_Un [simp]: "-(A \<union> B) = (-A) \<inter> (-B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1246 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1247 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1248 |
lemma Compl_Int [simp]: "-(A \<inter> B) = (-A) \<union> (-B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1249 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1250 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1251 |
lemma Compl_UN [simp]: "-(\<Union>x\<in>A. B x) = (\<Inter>x\<in>A. -B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1252 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1253 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1254 |
lemma Compl_INT [simp]: "-(\<Inter>x\<in>A. B x) = (\<Union>x\<in>A. -B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1255 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1256 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1257 |
lemma subset_Compl_self_eq: "(A \<subseteq> -A) = (A = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1258 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1259 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1260 |
lemma Un_Int_assoc_eq: "((A \<inter> B) \<union> C = A \<inter> (B \<union> C)) = (C \<subseteq> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1261 |
-- {* Halmos, Naive Set Theory, page 16. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1262 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1263 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1264 |
lemma Compl_UNIV_eq [simp]: "-UNIV = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1265 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1266 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1267 |
lemma Compl_empty_eq [simp]: "-{} = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1268 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1269 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1270 |
lemma Compl_subset_Compl_iff [iff]: "(-A \<subseteq> -B) = (B \<subseteq> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1271 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1272 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1273 |
lemma Compl_eq_Compl_iff [iff]: "(-A = -B) = (A = (B::'a set))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1274 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1275 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1276 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1277 |
text {* \medskip @{text Union}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1278 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1279 |
lemma Union_empty [simp]: "Union({}) = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1280 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1281 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1282 |
lemma Union_UNIV [simp]: "Union UNIV = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1283 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1284 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1285 |
lemma Union_insert [simp]: "Union (insert a B) = a \<union> \<Union>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1286 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1287 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1288 |
lemma Union_Un_distrib [simp]: "\<Union>(A Un B) = \<Union>A \<union> \<Union>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1289 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1290 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1291 |
lemma Union_Int_subset: "\<Union>(A \<inter> B) \<subseteq> \<Union>A \<inter> \<Union>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1292 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1293 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1294 |
lemma Union_empty_conv [iff]: "(\<Union>A = {}) = (\<forall>x\<in>A. x = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1295 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1296 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1297 |
lemma Union_disjoint: "(\<Union>C \<inter> A = {}) = (\<forall>B\<in>C. B \<inter> A = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1298 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1299 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1300 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1301 |
text {* \medskip @{text Inter}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1302 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1303 |
lemma Inter_empty [simp]: "\<Inter>{} = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1304 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1305 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1306 |
lemma Inter_UNIV [simp]: "\<Inter>UNIV = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1307 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1308 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1309 |
lemma Inter_insert [simp]: "\<Inter>(insert a B) = a \<inter> \<Inter>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1310 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1311 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1312 |
lemma Inter_Un_subset: "\<Inter>A \<union> \<Inter>B \<subseteq> \<Inter>(A \<inter> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1313 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1314 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1315 |
lemma Inter_Un_distrib: "\<Inter>(A \<union> B) = \<Inter>A \<inter> \<Inter>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1316 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1317 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1318 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1319 |
text {* |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1320 |
\medskip @{text UN} and @{text INT}. |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1321 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1322 |
Basic identities: *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1323 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1324 |
lemma UN_empty [simp]: "(\<Union>x\<in>{}. B x) = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1325 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1326 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1327 |
lemma UN_empty2 [simp]: "(\<Union>x\<in>A. {}) = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1328 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1329 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1330 |
lemma UN_singleton [simp]: "(\<Union>x\<in>A. {x}) = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1331 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1332 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1333 |
lemma UN_absorb: "k \<in> I ==> A k \<union> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. A i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1334 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1335 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1336 |
lemma INT_empty [simp]: "(\<Inter>x\<in>{}. B x) = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1337 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1338 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1339 |
lemma INT_absorb: "k \<in> I ==> A k \<inter> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. A i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1340 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1341 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1342 |
lemma UN_insert [simp]: "(\<Union>x\<in>insert a A. B x) = B a \<union> UNION A B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1343 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1344 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1345 |
lemma UN_Un: "(\<Union>i \<in> A \<union> B. M i) = (\<Union>i\<in>A. M i) \<union> (\<Union>i\<in>B. M i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1346 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1347 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1348 |
lemma UN_UN_flatten: "(\<Union>x \<in> (\<Union>y\<in>A. B y). C x) = (\<Union>y\<in>A. \<Union>x\<in>B y. C x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1349 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1350 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1351 |
lemma UN_subset_iff: "((\<Union>i\<in>I. A i) \<subseteq> B) = (\<forall>i\<in>I. A i \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1352 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1353 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1354 |
lemma INT_subset_iff: "(B \<subseteq> (\<Inter>i\<in>I. A i)) = (\<forall>i\<in>I. B \<subseteq> A i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1355 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1356 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1357 |
lemma INT_insert [simp]: "(\<Inter>x \<in> insert a A. B x) = B a \<inter> INTER A B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1358 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1359 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1360 |
lemma INT_Un: "(\<Inter>i \<in> A \<union> B. M i) = (\<Inter>i \<in> A. M i) \<inter> (\<Inter>i\<in>B. M i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1361 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1362 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1363 |
lemma INT_insert_distrib: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1364 |
"u \<in> A ==> (\<Inter>x\<in>A. insert a (B x)) = insert a (\<Inter>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1365 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1366 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1367 |
lemma Union_image_eq [simp]: "\<Union>(B`A) = (\<Union>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1368 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1369 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1370 |
lemma image_Union: "f ` \<Union>S = (\<Union>x\<in>S. f ` x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1371 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1372 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1373 |
lemma Inter_image_eq [simp]: "\<Inter>(B`A) = (\<Inter>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1374 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1375 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1376 |
lemma UN_constant [simp]: "(\<Union>y\<in>A. c) = (if A = {} then {} else c)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1377 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1378 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1379 |
lemma INT_constant [simp]: "(\<Inter>y\<in>A. c) = (if A = {} then UNIV else c)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1380 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1381 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1382 |
lemma UN_eq: "(\<Union>x\<in>A. B x) = \<Union>({Y. \<exists>x\<in>A. Y = B x})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1383 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1384 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1385 |
lemma INT_eq: "(\<Inter>x\<in>A. B x) = \<Inter>({Y. \<exists>x\<in>A. Y = B x})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1386 |
-- {* Look: it has an \emph{existential} quantifier *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1387 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1388 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1389 |
lemma UN_empty3 [iff]: "(UNION A B = {}) = (\<forall>x\<in>A. B x = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1390 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1391 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1392 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1393 |
text {* \medskip Distributive laws: *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1394 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1395 |
lemma Int_Union: "A \<inter> \<Union>B = (\<Union>C\<in>B. A \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1396 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1397 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1398 |
lemma Int_Union2: "\<Union>B \<inter> A = (\<Union>C\<in>B. C \<inter> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1399 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1400 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1401 |
lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A`C) \<union> \<Union>(B`C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1402 |
-- {* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1403 |
-- {* Union of a family of unions *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1404 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1405 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1406 |
lemma UN_Un_distrib: "(\<Union>i\<in>I. A i \<union> B i) = (\<Union>i\<in>I. A i) \<union> (\<Union>i\<in>I. B i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1407 |
-- {* Equivalent version *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1408 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1409 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1410 |
lemma Un_Inter: "A \<union> \<Inter>B = (\<Inter>C\<in>B. A \<union> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1411 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1412 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1413 |
lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A`C) \<inter> \<Inter>(B`C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1414 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1415 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1416 |
lemma INT_Int_distrib: "(\<Inter>i\<in>I. A i \<inter> B i) = (\<Inter>i\<in>I. A i) \<inter> (\<Inter>i\<in>I. B i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1417 |
-- {* Equivalent version *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1418 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1419 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1420 |
lemma Int_UN_distrib: "B \<inter> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. B \<inter> A i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1421 |
-- {* Halmos, Naive Set Theory, page 35. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1422 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1423 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1424 |
lemma Un_INT_distrib: "B \<union> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. B \<union> A i)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1425 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1426 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1427 |
lemma Int_UN_distrib2: "(\<Union>i\<in>I. A i) \<inter> (\<Union>j\<in>J. B j) = (\<Union>i\<in>I. \<Union>j\<in>J. A i \<inter> B j)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1428 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1429 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1430 |
lemma Un_INT_distrib2: "(\<Inter>i\<in>I. A i) \<union> (\<Inter>j\<in>J. B j) = (\<Inter>i\<in>I. \<Inter>j\<in>J. A i \<union> B j)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1431 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1432 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1433 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1434 |
text {* \medskip Bounded quantifiers. |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1435 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1436 |
The following are not added to the default simpset because |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1437 |
(a) they duplicate the body and (b) there are no similar rules for @{text Int}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1438 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1439 |
lemma ball_Un: "(\<forall>x \<in> A \<union> B. P x) = ((\<forall>x\<in>A. P x) & (\<forall>x\<in>B. P x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1440 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1441 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1442 |
lemma bex_Un: "(\<exists>x \<in> A \<union> B. P x) = ((\<exists>x\<in>A. P x) | (\<exists>x\<in>B. P x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1443 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1444 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1445 |
lemma ball_UN: "(\<forall>z \<in> UNION A B. P z) = (\<forall>x\<in>A. \<forall>z \<in> B x. P z)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1446 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1447 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1448 |
lemma bex_UN: "(\<exists>z \<in> UNION A B. P z) = (\<exists>x\<in>A. \<exists>z\<in>B x. P z)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1449 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1450 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1451 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1452 |
text {* \medskip Set difference. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1453 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1454 |
lemma Diff_eq: "A - B = A \<inter> (-B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1455 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1456 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1457 |
lemma Diff_eq_empty_iff [simp]: "(A - B = {}) = (A \<subseteq> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1458 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1459 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1460 |
lemma Diff_cancel [simp]: "A - A = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1461 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1462 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1463 |
lemma Diff_triv: "A \<inter> B = {} ==> A - B = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1464 |
by (blast elim: equalityE) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1465 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1466 |
lemma empty_Diff [simp]: "{} - A = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1467 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1468 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1469 |
lemma Diff_empty [simp]: "A - {} = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1470 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1471 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1472 |
lemma Diff_UNIV [simp]: "A - UNIV = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1473 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1474 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1475 |
lemma Diff_insert0 [simp]: "x \<notin> A ==> A - insert x B = A - B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1476 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1477 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1478 |
lemma Diff_insert: "A - insert a B = A - B - {a}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1479 |
-- {* NOT SUITABLE FOR REWRITING since @{text "{a} == insert a 0"} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1480 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1481 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1482 |
lemma Diff_insert2: "A - insert a B = A - {a} - B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1483 |
-- {* NOT SUITABLE FOR REWRITING since @{text "{a} == insert a 0"} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1484 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1485 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1486 |
lemma insert_Diff_if: "insert x A - B = (if x \<in> B then A - B else insert x (A - B))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1487 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1488 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1489 |
lemma insert_Diff1 [simp]: "x \<in> B ==> insert x A - B = A - B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1490 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1491 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1492 |
lemma insert_Diff: "a \<in> A ==> insert a (A - {a}) = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1493 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1494 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1495 |
lemma Diff_insert_absorb: "x \<notin> A ==> (insert x A) - {x} = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1496 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1497 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1498 |
lemma Diff_disjoint [simp]: "A \<inter> (B - A) = {}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1499 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1500 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1501 |
lemma Diff_partition: "A \<subseteq> B ==> A \<union> (B - A) = B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1502 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1503 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1504 |
lemma double_diff: "A \<subseteq> B ==> B \<subseteq> C ==> B - (C - A) = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1505 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1506 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1507 |
lemma Un_Diff_cancel [simp]: "A \<union> (B - A) = A \<union> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1508 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1509 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1510 |
lemma Un_Diff_cancel2 [simp]: "(B - A) \<union> A = B \<union> A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1511 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1512 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1513 |
lemma Diff_Un: "A - (B \<union> C) = (A - B) \<inter> (A - C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1514 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1515 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1516 |
lemma Diff_Int: "A - (B \<inter> C) = (A - B) \<union> (A - C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1517 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1518 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1519 |
lemma Un_Diff: "(A \<union> B) - C = (A - C) \<union> (B - C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1520 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1521 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1522 |
lemma Int_Diff: "(A \<inter> B) - C = A \<inter> (B - C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1523 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1524 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1525 |
lemma Diff_Int_distrib: "C \<inter> (A - B) = (C \<inter> A) - (C \<inter> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1526 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1527 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1528 |
lemma Diff_Int_distrib2: "(A - B) \<inter> C = (A \<inter> C) - (B \<inter> C)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1529 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1530 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1531 |
lemma Diff_Compl [simp]: "A - (- B) = A \<inter> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1532 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1533 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1534 |
lemma Compl_Diff_eq [simp]: "- (A - B) = -A \<union> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1535 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1536 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1537 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1538 |
text {* \medskip Quantification over type @{typ bool}. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1539 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1540 |
lemma all_bool_eq: "(\<forall>b::bool. P b) = (P True & P False)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1541 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1542 |
apply (tactic {* case_tac "b" 1 *}) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1543 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1544 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1545 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1546 |
lemma bool_induct: "P True \<Longrightarrow> P False \<Longrightarrow> P x" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1547 |
by (rule conjI [THEN all_bool_eq [THEN iffD2], THEN spec]) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1548 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1549 |
lemma ex_bool_eq: "(\<exists>b::bool. P b) = (P True | P False)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1550 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1551 |
apply (tactic {* case_tac "b" 1 *}) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1552 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1553 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1554 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1555 |
lemma Un_eq_UN: "A \<union> B = (\<Union>b. if b then A else B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1556 |
by (auto simp add: split_if_mem2) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1557 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1558 |
lemma UN_bool_eq: "(\<Union>b::bool. A b) = (A True \<union> A False)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1559 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1560 |
apply (tactic {* case_tac "b" 1 *}) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1561 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1562 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1563 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1564 |
lemma INT_bool_eq: "(\<Inter>b::bool. A b) = (A True \<inter> A False)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1565 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1566 |
apply (tactic {* case_tac "b" 1 *}) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1567 |
apply auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1568 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1569 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1570 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1571 |
text {* \medskip @{text Pow} *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1572 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1573 |
lemma Pow_empty [simp]: "Pow {} = {{}}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1574 |
by (auto simp add: Pow_def) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1575 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1576 |
lemma Pow_insert: "Pow (insert a A) = Pow A \<union> (insert a ` Pow A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1577 |
by (blast intro: image_eqI [where ?x = "u - {a}", standard]) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1578 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1579 |
lemma Pow_Compl: "Pow (- A) = {-B | B. A \<in> Pow B}" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1580 |
by (blast intro: exI [where ?x = "- u", standard]) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1581 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1582 |
lemma Pow_UNIV [simp]: "Pow UNIV = UNIV" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1583 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1584 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1585 |
lemma Un_Pow_subset: "Pow A \<union> Pow B \<subseteq> Pow (A \<union> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1586 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1587 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1588 |
lemma UN_Pow_subset: "(\<Union>x\<in>A. Pow (B x)) \<subseteq> Pow (\<Union>x\<in>A. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1589 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1590 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1591 |
lemma subset_Pow_Union: "A \<subseteq> Pow (\<Union>A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1592 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1593 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1594 |
lemma Union_Pow_eq [simp]: "\<Union>(Pow A) = A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1595 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1596 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1597 |
lemma Pow_Int_eq [simp]: "Pow (A \<inter> B) = Pow A \<inter> Pow B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1598 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1599 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1600 |
lemma Pow_INT_eq: "Pow (\<Inter>x\<in>A. B x) = (\<Inter>x\<in>A. Pow (B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1601 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1602 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1603 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1604 |
text {* \medskip Miscellany. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1605 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1606 |
lemma set_eq_subset: "(A = B) = (A \<subseteq> B & B \<subseteq> A)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1607 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1608 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1609 |
lemma subset_iff: "(A \<subseteq> B) = (\<forall>t. t \<in> A --> t \<in> B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1610 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1611 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1612 |
lemma subset_iff_psubset_eq: "(A \<subseteq> B) = ((A \<subset> B) | (A = B))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1613 |
by (unfold psubset_def) blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1614 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1615 |
lemma all_not_in_conv [iff]: "(\<forall>x. x \<notin> A) = (A = {})" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1616 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1617 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1618 |
lemma distinct_lemma: "f x \<noteq> f y ==> x \<noteq> y" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1619 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1620 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1621 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1622 |
text {* \medskip Miniscoping: pushing in big Unions and Intersections. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1623 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1624 |
lemma UN_simps [simp]: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1625 |
"!!a B C. (UN x:C. insert a (B x)) = (if C={} then {} else insert a (UN x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1626 |
"!!A B C. (UN x:C. A x Un B) = ((if C={} then {} else (UN x:C. A x) Un B))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1627 |
"!!A B C. (UN x:C. A Un B x) = ((if C={} then {} else A Un (UN x:C. B x)))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1628 |
"!!A B C. (UN x:C. A x Int B) = ((UN x:C. A x) Int B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1629 |
"!!A B C. (UN x:C. A Int B x) = (A Int (UN x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1630 |
"!!A B C. (UN x:C. A x - B) = ((UN x:C. A x) - B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1631 |
"!!A B C. (UN x:C. A - B x) = (A - (INT x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1632 |
"!!A B. (UN x: Union A. B x) = (UN y:A. UN x:y. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1633 |
"!!A B C. (UN z: UNION A B. C z) = (UN x:A. UN z: B(x). C z)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1634 |
"!!A B f. (UN x:f`A. B x) = (UN a:A. B (f a))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1635 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1636 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1637 |
lemma INT_simps [simp]: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1638 |
"!!A B C. (INT x:C. A x Int B) = (if C={} then UNIV else (INT x:C. A x) Int B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1639 |
"!!A B C. (INT x:C. A Int B x) = (if C={} then UNIV else A Int (INT x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1640 |
"!!A B C. (INT x:C. A x - B) = (if C={} then UNIV else (INT x:C. A x) - B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1641 |
"!!A B C. (INT x:C. A - B x) = (if C={} then UNIV else A - (UN x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1642 |
"!!a B C. (INT x:C. insert a (B x)) = insert a (INT x:C. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1643 |
"!!A B C. (INT x:C. A x Un B) = ((INT x:C. A x) Un B)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1644 |
"!!A B C. (INT x:C. A Un B x) = (A Un (INT x:C. B x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1645 |
"!!A B. (INT x: Union A. B x) = (INT y:A. INT x:y. B x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1646 |
"!!A B C. (INT z: UNION A B. C z) = (INT x:A. INT z: B(x). C z)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1647 |
"!!A B f. (INT x:f`A. B x) = (INT a:A. B (f a))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1648 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1649 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1650 |
lemma ball_simps [simp]: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1651 |
"!!A P Q. (ALL x:A. P x | Q) = ((ALL x:A. P x) | Q)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1652 |
"!!A P Q. (ALL x:A. P | Q x) = (P | (ALL x:A. Q x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1653 |
"!!A P Q. (ALL x:A. P --> Q x) = (P --> (ALL x:A. Q x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1654 |
"!!A P Q. (ALL x:A. P x --> Q) = ((EX x:A. P x) --> Q)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1655 |
"!!P. (ALL x:{}. P x) = True" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1656 |
"!!P. (ALL x:UNIV. P x) = (ALL x. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1657 |
"!!a B P. (ALL x:insert a B. P x) = (P a & (ALL x:B. P x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1658 |
"!!A P. (ALL x:Union A. P x) = (ALL y:A. ALL x:y. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1659 |
"!!A B P. (ALL x: UNION A B. P x) = (ALL a:A. ALL x: B a. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1660 |
"!!P Q. (ALL x:Collect Q. P x) = (ALL x. Q x --> P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1661 |
"!!A P f. (ALL x:f`A. P x) = (ALL x:A. P (f x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1662 |
"!!A P. (~(ALL x:A. P x)) = (EX x:A. ~P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1663 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1664 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1665 |
lemma bex_simps [simp]: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1666 |
"!!A P Q. (EX x:A. P x & Q) = ((EX x:A. P x) & Q)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1667 |
"!!A P Q. (EX x:A. P & Q x) = (P & (EX x:A. Q x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1668 |
"!!P. (EX x:{}. P x) = False" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1669 |
"!!P. (EX x:UNIV. P x) = (EX x. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1670 |
"!!a B P. (EX x:insert a B. P x) = (P(a) | (EX x:B. P x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1671 |
"!!A P. (EX x:Union A. P x) = (EX y:A. EX x:y. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1672 |
"!!A B P. (EX x: UNION A B. P x) = (EX a:A. EX x:B a. P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1673 |
"!!P Q. (EX x:Collect Q. P x) = (EX x. Q x & P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1674 |
"!!A P f. (EX x:f`A. P x) = (EX x:A. P (f x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1675 |
"!!A P. (~(EX x:A. P x)) = (ALL x:A. ~P x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1676 |
by auto |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1677 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1678 |
lemma ball_conj_distrib: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1679 |
"(ALL x:A. P x & Q x) = ((ALL x:A. P x) & (ALL x:A. Q x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1680 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1681 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1682 |
lemma bex_disj_distrib: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1683 |
"(EX x:A. P x | Q x) = ((EX x:A. P x) | (EX x:A. Q x))" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1684 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1685 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1686 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1687 |
subsubsection {* Monotonicity of various operations *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1688 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1689 |
lemma image_mono: "A \<subseteq> B ==> f`A \<subseteq> f`B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1690 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1691 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1692 |
lemma Pow_mono: "A \<subseteq> B ==> Pow A \<subseteq> Pow B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1693 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1694 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1695 |
lemma Union_mono: "A \<subseteq> B ==> \<Union>A \<subseteq> \<Union>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1696 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1697 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1698 |
lemma Inter_anti_mono: "B \<subseteq> A ==> \<Inter>A \<subseteq> \<Inter>B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1699 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1700 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1701 |
lemma UN_mono: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1702 |
"A \<subseteq> B ==> (!!x. x \<in> A ==> f x \<subseteq> g x) ==> |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1703 |
(\<Union>x\<in>A. f x) \<subseteq> (\<Union>x\<in>B. g x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1704 |
by (blast dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1705 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1706 |
lemma INT_anti_mono: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1707 |
"B \<subseteq> A ==> (!!x. x \<in> A ==> f x \<subseteq> g x) ==> |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1708 |
(\<Inter>x\<in>A. f x) \<subseteq> (\<Inter>x\<in>A. g x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1709 |
-- {* The last inclusion is POSITIVE! *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1710 |
by (blast dest: subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1711 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1712 |
lemma insert_mono: "C \<subseteq> D ==> insert a C \<subseteq> insert a D" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1713 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1714 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1715 |
lemma Un_mono: "A \<subseteq> C ==> B \<subseteq> D ==> A \<union> B \<subseteq> C \<union> D" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1716 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1717 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1718 |
lemma Int_mono: "A \<subseteq> C ==> B \<subseteq> D ==> A \<inter> B \<subseteq> C \<inter> D" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1719 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1720 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1721 |
lemma Diff_mono: "A \<subseteq> C ==> D \<subseteq> B ==> A - B \<subseteq> C - D" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1722 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1723 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1724 |
lemma Compl_anti_mono: "A \<subseteq> B ==> -B \<subseteq> -A" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1725 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1726 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1727 |
text {* \medskip Monotonicity of implications. *} |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1728 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1729 |
lemma in_mono: "A \<subseteq> B ==> x \<in> A --> x \<in> B" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1730 |
apply (rule impI) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1731 |
apply (erule subsetD) |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1732 |
apply assumption |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1733 |
done |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1734 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1735 |
lemma conj_mono: "P1 --> Q1 ==> P2 --> Q2 ==> (P1 & P2) --> (Q1 & Q2)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1736 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1737 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1738 |
lemma disj_mono: "P1 --> Q1 ==> P2 --> Q2 ==> (P1 | P2) --> (Q1 | Q2)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1739 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1740 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1741 |
lemma imp_mono: "Q1 --> P1 ==> P2 --> Q2 ==> (P1 --> P2) --> (Q1 --> Q2)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1742 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1743 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1744 |
lemma imp_refl: "P --> P" .. |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1745 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1746 |
lemma ex_mono: "(!!x. P x --> Q x) ==> (EX x. P x) --> (EX x. Q x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1747 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1748 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1749 |
lemma all_mono: "(!!x. P x --> Q x) ==> (ALL x. P x) --> (ALL x. Q x)" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1750 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1751 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1752 |
lemma Collect_mono: "(!!x. P x --> Q x) ==> Collect P \<subseteq> Collect Q" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1753 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1754 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1755 |
lemma Int_Collect_mono: |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1756 |
"A \<subseteq> B ==> (!!x. x \<in> A ==> P x --> Q x) ==> A \<inter> Collect P \<subseteq> B \<inter> Collect Q" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1757 |
by blast |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1758 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1759 |
lemmas basic_monos = |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1760 |
subset_refl imp_refl disj_mono conj_mono |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1761 |
ex_mono Collect_mono in_mono |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1762 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1763 |
lemma eq_to_mono: "a = b ==> c = d ==> b --> d ==> a --> c" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1764 |
by rules |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1765 |
|
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1766 |
lemma eq_to_mono2: "a = b ==> c = d ==> ~ b --> ~ d ==> ~ a --> ~ c" |
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1767 |
by rules |
11979 | 1768 |
|
11982
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1769 |
lemma Least_mono: |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1770 |
"mono (f::'a::order => 'b::order) ==> EX x:S. ALL y:S. x <= y |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1771 |
==> (LEAST y. y : f ` S) = f (LEAST x. x : S)" |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1772 |
-- {* Courtesy of Stephan Merz *} |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1773 |
apply clarify |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1774 |
apply (erule_tac P = "%x. x : S" in LeastI2) |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1775 |
apply fast |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1776 |
apply (rule LeastI2) |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1777 |
apply (auto elim: monoD intro!: order_antisym) |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1778 |
done |
65e2822d83dd
lemma Least_mono moved from Typedef.thy to Set.thy;
wenzelm
parents:
11979
diff
changeset
|
1779 |
|
12020 | 1780 |
|
12257 | 1781 |
subsection {* Inverse image of a function *} |
1782 |
||
1783 |
constdefs |
|
1784 |
vimage :: "('a => 'b) => 'b set => 'a set" (infixr "-`" 90) |
|
1785 |
"f -` B == {x. f x : B}" |
|
1786 |
||
1787 |
||
1788 |
subsubsection {* Basic rules *} |
|
1789 |
||
1790 |
lemma vimage_eq [simp]: "(a : f -` B) = (f a : B)" |
|
1791 |
by (unfold vimage_def) blast |
|
1792 |
||
1793 |
lemma vimage_singleton_eq: "(a : f -` {b}) = (f a = b)" |
|
1794 |
by simp |
|
1795 |
||
1796 |
lemma vimageI [intro]: "f a = b ==> b:B ==> a : f -` B" |
|
1797 |
by (unfold vimage_def) blast |
|
1798 |
||
1799 |
lemma vimageI2: "f a : A ==> a : f -` A" |
|
1800 |
by (unfold vimage_def) fast |
|
1801 |
||
1802 |
lemma vimageE [elim!]: "a: f -` B ==> (!!x. f a = x ==> x:B ==> P) ==> P" |
|
1803 |
by (unfold vimage_def) blast |
|
1804 |
||
1805 |
lemma vimageD: "a : f -` A ==> f a : A" |
|
1806 |
by (unfold vimage_def) fast |
|
1807 |
||
1808 |
||
1809 |
subsubsection {* Equations *} |
|
1810 |
||
1811 |
lemma vimage_empty [simp]: "f -` {} = {}" |
|
1812 |
by blast |
|
1813 |
||
1814 |
lemma vimage_Compl: "f -` (-A) = -(f -` A)" |
|
1815 |
by blast |
|
1816 |
||
1817 |
lemma vimage_Un [simp]: "f -` (A Un B) = (f -` A) Un (f -` B)" |
|
1818 |
by blast |
|
1819 |
||
1820 |
lemma vimage_Int [simp]: "f -` (A Int B) = (f -` A) Int (f -` B)" |
|
1821 |
by fast |
|
1822 |
||
1823 |
lemma vimage_Union: "f -` (Union A) = (UN X:A. f -` X)" |
|
1824 |
by blast |
|
1825 |
||
1826 |
lemma vimage_UN: "f-`(UN x:A. B x) = (UN x:A. f -` B x)" |
|
1827 |
by blast |
|
1828 |
||
1829 |
lemma vimage_INT: "f-`(INT x:A. B x) = (INT x:A. f -` B x)" |
|
1830 |
by blast |
|
1831 |
||
1832 |
lemma vimage_Collect_eq [simp]: "f -` Collect P = {y. P (f y)}" |
|
1833 |
by blast |
|
1834 |
||
1835 |
lemma vimage_Collect: "(!!x. P (f x) = Q x) ==> f -` (Collect P) = Collect Q" |
|
1836 |
by blast |
|
1837 |
||
1838 |
lemma vimage_insert: "f-`(insert a B) = (f-`{a}) Un (f-`B)" |
|
1839 |
-- {* NOT suitable for rewriting because of the recurrence of @{term "{a}"}. *} |
|
1840 |
by blast |
|
1841 |
||
1842 |
lemma vimage_Diff: "f -` (A - B) = (f -` A) - (f -` B)" |
|
1843 |
by blast |
|
1844 |
||
1845 |
lemma vimage_UNIV [simp]: "f -` UNIV = UNIV" |
|
1846 |
by blast |
|
1847 |
||
1848 |
lemma vimage_eq_UN: "f-`B = (UN y: B. f-`{y})" |
|
1849 |
-- {* NOT suitable for rewriting *} |
|
1850 |
by blast |
|
1851 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1852 |
lemma vimage_mono: "A \<subseteq> B ==> f -` A \<subseteq> f -` B" |
12257 | 1853 |
-- {* monotonicity *} |
1854 |
by blast |
|
1855 |
||
1856 |
||
12023 | 1857 |
subsection {* Transitivity rules for calculational reasoning *} |
12020 | 1858 |
|
1859 |
lemma forw_subst: "a = b ==> P b ==> P a" |
|
1860 |
by (rule ssubst) |
|
1861 |
||
1862 |
lemma back_subst: "P a ==> a = b ==> P b" |
|
1863 |
by (rule subst) |
|
1864 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1865 |
lemma set_rev_mp: "x:A ==> A \<subseteq> B ==> x:B" |
12020 | 1866 |
by (rule subsetD) |
1867 |
||
12897
f4d10ad0ea7b
converted/deleted equalities.ML, mono.ML, subset.ML (see Set.thy);
wenzelm
parents:
12633
diff
changeset
|
1868 |
lemma set_mp: "A \<subseteq> B ==> x:A ==> x:B" |
12020 | 1869 |
by (rule subsetD) |
1870 |
||
1871 |
lemma order_neq_le_trans: "a ~= b ==> (a::'a::order) <= b ==> a < b" |
|
1872 |
by (simp add: order_less_le) |
|
1873 |
||
1874 |
lemma order_le_neq_trans: "(a::'a::order) <= b ==> a ~= b ==> a < b" |
|
1875 |
by (simp add: order_less_le) |
|
1876 |
||
1877 |
lemma order_less_asym': "(a::'a::order) < b ==> b < a ==> P" |
|
1878 |
by (rule order_less_asym) |
|
1879 |
||
1880 |
lemma ord_le_eq_trans: "a <= b ==> b = c ==> a <= c" |
|
1881 |
by (rule subst) |
|
1882 |
||
1883 |
lemma ord_eq_le_trans: "a = b ==> b <= c ==> a <= c" |
|
1884 |
by (rule ssubst) |
|
1885 |
||
1886 |
lemma ord_less_eq_trans: "a < b ==> b = c ==> a < c" |
|
1887 |
by (rule subst) |
|
1888 |
||
1889 |
lemma ord_eq_less_trans: "a = b ==> b < c ==> a < c" |
|
1890 |
by (rule ssubst) |
|
1891 |
||
1892 |
lemma order_less_subst2: "(a::'a::order) < b ==> f b < (c::'c::order) ==> |
|
1893 |
(!!x y. x < y ==> f x < f y) ==> f a < c" |
|
1894 |
proof - |
|
1895 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1896 |
assume "a < b" hence "f a < f b" by (rule r) |
|
1897 |
also assume "f b < c" |
|
1898 |
finally (order_less_trans) show ?thesis . |
|
1899 |
qed |
|
1900 |
||
1901 |
lemma order_less_subst1: "(a::'a::order) < f b ==> (b::'b::order) < c ==> |
|
1902 |
(!!x y. x < y ==> f x < f y) ==> a < f c" |
|
1903 |
proof - |
|
1904 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1905 |
assume "a < f b" |
|
1906 |
also assume "b < c" hence "f b < f c" by (rule r) |
|
1907 |
finally (order_less_trans) show ?thesis . |
|
1908 |
qed |
|
1909 |
||
1910 |
lemma order_le_less_subst2: "(a::'a::order) <= b ==> f b < (c::'c::order) ==> |
|
1911 |
(!!x y. x <= y ==> f x <= f y) ==> f a < c" |
|
1912 |
proof - |
|
1913 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1914 |
assume "a <= b" hence "f a <= f b" by (rule r) |
|
1915 |
also assume "f b < c" |
|
1916 |
finally (order_le_less_trans) show ?thesis . |
|
1917 |
qed |
|
1918 |
||
1919 |
lemma order_le_less_subst1: "(a::'a::order) <= f b ==> (b::'b::order) < c ==> |
|
1920 |
(!!x y. x < y ==> f x < f y) ==> a < f c" |
|
1921 |
proof - |
|
1922 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1923 |
assume "a <= f b" |
|
1924 |
also assume "b < c" hence "f b < f c" by (rule r) |
|
1925 |
finally (order_le_less_trans) show ?thesis . |
|
1926 |
qed |
|
1927 |
||
1928 |
lemma order_less_le_subst2: "(a::'a::order) < b ==> f b <= (c::'c::order) ==> |
|
1929 |
(!!x y. x < y ==> f x < f y) ==> f a < c" |
|
1930 |
proof - |
|
1931 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1932 |
assume "a < b" hence "f a < f b" by (rule r) |
|
1933 |
also assume "f b <= c" |
|
1934 |
finally (order_less_le_trans) show ?thesis . |
|
1935 |
qed |
|
1936 |
||
1937 |
lemma order_less_le_subst1: "(a::'a::order) < f b ==> (b::'b::order) <= c ==> |
|
1938 |
(!!x y. x <= y ==> f x <= f y) ==> a < f c" |
|
1939 |
proof - |
|
1940 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1941 |
assume "a < f b" |
|
1942 |
also assume "b <= c" hence "f b <= f c" by (rule r) |
|
1943 |
finally (order_less_le_trans) show ?thesis . |
|
1944 |
qed |
|
1945 |
||
1946 |
lemma order_subst1: "(a::'a::order) <= f b ==> (b::'b::order) <= c ==> |
|
1947 |
(!!x y. x <= y ==> f x <= f y) ==> a <= f c" |
|
1948 |
proof - |
|
1949 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1950 |
assume "a <= f b" |
|
1951 |
also assume "b <= c" hence "f b <= f c" by (rule r) |
|
1952 |
finally (order_trans) show ?thesis . |
|
1953 |
qed |
|
1954 |
||
1955 |
lemma order_subst2: "(a::'a::order) <= b ==> f b <= (c::'c::order) ==> |
|
1956 |
(!!x y. x <= y ==> f x <= f y) ==> f a <= c" |
|
1957 |
proof - |
|
1958 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1959 |
assume "a <= b" hence "f a <= f b" by (rule r) |
|
1960 |
also assume "f b <= c" |
|
1961 |
finally (order_trans) show ?thesis . |
|
1962 |
qed |
|
1963 |
||
1964 |
lemma ord_le_eq_subst: "a <= b ==> f b = c ==> |
|
1965 |
(!!x y. x <= y ==> f x <= f y) ==> f a <= c" |
|
1966 |
proof - |
|
1967 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1968 |
assume "a <= b" hence "f a <= f b" by (rule r) |
|
1969 |
also assume "f b = c" |
|
1970 |
finally (ord_le_eq_trans) show ?thesis . |
|
1971 |
qed |
|
1972 |
||
1973 |
lemma ord_eq_le_subst: "a = f b ==> b <= c ==> |
|
1974 |
(!!x y. x <= y ==> f x <= f y) ==> a <= f c" |
|
1975 |
proof - |
|
1976 |
assume r: "!!x y. x <= y ==> f x <= f y" |
|
1977 |
assume "a = f b" |
|
1978 |
also assume "b <= c" hence "f b <= f c" by (rule r) |
|
1979 |
finally (ord_eq_le_trans) show ?thesis . |
|
1980 |
qed |
|
1981 |
||
1982 |
lemma ord_less_eq_subst: "a < b ==> f b = c ==> |
|
1983 |
(!!x y. x < y ==> f x < f y) ==> f a < c" |
|
1984 |
proof - |
|
1985 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1986 |
assume "a < b" hence "f a < f b" by (rule r) |
|
1987 |
also assume "f b = c" |
|
1988 |
finally (ord_less_eq_trans) show ?thesis . |
|
1989 |
qed |
|
1990 |
||
1991 |
lemma ord_eq_less_subst: "a = f b ==> b < c ==> |
|
1992 |
(!!x y. x < y ==> f x < f y) ==> a < f c" |
|
1993 |
proof - |
|
1994 |
assume r: "!!x y. x < y ==> f x < f y" |
|
1995 |
assume "a = f b" |
|
1996 |
also assume "b < c" hence "f b < f c" by (rule r) |
|
1997 |
finally (ord_eq_less_trans) show ?thesis . |
|
1998 |
qed |
|
1999 |
||
2000 |
text {* |
|
2001 |
Note that this list of rules is in reverse order of priorities. |
|
2002 |
*} |
|
2003 |
||
2004 |
lemmas basic_trans_rules [trans] = |
|
2005 |
order_less_subst2 |
|
2006 |
order_less_subst1 |
|
2007 |
order_le_less_subst2 |
|
2008 |
order_le_less_subst1 |
|
2009 |
order_less_le_subst2 |
|
2010 |
order_less_le_subst1 |
|
2011 |
order_subst2 |
|
2012 |
order_subst1 |
|
2013 |
ord_le_eq_subst |
|
2014 |
ord_eq_le_subst |
|
2015 |
ord_less_eq_subst |
|
2016 |
ord_eq_less_subst |
|
2017 |
forw_subst |
|
2018 |
back_subst |
|
2019 |
rev_mp |
|
2020 |
mp |
|
2021 |
set_rev_mp |
|
2022 |
set_mp |
|
2023 |
order_neq_le_trans |
|
2024 |
order_le_neq_trans |
|
2025 |
order_less_trans |
|
2026 |
order_less_asym' |
|
2027 |
order_le_less_trans |
|
2028 |
order_less_le_trans |
|
2029 |
order_trans |
|
2030 |
order_antisym |
|
2031 |
ord_le_eq_trans |
|
2032 |
ord_eq_le_trans |
|
2033 |
ord_less_eq_trans |
|
2034 |
ord_eq_less_trans |
|
2035 |
trans |
|
2036 |
||
11979 | 2037 |
end |