author | wenzelm |
Fri, 16 Apr 1999 14:42:44 +0200 | |
changeset 6435 | 154b88d2b62e |
parent 4721 | c8a8482a8124 |
child 9169 | 85a47aa21f74 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: HOLCF/pcpo.ML |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1461 | 3 |
Author: Franz Regensburger |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
4 |
Copyright 1993 Technische Universitaet Muenchen |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
5 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
6 |
Lemmas for pcpo.thy |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
7 |
*) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
8 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
9 |
open Pcpo; |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
10 |
|
2640 | 11 |
|
12 |
(* ------------------------------------------------------------------------ *) |
|
13 |
(* derive the old rule minimal *) |
|
14 |
(* ------------------------------------------------------------------------ *) |
|
15 |
||
3842 | 16 |
qed_goalw "UU_least" thy [ UU_def ] "!z. UU << z" |
2640 | 17 |
(fn prems => [ |
18 |
(rtac (select_eq_Ex RS iffD2) 1), |
|
19 |
(rtac least 1)]); |
|
20 |
||
21 |
bind_thm("minimal",UU_least RS spec); |
|
22 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
23 |
(* ------------------------------------------------------------------------ *) |
2839 | 24 |
(* in cpo's everthing equal to THE lub has lub properties for every chain *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
25 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
26 |
|
2640 | 27 |
qed_goal "thelubE" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
28 |
"[| chain(S);lub(range(S)) = (l::'a::cpo)|] ==> range(S) <<| l " |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
29 |
(fn prems => |
1461 | 30 |
[ |
31 |
(cut_facts_tac prems 1), |
|
32 |
(hyp_subst_tac 1), |
|
33 |
(rtac lubI 1), |
|
34 |
(etac cpo 1) |
|
35 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
36 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
37 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
38 |
(* Properties of the lub *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
39 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
40 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
41 |
|
1779 | 42 |
bind_thm ("is_ub_thelub", cpo RS lubI RS is_ub_lub); |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
43 |
(* chain(?S1) ==> ?S1(?x) << lub(range(?S1)) *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
44 |
|
1779 | 45 |
bind_thm ("is_lub_thelub", cpo RS lubI RS is_lub_lub); |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
46 |
(* [| chain(?S5); range(?S5) <| ?x1 |] ==> lub(range(?S5)) << ?x1 *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
47 |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
48 |
qed_goal "maxinch_is_thelub" thy "chain Y ==> \ |
2839 | 49 |
\ max_in_chain i Y = (lub(range(Y)) = ((Y i)::'a::cpo))" |
2354 | 50 |
(fn prems => |
2416 | 51 |
[ |
52 |
cut_facts_tac prems 1, |
|
53 |
rtac iffI 1, |
|
54 |
fast_tac (HOL_cs addSIs [thelubI,lub_finch1]) 1, |
|
55 |
rewtac max_in_chain_def, |
|
56 |
safe_tac (HOL_cs addSIs [antisym_less]), |
|
57 |
fast_tac (HOL_cs addSEs [chain_mono3]) 1, |
|
58 |
dtac sym 1, |
|
4098 | 59 |
fast_tac ((HOL_cs addSEs [is_ub_thelub]) addss simpset()) 1 |
2416 | 60 |
]); |
2354 | 61 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
62 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
63 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
64 |
(* the << relation between two chains is preserved by their lubs *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
65 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
66 |
|
2640 | 67 |
qed_goal "lub_mono" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
68 |
"[|chain(C1::(nat=>'a::cpo));chain(C2); ! k. C1(k) << C2(k)|]\ |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
69 |
\ ==> lub(range(C1)) << lub(range(C2))" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
70 |
(fn prems => |
1461 | 71 |
[ |
72 |
(cut_facts_tac prems 1), |
|
73 |
(etac is_lub_thelub 1), |
|
74 |
(rtac ub_rangeI 1), |
|
75 |
(rtac allI 1), |
|
76 |
(rtac trans_less 1), |
|
77 |
(etac spec 1), |
|
78 |
(etac is_ub_thelub 1) |
|
79 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
80 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
81 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
82 |
(* the = relation between two chains is preserved by their lubs *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
83 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
84 |
|
2640 | 85 |
qed_goal "lub_equal" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
86 |
"[| chain(C1::(nat=>'a::cpo));chain(C2);!k. C1(k)=C2(k)|]\ |
1461 | 87 |
\ ==> lub(range(C1))=lub(range(C2))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
88 |
(fn prems => |
1461 | 89 |
[ |
90 |
(cut_facts_tac prems 1), |
|
91 |
(rtac antisym_less 1), |
|
92 |
(rtac lub_mono 1), |
|
93 |
(atac 1), |
|
94 |
(atac 1), |
|
95 |
(strip_tac 1), |
|
96 |
(rtac (antisym_less_inverse RS conjunct1) 1), |
|
97 |
(etac spec 1), |
|
98 |
(rtac lub_mono 1), |
|
99 |
(atac 1), |
|
100 |
(atac 1), |
|
101 |
(strip_tac 1), |
|
102 |
(rtac (antisym_less_inverse RS conjunct2) 1), |
|
103 |
(etac spec 1) |
|
104 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
105 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
106 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
107 |
(* more results about mono and = of lubs of chains *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
108 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
109 |
|
2640 | 110 |
qed_goal "lub_mono2" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
111 |
"[|? j.!i. j<i --> X(i::nat)=Y(i);chain(X::nat=>'a::cpo);chain(Y)|]\ |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
112 |
\ ==> lub(range(X))<<lub(range(Y))" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
113 |
(fn prems => |
1461 | 114 |
[ |
115 |
(rtac exE 1), |
|
116 |
(resolve_tac prems 1), |
|
117 |
(rtac is_lub_thelub 1), |
|
118 |
(resolve_tac prems 1), |
|
119 |
(rtac ub_rangeI 1), |
|
120 |
(strip_tac 1), |
|
1675 | 121 |
(case_tac "x<i" 1), |
1461 | 122 |
(res_inst_tac [("s","Y(i)"),("t","X(i)")] subst 1), |
123 |
(rtac sym 1), |
|
3726 | 124 |
(Fast_tac 1), |
1461 | 125 |
(rtac is_ub_thelub 1), |
126 |
(resolve_tac prems 1), |
|
127 |
(res_inst_tac [("y","X(Suc(x))")] trans_less 1), |
|
128 |
(rtac (chain_mono RS mp) 1), |
|
129 |
(resolve_tac prems 1), |
|
130 |
(rtac (not_less_eq RS subst) 1), |
|
131 |
(atac 1), |
|
132 |
(res_inst_tac [("s","Y(Suc(x))"),("t","X(Suc(x))")] subst 1), |
|
133 |
(rtac sym 1), |
|
134 |
(Asm_simp_tac 1), |
|
135 |
(rtac is_ub_thelub 1), |
|
136 |
(resolve_tac prems 1) |
|
137 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
138 |
|
2640 | 139 |
qed_goal "lub_equal2" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
140 |
"[|? j.!i. j<i --> X(i)=Y(i);chain(X::nat=>'a::cpo);chain(Y)|]\ |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
141 |
\ ==> lub(range(X))=lub(range(Y))" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
142 |
(fn prems => |
1461 | 143 |
[ |
144 |
(rtac antisym_less 1), |
|
145 |
(rtac lub_mono2 1), |
|
146 |
(REPEAT (resolve_tac prems 1)), |
|
147 |
(cut_facts_tac prems 1), |
|
148 |
(rtac lub_mono2 1), |
|
3726 | 149 |
Safe_tac, |
150 |
(Step_tac 1), |
|
151 |
Safe_tac, |
|
1461 | 152 |
(rtac sym 1), |
3726 | 153 |
(Fast_tac 1) |
1461 | 154 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
155 |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
156 |
qed_goal "lub_mono3" thy "[|chain(Y::nat=>'a::cpo);chain(X);\ |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
157 |
\! i. ? j. Y(i)<< X(j)|]==> lub(range(Y))<<lub(range(X))" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
158 |
(fn prems => |
1461 | 159 |
[ |
160 |
(cut_facts_tac prems 1), |
|
161 |
(rtac is_lub_thelub 1), |
|
162 |
(atac 1), |
|
163 |
(rtac ub_rangeI 1), |
|
164 |
(strip_tac 1), |
|
165 |
(etac allE 1), |
|
166 |
(etac exE 1), |
|
167 |
(rtac trans_less 1), |
|
168 |
(rtac is_ub_thelub 2), |
|
169 |
(atac 2), |
|
170 |
(atac 1) |
|
171 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
172 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
173 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
174 |
(* usefull lemmas about UU *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
175 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
176 |
|
2640 | 177 |
val eq_UU_sym = prove_goal thy "(UU = x) = (x = UU)" (fn _ => [ |
3726 | 178 |
Fast_tac 1]); |
2275 | 179 |
|
2640 | 180 |
qed_goal "eq_UU_iff" thy "(x=UU)=(x<<UU)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
181 |
(fn prems => |
1461 | 182 |
[ |
183 |
(rtac iffI 1), |
|
184 |
(hyp_subst_tac 1), |
|
185 |
(rtac refl_less 1), |
|
186 |
(rtac antisym_less 1), |
|
187 |
(atac 1), |
|
188 |
(rtac minimal 1) |
|
189 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
190 |
|
2640 | 191 |
qed_goal "UU_I" thy "x << UU ==> x = UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
192 |
(fn prems => |
1461 | 193 |
[ |
2033 | 194 |
(stac eq_UU_iff 1), |
1461 | 195 |
(resolve_tac prems 1) |
196 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
197 |
|
3323
194ae2e0c193
eliminated the constant less by the introduction of the axclass sq_ord
slotosch
parents:
2839
diff
changeset
|
198 |
qed_goal "not_less2not_eq" thy "~(x::'a::po)<<y ==> ~x=y" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
199 |
(fn prems => |
1461 | 200 |
[ |
201 |
(cut_facts_tac prems 1), |
|
2445
51993fea433f
removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents:
2416
diff
changeset
|
202 |
(rtac classical2 1), |
1461 | 203 |
(atac 1), |
204 |
(hyp_subst_tac 1), |
|
205 |
(rtac refl_less 1) |
|
206 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
207 |
|
2640 | 208 |
qed_goal "chain_UU_I" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
209 |
"[|chain(Y);lub(range(Y))=UU|] ==> ! i. Y(i)=UU" |
1043 | 210 |
(fn prems => |
1461 | 211 |
[ |
212 |
(cut_facts_tac prems 1), |
|
213 |
(rtac allI 1), |
|
214 |
(rtac antisym_less 1), |
|
215 |
(rtac minimal 2), |
|
216 |
(etac subst 1), |
|
217 |
(etac is_ub_thelub 1) |
|
218 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
219 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
220 |
|
2640 | 221 |
qed_goal "chain_UU_I_inverse" thy |
3842 | 222 |
"!i. Y(i::nat)=UU ==> lub(range(Y::(nat=>'a::pcpo)))=UU" |
1043 | 223 |
(fn prems => |
1461 | 224 |
[ |
225 |
(cut_facts_tac prems 1), |
|
226 |
(rtac lub_chain_maxelem 1), |
|
227 |
(rtac exI 1), |
|
228 |
(etac spec 1), |
|
229 |
(rtac allI 1), |
|
230 |
(rtac (antisym_less_inverse RS conjunct1) 1), |
|
231 |
(etac spec 1) |
|
232 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
233 |
|
2640 | 234 |
qed_goal "chain_UU_I_inverse2" thy |
1461 | 235 |
"~lub(range(Y::(nat=>'a::pcpo)))=UU ==> ? i.~ Y(i)=UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
236 |
(fn prems => |
1461 | 237 |
[ |
238 |
(cut_facts_tac prems 1), |
|
1675 | 239 |
(rtac (not_all RS iffD1) 1), |
1461 | 240 |
(rtac swap 1), |
241 |
(rtac chain_UU_I_inverse 2), |
|
242 |
(etac notnotD 2), |
|
243 |
(atac 1) |
|
244 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
245 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
246 |
|
2640 | 247 |
qed_goal "notUU_I" thy "[| x<<y; ~x=UU |] ==> ~y=UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
248 |
(fn prems => |
1461 | 249 |
[ |
250 |
(cut_facts_tac prems 1), |
|
251 |
(etac contrapos 1), |
|
252 |
(rtac UU_I 1), |
|
253 |
(hyp_subst_tac 1), |
|
254 |
(atac 1) |
|
255 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
256 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
257 |
|
2640 | 258 |
qed_goal "chain_mono2" thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
259 |
"[|? j.~Y(j)=UU;chain(Y::nat=>'a::pcpo)|]\ |
3842 | 260 |
\ ==> ? j.!i. j<i-->~Y(i)=UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
261 |
(fn prems => |
1461 | 262 |
[ |
263 |
(cut_facts_tac prems 1), |
|
3726 | 264 |
Safe_tac, |
265 |
(Step_tac 1), |
|
1461 | 266 |
(strip_tac 1), |
267 |
(rtac notUU_I 1), |
|
268 |
(atac 2), |
|
269 |
(etac (chain_mono RS mp) 1), |
|
270 |
(atac 1) |
|
271 |
]); |
|
3326 | 272 |
|
273 |
(**************************************) |
|
274 |
(* some properties for chfin and flat *) |
|
275 |
(**************************************) |
|
276 |
||
277 |
(* ------------------------------------------------------------------------ *) |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
278 |
(* flat types are chfin *) |
3326 | 279 |
(* ------------------------------------------------------------------------ *) |
280 |
||
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
281 |
qed_goalw "flat_imp_chfin" thy [max_in_chain_def] |
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
282 |
"!Y::nat=>'a::flat. chain Y-->(? n. max_in_chain n Y)" |
3326 | 283 |
(fn _ => |
284 |
[ |
|
285 |
(strip_tac 1), |
|
3842 | 286 |
(case_tac "!i. Y(i)=UU" 1), |
3326 | 287 |
(res_inst_tac [("x","0")] exI 1), |
288 |
(Asm_simp_tac 1), |
|
289 |
(Asm_full_simp_tac 1), |
|
290 |
(etac exE 1), |
|
291 |
(res_inst_tac [("x","i")] exI 1), |
|
292 |
(strip_tac 1), |
|
293 |
(dres_inst_tac [("x","i"),("y","j")] chain_mono 1), |
|
294 |
(etac (le_imp_less_or_eq RS disjE) 1), |
|
3726 | 295 |
Safe_tac, |
3326 | 296 |
(dtac (ax_flat RS spec RS spec RS mp) 1), |
3726 | 297 |
(Fast_tac 1) |
3326 | 298 |
]); |
299 |
||
300 |
(* flat subclass of chfin --> adm_flat not needed *) |
|
301 |
||
302 |
qed_goal "flat_eq" thy "(a::'a::flat) ~= UU ==> a << b = (a = b)" |
|
303 |
(fn prems=> |
|
304 |
[ |
|
305 |
cut_facts_tac prems 1, |
|
306 |
safe_tac (HOL_cs addSIs [refl_less]), |
|
307 |
dtac (ax_flat RS spec RS spec RS mp) 1, |
|
308 |
fast_tac (HOL_cs addSIs [refl_less,ax_flat RS spec RS spec RS mp]) 1 |
|
309 |
]); |
|
310 |
||
311 |
qed_goal "chfin2finch" thy |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
312 |
"chain (Y::nat=>'a::chfin) ==> finite_chain Y" |
3326 | 313 |
(fn prems => |
314 |
[ |
|
315 |
cut_facts_tac prems 1, |
|
316 |
fast_tac (HOL_cs addss |
|
4098 | 317 |
(simpset() addsimps [chfin,finite_chain_def])) 1 |
3326 | 318 |
]); |
319 |
||
320 |
(* ------------------------------------------------------------------------ *) |
|
321 |
(* lemmata for improved admissibility introdution rule *) |
|
322 |
(* ------------------------------------------------------------------------ *) |
|
323 |
||
324 |
qed_goal "infinite_chain_adm_lemma" Porder.thy |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
325 |
"[|chain Y; !i. P (Y i); \ |
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
326 |
\ (!!Y. [| chain Y; !i. P (Y i); ~ finite_chain Y |] ==> P (lub (range Y)))\ |
3326 | 327 |
\ |] ==> P (lub (range Y))" |
328 |
(fn prems => [ |
|
329 |
cut_facts_tac prems 1, |
|
330 |
case_tac "finite_chain Y" 1, |
|
331 |
eresolve_tac prems 2, atac 2, atac 2, |
|
332 |
rewtac finite_chain_def, |
|
333 |
safe_tac HOL_cs, |
|
334 |
etac (lub_finch1 RS thelubI RS ssubst) 1, atac 1, etac spec 1]); |
|
335 |
||
336 |
qed_goal "increasing_chain_adm_lemma" Porder.thy |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
337 |
"[|chain Y; !i. P (Y i); \ |
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
338 |
\ (!!Y. [| chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j|]\ |
3326 | 339 |
\ ==> P (lub (range Y))) |] ==> P (lub (range Y))" |
340 |
(fn prems => [ |
|
341 |
cut_facts_tac prems 1, |
|
342 |
etac infinite_chain_adm_lemma 1, atac 1, etac thin_rl 1, |
|
343 |
rewtac finite_chain_def, |
|
344 |
safe_tac HOL_cs, |
|
345 |
etac swap 1, |
|
346 |
rewtac max_in_chain_def, |
|
347 |
resolve_tac prems 1, atac 1, atac 1, |
|
348 |
fast_tac (HOL_cs addDs [le_imp_less_or_eq] |
|
349 |
addEs [chain_mono RS mp]) 1]); |