src/HOLCF/Porder.thy
author huffman
Mon Oct 11 16:14:15 2010 -0700 (2010-10-11)
changeset 40000 9c6ad000dc89
parent 39969 0b8e19f588a4
child 40430 483a4876e428
permissions -rw-r--r--
remove unused constant 'directed'
huffman@15600
     1
(*  Title:      HOLCF/Porder.thy
huffman@25773
     2
    Author:     Franz Regensburger and Brian Huffman
nipkow@243
     3
*)
nipkow@243
     4
huffman@15587
     5
header {* Partial orders *}
huffman@15576
     6
huffman@15577
     7
theory Porder
huffman@27317
     8
imports Main
huffman@15577
     9
begin
huffman@15576
    10
huffman@15587
    11
subsection {* Type class for partial orders *}
huffman@15587
    12
huffman@31076
    13
class below =
huffman@31076
    14
  fixes below :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
haftmann@31071
    15
begin
huffman@15576
    16
huffman@23284
    17
notation
huffman@31076
    18
  below (infixl "<<" 55)
huffman@15576
    19
huffman@23284
    20
notation (xsymbols)
huffman@31076
    21
  below (infixl "\<sqsubseteq>" 55)
huffman@15576
    22
huffman@31076
    23
lemma below_eq_trans: "\<lbrakk>a \<sqsubseteq> b; b = c\<rbrakk> \<Longrightarrow> a \<sqsubseteq> c"
haftmann@31071
    24
  by (rule subst)
haftmann@31071
    25
huffman@31076
    26
lemma eq_below_trans: "\<lbrakk>a = b; b \<sqsubseteq> c\<rbrakk> \<Longrightarrow> a \<sqsubseteq> c"
haftmann@31071
    27
  by (rule ssubst)
haftmann@31071
    28
haftmann@31071
    29
end
haftmann@31071
    30
huffman@31076
    31
class po = below +
huffman@31076
    32
  assumes below_refl [iff]: "x \<sqsubseteq> x"
huffman@31076
    33
  assumes below_trans: "x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> z"
huffman@31076
    34
  assumes below_antisym: "x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> x \<Longrightarrow> x = y"
haftmann@31071
    35
begin
huffman@15576
    36
huffman@15576
    37
text {* minimal fixes least element *}
huffman@15576
    38
haftmann@31071
    39
lemma minimal2UU[OF allI] : "\<forall>x. uu \<sqsubseteq> x \<Longrightarrow> uu = (THE u. \<forall>y. u \<sqsubseteq> y)"
huffman@31076
    40
  by (blast intro: theI2 below_antisym)
huffman@15576
    41
huffman@15576
    42
text {* the reverse law of anti-symmetry of @{term "op <<"} *}
huffman@31076
    43
(* Is this rule ever useful? *)
huffman@31076
    44
lemma below_antisym_inverse: "x = y \<Longrightarrow> x \<sqsubseteq> y \<and> y \<sqsubseteq> x"
haftmann@31071
    45
  by simp
huffman@15576
    46
huffman@31076
    47
lemma box_below: "a \<sqsubseteq> b \<Longrightarrow> c \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> d \<Longrightarrow> c \<sqsubseteq> d"
huffman@31076
    48
  by (rule below_trans [OF below_trans])
huffman@17810
    49
haftmann@31071
    50
lemma po_eq_conv: "x = y \<longleftrightarrow> x \<sqsubseteq> y \<and> y \<sqsubseteq> x"
huffman@31076
    51
  by (fast intro!: below_antisym)
huffman@15576
    52
huffman@31076
    53
lemma rev_below_trans: "y \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> z"
huffman@31076
    54
  by (rule below_trans)
huffman@18647
    55
huffman@31076
    56
lemma not_below2not_eq: "\<not> x \<sqsubseteq> y \<Longrightarrow> x \<noteq> y"
haftmann@31071
    57
  by auto
haftmann@31071
    58
haftmann@31071
    59
end
huffman@18647
    60
huffman@18647
    61
lemmas HOLCF_trans_rules [trans] =
huffman@31076
    62
  below_trans
huffman@31076
    63
  below_antisym
huffman@31076
    64
  below_eq_trans
huffman@31076
    65
  eq_below_trans
huffman@18647
    66
haftmann@31071
    67
context po
haftmann@31071
    68
begin
haftmann@31071
    69
huffman@25777
    70
subsection {* Upper bounds *}
huffman@18071
    71
