| author | nipkow | 
| Fri, 19 Jan 2018 15:42:53 +0100 | |
| changeset 67458 | e090941f9f42 | 
| parent 67091 | 1393c2340eec | 
| child 67484 | c51935a46a8f | 
| permissions | -rw-r--r-- | 
| 52265 | 1  | 
(* Title: HOL/Conditionally_Complete_Lattices.thy  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
2  | 
Author: Amine Chaieb and L C Paulson, University of Cambridge  | 
| 51643 | 3  | 
Author: Johannes Hölzl, TU München  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
4  | 
Author: Luke S. Serafin, Carnegie Mellon University  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
5  | 
*)  | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
6  | 
|
| 60758 | 7  | 
section \<open>Conditionally-complete Lattices\<close>  | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
8  | 
|
| 51773 | 9  | 
theory Conditionally_Complete_Lattices  | 
| 63331 | 10  | 
imports Finite_Set Lattices_Big Set_Interval  | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
11  | 
begin  | 
| 
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
12  | 
|
| 65466 | 13  | 
context linorder  | 
14  | 
begin  | 
|
15  | 
||
16  | 
lemma Sup_fin_eq_Max:  | 
|
17  | 
  "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Sup_fin X = Max X"
 | 
|
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
18  | 
by (induct X rule: finite_ne_induct) (simp_all add: sup_max)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
19  | 
|
| 65466 | 20  | 
lemma Inf_fin_eq_Min:  | 
21  | 
  "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf_fin X = Min X"
 | 
