src/HOL/MicroJava/BV/Semilat.thy
author berghofe
Fri, 01 Jul 2005 13:54:12 +0200
changeset 16633 208ebc9311f2
parent 16417 9bc16273c2d4
child 22271 51a80e238b29
permissions -rw-r--r--
Implemented trick (due to Tobias Nipkow) for fine-tuning simplification of premises of congruence rules.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12516
d09d0f160888 exceptions
kleing
parents: 11175
diff changeset
     1
(*  Title:      HOL/MicroJava/BV/Semilat.thy
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     2
    ID:         $Id$
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     3
    Author:     Tobias Nipkow
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     4
    Copyright   2000 TUM
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     5
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     6
Semilattices
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     7
*)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
     8
12911
704713ca07ea new document
kleing
parents: 12773
diff changeset
     9
header {* 
704713ca07ea new document
kleing
parents: 12773
diff changeset
    10
  \chapter{Bytecode Verifier}\label{cha:bv}
704713ca07ea new document
kleing
parents: 12773
diff changeset
    11
  \isaheader{Semilattices} 
704713ca07ea new document
kleing
parents: 12773
diff changeset
    12
*}
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    13
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 13649
diff changeset
    14
theory Semilat imports While_Combinator begin
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    15
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    16
types 'a ord    = "'a \<Rightarrow> 'a \<Rightarrow> bool"
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    17
      'a binop  = "'a \<Rightarrow> 'a \<Rightarrow> 'a"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    18
      'a sl     = "'a set * 'a ord * 'a binop"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    19
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    20
consts
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    21
 "@lesub"   :: "'a \<Rightarrow> 'a ord \<Rightarrow> 'a \<Rightarrow> bool" ("(_ /<='__ _)" [50, 1000, 51] 50)
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    22
 "@lesssub" :: "'a \<Rightarrow> 'a ord \<Rightarrow> 'a \<Rightarrow> bool" ("(_ /<'__ _)" [50, 1000, 51] 50)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    23
defs
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    24
lesub_def:   "x <=_r y == r x y"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    25
lesssub_def: "x <_r y  == x <=_r y & x ~= y"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    26
13649
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    27
syntax (xsymbols)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    28
 "@lesub" :: "'a \<Rightarrow> 'a ord \<Rightarrow> 'a \<Rightarrow> bool" ("(_ /\<le>\<^sub>_ _)" [50, 1000, 51] 50)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    29
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    30
consts
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    31
 "@plussub" :: "'a \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'c" ("(_ /+'__ _)" [65, 1000, 66] 65)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    32
defs
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    33
plussub_def: "x +_f y == f x y"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    34
13649
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    35
syntax (xsymbols)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    36
 "@plussub" :: "'a \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'c" ("(_ /+\<^sub>_ _)" [65, 1000, 66] 65)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    37
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    38
syntax (xsymbols)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    39
 "@plussub" :: "'a \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'c" ("(_ /\<squnion>\<^sub>_ _)" [65, 1000, 66] 65)
0f562a70c07d alternative syntax
kleing
parents: 13365
diff changeset
    40
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    41
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    42
constdefs
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    43
 ord :: "('a*'a)set \<Rightarrow> 'a ord"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    44
"ord r == %x y. (x,y):r"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    45
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    46
 order :: "'a ord \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    47
"order r == (!x. x <=_r x) &
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    48
            (!x y. x <=_r y & y <=_r x \<longrightarrow> x=y) &
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    49
            (!x y z. x <=_r y & y <=_r z \<longrightarrow> x <=_r z)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    50
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    51
 acc :: "'a ord \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    52
"acc r == wf{(y,x) . x <_r y}"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    53
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    54
 top :: "'a ord \<Rightarrow> 'a \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    55
"top r T == !x. x <=_r T"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    56
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    57
 closed :: "'a set \<Rightarrow> 'a binop \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    58
"closed A f == !x:A. !y:A. x +_f y : A"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    59
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    60
 semilat :: "'a sl \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    61
"semilat == %(A,r,f). order r & closed A f &
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    62
                (!x:A. !y:A. x <=_r x +_f y)  &
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    63
                (!x:A. !y:A. y <=_r x +_f y)  &
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    64
                (!x:A. !y:A. !z:A. x <=_r z & y <=_r z \<longrightarrow> x +_f y <=_r z)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    65
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    66
 is_ub :: "('a*'a)set \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    67
"is_ub r x y u == (x,u):r & (y,u):r"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    68
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    69
 is_lub :: "('a*'a)set \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    70
