13 by (induct X rule: finite_ne_induct) (simp_all add: sup_max) |
14 by (induct X rule: finite_ne_induct) (simp_all add: sup_max) |
14 |
15 |
15 lemma Inf_fin_eq_Min: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf_fin X = Min X" |
16 lemma Inf_fin_eq_Min: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf_fin X = Min X" |
16 by (induct X rule: finite_ne_induct) (simp_all add: inf_min) |
17 by (induct X rule: finite_ne_induct) (simp_all add: inf_min) |
17 |
18 |
|
19 context preorder |
|
20 begin |
|
21 |
|
22 definition "bdd_above A \<longleftrightarrow> (\<exists>M. \<forall>x \<in> A. x \<le> M)" |
|
23 definition "bdd_below A \<longleftrightarrow> (\<exists>m. \<forall>x \<in> A. m \<le> x)" |
|
24 |
|
25 lemma bdd_aboveI[intro]: "(\<And>x. x \<in> A \<Longrightarrow> x \<le> M) \<Longrightarrow> bdd_above A" |
|
26 by (auto simp: bdd_above_def) |
|
27 |
|
28 lemma bdd_belowI[intro]: "(\<And>x. x \<in> A \<Longrightarrow> m \<le> x) \<Longrightarrow> bdd_below A" |
|
29 by (auto simp: bdd_below_def) |
|
30 |
|
31 lemma bdd_above_empty [simp, intro]: "bdd_above {}" |
|
32 unfolding bdd_above_def by auto |
|
33 |
|
34 lemma bdd_below_empty [simp, intro]: "bdd_below {}" |
|
35 unfolding bdd_below_def by auto |
|
36 |
|
37 lemma bdd_above_mono: "bdd_above B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> bdd_above A" |
|
38 by (metis (full_types) bdd_above_def order_class.le_neq_trans psubsetD) |
|
39 |
|
40 lemma bdd_below_mono: "bdd_below B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> bdd_below A" |
|
41 by (metis bdd_below_def order_class.le_neq_trans psubsetD) |
|
42 |
|
43 lemma bdd_above_Int1 [simp]: "bdd_above A \<Longrightarrow> bdd_above (A \<inter> B)" |
|
44 using bdd_above_mono by auto |
|
45 |
|
46 lemma bdd_above_Int2 [simp]: "bdd_above B \<Longrightarrow> bdd_above (A \<inter> B)" |
|
47 using bdd_above_mono by auto |
|
48 |
|
49 lemma bdd_below_Int1 [simp]: "bdd_below A \<Longrightarrow> bdd_below (A \<inter> B)" |
|
50 using bdd_below_mono by auto |
|
51 |
|
52 lemma bdd_below_Int2 [simp]: "bdd_below B \<Longrightarrow> bdd_below (A \<inter> B)" |
|
53 using bdd_below_mono by auto |
|
54 |
|
55 lemma bdd_above_Ioo [simp, intro]: "bdd_above {a <..< b}" |
|
56 by (auto simp add: bdd_above_def intro!: exI[of _ b] less_imp_le) |
|
57 |
|
58 lemma bdd_above_Ico [simp, intro]: "bdd_above {a ..< b}" |
|
59 by (auto simp add: bdd_above_def intro!: exI[of _ b] less_imp_le) |
|
60 |
|
61 lemma bdd_above_Iio [simp, intro]: "bdd_above {..< b}" |
|
62 by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le) |
|
63 |
|
64 lemma bdd_above_Ioc [simp, intro]: "bdd_above {a <.. b}" |
|
65 by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le) |
|
66 |
|
67 lemma bdd_above_Icc [simp, intro]: "bdd_above {a .. b}" |
|
68 by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le) |
|
69 |
|
70 lemma bdd_above_Iic [simp, intro]: "bdd_above {.. b}" |
|
71 by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le) |
|
72 |
|
73 lemma bdd_below_Ioo [simp, intro]: "bdd_below {a <..< b}" |
|
74 by (auto simp add: bdd_below_def intro!: exI[of _ a] less_imp_le) |
|
75 |
|
76 lemma bdd_below_Ioc [simp, intro]: "bdd_below {a <.. b}" |
|
77 by (auto simp add: bdd_below_def intro!: exI[of _ a] less_imp_le) |
|
78 |
|
79 lemma bdd_below_Ioi [simp, intro]: "bdd_below {a <..}" |
|
80 by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le) |
|
81 |
|
82 lemma bdd_below_Ico [simp, intro]: "bdd_below {a ..< b}" |
|
83 by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le) |
|
84 |
|
85 lemma bdd_below_Icc [simp, intro]: "bdd_below {a .. b}" |
|
86 by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le) |
|
87 |
|
88 lemma bdd_below_Ici [simp, intro]: "bdd_below {a ..}" |
|
89 by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le) |
|
90 |
|
91 end |
|
92 |
|
93 context lattice |
|
94 begin |
|
95 |
|
96 lemma bdd_above_insert [simp]: "bdd_above (insert a A) = bdd_above A" |
|
97 by (auto simp: bdd_above_def intro: le_supI2 sup_ge1) |
|
98 |
|
99 lemma bdd_below_insert [simp]: "bdd_below (insert a A) = bdd_below A" |
|
100 by (auto simp: bdd_below_def intro: le_infI2 inf_le1) |
|
101 |
|
102 lemma bdd_finite [simp]: |
|
103 assumes "finite A" shows bdd_above_finite: "bdd_above A" and bdd_below_finite: "bdd_below A" |
|
104 using assms by (induct rule: finite_induct, auto) |
|
105 |
|
106 lemma bdd_above_Un [simp]: "bdd_above (A \<union> B) = (bdd_above A \<and> bdd_above B)" |
|
107 proof |
|
108 assume "bdd_above (A \<union> B)" |
|
109 thus "bdd_above A \<and> bdd_above B" unfolding bdd_above_def by auto |
|
110 next |
|
111 assume "bdd_above A \<and> bdd_above B" |
|
112 then obtain a b where "\<forall>x\<in>A. x \<le> a" "\<forall>x\<in>B. x \<le> b" unfolding bdd_above_def by auto |
|
113 hence "\<forall>x \<in> A \<union> B. x \<le> sup a b" by (auto intro: Un_iff le_supI1 le_supI2) |
|
114 thus "bdd_above (A \<union> B)" unfolding bdd_above_def .. |
|
115 qed |
|
116 |
|
117 lemma bdd_below_Un [simp]: "bdd_below (A \<union> B) = (bdd_below A \<and> bdd_below B)" |
|
118 proof |
|
119 assume "bdd_below (A \<union> B)" |
|
120 thus "bdd_below A \<and> bdd_below B" unfolding bdd_below_def by auto |
|
121 next |
|
122 assume "bdd_below A \<and> bdd_below B" |
|
123 then obtain a b where "\<forall>x\<in>A. a \<le> x" "\<forall>x\<in>B. b \<le> x" unfolding bdd_below_def by auto |
|
124 hence "\<forall>x \<in> A \<union> B. inf a b \<le> x" by (auto intro: Un_iff le_infI1 le_infI2) |
|
125 thus "bdd_below (A \<union> B)" unfolding bdd_below_def .. |
|
126 qed |
|
127 |
|
128 end |
|
129 |
|
130 |
18 text {* |
131 text {* |
19 |
132 |
20 To avoid name classes with the @{class complete_lattice}-class we prefix @{const Sup} and |
133 To avoid name classes with the @{class complete_lattice}-class we prefix @{const Sup} and |
21 @{const Inf} in theorem names with c. |
134 @{const Inf} in theorem names with c. |
22 |
135 |
23 *} |
136 *} |
24 |
137 |
25 class conditionally_complete_lattice = lattice + Sup + Inf + |
138 class conditionally_complete_lattice = lattice + Sup + Inf + |
26 assumes cInf_lower: "x \<in> X \<Longrightarrow> (\<And>a. a \<in> X \<Longrightarrow> z \<le> a) \<Longrightarrow> Inf X \<le> x" |
139 assumes cInf_lower: "x \<in> X \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X \<le> x" |
27 and cInf_greatest: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> z \<le> Inf X" |
140 and cInf_greatest: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> z \<le> Inf X" |
28 assumes cSup_upper: "x \<in> X \<Longrightarrow> (\<And>a. a \<in> X \<Longrightarrow> a \<le> z) \<Longrightarrow> x \<le> Sup X" |
141 assumes cSup_upper: "x \<in> X \<Longrightarrow> bdd_above X \<Longrightarrow> x \<le> Sup X" |
29 and cSup_least: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X \<le> z" |
142 and cSup_least: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X \<le> z" |
30 begin |
143 begin |
31 |
144 |
32 lemma cSup_eq_maximum: (*REAL_SUP_MAX in HOL4*) |
145 lemma cSup_eq_maximum: "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X = z" |
33 "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X = z" |
146 by (intro antisym cSup_upper[of z X] cSup_least[of X z]) auto |
34 by (blast intro: antisym cSup_upper cSup_least) |
147 |
35 |
148 lemma cInf_eq_minimum: "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf X = z" |
36 lemma cInf_eq_minimum: (*REAL_INF_MIN in HOL4*) |
149 by (intro antisym cInf_lower[of z X] cInf_greatest[of X z]) auto |
37 "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf X = z" |
150 |
38 by (intro antisym cInf_lower[of z X z] cInf_greatest[of X z]) auto |
151 lemma cSup_le_iff: "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> Sup S \<le> a \<longleftrightarrow> (\<forall>x\<in>S. x \<le> a)" |
39 |
|
40 lemma cSup_le_iff: "S \<noteq> {} \<Longrightarrow> (\<And>a. a \<in> S \<Longrightarrow> a \<le> z) \<Longrightarrow> Sup S \<le> a \<longleftrightarrow> (\<forall>x\<in>S. x \<le> a)" |
|
41 by (metis order_trans cSup_upper cSup_least) |
152 by (metis order_trans cSup_upper cSup_least) |
42 |
153 |
43 lemma le_cInf_iff: "S \<noteq> {} \<Longrightarrow> (\<And>a. a \<in> S \<Longrightarrow> z \<le> a) \<Longrightarrow> a \<le> Inf S \<longleftrightarrow> (\<forall>x\<in>S. a \<le> x)" |
154 lemma le_cInf_iff: "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> a \<le> Inf S \<longleftrightarrow> (\<forall>x\<in>S. a \<le> x)" |
44 by (metis order_trans cInf_lower cInf_greatest) |
155 by (metis order_trans cInf_lower cInf_greatest) |
45 |
156 |
46 lemma cSup_singleton [simp]: "Sup {x} = x" |
157 lemma cSup_singleton [simp]: "Sup {x} = x" |
47 by (intro cSup_eq_maximum) auto |
158 by (intro cSup_eq_maximum) auto |
48 |
159 |
49 lemma cInf_singleton [simp]: "Inf {x} = x" |
160 lemma cInf_singleton [simp]: "Inf {x} = x" |
50 by (intro cInf_eq_minimum) auto |
161 by (intro cInf_eq_minimum) auto |
51 |
162 |
52 lemma cSup_upper2: (*REAL_IMP_LE_SUP in HOL4*) |
163 lemma cSup_upper2: "x \<in> X \<Longrightarrow> y \<le> x \<Longrightarrow> bdd_above X \<Longrightarrow> y \<le> Sup X" |
53 "x \<in> X \<Longrightarrow> y \<le> x \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> y \<le> Sup X" |
|
54 by (metis cSup_upper order_trans) |
164 by (metis cSup_upper order_trans) |
55 |
165 |
56 lemma cInf_lower2: |
166 lemma cInf_lower2: "x \<in> X \<Longrightarrow> x \<le> y \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X \<le> y" |
57 "x \<in> X \<Longrightarrow> x \<le> y \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf X \<le> y" |
|
58 by (metis cInf_lower order_trans) |
167 by (metis cInf_lower order_trans) |
59 |
|
60 lemma cSup_upper_EX: "x \<in> X \<Longrightarrow> \<exists>z. \<forall>x. x \<in> X \<longrightarrow> x \<le> z \<Longrightarrow> x \<le> Sup X" |
|
61 by (blast intro: cSup_upper) |
|
62 |
|
63 lemma cInf_lower_EX: "x \<in> X \<Longrightarrow> \<exists>z. \<forall>x. x \<in> X \<longrightarrow> z \<le> x \<Longrightarrow> Inf X \<le> x" |
|
64 by (blast intro: cInf_lower) |
|
65 |
168 |
66 lemma cSup_eq_non_empty: |
169 lemma cSup_eq_non_empty: |
67 assumes 1: "X \<noteq> {}" |
170 assumes 1: "X \<noteq> {}" |
68 assumes 2: "\<And>x. x \<in> X \<Longrightarrow> x \<le> a" |
171 assumes 2: "\<And>x. x \<in> X \<Longrightarrow> x \<le> a" |
69 assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> x \<le> y) \<Longrightarrow> a \<le> y" |
172 assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> x \<le> y) \<Longrightarrow> a \<le> y" |
75 assumes 2: "\<And>x. x \<in> X \<Longrightarrow> a \<le> x" |
178 assumes 2: "\<And>x. x \<in> X \<Longrightarrow> a \<le> x" |
76 assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> y \<le> x) \<Longrightarrow> y \<le> a" |
179 assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> y \<le> x) \<Longrightarrow> y \<le> a" |
77 shows "Inf X = a" |
180 shows "Inf X = a" |
78 by (intro 3 1 antisym cInf_greatest) (auto intro: 2 1 cInf_lower) |
181 by (intro 3 1 antisym cInf_greatest) (auto intro: 2 1 cInf_lower) |
79 |
182 |
80 lemma cInf_cSup: "S \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> S \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf S = Sup {x. \<forall>s\<in>S. x \<le> s}" |
183 lemma cInf_cSup: "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> Inf S = Sup {x. \<forall>s\<in>S. x \<le> s}" |
81 by (rule cInf_eq_non_empty) (auto intro: cSup_upper cSup_least) |
184 by (rule cInf_eq_non_empty) (auto intro!: cSup_upper cSup_least simp: bdd_below_def) |
82 |
185 |
83 lemma cSup_cInf: "S \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> S \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup S = Inf {x. \<forall>s\<in>S. s \<le> x}" |
186 lemma cSup_cInf: "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> Sup S = Inf {x. \<forall>s\<in>S. s \<le> x}" |
84 by (rule cSup_eq_non_empty) (auto intro: cInf_lower cInf_greatest) |
187 by (rule cSup_eq_non_empty) (auto intro!: cInf_lower cInf_greatest simp: bdd_above_def) |
85 |
188 |
86 lemma cSup_insert: |
189 lemma cSup_insert: "X \<noteq> {} \<Longrightarrow> bdd_above X \<Longrightarrow> Sup (insert a X) = sup a (Sup X)" |
87 assumes x: "X \<noteq> {}" |
190 by (intro cSup_eq_non_empty) (auto intro: le_supI2 cSup_upper cSup_least) |
88 and z: "\<And>x. x \<in> X \<Longrightarrow> x \<le> z" |
191 |
89 shows "Sup (insert a X) = sup a (Sup X)" |
192 lemma cInf_insert: "X \<noteq> {} \<Longrightarrow> bdd_below X \<Longrightarrow> Inf (insert a X) = inf a (Inf X)" |
90 proof (intro cSup_eq_non_empty) |
193 by (intro cInf_eq_non_empty) (auto intro: le_infI2 cInf_lower cInf_greatest) |
91 fix y assume "\<And>x. x \<in> insert a X \<Longrightarrow> x \<le> y" with x show "sup a (Sup X) \<le> y" by (auto intro: cSup_least) |
194 |
92 qed (auto intro: le_supI2 z cSup_upper) |
195 lemma cSup_insert_If: "bdd_above X \<Longrightarrow> Sup (insert a X) = (if X = {} then a else sup a (Sup X))" |
93 |
196 using cSup_insert[of X] by simp |
94 lemma cInf_insert: |
197 |
95 assumes x: "X \<noteq> {}" |
198 lemma cInf_insert_if: "bdd_below X \<Longrightarrow> Inf (insert a X) = (if X = {} then a else inf a (Inf X))" |
96 and z: "\<And>x. x \<in> X \<Longrightarrow> z \<le> x" |
199 using cInf_insert[of X] by simp |
97 shows "Inf (insert a X) = inf a (Inf X)" |
|
98 proof (intro cInf_eq_non_empty) |
|
99 fix y assume "\<And>x. x \<in> insert a X \<Longrightarrow> y \<le> x" with x show "y \<le> inf a (Inf X)" by (auto intro: cInf_greatest) |
|
100 qed (auto intro: le_infI2 z cInf_lower) |
|
101 |
|
102 lemma cSup_insert_If: |
|
103 "(\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup (insert a X) = (if X = {} then a else sup a (Sup X))" |
|
104 using cSup_insert[of X z] by simp |
|
105 |
|
106 lemma cInf_insert_if: |
|
107 "(\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf (insert a X) = (if X = {} then a else inf a (Inf X))" |
|
108 using cInf_insert[of X z] by simp |
|
109 |
200 |
110 lemma le_cSup_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> x \<le> Sup X" |
201 lemma le_cSup_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> x \<le> Sup X" |
111 proof (induct X arbitrary: x rule: finite_induct) |
202 proof (induct X arbitrary: x rule: finite_induct) |
112 case (insert x X y) then show ?case |
203 case (insert x X y) then show ?case |
113 apply (cases "X = {}") |
204 by (cases "X = {}") (auto simp: cSup_insert intro: le_supI2) |
114 apply simp |
|
115 apply (subst cSup_insert[of _ "Sup X"]) |
|
116 apply (auto intro: le_supI2) |
|
117 done |
|
118 qed simp |
205 qed simp |
119 |
206 |
120 lemma cInf_le_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> Inf X \<le> x" |
207 lemma cInf_le_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> Inf X \<le> x" |
121 proof (induct X arbitrary: x rule: finite_induct) |
208 proof (induct X arbitrary: x rule: finite_induct) |
122 case (insert x X y) then show ?case |
209 case (insert x X y) then show ?case |
123 apply (cases "X = {}") |
210 by (cases "X = {}") (auto simp: cInf_insert intro: le_infI2) |
124 apply simp |
|
125 apply (subst cInf_insert[of _ "Inf X"]) |
|
126 apply (auto intro: le_infI2) |
|
127 done |
|
128 qed simp |
211 qed simp |
129 |
212 |
130 lemma cSup_eq_Sup_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Sup X = Sup_fin X" |
213 lemma cSup_eq_Sup_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Sup X = Sup_fin X" |
131 proof (induct X rule: finite_ne_induct) |
214 by (induct X rule: finite_ne_induct) (simp_all add: cSup_insert) |
132 case (insert x X) then show ?case |
|
133 using cSup_insert[of X "Sup_fin X" x] le_cSup_finite[of X] by simp |
|
134 qed simp |
|
135 |
215 |
136 lemma cInf_eq_Inf_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf X = Inf_fin X" |
216 lemma cInf_eq_Inf_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf X = Inf_fin X" |
137 proof (induct X rule: finite_ne_induct) |
217 by (induct X rule: finite_ne_induct) (simp_all add: cInf_insert) |
138 case (insert x X) then show ?case |
|
139 using cInf_insert[of X "Inf_fin X" x] cInf_le_finite[of X] by simp |
|
140 qed simp |
|
141 |
218 |
142 lemma cSup_atMost[simp]: "Sup {..x} = x" |
219 lemma cSup_atMost[simp]: "Sup {..x} = x" |
143 by (auto intro!: cSup_eq_maximum) |
220 by (auto intro!: cSup_eq_maximum) |
144 |
221 |
145 lemma cSup_greaterThanAtMost[simp]: "y < x \<Longrightarrow> Sup {y<..x} = x" |
222 lemma cSup_greaterThanAtMost[simp]: "y < x \<Longrightarrow> Sup {y<..x} = x" |
193 |
270 |
194 class conditionally_complete_linorder = conditionally_complete_lattice + linorder |
271 class conditionally_complete_linorder = conditionally_complete_lattice + linorder |
195 begin |
272 begin |
196 |
273 |
197 lemma less_cSup_iff : (*REAL_SUP_LE in HOL4*) |
274 lemma less_cSup_iff : (*REAL_SUP_LE in HOL4*) |
198 "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> y < Sup X \<longleftrightarrow> (\<exists>x\<in>X. y < x)" |
275 "X \<noteq> {} \<Longrightarrow> bdd_above X \<Longrightarrow> y < Sup X \<longleftrightarrow> (\<exists>x\<in>X. y < x)" |
199 by (rule iffI) (metis cSup_least not_less, metis cSup_upper less_le_trans) |
276 by (rule iffI) (metis cSup_least not_less, metis cSup_upper less_le_trans) |
200 |
277 |
201 lemma cInf_less_iff: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf X < y \<longleftrightarrow> (\<exists>x\<in>X. x < y)" |
278 lemma cInf_less_iff: "X \<noteq> {} \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X < y \<longleftrightarrow> (\<exists>x\<in>X. x < y)" |
202 by (rule iffI) (metis cInf_greatest not_less, metis cInf_lower le_less_trans) |
279 by (rule iffI) (metis cInf_greatest not_less, metis cInf_lower le_less_trans) |
203 |
280 |
204 lemma less_cSupE: |
281 lemma less_cSupE: |
205 assumes "y < Sup X" "X \<noteq> {}" obtains x where "x \<in> X" "y < x" |
282 assumes "y < Sup X" "X \<noteq> {}" obtains x where "x \<in> X" "y < x" |
206 by (metis cSup_least assms not_le that) |
283 by (metis cSup_least assms not_le that) |
207 |
284 |
208 lemma less_cSupD: |
285 lemma less_cSupD: |
209 "X \<noteq> {} \<Longrightarrow> z < Sup X \<Longrightarrow> \<exists>x\<in>X. z < x" |
286 "X \<noteq> {} \<Longrightarrow> z < Sup X \<Longrightarrow> \<exists>x\<in>X. z < x" |
210 by (metis less_cSup_iff not_leE) |
287 by (metis less_cSup_iff not_leE bdd_above_def) |
211 |
288 |
212 lemma cInf_lessD: |
289 lemma cInf_lessD: |
213 "X \<noteq> {} \<Longrightarrow> Inf X < z \<Longrightarrow> \<exists>x\<in>X. x < z" |
290 "X \<noteq> {} \<Longrightarrow> Inf X < z \<Longrightarrow> \<exists>x\<in>X. x < z" |
214 by (metis cInf_less_iff not_leE) |
291 by (metis cInf_less_iff not_leE bdd_below_def) |
215 |
292 |
216 lemma complete_interval: |
293 lemma complete_interval: |
217 assumes "a < b" and "P a" and "\<not> P b" |
294 assumes "a < b" and "P a" and "\<not> P b" |
218 shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and> |
295 shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and> |
219 (\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)" |
296 (\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)" |
220 proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x & x < d --> P x}"], auto) |
297 proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x & x < d --> P x}"], auto) |
221 show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}" |
298 show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}" |
222 by (rule cSup_upper [where z=b], auto) |
299 by (rule cSup_upper, auto simp: bdd_above_def) |
223 (metis `a < b` `\<not> P b` linear less_le) |
300 (metis `a < b` `\<not> P b` linear less_le) |
224 next |
301 next |
225 show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b" |
302 show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b" |
226 apply (rule cSup_least) |
303 apply (rule cSup_least) |
227 apply auto |
304 apply auto |