haftmann@31071
    72
definition is_ub :: "'a set \<Rightarrow> 'a \<Rightarrow> bool" (infixl "<|" 55) where
huffman@39968
    73
  "S <| x \<longleftrightarrow> (\<forall>y\<in>S. y \<sqsubseteq> x)"
huffman@18071
    74
huffman@25777
    75
lemma is_ubI: "(\<And>x. x \<in> S \<Longrightarrow> x \<sqsubseteq> u) \<Longrightarrow> S <| u"
haftmann@31071
    76
  by (simp add: is_ub_def)
huffman@25777
    77
huffman@25777
    78
lemma is_ubD: "\<lbrakk>S <| u; x \<in> S\<rbrakk> \<Longrightarrow> x \<sqsubseteq> u"
haftmann@31071
    79
  by (simp add: is_ub_def)
huffman@25777
    80
huffman@25777
    81
lemma ub_imageI: "(\<And>x. x \<in> S \<Longrightarrow> f x \<sqsubseteq> u) \<Longrightarrow> (\<lambda>x. f x) ` S <| u"
haftmann@31071
    82
  unfolding is_ub_def by fast
huffman@25777
    83
huffman@25777
    84
lemma ub_imageD: "\<lbrakk>f ` S <| u; x \<in> S\<rbrakk> \<Longrightarrow> f x \<sqsubseteq> u"
haftmann@31071
    85
  unfolding is_ub_def by fast
huffman@25777
    86
huffman@25777
    87
lemma ub_rangeI: "(\<And>i. S i \<sqsubseteq> x) \<Longrightarrow> range S <| x"
haftmann@31071
    88
  unfolding is_ub_def by fast
huffman@25777
    89
huffman@25777
    90
lemma ub_rangeD: "range S <| x \<Longrightarrow> S i \<sqsubseteq> x"
haftmann@31071
    91
  unfolding is_ub_def by fast
huffman@25777
    92
huffman@25828
    93
lemma is_ub_empty [simp]: "{} <| u"
haftmann@31071
    94
  unfolding is_ub_def by fast
huffman@25828
    95
huffman@25828
    96
lemma is_ub_insert [simp]: "(insert x A) <| y = (x \<sqsubseteq> y \<and> A <| y)"
haftmann@31071
    97
  unfolding is_ub_def by fast
huffman@25828
    98
huffman@25828
    99
lemma is_ub_upward: "\<lbrakk>S <| x; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> S <| y"
huffman@31076
   100
  unfolding is_ub_def by (fast intro: below_trans)
huffman@25828
   101
huffman@25777
   102
subsection {* Least upper bounds *}
huffman@25777
   103
haftmann@31071
   104
definition is_lub :: "'a set \<Rightarrow> 'a \<Rightarrow> bool" (infixl "<<|" 55) where
haftmann@31071
   105
  "S <<| x \<longleftrightarrow> S <| x \<and> (\<forall>u. S <| u \<longrightarrow> x \<sqsubseteq> u)"
huffman@18071
   106
haftmann@31071
   107
definition lub :: "'a set \<Rightarrow> 'a" where
wenzelm@25131
   108
  "lub S = (THE x. S <<| x)"
nipkow@243
   109
haftmann@31071
   110
end
haftmann@31071
   111
huffman@25777
   112
syntax
huffman@25777
   113
  "_BLub" :: "[pttrn, 'a set, 'b] \<Rightarrow> 'b" ("(3LUB _:_./ _)" [0,0, 10] 10)
huffman@25777
   114
huffman@25777
   115
syntax (xsymbols)
huffman@25777
   116
  "_BLub" :: "[pttrn, 'a set, 'b] \<Rightarrow> 'b" ("(3\<Squnion>_\<in>_./ _)" [0,0, 10] 10)
huffman@25777
   117
huffman@25777
   118
translations
huffman@25777
   119
  "LUB x:A. t" == "CONST lub ((%x. t) ` A)"
huffman@25777
   120
haftmann@31071
   121
context po
haftmann@31071
   122
begin
haftmann@31071
   123
wenzelm@21524
   124
abbreviation
wenzelm@21524
   125
  Lub  (binder "LUB " 10) where
wenzelm@21524
   126
  "LUB n. t n == lub (range t)"
oheimb@2394
   127
wenzelm@21524
   128
notation (xsymbols)
wenzelm@21524
   129
  Lub  (binder "\<Squnion> " 10)
