author | huffman |
Fri, 01 Jul 2005 02:35:24 +0200 | |
changeset 16627 | a2844e212da4 |
parent 16626 | d28314d2dce3 |
child 16739 | 9ffd706ae402 |
permissions | -rw-r--r-- |
2640 | 1 |
(* Title: HOLCF/Pcpo.thy |
2 |
ID: $Id$ |
|
3 |
Author: Franz Regensburger |
|
4 |
||
16070
4a83dd540b88
removed LICENCE note -- everything is subject to Isabelle licence as
wenzelm
parents:
15930
diff
changeset
|
5 |
Introduction of the classes cpo and pcpo. |
2640 | 6 |
*) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
15563
diff
changeset
|
7 |
|
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
15563
diff
changeset
|
8 |
header {* Classes cpo and pcpo *} |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
15563
diff
changeset
|
9 |
|
15577 | 10 |
theory Pcpo |
11 |
imports Porder |
|
12 |
begin |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
13 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
14 |
subsection {* Complete partial orders *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
15 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
16 |
text {* The class cpo of chain complete partial orders *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
17 |
|
2640 | 18 |
axclass cpo < po |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
19 |
-- {* class axiom: *} |
16626 | 20 |
cpo: "chain S \<Longrightarrow> \<exists>x. range S <<| x" |
2394 | 21 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
22 |
text {* in cpo's everthing equal to THE lub has lub properties for every chain *} |
15563 | 23 |
|
16626 | 24 |
lemma thelubE: "\<lbrakk>chain S; (\<Squnion>i. S i) = (l::'a::cpo)\<rbrakk> \<Longrightarrow> range S <<| l" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
25 |
by (blast dest: cpo intro: lubI) |
15563 | 26 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
27 |
text {* Properties of the lub *} |
15563 | 28 |
|
16626 | 29 |
lemma is_ub_thelub: "chain (S::nat \<Rightarrow> 'a::cpo) \<Longrightarrow> S x \<sqsubseteq> (\<Squnion>i. S i)" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
30 |
by (blast dest: cpo intro: lubI [THEN is_ub_lub]) |
15563 | 31 |
|
16626 | 32 |
lemma is_lub_thelub: |
33 |
"\<lbrakk>chain (S::nat \<Rightarrow> 'a::cpo); range S <| x\<rbrakk> \<Longrightarrow> (\<Squnion>i. S i) \<sqsubseteq> x" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
34 |
by (blast dest: cpo intro: lubI [THEN is_lub_lub]) |
15563 | 35 |
|
16626 | 36 |
lemma lub_range_mono: |
37 |
"\<lbrakk>range X \<subseteq> range Y; chain Y; chain (X::nat \<Rightarrow> 'a::cpo)\<rbrakk> |
|
38 |
\<Longrightarrow> (\<Squnion>i. X i) \<sqsubseteq> (\<Squnion>i. Y i)" |
|
15563 | 39 |
apply (erule is_lub_thelub) |
40 |
apply (rule ub_rangeI) |
|
16626 | 41 |
apply (subgoal_tac "\<exists>j. X i = Y j") |
15563 | 42 |
apply clarsimp |
43 |
apply (erule is_ub_thelub) |
|
44 |
apply auto |
|
45 |
done |
|
46 |
||
16626 | 47 |
lemma lub_range_shift: |
48 |
"chain (Y::nat \<Rightarrow> 'a::cpo) \<Longrightarrow> (\<Squnion>i. Y (i + j)) = (\<Squnion>i. Y i)" |
|
15563 | 49 |
apply (rule antisym_less) |
50 |
apply (rule lub_range_mono) |
|
51 |
apply fast |
|
52 |
apply assumption |
|
53 |
apply (erule chain_shift) |
|
54 |
apply (rule is_lub_thelub) |
|
55 |
apply assumption |
|
56 |
apply (rule ub_rangeI) |
|
57 |
apply (rule trans_less) |
|
58 |
apply (rule_tac [2] is_ub_thelub) |
|
59 |
apply (erule_tac [2] chain_shift) |
|
60 |
apply (erule chain_mono3) |
|
61 |
apply (rule le_add1) |
|
62 |
done |
|
63 |
||
16626 | 64 |
lemma maxinch_is_thelub: |
65 |
"chain Y \<Longrightarrow> max_in_chain i Y = ((\<Squnion>i. Y i) = ((Y i)::'a::cpo))" |
|
15563 | 66 |
apply (rule iffI) |
67 |
apply (fast intro!: thelubI lub_finch1) |
|
68 |
apply (unfold max_in_chain_def) |
|
69 |
apply (safe intro!: antisym_less) |
|
70 |
apply (fast elim!: chain_mono3) |
|
71 |
apply (drule sym) |
|
72 |
apply (force elim!: is_ub_thelub) |
|
73 |
done |
|
74 |
||
16626 | 75 |
text {* the @{text "\<sqsubseteq>"} relation between two chains is preserved by their lubs *} |
15563 | 76 |
|
16626 | 77 |
lemma lub_mono: |
78 |
"\<lbrakk>chain (X::nat \<Rightarrow> 'a::cpo); chain Y; \<forall>k. X k \<sqsubseteq> Y k\<rbrakk> |
|
79 |
\<Longrightarrow> (\<Squnion>i. X i) \<sqsubseteq> (\<Squnion>i. Y i)" |
|
15563 | 80 |
apply (erule is_lub_thelub) |
81 |
apply (rule ub_rangeI) |
|
82 |
apply (rule trans_less) |
|
83 |
apply (erule spec) |
|
84 |
apply (erule is_ub_thelub) |
|
85 |
done |
|
86 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
87 |
text {* the = relation between two chains is preserved by their lubs *} |
15563 | 88 |
|
16626 | 89 |
lemma lub_equal: |
90 |
"\<lbrakk>chain (X::nat \<Rightarrow> 'a::cpo); chain Y; \<forall>k. X k = Y k\<rbrakk> |
|
91 |
\<Longrightarrow> (\<Squnion>i. X i) = (\<Squnion>i. Y i)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
92 |
by (simp only: expand_fun_eq [symmetric]) |
15563 | 93 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
94 |
text {* more results about mono and = of lubs of chains *} |
3326 | 95 |
|
16626 | 96 |
lemma lub_mono2: |
97 |
"\<lbrakk>\<exists>j::nat. \<forall>i>j. X i = Y i; chain (X::nat=>'a::cpo); chain Y\<rbrakk> |
|
98 |
\<Longrightarrow> (\<Squnion>i. X i) \<sqsubseteq> (\<Squnion>i. Y i)" |
|
15563 | 99 |
apply (erule exE) |
100 |
apply (rule is_lub_thelub) |
|
101 |
apply assumption |
|
102 |
apply (rule ub_rangeI) |
|
16626 | 103 |
apply (case_tac "j < i") |
104 |
apply (rule_tac s="Y i" and t="X i" in subst) |
|
105 |
apply simp |
|
106 |
apply (erule is_ub_thelub) |
|
107 |
apply (rule_tac y = "X (Suc j)" in trans_less) |
|
108 |
apply (erule chain_mono) |
|
109 |
apply (erule not_less_eq [THEN iffD1]) |
|
110 |
apply (rule_tac s="Y (Suc j)" and t="X (Suc j)" in subst) |
|
111 |
apply simp |
|
15563 | 112 |
apply (erule is_ub_thelub) |
113 |
done |
|
114 |
||
16626 | 115 |
lemma lub_equal2: |
116 |
"\<lbrakk>\<exists>j. \<forall>i>j. X i = Y i; chain (X::nat \<Rightarrow> 'a::cpo); chain Y\<rbrakk> |
|
117 |
\<Longrightarrow> (\<Squnion>i. X i) = (\<Squnion>i. Y i)" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
118 |
by (blast intro: antisym_less lub_mono2 sym) |
15563 | 119 |
|
16626 | 120 |
lemma lub_mono3: |
121 |
"\<lbrakk>chain (Y::nat \<Rightarrow> 'a::cpo); chain X; \<forall>i. \<exists>j. Y i \<sqsubseteq> X j\<rbrakk> |
|
122 |
\<Longrightarrow> (\<Squnion>i. Y i) \<sqsubseteq> (\<Squnion>i. X i)" |
|
15563 | 123 |
apply (rule is_lub_thelub) |
124 |
apply assumption |
|
125 |
apply (rule ub_rangeI) |
|
126 |
apply (erule allE) |
|
127 |
apply (erule exE) |
|
16626 | 128 |
apply (erule trans_less) |
129 |
apply (erule is_ub_thelub) |
|
15563 | 130 |
done |
131 |
||
16203 | 132 |
lemma ch2ch_lub: |
133 |
fixes Y :: "nat \<Rightarrow> nat \<Rightarrow> 'a::cpo" |
|
134 |
assumes 1: "\<And>j. chain (\<lambda>i. Y i j)" |
|
135 |
assumes 2: "\<And>i. chain (\<lambda>j. Y i j)" |
|
136 |
shows "chain (\<lambda>i. \<Squnion>j. Y i j)" |
|
137 |
apply (rule chainI) |
|
138 |
apply (rule lub_mono [rule_format, OF 2 2]) |
|
139 |
apply (rule chainE [OF 1]) |
|
140 |
done |
|
141 |
||
16201 | 142 |
lemma diag_lub: |
143 |
fixes Y :: "nat \<Rightarrow> nat \<Rightarrow> 'a::cpo" |
|
144 |
assumes 1: "\<And>j. chain (\<lambda>i. Y i j)" |
|
145 |
assumes 2: "\<And>i. chain (\<lambda>j. Y i j)" |
|
146 |
shows "(\<Squnion>i. \<Squnion>j. Y i j) = (\<Squnion>i. Y i i)" |
|
147 |
proof (rule antisym_less) |
|
148 |
have 3: "chain (\<lambda>i. Y i i)" |
|
149 |
apply (rule chainI) |
|
150 |
apply (rule trans_less) |
|
151 |
apply (rule chainE [OF 1]) |
|
152 |
apply (rule chainE [OF 2]) |
|
153 |
done |
|
154 |
have 4: "chain (\<lambda>i. \<Squnion>j. Y i j)" |
|
16203 | 155 |
by (rule ch2ch_lub [OF 1 2]) |
16201 | 156 |
show "(\<Squnion>i. \<Squnion>j. Y i j) \<sqsubseteq> (\<Squnion>i. Y i i)" |
157 |
apply (rule is_lub_thelub [OF 4]) |
|
158 |
apply (rule ub_rangeI) |
|
16203 | 159 |
apply (rule lub_mono3 [rule_format, OF 2 3]) |
16201 | 160 |
apply (rule exI) |
161 |
apply (rule trans_less) |
|
162 |
apply (rule chain_mono3 [OF 1 le_maxI1]) |
|
163 |
apply (rule chain_mono3 [OF 2 le_maxI2]) |
|
164 |
done |
|
165 |
show "(\<Squnion>i. Y i i) \<sqsubseteq> (\<Squnion>i. \<Squnion>j. Y i j)" |
|
16203 | 166 |
apply (rule lub_mono [rule_format, OF 3 4]) |
16201 | 167 |
apply (rule is_ub_thelub [OF 2]) |
168 |
done |
|
169 |
qed |
|
170 |
||
171 |
lemma ex_lub: |
|
172 |
fixes Y :: "nat \<Rightarrow> nat \<Rightarrow> 'a::cpo" |
|
173 |
assumes 1: "\<And>j. chain (\<lambda>i. Y i j)" |
|
174 |
assumes 2: "\<And>i. chain (\<lambda>j. Y i j)" |
|
175 |
shows "(\<Squnion>i. \<Squnion>j. Y i j) = (\<Squnion>j. \<Squnion>i. Y i j)" |
|
176 |
by (simp add: diag_lub 1 2) |
|
177 |
||
178 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
179 |
subsection {* Pointed cpos *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
180 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
181 |
text {* The class pcpo of pointed cpos *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
182 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
183 |
axclass pcpo < cpo |
16626 | 184 |
least: "\<exists>x. \<forall>y. x \<sqsubseteq> y" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
185 |
|
16626 | 186 |
constdefs |
187 |
UU :: "'a::pcpo" |
|
188 |
"UU \<equiv> THE x. ALL y. x \<sqsubseteq> y" |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
189 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
190 |
syntax (xsymbols) |
16626 | 191 |
UU :: "'a::pcpo" ("\<bottom>") |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
192 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
193 |
text {* derive the old rule minimal *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
194 |
|
16626 | 195 |
lemma UU_least: "\<forall>z. \<bottom> \<sqsubseteq> z" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
196 |
apply (unfold UU_def) |
15930
145651bc64a8
Replaced all unnecessary uses of SOME with THE or LEAST
huffman
parents:
15640
diff
changeset
|
197 |
apply (rule theI') |
145651bc64a8
Replaced all unnecessary uses of SOME with THE or LEAST
huffman
parents:
15640
diff
changeset
|
198 |
apply (rule ex_ex1I) |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
199 |
apply (rule least) |
15930
145651bc64a8
Replaced all unnecessary uses of SOME with THE or LEAST
huffman
parents:
15640
diff
changeset
|
200 |
apply (blast intro: antisym_less) |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
201 |
done |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
202 |
|
16626 | 203 |
lemma minimal [iff]: "\<bottom> \<sqsubseteq> x" |
204 |
by (rule UU_least [THEN spec]) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
205 |
|
16626 | 206 |
text {* useful lemmas about @{term \<bottom>} *} |
15563 | 207 |
|
16626 | 208 |
lemma eq_UU_iff: "(x = \<bottom>) = (x \<sqsubseteq> \<bottom>)" |
15563 | 209 |
apply (rule iffI) |
210 |
apply (erule ssubst) |
|
211 |
apply (rule refl_less) |
|
212 |
apply (rule antisym_less) |
|
213 |
apply assumption |
|
214 |
apply (rule minimal) |
|
215 |
done |
|
216 |
||
16626 | 217 |
lemma UU_I: "x \<sqsubseteq> \<bottom> \<Longrightarrow> x = \<bottom>" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
218 |
by (subst eq_UU_iff) |
15563 | 219 |
|
16626 | 220 |
lemma not_less2not_eq: "\<not> (x::'a::po) \<sqsubseteq> y \<Longrightarrow> x \<noteq> y" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
221 |
by auto |
15563 | 222 |
|
16626 | 223 |
lemma chain_UU_I: "\<lbrakk>chain Y; (\<Squnion>i. Y i) = \<bottom>\<rbrakk> \<Longrightarrow> \<forall>i. Y i = \<bottom>" |
15563 | 224 |
apply (rule allI) |
16626 | 225 |
apply (rule UU_I) |
15563 | 226 |
apply (erule subst) |
227 |
apply (erule is_ub_thelub) |
|
228 |
done |
|
229 |
||
16626 | 230 |
lemma chain_UU_I_inverse: "\<forall>i::nat. Y i = \<bottom> \<Longrightarrow> (\<Squnion>i. Y i) = \<bottom>" |
15563 | 231 |
apply (rule lub_chain_maxelem) |
232 |
apply (erule spec) |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
233 |
apply simp |
15563 | 234 |
done |
235 |
||
16626 | 236 |
lemma chain_UU_I_inverse2: "(\<Squnion>i. Y i) \<noteq> \<bottom> \<Longrightarrow> \<exists>i::nat. Y i \<noteq> \<bottom>" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
237 |
by (blast intro: chain_UU_I_inverse) |
15563 | 238 |
|
16626 | 239 |
lemma notUU_I: "\<lbrakk>x \<sqsubseteq> y; x \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> y \<noteq> \<bottom>" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
240 |
by (blast intro: UU_I) |
15563 | 241 |
|
16627 | 242 |
lemma chain_mono2: "\<lbrakk>\<exists>j. Y j \<noteq> \<bottom>; chain Y\<rbrakk> \<Longrightarrow> \<exists>j. \<forall>i>j. Y i \<noteq> \<bottom>" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
243 |
by (blast dest: notUU_I chain_mono) |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
244 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
245 |
subsection {* Chain-finite and flat cpos *} |
15563 | 246 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
247 |
text {* further useful classes for HOLCF domains *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
248 |
|
15640
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
249 |
axclass chfin < po |
16626 | 250 |
chfin: "\<forall>Y. chain Y \<longrightarrow> (\<exists>n. max_in_chain n Y)" |
15563 | 251 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
252 |
axclass flat < pcpo |
16626 | 253 |
ax_flat: "\<forall>x y. x \<sqsubseteq> y \<longrightarrow> (x = \<bottom>) \<or> (x = y)" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
254 |
|
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
255 |
text {* some properties for chfin and flat *} |
15563 | 256 |
|
15640
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
257 |
text {* chfin types are cpo *} |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
258 |
|
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
259 |
lemma chfin_imp_cpo: |
16626 | 260 |
"chain (S::nat \<Rightarrow> 'a::chfin) \<Longrightarrow> \<exists>x. range S <<| x" |
15640
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
261 |
apply (frule chfin [rule_format]) |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
262 |
apply (blast intro: lub_finch1) |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
263 |
done |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
264 |
|
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
265 |
instance chfin < cpo |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
266 |
by intro_classes (rule chfin_imp_cpo) |
2d1d6ea579a1
chfin now a subclass of po, proved instance chfin < cpo
huffman
parents:
15588
diff
changeset
|
267 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
268 |
text {* flat types are chfin *} |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
269 |
|
15563 | 270 |
lemma flat_imp_chfin: |
16626 | 271 |
"\<forall>Y::nat \<Rightarrow> 'a::flat. chain Y \<longrightarrow> (\<exists>n. max_in_chain n Y)" |
15563 | 272 |
apply (unfold max_in_chain_def) |
273 |
apply clarify |
|
16626 | 274 |
apply (case_tac "\<forall>i. Y i = \<bottom>") |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
275 |
apply simp |
15563 | 276 |
apply simp |
277 |
apply (erule exE) |
|
16626 | 278 |
apply (rule_tac x="i" in exI) |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
279 |
apply clarify |
15563 | 280 |
apply (erule le_imp_less_or_eq [THEN disjE]) |
281 |
apply safe |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
282 |
apply (blast dest: chain_mono ax_flat [rule_format]) |
15563 | 283 |
done |
284 |
||
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
285 |
instance flat < chfin |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
286 |
by intro_classes (rule flat_imp_chfin) |
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
287 |
|
16627 | 288 |
text {* flat subclass of chfin; @{text adm_flat} not needed *} |
15563 | 289 |
|
16626 | 290 |
lemma flat_eq: "(a::'a::flat) \<noteq> \<bottom> \<Longrightarrow> a \<sqsubseteq> b = (a = b)" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
291 |
by (safe dest!: ax_flat [rule_format]) |
15563 | 292 |
|
16626 | 293 |
lemma chfin2finch: "chain (Y::nat \<Rightarrow> 'a::chfin) \<Longrightarrow> finite_chain Y" |
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
294 |
by (simp add: chfin finite_chain_def) |
15563 | 295 |
|
15588
14e3228f18cc
arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset
|
296 |
text {* lemmata for improved admissibility introdution rule *} |
15563 | 297 |
|
298 |
lemma infinite_chain_adm_lemma: |
|
16626 | 299 |
"\<lbrakk>chain Y; \<forall>i. P (Y i); |
300 |
\<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i); \<not> finite_chain Y\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)\<rbrakk> |
|
301 |
\<Longrightarrow> P (\<Squnion>i. Y i)" |
|
15563 | 302 |
apply (case_tac "finite_chain Y") |
303 |
prefer 2 apply fast |
|
304 |
apply (unfold finite_chain_def) |
|
305 |
apply safe |
|
306 |
apply (erule lub_finch1 [THEN thelubI, THEN ssubst]) |
|
307 |
apply assumption |
|
308 |
apply (erule spec) |
|
309 |
done |
|
310 |
||
311 |
lemma increasing_chain_adm_lemma: |
|
16626 | 312 |
"\<lbrakk>chain Y; \<forall>i. P (Y i); \<And>Y. \<lbrakk>chain Y; \<forall>i. P (Y i); |
313 |
\<forall>i. \<exists>j>i. Y i \<noteq> Y j \<and> Y i \<sqsubseteq> Y j\<rbrakk> \<Longrightarrow> P (\<Squnion>i. Y i)\<rbrakk> |
|
314 |
\<Longrightarrow> P (\<Squnion>i. Y i)" |
|
15563 | 315 |
apply (erule infinite_chain_adm_lemma) |
316 |
apply assumption |
|
317 |
apply (erule thin_rl) |
|
318 |
apply (unfold finite_chain_def) |
|
319 |
apply (unfold max_in_chain_def) |
|
320 |
apply (fast dest: le_imp_less_or_eq elim: chain_mono) |
|
321 |
done |
|
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
15563
diff
changeset
|
322 |
|
16626 | 323 |
end |