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