author | wenzelm |
Sat, 28 Jul 2018 16:49:53 +0200 | |
changeset 68700 | 1e358063ab90 |
parent 68610 | 4fdc9f681479 |
child 68802 | 3974935e0252 |
permissions | -rw-r--r-- |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
1 |
(* Title: HOL/Hilbert_Choice.thy |
32988 | 2 |
Author: Lawrence C Paulson, Tobias Nipkow |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
3 |
Author: Viorel Preoteasa (Results about complete distributive lattices) |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
4 |
Copyright 2001 University of Cambridge |
12023 | 5 |
*) |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
6 |
|
60758 | 7 |
section \<open>Hilbert's Epsilon-Operator and the Axiom of Choice\<close> |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
8 |
|
15131 | 9 |
theory Hilbert_Choice |
63612 | 10 |
imports Wellfounded |
11 |
keywords "specification" :: thy_goal |
|
15131 | 12 |
begin |
12298 | 13 |
|
60758 | 14 |
subsection \<open>Hilbert's epsilon\<close> |
12298 | 15 |
|
63612 | 16 |
axiomatization Eps :: "('a \<Rightarrow> bool) \<Rightarrow> 'a" |
17 |
where someI: "P x \<Longrightarrow> P (Eps P)" |
|
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
18 |
|
14872
3f2144aebd76
improved symbolic syntax of Eps: \<some> for mode "epsilon";
wenzelm
parents:
14760
diff
changeset
|
19 |
syntax (epsilon) |
63612 | 20 |
"_Eps" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a" ("(3\<some>_./ _)" [0, 10] 10) |
62521 | 21 |
syntax (input) |
63612 | 22 |
"_Eps" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a" ("(3@ _./ _)" [0, 10] 10) |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
23 |
syntax |
63612 | 24 |
"_Eps" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a" ("(3SOME _./ _)" [0, 10] 10) |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
25 |
translations |
63612 | 26 |
"SOME x. P" \<rightleftharpoons> "CONST Eps (\<lambda>x. P)" |
13763
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13585
diff
changeset
|
27 |
|
60758 | 28 |
print_translation \<open> |
52143 | 29 |
[(@{const_syntax Eps}, fn _ => fn [Abs abs] => |
42284 | 30 |
let val (x, t) = Syntax_Trans.atomic_abs_tr' abs |
35115 | 31 |
in Syntax.const @{syntax_const "_Eps"} $ x $ t end)] |
61799 | 32 |
\<close> \<comment> \<open>to avoid eta-contraction of body\<close> |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
33 |
|
65815 | 34 |
definition inv_into :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)" where |
35 |
"inv_into A f = (\<lambda>x. SOME y. y \<in> A \<and> f y = x)" |
|
11454
7514e5e21cb8
Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents:
11451
diff
changeset
|
36 |
|
65815 | 37 |
lemma inv_into_def2: "inv_into A f x = (SOME y. y \<in> A \<and> f y = x)" |
38 |
by(simp add: inv_into_def) |
|
39 |
||
40 |
abbreviation inv :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)" where |
|
41 |
"inv \<equiv> inv_into UNIV" |
|
14760 | 42 |
|
43 |
||
60758 | 44 |
subsection \<open>Hilbert's Epsilon-operator\<close> |
14760 | 45 |
|
63612 | 46 |
text \<open> |
47 |
Easier to apply than \<open>someI\<close> if the witness comes from an |
|
48 |
existential formula. |
|
49 |
\<close> |
|
50 |
lemma someI_ex [elim?]: "\<exists>x. P x \<Longrightarrow> P (SOME x. P x)" |
|
51 |
apply (erule exE) |
|
52 |
apply (erule someI) |
|
53 |
done |
|
14760 | 54 |
|
63612 | 55 |
text \<open> |
56 |
Easier to apply than \<open>someI\<close> because the conclusion has only one |
|
57 |
occurrence of @{term P}. |
|
58 |
\<close> |
|
59 |
lemma someI2: "P a \<Longrightarrow> (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> Q (SOME x. P x)" |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60758
diff
changeset
|
60 |
by (blast intro: someI) |
14760 | 61 |
|
63612 | 62 |
text \<open> |
63 |
Easier to apply than \<open>someI2\<close> if the witness comes from an |
|
64 |
existential formula. |
|
65 |
\<close> |
|
66 |
lemma someI2_ex: "\<exists>a. P a \<Longrightarrow> (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> Q (SOME x. P x)" |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60758
diff
changeset
|
67 |
by (blast intro: someI2) |
14760 | 68 |
|
63612 | 69 |
lemma someI2_bex: "\<exists>a\<in>A. P a \<Longrightarrow> (\<And>x. x \<in> A \<and> P x \<Longrightarrow> Q x) \<Longrightarrow> Q (SOME x. x \<in> A \<and> P x)" |
70 |
by (blast intro: someI2) |
|
71 |
||
72 |
lemma some_equality [intro]: "P a \<Longrightarrow> (\<And>x. P x \<Longrightarrow> x = a) \<Longrightarrow> (SOME x. P x) = a" |
|
73 |
by (blast intro: someI2) |
|
14760 | 74 |
|
63629 | 75 |
lemma some1_equality: "\<exists>!x. P x \<Longrightarrow> P a \<Longrightarrow> (SOME x. P x) = a" |
63612 | 76 |
by blast |
14760 | 77 |
|
63612 | 78 |
lemma some_eq_ex: "P (SOME x. P x) \<longleftrightarrow> (\<exists>x. P x)" |
79 |
by (blast intro: someI) |
|
14760 | 80 |
|
59000 | 81 |
lemma some_in_eq: "(SOME x. x \<in> A) \<in> A \<longleftrightarrow> A \<noteq> {}" |
82 |
unfolding ex_in_conv[symmetric] by (rule some_eq_ex) |
|
83 |
||
63612 | 84 |
lemma some_eq_trivial [simp]: "(SOME y. y = x) = x" |
85 |
by (rule some_equality) (rule refl) |
|
14760 | 86 |
|
63612 | 87 |
lemma some_sym_eq_trivial [simp]: "(SOME y. x = y) = x" |
88 |
apply (rule some_equality) |
|
89 |
apply (rule refl) |
|
90 |
apply (erule sym) |
|
91 |
done |
|
14760 | 92 |
|
93 |
||
63612 | 94 |
subsection \<open>Axiom of Choice, Proved Using the Description Operator\<close> |
14760 | 95 |
|
63612 | 96 |
lemma choice: "\<forall>x. \<exists>y. Q x y \<Longrightarrow> \<exists>f. \<forall>x. Q x (f x)" |
97 |
by (fast elim: someI) |
|
14760 | 98 |
|
63612 | 99 |
lemma bchoice: "\<forall>x\<in>S. \<exists>y. Q x y \<Longrightarrow> \<exists>f. \<forall>x\<in>S. Q x (f x)" |
100 |
by (fast elim: someI) |
|
14760 | 101 |
|
50105 | 102 |
lemma choice_iff: "(\<forall>x. \<exists>y. Q x y) \<longleftrightarrow> (\<exists>f. \<forall>x. Q x (f x))" |
63612 | 103 |
by (fast elim: someI) |
50105 | 104 |
|
105 |
lemma choice_iff': "(\<forall>x. P x \<longrightarrow> (\<exists>y. Q x y)) \<longleftrightarrow> (\<exists>f. \<forall>x. P x \<longrightarrow> Q x (f x))" |
|
63612 | 106 |
by (fast elim: someI) |
50105 | 107 |
|
108 |
lemma bchoice_iff: "(\<forall>x\<in>S. \<exists>y. Q x y) \<longleftrightarrow> (\<exists>f. \<forall>x\<in>S. Q x (f x))" |
|
63612 | 109 |
by (fast elim: someI) |
50105 | 110 |
|
111 |
lemma bchoice_iff': "(\<forall>x\<in>S. P x \<longrightarrow> (\<exists>y. Q x y)) \<longleftrightarrow> (\<exists>f. \<forall>x\<in>S. P x \<longrightarrow> Q x (f x))" |
|
63612 | 112 |
by (fast elim: someI) |
14760 | 113 |
|
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
56740
diff
changeset
|
114 |
lemma dependent_nat_choice: |
63612 | 115 |
assumes 1: "\<exists>x. P 0 x" |
116 |
and 2: "\<And>x n. P n x \<Longrightarrow> \<exists>y. P (Suc n) y \<and> Q n x y" |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57275
diff
changeset
|
117 |
shows "\<exists>f. \<forall>n. P n (f n) \<and> Q n (f n) (f (Suc n))" |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
56740
diff
changeset
|
118 |
proof (intro exI allI conjI) |
63040 | 119 |
fix n |
120 |
define f where "f = rec_nat (SOME x. P 0 x) (\<lambda>n x. SOME y. P (Suc n) y \<and> Q n x y)" |
|
63612 | 121 |
then have "P 0 (f 0)" "\<And>n. P n (f n) \<Longrightarrow> P (Suc n) (f (Suc n)) \<and> Q n (f n) (f (Suc n))" |
122 |
using someI_ex[OF 1] someI_ex[OF 2] by simp_all |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57275
diff
changeset
|
123 |
then show "P n (f n)" "Q n (f n) (f (Suc n))" |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
56740
diff
changeset
|
124 |
by (induct n) auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
56740
diff
changeset
|
125 |
qed |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
56740
diff
changeset
|
126 |
|
58074 | 127 |
|
60758 | 128 |
subsection \<open>Function Inverse\<close> |
14760 | 129 |
|
63612 | 130 |
lemma inv_def: "inv f = (\<lambda>y. SOME x. f x = y)" |
131 |
by (simp add: inv_into_def) |
|
33014 | 132 |
|
63612 | 133 |
lemma inv_into_into: "x \<in> f ` A \<Longrightarrow> inv_into A f x \<in> A" |
134 |
by (simp add: inv_into_def) (fast intro: someI2) |
|
14760 | 135 |
|
63612 | 136 |
lemma inv_identity [simp]: "inv (\<lambda>a. a) = (\<lambda>a. a)" |
63365 | 137 |
by (simp add: inv_def) |
138 |
||
63612 | 139 |
lemma inv_id [simp]: "inv id = id" |
63365 | 140 |
by (simp add: id_def) |
14760 | 141 |
|
63612 | 142 |
lemma inv_into_f_f [simp]: "inj_on f A \<Longrightarrow> x \<in> A \<Longrightarrow> inv_into A f (f x) = x" |
143 |
by (simp add: inv_into_def inj_on_def) (blast intro: someI2) |
|
14760 | 144 |
|
63612 | 145 |
lemma inv_f_f: "inj f \<Longrightarrow> inv f (f x) = x" |
146 |
by simp |
|
32988 | 147 |
|
67613 | 148 |
lemma f_inv_into_f: "y \<in> f`A \<Longrightarrow> f (inv_into A f y) = y" |
63612 | 149 |
by (simp add: inv_into_def) (fast intro: someI2) |
32988 | 150 |
|
63612 | 151 |
lemma inv_into_f_eq: "inj_on f A \<Longrightarrow> x \<in> A \<Longrightarrow> f x = y \<Longrightarrow> inv_into A f y = x" |
152 |
by (erule subst) (fast intro: inv_into_f_f) |
|
32988 | 153 |
|
63612 | 154 |
lemma inv_f_eq: "inj f \<Longrightarrow> f x = y \<Longrightarrow> inv f y = x" |
155 |
by (simp add:inv_into_f_eq) |
|
32988 | 156 |
|
63612 | 157 |
lemma inj_imp_inv_eq: "inj f \<Longrightarrow> \<forall>x. f (g x) = x \<Longrightarrow> inv f = g" |
44921 | 158 |
by (blast intro: inv_into_f_eq) |
14760 | 159 |
|
63612 | 160 |
text \<open>But is it useful?\<close> |
14760 | 161 |
lemma inj_transfer: |
63612 | 162 |
assumes inj: "inj f" |
163 |
and minor: "\<And>y. y \<in> range f \<Longrightarrow> P (inv f y)" |
|
14760 | 164 |
shows "P x" |
165 |
proof - |
|
166 |
have "f x \<in> range f" by auto |
|
63612 | 167 |
then have "P(inv f (f x))" by (rule minor) |
168 |
then show "P x" by (simp add: inv_into_f_f [OF inj]) |
|
14760 | 169 |
qed |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
170 |
|
63612 | 171 |
lemma inj_iff: "inj f \<longleftrightarrow> inv f \<circ> f = id" |
172 |
by (simp add: o_def fun_eq_iff) (blast intro: inj_on_inverseI inv_into_f_f) |
|
14760 | 173 |
|
63612 | 174 |
lemma inv_o_cancel[simp]: "inj f \<Longrightarrow> inv f \<circ> f = id" |
175 |
by (simp add: inj_iff) |
|
176 |
||
177 |
lemma o_inv_o_cancel[simp]: "inj f \<Longrightarrow> g \<circ> inv f \<circ> f = g" |
|
178 |
by (simp add: comp_assoc) |
|
23433 | 179 |
|
63612 | 180 |
lemma inv_into_image_cancel[simp]: "inj_on f A \<Longrightarrow> S \<subseteq> A \<Longrightarrow> inv_into A f ` f ` S = S" |
181 |
by (fastforce simp: image_def) |
|
23433 | 182 |
|
63612 | 183 |
lemma inj_imp_surj_inv: "inj f \<Longrightarrow> surj (inv f)" |
184 |
by (blast intro!: surjI inv_into_f_f) |
|
32988 | 185 |
|
63612 | 186 |
lemma surj_f_inv_f: "surj f \<Longrightarrow> f (inv f y) = y" |
187 |
by (simp add: f_inv_into_f) |
|
14760 | 188 |
|
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67613
diff
changeset
|
189 |
lemma bij_inv_eq_iff: "bij p \<Longrightarrow> x = inv p y \<longleftrightarrow> p x = y" |
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67613
diff
changeset
|
190 |
using surj_f_inv_f[of p] by (auto simp add: bij_def) |
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67613
diff
changeset
|
191 |
|
33057 | 192 |
lemma inv_into_injective: |
193 |
assumes eq: "inv_into A f x = inv_into A f y" |
|
63612 | 194 |
and x: "x \<in> f`A" |
195 |
and y: "y \<in> f`A" |
|
196 |
shows "x = y" |
|
14760 | 197 |
proof - |
63612 | 198 |
from eq have "f (inv_into A f x) = f (inv_into A f y)" |
199 |
by simp |
|
200 |
with x y show ?thesis |
|
201 |
by (simp add: f_inv_into_f) |
|
14760 | 202 |
qed |
203 |
||
63612 | 204 |
lemma inj_on_inv_into: "B \<subseteq> f`A \<Longrightarrow> inj_on (inv_into A f) B" |
205 |
by (blast intro: inj_onI dest: inv_into_injective injD) |
|
32988 | 206 |
|
63612 | 207 |
lemma bij_betw_inv_into: "bij_betw f A B \<Longrightarrow> bij_betw (inv_into A f) B A" |
208 |
by (auto simp add: bij_betw_def inj_on_inv_into) |
|
14760 | 209 |
|
63612 | 210 |
lemma surj_imp_inj_inv: "surj f \<Longrightarrow> inj (inv f)" |
211 |
by (simp add: inj_on_inv_into) |
|
14760 | 212 |
|
63612 | 213 |
lemma surj_iff: "surj f \<longleftrightarrow> f \<circ> inv f = id" |
214 |
by (auto intro!: surjI simp: surj_f_inv_f fun_eq_iff[where 'b='a]) |
|
40702 | 215 |
|
216 |
lemma surj_iff_all: "surj f \<longleftrightarrow> (\<forall>x. f (inv f x) = x)" |
|
63612 | 217 |
by (simp add: o_def surj_iff fun_eq_iff) |
14760 | 218 |
|
63612 | 219 |
lemma surj_imp_inv_eq: "surj f \<Longrightarrow> \<forall>x. g (f x) = x \<Longrightarrow> inv f = g" |
220 |
apply (rule ext) |
|
221 |
apply (drule_tac x = "inv f x" in spec) |
|
222 |
apply (simp add: surj_f_inv_f) |
|
223 |
done |
|
14760 | 224 |
|
63612 | 225 |
lemma bij_imp_bij_inv: "bij f \<Longrightarrow> bij (inv f)" |
226 |
by (simp add: bij_def inj_imp_surj_inv surj_imp_inj_inv) |
|
12372 | 227 |
|
63612 | 228 |
lemma inv_equality: "(\<And>x. g (f x) = x) \<Longrightarrow> (\<And>y. f (g y) = y) \<Longrightarrow> inv f = g" |
229 |
by (rule ext) (auto simp add: inv_into_def) |
|
230 |
||
231 |
lemma inv_inv_eq: "bij f \<Longrightarrow> inv (inv f) = f" |
|
232 |
by (rule inv_equality) (auto simp add: bij_def surj_f_inv_f) |
|
14760 | 233 |
|
63612 | 234 |
text \<open> |
235 |
\<open>bij (inv f)\<close> implies little about \<open>f\<close>. Consider \<open>f :: bool \<Rightarrow> bool\<close> such |
|
236 |
that \<open>f True = f False = True\<close>. Then it ia consistent with axiom \<open>someI\<close> |
|
237 |
that \<open>inv f\<close> could be any function at all, including the identity function. |
|
238 |
If \<open>inv f = id\<close> then \<open>inv f\<close> is a bijection, but \<open>inj f\<close>, \<open>surj f\<close> and \<open>inv |
|
239 |
(inv f) = f\<close> all fail. |
|
240 |
\<close> |
|
14760 | 241 |
|
33057 | 242 |
lemma inv_into_comp: |
63612 | 243 |
"inj_on f (g ` A) \<Longrightarrow> inj_on g A \<Longrightarrow> x \<in> f ` g ` A \<Longrightarrow> |
244 |
inv_into A (f \<circ> g) x = (inv_into A g \<circ> inv_into (g ` A) f) x" |
|
245 |
apply (rule inv_into_f_eq) |
|
246 |
apply (fast intro: comp_inj_on) |
|
247 |
apply (simp add: inv_into_into) |
|
248 |
apply (simp add: f_inv_into_f inv_into_into) |
|
249 |
done |
|
32988 | 250 |
|
63612 | 251 |
lemma o_inv_distrib: "bij f \<Longrightarrow> bij g \<Longrightarrow> inv (f \<circ> g) = inv g \<circ> inv f" |
252 |
by (rule inv_equality) (auto simp add: bij_def surj_f_inv_f) |
|
14760 | 253 |
|
63807 | 254 |
lemma image_f_inv_f: "surj f \<Longrightarrow> f ` (inv f ` A) = A" |
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
61859
diff
changeset
|
255 |
by (simp add: surj_f_inv_f image_comp comp_def) |
14760 | 256 |
|
63612 | 257 |
lemma image_inv_f_f: "inj f \<Longrightarrow> inv f ` (f ` A) = A" |
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
61859
diff
changeset
|
258 |
by simp |
14760 | 259 |
|
63612 | 260 |
lemma bij_image_Collect_eq: "bij f \<Longrightarrow> f ` Collect P = {y. P (inv f y)}" |
261 |
apply auto |
|
262 |
apply (force simp add: bij_is_inj) |
|
263 |
apply (blast intro: bij_is_surj [THEN surj_f_inv_f, symmetric]) |
|
264 |
done |
|
14760 | 265 |
|
63612 | 266 |
lemma bij_vimage_eq_inv_image: "bij f \<Longrightarrow> f -` A = inv f ` A" |
267 |
apply (auto simp add: bij_is_surj [THEN surj_f_inv_f]) |
|
268 |
apply (blast intro: bij_is_inj [THEN inv_into_f_f, symmetric]) |
|
269 |
done |
|
14760 | 270 |
|
68610 | 271 |
lemma inv_fn_o_fn_is_id: |
272 |
fixes f::"'a \<Rightarrow> 'a" |
|
273 |
assumes "bij f" |
|
274 |
shows "((inv f)^^n) o (f^^n) = (\<lambda>x. x)" |
|
275 |
proof - |
|
276 |
have "((inv f)^^n)((f^^n) x) = x" for x n |
|
277 |
proof (induction n) |
|
278 |
case (Suc n) |
|
279 |
have *: "(inv f) (f y) = y" for y |
|
280 |
by (simp add: assms bij_is_inj) |
|
281 |
have "(inv f ^^ Suc n) ((f ^^ Suc n) x) = (inv f^^n) (inv f (f ((f^^n) x)))" |
|
282 |
by (simp add: funpow_swap1) |
|
283 |
also have "... = (inv f^^n) ((f^^n) x)" |
|
284 |
using * by auto |
|
285 |
also have "... = x" using Suc.IH by auto |
|
286 |
finally show ?case by simp |
|
287 |
qed (auto) |
|
288 |
then show ?thesis unfolding o_def by blast |
|
289 |
qed |
|
290 |
||
291 |
lemma fn_o_inv_fn_is_id: |
|
292 |
fixes f::"'a \<Rightarrow> 'a" |
|
293 |
assumes "bij f" |
|
294 |
shows "(f^^n) o ((inv f)^^n) = (\<lambda>x. x)" |
|
295 |
proof - |
|
296 |
have "(f^^n) (((inv f)^^n) x) = x" for x n |
|
297 |
proof (induction n) |
|
298 |
case (Suc n) |
|
299 |
have *: "f(inv f y) = y" for y |
|
300 |
using bij_inv_eq_iff[OF assms] by auto |
|
301 |
have "(f ^^ Suc n) ((inv f ^^ Suc n) x) = (f^^n) (f (inv f ((inv f^^n) x)))" |
|
302 |
by (simp add: funpow_swap1) |
|
303 |
also have "... = (f^^n) ((inv f^^n) x)" |
|
304 |
using * by auto |
|
305 |
also have "... = x" using Suc.IH by auto |
|
306 |
finally show ?case by simp |
|
307 |
qed (auto) |
|
308 |
then show ?thesis unfolding o_def by blast |
|
309 |
qed |
|
310 |
||
311 |
lemma inv_fn: |
|
312 |
fixes f::"'a \<Rightarrow> 'a" |
|
313 |
assumes "bij f" |
|
314 |
shows "inv (f^^n) = ((inv f)^^n)" |
|
315 |
proof - |
|
316 |
have "inv (f^^n) x = ((inv f)^^n) x" for x |
|
317 |
apply (rule inv_into_f_eq, auto simp add: inj_fn[OF bij_is_inj[OF assms]]) |
|
318 |
using fn_o_inv_fn_is_id[OF assms, of n, THEN fun_cong] by (simp) |
|
319 |
then show ?thesis by auto |
|
320 |
qed |
|
321 |
||
322 |
lemma mono_inv: |
|
323 |
fixes f::"'a::linorder \<Rightarrow> 'b::linorder" |
|
324 |
assumes "mono f" "bij f" |
|
325 |
shows "mono (inv f)" |
|
326 |
proof |
|
327 |
fix x y::'b assume "x \<le> y" |
|
328 |
from \<open>bij f\<close> obtain a b where x: "x = f a" and y: "y = f b" by(fastforce simp: bij_def surj_def) |
|
329 |
show "inv f x \<le> inv f y" |
|
330 |
proof (rule le_cases) |
|
331 |
assume "a \<le> b" |
|
332 |
thus ?thesis using \<open>bij f\<close> x y by(simp add: bij_def inv_f_f) |
|
333 |
next |
|
334 |
assume "b \<le> a" |
|
335 |
hence "f b \<le> f a" by(rule monoD[OF \<open>mono f\<close>]) |
|
336 |
hence "y \<le> x" using x y by simp |
|
337 |
hence "x = y" using \<open>x \<le> y\<close> by auto |
|
338 |
thus ?thesis by simp |
|
339 |
qed |
|
340 |
qed |
|
341 |
||
342 |
lemma mono_bij_Inf: |
|
343 |
fixes f :: "'a::complete_linorder \<Rightarrow> 'b::complete_linorder" |
|
344 |
assumes "mono f" "bij f" |
|
345 |
shows "f (Inf A) = Inf (f`A)" |
|
346 |
proof - |
|
347 |
have "surj f" using \<open>bij f\<close> by (auto simp: bij_betw_def) |
|
348 |
have *: "(inv f) (Inf (f`A)) \<le> Inf ((inv f)`(f`A))" |
|
349 |
using mono_Inf[OF mono_inv[OF assms], of "f`A"] by simp |
|
350 |
have "Inf (f`A) \<le> f (Inf ((inv f)`(f`A)))" |
|
351 |
using monoD[OF \<open>mono f\<close> *] by(simp add: surj_f_inv_f[OF \<open>surj f\<close>]) |
|
352 |
also have "... = f(Inf A)" |
|
353 |
using assms by (simp add: bij_is_inj) |
|
354 |
finally show ?thesis using mono_Inf[OF assms(1), of A] by auto |
|
355 |
qed |
|
356 |
||
31380 | 357 |
lemma finite_fun_UNIVD1: |
358 |
assumes fin: "finite (UNIV :: ('a \<Rightarrow> 'b) set)" |
|
63612 | 359 |
and card: "card (UNIV :: 'b set) \<noteq> Suc 0" |
31380 | 360 |
shows "finite (UNIV :: 'a set)" |
361 |
proof - |
|
63630 | 362 |
let ?UNIV_b = "UNIV :: 'b set" |
363 |
from fin have "finite ?UNIV_b" |
|
63612 | 364 |
by (rule finite_fun_UNIVD2) |
63630 | 365 |
with card have "card ?UNIV_b \<ge> Suc (Suc 0)" |
366 |
by (cases "card ?UNIV_b") (auto simp: card_eq_0_iff) |
|
367 |
then have "card ?UNIV_b = Suc (Suc (card ?UNIV_b - Suc (Suc 0)))" |
|
368 |
by simp |
|
63629 | 369 |
then obtain b1 b2 :: 'b where b1b2: "b1 \<noteq> b2" |
370 |
by (auto simp: card_Suc_eq) |
|
63630 | 371 |
from fin have fin': "finite (range (\<lambda>f :: 'a \<Rightarrow> 'b. inv f b1))" |
63612 | 372 |
by (rule finite_imageI) |
63630 | 373 |
have "UNIV = range (\<lambda>f :: 'a \<Rightarrow> 'b. inv f b1)" |
31380 | 374 |
proof (rule UNIV_eq_I) |
375 |
fix x :: 'a |
|
63612 | 376 |
from b1b2 have "x = inv (\<lambda>y. if y = x then b1 else b2) b1" |
377 |
by (simp add: inv_into_def) |
|
378 |
then show "x \<in> range (\<lambda>f::'a \<Rightarrow> 'b. inv f b1)" |
|
379 |
by blast |
|
31380 | 380 |
qed |
63630 | 381 |
with fin' show ?thesis |
63612 | 382 |
by simp |
31380 | 383 |
qed |
14760 | 384 |
|
60758 | 385 |
text \<open> |
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
386 |
Every infinite set contains a countable subset. More precisely we |
61799 | 387 |
show that a set \<open>S\<close> is infinite if and only if there exists an |
388 |
injective function from the naturals into \<open>S\<close>. |
|
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
389 |
|
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
390 |
The ``only if'' direction is harder because it requires the |
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
391 |
construction of a sequence of pairwise different elements of an |
61799 | 392 |
infinite set \<open>S\<close>. The idea is to construct a sequence of |
393 |
non-empty and infinite subsets of \<open>S\<close> obtained by successively |
|
394 |
removing elements of \<open>S\<close>. |
|
60758 | 395 |
\<close> |
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
396 |
|
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
397 |
lemma infinite_countable_subset: |
63629 | 398 |
assumes inf: "\<not> finite S" |
399 |
shows "\<exists>f::nat \<Rightarrow> 'a. inj f \<and> range f \<subseteq> S" |
|
61799 | 400 |
\<comment> \<open>Courtesy of Stephan Merz\<close> |
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
401 |
proof - |
63040 | 402 |
define Sseq where "Sseq = rec_nat S (\<lambda>n T. T - {SOME e. e \<in> T})" |
403 |
define pick where "pick n = (SOME e. e \<in> Sseq n)" for n |
|
63540 | 404 |
have *: "Sseq n \<subseteq> S" "\<not> finite (Sseq n)" for n |
63612 | 405 |
by (induct n) (auto simp: Sseq_def inf) |
63540 | 406 |
then have **: "\<And>n. pick n \<in> Sseq n" |
55811 | 407 |
unfolding pick_def by (subst (asm) finite.simps) (auto simp add: ex_in_conv intro: someI_ex) |
63540 | 408 |
with * have "range pick \<subseteq> S" by auto |
63612 | 409 |
moreover have "pick n \<noteq> pick (n + Suc m)" for m n |
410 |
proof - |
|
63540 | 411 |
have "pick n \<notin> Sseq (n + Suc m)" |
412 |
by (induct m) (auto simp add: Sseq_def pick_def) |
|
63612 | 413 |
with ** show ?thesis by auto |
414 |
qed |
|
415 |
then have "inj pick" |
|
416 |
by (intro linorder_injI) (auto simp add: less_iff_Suc_add) |
|
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
417 |
ultimately show ?thesis by blast |
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
418 |
qed |
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
419 |
|
63629 | 420 |
lemma infinite_iff_countable_subset: "\<not> finite S \<longleftrightarrow> (\<exists>f::nat \<Rightarrow> 'a. inj f \<and> range f \<subseteq> S)" |
61799 | 421 |
\<comment> \<open>Courtesy of Stephan Merz\<close> |
55811 | 422 |
using finite_imageD finite_subset infinite_UNIV_char_0 infinite_countable_subset by auto |
54578
9387251b6a46
eliminated dependence of BNF on Infinite_Set by moving 3 theorems from the latter to Main
traytel
parents:
54295
diff
changeset
|
423 |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
424 |
lemma image_inv_into_cancel: |
63612 | 425 |
assumes surj: "f`A = A'" |
426 |
and sub: "B' \<subseteq> A'" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
427 |
shows "f `((inv_into A f)`B') = B'" |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
428 |
using assms |
63612 | 429 |
proof (auto simp: f_inv_into_f) |
430 |
let ?f' = "inv_into A f" |
|
431 |
fix a' |
|
432 |
assume *: "a' \<in> B'" |
|
433 |
with sub have "a' \<in> A'" by auto |
|
434 |
with surj have "a' = f (?f' a')" |
|
435 |
by (auto simp: f_inv_into_f) |
|
436 |
with * show "a' \<in> f ` (?f' ` B')" by blast |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
437 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
438 |
|
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
439 |
lemma inv_into_inv_into_eq: |
63612 | 440 |
assumes "bij_betw f A A'" |
441 |
and a: "a \<in> A" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
442 |
shows "inv_into A' (inv_into A f) a = f a" |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
443 |
proof - |
63612 | 444 |
let ?f' = "inv_into A f" |
445 |
let ?f'' = "inv_into A' ?f'" |
|
446 |
from assms have *: "bij_betw ?f' A' A" |
|
447 |
by (auto simp: bij_betw_inv_into) |
|
448 |
with a obtain a' where a': "a' \<in> A'" "?f' a' = a" |
|
449 |
unfolding bij_betw_def by force |
|
450 |
with a * have "?f'' a = a'" |
|
451 |
by (auto simp: f_inv_into_f bij_betw_def) |
|
452 |
moreover from assms a' have "f a = a'" |
|
453 |
by (auto simp: bij_betw_def) |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
454 |
ultimately show "?f'' a = f a" by simp |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
455 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
456 |
|
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
457 |
lemma inj_on_iff_surj: |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
458 |
assumes "A \<noteq> {}" |
63629 | 459 |
shows "(\<exists>f. inj_on f A \<and> f ` A \<subseteq> A') \<longleftrightarrow> (\<exists>g. g ` A' = A)" |
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
460 |
proof safe |
63612 | 461 |
fix f |
462 |
assume inj: "inj_on f A" and incl: "f ` A \<subseteq> A'" |
|
463 |
let ?phi = "\<lambda>a' a. a \<in> A \<and> f a = a'" |
|
464 |
let ?csi = "\<lambda>a. a \<in> A" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
465 |
let ?g = "\<lambda>a'. if a' \<in> f ` A then (SOME a. ?phi a' a) else (SOME a. ?csi a)" |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
466 |
have "?g ` A' = A" |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
467 |
proof |
63612 | 468 |
show "?g ` A' \<subseteq> A" |
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
469 |
proof clarify |
63612 | 470 |
fix a' |
471 |
assume *: "a' \<in> A'" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
472 |
show "?g a' \<in> A" |
63612 | 473 |
proof (cases "a' \<in> f ` A") |
474 |
case True |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
475 |
then obtain a where "?phi a' a" by blast |
63612 | 476 |
then have "?phi a' (SOME a. ?phi a' a)" |
477 |
using someI[of "?phi a'" a] by blast |
|
478 |
with True show ?thesis by auto |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
479 |
next |
63612 | 480 |
case False |
481 |
with assms have "?csi (SOME a. ?csi a)" |
|
482 |
using someI_ex[of ?csi] by blast |
|
483 |
with False show ?thesis by auto |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
484 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
485 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
486 |
next |
63612 | 487 |
show "A \<subseteq> ?g ` A'" |
488 |
proof - |
|
489 |
have "?g (f a) = a \<and> f a \<in> A'" if a: "a \<in> A" for a |
|
490 |
proof - |
|
491 |
let ?b = "SOME aa. ?phi (f a) aa" |
|
492 |
from a have "?phi (f a) a" by auto |
|
493 |
then have *: "?phi (f a) ?b" |
|
494 |
using someI[of "?phi(f a)" a] by blast |
|
495 |
then have "?g (f a) = ?b" using a by auto |
|
496 |
moreover from inj * a have "a = ?b" |
|
497 |
by (auto simp add: inj_on_def) |
|
498 |
ultimately have "?g(f a) = a" by simp |
|
499 |
with incl a show ?thesis by auto |
|
500 |
qed |
|
501 |
then show ?thesis by force |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
502 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
503 |
qed |
63612 | 504 |
then show "\<exists>g. g ` A' = A" by blast |
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
505 |
next |
63612 | 506 |
fix g |
507 |
let ?f = "inv_into A' g" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
508 |
have "inj_on ?f (g ` A')" |
63612 | 509 |
by (auto simp: inj_on_inv_into) |
510 |
moreover have "?f (g a') \<in> A'" if a': "a' \<in> A'" for a' |
|
511 |
proof - |
|
512 |
let ?phi = "\<lambda> b'. b' \<in> A' \<and> g b' = g a'" |
|
513 |
from a' have "?phi a'" by auto |
|
514 |
then have "?phi (SOME b'. ?phi b')" |
|
515 |
using someI[of ?phi] by blast |
|
516 |
then show ?thesis by (auto simp: inv_into_def) |
|
517 |
qed |
|
518 |
ultimately show "\<exists>f. inj_on f (g ` A') \<and> f ` g ` A' \<subseteq> A'" |
|
519 |
by auto |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
520 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
521 |
|
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
522 |
lemma Ex_inj_on_UNION_Sigma: |
63629 | 523 |
"\<exists>f. (inj_on f (\<Union>i \<in> I. A i) \<and> f ` (\<Union>i \<in> I. A i) \<subseteq> (SIGMA i : I. A i))" |
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
524 |
proof |
63612 | 525 |
let ?phi = "\<lambda>a i. i \<in> I \<and> a \<in> A i" |
526 |
let ?sm = "\<lambda>a. SOME i. ?phi a i" |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
527 |
let ?f = "\<lambda>a. (?sm a, a)" |
63612 | 528 |
have "inj_on ?f (\<Union>i \<in> I. A i)" |
529 |
by (auto simp: inj_on_def) |
|
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
530 |
moreover |
63612 | 531 |
have "?sm a \<in> I \<and> a \<in> A(?sm a)" if "i \<in> I" and "a \<in> A i" for i a |
532 |
using that someI[of "?phi a" i] by auto |
|
63629 | 533 |
then have "?f ` (\<Union>i \<in> I. A i) \<subseteq> (SIGMA i : I. A i)" |
63612 | 534 |
by auto |
63629 | 535 |
ultimately show "inj_on ?f (\<Union>i \<in> I. A i) \<and> ?f ` (\<Union>i \<in> I. A i) \<subseteq> (SIGMA i : I. A i)" |
63612 | 536 |
by auto |
40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
537 |
qed |
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOL-image.
hoelzl
parents:
40702
diff
changeset
|
538 |
|
56608 | 539 |
lemma inv_unique_comp: |
540 |
assumes fg: "f \<circ> g = id" |
|
541 |
and gf: "g \<circ> f = id" |
|
542 |
shows "inv f = g" |
|
543 |
using fg gf inv_equality[of g f] by (auto simp add: fun_eq_iff) |
|
544 |
||
545 |
||
60758 | 546 |
subsection \<open>Other Consequences of Hilbert's Epsilon\<close> |
14760 | 547 |
|
60758 | 548 |
text \<open>Hilbert's Epsilon and the @{term split} Operator\<close> |
14760 | 549 |
|
63612 | 550 |
text \<open>Looping simprule!\<close> |
551 |
lemma split_paired_Eps: "(SOME x. P x) = (SOME (a, b). P (a, b))" |
|
26347 | 552 |
by simp |
14760 | 553 |
|
61424
c3658c18b7bc
prod_case as canonical name for product type eliminator
haftmann
parents:
61076
diff
changeset
|
554 |
lemma Eps_case_prod: "Eps (case_prod P) = (SOME xy. P (fst xy) (snd xy))" |
26347 | 555 |
by (simp add: split_def) |
14760 | 556 |
|
63612 | 557 |
lemma Eps_case_prod_eq [simp]: "(SOME (x', y'). x = x' \<and> y = y') = (x, y)" |
26347 | 558 |
by blast |
14760 | 559 |
|
560 |
||
63612 | 561 |
text \<open>A relation is wellfounded iff it has no infinite descending chain.\<close> |
63981 | 562 |
lemma wf_iff_no_infinite_down_chain: "wf r \<longleftrightarrow> (\<nexists>f. \<forall>i. (f (Suc i), f i) \<in> r)" |
563 |
(is "_ \<longleftrightarrow> \<not> ?ex") |
|
564 |
proof |
|
565 |
assume "wf r" |
|
566 |
show "\<not> ?ex" |
|
567 |
proof |
|
568 |
assume ?ex |
|
569 |
then obtain f where f: "(f (Suc i), f i) \<in> r" for i |
|
570 |
by blast |
|
571 |
from \<open>wf r\<close> have minimal: "x \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q" for x Q |
|
572 |
by (auto simp: wf_eq_minimal) |
|
573 |
let ?Q = "{w. \<exists>i. w = f i}" |
|
574 |
fix n |
|
575 |
have "f n \<in> ?Q" by blast |
|
576 |
from minimal [OF this] obtain j where "(y, f j) \<in> r \<Longrightarrow> y \<notin> ?Q" for y by blast |
|
577 |
with this [OF \<open>(f (Suc j), f j) \<in> r\<close>] have "f (Suc j) \<notin> ?Q" by simp |
|
578 |
then show False by blast |
|
579 |
qed |
|
580 |
next |
|
581 |
assume "\<not> ?ex" |
|
582 |
then show "wf r" |
|
583 |
proof (rule contrapos_np) |
|
584 |
assume "\<not> wf r" |
|
585 |
then obtain Q x where x: "x \<in> Q" and rec: "z \<in> Q \<Longrightarrow> \<exists>y. (y, z) \<in> r \<and> y \<in> Q" for z |
|
586 |
by (auto simp add: wf_eq_minimal) |
|
587 |
obtain descend :: "nat \<Rightarrow> 'a" |
|
588 |
where descend_0: "descend 0 = x" |
|
589 |
and descend_Suc: "descend (Suc n) = (SOME y. y \<in> Q \<and> (y, descend n) \<in> r)" for n |
|
590 |
by (rule that [of "rec_nat x (\<lambda>_ rec. (SOME y. y \<in> Q \<and> (y, rec) \<in> r))"]) simp_all |
|
591 |
have descend_Q: "descend n \<in> Q" for n |
|
592 |
proof (induct n) |
|
593 |
case 0 |
|
594 |
with x show ?case by (simp only: descend_0) |
|
595 |
next |
|
596 |
case Suc |
|
597 |
then show ?case by (simp only: descend_Suc) (rule someI2_ex; use rec in blast) |
|
598 |
qed |
|
599 |
have "(descend (Suc i), descend i) \<in> r" for i |
|
600 |
by (simp only: descend_Suc) (rule someI2_ex; use descend_Q rec in blast) |
|
601 |
then show "\<exists>f. \<forall>i. (f (Suc i), f i) \<in> r" by blast |
|
602 |
qed |
|
603 |
qed |
|
14760 | 604 |
|
27760 | 605 |
lemma wf_no_infinite_down_chainE: |
63612 | 606 |
assumes "wf r" |
607 |
obtains k where "(f (Suc k), f k) \<notin> r" |
|
608 |
using assms wf_iff_no_infinite_down_chain[of r] by blast |
|
27760 | 609 |
|
610 |
||
63612 | 611 |
text \<open>A dynamically-scoped fact for TFL\<close> |
612 |
lemma tfl_some: "\<forall>P x. P x \<longrightarrow> P (Eps P)" |
|
12298 | 613 |
by (blast intro: someI) |
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
614 |
|
12298 | 615 |
|
60758 | 616 |
subsection \<open>An aside: bounded accessible part\<close> |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
617 |
|
60758 | 618 |
text \<open>Finite monotone eventually stable sequences\<close> |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
619 |
|
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
620 |
lemma finite_mono_remains_stable_implies_strict_prefix: |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
621 |
fixes f :: "nat \<Rightarrow> 'a::order" |
63612 | 622 |
assumes S: "finite (range f)" "mono f" |
623 |
and eq: "\<forall>n. f n = f (Suc n) \<longrightarrow> f (Suc n) = f (Suc (Suc n))" |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
624 |
shows "\<exists>N. (\<forall>n\<le>N. \<forall>m\<le>N. m < n \<longrightarrow> f m < f n) \<and> (\<forall>n\<ge>N. f N = f n)" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
625 |
using assms |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
626 |
proof - |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
627 |
have "\<exists>n. f n = f (Suc n)" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
628 |
proof (rule ccontr) |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
629 |
assume "\<not> ?thesis" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
630 |
then have "\<And>n. f n \<noteq> f (Suc n)" by auto |
63612 | 631 |
with \<open>mono f\<close> have "\<And>n. f n < f (Suc n)" |
632 |
by (auto simp: le_less mono_iff_le_Suc) |
|
633 |
with lift_Suc_mono_less_iff[of f] have *: "\<And>n m. n < m \<Longrightarrow> f n < f m" |
|
634 |
by auto |
|
55811 | 635 |
have "inj f" |
636 |
proof (intro injI) |
|
637 |
fix x y |
|
638 |
assume "f x = f y" |
|
63612 | 639 |
then show "x = y" |
640 |
by (cases x y rule: linorder_cases) (auto dest: *) |
|
55811 | 641 |
qed |
60758 | 642 |
with \<open>finite (range f)\<close> have "finite (UNIV::nat set)" |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
643 |
by (rule finite_imageD) |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
644 |
then show False by simp |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
645 |
qed |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
646 |
then obtain n where n: "f n = f (Suc n)" .. |
63040 | 647 |
define N where "N = (LEAST n. f n = f (Suc n))" |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
648 |
have N: "f N = f (Suc N)" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
649 |
unfolding N_def using n by (rule LeastI) |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
650 |
show ?thesis |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
651 |
proof (intro exI[of _ N] conjI allI impI) |
63612 | 652 |
fix n |
653 |
assume "N \<le> n" |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
654 |
then have "\<And>m. N \<le> m \<Longrightarrow> m \<le> n \<Longrightarrow> f m = f N" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
655 |
proof (induct rule: dec_induct) |
63612 | 656 |
case base |
657 |
then show ?case by simp |
|
658 |
next |
|
659 |
case (step n) |
|
660 |
then show ?case |
|
661 |
using eq [rule_format, of "n - 1"] N |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
662 |
by (cases n) (auto simp add: le_Suc_eq) |
63612 | 663 |
qed |
60758 | 664 |
from this[of n] \<open>N \<le> n\<close> show "f N = f n" by auto |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
665 |
next |
63612 | 666 |
fix n m :: nat |
667 |
assume "m < n" "n \<le> N" |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
668 |
then show "f m < f n" |
62683 | 669 |
proof (induct rule: less_Suc_induct) |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
670 |
case (1 i) |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
671 |
then have "i < N" by simp |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
672 |
then have "f i \<noteq> f (Suc i)" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
673 |
unfolding N_def by (rule not_less_Least) |
60758 | 674 |
with \<open>mono f\<close> show ?case by (simp add: mono_iff_le_Suc less_le) |
63612 | 675 |
next |
676 |
case 2 |
|
677 |
then show ?case by simp |
|
678 |
qed |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
679 |
qed |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
680 |
qed |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
681 |
|
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
682 |
lemma finite_mono_strict_prefix_implies_finite_fixpoint: |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
683 |
fixes f :: "nat \<Rightarrow> 'a set" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
684 |
assumes S: "\<And>i. f i \<subseteq> S" "finite S" |
63612 | 685 |
and ex: "\<exists>N. (\<forall>n\<le>N. \<forall>m\<le>N. m < n \<longrightarrow> f m \<subset> f n) \<and> (\<forall>n\<ge>N. f N = f n)" |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
686 |
shows "f (card S) = (\<Union>n. f n)" |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
687 |
proof - |
63612 | 688 |
from ex obtain N where inj: "\<And>n m. n \<le> N \<Longrightarrow> m \<le> N \<Longrightarrow> m < n \<Longrightarrow> f m \<subset> f n" |
689 |
and eq: "\<forall>n\<ge>N. f N = f n" |
|
690 |
by atomize auto |
|
691 |
have "i \<le> N \<Longrightarrow> i \<le> card (f i)" for i |
|
692 |
proof (induct i) |
|
693 |
case 0 |
|
694 |
then show ?case by simp |
|
695 |
next |
|
696 |
case (Suc i) |
|
697 |
with inj [of "Suc i" i] have "(f i) \<subset> (f (Suc i))" by auto |
|
698 |
moreover have "finite (f (Suc i))" using S by (rule finite_subset) |
|
699 |
ultimately have "card (f i) < card (f (Suc i))" by (intro psubset_card_mono) |
|
700 |
with Suc inj show ?case by auto |
|
701 |
qed |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
702 |
then have "N \<le> card (f N)" by simp |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
703 |
also have "\<dots> \<le> card S" using S by (intro card_mono) |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
704 |
finally have "f (card S) = f N" using eq by auto |
63612 | 705 |
then show ?thesis |
706 |
using eq inj [of N] |
|
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
707 |
apply auto |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
708 |
apply (case_tac "n < N") |
63612 | 709 |
apply (auto simp: not_less) |
49948
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
710 |
done |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
711 |
qed |
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
712 |
|
744934b818c7
moved quite generic material from theory Enum to more appropriate places
haftmann
parents:
49739
diff
changeset
|
713 |
|
60758 | 714 |
subsection \<open>More on injections, bijections, and inverses\<close> |
55020 | 715 |
|
63374 | 716 |
locale bijection = |
717 |
fixes f :: "'a \<Rightarrow> 'a" |
|
718 |
assumes bij: "bij f" |
|
719 |
begin |
|
720 |
||
63612 | 721 |
lemma bij_inv: "bij (inv f)" |
63374 | 722 |
using bij by (rule bij_imp_bij_inv) |
723 |
||
63612 | 724 |
lemma surj [simp]: "surj f" |
63374 | 725 |
using bij by (rule bij_is_surj) |
726 |
||
63612 | 727 |
lemma inj: "inj f" |
63374 | 728 |
using bij by (rule bij_is_inj) |
729 |
||
63612 | 730 |
lemma surj_inv [simp]: "surj (inv f)" |
63374 | 731 |
using inj by (rule inj_imp_surj_inv) |
732 |
||
63612 | 733 |
lemma inj_inv: "inj (inv f)" |
63374 | 734 |
using surj by (rule surj_imp_inj_inv) |
735 |
||
63612 | 736 |
lemma eqI: "f a = f b \<Longrightarrow> a = b" |
63374 | 737 |
using inj by (rule injD) |
738 |
||
63612 | 739 |
lemma eq_iff [simp]: "f a = f b \<longleftrightarrow> a = b" |
63374 | 740 |
by (auto intro: eqI) |
741 |
||
63612 | 742 |
lemma eq_invI: "inv f a = inv f b \<Longrightarrow> a = b" |
63374 | 743 |
using inj_inv by (rule injD) |
744 |
||
63612 | 745 |
lemma eq_inv_iff [simp]: "inv f a = inv f b \<longleftrightarrow> a = b" |
63374 | 746 |
by (auto intro: eq_invI) |
747 |
||
63612 | 748 |
lemma inv_left [simp]: "inv f (f a) = a" |
63374 | 749 |
using inj by (simp add: inv_f_eq) |
750 |
||
63612 | 751 |
lemma inv_comp_left [simp]: "inv f \<circ> f = id" |
63374 | 752 |
by (simp add: fun_eq_iff) |
753 |
||
63612 | 754 |
lemma inv_right [simp]: "f (inv f a) = a" |
63374 | 755 |
using surj by (simp add: surj_f_inv_f) |
756 |
||
63612 | 757 |
lemma inv_comp_right [simp]: "f \<circ> inv f = id" |
63374 | 758 |
by (simp add: fun_eq_iff) |
759 |
||
63612 | 760 |
lemma inv_left_eq_iff [simp]: "inv f a = b \<longleftrightarrow> f b = a" |
63374 | 761 |
by auto |
762 |
||
63612 | 763 |
lemma inv_right_eq_iff [simp]: "b = inv f a \<longleftrightarrow> f b = a" |
63374 | 764 |
by auto |
765 |
||
766 |
end |
|
767 |
||
55020 | 768 |
lemma infinite_imp_bij_betw: |
63612 | 769 |
assumes infinite: "\<not> finite A" |
770 |
shows "\<exists>h. bij_betw h A (A - {a})" |
|
771 |
proof (cases "a \<in> A") |
|
772 |
case False |
|
773 |
then have "A - {a} = A" by blast |
|
774 |
then show ?thesis |
|
775 |
using bij_betw_id[of A] by auto |
|
55020 | 776 |
next |
63612 | 777 |
case True |
778 |
with infinite have "\<not> finite (A - {a})" by auto |
|
779 |
with infinite_iff_countable_subset[of "A - {a}"] |
|
780 |
obtain f :: "nat \<Rightarrow> 'a" where 1: "inj f" and 2: "f ` UNIV \<subseteq> A - {a}" by blast |
|
781 |
define g where "g n = (if n = 0 then a else f (Suc n))" for n |
|
782 |
define A' where "A' = g ` UNIV" |
|
783 |
have *: "\<forall>y. f y \<noteq> a" using 2 by blast |
|
784 |
have 3: "inj_on g UNIV \<and> g ` UNIV \<subseteq> A \<and> a \<in> g ` UNIV" |
|
785 |
apply (auto simp add: True g_def [abs_def]) |
|
786 |
apply (unfold inj_on_def) |
|
787 |
apply (intro ballI impI) |
|
788 |
apply (case_tac "x = 0") |
|
789 |
apply (auto simp add: 2) |
|
790 |
proof - |
|
791 |
fix y |
|
792 |
assume "a = (if y = 0 then a else f (Suc y))" |
|
793 |
then show "y = 0" by (cases "y = 0") (use * in auto) |
|
55020 | 794 |
next |
795 |
fix x y |
|
796 |
assume "f (Suc x) = (if y = 0 then a else f (Suc y))" |
|
63612 | 797 |
with 1 * show "x = y" by (cases "y = 0") (auto simp: inj_on_def) |
55020 | 798 |
next |
63612 | 799 |
fix n |
800 |
from 2 show "f (Suc n) \<in> A" by blast |
|
55020 | 801 |
qed |
63612 | 802 |
then have 4: "bij_betw g UNIV A' \<and> a \<in> A' \<and> A' \<subseteq> A" |
803 |
using inj_on_imp_bij_betw[of g] by (auto simp: A'_def) |
|
804 |
then have 5: "bij_betw (inv g) A' UNIV" |
|
805 |
by (auto simp add: bij_betw_inv_into) |
|
806 |
from 3 obtain n where n: "g n = a" by auto |
|
807 |
have 6: "bij_betw g (UNIV - {n}) (A' - {a})" |
|
808 |
by (rule bij_betw_subset) (use 3 4 n in \<open>auto simp: image_set_diff A'_def\<close>) |
|
809 |
define v where "v m = (if m < n then m else Suc m)" for m |
|
55020 | 810 |
have 7: "bij_betw v UNIV (UNIV - {n})" |
63612 | 811 |
proof (unfold bij_betw_def inj_on_def, intro conjI, clarify) |
812 |
fix m1 m2 |
|
813 |
assume "v m1 = v m2" |
|
814 |
then show "m1 = m2" |
|
815 |
apply (cases "m1 < n") |
|
816 |
apply (cases "m2 < n") |
|
817 |
apply (auto simp: inj_on_def v_def [abs_def]) |
|
818 |
apply (cases "m2 < n") |
|
819 |
apply auto |
|
820 |
done |
|
55020 | 821 |
next |
822 |
show "v ` UNIV = UNIV - {n}" |
|
63612 | 823 |
proof (auto simp: v_def [abs_def]) |
824 |
fix m |
|
825 |
assume "m \<noteq> n" |
|
826 |
assume *: "m \<notin> Suc ` {m'. \<not> m' < n}" |
|
827 |
have False if "n \<le> m" |
|
828 |
proof - |
|
829 |
from \<open>m \<noteq> n\<close> that have **: "Suc n \<le> m" by auto |
|
830 |
from Suc_le_D [OF this] obtain m' where m': "m = Suc m'" .. |
|
831 |
with ** have "n \<le> m'" by auto |
|
832 |
with m' * show ?thesis by auto |
|
833 |
qed |
|
834 |
then show "m < n" by force |
|
55020 | 835 |
qed |
836 |
qed |
|
63612 | 837 |
define h' where "h' = g \<circ> v \<circ> (inv g)" |
838 |
with 5 6 7 have 8: "bij_betw h' A' (A' - {a})" |
|
839 |
by (auto simp add: bij_betw_trans) |
|
840 |
define h where "h b = (if b \<in> A' then h' b else b)" for b |
|
841 |
then have "\<forall>b \<in> A'. h b = h' b" by simp |
|
842 |
with 8 have "bij_betw h A' (A' - {a})" |
|
843 |
using bij_betw_cong[of A' h] by auto |
|
55020 | 844 |
moreover |
63612 | 845 |
have "\<forall>b \<in> A - A'. h b = b" by (auto simp: h_def) |
846 |
then have "bij_betw h (A - A') (A - A')" |
|
847 |
using bij_betw_cong[of "A - A'" h id] bij_betw_id[of "A - A'"] by auto |
|
55020 | 848 |
moreover |
63612 | 849 |
from 4 have "(A' \<inter> (A - A') = {} \<and> A' \<union> (A - A') = A) \<and> |
850 |
((A' - {a}) \<inter> (A - A') = {} \<and> (A' - {a}) \<union> (A - A') = A - {a})" |
|
851 |
by blast |
|
55020 | 852 |
ultimately have "bij_betw h A (A - {a})" |
63612 | 853 |
using bij_betw_combine[of h A' "A' - {a}" "A - A'" "A - A'"] by simp |
854 |
then show ?thesis by blast |
|
55020 | 855 |
qed |
856 |
||
857 |
lemma infinite_imp_bij_betw2: |
|
63612 | 858 |
assumes "\<not> finite A" |
859 |
shows "\<exists>h. bij_betw h A (A \<union> {a})" |
|
860 |
proof (cases "a \<in> A") |
|
861 |
case True |
|
862 |
then have "A \<union> {a} = A" by blast |
|
863 |
then show ?thesis using bij_betw_id[of A] by auto |
|
55020 | 864 |
next |
63612 | 865 |
case False |
55020 | 866 |
let ?A' = "A \<union> {a}" |
63612 | 867 |
from False have "A = ?A' - {a}" by blast |
868 |
moreover from assms have "\<not> finite ?A'" by auto |
|
55020 | 869 |
ultimately obtain f where "bij_betw f ?A' A" |
63612 | 870 |
using infinite_imp_bij_betw[of ?A' a] by auto |
871 |
then have "bij_betw (inv_into ?A' f) A ?A'" by (rule bij_betw_inv_into) |
|
872 |
then show ?thesis by auto |
|
55020 | 873 |
qed |
874 |
||
63612 | 875 |
lemma bij_betw_inv_into_left: "bij_betw f A A' \<Longrightarrow> a \<in> A \<Longrightarrow> inv_into A f (f a) = a" |
876 |
unfolding bij_betw_def by clarify (rule inv_into_f_f) |
|
55020 | 877 |
|
63612 | 878 |
lemma bij_betw_inv_into_right: "bij_betw f A A' \<Longrightarrow> a' \<in> A' \<Longrightarrow> f (inv_into A f a') = a'" |
879 |
unfolding bij_betw_def using f_inv_into_f by force |
|
55020 | 880 |
|
881 |
lemma bij_betw_inv_into_subset: |
|
63612 | 882 |
"bij_betw f A A' \<Longrightarrow> B \<subseteq> A \<Longrightarrow> f ` B = B' \<Longrightarrow> bij_betw (inv_into A f) B' B" |
883 |
by (auto simp: bij_betw_def intro: inj_on_inv_into) |
|
55020 | 884 |
|
885 |
||
60758 | 886 |
subsection \<open>Specification package -- Hilbertized version\<close> |
17893
aef5a6d11c2a
added lemma exE_some (from specification_package.ML);
wenzelm
parents:
17702
diff
changeset
|
887 |
|
63612 | 888 |
lemma exE_some: "Ex P \<Longrightarrow> c \<equiv> Eps P \<Longrightarrow> P c" |
17893
aef5a6d11c2a
added lemma exE_some (from specification_package.ML);
wenzelm
parents:
17702
diff
changeset
|
889 |
by (simp only: someI_ex) |
aef5a6d11c2a
added lemma exE_some (from specification_package.ML);
wenzelm
parents:
17702
diff
changeset
|
890 |
|
48891 | 891 |
ML_file "Tools/choice_specification.ML" |
14115 | 892 |
|
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
893 |
subsection \<open>Complete Distributive Lattices -- Properties depending on Hilbert Choice\<close> |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
894 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
895 |
context complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
896 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
897 |
lemma Sup_Inf: "Sup (Inf ` A) = Inf (Sup ` {f ` A | f . (\<forall> Y \<in> A . f Y \<in> Y)})" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
898 |
proof (rule antisym) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
899 |
show "SUPREMUM A Inf \<le> INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Sup" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
900 |
apply (rule Sup_least, rule INF_greatest) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
901 |
using Inf_lower2 Sup_upper by auto |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
902 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
903 |
show "INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Sup \<le> SUPREMUM A Inf" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
904 |
proof (simp add: Inf_Sup, rule SUP_least, simp, safe) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
905 |
fix f |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
906 |
assume "\<forall>Y. (\<exists>f. Y = f ` A \<and> (\<forall>Y\<in>A. f Y \<in> Y)) \<longrightarrow> f Y \<in> Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
907 |
from this have B: "\<And> F . (\<forall> Y \<in> A . F Y \<in> Y) \<Longrightarrow> \<exists> Z \<in> A . f (F ` A) = F Z" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
908 |
by auto |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
909 |
show "INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> SUPREMUM A Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
910 |
proof (cases "\<exists> Z \<in> A . INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> Inf Z") |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
911 |
case True |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
912 |
from this obtain Z where [simp]: "Z \<in> A" and A: "INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> Inf Z" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
913 |
by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
914 |
have B: "... \<le> SUPREMUM A Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
915 |
by (simp add: SUP_upper) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
916 |
from A and B show ?thesis |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
917 |
by simp |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
918 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
919 |
case False |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
920 |
from this have X: "\<And> Z . Z \<in> A \<Longrightarrow> \<exists> x . x \<in> Z \<and> \<not> INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> x" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
921 |
using Inf_greatest by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
922 |
define F where "F = (\<lambda> Z . SOME x . x \<in> Z \<and> \<not> INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> x)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
923 |
have C: "\<And> Y . Y \<in> A \<Longrightarrow> F Y \<in> Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
924 |
using X by (simp add: F_def, rule someI2_ex, auto) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
925 |
have E: "\<And> Y . Y \<in> A \<Longrightarrow> \<not> INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> F Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
926 |
using X by (simp add: F_def, rule someI2_ex, auto) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
927 |
from C and B obtain Z where D: "Z \<in> A " and Y: "f (F ` A) = F Z" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
928 |
by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
929 |
from E and D have W: "\<not> INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> F Z" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
930 |
by simp |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
931 |
have "INFIMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} f \<le> f (F ` A)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
932 |
apply (rule INF_lower) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
933 |
using C by blast |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
934 |
from this and W and Y show ?thesis |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
935 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
936 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
937 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
938 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
939 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
940 |
lemma dual_complete_distrib_lattice: |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
941 |
"class.complete_distrib_lattice Sup Inf sup (\<ge>) (>) inf \<top> \<bottom>" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
942 |
apply (rule class.complete_distrib_lattice.intro) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
943 |
apply (fact dual_complete_lattice) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
944 |
by (simp add: class.complete_distrib_lattice_axioms_def Sup_Inf) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
945 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
946 |
lemma sup_Inf: "a \<squnion> Inf B = (INF b:B. a \<squnion> b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
947 |
proof (rule antisym) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
948 |
show "a \<squnion> Inf B \<le> (INF b:B. a \<squnion> b)" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
949 |
apply (rule INF_greatest) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
950 |
using Inf_lower sup.mono by fastforce |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
951 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
952 |
have "(INF b:B. a \<squnion> b) \<le> INFIMUM {{f {a}, f B} |f. f {a} = a \<and> f B \<in> B} Sup" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
953 |
by (rule INF_greatest, auto simp add: INF_lower) |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
954 |
also have "... = SUPREMUM {{a}, B} Inf" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
955 |
by (unfold Sup_Inf, simp) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
956 |
finally show "(INF b:B. a \<squnion> b) \<le> a \<squnion> Inf B" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
957 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
958 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
959 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
960 |
lemma inf_Sup: "a \<sqinter> Sup B = (SUP b:B. a \<sqinter> b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
961 |
using dual_complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
962 |
by (rule complete_distrib_lattice.sup_Inf) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
963 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
964 |
lemma INF_SUP: "(INF y. SUP x. ((P x y)::'a)) = (SUP x. INF y. P (x y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
965 |
proof (rule antisym) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
966 |
show "(SUP x. INF y. P (x y) y) \<le> (INF y. SUP x. P x y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
967 |
by (rule SUP_least, rule INF_greatest, rule SUP_upper2, simp_all, rule INF_lower2, simp, blast) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
968 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
969 |
have "(INF y. SUP x. ((P x y))) \<le> Inf (Sup ` {{P x y | x . True} | y . True })" (is "?A \<le> ?B") |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
970 |
proof (rule INF_greatest, clarsimp) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
971 |
fix y |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
972 |
have "?A \<le> (SUP x. P x y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
973 |
by (rule INF_lower, simp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
974 |
also have "... \<le> Sup {uu. \<exists>x. uu = P x y}" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
975 |
by (simp add: full_SetCompr_eq) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
976 |
finally show "?A \<le> Sup {uu. \<exists>x. uu = P x y}" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
977 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
978 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
979 |
also have "... \<le> (SUP x. INF y. P (x y) y)" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
980 |
proof (subst Inf_Sup, rule SUP_least, clarsimp) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
981 |
fix f |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
982 |
assume A: "\<forall>Y. (\<exists>y. Y = {uu. \<exists>x. uu = P x y}) \<longrightarrow> f Y \<in> Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
983 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
984 |
have "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> (INF y. P ((\<lambda> y. SOME x . f ({P x y | x. True}) = P x y) y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
985 |
proof (rule INF_greatest, clarsimp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
986 |
fix y |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
987 |
have "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> f {uu. \<exists>x. uu = P x y}" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
988 |
by (rule INF_lower, blast) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
989 |
also have "... \<le> P (SOME x. f {uu . \<exists>x. uu = P x y} = P x y) y" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
990 |
apply (rule someI2_ex) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
991 |
using A by auto |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
992 |
finally show "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> P (SOME x. f {uu . \<exists>x. uu = P x y} = P x y) y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
993 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
994 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
995 |
also have "... \<le> (SUP x. INF y. P (x y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
996 |
by (rule SUP_upper, simp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
997 |
finally show "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> (SUP x. INF y. P (x y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
998 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
999 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1000 |
finally show "(INF y. SUP x. P x y) \<le> (SUP x. INF y. P (x y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1001 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1002 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1003 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1004 |
lemma INF_SUP_set: "(INF x:A. SUP a:x. (g a)) = (SUP x:{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. INF a:x. g a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1005 |
proof (rule antisym) |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1006 |
have [simp]: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> (\<Sqinter>x\<in>A. g (f x)) \<le> g (f xa)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1007 |
by (rule INF_lower2, blast+) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1008 |
have B: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> f xa \<in> xa" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1009 |
by blast |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1010 |
have A: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> (\<Sqinter>x\<in>A. g (f x)) \<le> SUPREMUM xa g" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1011 |
by (rule SUP_upper2, rule B, simp_all, simp) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1012 |
show "(\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>a\<in>x. g a) \<le> (\<Sqinter>x\<in>A. \<Squnion>a\<in>x. g a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1013 |
apply (rule SUP_least, simp, safe, rule INF_greatest, simp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1014 |
by (rule A) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1015 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1016 |
show "(\<Sqinter>x\<in>A. \<Squnion>a\<in>x. g a) \<le> (\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>a\<in>x. g a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1017 |
proof (cases "{} \<in> A") |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1018 |
case True |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1019 |
then show ?thesis |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1020 |
by (rule INF_lower2, simp_all) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1021 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1022 |
case False |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1023 |
have [simp]: "\<And>x xa xb. xb \<in> A \<Longrightarrow> x xb \<in> xb \<Longrightarrow> (\<Sqinter>xa. if xa \<in> A then if x xa \<in> xa then g (x xa) else \<bottom> else \<top>) \<le> g (x xb)" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1024 |
by (rule INF_lower2, auto) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1025 |
have [simp]: " \<And>x xa y. y \<in> A \<Longrightarrow> x y \<notin> y \<Longrightarrow> (\<Sqinter>xa. if xa \<in> A then if x xa \<in> xa then g (x xa) else \<bottom> else \<top>) \<le> g (SOME x. x \<in> y)" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1026 |
by (rule INF_lower2, auto) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1027 |
have [simp]: "\<And>x. (\<Sqinter>xa. if xa \<in> A then if x xa \<in> xa then g (x xa) else \<bottom> else \<top>) \<le> (\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>x\<in>x. g x)" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1028 |
proof - |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1029 |
fix x |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1030 |
define F where "F = (\<lambda> (y::'b set) . if x y \<in> y then x y else (SOME x . x \<in>y))" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1031 |
have B: "(\<forall>Y\<in>A. F Y \<in> Y)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1032 |
using False some_in_eq F_def by auto |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1033 |
have A: "F ` A \<in> {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1034 |
using B by blast |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1035 |
show "(\<Sqinter>xa. if xa \<in> A then if x xa \<in> xa then g (x xa) else \<bottom> else \<top>) \<le> (\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>x\<in>x. g x)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1036 |
using A apply (rule SUP_upper2) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1037 |
by (simp add: F_def, rule INF_greatest, auto) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1038 |
qed |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1039 |
|
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1040 |
{fix x |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1041 |
have "(\<Sqinter>x\<in>A. \<Squnion>x\<in>x. g x) \<le> (\<Squnion>xa. if x \<in> A then if xa \<in> x then g xa else \<bottom> else \<top>)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1042 |
proof (cases "x \<in> A") |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1043 |
case True |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1044 |
then show ?thesis |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1045 |
apply (rule INF_lower2, simp_all) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1046 |
by (rule SUP_least, rule SUP_upper2, auto) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1047 |
next |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1048 |
case False |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1049 |
then show ?thesis by simp |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1050 |
qed |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1051 |
} |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1052 |
from this have "(\<Sqinter>x\<in>A. \<Squnion>a\<in>x. g a) \<le> (\<Sqinter>x. \<Squnion>xa. if x \<in> A then if xa \<in> x then g xa else \<bottom> else \<top>)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1053 |
by (rule INF_greatest) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1054 |
also have "... = (\<Squnion>x. \<Sqinter>xa. if xa \<in> A then if x xa \<in> xa then g (x xa) else \<bottom> else \<top>)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1055 |
by (simp add: INF_SUP) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1056 |
also have "... \<le> (\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>a\<in>x. g a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1057 |
by (rule SUP_least, simp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1058 |
finally show ?thesis by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1059 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1060 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1061 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1062 |
lemma SUP_INF: "(SUP y. INF x. ((P x y)::'a)) = (INF x. SUP y. P (x y) y)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1063 |
using dual_complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1064 |
by (rule complete_distrib_lattice.INF_SUP) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1065 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1066 |
lemma SUP_INF_set: "(SUP x:A. INF a:x. (g a)) = (INF x:{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. SUP a:x. g a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1067 |
using dual_complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1068 |
by (rule complete_distrib_lattice.INF_SUP_set) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1069 |
|
11451
8abfb4f7bd02
partial restructuring to reduce dependence on Axiom of Choice
paulson
parents:
diff
changeset
|
1070 |
end |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1071 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1072 |
(*properties of the former complete_distrib_lattice*) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1073 |
context complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1074 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1075 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1076 |
lemma sup_INF: "a \<squnion> (\<Sqinter>b\<in>B. f b) = (\<Sqinter>b\<in>B. a \<squnion> f b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1077 |
by (simp add: sup_Inf) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1078 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1079 |
lemma inf_SUP: "a \<sqinter> (\<Squnion>b\<in>B. f b) = (\<Squnion>b\<in>B. a \<sqinter> f b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1080 |
by (simp add: inf_Sup) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1081 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1082 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1083 |
lemma Inf_sup: "\<Sqinter>B \<squnion> a = (\<Sqinter>b\<in>B. b \<squnion> a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1084 |
by (simp add: sup_Inf sup_commute) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1085 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1086 |
lemma Sup_inf: "\<Squnion>B \<sqinter> a = (\<Squnion>b\<in>B. b \<sqinter> a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1087 |
by (simp add: inf_Sup inf_commute) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1088 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1089 |
lemma INF_sup: "(\<Sqinter>b\<in>B. f b) \<squnion> a = (\<Sqinter>b\<in>B. f b \<squnion> a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1090 |
by (simp add: sup_INF sup_commute) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1091 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1092 |
lemma SUP_inf: "(\<Squnion>b\<in>B. f b) \<sqinter> a = (\<Squnion>b\<in>B. f b \<sqinter> a)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1093 |
by (simp add: inf_SUP inf_commute) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1094 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1095 |
lemma Inf_sup_eq_top_iff: "(\<Sqinter>B \<squnion> a = \<top>) \<longleftrightarrow> (\<forall>b\<in>B. b \<squnion> a = \<top>)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1096 |
by (simp only: Inf_sup INF_top_conv) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1097 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1098 |
lemma Sup_inf_eq_bot_iff: "(\<Squnion>B \<sqinter> a = \<bottom>) \<longleftrightarrow> (\<forall>b\<in>B. b \<sqinter> a = \<bottom>)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1099 |
by (simp only: Sup_inf SUP_bot_conv) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1100 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1101 |
lemma INF_sup_distrib2: "(\<Sqinter>a\<in>A. f a) \<squnion> (\<Sqinter>b\<in>B. g b) = (\<Sqinter>a\<in>A. \<Sqinter>b\<in>B. f a \<squnion> g b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1102 |
by (subst INF_commute) (simp add: sup_INF INF_sup) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1103 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1104 |
lemma SUP_inf_distrib2: "(\<Squnion>a\<in>A. f a) \<sqinter> (\<Squnion>b\<in>B. g b) = (\<Squnion>a\<in>A. \<Squnion>b\<in>B. f a \<sqinter> g b)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1105 |
by (subst SUP_commute) (simp add: inf_SUP SUP_inf) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1106 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1107 |
end |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1108 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1109 |
context complete_boolean_algebra |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1110 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1111 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1112 |
lemma dual_complete_boolean_algebra: |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1113 |
"class.complete_boolean_algebra Sup Inf sup (\<ge>) (>) inf \<top> \<bottom> (\<lambda>x y. x \<squnion> - y) uminus" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1114 |
by (rule class.complete_boolean_algebra.intro, |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1115 |
rule dual_complete_distrib_lattice, |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1116 |
rule dual_boolean_algebra) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1117 |
end |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1118 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1119 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1120 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1121 |
instantiation "set" :: (type) complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1122 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1123 |
instance proof (standard, clarsimp) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1124 |
fix A :: "(('a set) set) set" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1125 |
fix x::'a |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1126 |
define F where "F = (\<lambda> Y . (SOME X . (Y \<in> A \<and> X \<in> Y \<and> x \<in> X)))" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1127 |
assume A: "\<forall>xa\<in>A. \<exists>X\<in>xa. x \<in> X" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1128 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1129 |
from this have B: " (\<forall>xa \<in> F ` A. x \<in> xa)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1130 |
apply (safe, simp add: F_def) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1131 |
by (rule someI2_ex, auto) |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1132 |
|
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1133 |
have C: "(\<forall>Y\<in>A. F Y \<in> Y)" |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1134 |
apply (simp add: F_def, safe) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1135 |
apply (rule someI2_ex) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1136 |
using A by auto |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1137 |
|
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1138 |
have "(\<exists>f. F ` A = f ` A \<and> (\<forall>Y\<in>A. f Y \<in> Y))" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1139 |
using C by blast |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1140 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1141 |
from B and this show "\<exists>X. (\<exists>f. X = f ` A \<and> (\<forall>Y\<in>A. f Y \<in> Y)) \<and> (\<forall>xa\<in>X. x \<in> xa)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1142 |
by auto |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1143 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1144 |
end |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1145 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1146 |
instance "set" :: (type) complete_boolean_algebra .. |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1147 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1148 |
instantiation "fun" :: (type, complete_distrib_lattice) complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1149 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1150 |
instance by standard (simp add: le_fun_def INF_SUP_set) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1151 |
end |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1152 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1153 |
instance "fun" :: (type, complete_boolean_algebra) complete_boolean_algebra .. |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1154 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1155 |
context complete_linorder |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1156 |
begin |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1157 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1158 |
subclass complete_distrib_lattice |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1159 |
proof (standard, rule ccontr) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1160 |
fix A |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1161 |
assume "\<not> INFIMUM A Sup \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1162 |
from this have C: "INFIMUM A Sup > SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1163 |
using local.not_le by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1164 |
show "False" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1165 |
proof (cases "\<exists> z . INFIMUM A Sup > z \<and> z > SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf") |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1166 |
case True |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1167 |
from this obtain z where A: "z < INFIMUM A Sup" and X: "SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf < z" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1168 |
by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1169 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1170 |
from A have "\<And> Y . Y \<in> A \<Longrightarrow> z < Sup Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1171 |
by (simp add: less_INF_D) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1172 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1173 |
from this have B: "\<And> Y . Y \<in> A \<Longrightarrow> \<exists> k \<in>Y . z < k" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1174 |
using local.less_Sup_iff by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1175 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1176 |
define F where "F = (\<lambda> Y . SOME k . k \<in> Y \<and> z < k)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1177 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1178 |
have D: "\<And> Y . Y \<in> A \<Longrightarrow> z < F Y" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1179 |
using B apply (simp add: F_def) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1180 |
by (rule someI2_ex, auto) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1181 |
|
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1182 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1183 |
have E: "\<And> Y . Y \<in> A \<Longrightarrow> F Y \<in> Y" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1184 |
using B apply (simp add: F_def) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1185 |
by (rule someI2_ex, auto) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1186 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1187 |
have "z \<le> Inf (F ` A)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1188 |
by (simp add: D local.INF_greatest local.order.strict_implies_order) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1189 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1190 |
also have "... \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1191 |
apply (rule SUP_upper, safe) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1192 |
using E by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1193 |
finally have "z \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1194 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1195 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1196 |
from X and this show ?thesis |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1197 |
using local.not_less by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1198 |
next |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1199 |
case False |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1200 |
from this have A: "\<And> z . INFIMUM A Sup \<le> z \<or> z \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1201 |
using local.le_less_linear by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1202 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1203 |
from C have "\<And> Y . Y \<in> A \<Longrightarrow> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf < Sup Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1204 |
by (simp add: less_INF_D) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1205 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1206 |
from this have B: "\<And> Y . Y \<in> A \<Longrightarrow> \<exists> k \<in>Y . SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf < k" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1207 |
using local.less_Sup_iff by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1208 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1209 |
define F where "F = (\<lambda> Y . SOME k . k \<in> Y \<and> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf < k)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1210 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1211 |
have D: "\<And> Y . Y \<in> A \<Longrightarrow> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf < F Y" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1212 |
using B apply (simp add: F_def) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1213 |
by (rule someI2_ex, auto) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1214 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1215 |
have E: "\<And> Y . Y \<in> A \<Longrightarrow> F Y \<in> Y" |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1216 |
using B apply (simp add: F_def) |
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1217 |
by (rule someI2_ex, auto) |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1218 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1219 |
have "\<And> Y . Y \<in> A \<Longrightarrow> INFIMUM A Sup \<le> F Y" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1220 |
using D False local.leI by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1221 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1222 |
from this have "INFIMUM A Sup \<le> Inf (F ` A)" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1223 |
by (simp add: local.INF_greatest) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1224 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1225 |
also have "Inf (F ` A) \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1226 |
apply (rule SUP_upper, safe) |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1227 |
using E by blast |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1228 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1229 |
finally have "INFIMUM A Sup \<le> SUPREMUM {f ` A |f. \<forall>Y\<in>A. f Y \<in> Y} Inf" |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1230 |
by simp |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1231 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1232 |
from C and this show ?thesis |
67951
655aa11359dc
Removed some uses of deprecated _tac methods. (Patch from Viorel Preoteasa)
Manuel Eberl <eberlm@in.tum.de>
parents:
67829
diff
changeset
|
1233 |
using not_less by blast |
67829
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1234 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1235 |
qed |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1236 |
end |
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1237 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1238 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1239 |
|
2a6ef5ba4822
Changes to complete distributive lattices due to Viorel Preoteasa
Manuel Eberl <eberlm@in.tum.de>
parents:
67673
diff
changeset
|
1240 |
end |