author | paulson |
Wed, 23 Apr 1997 11:05:18 +0200 | |
changeset 3019 | ca5a7bbbee6c |
parent 2839 | 7ca787c6efca |
child 3323 | 194ae2e0c193 |
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 |
||
16 |
qed_goalw "UU_least" thy [ UU_def ] "!z.UU << z" |
|
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 |
2839 | 28 |
"[| is_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); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
43 |
(* is_chain(?S1) ==> ?S1(?x) << lub(range(?S1)) *) |
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); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
46 |
(* [| is_chain(?S5); range(?S5) <| ?x1 |] ==> lub(range(?S5)) << ?x1 *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
47 |
|
2640 | 48 |
qed_goal "maxinch_is_thelub" thy "is_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, |
|
59 |
fast_tac ((HOL_cs addSEs [is_ub_thelub]) addss !simpset) 1 |
|
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 |
2839 | 68 |
"[|is_chain(C1::(nat=>'a::cpo));is_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 |
2839 | 86 |
"[| is_chain(C1::(nat=>'a::cpo));is_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 |
2839 | 111 |
"[|? j.!i. j<i --> X(i::nat)=Y(i);is_chain(X::nat=>'a::cpo);is_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), |
|
124 |
(fast_tac HOL_cs 1), |
|
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 |
2839 | 140 |
"[|? j.!i. j<i --> X(i)=Y(i);is_chain(X::nat=>'a::cpo);is_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), |
|
149 |
(safe_tac HOL_cs), |
|
150 |
(step_tac HOL_cs 1), |
|
151 |
(safe_tac HOL_cs), |
|
152 |
(rtac sym 1), |
|
153 |
(fast_tac HOL_cs 1) |
|
154 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
155 |
|
2839 | 156 |
qed_goal "lub_mono3" thy "[|is_chain(Y::nat=>'a::cpo);is_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 _ => [ |
2416 | 178 |
fast_tac HOL_cs 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 |
|
2640 | 198 |
qed_goal "not_less2not_eq" thy "~x<<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 |
1461 | 209 |
"[|is_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 |
1461 | 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 |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
259 |
"[|? j.~Y(j)=UU;is_chain(Y::nat=>'a::pcpo)|]\ |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
260 |
\ ==> ? j.!i.j<i-->~Y(i)=UU" |
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), |
|
264 |
(safe_tac HOL_cs), |
|
265 |
(step_tac HOL_cs 1), |
|
266 |
(strip_tac 1), |
|
267 |
(rtac notUU_I 1), |
|
268 |
(atac 2), |
|
269 |
(etac (chain_mono RS mp) 1), |
|
270 |
(atac 1) |
|
271 |
]); |