nipkow@243
   130
huffman@25813
   131
text {* access to some definition as inference rule *}
huffman@25813
   132
huffman@25813
   133
lemma is_lubD1: "S <<| x \<Longrightarrow> S <| x"
haftmann@31071
   134
  unfolding is_lub_def by fast
huffman@25813
   135
huffman@25813
   136
lemma is_lub_lub: "\<lbrakk>S <<| x; S <| u\<rbrakk> \<Longrightarrow> x \<sqsubseteq> u"
haftmann@31071
   137
  unfolding is_lub_def by fast
huffman@25813
   138
huffman@25813
   139
lemma is_lubI: "\<lbrakk>S <| x; \<And>u. S <| u \<Longrightarrow> x \<sqsubseteq> u\<rbrakk> \<Longrightarrow> S <<| x"
haftmann@31071
   140
  unfolding is_lub_def by fast
huffman@25813
   141
huffman@39969
   142
lemma is_lub_below_iff: "S <<| x \<Longrightarrow> x \<sqsubseteq> u \<longleftrightarrow> S <| u"
huffman@39969
   143
  unfolding is_lub_def is_ub_def by (metis below_trans)
huffman@39969
   144
huffman@15576
   145
text {* lubs are unique *}
huffman@15562
   146
huffman@17810
   147
lemma unique_lub: "\<lbrakk>S <<| x; S <<| y\<rbrakk> \<Longrightarrow> x = y"
huffman@15562
   148
apply (unfold is_lub_def is_ub_def)
huffman@31076
   149
apply (blast intro: below_antisym)
huffman@15562
   150
done
huffman@15562
   151
huffman@15576
   152
text {* technical lemmas about @{term lub} and @{term is_lub} *}
huffman@15562
   153
huffman@17810
   154
lemma lubI: "M <<| x \<Longrightarrow> M <<| lub M"
huffman@15930
   155
apply (unfold lub_def)
huffman@17810
   156
apply (rule theI)
huffman@15930
   157
apply assumption
huffman@17810
   158
apply (erule (1) unique_lub)
huffman@15562
   159
done
huffman@15562
   160
huffman@17810
   161
lemma thelubI: "M <<| l \<Longrightarrow> lub M = l"
haftmann@31071
   162
  by (rule unique_lub [OF lubI])
huffman@15562
   163
huffman@25780
   164
lemma is_lub_singleton: "{x} <<| x"
haftmann@31071
   165
  by (simp add: is_lub_def)
huffman@25780
   166
huffman@17810
   167
lemma lub_singleton [simp]: "lub {x} = x"
haftmann@31071
   168
  by (rule thelubI [OF is_lub_singleton])
huffman@25780
   169
huffman@25780
   170
lemma is_lub_bin: "x \<sqsubseteq> y \<Longrightarrow> {x, y} <<| y"
haftmann@31071
   171
  by (simp add: is_lub_def)
huffman@25780
   172
huffman@25780
   173
lemma lub_bin: "x \<sqsubseteq> y \<Longrightarrow> lub {x, y} = y"
haftmann@31071
   174
  by (rule is_lub_bin [THEN thelubI])
huffman@15562
   175
huffman@25813
   176
lemma is_lub_maximal: "\<lbrakk>S <| x; x \<in> S\<rbrakk> \<Longrightarrow> S <<| x"
haftmann@31071
   177
  by (erule is_lubI, erule (1) is_ubD)
huffman@15562
   178
huffman@25813
   179
lemma lub_maximal: "\<lbrakk>S <| x; x \<in> S\<rbrakk> \<Longrightarrow> lub S = x"
haftmann@31071
   180
  by (rule is_lub_maximal [THEN thelubI])
nipkow@243
   181
huffman@25695
   182
subsection {* Countable chains *}
huffman@25695
   183
haftmann@31071
   184
definition chain :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool" where
huffman@25695
   185
  -- {* Here we use countable chains and I prefer to code them as functions! *}
huffman@25922
   186
  "chain Y = (\<forall>i. Y i \<sqsubseteq> Y (Suc i))"
huffman@25922
   187
huffman@25922
   188
lemma chainI: "(\<And>i. Y i \<sqsubseteq> Y (Suc i)) \<Longrightarrow> chain Y"
haftmann@31071
   189
  unfolding chain_def by fast
huffman@25922
   190
huffman@25922
   191
