src/HOL/MicroJava/BV/Semilat.thy
author wenzelm
Tue, 10 Jul 2007 23:29:43 +0200
changeset 23719 ccd9cb15c062
parent 22271 51a80e238b29
child 23757 087b0a241557
permissions -rw-r--r--
more markup for inner and outer syntax; added enclose;
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
 order :: "'a ord \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    44
"order r == (!x. x <=_r x) &
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    45
            (!x y. x <=_r y & y <=_r x \<longrightarrow> x=y) &
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    46
            (!x y z. x <=_r y & y <=_r z \<longrightarrow> x <=_r z)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    47
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    48
 acc :: "'a ord \<Rightarrow> bool"
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    49
"acc r == wfP (\<lambda>y x. x <_r y)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    50
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    51
 top :: "'a ord \<Rightarrow> 'a \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    52
"top r T == !x. x <=_r T"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    53
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    54
 closed :: "'a set \<Rightarrow> 'a binop \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    55
"closed A f == !x:A. !y:A. x +_f y : A"
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    56
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    57
 semilat :: "'a sl \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    58
"semilat == %(A,r,f). order r & closed A f &
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    59
                (!x:A. !y:A. x <=_r x +_f y)  &
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    60
                (!x:A. !y:A. y <=_r x +_f y)  &
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    61
                (!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
    62
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    63
 is_ub :: "'a ord \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    64
"is_ub r x y u == r x u & r y u"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    65
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    66
 is_lub :: "'a ord \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    67
"is_lub r x y u == is_ub r x y u & (!z. is_ub r x y z \<longrightarrow> r u z)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    68
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
    69
 some_lub :: "'a ord \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'a"
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    70
"some_lub r x y == SOME z. is_lub r x y z";
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    71
13365
a2c4faad4d35 adapted to locale defs;
wenzelm
parents: 13077
diff changeset
    72
locale (open) semilat =
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    73
  fixes A :: "'a set"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    74
    and r :: "'a ord"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    75
    and f :: "'a binop"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    76
  assumes semilat: "semilat(A,r,f)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    77
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    78
lemma order_refl [simp, intro]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    79
  "order r \<Longrightarrow> x <=_r x";
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    80
  by (simp add: order_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    81
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    82
lemma order_antisym:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    83
  "\<lbrakk> order r; x <=_r y; y <=_r x \<rbrakk> \<Longrightarrow> x = y"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    84
apply (unfold order_def)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
    85
apply (simp (no_asm_simp))
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    86
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    87
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    88
lemma order_trans:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    89
   "\<lbrakk> order r; x <=_r y; y <=_r z \<rbrakk> \<Longrightarrow> x <=_r z"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    90
apply (unfold order_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    91
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    92
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    93
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    94
lemma order_less_irrefl [intro, simp]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    95
   "order r \<Longrightarrow> ~ x <_r x"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    96
apply (unfold order_def lesssub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    97
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    98
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
    99
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   100
lemma order_less_trans:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   101
  "\<lbrakk> order r; x <_r y; y <_r z \<rbrakk> \<Longrightarrow> x <_r z"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   102
apply (unfold order_def lesssub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   103
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   104
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   105
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   106
lemma topD [simp, intro]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   107
  "top r T \<Longrightarrow> x <=_r T"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   108
  by (simp add: top_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   109
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   110
lemma top_le_conv [simp]:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   111
  "\<lbrakk> order r; top r T \<rbrakk> \<Longrightarrow> (T <=_r x) = (x = T)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   112
  by (blast intro: order_antisym)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   113
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   114
lemma semilat_Def:
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   115
"semilat(A,r,f) == order r & closed A f & 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   116
                 (!x:A. !y:A. x <=_r x +_f y) & 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   117
                 (!x:A. !y:A. y <=_r x +_f y) & 
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   118
                 (!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
   119
apply (unfold semilat_def split_conv [THEN eq_reflection])
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   120
apply (rule refl [THEN eq_reflection])
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   121
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   122
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   123
lemma (in semilat) orderI [simp, intro]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   124
  "order r"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   125
  by (insert semilat) (simp add: semilat_Def)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   126
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   127
lemma (in semilat) closedI [simp, intro]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   128
  "closed A f"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   129
  by (insert semilat) (simp add: semilat_Def)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   130
13077
kleing
parents: 13074
diff changeset
   131
lemma closedD:
kleing
parents: 13074
diff changeset
   132
  "\<lbrakk> closed A f; x:A; y:A \<rbrakk> \<Longrightarrow> x +_f y : A"
kleing
parents: 13074
diff changeset
   133
  by (unfold closed_def) blast
kleing
parents: 13074
diff changeset
   134
kleing
parents: 13074
diff changeset
   135
lemma closed_UNIV [simp]: "closed UNIV f"
kleing
parents: 13074
diff changeset
   136
  by (simp add: closed_def)
kleing
parents: 13074
diff changeset
   137
kleing
parents: 13074
diff changeset
   138
kleing
parents: 13074
diff changeset
   139
lemma (in semilat) closed_f [simp, intro]:
kleing
parents: 13074
diff changeset
   140
  "\<lbrakk>x:A; y:A\<rbrakk>  \<Longrightarrow> x +_f y : A"
kleing
parents: 13074
diff changeset
   141
  by (simp add: closedD [OF closedI])
kleing
parents: 13074
diff changeset
   142
kleing
parents: 13074
diff changeset
   143
lemma (in semilat) refl_r [intro, simp]:
kleing
parents: 13074
diff changeset
   144
  "x <=_r x"
kleing
parents: 13074
diff changeset
   145
  by simp
kleing
parents: 13074
diff changeset
   146
kleing
parents: 13074
diff changeset
   147
lemma (in semilat) antisym_r [intro?]:
kleing
parents: 13074
diff changeset
   148
  "\<lbrakk> x <=_r y; y <=_r x \<rbrakk> \<Longrightarrow> x = y"
kleing
parents: 13074
diff changeset
   149
  by (rule order_antisym) auto
kleing
parents: 13074
diff changeset
   150
  
kleing
parents: 13074
diff changeset
   151
lemma (in semilat) trans_r [trans, intro?]:
kleing
parents: 13074
diff changeset
   152
  "\<lbrakk>x <=_r y; y <=_r z\<rbrakk> \<Longrightarrow> x <=_r z"
kleing
parents: 13074
diff changeset
   153
  by (auto intro: order_trans)    
kleing
parents: 13074
diff changeset
   154
  
kleing
parents: 13074
diff changeset
   155
kleing
parents: 13074
diff changeset
   156
lemma (in semilat) ub1 [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   157
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> x <=_r x +_f y"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   158
  by (insert semilat) (unfold semilat_Def, simp)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   159
13077
kleing
parents: 13074
diff changeset
   160
lemma (in semilat) ub2 [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   161
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> y <=_r x +_f y"
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   162
  by (insert semilat) (unfold semilat_Def, simp)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   163
13077
kleing
parents: 13074
diff changeset
   164
lemma (in semilat) lub [simp, intro?]:
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   165
 "\<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
   166
  by (insert semilat) (unfold semilat_Def, simp)
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   167
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   168
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   169
lemma (in semilat) plus_le_conv [simp]:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   170
  "\<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
   171
  by (blast intro: ub1 ub2 lub order_trans)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   172
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   173
lemma (in semilat) le_iff_plus_unchanged:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   174
  "\<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
   175
apply (rule iffI)
13077
kleing
parents: 13074
diff changeset
   176
 apply (blast intro: antisym_r refl_r lub ub2)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   177
apply (erule subst)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   178
apply simp
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   179
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   180
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   181
lemma (in semilat) le_iff_plus_unchanged2:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   182
  "\<lbrakk> x:A; y:A \<rbrakk> \<Longrightarrow> (x <=_r y) = (y +_f x = y)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   183
apply (rule iffI)
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   184
 apply (blast intro: order_antisym lub order_refl ub1)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   185
apply (erule subst)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   186
apply simp
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   187
done 
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   188
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   189
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   190
lemma (in semilat) plus_assoc [simp]:
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   191
  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
   192
  shows "a +_f (b +_f c) = a +_f b +_f c"
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   193
proof -
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   194
  from a b have ab: "a +_f b \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   195
  from this c have abc: "(a +_f b) +_f c \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   196
  from b c have bc: "b +_f c \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   197
  from a this have abc': "a +_f (b +_f c) \<in> A" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   198
13077
kleing
parents: 13074
diff changeset
   199
  show ?thesis
kleing
parents: 13074
diff changeset
   200
  proof    
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   201
    show "a +_f (b +_f c) <=_r (a +_f b) +_f c"
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   202
    proof -
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   203
      from a b have "a <=_r a +_f b" .. 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   204
      also from ab c have "\<dots> <=_r \<dots> +_f c" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   205
      finally have "a<": "a <=_r (a +_f b) +_f c" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   206
      from a b have "b <=_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 "b<": "b <=_r (a +_f b) +_f c" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   209
      from ab c have "c<": "c <=_r (a +_f b) +_f c" ..    
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   210
      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
   211
      from "a<" this a bc abc show ?thesis ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   212
    qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   213
    show "(a +_f b) +_f c <=_r a +_f (b +_f c)" 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   214
    proof -
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   215
      from b c have "b <=_r b +_f c" .. 
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   216
      also from a bc have "\<dots> <=_r a +_f \<dots>" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   217
      finally have "b<": "b <=_r a +_f (b +_f c)" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   218
      from b c have "c <=_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 "c<": "c <=_r a +_f (b +_f c)" .
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   221
      from a bc have "a<": "a <=_r a +_f (b +_f c)" ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   222
      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
   223
      from this "c<" ab c abc' show ?thesis ..
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   224
    qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   225
  qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   226
qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   227
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   228
lemma (in semilat) plus_com_lemma:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   229
  "\<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
   230
proof -
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   231
  assume a: "a \<in> A" and b: "b \<in> A"  
13077
kleing
parents: 13074
diff changeset
   232
  from b a have "a <=_r b +_f a" .. 
kleing
parents: 13074
diff changeset
   233
  moreover from b a have "b <=_r b +_f a" ..
kleing
parents: 13074
diff changeset
   234
  moreover note a b
kleing
parents: 13074
diff changeset
   235
  moreover from b a have "b +_f a \<in> A" ..
kleing
parents: 13074
diff changeset
   236
  ultimately show ?thesis ..
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   237
qed
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   238
13074
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   239
lemma (in semilat) plus_commutative:
96bf406fd3e5 Started to convert to locales
nipkow
parents: 13068
diff changeset
   240
  "\<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
   241
by(blast intro: order_antisym plus_com_lemma)
13068
472b1c91b09f +_f is associative and commutative
kleing
parents: 13006
diff changeset
   242
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   243
lemma is_lubD:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   244
  "is_lub r x y u \<Longrightarrow> is_ub r x y u & (!z. is_ub r x y z \<longrightarrow> r u z)"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   245
  by (simp add: is_lub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   246
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   247
lemma is_ubI:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   248
  "\<lbrakk> r x u; r y u \<rbrakk> \<Longrightarrow> is_ub r x y u"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   249
  by (simp add: is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   250
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   251
lemma is_ubD:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   252
  "is_ub r x y u \<Longrightarrow> r x u & r y u"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   253
  by (simp add: is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   254
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   255
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   256
lemma is_lub_bigger1 [iff]:  
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   257
  "is_lub (r^** ) x y y = r^** x y"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   258
apply (unfold is_lub_def is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   259
apply blast
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   260
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   261
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   262
lemma is_lub_bigger2 [iff]:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   263
  "is_lub (r^** ) x y x = r^** y x"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   264
apply (unfold is_lub_def is_ub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   265
apply blast 
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   266
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   267
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   268
lemma extend_lub:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   269
  "\<lbrakk> single_valuedP r; is_lub (r^** ) x y u; r x' x \<rbrakk> 
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   270
  \<Longrightarrow> EX v. is_lub (r^** ) x' y v"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   271
apply (unfold is_lub_def is_ub_def)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   272
apply (case_tac "r^** y x")
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   273
 apply (case_tac "r^** y x'")
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   274
  apply blast
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   275
 apply (blast elim: converse_rtranclE' dest: single_valuedD)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   276
apply (rule exI)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   277
apply (rule conjI)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   278
 apply (blast intro: converse_rtrancl_into_rtrancl' dest: single_valuedD)
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   279
apply (blast intro: rtrancl.rtrancl_into_rtrancl converse_rtrancl_into_rtrancl'
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   280
             elim: converse_rtranclE' dest: single_valuedD)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   281
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   282
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10496
diff changeset
   283
lemma single_valued_has_lubs [rule_format]:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   284
  "\<lbrakk> single_valuedP r; r^** x u \<rbrakk> \<Longrightarrow> (!y. r^** y u \<longrightarrow> 
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   285
  (EX z. is_lub (r^** ) x y z))"
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   286
apply (erule converse_rtrancl_induct')
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   287
 apply clarify
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   288
 apply (erule converse_rtrancl_induct')
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   289
  apply blast
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   290
 apply (blast intro: converse_rtrancl_into_rtrancl')
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   291
apply (blast intro: extend_lub)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   292
done
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   293
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   294
lemma some_lub_conv:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   295
  "\<lbrakk> acyclicP 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
   296
apply (unfold some_lub_def is_lub_def)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   297
apply (rule someI2)
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   298
 apply assumption
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   299
apply (blast intro: antisymD dest!: acyclic_impl_antisym_rtrancl [to_pred])
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   300
done
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   301
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   302
lemma is_lub_some_lub:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   303
  "\<lbrakk> single_valuedP r; acyclicP r; r^** x u; r^** y u \<rbrakk> 
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   304
  \<Longrightarrow> is_lub (r^** ) x y (some_lub (r^** ) x y)";
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10496
diff changeset
   305
  by (fastsimp dest: single_valued_has_lubs simp add: some_lub_conv)
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   306
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   307
subsection{*An executable lub-finder*}
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   308
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   309
constdefs
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   310
 exec_lub :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> 'a binop"
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   311
"exec_lub r f x y == while (\<lambda>z. \<not> r\<^sup>*\<^sup>* x z) f y"
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   312
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   313
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   314
lemma acyclic_single_valued_finite:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   315
 "\<lbrakk>acyclicP r; single_valuedP r; r\<^sup>*\<^sup>* x y \<rbrakk>
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   316
  \<Longrightarrow> finite (Collect2 r \<inter> {a. r\<^sup>*\<^sup>* x a} \<times> {b. r\<^sup>*\<^sup>* b y})"
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   317
apply(erule converse_rtrancl_induct')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   318
 apply(rule_tac B = "{}" in finite_subset)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   319
  apply(simp only:acyclic_def [to_pred])
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   320
  apply(blast intro:rtrancl_into_trancl2' rtrancl_trancl_trancl')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   321
 apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   322
apply(rename_tac x x')
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   323
apply(subgoal_tac "Collect2 r \<inter> {a. r\<^sup>*\<^sup>* x a} \<times> {b. r\<^sup>*\<^sup>* b y} =
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   324
                   insert (x,x') (Collect2 r \<inter> {a. r\<^sup>*\<^sup>* x' a} \<times> {b. r\<^sup>*\<^sup>* b y})")
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   325
 apply simp
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   326
apply(blast intro:converse_rtrancl_into_rtrancl'
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   327
            elim:converse_rtranclE' dest:single_valuedD)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   328
done
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   329
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   330
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   331
lemma exec_lub_conv:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   332
  "\<lbrakk> acyclicP r; !x y. r x y \<longrightarrow> f x = y; is_lub (r\<^sup>*\<^sup>*) x y u \<rbrakk> \<Longrightarrow>
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   333
  exec_lub r f x y = u";
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   334
apply(unfold exec_lub_def)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   335
apply(rule_tac P = "\<lambda>z. r\<^sup>*\<^sup>* y z \<and> r\<^sup>*\<^sup>* z u" and
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   336
               r = "(Collect2 r \<inter> {(a,b). r\<^sup>*\<^sup>* y a \<and> r\<^sup>*\<^sup>* b u})^-1" in while_rule)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   337
    apply(blast dest: is_lubD is_ubD)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   338
   apply(erule conjE)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   339
   apply(erule_tac z = u in converse_rtranclE')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   340
    apply(blast dest: is_lubD is_ubD)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   341
   apply(blast dest: rtrancl.rtrancl_into_rtrancl)
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   342
  apply(rename_tac s)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   343
  apply(subgoal_tac "is_ub (r\<^sup>*\<^sup>*) x y s")
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   344
   prefer 2; apply(simp add:is_ub_def)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   345
  apply(subgoal_tac "r\<^sup>*\<^sup>* u s")
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   346
   prefer 2; apply(blast dest:is_lubD)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   347
  apply(erule converse_rtranclE')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   348
   apply blast
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   349
  apply(simp only:acyclic_def [to_pred])
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   350
  apply(blast intro:rtrancl_into_trancl2' rtrancl_trancl_trancl')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   351
 apply(rule finite_acyclic_wf)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   352
  apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   353
  apply(erule acyclic_single_valued_finite)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   354
   apply(blast intro:single_valuedI)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   355
  apply(simp add:is_lub_def is_ub_def)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   356
 apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   357
 apply(erule acyclic_subset)
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   358
 apply blast
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   359
apply simp
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   360
apply(erule conjE)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   361
apply(erule_tac z = u in converse_rtranclE')
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   362
 apply(blast dest: is_lubD is_ubD)
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   363
apply blast
12542
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   364
done
ff5e3f11e1ef added exec_lub
nipkow
parents: 12516
diff changeset
   365
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   366
lemma is_lub_exec_lub:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   367
  "\<lbrakk> single_valuedP r; acyclicP r; r^** x u; r^** y u; !x y. r x y \<longrightarrow> f x = y \<rbrakk>
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   368
  \<Longrightarrow> is_lub (r^** ) x y (exec_lub r f x y)"
12773
a47f51daa6dc use exec_lub instead of some_lub
kleing
parents: 12566
diff changeset
   369
  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
   370
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents:
diff changeset
   371
end