src/HOL/Library/Glbs.thy
author wenzelm
Wed, 04 Mar 2009 23:52:47 +0100
changeset 30267 171b3bd93c90
parent 29838 a562ca0c408d
child 30661 54858c8ad226
permissions -rw-r--r--
removed old/broken CVS Ids;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29838
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     1
(* Title:      Glbs
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     2
   Author:     Amine Chaieb, University of Cambridge
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     3
*)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     4
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     5
header{*Definitions of Lower Bounds and Greatest Lower Bounds, analogous to Lubs*}
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     6
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     7
theory Glbs
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     8
imports Lubs
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
     9
begin
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    10
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    11
definition
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    12
  greatestP      :: "['a =>bool,'a::ord] => bool" where
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    13
  "greatestP P x = (P x & Collect P *<=  x)"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    14
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    15
definition
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    16
  isLb        :: "['a set, 'a set, 'a::ord] => bool" where
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    17
  "isLb R S x = (x <=* S & x: R)"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    18
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    19
definition
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    20
  isGlb       :: "['a set, 'a set, 'a::ord] => bool" where
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    21
  "isGlb R S x = greatestP (isLb R S) x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    22
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    23
definition
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    24
  lbs         :: "['a set, 'a::ord set] => 'a set" where
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    25
  "lbs R S = Collect (isLb R S)"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    26
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    27
subsection{*Rules about the Operators @{term greatestP}, @{term isLb}
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    28
    and @{term isGlb}*}
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    29
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    30
lemma leastPD1: "greatestP P x ==> P x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    31
by (simp add: greatestP_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    32
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    33
lemma greatestPD2: "greatestP P x ==> Collect P *<= x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    34
by (simp add: greatestP_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    35
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    36
lemma greatestPD3: "[| greatestP P x; y: Collect P |] ==> x >= y"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    37
by (blast dest!: greatestPD2 setleD)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    38
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    39
lemma isGlbD1: "isGlb R S x ==> x <=* S"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    40
by (simp add: isGlb_def isLb_def greatestP_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    41
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    42
lemma isGlbD1a: "isGlb R S x ==> x: R"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    43
by (simp add: isGlb_def isLb_def greatestP_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    44
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    45
lemma isGlb_isLb: "isGlb R S x ==> isLb R S x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    46
apply (simp add: isLb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    47
apply (blast dest: isGlbD1 isGlbD1a)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    48
done
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    49
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    50
lemma isGlbD2: "[| isGlb R S x; y : S |] ==> y >= x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    51
by (blast dest!: isGlbD1 setgeD)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    52
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    53
lemma isGlbD3: "isGlb R S x ==> greatestP(isLb R S) x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    54
by (simp add: isGlb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    55
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    56
lemma isGlbI1: "greatestP(isLb R S) x ==> isGlb R S x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    57
by (simp add: isGlb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    58
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    59
lemma isGlbI2: "[| isLb R S x; Collect (isLb R S) *<= x |] ==> isGlb R S x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    60
by (simp add: isGlb_def greatestP_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    61
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    62
lemma isLbD: "[| isLb R S x; y : S |] ==> y >= x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    63
by (simp add: isLb_def setge_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    64
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    65
lemma isLbD2: "isLb R S x ==> x <=* S "
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    66
by (simp add: isLb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    67
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    68
lemma isLbD2a: "isLb R S x ==> x: R"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    69
by (simp add: isLb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    70
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    71
lemma isLbI: "[| x <=* S ; x: R |] ==> isLb R S x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    72
by (simp add: isLb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    73
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    74
lemma isGlb_le_isLb: "[| isGlb R S x; isLb R S y |] ==> x >= y"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    75
apply (simp add: isGlb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    76
apply (blast intro!: greatestPD3)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    77
done
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    78
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    79
lemma isGlb_ubs: "isGlb R S x ==> lbs R S *<= x"
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    80
apply (simp add: lbs_def isGlb_def)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    81
apply (erule greatestPD2)
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    82
done
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    83
a562ca0c408d A theory of greatest lower bounds
chaieb
parents:
diff changeset
    84
end