lemma chainE: "chain Y \<Longrightarrow> Y i \<sqsubseteq> Y (Suc i)"
haftmann@31071
   192
  unfolding chain_def by fast
huffman@25695
   193
huffman@25695
   194
text {* chains are monotone functions *}
huffman@25695
   195
huffman@27317
   196
lemma chain_mono_less: "\<lbrakk>chain Y; i < j\<rbrakk> \<Longrightarrow> Y i \<sqsubseteq> Y j"
huffman@31076
   197
  by (erule less_Suc_induct, erule chainE, erule below_trans)
huffman@25695
   198
huffman@27317
   199
lemma chain_mono: "\<lbrakk>chain Y; i \<le> j\<rbrakk> \<Longrightarrow> Y i \<sqsubseteq> Y j"
haftmann@31071
   200
  by (cases "i = j", simp, simp add: chain_mono_less)
huffman@15562
   201
huffman@17810
   202
lemma chain_shift: "chain Y \<Longrightarrow> chain (\<lambda>i. Y (i + j))"
haftmann@31071
   203
  by (rule chainI, simp, erule chainE)
huffman@15562
   204
huffman@15576
   205
text {* technical lemmas about (least) upper bounds of chains *}
huffman@15562
   206
huffman@17810
   207
lemma is_ub_lub: "range S <<| x \<Longrightarrow> S i \<sqsubseteq> x"
haftmann@31071
   208
  by (rule is_lubD1 [THEN ub_rangeD])
huffman@15562
   209
huffman@16318
   210
lemma is_ub_range_shift:
huffman@16318
   211
  "chain S \<Longrightarrow> range (\<lambda>i. S (i + j)) <| x = range S <| x"
huffman@16318
   212
apply (rule iffI)
huffman@16318
   213
apply (rule ub_rangeI)
huffman@31076
   214
apply (rule_tac y="S (i + j)" in below_trans)
huffman@25922
   215
apply (erule chain_mono)
huffman@16318
   216
apply (rule le_add1)
huffman@16318
   217
apply (erule ub_rangeD)
huffman@16318
   218
apply (rule ub_rangeI)
huffman@16318
   219
apply (erule ub_rangeD)
huffman@16318
   220
done
huffman@16318
   221
huffman@16318
   222
lemma is_lub_range_shift:
huffman@16318
   223
  "chain S \<Longrightarrow> range (\<lambda>i. S (i + j)) <<| x = range S <<| x"
haftmann@31071
   224
  by (simp add: is_lub_def is_ub_range_shift)
huffman@16318
   225
huffman@25695
   226
text {* the lub of a constant chain is the constant *}
huffman@25695
   227
huffman@25695
   228
lemma chain_const [simp]: "chain (\<lambda>i. c)"
haftmann@31071
   229
  by (simp add: chainI)
huffman@25695
   230
huffman@25695
   231
lemma lub_const: "range (\<lambda>x. c) <<| c"
huffman@25695
   232
by (blast dest: ub_rangeD intro: is_lubI ub_rangeI)
huffman@25695
   233
huffman@25695
   234
lemma thelub_const [simp]: "(\<Squnion>i. c) = c"
haftmann@31071
   235
  by (rule lub_const [THEN thelubI])
huffman@25695
   236
huffman@25695
   237
subsection {* Finite chains *}
huffman@25695
   238
haftmann@31071
   239
definition max_in_chain :: "nat \<Rightarrow> (nat \<Rightarrow> 'a) \<Rightarrow> bool" where
huffman@25695
   240
  -- {* finite chains, needed for monotony of continuous functions *}
haftmann@31071
   241
  "max_in_chain i C \<longleftrightarrow> (\<forall>j. i \<le> j \<longrightarrow> C i = C j)"
huffman@25695
   242
haftmann@31071
   243
definition finite_chain :: "(nat \<Rightarrow> 'a) \<Rightarrow> bool" where
huffman@25695
   244
  "finite_chain C = (chain C \<and> (\<exists>i. max_in_chain i C))"
huffman@25695
   245
huffman@15576
   246
text {* results about finite chains *}
huffman@15562
   247
huffman@25878
   248
lemma max_in_chainI: "(\<And>j. i \<le> j \<Longrightarrow> Y i = Y j) \<Longrightarrow> max_in_chain i Y"
haftmann@31071
   249
  unfolding max_in_chain_def by fast
huffman@25878
   250
huffman@25878
   251
