src/HOL/Real/Lubs.thy
author nipkow
Wed Aug 18 11:09:40 2004 +0200 (2004-08-18)
changeset 15140 322485b816ac
parent 15131 c69542757a4d
child 19765 dfe940911617
permissions -rw-r--r--
import -> imports
paulson@5078
     1
(*  Title       : Lubs.thy
paulson@7219
     2
    ID          : $Id$
paulson@5078
     3
    Author      : Jacques D. Fleuriot
paulson@5078
     4
    Copyright   : 1998  University of Cambridge
paulson@14368
     5
*)
paulson@5078
     6
paulson@14368
     7
header{*Definitions of Upper Bounds and Least Upper Bounds*}
paulson@5078
     8
nipkow@15131
     9
theory Lubs
nipkow@15140
    10
imports Main
nipkow@15131
    11
begin
paulson@5078
    12
paulson@14368
    13
text{*Thanks to suggestions by James Margetson*}
paulson@5078
    14
paulson@5078
    15
constdefs
paulson@14368
    16
paulson@14368
    17
  setle :: "['a set, 'a::ord] => bool"     (infixl "*<=" 70)
paulson@14368
    18
    "S *<= x    == (ALL y: S. y <= x)"
paulson@14368
    19
paulson@14368
    20
  setge :: "['a::ord, 'a set] => bool"     (infixl "<=*" 70)
paulson@14368
    21
    "x <=* S    == (ALL y: S. x <= y)"
paulson@14368
    22
paulson@14368
    23
  leastP      :: "['a =>bool,'a::ord] => bool"
paulson@5078
    24
    "leastP P x == (P x & x <=* Collect P)"
paulson@5078
    25
wenzelm@14653
    26
  isUb        :: "['a set, 'a set, 'a::ord] => bool"
wenzelm@14653
    27
    "isUb R S x   == S *<= x & x: R"
wenzelm@14653
    28
paulson@14368
    29
  isLub       :: "['a set, 'a set, 'a::ord] => bool"
paulson@5078
    30
    "isLub R S x  == leastP (isUb R S) x"
paulson@5078
    31
paulson@14368
    32
  ubs         :: "['a set, 'a::ord set] => 'a set"
paulson@5078
    33
    "ubs R S      == Collect (isUb R S)"
paulson@5078
    34
paulson@14368
    35
paulson@14368
    36
paulson@14368
    37
subsection{*Rules for the Relations @{text "*<="} and @{text "<=*"}*}
paulson@14368
    38
paulson@14368
    39
lemma setleI: "ALL y: S. y <= x ==> S *<= x"
paulson@14368
    40
by (simp add: setle_def)
paulson@14368
    41
paulson@14368
    42
lemma setleD: "[| S *<= x; y: S |] ==> y <= x"
paulson@14368
    43
by (simp add: setle_def)
paulson@14368
    44
paulson@14368
    45
lemma setgeI: "ALL y: S. x<= y ==> x <=* S"
paulson@14368
    46
by (simp add: setge_def)
paulson@14368
    47
paulson@14368
    48
lemma setgeD: "[| x <=* S; y: S |] ==> x <= y"
paulson@14368
    49
by (simp add: setge_def)
paulson@14368
    50
paulson@14368
    51
paulson@14368
    52
subsection{*Rules about the Operators @{term leastP}, @{term ub}
paulson@14368
    53
    and @{term lub}*}
paulson@14368
    54
paulson@14368
    55
lemma leastPD1: "leastP P x ==> P x"
paulson@14368
    56
by (simp add: leastP_def)
paulson@14368
    57
paulson@14368
    58
lemma leastPD2: "leastP P x ==> x <=* Collect P"
paulson@14368
    59
by (simp add: leastP_def)
paulson@14368
    60
paulson@14368
    61
lemma leastPD3: "[| leastP P x; y: Collect P |] ==> x <= y"
paulson@14368
    62
by (blast dest!: leastPD2 setgeD)
paulson@14368
    63
paulson@14368
    64
lemma isLubD1: "isLub R S x ==> S *<= x"
paulson@14368
    65
by (simp add: isLub_def isUb_def leastP_def)
paulson@14368
    66
paulson@14368
    67
lemma isLubD1a: "isLub R S x ==> x: R"
paulson@14368
    68
by (simp add: isLub_def isUb_def leastP_def)
paulson@14368
    69
paulson@14368
    70
