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