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