"is_lub r x y u == is_ub r x y u & (!z. is_ub r x y z \<longrightarrow> (u,z):r)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    71
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    72
 some_lub :: "('a*'a)set \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a"
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    73
"some_lub r x y == SOME z. is_lub r x y z";
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    74
13365
a2c4faad4d35 adapted to locale defs;
wenzelm
parents: 13077
diff changeset
    75
locale (open) semilat =
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    76
  fixes A :: "'a set"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    77
    and r :: "'a ord"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    78
    and f :: "'a binop"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    79
  assumes semilat: "semilat(A,r,f)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    80
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    81
lemma order_refl [simp, intro]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    82
  "order r \<Longrightarrow> x <=_r x";
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    83
  by (simp add: order_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    84
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    85
lemma order_antisym:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    86
  "\<lbrakk> order r; x <=_r y; y <=_r x \<rbrakk> \<Longrightarrow> x = y"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    87
apply (unfold order_def)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    88
apply (simp (no_asm_simp))
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    89
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    90
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    91
lemma order_trans:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    92
   "\<lbrakk> order r; x <=_r y; y <=_r z \<rbrakk> \<Longrightarrow> x <=_r z"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    93
apply (unfold order_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    94
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    95
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    96
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    97
lemma order_less_irrefl [intro, simp]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    98
   "order r \<Longrightarrow> ~ x <_r x"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    99
apply (unfold order_def lesssub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   100
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   101
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   102
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   103
lemma order_less_trans:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   104
  "\<lbrakk> order r; x <_r y; y <_r z \<rbrakk> \<Longrightarrow> x <_r z"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   105
apply (unfold order_def lesssub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   106
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   107
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   108
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   109
lemma topD [simp, intro]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   110
  "top r T \<Longrightarrow> x <=_r T"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   111
  by (simp add: top_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   112
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   113
lemma top_le_conv [simp]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   114
  "\<lbrakk> order r; top r T \<rbrakk> \<Longrightarrow> (T <=_r x) = (x = T)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   115
  by (blast intro: order_antisym)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   116
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   117
lemma semilat_Def:
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   118
"semilat(A,r,f) == order r & closed A f & 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   119
                 (!x:A. !y:A. x <=_r x +_f y) & 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   120
                 (!x:A. !y:A. y <=_r x +_f y) & 
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   121
                 (!x:A. !y:A. !z:A. x <=_r z & y <=_r z \<longrightarrow> x +_f y <=_r z)"
10918
9679326489cd renamed Product_Type.split to split_conv;
wenzelm
parents: 10797
diff changeset
   122
apply (unfold semilat_def split_conv [THEN eq_reflection])
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   123
apply (rule refl [THEN eq_reflection])
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   124
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   125
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   126
lemma (in semilat) orderI [simp, intro]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   127
  "order r"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   128
  by (insert semilat) (simp add: semilat_Def)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   129
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   130
lemma (in semilat) closedI [simp, intro]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   131
  "closed A f"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   132
  by (insert semilat) (simp add: semilat_Def)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   133
13077
kleing
parents: 13074
diff changeset
   134
lemma closedD:
kleing
parents: 13074
diff changeset
   135
  "\<lbrakk> closed A f; x:A; y:A \<rbrakk> \<Longrightarrow> x +_f y : A"
kleing
parents: 13074
diff changeset
   136
  by (unfold closed_def) blast
kleing
parents: 13074
diff changeset
   137
kleing
parents: 13074
diff changeset
   138
lemma closed_UNIV [simp]: "closed UNIV f"
kleing
parents: 13074
diff changeset
   139
  by (simp add: closed_def)
kleing
parents: 13074
diff changeset
   140
kleing
parents: 13074
diff changeset
   141
kleing
parents: 13074
diff changeset
   142
lemma (in semilat) closed_f [simp, intro]:
kleing
parents: 13074
diff changeset
   143
  "\<lbrakk>x:A; y:A\<rbrakk>  \<Longrightarrow> x +_f y : A"
kleing
parents: 13074
diff changeset
   144
  by (simp add: closedD [OF closedI])
kleing
parents: 13074
diff changeset
   145
kleing
parents: 13074
diff changeset
   146
lemma (in semilat) refl_r [intro, simp]:
kleing
parents: 13074
diff changeset
   147
  "x <=_r x"
kleing
parents: 13074
diff changeset
   148
  by simp
kleing
parents: 13074
diff changeset
   149
kleing
parents: 13074
diff changeset
   150
lemma (in semilat) antisym_r [intro?]:
kleing
parents: 13074
diff changeset
   151
  "\<lbrakk> x <=_r y; y <=_r x \<rbrakk> \<Longrightarrow> x = y"
kleing
parents: 13074
diff changeset
   152
  by (rule order_antisym) auto
kleing
parents: 13074
diff changeset
   153
  
kleing
parents: 13074
diff changeset
   154
lemma (in semilat) trans_r [trans, intro?]:
kleing
parents: 13074
diff changeset
   155
  "\<lbrakk>x <=_r y; y <=_r z\<rbrakk> \<Longrightarrow> x <=_r z"
kleing
parents: 13074
diff changeset
   156
  by (auto intro: order_trans)    
kleing
parents: 13074
diff changeset
   157
  
kleing
parents: 13074
diff changeset
   158
kleing
parents: 13074
diff changeset
   159
lemma (in semilat) ub1 [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   160
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> x <=_r x +_f y"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   161
  by (insert semilat) (unfold semilat_Def, simp)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   162
13077
kleing
parents: 13074
diff changeset
   163
lemma (in semilat) ub2 [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   164
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> y <=_r x +_f y"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   165
  by (insert semilat) (unfold semilat_Def, simp)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   166
13077
kleing
parents: 13074
diff changeset
   167
lemma (in semilat) lub [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   168
 "\<lbrakk> x <=_r z; y <=_r z; x:A; y:A; z:A \<rbrakk> \<Longrightarrow> x +_f y <=_r z";
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   169
  by (insert semilat) (unfold semilat_Def, simp)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   170
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   171
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   172
lemma (in semilat) plus_le_conv [simp]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   173
  "\<lbrakk> x:A; y:A; z:A \<rbrakk> \<Longrightarrow> (x +_f y <=_r z) = (x <=_r z & y <=_r z)"
13077
kleing
parents: 13074
diff changeset
   174
  by (blast intro: ub1 ub2 lub order_trans)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   175
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   176
lemma (in semilat) le_iff_plus_unchanged:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   177
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> (x <=_r y) = (x +_f y = y)"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   178
apply (rule iffI)
13077
kleing
parents: 13074
diff changeset
   179
 apply (blast intro: antisym_r refl_r lub ub2)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   180
apply (erule subst)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   181
apply simp
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   182
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   183
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   184
lemma (in semilat) le_iff_plus_unchanged2:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   185
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> (x <=_r y) = (y +_f x = y)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   186
apply (rule iffI)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   187
 apply (blast intro: order_antisym lub order_refl ub1)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   188
apply (erule subst)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   189
apply simp
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   190
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   191
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   192
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   193
lemma (in semilat) plus_assoc [simp]:
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   194
  assumes a: "a \<in> A" and b: "b \<in> A" and c: "c \<in> A"
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   195
  shows "a +_f (b +_f c) = a +_f b +_f c"
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   196
proof -
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   197
  from a b have ab: "a +_f b \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   198
  from this c have abc: "(a +_f b) +_f c \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   199
  from b c have bc: "b +_f c \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   200
  from a this have abc': "a +_f (b +_f c) \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   201
13077
kleing
parents: 13074
diff changeset
   202
  show ?thesis
kleing
parents: 13074
diff changeset
   203
  proof    
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   204
    show "a +_f (b +_f c) <=_r (a +_f b) +_f c"
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   205
    proof -
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   206
      from a b have "a <=_r a +_f b" .. 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   207
      also from ab c have "\<dots> <=_r \<dots> +_f c" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   208
      finally have "a<": "a <=_r (a +_f b) +_f c" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   209
      from a b have "b <=_r a +_f b" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   210
      also from ab c have "\<dots> <=_r \<dots> +_f c" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   211
      finally have "b<": "b <=_r (a +_f b) +_f c" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   212
      from ab c have "c<": "c <=_r (a +_f b) +_f c" ..    
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   213
      from "b<" "c<" b c abc have "b +_f c <=_r (a +_f b) +_f c" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   214
      from "a<" this a bc abc show ?thesis ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   215
    qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   216
    show "(a +_f b) +_f c <=_r a +_f (b +_f c)" 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   217
    proof -
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   218
      from b c have "b <=_r b +_f c" .. 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   219
      also from a bc have "\<dots> <=_r a +_f \<dots>" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   220
      finally have "b<": "b <=_r a +_f (b +_f c)" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   221
      from b c have "c <=_r b +_f c" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   222
      also from a bc have "\<dots> <=_r a +_f \<dots>" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   223
      finally have "c<": "c <=_r a +_f (b +_f c)" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   224
      from a bc have "a<": "a <=_r a +_f (b +_f c)" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   225
      from "a<" "b<" a b abc' have "a +_f b <=_r a +_f (b +_f c)" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   226
      from this "c<" ab c abc' show ?thesis ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   227
    qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   228
  qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   229
qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   230
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   231
lemma (in semilat) plus_com_lemma:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   232
  "\<lbrakk>a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> a +_f b <=_r b +_f a"
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   233
proof -
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   234
  assume a: "a \<in> A" and b: "b \<in> A"  
13077
kleing
parents: 13074
diff changeset
   235
  from b a have "a <=_r b +_f a" .. 
kleing
parents: 13074
diff changeset
   236
  moreover from b a have "b <=_r b +_f a" ..
kleing
parents: 13074
diff changeset
   237
  moreover note a b
kleing
parents: 13074
diff changeset
   238
  moreover from b a have "b +_f a \<in> A" ..
kleing
parents: 13074
diff changeset
   239
  ultimately show ?thesis ..
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   240
qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   241
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   242
lemma (in semilat) plus_commutative:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   243
  "\<lbrakk>a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> a +_f b = b +_f a"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   244
by(blast intro: order_antisym plus_com_lemma)
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   245
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   246
lemma is_lubD:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   247
  "is_lub r x y u \<Longrightarrow> is_ub r x y u & (!z. is_ub r x y z \<longrightarrow> (u,z):r)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   248
  by (simp add: is_lub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   249
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   250
lemma is_ubI:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   251
  "\<lbrakk> (x,u) : r; (y,u) : r \<rbrakk> \<Longrightarrow> is_ub r x y u"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   252
  by (simp add: is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   253
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   254
lemma is_ubD:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   255
  "is_ub r x y u \<Longrightarrow> (x,u) : r & (y,u) : r"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   256
  by (simp add: is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   257
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   258
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   259
lemma is_lub_bigger1 [iff]:  
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   260
  "is_lub (r^* ) x y y = ((x,y):r^* )"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   261
apply (unfold is_lub_def is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   262
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   263
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   264
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   265
lemma is_lub_bigger2 [iff]:
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   266
  "is_lub (r^* ) x y x = ((y,x):r^* )"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   267
apply (unfold is_lub_def is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   268
apply blast 
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   269
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   270
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   271
lemma extend_lub:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   272
  "\<lbrakk> single_valued r; is_lub (r^* ) x y u; (x',x) : r \<rbrakk> 
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   273
  \<Longrightarrow> EX v. is_lub (r^* ) x' y v"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   274
apply (unfold is_lub_def is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   275
apply (case_tac "(y,x) : r^*")
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   276
 apply (case_tac "(y,x') : r^*")
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   277
  apply blast
11175
56ab6a5ba351 recoded function iter with the help of the while-combinator.
nipkow
parents: 11085
diff changeset
   278
 apply (blast elim: converse_rtranclE dest: single_valuedD)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   279
apply (rule exI)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   280
apply (rule conjI)
12566
fe20540bcf93 renamed rtrancl_into_rtrancl2 to converse_rtrancl_into_rtrancl
nipkow
parents: 12542
diff changeset
   281
 apply (blast intro: converse_rtrancl_into_rtrancl dest: single_valuedD)
fe20540bcf93 renamed rtrancl_into_rtrancl2 to converse_rtrancl_into_rtrancl
nipkow
parents: 12542
diff changeset
   282
apply (blast intro: rtrancl_into_rtrancl converse_rtrancl_into_rtrancl 
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10496
diff changeset
   283
             elim: converse_rtranclE dest: single_valuedD)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   284
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   285
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10496
diff changeset
   286
lemma single_valued_has_lubs [rule_format]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   287
  "\<lbrakk> single_valued r; (x,u) : r^* \<rbrakk> \<Longrightarrow> (!y. (y,u) : r^* \<longrightarrow> 
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   288
  (EX z. is_lub (r^* ) x y z))"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   289
apply (erule converse_rtrancl_induct)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   290
 apply clarify
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   291
 apply (erule converse_rtrancl_induct)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   292
  apply blast
12566
fe20540bcf93 renamed rtrancl_into_rtrancl2 to converse_rtrancl_into_rtrancl
nipkow
parents: 12542
diff changeset
   293
 apply (blast intro: converse_rtrancl_into_rtrancl)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   294
apply (blast intro: extend_lub)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   295
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   296
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   297
lemma some_lub_conv:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   298
  "\<lbrakk> acyclic r; is_lub (r^* ) x y u \<rbrakk> \<Longrightarrow> some_lub (r^* ) x y = u"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   299
apply (unfold some_lub_def is_lub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   300
apply (rule someI2)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   301
 apply assumption
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   302
apply (blast intro: antisymD dest!: acyclic_impl_antisym_rtrancl)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   303
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   304
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   305
lemma is_lub_some_lub:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   306
  "\<lbrakk> single_valued r; acyclic r; (x,u):r^*; (y,u):r^* \<rbrakk> 
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   307
  \<Longrightarrow> is_lub (r^* ) x y (some_lub (r^* ) x y)";
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10496
diff changeset
   308
  by (fastsimp dest: single_valued_has_lubs simp add: some_lub_conv)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   309
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   310
subsection{*An executable lub-finder*}
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   311
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   312
constdefs
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   313
 exec_lub :: "('a * 'a) set \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> 'a binop"
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   314
"exec_lub r f x y == while (\<lambda>z. (x,z) \<notin> r\<^sup>*) f y"
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   315
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   316
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   317
lemma acyclic_single_valued_finite:
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   318
 "\<lbrakk>acyclic r; single_valued r; (x,y) \<in> r\<^sup>*\<rbrakk>
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   319
  \<Longrightarrow> finite (r \<inter> {a. (x, a) \<in> r\<^sup>*} \<times> {b. (b, y) \<in> r\<^sup>*})"
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   320
apply(erule converse_rtrancl_induct)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   321
 apply(rule_tac B = "{}" in finite_subset)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   322
  apply(simp only:acyclic_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   323
  apply(blast intro:rtrancl_into_trancl2 rtrancl_trancl_trancl)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   324
 apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   325
apply(rename_tac x x')
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   326
apply(subgoal_tac "r \<inter> {a. (x,a) \<in> r\<^sup>*} \<times> {b. (b,y) \<in> r\<^sup>*} =
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   327
                   insert (x,x') (r \<inter> {a. (x', a) \<in> r\<^sup>*} \<times> {b. (b, y) \<in> r\<^sup>*})")
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   328
 apply simp
12566
fe20540bcf93 renamed rtrancl_into_rtrancl2 to converse_rtrancl_into_rtrancl
nipkow
parents: 12542
diff changeset
   329
apply(blast intro:converse_rtrancl_into_rtrancl
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   330
            elim:converse_rtranclE dest:single_valuedD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   331
done
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   332
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   333
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   334
lemma exec_lub_conv:
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   335
  "\<lbrakk> acyclic r; !x y. (x,y) \<in> r \<longrightarrow> f x = y; is_lub (r\<^sup>*) x y u \<rbrakk> \<Longrightarrow>
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   336
  exec_lub r f x y = u";
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   337
apply(unfold exec_lub_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   338
apply(rule_tac P = "\<lambda>z. (y,z) \<in> r\<^sup>* \<and> (z,u) \<in> r\<^sup>*" and
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   339
               r = "(r \<inter> {(a,b). (y,a) \<in> r\<^sup>* \<and> (b,u) \<in> r\<^sup>*})^-1" in while_rule)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   340
    apply(blast dest: is_lubD is_ubD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   341
   apply(erule conjE)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   342
   apply(erule_tac z = u in converse_rtranclE)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   343
    apply(blast dest: is_lubD is_ubD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   344
   apply(blast dest:rtrancl_into_rtrancl)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   345
  apply(rename_tac s)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   346
  apply(subgoal_tac "is_ub (r\<^sup>*) x y s")
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   347
   prefer 2; apply(simp add:is_ub_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   348
  apply(subgoal_tac "(u, s) \<in> r\<^sup>*")
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   349
   prefer 2; apply(blast dest:is_lubD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   350
  apply(erule converse_rtranclE)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   351
   apply blast
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   352
  apply(simp only:acyclic_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   353
  apply(blast intro:rtrancl_into_trancl2 rtrancl_trancl_trancl)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   354
 apply(rule finite_acyclic_wf)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   355
  apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   356
  apply(erule acyclic_single_valued_finite)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   357
   apply(blast intro:single_valuedI)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   358
  apply(simp add:is_lub_def is_ub_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   359
 apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   360
 apply(erule acyclic_subset)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   361
 apply blast
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   362
apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   363
apply(erule conjE)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   364
apply(erule_tac z = u in converse_rtranclE)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   365
 apply(blast dest: is_lubD is_ubD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   366
apply(blast dest:rtrancl_into_rtrancl)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   367
done
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   368
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   369
lemma is_lub_exec_lub:
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   370
  "\<lbrakk> single_valued r; acyclic r; (x,u):r^*; (y,u):r^*; !x y. (x,y) \<in> r \<longrightarrow> f x = y \<rbrakk>
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   371
  \<Longrightarrow> is_lub (r^* ) x y (exec_lub r f x y)"
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   372
  by (fastsimp dest: single_valued_has_lubs simp add: exec_lub_conv)
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   373
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   374
end