lemma isLub_isUb: "isLub R S x ==> isUb R S x"
paulson@14368
    71
apply (simp add: isUb_def)
paulson@14368
    72
apply (blast dest: isLubD1 isLubD1a)
paulson@14368
    73
done
paulson@14368
    74
paulson@14368
    75
lemma isLubD2: "[| isLub R S x; y : S |] ==> y <= x"
paulson@14368
    76
by (blast dest!: isLubD1 setleD)
paulson@14368
    77
paulson@14368
    78
lemma isLubD3: "isLub R S x ==> leastP(isUb R S) x"
paulson@14368
    79
by (simp add: isLub_def)
paulson@14368
    80
paulson@14368
    81
lemma isLubI1: "leastP(isUb R S) x ==> isLub R S x"
paulson@14368
    82
by (simp add: isLub_def)
paulson@14368
    83
paulson@14368
    84
lemma isLubI2: "[| isUb R S x; x <=* Collect (isUb R S) |] ==> isLub R S x"
paulson@14368
    85
by (simp add: isLub_def leastP_def)
paulson@5078
    86
paulson@14368
    87
lemma isUbD: "[| isUb R S x; y : S |] ==> y <= x"
paulson@14368
    88
by (simp add: isUb_def setle_def)
paulson@14368
    89
paulson@14368
    90
lemma isUbD2: "isUb R S x ==> S *<= x"
paulson@14368
    91
by (simp add: isUb_def)
paulson@14368
    92
paulson@14368
    93
lemma isUbD2a: "isUb R S x ==> x: R"
paulson@14368
    94
by (simp add: isUb_def)
paulson@14368
    95
paulson@14368
    96
lemma isUbI: "[| S *<= x; x: R |] ==> isUb R S x"
paulson@14368
    97
by (simp add: isUb_def)
paulson@14368
    98
paulson@14368
    99
lemma isLub_le_isUb: "[| isLub R S x; isUb R S y |] ==> x <= y"
paulson@14368
   100
apply (simp add: isLub_def)
paulson@14368
   101
apply (blast intro!: leastPD3)
paulson@14368
   102
done
paulson@14368
   103
paulson@14368
   104
lemma isLub_ubs: "isLub R S x ==> x <=* ubs R S"
paulson@14368
   105
apply (simp add: ubs_def isLub_def)
paulson@14368
   106
apply (erule leastPD2)
paulson@14368
   107
done
paulson@5078
   108
paulson@14368
   109
ML
paulson@14368
   110
{*
paulson@14368
   111
val setle_def = thm "setle_def";
paulson@14368
   112
val setge_def = thm "setge_def";
paulson@14368
   113
val leastP_def = thm "leastP_def";
paulson@14368
   114
val isLub_def = thm "isLub_def";
paulson@14368
   115
val isUb_def = thm "isUb_def";
paulson@14368
   116
val ubs_def = thm "ubs_def";
paulson@5078
   117
paulson@14368
   118
val setleI = thm "setleI";
paulson@14368
   119
val setleD = thm "setleD";
paulson@14368
   120
val setgeI = thm "setgeI";
paulson@14368
   121
val setgeD = thm "setgeD";
paulson@14368
   122
val leastPD1 = thm "leastPD1";
paulson@14368
   123
val leastPD2 = thm "leastPD2";
paulson@14368
   124
val leastPD3 = thm "leastPD3";
paulson@14368
   125
val isLubD1 = thm "isLubD1";
paulson@14368
   126
val isLubD1a = thm "isLubD1a";
paulson@14368
   127
val isLub_isUb = thm "isLub_isUb";
paulson@14368
   128
val isLubD2 = thm "isLubD2";
paulson@14368
   129
val isLubD3 = thm "isLubD3";
paulson@14368
   130
val isLubI1 = thm "isLubI1";
paulson@14368
   131
val isLubI2 = thm "isLubI2";
paulson@14368
   132
val isUbD = thm "isUbD";
paulson@14368
   133
val isUbD2 = thm "isUbD2";
paulson@14368
   134
val isUbD2a = thm "isUbD2a";
paulson@14368
   135
val isUbI = thm "isUbI";
paulson@14368
   136
val isLub_le_isUb = thm "isLub_le_isUb";
paulson@14368
   137
val isLub_ubs = thm "isLub_ubs";
paulson@14368
   138
*}
paulson@14368
   139
paulson@14368
   140
end