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