1 (* Title: HOL/Real/HahnBanach/Bounds.thy |
|
2 Author: Gertrud Bauer, TU Munich |
|
3 *) |
|
4 |
|
5 header {* Bounds *} |
|
6 |
|
7 theory Bounds |
|
8 imports Main ContNotDenum |
|
9 begin |
|
10 |
|
11 locale lub = |
|
12 fixes A and x |
|
13 assumes least [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> a \<le> b) \<Longrightarrow> x \<le> b" |
|
14 and upper [intro?]: "a \<in> A \<Longrightarrow> a \<le> x" |
|
15 |
|
16 lemmas [elim?] = lub.least lub.upper |
|
17 |
|
18 definition |
|
19 the_lub :: "'a::order set \<Rightarrow> 'a" where |
|
20 "the_lub A = The (lub A)" |
|
21 |
|
22 notation (xsymbols) |
|
23 the_lub ("\<Squnion>_" [90] 90) |
|
24 |
|
25 lemma the_lub_equality [elim?]: |
|
26 assumes "lub A x" |
|
27 shows "\<Squnion>A = (x::'a::order)" |
|
28 proof - |
|
29 interpret lub A x by fact |
|
30 show ?thesis |
|
31 proof (unfold the_lub_def) |
|
32 from `lub A x` show "The (lub A) = x" |
|
33 proof |
|
34 fix x' assume lub': "lub A x'" |
|
35 show "x' = x" |
|
36 proof (rule order_antisym) |
|
37 from lub' show "x' \<le> x" |
|
38 proof |
|
39 fix a assume "a \<in> A" |
|
40 then show "a \<le> x" .. |
|
41 qed |
|
42 show "x \<le> x'" |
|
43 proof |
|
44 fix a assume "a \<in> A" |
|
45 with lub' show "a \<le> x'" .. |
|
46 qed |
|
47 qed |
|
48 qed |
|
49 qed |
|
50 qed |
|
51 |
|
52 lemma the_lubI_ex: |
|
53 assumes ex: "\<exists>x. lub A x" |
|
54 shows "lub A (\<Squnion>A)" |
|
55 proof - |
|
56 from ex obtain x where x: "lub A x" .. |
|
57 also from x have [symmetric]: "\<Squnion>A = x" .. |
|
58 finally show ?thesis . |
|
59 qed |
|
60 |
|
61 lemma lub_compat: "lub A x = isLub UNIV A x" |
|
62 proof - |
|
63 have "isUb UNIV A = (\<lambda>x. A *<= x \<and> x \<in> UNIV)" |
|
64 by (rule ext) (simp only: isUb_def) |
|
65 then show ?thesis |
|
66 by (simp only: lub_def isLub_def leastP_def setge_def setle_def) blast |
|
67 qed |
|
68 |
|
69 lemma real_complete: |
|
70 fixes A :: "real set" |
|
71 assumes nonempty: "\<exists>a. a \<in> A" |
|
72 and ex_upper: "\<exists>y. \<forall>a \<in> A. a \<le> y" |
|
73 shows "\<exists>x. lub A x" |
|
74 proof - |
|
75 from ex_upper have "\<exists>y. isUb UNIV A y" |
|
76 unfolding isUb_def setle_def by blast |
|
77 with nonempty have "\<exists>x. isLub UNIV A x" |
|
78 by (rule reals_complete) |
|
79 then show ?thesis by (simp only: lub_compat) |
|
80 qed |
|
81 |
|
82 end |
|