|
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
22  | 
by (induct X rule: finite_ne_induct) (simp_all add: inf_min)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
23  | 
|
| 65466 | 24  | 
end  | 
25  | 
||
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
26  | 
context preorder  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
27  | 
begin  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
28  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
29  | 
definition "bdd_above A \<longleftrightarrow> (\<exists>M. \<forall>x \<in> A. x \<le> M)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
30  | 
definition "bdd_below A \<longleftrightarrow> (\<exists>m. \<forall>x \<in> A. m \<le> x)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
31  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
32  | 
lemma bdd_aboveI[intro]: "(\<And>x. x \<in> A \<Longrightarrow> x \<le> M) \<Longrightarrow> bdd_above A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
33  | 
by (auto simp: bdd_above_def)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
34  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
35  | 
lemma bdd_belowI[intro]: "(\<And>x. x \<in> A \<Longrightarrow> m \<le> x) \<Longrightarrow> bdd_below A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
36  | 
by (auto simp: bdd_below_def)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
37  | 
|
| 
54263
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
38  | 
lemma bdd_aboveI2: "(\<And>x. x \<in> A \<Longrightarrow> f x \<le> M) \<Longrightarrow> bdd_above (f`A)"  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
39  | 
by force  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
40  | 
|
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
41  | 
lemma bdd_belowI2: "(\<And>x. x \<in> A \<Longrightarrow> m \<le> f x) \<Longrightarrow> bdd_below (f`A)"  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
42  | 
by force  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
43  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
44  | 
lemma bdd_above_empty [simp, intro]: "bdd_above {}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
45  | 
unfolding bdd_above_def by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
46  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
47  | 
lemma bdd_below_empty [simp, intro]: "bdd_below {}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
48  | 
unfolding bdd_below_def by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
49  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
50  | 
lemma bdd_above_mono: "bdd_above B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> bdd_above A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
51  | 
by (metis (full_types) bdd_above_def order_class.le_neq_trans psubsetD)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
52  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
53  | 
lemma bdd_below_mono: "bdd_below B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> bdd_below A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
54  | 
by (metis bdd_below_def order_class.le_neq_trans psubsetD)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
55  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
56  | 
lemma bdd_above_Int1 [simp]: "bdd_above A \<Longrightarrow> bdd_above (A \<inter> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
57  | 
using bdd_above_mono by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
58  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
59  | 
lemma bdd_above_Int2 [simp]: "bdd_above B \<Longrightarrow> bdd_above (A \<inter> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
60  | 
using bdd_above_mono by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
61  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
62  | 
lemma bdd_below_Int1 [simp]: "bdd_below A \<Longrightarrow> bdd_below (A \<inter> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
63  | 
using bdd_below_mono by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
64  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
65  | 
lemma bdd_below_Int2 [simp]: "bdd_below B \<Longrightarrow> bdd_below (A \<inter> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
66  | 
using bdd_below_mono by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
67  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
68  | 
lemma bdd_above_Ioo [simp, intro]: "bdd_above {a <..< b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
69  | 
by (auto simp add: bdd_above_def intro!: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
70  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
71  | 
lemma bdd_above_Ico [simp, intro]: "bdd_above {a ..< b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
72  | 
by (auto simp add: bdd_above_def intro!: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
73  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
74  | 
lemma bdd_above_Iio [simp, intro]: "bdd_above {..< b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
75  | 
by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
76  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
77  | 
lemma bdd_above_Ioc [simp, intro]: "bdd_above {a <.. b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
78  | 
by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
79  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
80  | 
lemma bdd_above_Icc [simp, intro]: "bdd_above {a .. b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
81  | 
by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
82  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
83  | 
lemma bdd_above_Iic [simp, intro]: "bdd_above {.. b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
84  | 
by (auto simp add: bdd_above_def intro: exI[of _ b] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
85  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
86  | 
lemma bdd_below_Ioo [simp, intro]: "bdd_below {a <..< b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
87  | 
by (auto simp add: bdd_below_def intro!: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
88  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
89  | 
lemma bdd_below_Ioc [simp, intro]: "bdd_below {a <.. b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
90  | 
by (auto simp add: bdd_below_def intro!: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
91  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
92  | 
lemma bdd_below_Ioi [simp, intro]: "bdd_below {a <..}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
93  | 
by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
94  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
95  | 
lemma bdd_below_Ico [simp, intro]: "bdd_below {a ..< b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
96  | 
by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
97  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
98  | 
lemma bdd_below_Icc [simp, intro]: "bdd_below {a .. b}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
99  | 
by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
100  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
101  | 
lemma bdd_below_Ici [simp, intro]: "bdd_below {a ..}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
102  | 
by (auto simp add: bdd_below_def intro: exI[of _ a] less_imp_le)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
103  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
104  | 
end  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
105  | 
|
| 54261 | 106  | 
lemma (in order_top) bdd_above_top[simp, intro!]: "bdd_above A"  | 
107  | 
by (rule bdd_aboveI[of _ top]) simp  | 
|
108  | 
||
109  | 
lemma (in order_bot) bdd_above_bot[simp, intro!]: "bdd_below A"  | 
|
110  | 
by (rule bdd_belowI[of _ bot]) simp  | 
|
111  | 
||
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
112  | 
lemma bdd_above_image_mono: "mono f \<Longrightarrow> bdd_above A \<Longrightarrow> bdd_above (f`A)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
113  | 
by (auto simp: bdd_above_def mono_def)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
114  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
115  | 
lemma bdd_below_image_mono: "mono f \<Longrightarrow> bdd_below A \<Longrightarrow> bdd_below (f`A)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
116  | 
by (auto simp: bdd_below_def mono_def)  | 
| 63331 | 117  | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
118  | 
lemma bdd_above_image_antimono: "antimono f \<Longrightarrow> bdd_below A \<Longrightarrow> bdd_above (f`A)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
119  | 
by (auto simp: bdd_above_def bdd_below_def antimono_def)  | 
| 
54262
 
326fd7103cb4
generalize bdd_above/below_uminus to ordered_ab_group_add
 
hoelzl 
parents: 
54261 
diff
changeset
 | 
120  | 
|
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
121  | 
lemma bdd_below_image_antimono: "antimono f \<Longrightarrow> bdd_above A \<Longrightarrow> bdd_below (f`A)"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
122  | 
by (auto simp: bdd_above_def bdd_below_def antimono_def)  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
123  | 
|
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
124  | 
lemma  | 
| 
54262
 
326fd7103cb4
generalize bdd_above/below_uminus to ordered_ab_group_add
 
hoelzl 
parents: 
54261 
diff
changeset
 | 
125  | 
fixes X :: "'a::ordered_ab_group_add set"  | 
| 
59452
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
126  | 
shows bdd_above_uminus[simp]: "bdd_above (uminus ` X) \<longleftrightarrow> bdd_below X"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
127  | 
and bdd_below_uminus[simp]: "bdd_below (uminus ` X) \<longleftrightarrow> bdd_above X"  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
128  | 
using bdd_above_image_antimono[of uminus X] bdd_below_image_antimono[of uminus "uminus`X"]  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
129  | 
using bdd_below_image_antimono[of uminus X] bdd_above_image_antimono[of uminus "uminus`X"]  | 
| 
 
2538b2c51769
ereal: tuned proofs concerning continuity and suprema
 
hoelzl 
parents: 
58889 
diff
changeset
 | 
130  | 
by (auto simp: antimono_def image_image)  | 
| 
54262
 
326fd7103cb4
generalize bdd_above/below_uminus to ordered_ab_group_add
 
hoelzl 
parents: 
54261 
diff
changeset
 | 
131  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
132  | 
context lattice  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
133  | 
begin  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
134  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
135  | 
lemma bdd_above_insert [simp]: "bdd_above (insert a A) = bdd_above A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
136  | 
by (auto simp: bdd_above_def intro: le_supI2 sup_ge1)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
137  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
138  | 
lemma bdd_below_insert [simp]: "bdd_below (insert a A) = bdd_below A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
139  | 
by (auto simp: bdd_below_def intro: le_infI2 inf_le1)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
140  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
141  | 
lemma bdd_finite [simp]:  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
142  | 
assumes "finite A" shows bdd_above_finite: "bdd_above A" and bdd_below_finite: "bdd_below A"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
143  | 
using assms by (induct rule: finite_induct, auto)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
144  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
145  | 
lemma bdd_above_Un [simp]: "bdd_above (A \<union> B) = (bdd_above A \<and> bdd_above B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
146  | 
proof  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
147  | 
assume "bdd_above (A \<union> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
148  | 
thus "bdd_above A \<and> bdd_above B" unfolding bdd_above_def by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
149  | 
next  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
150  | 
assume "bdd_above A \<and> bdd_above B"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
151  | 
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  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
152  | 
hence "\<forall>x \<in> A \<union> B. x \<le> sup a b" by (auto intro: Un_iff le_supI1 le_supI2)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
153  | 
thus "bdd_above (A \<union> B)" unfolding bdd_above_def ..  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
154  | 
qed  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
155  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
156  | 
lemma bdd_below_Un [simp]: "bdd_below (A \<union> B) = (bdd_below A \<and> bdd_below B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
157  | 
proof  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
158  | 
assume "bdd_below (A \<union> B)"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
159  | 
thus "bdd_below A \<and> bdd_below B" unfolding bdd_below_def by auto  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
160  | 
next  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
161  | 
assume "bdd_below A \<and> bdd_below B"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
162  | 
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  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
163  | 
hence "\<forall>x \<in> A \<union> B. inf a b \<le> x" by (auto intro: Un_iff le_infI1 le_infI2)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
164  | 
thus "bdd_below (A \<union> B)" unfolding bdd_below_def ..  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
165  | 
qed  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
166  | 
|
| 67458 | 167  | 
lemma bdd_above_image_sup[simp]:  | 
168  | 
"bdd_above ((\<lambda>x. sup (f x) (g x)) ` A) \<longleftrightarrow> bdd_above (f`A) \<and> bdd_above (g`A)"  | 
|
169  | 
by (auto simp: bdd_above_def intro: le_supI1 le_supI2)  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
170  | 
|
| 67458 | 171  | 
lemma bdd_below_image_inf[simp]:  | 
172  | 
"bdd_below ((\<lambda>x. inf (f x) (g x)) ` A) \<longleftrightarrow> bdd_below (f`A) \<and> bdd_below (g`A)"  | 
|
173  | 
by (auto simp: bdd_below_def intro: le_infI1 le_infI2)  | 
|
174  | 
||
175  | 
lemma bdd_below_UN[simp]: "finite I \<Longrightarrow> bdd_below (\<Union>i\<in>I. A i) = (\<forall>i \<in> I. bdd_below (A i))"  | 
|
176  | 
by (induction I rule: finite.induct) auto  | 
|
177  | 
||
178  | 
lemma bdd_above_UN[simp]: "finite I \<Longrightarrow> bdd_above (\<Union>i\<in>I. A i) = (\<forall>i \<in> I. bdd_above (A i))"  | 
|
179  | 
by (induction I rule: finite.induct) auto  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
180  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
181  | 
end  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
182  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
183  | 
|
| 60758 | 184  | 
text \<open>  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
185  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
186  | 
To avoid name classes with the @{class complete_lattice}-class we prefix @{const Sup} and
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
187  | 
@{const Inf} in theorem names with c.
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
188  | 
|
| 60758 | 189  | 
\<close>  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
190  | 
|
| 51773 | 191  | 
class conditionally_complete_lattice = lattice + Sup + Inf +  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
192  | 
assumes cInf_lower: "x \<in> X \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X \<le> x"  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
193  | 
    and cInf_greatest: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> z \<le> Inf X"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
194  | 
assumes cSup_upper: "x \<in> X \<Longrightarrow> bdd_above X \<Longrightarrow> x \<le> Sup X"  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
195  | 
    and cSup_least: "X \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X \<le> z"
 | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
196  | 
begin  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
197  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
198  | 
lemma cSup_upper2: "x \<in> X \<Longrightarrow> y \<le> x \<Longrightarrow> bdd_above X \<Longrightarrow> y \<le> Sup X"  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
199  | 
by (metis cSup_upper order_trans)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
200  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
201  | 
lemma cInf_lower2: "x \<in> X \<Longrightarrow> x \<le> y \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X \<le> y"  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
202  | 
by (metis cInf_lower order_trans)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
203  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
204  | 
lemma cSup_mono: "B \<noteq> {} \<Longrightarrow> bdd_above A \<Longrightarrow> (\<And>b. b \<in> B \<Longrightarrow> \<exists>a\<in>A. b \<le> a) \<Longrightarrow> Sup B \<le> Sup A"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
205  | 
by (metis cSup_least cSup_upper2)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
206  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
207  | 
lemma cInf_mono: "B \<noteq> {} \<Longrightarrow> bdd_below A \<Longrightarrow> (\<And>b. b \<in> B \<Longrightarrow> \<exists>a\<in>A. a \<le> b) \<Longrightarrow> Inf A \<le> Inf B"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
208  | 
by (metis cInf_greatest cInf_lower2)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
209  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
210  | 
lemma cSup_subset_mono: "A \<noteq> {} \<Longrightarrow> bdd_above B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> Sup A \<le> Sup B"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
211  | 
by (metis cSup_least cSup_upper subsetD)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
212  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
213  | 
lemma cInf_superset_mono: "A \<noteq> {} \<Longrightarrow> bdd_below B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> Inf B \<le> Inf A"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
214  | 
by (metis cInf_greatest cInf_lower subsetD)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
215  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
216  | 
lemma cSup_eq_maximum: "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X = z"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
217  | 
by (intro antisym cSup_upper[of z X] cSup_least[of X z]) auto  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
218  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
219  | 
lemma cInf_eq_minimum: "z \<in> X \<Longrightarrow> (\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> Inf X = z"  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
220  | 
by (intro antisym cInf_lower[of z X] cInf_greatest[of X z]) auto  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
221  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
222  | 
lemma cSup_le_iff: "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> Sup S \<le> a \<longleftrightarrow> (\<forall>x\<in>S. x \<le> a)"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
223  | 
by (metis order_trans cSup_upper cSup_least)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
224  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
225  | 
lemma le_cInf_iff: "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> a \<le> Inf S \<longleftrightarrow> (\<forall>x\<in>S. a \<le> x)"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
226  | 
by (metis order_trans cInf_lower cInf_greatest)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
227  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
228  | 
lemma cSup_eq_non_empty:  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
229  | 
  assumes 1: "X \<noteq> {}"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
230  | 
assumes 2: "\<And>x. x \<in> X \<Longrightarrow> x \<le> a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
231  | 
assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> x \<le> y) \<Longrightarrow> a \<le> y"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
232  | 
shows "Sup X = a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
233  | 
by (intro 3 1 antisym cSup_least) (auto intro: 2 1 cSup_upper)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
234  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
235  | 
lemma cInf_eq_non_empty:  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
236  | 
  assumes 1: "X \<noteq> {}"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
237  | 
assumes 2: "\<And>x. x \<in> X \<Longrightarrow> a \<le> x"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
238  | 
assumes 3: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> y \<le> x) \<Longrightarrow> y \<le> a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
239  | 
shows "Inf X = a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
240  | 
by (intro 3 1 antisym cInf_greatest) (auto intro: 2 1 cInf_lower)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
241  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
242  | 
lemma cInf_cSup: "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> Inf S = Sup {x. \<forall>s\<in>S. x \<le> s}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
243  | 
by (rule cInf_eq_non_empty) (auto intro!: cSup_upper cSup_least simp: bdd_below_def)  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
244  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
245  | 
lemma cSup_cInf: "S \<noteq> {} \<Longrightarrow> bdd_above S \<Longrightarrow> Sup S = Inf {x. \<forall>s\<in>S. s \<le> x}"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
246  | 
by (rule cSup_eq_non_empty) (auto intro!: cInf_lower cInf_greatest simp: bdd_above_def)  | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
247  | 
|
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
248  | 
lemma cSup_insert: "X \<noteq> {} \<Longrightarrow> bdd_above X \<Longrightarrow> Sup (insert a X) = sup a (Sup X)"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
249  | 
by (intro cSup_eq_non_empty) (auto intro: le_supI2 cSup_upper cSup_least)  | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
250  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
251  | 
lemma cInf_insert: "X \<noteq> {} \<Longrightarrow> bdd_below X \<Longrightarrow> Inf (insert a X) = inf a (Inf X)"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
252  | 
by (intro cInf_eq_non_empty) (auto intro: le_infI2 cInf_lower cInf_greatest)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
253  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
254  | 
lemma cSup_singleton [simp]: "Sup {x} = x"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
255  | 
by (intro cSup_eq_maximum) auto  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
256  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
257  | 
lemma cInf_singleton [simp]: "Inf {x} = x"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
258  | 
by (intro cInf_eq_minimum) auto  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
259  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
260  | 
lemma cSup_insert_If:  "bdd_above X \<Longrightarrow> Sup (insert a X) = (if X = {} then a else sup a (Sup X))"
 | 
| 
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
261  | 
using cSup_insert[of X] by simp  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
262  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
263  | 
lemma cInf_insert_If: "bdd_below X \<Longrightarrow> Inf (insert a X) = (if X = {} then a else inf a (Inf X))"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
264  | 
using cInf_insert[of X] by simp  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
265  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
266  | 
lemma le_cSup_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> x \<le> Sup X"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
267  | 
proof (induct X arbitrary: x rule: finite_induct)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
268  | 
case (insert x X y) then show ?case  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
269  | 
    by (cases "X = {}") (auto simp: cSup_insert intro: le_supI2)
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
270  | 
qed simp  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
271  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
272  | 
lemma cInf_le_finite: "finite X \<Longrightarrow> x \<in> X \<Longrightarrow> Inf X \<le> x"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
273  | 
proof (induct X arbitrary: x rule: finite_induct)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
274  | 
case (insert x X y) then show ?case  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
275  | 
    by (cases "X = {}") (auto simp: cInf_insert intro: le_infI2)
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
276  | 
qed simp  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
277  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
278  | 
lemma cSup_eq_Sup_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Sup X = Sup_fin X"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
279  | 
by (induct X rule: finite_ne_induct) (simp_all add: cSup_insert)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
280  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
281  | 
lemma cInf_eq_Inf_fin: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf X = Inf_fin X"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
282  | 
by (induct X rule: finite_ne_induct) (simp_all add: cInf_insert)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
283  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
284  | 
lemma cSup_atMost[simp]: "Sup {..x} = x"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
285  | 
by (auto intro!: cSup_eq_maximum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
286  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
287  | 
lemma cSup_greaterThanAtMost[simp]: "y < x \<Longrightarrow> Sup {y<..x} = x"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
288  | 
by (auto intro!: cSup_eq_maximum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
289  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
290  | 
lemma cSup_atLeastAtMost[simp]: "y \<le> x \<Longrightarrow> Sup {y..x} = x"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
291  | 
by (auto intro!: cSup_eq_maximum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
292  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
293  | 
lemma cInf_atLeast[simp]: "Inf {x..} = x"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
294  | 
by (auto intro!: cInf_eq_minimum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
295  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
296  | 
lemma cInf_atLeastLessThan[simp]: "y < x \<Longrightarrow> Inf {y..<x} = y"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
297  | 
by (auto intro!: cInf_eq_minimum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
298  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
299  | 
lemma cInf_atLeastAtMost[simp]: "y \<le> x \<Longrightarrow> Inf {y..x} = y"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
300  | 
by (auto intro!: cInf_eq_minimum)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
301  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
302  | 
lemma cINF_lower: "bdd_below (f ` A) \<Longrightarrow> x \<in> A \<Longrightarrow> INFIMUM A f \<le> f x"  | 
| 56166 | 303  | 
using cInf_lower [of _ "f ` A"] by simp  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
304  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
305  | 
lemma cINF_greatest: "A \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> m \<le> f x) \<Longrightarrow> m \<le> INFIMUM A f"
 | 
| 56166 | 306  | 
using cInf_greatest [of "f ` A"] by auto  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
307  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
308  | 
lemma cSUP_upper: "x \<in> A \<Longrightarrow> bdd_above (f ` A) \<Longrightarrow> f x \<le> SUPREMUM A f"  | 
| 56166 | 309  | 
using cSup_upper [of _ "f ` A"] by simp  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
310  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
311  | 
lemma cSUP_least: "A \<noteq> {} \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<le> M) \<Longrightarrow> SUPREMUM A f \<le> M"
 | 
| 56166 | 312  | 
using cSup_least [of "f ` A"] by auto  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
313  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
314  | 
lemma cINF_lower2: "bdd_below (f ` A) \<Longrightarrow> x \<in> A \<Longrightarrow> f x \<le> u \<Longrightarrow> INFIMUM A f \<le> u"  | 
| 63092 | 315  | 
by (auto intro: cINF_lower order_trans)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
316  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
317  | 
lemma cSUP_upper2: "bdd_above (f ` A) \<Longrightarrow> x \<in> A \<Longrightarrow> u \<le> f x \<Longrightarrow> u \<le> SUPREMUM A f"  | 
| 63092 | 318  | 
by (auto intro: cSUP_upper order_trans)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
319  | 
|
| 
60615
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
320  | 
lemma cSUP_const [simp]: "A \<noteq> {} \<Longrightarrow> (SUP x:A. c) = c"
 | 
| 54261 | 321  | 
by (intro antisym cSUP_least) (auto intro: cSUP_upper)  | 
322  | 
||
| 
60615
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
323  | 
lemma cINF_const [simp]: "A \<noteq> {} \<Longrightarrow> (INF x:A. c) = c"
 | 
| 54261 | 324  | 
by (intro antisym cINF_greatest) (auto intro: cINF_lower)  | 
325  | 
||
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
326  | 
lemma le_cINF_iff: "A \<noteq> {} \<Longrightarrow> bdd_below (f ` A) \<Longrightarrow> u \<le> INFIMUM A f \<longleftrightarrow> (\<forall>x\<in>A. u \<le> f x)"
 | 
| 63092 | 327  | 
by (metis cINF_greatest cINF_lower order_trans)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
328  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
329  | 
lemma cSUP_le_iff: "A \<noteq> {} \<Longrightarrow> bdd_above (f ` A) \<Longrightarrow> SUPREMUM A f \<le> u \<longleftrightarrow> (\<forall>x\<in>A. f x \<le> u)"
 | 
| 63092 | 330  | 
by (metis cSUP_least cSUP_upper order_trans)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
331  | 
|
| 
54263
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
332  | 
lemma less_cINF_D: "bdd_below (f`A) \<Longrightarrow> y < (INF i:A. f i) \<Longrightarrow> i \<in> A \<Longrightarrow> y < f i"  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
333  | 
by (metis cINF_lower less_le_trans)  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
334  | 
|
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
335  | 
lemma cSUP_lessD: "bdd_above (f`A) \<Longrightarrow> (SUP i:A. f i) < y \<Longrightarrow> i \<in> A \<Longrightarrow> f i < y"  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
336  | 
by (metis cSUP_upper le_less_trans)  | 
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
337  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
338  | 
lemma cINF_insert: "A \<noteq> {} \<Longrightarrow> bdd_below (f ` A) \<Longrightarrow> INFIMUM (insert a A) f = inf (f a) (INFIMUM A f)"
 | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
61824 
diff
changeset
 | 
339  | 
by (metis cInf_insert image_insert image_is_empty)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
340  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
341  | 
lemma cSUP_insert: "A \<noteq> {} \<Longrightarrow> bdd_above (f ` A) \<Longrightarrow> SUPREMUM (insert a A) f = sup (f a) (SUPREMUM A f)"
 | 
| 
62343
 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 
haftmann 
parents: 
61824 
diff
changeset
 | 
342  | 
by (metis cSup_insert image_insert image_is_empty)  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
343  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
344  | 
lemma cINF_mono: "B \<noteq> {} \<Longrightarrow> bdd_below (f ` A) \<Longrightarrow> (\<And>m. m \<in> B \<Longrightarrow> \<exists>n\<in>A. f n \<le> g m) \<Longrightarrow> INFIMUM A f \<le> INFIMUM B g"
 | 
| 56166 | 345  | 
using cInf_mono [of "g ` B" "f ` A"] by auto  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
346  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
347  | 
lemma cSUP_mono: "A \<noteq> {} \<Longrightarrow> bdd_above (g ` B) \<Longrightarrow> (\<And>n. n \<in> A \<Longrightarrow> \<exists>m\<in>B. f n \<le> g m) \<Longrightarrow> SUPREMUM A f \<le> SUPREMUM B g"
 | 
| 56166 | 348  | 
using cSup_mono [of "f ` A" "g ` B"] by auto  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
349  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
350  | 
lemma cINF_superset_mono: "A \<noteq> {} \<Longrightarrow> bdd_below (g ` B) \<Longrightarrow> A \<subseteq> B \<Longrightarrow> (\<And>x. x \<in> B \<Longrightarrow> g x \<le> f x) \<Longrightarrow> INFIMUM B g \<le> INFIMUM A f"
 | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
351  | 
by (rule cINF_mono) auto  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
352  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
353  | 
lemma cSUP_subset_mono: "A \<noteq> {} \<Longrightarrow> bdd_above (g ` B) \<Longrightarrow> A \<subseteq> B \<Longrightarrow> (\<And>x. x \<in> B \<Longrightarrow> f x \<le> g x) \<Longrightarrow> SUPREMUM A f \<le> SUPREMUM B g"
 | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
354  | 
by (rule cSUP_mono) auto  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
355  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
356  | 
lemma less_eq_cInf_inter: "bdd_below A \<Longrightarrow> bdd_below B \<Longrightarrow> A \<inter> B \<noteq> {} \<Longrightarrow> inf (Inf A) (Inf B) \<le> Inf (A \<inter> B)"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
357  | 
by (metis cInf_superset_mono lattice_class.inf_sup_ord(1) le_infI1)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
358  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
359  | 
lemma cSup_inter_less_eq: "bdd_above A \<Longrightarrow> bdd_above B \<Longrightarrow> A \<inter> B \<noteq> {} \<Longrightarrow> Sup (A \<inter> B) \<le> sup (Sup A) (Sup B) "
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
360  | 
by (metis cSup_subset_mono lattice_class.inf_sup_ord(1) le_supI1)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
361  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
362  | 
lemma cInf_union_distrib: "A \<noteq> {} \<Longrightarrow> bdd_below A \<Longrightarrow> B \<noteq> {} \<Longrightarrow> bdd_below B \<Longrightarrow> Inf (A \<union> B) = inf (Inf A) (Inf B)"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
363  | 
by (intro antisym le_infI cInf_greatest cInf_lower) (auto intro: le_infI1 le_infI2 cInf_lower)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
364  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
365  | 
lemma cINF_union: "A \<noteq> {} \<Longrightarrow> bdd_below (f`A) \<Longrightarrow> B \<noteq> {} \<Longrightarrow> bdd_below (f`B) \<Longrightarrow> INFIMUM (A \<union> B) f = inf (INFIMUM A f) (INFIMUM B f)"
 | 
| 56166 | 366  | 
using cInf_union_distrib [of "f ` A" "f ` B"] by (simp add: image_Un [symmetric])  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
367  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
368  | 
lemma cSup_union_distrib: "A \<noteq> {} \<Longrightarrow> bdd_above A \<Longrightarrow> B \<noteq> {} \<Longrightarrow> bdd_above B \<Longrightarrow> Sup (A \<union> B) = sup (Sup A) (Sup B)"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
369  | 
by (intro antisym le_supI cSup_least cSup_upper) (auto intro: le_supI1 le_supI2 cSup_upper)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
370  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
371  | 
lemma cSUP_union: "A \<noteq> {} \<Longrightarrow> bdd_above (f`A) \<Longrightarrow> B \<noteq> {} \<Longrightarrow> bdd_above (f`B) \<Longrightarrow> SUPREMUM (A \<union> B) f = sup (SUPREMUM A f) (SUPREMUM B f)"
 | 
| 56166 | 372  | 
using cSup_union_distrib [of "f ` A" "f ` B"] by (simp add: image_Un [symmetric])  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
373  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
374  | 
lemma cINF_inf_distrib: "A \<noteq> {} \<Longrightarrow> bdd_below (f`A) \<Longrightarrow> bdd_below (g`A) \<Longrightarrow> inf (INFIMUM A f) (INFIMUM A g) = (INF a:A. inf (f a) (g a))"
 | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
375  | 
by (intro antisym le_infI cINF_greatest cINF_lower2)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
376  | 
(auto intro: le_infI1 le_infI2 cINF_greatest cINF_lower le_infI)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
377  | 
|
| 
56218
 
1c3f1f2431f9
elongated INFI and SUPR, to reduced risk of confusing theorems names in the future while still being consistent with INTER and UNION
 
haftmann 
parents: 
56166 
diff
changeset
 | 
378  | 
lemma SUP_sup_distrib: "A \<noteq> {} \<Longrightarrow> bdd_above (f`A) \<Longrightarrow> bdd_above (g`A) \<Longrightarrow> sup (SUPREMUM A f) (SUPREMUM A g) = (SUP a:A. sup (f a) (g a))"
 | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
379  | 
by (intro antisym le_supI cSUP_least cSUP_upper2)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
380  | 
(auto intro: le_supI1 le_supI2 cSUP_least cSUP_upper le_supI)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
381  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
382  | 
lemma cInf_le_cSup:  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
383  | 
  "A \<noteq> {} \<Longrightarrow> bdd_above A \<Longrightarrow> bdd_below A \<Longrightarrow> Inf A \<le> Sup A"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
384  | 
by (auto intro!: cSup_upper2[of "SOME a. a \<in> A"] intro: someI cInf_lower)  | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
385  | 
|
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
386  | 
end  | 
| 
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
387  | 
|
| 51773 | 388  | 
instance complete_lattice \<subseteq> conditionally_complete_lattice  | 
| 61169 | 389  | 
by standard (auto intro: Sup_upper Sup_least Inf_lower Inf_greatest)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
390  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
391  | 
lemma cSup_eq:  | 
| 51773 | 392  | 
  fixes a :: "'a :: {conditionally_complete_lattice, no_bot}"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
393  | 
assumes upper: "\<And>x. x \<in> X \<Longrightarrow> x \<le> a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
394  | 
assumes least: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> x \<le> y) \<Longrightarrow> a \<le> y"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
395  | 
shows "Sup X = a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
396  | 
proof cases  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
397  | 
  assume "X = {}" with lt_ex[of a] least show ?thesis by (auto simp: less_le_not_le)
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
398  | 
qed (intro cSup_eq_non_empty assms)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
399  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
400  | 
lemma cInf_eq:  | 
| 51773 | 401  | 
  fixes a :: "'a :: {conditionally_complete_lattice, no_top}"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
402  | 
assumes upper: "\<And>x. x \<in> X \<Longrightarrow> a \<le> x"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
403  | 
assumes least: "\<And>y. (\<And>x. x \<in> X \<Longrightarrow> y \<le> x) \<Longrightarrow> y \<le> a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
404  | 
shows "Inf X = a"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
405  | 
proof cases  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
406  | 
  assume "X = {}" with gt_ex[of a] least show ?thesis by (auto simp: less_le_not_le)
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
407  | 
qed (intro cInf_eq_non_empty assms)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
408  | 
|
| 51773 | 409  | 
class conditionally_complete_linorder = conditionally_complete_lattice + linorder  | 
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
410  | 
begin  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
411  | 
|
| 63331 | 412  | 
lemma less_cSup_iff:  | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
413  | 
  "X \<noteq> {} \<Longrightarrow> bdd_above X \<Longrightarrow> y < Sup X \<longleftrightarrow> (\<exists>x\<in>X. y < x)"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
414  | 
by (rule iffI) (metis cSup_least not_less, metis cSup_upper less_le_trans)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
415  | 
|
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
416  | 
lemma cInf_less_iff: "X \<noteq> {} \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X < y \<longleftrightarrow> (\<exists>x\<in>X. x < y)"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
417  | 
by (rule iffI) (metis cInf_greatest not_less, metis cInf_lower le_less_trans)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
418  | 
|
| 
54263
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
419  | 
lemma cINF_less_iff: "A \<noteq> {} \<Longrightarrow> bdd_below (f`A) \<Longrightarrow> (INF i:A. f i) < a \<longleftrightarrow> (\<exists>x\<in>A. f x < a)"
 | 
| 56166 | 420  | 
using cInf_less_iff[of "f`A"] by auto  | 
| 
54263
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
421  | 
|
| 
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
422  | 
lemma less_cSUP_iff: "A \<noteq> {} \<Longrightarrow> bdd_above (f`A) \<Longrightarrow> a < (SUP i:A. f i) \<longleftrightarrow> (\<exists>x\<in>A. a < f x)"
 | 
| 56166 | 423  | 
using less_cSup_iff[of "f`A"] by auto  | 
| 
54263
 
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
 
hoelzl 
parents: 
54262 
diff
changeset
 | 
424  | 
|
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
425  | 
lemma less_cSupE:  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
426  | 
  assumes "y < Sup X" "X \<noteq> {}" obtains x where "x \<in> X" "y < x"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
427  | 
by (metis cSup_least assms not_le that)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
428  | 
|
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
429  | 
lemma less_cSupD:  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
430  | 
  "X \<noteq> {} \<Longrightarrow> z < Sup X \<Longrightarrow> \<exists>x\<in>X. z < x"
 | 
| 
61824
 
dcbe9f756ae0
not_leE -> not_le_imp_less and other tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
61169 
diff
changeset
 | 
431  | 
by (metis less_cSup_iff not_le_imp_less bdd_above_def)  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
432  | 
|
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
433  | 
lemma cInf_lessD:  | 
| 
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
434  | 
  "X \<noteq> {} \<Longrightarrow> Inf X < z \<Longrightarrow> \<exists>x\<in>X. x < z"
 | 
| 
61824
 
dcbe9f756ae0
not_leE -> not_le_imp_less and other tidying
 
paulson <lp15@cam.ac.uk> 
parents: 
61169 
diff
changeset
 | 
435  | 
by (metis cInf_less_iff not_le_imp_less bdd_below_def)  | 
| 
51518
 
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
 
hoelzl 
parents: 
51475 
diff
changeset
 | 
436  | 
|
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
437  | 
lemma complete_interval:  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
438  | 
assumes "a < b" and "P a" and "\<not> P b"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
439  | 
shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and>  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
440  | 
(\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)"  | 
| 67091 | 441  | 
proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x}"], auto)
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
442  | 
  show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
443  | 
by (rule cSup_upper, auto simp: bdd_above_def)  | 
| 60758 | 444  | 
(metis \<open>a < b\<close> \<open>\<not> P b\<close> linear less_le)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
445  | 
next  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
446  | 
  show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b"
 | 
| 63331 | 447  | 
apply (rule cSup_least)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
448  | 
apply auto  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
449  | 
apply (metis less_le_not_le)  | 
| 67091 | 450  | 
apply (metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
451  | 
done  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
452  | 
next  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
453  | 
fix x  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
454  | 
  assume x: "a \<le> x" and lt: "x < Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
 | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
455  | 
show "P x"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
456  | 
apply (rule less_cSupE [OF lt], auto)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
457  | 
apply (metis less_le_not_le)  | 
| 63331 | 458  | 
apply (metis x)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
459  | 
done  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
460  | 
next  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
461  | 
fix d  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
462  | 
assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
463  | 
    thus "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
 | 
| 
54258
 
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
 
hoelzl 
parents: 
54257 
diff
changeset
 | 
464  | 
by (rule_tac cSup_upper, auto simp: bdd_above_def)  | 
| 67091 | 465  | 
(metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
466  | 
qed  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
467  | 
|
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
468  | 
end  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
469  | 
|
| 
60172
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
59452 
diff
changeset
 | 
470  | 
instance complete_linorder < conditionally_complete_linorder  | 
| 
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
59452 
diff
changeset
 | 
471  | 
..  | 
| 
 
423273355b55
rename continuous and down_continuous in Order_Continuity to sup_/inf_continuous; relate them with topological continuity
 
hoelzl 
parents: 
59452 
diff
changeset
 | 
472  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
473  | 
lemma cSup_eq_Max: "finite (X::'a::conditionally_complete_linorder set) \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Sup X = Max X"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
474  | 
using cSup_eq_Sup_fin[of X] Sup_fin_eq_Max[of X] by simp  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51773 
diff
changeset
 | 
475  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
476  | 
lemma cInf_eq_Min: "finite (X::'a::conditionally_complete_linorder set) \<Longrightarrow> X \<noteq> {} \<Longrightarrow> Inf X = Min X"
 | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
477  | 
using cInf_eq_Inf_fin[of X] Inf_fin_eq_Min[of X] by simp  | 
| 
51775
 
408d937c9486
revert #916271d52466; add non-topological linear_continuum type class; show linear_continuum_topology is a perfect_space
 
hoelzl 
parents: 
51773 
diff
changeset
 | 
478  | 
|
| 
54257
 
5c7a3b6b05a9
generalize SUP and INF to the syntactic type classes Sup and Inf
 
hoelzl 
parents: 
53216 
diff
changeset
 | 
479  | 
lemma cSup_lessThan[simp]: "Sup {..<x::'a::{conditionally_complete_linorder, no_bot, dense_linorder}} = x"
 | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
480  | 
by (auto intro!: cSup_eq_non_empty intro: dense_le)  | 
| 
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
481  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
482  | 
lemma cSup_greaterThanLessThan[simp]: "y < x \<Longrightarrow> Sup {y<..<x::'a::{conditionally_complete_linorder, dense_linorder}} = x"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
483  | 
by (auto intro!: cSup_eq_non_empty intro: dense_le_bounded)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
484  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
485  | 
lemma cSup_atLeastLessThan[simp]: "y < x \<Longrightarrow> Sup {y..<x::'a::{conditionally_complete_linorder, dense_linorder}} = x"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
486  | 
by (auto intro!: cSup_eq_non_empty intro: dense_le_bounded)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
487  | 
|
| 
54257
 
5c7a3b6b05a9
generalize SUP and INF to the syntactic type classes Sup and Inf
 
hoelzl 
parents: 
53216 
diff
changeset
 | 
488  | 
lemma cInf_greaterThan[simp]: "Inf {x::'a::{conditionally_complete_linorder, no_top, dense_linorder} <..} = x"
 | 
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
489  | 
by (auto intro!: cInf_eq_non_empty intro: dense_ge)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
490  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
491  | 
lemma cInf_greaterThanAtMost[simp]: "y < x \<Longrightarrow> Inf {y<..x::'a::{conditionally_complete_linorder, dense_linorder}} = y"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
492  | 
by (auto intro!: cInf_eq_non_empty intro: dense_ge_bounded)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
493  | 
|
| 
57447
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
494  | 
lemma cInf_greaterThanLessThan[simp]: "y < x \<Longrightarrow> Inf {y<..<x::'a::{conditionally_complete_linorder, dense_linorder}} = y"
 | 
| 
 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 
hoelzl 
parents: 
57275 
diff
changeset
 | 
495  | 
by (auto intro!: cInf_eq_non_empty intro: dense_ge_bounded)  | 
| 
51475
 
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
 
hoelzl 
parents: 
46757 
diff
changeset
 | 
496  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
497  | 
class linear_continuum = conditionally_complete_linorder + dense_linorder +  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
498  | 
assumes UNIV_not_singleton: "\<exists>a b::'a. a \<noteq> b"  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
499  | 
begin  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
500  | 
|
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
501  | 
lemma ex_gt_or_lt: "\<exists>b. a < b \<or> b < a"  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
502  | 
by (metis UNIV_not_singleton neq_iff)  | 
| 
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
503  | 
|
| 
33269
 
3b7e2dbbd684
New theory SupInf of the supremum and infimum operators for sets of reals.
 
paulson 
parents:  
diff
changeset
 | 
504  | 
end  | 
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
505  | 
|
| 54281 | 506  | 
instantiation nat :: conditionally_complete_linorder  | 
507  | 
begin  | 
|
508  | 
||
509  | 
definition "Sup (X::nat set) = Max X"  | 
|
510  | 
definition "Inf (X::nat set) = (LEAST n. n \<in> X)"  | 
|
511  | 
||
512  | 
lemma bdd_above_nat: "bdd_above X \<longleftrightarrow> finite (X::nat set)"  | 
|
513  | 
proof  | 
|
514  | 
assume "bdd_above X"  | 
|
515  | 
  then obtain z where "X \<subseteq> {.. z}"
 | 
|
516  | 
by (auto simp: bdd_above_def)  | 
|
517  | 
then show "finite X"  | 
|
518  | 
by (rule finite_subset) simp  | 
|
519  | 
qed simp  | 
|
520  | 
||
521  | 
instance  | 
|
522  | 
proof  | 
|
| 63540 | 523  | 
fix x :: nat  | 
524  | 
fix X :: "nat set"  | 
|
525  | 
show "Inf X \<le> x" if "x \<in> X" "bdd_below X"  | 
|
526  | 
using that by (simp add: Inf_nat_def Least_le)  | 
|
527  | 
  show "x \<le> Inf X" if "X \<noteq> {}" "\<And>y. y \<in> X \<Longrightarrow> x \<le> y"
 | 
|
528  | 
using that unfolding Inf_nat_def ex_in_conv[symmetric] by (rule LeastI2_ex)  | 
|
529  | 
show "x \<le> Sup X" if "x \<in> X" "bdd_above X"  | 
|
530  | 
using that by (simp add: Sup_nat_def bdd_above_nat)  | 
|
531  | 
  show "Sup X \<le> x" if "X \<noteq> {}" "\<And>y. y \<in> X \<Longrightarrow> y \<le> x"
 | 
|
532  | 
proof -  | 
|
533  | 
from that have "bdd_above X"  | 
|
| 54281 | 534  | 
by (auto simp: bdd_above_def)  | 
| 63540 | 535  | 
with that show ?thesis  | 
536  | 
by (simp add: Sup_nat_def bdd_above_nat)  | 
|
537  | 
qed  | 
|
| 54281 | 538  | 
qed  | 
| 63540 | 539  | 
|
| 
54259
 
71c701dc5bf9
add SUP and INF for conditionally complete lattices
 
hoelzl 
parents: 
54258 
diff
changeset
 | 
540  | 
end  | 
| 54281 | 541  | 
|
542  | 
instantiation int :: conditionally_complete_linorder  | 
|
543  | 
begin  | 
|
544  | 
||
545  | 
definition "Sup (X::int set) = (THE x. x \<in> X \<and> (\<forall>y\<in>X. y \<le> x))"  | 
|
546  | 
definition "Inf (X::int set) = - (Sup (uminus ` X))"  | 
|
547  | 
||
548  | 
instance  | 
|
549  | 
proof  | 
|
550  | 
  { fix x :: int and X :: "int set" assume "X \<noteq> {}" "bdd_above X"
 | 
|
551  | 
    then obtain x y where "X \<subseteq> {..y}" "x \<in> X"
 | 
|
552  | 
by (auto simp: bdd_above_def)  | 
|
553  | 
    then have *: "finite (X \<inter> {x..y})" "X \<inter> {x..y} \<noteq> {}" and "x \<le> y"
 | 
|
554  | 
by (auto simp: subset_eq)  | 
|
555  | 
have "\<exists>!x\<in>X. (\<forall>y\<in>X. y \<le> x)"  | 
|
556  | 
proof  | 
|
557  | 
      { fix z assume "z \<in> X"
 | 
|
558  | 
        have "z \<le> Max (X \<inter> {x..y})"
 | 
|
559  | 
proof cases  | 
|
| 60758 | 560  | 
          assume "x \<le> z" with \<open>z \<in> X\<close> \<open>X \<subseteq> {..y}\<close> *(1) show ?thesis
 | 
| 54281 | 561  | 
by (auto intro!: Max_ge)  | 
562  | 
next  | 
|
563  | 
assume "\<not> x \<le> z"  | 
|
564  | 
then have "z < x" by simp  | 
|
565  | 
          also have "x \<le> Max (X \<inter> {x..y})"
 | 
|
| 60758 | 566  | 
using \<open>x \<in> X\<close> *(1) \<open>x \<le> y\<close> by (intro Max_ge) auto  | 
| 54281 | 567  | 
finally show ?thesis by simp  | 
568  | 
qed }  | 
|
569  | 
note le = this  | 
|
570  | 
      with Max_in[OF *] show ex: "Max (X \<inter> {x..y}) \<in> X \<and> (\<forall>z\<in>X. z \<le> Max (X \<inter> {x..y}))" by auto
 | 
|
571  | 
||
572  | 
fix z assume *: "z \<in> X \<and> (\<forall>y\<in>X. y \<le> z)"  | 
|
573  | 
      with le have "z \<le> Max (X \<inter> {x..y})"
 | 
|
574  | 
by auto  | 
|
575  | 
      moreover have "Max (X \<inter> {x..y}) \<le> z"
 | 
|
576  | 
using * ex by auto  | 
|
577  | 
      ultimately show "z = Max (X \<inter> {x..y})"
 | 
|
578  | 
by auto  | 
|
579  | 
qed  | 
|
580  | 
then have "Sup X \<in> X \<and> (\<forall>y\<in>X. y \<le> Sup X)"  | 
|
581  | 
unfolding Sup_int_def by (rule theI') }  | 
|
582  | 
note Sup_int = this  | 
|
583  | 
||
584  | 
  { fix x :: int and X :: "int set" assume "x \<in> X" "bdd_above X" then show "x \<le> Sup X"
 | 
|
585  | 
using Sup_int[of X] by auto }  | 
|
586  | 
note le_Sup = this  | 
|
587  | 
  { fix x :: int and X :: "int set" assume "X \<noteq> {}" "\<And>y. y \<in> X \<Longrightarrow> y \<le> x" then show "Sup X \<le> x"
 | 
|
588  | 
using Sup_int[of X] by (auto simp: bdd_above_def) }  | 
|
589  | 
note Sup_le = this  | 
|
590  | 
||
591  | 
  { fix x :: int and X :: "int set" assume "x \<in> X" "bdd_below X" then show "Inf X \<le> x"
 | 
|
592  | 
using le_Sup[of "-x" "uminus ` X"] by (auto simp: Inf_int_def) }  | 
|
593  | 
  { fix x :: int and X :: "int set" assume "X \<noteq> {}" "\<And>y. y \<in> X \<Longrightarrow> x \<le> y" then show "x \<le> Inf X"
 | 
|
594  | 
using Sup_le[of "uminus ` X" "-x"] by (force simp: Inf_int_def) }  | 
|
595  | 
qed  | 
|
596  | 
end  | 
|
597  | 
||
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
598  | 
lemma interval_cases:  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
599  | 
fixes S :: "'a :: conditionally_complete_linorder set"  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
600  | 
assumes ivl: "\<And>a b x. a \<in> S \<Longrightarrow> b \<in> S \<Longrightarrow> a \<le> x \<Longrightarrow> x \<le> b \<Longrightarrow> x \<in> S"  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
601  | 
  shows "\<exists>a b. S = {} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
602  | 
S = UNIV \<or>  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
603  | 
    S = {..<b} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
604  | 
    S = {..b} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
605  | 
    S = {a<..} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
606  | 
    S = {a..} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
607  | 
    S = {a<..<b} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
608  | 
    S = {a<..b} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
609  | 
    S = {a..<b} \<or>
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
610  | 
    S = {a..b}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
611  | 
proof -  | 
| 63040 | 612  | 
  define lower upper where "lower = {x. \<exists>s\<in>S. s \<le> x}" and "upper = {x. \<exists>s\<in>S. x \<le> s}"
 | 
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
613  | 
with ivl have "S = lower \<inter> upper"  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
614  | 
by auto  | 
| 63331 | 615  | 
moreover  | 
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
616  | 
  have "\<exists>a. upper = UNIV \<or> upper = {} \<or> upper = {.. a} \<or> upper = {..< a}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
617  | 
proof cases  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
618  | 
    assume *: "bdd_above S \<and> S \<noteq> {}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
619  | 
    from * have "upper \<subseteq> {.. Sup S}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
620  | 
by (auto simp: upper_def intro: cSup_upper2)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
621  | 
    moreover from * have "{..< Sup S} \<subseteq> upper"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
622  | 
by (force simp add: less_cSup_iff upper_def subset_eq Ball_def)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
623  | 
    ultimately have "upper = {.. Sup S} \<or> upper = {..< Sup S}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
624  | 
unfolding ivl_disj_un(2)[symmetric] by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
625  | 
then show ?thesis by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
626  | 
next  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
627  | 
    assume "\<not> (bdd_above S \<and> S \<noteq> {})"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
628  | 
    then have "upper = UNIV \<or> upper = {}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
629  | 
by (auto simp: upper_def bdd_above_def not_le dest: less_imp_le)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
630  | 
then show ?thesis  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
631  | 
by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
632  | 
qed  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
633  | 
moreover  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
634  | 
  have "\<exists>b. lower = UNIV \<or> lower = {} \<or> lower = {b ..} \<or> lower = {b <..}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
635  | 
proof cases  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
636  | 
    assume *: "bdd_below S \<and> S \<noteq> {}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
637  | 
    from * have "lower \<subseteq> {Inf S ..}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
638  | 
by (auto simp: lower_def intro: cInf_lower2)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
639  | 
    moreover from * have "{Inf S <..} \<subseteq> lower"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
640  | 
by (force simp add: cInf_less_iff lower_def subset_eq Ball_def)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
641  | 
    ultimately have "lower = {Inf S ..} \<or> lower = {Inf S <..}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
642  | 
unfolding ivl_disj_un(1)[symmetric] by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
643  | 
then show ?thesis by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
644  | 
next  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
645  | 
    assume "\<not> (bdd_below S \<and> S \<noteq> {})"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
646  | 
    then have "lower = UNIV \<or> lower = {}"
 | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
647  | 
by (auto simp: lower_def bdd_below_def not_le dest: less_imp_le)  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
648  | 
then show ?thesis  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
649  | 
by auto  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
650  | 
qed  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
651  | 
ultimately show ?thesis  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
652  | 
unfolding greaterThanAtMost_def greaterThanLessThan_def atLeastAtMost_def atLeastLessThan_def  | 
| 63171 | 653  | 
by (metis inf_bot_left inf_bot_right inf_top.left_neutral inf_top.right_neutral)  | 
| 
57275
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
654  | 
qed  | 
| 
 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 
hoelzl 
parents: 
56218 
diff
changeset
 | 
655  | 
|
| 
60615
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
656  | 
lemma cSUP_eq_cINF_D:  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
657  | 
fixes f :: "_ \<Rightarrow> 'b::conditionally_complete_lattice"  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
658  | 
assumes eq: "(SUP x:A. f x) = (INF x:A. f x)"  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
659  | 
and bdd: "bdd_above (f ` A)" "bdd_below (f ` A)"  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
660  | 
and a: "a \<in> A"  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
661  | 
shows "f a = (INF x:A. f x)"  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
662  | 
apply (rule antisym)  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
663  | 
using a bdd  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
664  | 
apply (auto simp: cINF_lower)  | 
| 
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
665  | 
apply (metis eq cSUP_upper)  | 
| 63331 | 666  | 
done  | 
| 
60615
 
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
 
paulson <lp15@cam.ac.uk> 
parents: 
60172 
diff
changeset
 | 
667  | 
|
| 
62379
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
668  | 
lemma cSUP_UNION:  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
669  | 
fixes f :: "_ \<Rightarrow> 'b::conditionally_complete_lattice"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
670  | 
  assumes ne: "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> B(x) \<noteq> {}"
 | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
671  | 
and bdd_UN: "bdd_above (\<Union>x\<in>A. f ` B x)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
672  | 
shows "(SUP z : \<Union>x\<in>A. B x. f z) = (SUP x:A. SUP z:B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
673  | 
proof -  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
674  | 
have bdd: "\<And>x. x \<in> A \<Longrightarrow> bdd_above (f ` B x)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
675  | 
using bdd_UN by (meson UN_upper bdd_above_mono)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
676  | 
obtain M where "\<And>x y. x \<in> A \<Longrightarrow> y \<in> B(x) \<Longrightarrow> f y \<le> M"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
677  | 
using bdd_UN by (auto simp: bdd_above_def)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
678  | 
then have bdd2: "bdd_above ((\<lambda>x. SUP z:B x. f z) ` A)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
679  | 
unfolding bdd_above_def by (force simp: bdd cSUP_le_iff ne(2))  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
680  | 
have "(SUP z:\<Union>x\<in>A. B x. f z) \<le> (SUP x:A. SUP z:B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
681  | 
using assms by (fastforce simp add: intro!: cSUP_least intro: cSUP_upper2 simp: bdd2 bdd)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
682  | 
moreover have "(SUP x:A. SUP z:B x. f z) \<le> (SUP z:\<Union>x\<in>A. B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
683  | 
using assms by (fastforce simp add: intro!: cSUP_least intro: cSUP_upper simp: image_UN bdd_UN)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
684  | 
ultimately show ?thesis  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
685  | 
by (rule order_antisym)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
686  | 
qed  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
687  | 
|
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
688  | 
lemma cINF_UNION:  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
689  | 
fixes f :: "_ \<Rightarrow> 'b::conditionally_complete_lattice"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
690  | 
  assumes ne: "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> B(x) \<noteq> {}"
 | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
691  | 
and bdd_UN: "bdd_below (\<Union>x\<in>A. f ` B x)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
692  | 
shows "(INF z : \<Union>x\<in>A. B x. f z) = (INF x:A. INF z:B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
693  | 
proof -  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
694  | 
have bdd: "\<And>x. x \<in> A \<Longrightarrow> bdd_below (f ` B x)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
695  | 
using bdd_UN by (meson UN_upper bdd_below_mono)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
696  | 
obtain M where "\<And>x y. x \<in> A \<Longrightarrow> y \<in> B(x) \<Longrightarrow> f y \<ge> M"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
697  | 
using bdd_UN by (auto simp: bdd_below_def)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
698  | 
then have bdd2: "bdd_below ((\<lambda>x. INF z:B x. f z) ` A)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
699  | 
unfolding bdd_below_def by (force simp: bdd le_cINF_iff ne(2))  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
700  | 
have "(INF z:\<Union>x\<in>A. B x. f z) \<le> (INF x:A. INF z:B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
701  | 
using assms by (fastforce simp add: intro!: cINF_greatest intro: cINF_lower simp: bdd2 bdd)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
702  | 
moreover have "(INF x:A. INF z:B x. f z) \<le> (INF z:\<Union>x\<in>A. B x. f z)"  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
703  | 
using assms by (fastforce simp add: intro!: cINF_greatest intro: cINF_lower2 simp: bdd bdd_UN bdd2)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
704  | 
ultimately show ?thesis  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
705  | 
by (rule order_antisym)  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
706  | 
qed  | 
| 
 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 
paulson <lp15@cam.ac.uk> 
parents: 
62343 
diff
changeset
 | 
707  | 
|
| 63331 | 708  | 
lemma cSup_abs_le:  | 
| 
62626
 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 
paulson <lp15@cam.ac.uk> 
parents: 
62379 
diff
changeset
 | 
709  | 
  fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set"
 | 
| 
 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 
paulson <lp15@cam.ac.uk> 
parents: 
62379 
diff
changeset
 | 
710  | 
  shows "S \<noteq> {} \<Longrightarrow> (\<And>x. x\<in>S \<Longrightarrow> \<bar>x\<bar> \<le> a) \<Longrightarrow> \<bar>Sup S\<bar> \<le> a"
 | 
| 
 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 
paulson <lp15@cam.ac.uk> 
parents: 
62379 
diff
changeset
 | 
711  | 
apply (auto simp add: abs_le_iff intro: cSup_least)  | 
| 
 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 
paulson <lp15@cam.ac.uk> 
parents: 
62379 
diff
changeset
 | 
712  | 
by (metis bdd_aboveI cSup_upper neg_le_iff_le order_trans)  | 
| 
 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 
paulson <lp15@cam.ac.uk> 
parents: 
62379 
diff
changeset
 | 
713  | 
|
| 54281 | 714  | 
end  |