lemma max_in_chainD: "\<lbrakk>max_in_chain i Y; i \<le> j\<rbrakk> \<Longrightarrow> Y i = Y j"
haftmann@31071
   252
  unfolding max_in_chain_def by fast
huffman@25878
   253
huffman@27317
   254
lemma finite_chainI:
huffman@27317
   255
  "\<lbrakk>chain C; max_in_chain i C\<rbrakk> \<Longrightarrow> finite_chain C"
haftmann@31071
   256
  unfolding finite_chain_def by fast
huffman@27317
   257
huffman@27317
   258
lemma finite_chainE:
huffman@27317
   259
  "\<lbrakk>finite_chain C; \<And>i. \<lbrakk>chain C; max_in_chain i C\<rbrakk> \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R"
haftmann@31071
   260
  unfolding finite_chain_def by fast
huffman@27317
   261
huffman@17810
   262
lemma lub_finch1: "\<lbrakk>chain C; max_in_chain i C\<rbrakk> \<Longrightarrow> range C <<| C i"
huffman@15562
   263
apply (rule is_lubI)
huffman@17810
   264
apply (rule ub_rangeI, rename_tac j)
huffman@17810
   265
apply (rule_tac x=i and y=j in linorder_le_cases)
huffman@25878
   266
apply (drule (1) max_in_chainD, simp)
huffman@25922
   267
apply (erule (1) chain_mono)
huffman@15562
   268
apply (erule ub_rangeD)
huffman@15562
   269
done
huffman@15562
   270
wenzelm@25131
   271
lemma lub_finch2:
huffman@27317
   272
  "finite_chain C \<Longrightarrow> range C <<| C (LEAST i. max_in_chain i C)"
huffman@27317
   273
apply (erule finite_chainE)
huffman@27317
   274
apply (erule LeastI2 [where Q="\<lambda>i. range C <<| C i"])
huffman@17810
   275
apply (erule (1) lub_finch1)
huffman@15562
   276
done
huffman@15562
   277
huffman@19621
   278
lemma finch_imp_finite_range: "finite_chain Y \<Longrightarrow> finite (range Y)"
huffman@27317
   279
 apply (erule finite_chainE)
huffman@27317
   280
 apply (rule_tac B="Y ` {..i}" in finite_subset)
huffman@19621
   281
  apply (rule subsetI)
huffman@19621
   282
  apply (erule rangeE, rename_tac j)
huffman@19621
   283
  apply (rule_tac x=i and y=j in linorder_le_cases)
huffman@19621
   284
   apply (subgoal_tac "Y j = Y i", simp)
huffman@19621
   285
   apply (simp add: max_in_chain_def)
huffman@19621
   286
  apply simp
huffman@27317
   287
 apply simp
huffman@19621
   288
done
huffman@19621
   289
huffman@27317
   290
lemma finite_range_has_max:
huffman@27317
   291
  fixes f :: "nat \<Rightarrow> 'a" and r :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
huffman@27317
   292
  assumes mono: "\<And>i j. i \<le> j \<Longrightarrow> r (f i) (f j)"
huffman@27317
   293
  assumes finite_range: "finite (range f)"
huffman@27317
   294
  shows "\<exists>k. \<forall>i. r (f i) (f k)"
huffman@27317
   295
proof (intro exI allI)
huffman@27317
   296
  fix i :: nat
huffman@27317
   297
  let ?j = "LEAST k. f k = f i"
huffman@27317
   298
  let ?k = "Max ((\<lambda>x. LEAST k. f k = x) ` range f)"
huffman@27317
   299
  have "?j \<le> ?k"
huffman@27317
   300
  proof (rule Max_ge)
huffman@27317
   301
    show "finite ((\<lambda>x. LEAST k. f k = x) ` range f)"
huffman@27317
   302
      using finite_range by (rule finite_imageI)
huffman@27317
   303
    show "?j \<in> (\<lambda>x. LEAST k. f k = x) ` range f"
huffman@27317
   304
      by (intro imageI rangeI)
huffman@27317
   305
  qed
huffman@27317
   306
  hence "r (f ?j) (f ?k)"
huffman@27317
   307
    by (rule mono)
huffman@27317
   308
  also have "f ?j = f i"
huffman@27317
   309
    by (rule LeastI, rule refl)
huffman@27317
   310
  finally show "r (f i) (f ?k)" .
huffman@27317
   311
qed
huffman@27317
   312
huffman@19621
   313
