src/HOL/Real/HahnBanach/Bounds.thy
author ballarin
Tue Jul 15 16:50:09 2008 +0200 (2008-07-15)
changeset 27611 2c01c0bdb385
parent 25596 ad9e3594f3f3
child 27612 d3eb431db035
permissions -rw-r--r--
Removed uses of context element includes.
     1 (*  Title:      HOL/Real/HahnBanach/Bounds.thy
     2     ID:         $Id$
     3     Author:     Gertrud Bauer, TU Munich
     4 *)
     5 
     6 header {* Bounds *}
     7 
     8 theory Bounds
     9 imports Main Real
    10 begin
    11 
    12 locale lub =
    13   fixes A and x
    14   assumes least [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> a \<le> b) \<Longrightarrow> x \<le> b"
    15     and upper [intro?]: "a \<in> A \<Longrightarrow> a \<le> x"
    16 
    17 lemmas [elim?] = lub.least lub.upper
    18 
    19 definition
    20   the_lub :: "'a::order set \<Rightarrow> 'a" where
    21   "the_lub A = The (lub A)"
    22 
    23 notation (xsymbols)
    24   the_lub  ("\<Squnion>_" [90] 90)
    25 
    26 lemma the_lub_equality [elim?]:
    27   assumes "lub A x"
    28   shows "\<Squnion>A = (x::'a::order)"
    29 proof -
    30   interpret lub [A x] by fact
    31   show ?thesis 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     by (unfold isUb_def setle_def) 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