author | paulson |
Tue, 04 Jul 2000 15:58:11 +0200 | |
changeset 9245 | 428385c4bc50 |
parent 8820 | a1297de19ec7 |
child 9248 | e1dee89de037 |
permissions | -rw-r--r-- |
9245 | 1 |
(* Title: HOLCF/Cfun3 |
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 |
9245 | 5 |
|
6 |
Class instance of -> for class pcpo |
|
243
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 |
|
2640 | 9 |
(* for compatibility with old HOLCF-Version *) |
9245 | 10 |
val prems = goal thy "UU = Abs_CFun(%x. UU)"; |
11 |
by (simp_tac (HOL_ss addsimps [UU_def,UU_cfun_def]) 1); |
|
12 |
qed "inst_cfun_pcpo"; |
|
2640 | 13 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
14 |
(* ------------------------------------------------------------------------ *) |
5291 | 15 |
(* the contlub property for Rep_CFun its 'first' argument *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
16 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
17 |
|
9245 | 18 |
val prems = goal thy "contlub(Rep_CFun)"; |
19 |
by (rtac contlubI 1); |
|
20 |
by (strip_tac 1); |
|
21 |
by (rtac (expand_fun_eq RS iffD2) 1); |
|
22 |
by (strip_tac 1); |
|
23 |
by (stac thelub_cfun 1); |
|
24 |
by (atac 1); |
|
25 |
by (stac Cfunapp2 1); |
|
26 |
by (etac cont_lubcfun 1); |
|
27 |
by (stac thelub_fun 1); |
|
28 |
by (etac (monofun_Rep_CFun1 RS ch2ch_monofun) 1); |
|
29 |
by (rtac refl 1); |
|
30 |
qed "contlub_Rep_CFun1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
31 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
32 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
33 |
(* ------------------------------------------------------------------------ *) |
5291 | 34 |
(* the cont property for Rep_CFun in its first argument *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
35 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
36 |
|
9245 | 37 |
val prems = goal thy "cont(Rep_CFun)"; |
38 |
by (rtac monocontlub2cont 1); |
|
39 |
by (rtac monofun_Rep_CFun1 1); |
|
40 |
by (rtac contlub_Rep_CFun1 1); |
|
41 |
qed "cont_Rep_CFun1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
42 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
43 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
44 |
(* ------------------------------------------------------------------------ *) |
5291 | 45 |
(* contlub, cont properties of Rep_CFun in its first argument in mixfix _[_] *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
46 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
47 |
|
9245 | 48 |
val prems = goal thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4423
diff
changeset
|
49 |
"chain(FY) ==>\ |
9245 | 50 |
\ lub(range FY)`x = lub(range (%i. FY(i)`x))"; |
51 |
by (cut_facts_tac prems 1); |
|
52 |
by (rtac trans 1); |
|
53 |
by (etac (contlub_Rep_CFun1 RS contlubE RS spec RS mp RS fun_cong) 1); |
|
54 |
by (stac thelub_fun 1); |
|
55 |
by (etac (monofun_Rep_CFun1 RS ch2ch_monofun) 1); |
|
56 |
by (rtac refl 1); |
|
57 |
qed "contlub_cfun_fun"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
58 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
59 |
|
9245 | 60 |
val prems = goal thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4423
diff
changeset
|
61 |
"chain(FY) ==>\ |
9245 | 62 |
\ range(%i. FY(i)`x) <<| lub(range FY)`x"; |
63 |
by (cut_facts_tac prems 1); |
|
64 |
by (rtac thelubE 1); |
|
65 |
by (etac ch2ch_Rep_CFunL 1); |
|
66 |
by (etac (contlub_cfun_fun RS sym) 1); |
|
67 |
qed "cont_cfun_fun"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
68 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
69 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
70 |
(* ------------------------------------------------------------------------ *) |
5291 | 71 |
(* contlub, cont properties of Rep_CFun in both argument in mixfix _[_] *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
72 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
73 |
|
9245 | 74 |
val prems = goal thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4423
diff
changeset
|
75 |
"[|chain(FY);chain(TY)|] ==>\ |
9245 | 76 |
\ (lub(range FY))`(lub(range TY)) = lub(range(%i. FY(i)`(TY i)))"; |
77 |
by (cut_facts_tac prems 1); |
|
78 |
by (rtac contlub_CF2 1); |
|
79 |
by (rtac cont_Rep_CFun1 1); |
|
80 |
by (rtac allI 1); |
|
81 |
by (rtac cont_Rep_CFun2 1); |
|
82 |
by (atac 1); |
|
83 |
by (atac 1); |
|
84 |
qed "contlub_cfun"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
85 |
|
9245 | 86 |
val prems = goal thy |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4423
diff
changeset
|
87 |
"[|chain(FY);chain(TY)|] ==>\ |
9245 | 88 |
\ range(%i.(FY i)`(TY i)) <<| (lub (range FY))`(lub(range TY))"; |
89 |
by (cut_facts_tac prems 1); |
|
90 |
by (rtac thelubE 1); |
|
91 |
by (rtac (monofun_Rep_CFun1 RS ch2ch_MF2LR) 1); |
|
92 |
by (rtac allI 1); |
|
93 |
by (rtac monofun_Rep_CFun2 1); |
|
94 |
by (atac 1); |
|
95 |
by (atac 1); |
|
96 |
by (etac (contlub_cfun RS sym) 1); |
|
97 |
by (atac 1); |
|
98 |
qed "cont_cfun"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
99 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
100 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
101 |
(* ------------------------------------------------------------------------ *) |
5291 | 102 |
(* cont2cont lemma for Rep_CFun *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
103 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
104 |
|
9245 | 105 |
Goal "[|cont(%x. ft x);cont(%x. tt x)|] ==> cont(%x. (ft x)`(tt x))"; |
106 |
by (best_tac (claset() addIs [cont2cont_app2, cont_const, cont_Rep_CFun1, |
|
107 |
cont_Rep_CFun2]) 1); |
|
108 |
qed "cont2cont_Rep_CFun"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
109 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
110 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
111 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
112 |
(* ------------------------------------------------------------------------ *) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
961
diff
changeset
|
113 |
(* cont2mono Lemma for %x. LAM y. c1(x)(y) *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
114 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
115 |
|
9245 | 116 |
val [p1,p2] = goal thy |
117 |
"[| !!x. cont(c1 x); !!y. monofun(%x. c1 x y)|] ==> monofun(%x. LAM y. c1 x y)"; |
|
118 |
by (rtac monofunI 1); |
|
119 |
by (strip_tac 1); |
|
120 |
by (stac less_cfun 1); |
|
121 |
by (stac less_fun 1); |
|
122 |
by (rtac allI 1); |
|
123 |
by (stac beta_cfun 1); |
|
124 |
by (rtac p1 1); |
|
125 |
by (stac beta_cfun 1); |
|
126 |
by (rtac p1 1); |
|
127 |
by (etac (p2 RS monofunE RS spec RS spec RS mp) 1); |
|
128 |
qed "cont2mono_LAM"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
129 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
130 |
(* ------------------------------------------------------------------------ *) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
961
diff
changeset
|
131 |
(* cont2cont Lemma for %x. LAM y. c1 x y) *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
132 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
133 |
|
9245 | 134 |
val [p1,p2] = goal thy |
135 |
"[| !!x. cont(c1 x); !!y. cont(%x. c1 x y) |] ==> cont(%x. LAM y. c1 x y)"; |
|
136 |
by (rtac monocontlub2cont 1); |
|
137 |
by (rtac (p1 RS cont2mono_LAM) 1); |
|
138 |
by (rtac (p2 RS cont2mono) 1); |
|
139 |
by (rtac contlubI 1); |
|
140 |
by (strip_tac 1); |
|
141 |
by (stac thelub_cfun 1); |
|
142 |
by (rtac (p1 RS cont2mono_LAM RS ch2ch_monofun) 1); |
|
143 |
by (rtac (p2 RS cont2mono) 1); |
|
144 |
by (atac 1); |
|
145 |
by (res_inst_tac [("f","Abs_CFun")] arg_cong 1); |
|
146 |
by (rtac ext 1); |
|
147 |
by (stac (p1 RS beta_cfun RS ext) 1); |
|
148 |
by (etac (p2 RS cont2contlub RS contlubE RS spec RS mp) 1); |
|
149 |
qed "cont2cont_LAM"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
150 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
151 |
(* ------------------------------------------------------------------------ *) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
961
diff
changeset
|
152 |
(* cont2cont tactic *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
153 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
154 |
|
5291 | 155 |
val cont_lemmas1 = [cont_const, cont_id, cont_Rep_CFun2, |
156 |
cont2cont_Rep_CFun,cont2cont_LAM]; |
|
2566 | 157 |
|
158 |
Addsimps cont_lemmas1; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
159 |
|
4004 | 160 |
(* HINT: cont_tac is now installed in simplifier in Lift.ML ! *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
161 |
|
2566 | 162 |
(*val cont_tac = (fn i => (resolve_tac cont_lemmas i));*) |
163 |
(*val cont_tacR = (fn i => (REPEAT (cont_tac i)));*) |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
164 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
165 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
166 |
(* function application _[_] is strict in its first arguments *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
167 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
168 |
|
9245 | 169 |
val prems = goal thy "(UU::'a::cpo->'b)`x = (UU::'b)"; |
170 |
by (stac inst_cfun_pcpo 1); |
|
171 |
by (stac beta_cfun 1); |
|
172 |
by (Simp_tac 1); |
|
173 |
by (rtac refl 1); |
|
174 |
qed "strict_Rep_CFun1"; |
|
243
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 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
177 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
178 |
(* results about strictify *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
179 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
180 |
|
9245 | 181 |
val prems = goalw thy [Istrictify_def] |
182 |
"Istrictify(f)(UU)= (UU)"; |
|
183 |
by (Simp_tac 1); |
|
184 |
qed "Istrictify1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
185 |
|
9245 | 186 |
val prems = goalw thy [Istrictify_def] |
187 |
"~x=UU ==> Istrictify(f)(x)=f`x"; |
|
188 |
by (cut_facts_tac prems 1); |
|
189 |
by (Asm_simp_tac 1); |
|
190 |
qed "Istrictify2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
191 |
|
9245 | 192 |
val prems = goal thy "monofun(Istrictify)"; |
193 |
by (rtac monofunI 1); |
|
194 |
by (strip_tac 1); |
|
195 |
by (rtac (less_fun RS iffD2) 1); |
|
196 |
by (strip_tac 1); |
|
197 |
by (res_inst_tac [("Q","xa=UU")] (excluded_middle RS disjE) 1); |
|
198 |
by (stac Istrictify2 1); |
|
199 |
by (atac 1); |
|
200 |
by (stac Istrictify2 1); |
|
201 |
by (atac 1); |
|
202 |
by (rtac monofun_cfun_fun 1); |
|
203 |
by (atac 1); |
|
204 |
by (hyp_subst_tac 1); |
|
205 |
by (stac Istrictify1 1); |
|
206 |
by (stac Istrictify1 1); |
|
207 |
by (rtac refl_less 1); |
|
208 |
qed "monofun_Istrictify1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
209 |
|
9245 | 210 |
val prems = goal thy "monofun(Istrictify(f))"; |
211 |
by (rtac monofunI 1); |
|
212 |
by (strip_tac 1); |
|
213 |
by (res_inst_tac [("Q","x=UU")] (excluded_middle RS disjE) 1); |
|
214 |
by (stac Istrictify2 1); |
|
215 |
by (etac notUU_I 1); |
|
216 |
by (atac 1); |
|
217 |
by (stac Istrictify2 1); |
|
218 |
by (atac 1); |
|
219 |
by (rtac monofun_cfun_arg 1); |
|
220 |
by (atac 1); |
|
221 |
by (hyp_subst_tac 1); |
|
222 |
by (stac Istrictify1 1); |
|
223 |
by (rtac minimal 1); |
|
224 |
qed "monofun_Istrictify2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
225 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
226 |
|
9245 | 227 |
val prems = goal thy "contlub(Istrictify)"; |
228 |
by (rtac contlubI 1); |
|
229 |
by (strip_tac 1); |
|
230 |
by (rtac (expand_fun_eq RS iffD2) 1); |
|
231 |
by (strip_tac 1); |
|
232 |
by (stac thelub_fun 1); |
|
233 |
by (etac (monofun_Istrictify1 RS ch2ch_monofun) 1); |
|
234 |
by (res_inst_tac [("Q","x=UU")] (excluded_middle RS disjE) 1); |
|
235 |
by (stac Istrictify2 1); |
|
236 |
by (atac 1); |
|
237 |
by (stac (Istrictify2 RS ext) 1); |
|
238 |
by (atac 1); |
|
239 |
by (stac thelub_cfun 1); |
|
240 |
by (atac 1); |
|
241 |
by (stac beta_cfun 1); |
|
242 |
by (rtac cont_lubcfun 1); |
|
243 |
by (atac 1); |
|
244 |
by (rtac refl 1); |
|
245 |
by (hyp_subst_tac 1); |
|
246 |
by (stac Istrictify1 1); |
|
247 |
by (stac (Istrictify1 RS ext) 1); |
|
248 |
by (rtac (chain_UU_I_inverse RS sym) 1); |
|
249 |
by (rtac (refl RS allI) 1); |
|
250 |
qed "contlub_Istrictify1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
251 |
|
9245 | 252 |
Goal "contlub(Istrictify(f::'a -> 'b))"; |
253 |
by (rtac contlubI 1); |
|
254 |
by (strip_tac 1); |
|
255 |
by (case_tac "lub(range(Y))=(UU::'a)" 1); |
|
256 |
by (asm_simp_tac (simpset() addsimps [Istrictify1, chain_UU_I_inverse, chain_UU_I, Istrictify1]) 1); |
|
257 |
by (stac Istrictify2 1); |
|
258 |
by (atac 1); |
|
259 |
by (res_inst_tac [("s","lub(range(%i. f`(Y i)))")] trans 1); |
|
260 |
by (rtac contlub_cfun_arg 1); |
|
261 |
by (atac 1); |
|
262 |
by (rtac lub_equal2 1); |
|
263 |
by (best_tac (claset() addIs [ch2ch_monofun, monofun_Istrictify2]) 3); |
|
264 |
by (best_tac (claset() addIs [ch2ch_monofun, monofun_Rep_CFun2]) 2); |
|
265 |
by (rtac (chain_mono2 RS exE) 1); |
|
266 |
by (atac 2); |
|
267 |
by (etac chain_UU_I_inverse2 1); |
|
268 |
by (blast_tac (claset() addIs [Istrictify2 RS sym]) 1); |
|
269 |
qed "contlub_Istrictify2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
270 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
271 |
|
1779 | 272 |
bind_thm ("cont_Istrictify1", contlub_Istrictify1 RS |
1461 | 273 |
(monofun_Istrictify1 RS monocontlub2cont)); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
274 |
|
1779 | 275 |
bind_thm ("cont_Istrictify2", contlub_Istrictify2 RS |
1461 | 276 |
(monofun_Istrictify2 RS monocontlub2cont)); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
277 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
278 |
|
9245 | 279 |
val _ = goalw thy [strictify_def] "strictify`f`UU=UU"; |
280 |
by (stac beta_cfun 1); |
|
281 |
by (simp_tac (simpset() addsimps [cont_Istrictify2,cont_Istrictify1, cont2cont_CF1L]) 1); |
|
282 |
by (stac beta_cfun 1); |
|
283 |
by (rtac cont_Istrictify2 1); |
|
284 |
by (rtac Istrictify1 1); |
|
285 |
qed "strictify1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
286 |
|
9245 | 287 |
val prems = goalw thy [strictify_def] |
288 |
"~x=UU ==> strictify`f`x=f`x"; |
|
289 |
by (stac beta_cfun 1); |
|
290 |
by (simp_tac (simpset() addsimps [cont_Istrictify2,cont_Istrictify1, cont2cont_CF1L]) 1); |
|
291 |
by (stac beta_cfun 1); |
|
292 |
by (rtac cont_Istrictify2 1); |
|
293 |
by (rtac Istrictify2 1); |
|
294 |
by (resolve_tac prems 1); |
|
295 |
qed "strictify2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
296 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
297 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
298 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
299 |
(* Instantiate the simplifier *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
300 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
301 |
|
5291 | 302 |
Addsimps [minimal,refl_less,beta_cfun,strict_Rep_CFun1,strictify1, strictify2]; |
1267 | 303 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
304 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
305 |
(* ------------------------------------------------------------------------ *) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
961
diff
changeset
|
306 |
(* use cont_tac as autotac. *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
307 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
308 |
|
4004 | 309 |
(* HINT: cont_tac is now installed in simplifier in Lift.ML ! *) |
4098 | 310 |
(*simpset_ref() := simpset() addsolver (K (DEPTH_SOLVE_1 o cont_tac));*) |
3326 | 311 |
|
312 |
(* ------------------------------------------------------------------------ *) |
|
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4423
diff
changeset
|
313 |
(* some lemmata for functions with flat/chfin domain/range types *) |
3326 | 314 |
(* ------------------------------------------------------------------------ *) |
315 |
||
9245 | 316 |
Goal "chain (Y::nat => 'a::cpo->'b::chfin) \ |
317 |
\ ==> !s. ? n. lub(range(Y))`s = Y n`s"; |
|
318 |
by (rtac allI 1); |
|
319 |
by (stac contlub_cfun_fun 1); |
|
320 |
by (atac 1); |
|
321 |
by (fast_tac (HOL_cs addSIs [thelubI,chfin,lub_finch2,chfin2finch,ch2ch_Rep_CFunL])1); |
|
322 |
qed "chfin_Rep_CFunR"; |
|
3326 | 323 |
|
324 |
(* ------------------------------------------------------------------------ *) |
|
325 |
(* continuous isomorphisms are strict *) |
|
326 |
(* a prove for embedding projection pairs is similar *) |
|
327 |
(* ------------------------------------------------------------------------ *) |
|
328 |
||
9245 | 329 |
val prems = goal thy |
3842 | 330 |
"!!f g.[|!y. f`(g`y)=(y::'b) ; !x. g`(f`x)=(x::'a) |] \ |
9245 | 331 |
\ ==> f`UU=UU & g`UU=UU"; |
332 |
by (rtac conjI 1); |
|
333 |
by (rtac UU_I 1); |
|
334 |
by (res_inst_tac [("s","f`(g`(UU::'b))"),("t","UU::'b")] subst 1); |
|
335 |
by (etac spec 1); |
|
336 |
by (rtac (minimal RS monofun_cfun_arg) 1); |
|
337 |
by (rtac UU_I 1); |
|
338 |
by (res_inst_tac [("s","g`(f`(UU::'a))"),("t","UU::'a")] subst 1); |
|
339 |
by (etac spec 1); |
|
340 |
by (rtac (minimal RS monofun_cfun_arg) 1); |
|
341 |
qed "iso_strict"; |
|
3326 | 342 |
|
343 |
||
9245 | 344 |
val prems = goal thy |
345 |
"[|!x. rep`(ab`x)=x;!y. ab`(rep`y)=y; z~=UU|] ==> rep`z ~= UU"; |
|
346 |
by (cut_facts_tac prems 1); |
|
347 |
by (etac swap 1); |
|
348 |
by (dtac notnotD 1); |
|
349 |
by (dres_inst_tac [("f","ab")] cfun_arg_cong 1); |
|
350 |
by (etac box_equals 1); |
|
351 |
by (fast_tac HOL_cs 1); |
|
352 |
by (etac (iso_strict RS conjunct1) 1); |
|
353 |
by (atac 1); |
|
354 |
qed "isorep_defined"; |
|
3326 | 355 |
|
9245 | 356 |
val prems = goal thy |
357 |
"[|!x. rep`(ab`x) = x;!y. ab`(rep`y)=y ; z~=UU|] ==> ab`z ~= UU"; |
|
358 |
by (cut_facts_tac prems 1); |
|
359 |
by (etac swap 1); |
|
360 |
by (dtac notnotD 1); |
|
361 |
by (dres_inst_tac [("f","rep")] cfun_arg_cong 1); |
|
362 |
by (etac box_equals 1); |
|
363 |
by (fast_tac HOL_cs 1); |
|
364 |
by (etac (iso_strict RS conjunct2) 1); |
|
365 |
by (atac 1); |
|
366 |
qed "isoabs_defined"; |
|
3326 | 367 |
|
368 |
(* ------------------------------------------------------------------------ *) |
|
369 |
(* propagation of flatness and chainfiniteness by continuous isomorphisms *) |
|
370 |
(* ------------------------------------------------------------------------ *) |
|
371 |
||
9245 | 372 |
val prems = goal thy "!!f g.[|! Y::nat=>'a. chain Y --> (? n. max_in_chain n Y); \ |
3842 | 373 |
\ !y. f`(g`y)=(y::'b) ; !x. g`(f`x)=(x::'a::chfin) |] \ |
9245 | 374 |
\ ==> ! Y::nat=>'b. chain Y --> (? n. max_in_chain n Y)"; |
375 |
by (rewtac max_in_chain_def); |
|
376 |
by (strip_tac 1); |
|
377 |
by (rtac exE 1); |
|
378 |
by (res_inst_tac [("P","chain(%i. g`(Y i))")] mp 1); |
|
379 |
by (etac spec 1); |
|
380 |
by (etac ch2ch_Rep_CFunR 1); |
|
381 |
by (rtac exI 1); |
|
382 |
by (strip_tac 1); |
|
383 |
by (res_inst_tac [("s","f`(g`(Y x))"),("t","Y(x)")] subst 1); |
|
384 |
by (etac spec 1); |
|
385 |
by (res_inst_tac [("s","f`(g`(Y j))"),("t","Y(j)")] subst 1); |
|
386 |
by (etac spec 1); |
|
387 |
by (rtac cfun_arg_cong 1); |
|
388 |
by (rtac mp 1); |
|
389 |
by (etac spec 1); |
|
390 |
by (atac 1); |
|
391 |
qed "chfin2chfin"; |
|
3326 | 392 |
|
393 |
||
9245 | 394 |
val prems = goal thy "!!f g.[|!x y::'a. x<<y --> x=UU | x=y; \ |
395 |
\ !y. f`(g`y)=(y::'b); !x. g`(f`x)=(x::'a)|] ==> !x y::'b. x<<y --> x=UU | x=y"; |
|
396 |
by (strip_tac 1); |
|
397 |
by (rtac disjE 1); |
|
398 |
by (res_inst_tac [("P","g`x<<g`y")] mp 1); |
|
399 |
by (etac monofun_cfun_arg 2); |
|
400 |
by (dtac spec 1); |
|
401 |
by (etac spec 1); |
|
402 |
by (rtac disjI1 1); |
|
403 |
by (rtac trans 1); |
|
404 |
by (res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1); |
|
405 |
by (etac spec 1); |
|
406 |
by (etac cfun_arg_cong 1); |
|
407 |
by (rtac (iso_strict RS conjunct1) 1); |
|
408 |
by (atac 1); |
|
409 |
by (atac 1); |
|
410 |
by (rtac disjI2 1); |
|
411 |
by (res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1); |
|
412 |
by (etac spec 1); |
|
413 |
by (res_inst_tac [("s","f`(g`y)"),("t","y")] subst 1); |
|
414 |
by (etac spec 1); |
|
415 |
by (etac cfun_arg_cong 1); |
|
416 |
qed "flat2flat"; |
|
3326 | 417 |
|
418 |
(* ------------------------------------------------------------------------- *) |
|
419 |
(* a result about functions with flat codomain *) |
|
420 |
(* ------------------------------------------------------------------------- *) |
|
421 |
||
9245 | 422 |
val prems = goal thy |
423 |
"f`(x::'a)=(c::'b::flat) ==> f`(UU::'a)=(UU::'b) | (!z. f`(z::'a)=c)"; |
|
424 |
by (cut_facts_tac prems 1); |
|
425 |
by (case_tac "f`(x::'a)=(UU::'b)" 1); |
|
426 |
by (rtac disjI1 1); |
|
427 |
by (rtac UU_I 1); |
|
428 |
by (res_inst_tac [("s","f`(x)"),("t","UU::'b")] subst 1); |
|
429 |
by (atac 1); |
|
430 |
by (rtac (minimal RS monofun_cfun_arg) 1); |
|
431 |
by (case_tac "f`(UU::'a)=(UU::'b)" 1); |
|
432 |
by (etac disjI1 1); |
|
433 |
by (rtac disjI2 1); |
|
434 |
by (rtac allI 1); |
|
435 |
by (hyp_subst_tac 1); |
|
436 |
by (res_inst_tac [("a","f`(UU::'a)")] (refl RS box_equals) 1); |
|
437 |
by (res_inst_tac [("fo5","f")] ((minimal RS monofun_cfun_arg) RS (ax_flat RS spec RS spec RS mp) RS disjE) 1); |
|
438 |
by (contr_tac 1); |
|
439 |
by (atac 1); |
|
440 |
by (res_inst_tac [("fo5","f")] ((minimal RS monofun_cfun_arg) RS (ax_flat RS spec RS spec RS mp) RS disjE) 1); |
|
441 |
by (contr_tac 1); |
|
442 |
by (atac 1); |
|
443 |
qed "flat_codom"; |
|
3326 | 444 |
|
3327 | 445 |
|
446 |
(* ------------------------------------------------------------------------ *) |
|
447 |
(* Access to definitions *) |
|
448 |
(* ------------------------------------------------------------------------ *) |
|
449 |
||
450 |
||
9245 | 451 |
val prems = goalw thy [ID_def] "ID`x=x"; |
452 |
by (stac beta_cfun 1); |
|
453 |
by (rtac cont_id 1); |
|
454 |
by (rtac refl 1); |
|
455 |
qed "ID1"; |
|
3327 | 456 |
|
9245 | 457 |
val _ = goalw thy [oo_def] "(f oo g)=(LAM x. f`(g`x))"; |
458 |
by (stac beta_cfun 1); |
|
459 |
by (Simp_tac 1); |
|
460 |
by (stac beta_cfun 1); |
|
461 |
by (Simp_tac 1); |
|
462 |
by (rtac refl 1); |
|
463 |
qed "cfcomp1"; |
|
3327 | 464 |
|
9245 | 465 |
val _ = goal thy "(f oo g)`x=f`(g`x)"; |
466 |
by (stac cfcomp1 1); |
|
467 |
by (stac beta_cfun 1); |
|
468 |
by (Simp_tac 1); |
|
469 |
by (rtac refl 1); |
|
470 |
qed "cfcomp2"; |
|
3327 | 471 |
|
472 |
||
473 |
(* ------------------------------------------------------------------------ *) |
|
474 |
(* Show that interpretation of (pcpo,_->_) is a category *) |
|
475 |
(* The class of objects is interpretation of syntactical class pcpo *) |
|
476 |
(* The class of arrows between objects 'a and 'b is interpret. of 'a -> 'b *) |
|
477 |
(* The identity arrow is interpretation of ID *) |
|
478 |
(* The composition of f and g is interpretation of oo *) |
|
479 |
(* ------------------------------------------------------------------------ *) |
|
480 |
||
481 |
||
9245 | 482 |
val prems = goal thy "f oo ID = f "; |
483 |
by (rtac ext_cfun 1); |
|
484 |
by (stac cfcomp2 1); |
|
485 |
by (stac ID1 1); |
|
486 |
by (rtac refl 1); |
|
487 |
qed "ID2"; |
|
3327 | 488 |
|
9245 | 489 |
val prems = goal thy "ID oo f = f "; |
490 |
by (rtac ext_cfun 1); |
|
491 |
by (stac cfcomp2 1); |
|
492 |
by (stac ID1 1); |
|
493 |
by (rtac refl 1); |
|
494 |
qed "ID3"; |
|
3327 | 495 |
|
496 |
||
9245 | 497 |
val prems = goal thy "f oo (g oo h) = (f oo g) oo h"; |
498 |
by (rtac ext_cfun 1); |
|
499 |
by (res_inst_tac [("s","f`(g`(h`x))")] trans 1); |
|
500 |
by (stac cfcomp2 1); |
|
501 |
by (stac cfcomp2 1); |
|
502 |
by (rtac refl 1); |
|
503 |
by (stac cfcomp2 1); |
|
504 |
by (stac cfcomp2 1); |
|
505 |
by (rtac refl 1); |
|
506 |
qed "assoc_oo"; |
|
3327 | 507 |
|
508 |
(* ------------------------------------------------------------------------ *) |
|
509 |
(* Merge the different rewrite rules for the simplifier *) |
|
510 |
(* ------------------------------------------------------------------------ *) |
|
511 |
||
512 |
Addsimps ([ID1,ID2,ID3,cfcomp2]); |
|
513 |
||
514 |