lemma finite_range_imp_finch:
huffman@19621
   314
  "\<lbrakk>chain Y; finite (range Y)\<rbrakk> \<Longrightarrow> finite_chain Y"
huffman@27317
   315
 apply (subgoal_tac "\<exists>k. \<forall>i. Y i \<sqsubseteq> Y k")
huffman@27317
   316
  apply (erule exE)
huffman@27317
   317
  apply (rule finite_chainI, assumption)
huffman@27317
   318
  apply (rule max_in_chainI)
huffman@31076
   319
  apply (rule below_antisym)
huffman@27317
   320
   apply (erule (1) chain_mono)
huffman@27317
   321
  apply (erule spec)
huffman@27317
   322
 apply (rule finite_range_has_max)
huffman@27317
   323
  apply (erule (1) chain_mono)
huffman@27317
   324
 apply assumption
huffman@19621
   325
done
huffman@19621
   326
huffman@17810
   327
lemma bin_chain: "x \<sqsubseteq> y \<Longrightarrow> chain (\<lambda>i. if i=0 then x else y)"
haftmann@31071
   328
  by (rule chainI, simp)
huffman@17810
   329
huffman@17810
   330
lemma bin_chainmax:
huffman@17810
   331
  "x \<sqsubseteq> y \<Longrightarrow> max_in_chain (Suc 0) (\<lambda>i. if i=0 then x else y)"
haftmann@31071
   332
  unfolding max_in_chain_def by simp
huffman@15562
   333
huffman@17810
   334
lemma lub_bin_chain:
huffman@17810
   335
  "x \<sqsubseteq> y \<Longrightarrow> range (\<lambda>i::nat. if i=0 then x else y) <<| y"
huffman@17810
   336
apply (frule bin_chain)
huffman@17810
   337
apply (drule bin_chainmax)
huffman@17810
   338
apply (drule (1) lub_finch1)
huffman@17810
   339
apply simp
huffman@15562
   340
done
huffman@15562
   341
huffman@15576
   342
text {* the maximal element in a chain is its lub *}
huffman@15562
   343
huffman@17810
   344
lemma lub_chain_maxelem: "\<lbrakk>Y i = c; \<forall>i. Y i \<sqsubseteq> c\<rbrakk> \<Longrightarrow> lub (range Y) = c"
haftmann@31071
   345
  by (blast dest: ub_rangeD intro: thelubI is_lubI ub_rangeI)
huffman@15562
   346
haftmann@31071
   347
text {* lemmata for improved admissibility introdution rule *}
haftmann@31071
   348
haftmann@31071
   349
lemma infinite_chain_adm_lemma:
haftmann@31071
   350
  "\<lbrakk>chain Y; \<forall>i. P (Y i);  
haftmann@31071
   351
    \<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i); \<not> finite_chain Y\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)\<rbrakk>
haftmann@31071
   352
      \<Longrightarrow> P (\<Squnion>i. Y i)"
haftmann@31071
   353
apply (case_tac "finite_chain Y")
haftmann@31071
   354
prefer 2 apply fast
haftmann@31071
   355
apply (unfold finite_chain_def)
haftmann@31071
   356
apply safe
haftmann@31071
   357
apply (erule lub_finch1 [THEN thelubI, THEN ssubst])
haftmann@31071
   358
apply assumption
haftmann@31071
   359
apply (erule spec)
haftmann@31071
   360
done
haftmann@31071
   361
haftmann@31071
   362
lemma increasing_chain_adm_lemma:
haftmann@31071
   363
  "\<lbrakk>chain Y;  \<forall>i. P (Y i); \<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i);
haftmann@31071
   364
    \<forall>i. \<exists>j>i. Y i \<noteq> Y j \<and> Y i \<sqsubseteq> Y j\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)\<rbrakk>
haftmann@31071
   365
      \<Longrightarrow> P (\<Squnion>i. Y i)"
haftmann@31071
   366
apply (erule infinite_chain_adm_lemma)
haftmann@31071
   367
apply assumption
haftmann@31071
   368
apply (erule thin_rl)
haftmann@31071
   369
apply (unfold finite_chain_def)
haftmann@31071
   370
apply (unfold max_in_chain_def)
haftmann@31071
   371
apply (fast dest: le_imp_less_or_eq elim: chain_mono_less)
haftmann@31071
   372
done
haftmann@31071
   373
huffman@18071
   374
end
haftmann@31071
   375
huffman@31076
   376
end