author | wenzelm |
Fri, 06 Oct 2000 17:35:58 +0200 | |
changeset 10168 | 50be659d4222 |
parent 9248 | e1dee89de037 |
child 10198 | 2b255b772585 |
permissions | -rw-r--r-- |
9169 | 1 |
(* Title: HOLCF/Ssum3.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 |
|
9169 | 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 *) |
9169 | 10 |
Goal "UU = Isinl UU"; |
11 |
by (simp_tac (HOL_ss addsimps [UU_def,UU_ssum_def]) 1); |
|
12 |
qed "inst_ssum_pcpo"; |
|
2640 | 13 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
14 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
15 |
(* continuity for Isinl and Isinr *) |
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 |
|
9169 | 18 |
Goal "contlub(Isinl)"; |
19 |
by (rtac contlubI 1); |
|
20 |
by (strip_tac 1); |
|
21 |
by (rtac trans 1); |
|
22 |
by (rtac (thelub_ssum1a RS sym) 2); |
|
23 |
by (rtac allI 3); |
|
24 |
by (rtac exI 3); |
|
25 |
by (rtac refl 3); |
|
26 |
by (etac (monofun_Isinl RS ch2ch_monofun) 2); |
|
27 |
by (case_tac "lub(range(Y))=UU" 1); |
|
28 |
by (res_inst_tac [("s","UU"),("t","lub(range(Y))")] ssubst 1); |
|
29 |
by (atac 1); |
|
30 |
by (res_inst_tac [("f","Isinl")] arg_cong 1); |
|
31 |
by (rtac (chain_UU_I_inverse RS sym) 1); |
|
32 |
by (rtac allI 1); |
|
33 |
by (res_inst_tac [("s","UU"),("t","Y(i)")] ssubst 1); |
|
34 |
by (etac (chain_UU_I RS spec ) 1); |
|
35 |
by (atac 1); |
|
36 |
by (rtac Iwhen1 1); |
|
37 |
by (res_inst_tac [("f","Isinl")] arg_cong 1); |
|
38 |
by (rtac lub_equal 1); |
|
39 |
by (atac 1); |
|
40 |
by (rtac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
41 |
by (etac (monofun_Isinl RS ch2ch_monofun) 1); |
|
42 |
by (rtac allI 1); |
|
43 |
by (case_tac "Y(k)=UU" 1); |
|
44 |
by (asm_simp_tac Ssum0_ss 1); |
|
45 |
by (asm_simp_tac Ssum0_ss 1); |
|
46 |
qed "contlub_Isinl"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
47 |
|
9169 | 48 |
Goal "contlub(Isinr)"; |
49 |
by (rtac contlubI 1); |
|
50 |
by (strip_tac 1); |
|
51 |
by (rtac trans 1); |
|
52 |
by (rtac (thelub_ssum1b RS sym) 2); |
|
53 |
by (rtac allI 3); |
|
54 |
by (rtac exI 3); |
|
55 |
by (rtac refl 3); |
|
56 |
by (etac (monofun_Isinr RS ch2ch_monofun) 2); |
|
57 |
by (case_tac "lub(range(Y))=UU" 1); |
|
58 |
by (res_inst_tac [("s","UU"),("t","lub(range(Y))")] ssubst 1); |
|
59 |
by (atac 1); |
|
60 |
by ((rtac arg_cong 1) THEN (rtac (chain_UU_I_inverse RS sym) 1)); |
|
61 |
by (rtac allI 1); |
|
62 |
by (res_inst_tac [("s","UU"),("t","Y(i)")] ssubst 1); |
|
63 |
by (etac (chain_UU_I RS spec ) 1); |
|
64 |
by (atac 1); |
|
65 |
by (rtac (strict_IsinlIsinr RS subst) 1); |
|
66 |
by (rtac Iwhen1 1); |
|
67 |
by ((rtac arg_cong 1) THEN (rtac lub_equal 1)); |
|
68 |
by (atac 1); |
|
69 |
by (rtac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
70 |
by (etac (monofun_Isinr RS ch2ch_monofun) 1); |
|
71 |
by (rtac allI 1); |
|
72 |
by (case_tac "Y(k)=UU" 1); |
|
73 |
by (asm_simp_tac Ssum0_ss 1); |
|
74 |
by (asm_simp_tac Ssum0_ss 1); |
|
75 |
qed "contlub_Isinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
76 |
|
9169 | 77 |
Goal "cont(Isinl)"; |
78 |
by (rtac monocontlub2cont 1); |
|
79 |
by (rtac monofun_Isinl 1); |
|
80 |
by (rtac contlub_Isinl 1); |
|
81 |
qed "cont_Isinl"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
82 |
|
9169 | 83 |
Goal "cont(Isinr)"; |
84 |
by (rtac monocontlub2cont 1); |
|
85 |
by (rtac monofun_Isinr 1); |
|
86 |
by (rtac contlub_Isinr 1); |
|
87 |
qed "cont_Isinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
88 |
|
9245 | 89 |
AddIffs [cont_Isinl, cont_Isinr]; |
90 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
91 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
92 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
93 |
(* continuity for Iwhen in the firts two arguments *) |
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 |
|
9169 | 96 |
Goal "contlub(Iwhen)"; |
97 |
by (rtac contlubI 1); |
|
98 |
by (strip_tac 1); |
|
99 |
by (rtac trans 1); |
|
100 |
by (rtac (thelub_fun RS sym) 2); |
|
101 |
by (etac (monofun_Iwhen1 RS ch2ch_monofun) 2); |
|
102 |
by (rtac (expand_fun_eq RS iffD2) 1); |
|
103 |
by (strip_tac 1); |
|
104 |
by (rtac trans 1); |
|
105 |
by (rtac (thelub_fun RS sym) 2); |
|
106 |
by (rtac ch2ch_fun 2); |
|
107 |
by (etac (monofun_Iwhen1 RS ch2ch_monofun) 2); |
|
108 |
by (rtac (expand_fun_eq RS iffD2) 1); |
|
109 |
by (strip_tac 1); |
|
110 |
by (res_inst_tac [("p","xa")] IssumE 1); |
|
111 |
by (asm_simp_tac Ssum0_ss 1); |
|
112 |
by (rtac (lub_const RS thelubI RS sym) 1); |
|
113 |
by (asm_simp_tac Ssum0_ss 1); |
|
114 |
by (etac contlub_cfun_fun 1); |
|
115 |
by (asm_simp_tac Ssum0_ss 1); |
|
116 |
by (rtac (lub_const RS thelubI RS sym) 1); |
|
117 |
qed "contlub_Iwhen1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
118 |
|
9169 | 119 |
Goal "contlub(Iwhen(f))"; |
120 |
by (rtac contlubI 1); |
|
121 |
by (strip_tac 1); |
|
122 |
by (rtac trans 1); |
|
123 |
by (rtac (thelub_fun RS sym) 2); |
|
124 |
by (etac (monofun_Iwhen2 RS ch2ch_monofun) 2); |
|
125 |
by (rtac (expand_fun_eq RS iffD2) 1); |
|
126 |
by (strip_tac 1); |
|
127 |
by (res_inst_tac [("p","x")] IssumE 1); |
|
128 |
by (asm_simp_tac Ssum0_ss 1); |
|
129 |
by (rtac (lub_const RS thelubI RS sym) 1); |
|
130 |
by (asm_simp_tac Ssum0_ss 1); |
|
131 |
by (rtac (lub_const RS thelubI RS sym) 1); |
|
132 |
by (asm_simp_tac Ssum0_ss 1); |
|
133 |
by (etac contlub_cfun_fun 1); |
|
134 |
qed "contlub_Iwhen2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
135 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
136 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
137 |
(* continuity for Iwhen in its third argument *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
138 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
139 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
140 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
141 |
(* first 5 ugly lemmas *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
142 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
143 |
|
9169 | 144 |
Goal "[| chain(Y); lub(range(Y)) = Isinl(x)|] ==> !i.? x. Y(i)=Isinl(x)"; |
145 |
by (strip_tac 1); |
|
146 |
by (res_inst_tac [("p","Y(i)")] IssumE 1); |
|
147 |
by (etac exI 1); |
|
148 |
by (etac exI 1); |
|
149 |
by (res_inst_tac [("P","y=UU")] notE 1); |
|
150 |
by (atac 1); |
|
151 |
by (rtac (less_ssum3d RS iffD1) 1); |
|
152 |
by (etac subst 1); |
|
153 |
by (etac subst 1); |
|
154 |
by (etac is_ub_thelub 1); |
|
155 |
qed "ssum_lemma9"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
156 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
157 |
|
9169 | 158 |
Goal "[| chain(Y); lub(range(Y)) = Isinr(x)|] ==> !i.? x. Y(i)=Isinr(x)"; |
159 |
by (strip_tac 1); |
|
160 |
by (res_inst_tac [("p","Y(i)")] IssumE 1); |
|
161 |
by (rtac exI 1); |
|
162 |
by (etac trans 1); |
|
163 |
by (rtac strict_IsinlIsinr 1); |
|
164 |
by (etac exI 2); |
|
165 |
by (res_inst_tac [("P","xa=UU")] notE 1); |
|
166 |
by (atac 1); |
|
167 |
by (rtac (less_ssum3c RS iffD1) 1); |
|
168 |
by (etac subst 1); |
|
169 |
by (etac subst 1); |
|
170 |
by (etac is_ub_thelub 1); |
|
171 |
qed "ssum_lemma10"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
172 |
|
9169 | 173 |
Goal "[| chain(Y); lub(range(Y)) = Isinl(UU) |] ==>\ |
8161 | 174 |
\ Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"; |
175 |
by (asm_simp_tac Ssum0_ss 1); |
|
176 |
by (rtac (chain_UU_I_inverse RS sym) 1); |
|
177 |
by (rtac allI 1); |
|
178 |
by (res_inst_tac [("s","Isinl(UU)"),("t","Y(i)")] subst 1); |
|
179 |
by (rtac (inst_ssum_pcpo RS subst) 1); |
|
180 |
by (rtac (chain_UU_I RS spec RS sym) 1); |
|
181 |
by (atac 1); |
|
182 |
by (etac (inst_ssum_pcpo RS ssubst) 1); |
|
183 |
by (asm_simp_tac Ssum0_ss 1); |
|
184 |
qed "ssum_lemma11"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
185 |
|
9169 | 186 |
Goal "[| chain(Y); lub(range(Y)) = Isinl(x); x ~= UU |] ==>\ |
187 |
\ Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"; |
|
188 |
by (asm_simp_tac Ssum0_ss 1); |
|
189 |
by (res_inst_tac [("t","x")] subst 1); |
|
190 |
by (rtac inject_Isinl 1); |
|
191 |
by (rtac trans 1); |
|
192 |
by (atac 2); |
|
193 |
by (rtac (thelub_ssum1a RS sym) 1); |
|
194 |
by (atac 1); |
|
195 |
by (etac ssum_lemma9 1); |
|
196 |
by (atac 1); |
|
197 |
by (rtac trans 1); |
|
198 |
by (rtac contlub_cfun_arg 1); |
|
199 |
by (rtac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
200 |
by (atac 1); |
|
201 |
by (rtac lub_equal2 1); |
|
202 |
by (rtac (chain_mono2 RS exE) 1); |
|
203 |
by (atac 2); |
|
204 |
by (rtac chain_UU_I_inverse2 1); |
|
205 |
by (stac inst_ssum_pcpo 1); |
|
206 |
by (etac swap 1); |
|
207 |
by (rtac inject_Isinl 1); |
|
208 |
by (rtac trans 1); |
|
209 |
by (etac sym 1); |
|
210 |
by (etac notnotD 1); |
|
211 |
by (rtac exI 1); |
|
212 |
by (strip_tac 1); |
|
213 |
by (rtac (ssum_lemma9 RS spec RS exE) 1); |
|
214 |
by (atac 1); |
|
215 |
by (atac 1); |
|
216 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
217 |
by (atac 1); |
|
218 |
by (rtac trans 1); |
|
219 |
by (rtac cfun_arg_cong 1); |
|
220 |
by (rtac Iwhen2 1); |
|
221 |
by (res_inst_tac [("Pa","Y(i)=UU")] swap 1); |
|
222 |
by (fast_tac HOL_cs 1); |
|
223 |
by (stac inst_ssum_pcpo 1); |
|
224 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
225 |
by (atac 1); |
|
226 |
by (fast_tac HOL_cs 1); |
|
227 |
by (stac Iwhen2 1); |
|
228 |
by (res_inst_tac [("Pa","Y(i)=UU")] swap 1); |
|
229 |
by (fast_tac HOL_cs 1); |
|
230 |
by (stac inst_ssum_pcpo 1); |
|
231 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
232 |
by (atac 1); |
|
233 |
by (fast_tac HOL_cs 1); |
|
234 |
by (simp_tac (simpset_of Cfun3.thy) 1); |
|
235 |
by (rtac (monofun_Rep_CFun2 RS ch2ch_monofun) 1); |
|
236 |
by (etac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
237 |
by (etac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
238 |
qed "ssum_lemma12"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
239 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
240 |
|
9169 | 241 |
Goal "[| chain(Y); lub(range(Y)) = Isinr(x); x ~= UU |] ==>\ |
242 |
\ Iwhen f g (lub(range Y)) = lub(range(%i. Iwhen f g (Y i)))"; |
|
243 |
by (asm_simp_tac Ssum0_ss 1); |
|
244 |
by (res_inst_tac [("t","x")] subst 1); |
|
245 |
by (rtac inject_Isinr 1); |
|
246 |
by (rtac trans 1); |
|
247 |
by (atac 2); |
|
248 |
by (rtac (thelub_ssum1b RS sym) 1); |
|
249 |
by (atac 1); |
|
250 |
by (etac ssum_lemma10 1); |
|
251 |
by (atac 1); |
|
252 |
by (rtac trans 1); |
|
253 |
by (rtac contlub_cfun_arg 1); |
|
254 |
by (rtac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
255 |
by (atac 1); |
|
256 |
by (rtac lub_equal2 1); |
|
257 |
by (rtac (chain_mono2 RS exE) 1); |
|
258 |
by (atac 2); |
|
259 |
by (rtac chain_UU_I_inverse2 1); |
|
260 |
by (stac inst_ssum_pcpo 1); |
|
261 |
by (etac swap 1); |
|
262 |
by (rtac inject_Isinr 1); |
|
263 |
by (rtac trans 1); |
|
264 |
by (etac sym 1); |
|
265 |
by (rtac (strict_IsinlIsinr RS subst) 1); |
|
266 |
by (etac notnotD 1); |
|
267 |
by (rtac exI 1); |
|
268 |
by (strip_tac 1); |
|
269 |
by (rtac (ssum_lemma10 RS spec RS exE) 1); |
|
270 |
by (atac 1); |
|
271 |
by (atac 1); |
|
272 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
273 |
by (atac 1); |
|
274 |
by (rtac trans 1); |
|
275 |
by (rtac cfun_arg_cong 1); |
|
276 |
by (rtac Iwhen3 1); |
|
277 |
by (res_inst_tac [("Pa","Y(i)=UU")] swap 1); |
|
278 |
by (fast_tac HOL_cs 1); |
|
279 |
by (dtac notnotD 1); |
|
280 |
by (stac inst_ssum_pcpo 1); |
|
281 |
by (stac strict_IsinlIsinr 1); |
|
282 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
283 |
by (atac 1); |
|
284 |
by (fast_tac HOL_cs 1); |
|
285 |
by (stac Iwhen3 1); |
|
286 |
by (res_inst_tac [("Pa","Y(i)=UU")] swap 1); |
|
287 |
by (fast_tac HOL_cs 1); |
|
288 |
by (dtac notnotD 1); |
|
289 |
by (stac inst_ssum_pcpo 1); |
|
290 |
by (stac strict_IsinlIsinr 1); |
|
291 |
by (res_inst_tac [("t","Y(i)")] ssubst 1); |
|
292 |
by (atac 1); |
|
293 |
by (fast_tac HOL_cs 1); |
|
294 |
by (simp_tac (simpset_of Cfun3.thy) 1); |
|
295 |
by (rtac (monofun_Rep_CFun2 RS ch2ch_monofun) 1); |
|
296 |
by (etac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
297 |
by (etac (monofun_Iwhen3 RS ch2ch_monofun) 1); |
|
298 |
qed "ssum_lemma13"; |
|
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 |
|
9169 | 301 |
Goal "contlub(Iwhen(f)(g))"; |
302 |
by (rtac contlubI 1); |
|
303 |
by (strip_tac 1); |
|
304 |
by (res_inst_tac [("p","lub(range(Y))")] IssumE 1); |
|
305 |
by (etac ssum_lemma11 1); |
|
306 |
by (atac 1); |
|
307 |
by (etac ssum_lemma12 1); |
|
308 |
by (atac 1); |
|
309 |
by (atac 1); |
|
310 |
by (etac ssum_lemma13 1); |
|
311 |
by (atac 1); |
|
312 |
by (atac 1); |
|
313 |
qed "contlub_Iwhen3"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
314 |
|
9169 | 315 |
Goal "cont(Iwhen)"; |
316 |
by (rtac monocontlub2cont 1); |
|
317 |
by (rtac monofun_Iwhen1 1); |
|
318 |
by (rtac contlub_Iwhen1 1); |
|
319 |
qed "cont_Iwhen1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
320 |
|
9169 | 321 |
Goal "cont(Iwhen(f))"; |
322 |
by (rtac monocontlub2cont 1); |
|
323 |
by (rtac monofun_Iwhen2 1); |
|
324 |
by (rtac contlub_Iwhen2 1); |
|
325 |
qed "cont_Iwhen2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
326 |
|
9169 | 327 |
Goal "cont(Iwhen(f)(g))"; |
328 |
by (rtac monocontlub2cont 1); |
|
329 |
by (rtac monofun_Iwhen3 1); |
|
330 |
by (rtac contlub_Iwhen3 1); |
|
331 |
qed "cont_Iwhen3"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
332 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
333 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
334 |
(* continuous versions of lemmas for 'a ++ 'b *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
335 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
336 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
337 |
Goalw [sinl_def] "sinl`UU =UU"; |
9245 | 338 |
by (simp_tac (Ssum0_ss addsimps [cont_Isinl]) 1); |
339 |
by (rtac (inst_ssum_pcpo RS sym) 1); |
|
340 |
qed "strict_sinl"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
341 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
342 |
Goalw [sinr_def] "sinr`UU=UU"; |
9245 | 343 |
by (simp_tac (Ssum0_ss addsimps [cont_Isinr]) 1); |
344 |
by (rtac (inst_ssum_pcpo RS sym) 1); |
|
345 |
qed "strict_sinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
346 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
347 |
Goalw [sinl_def,sinr_def] |
9245 | 348 |
"sinl`a=sinr`b ==> a=UU & b=UU"; |
349 |
by (rtac noteq_IsinlIsinr 1); |
|
350 |
by (etac box_equals 1); |
|
351 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
352 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
353 |
qed "noteq_sinlsinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
354 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
355 |
Goalw [sinl_def,sinr_def] |
9245 | 356 |
"sinl`a1=sinl`a2==> a1=a2"; |
357 |
by (rtac inject_Isinl 1); |
|
358 |
by (etac box_equals 1); |
|
359 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
360 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
361 |
qed "inject_sinl"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
362 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
363 |
Goalw [sinl_def,sinr_def] |
9245 | 364 |
"sinr`a1=sinr`a2==> a1=a2"; |
365 |
by (rtac inject_Isinr 1); |
|
366 |
by (etac box_equals 1); |
|
367 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
368 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
369 |
qed "inject_sinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
370 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
371 |
|
9169 | 372 |
Goal "x~=UU ==> sinl`x ~= UU"; |
373 |
by (etac swap 1); |
|
374 |
by (rtac inject_sinl 1); |
|
375 |
by (stac strict_sinl 1); |
|
376 |
by (etac notnotD 1); |
|
377 |
qed "defined_sinl"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
378 |
|
9169 | 379 |
Goal "x~=UU ==> sinr`x ~= UU"; |
380 |
by (etac swap 1); |
|
381 |
by (rtac inject_sinr 1); |
|
382 |
by (stac strict_sinr 1); |
|
383 |
by (etac notnotD 1); |
|
384 |
qed "defined_sinr"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
385 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
386 |
Goalw [sinl_def,sinr_def] |
9245 | 387 |
"z=UU | (? a. z=sinl`a & a~=UU) | (? b. z=sinr`b & b~=UU)"; |
388 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
389 |
by (stac inst_ssum_pcpo 1); |
|
390 |
by (rtac Exh_Ssum 1); |
|
391 |
qed "Exh_Ssum1"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
392 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
393 |
|
9245 | 394 |
val [major,prem2,prem3] = Goalw [sinl_def,sinr_def] |
1461 | 395 |
"[|p=UU ==> Q ;\ |
396 |
\ !!x.[|p=sinl`x; x~=UU |] ==> Q;\ |
|
9245 | 397 |
\ !!y.[|p=sinr`y; y~=UU |] ==> Q|] ==> Q"; |
398 |
by (rtac (major RS IssumE) 1); |
|
399 |
by (stac inst_ssum_pcpo 1); |
|
400 |
by (atac 1); |
|
401 |
by (rtac prem2 1); |
|
402 |
by (atac 2); |
|
403 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
404 |
by (rtac prem3 1); |
|
405 |
by (atac 2); |
|
406 |
by (Asm_simp_tac 1); |
|
407 |
qed "ssumE"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
408 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
409 |
|
9245 | 410 |
val [preml,premr] = Goalw [sinl_def,sinr_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
411 |
"[|!!x.[|p=sinl`x|] ==> Q;\ |
9245 | 412 |
\ !!y.[|p=sinr`y|] ==> Q|] ==> Q"; |
413 |
by (rtac IssumE2 1); |
|
414 |
by (rtac preml 1); |
|
415 |
by (rtac premr 2); |
|
416 |
by Auto_tac; |
|
417 |
qed "ssumE2"; |
|
418 |
||
419 |
val tac = (REPEAT (resolve_tac (cont_lemmas1 @ [cont_Iwhen1,cont_Iwhen2, |
|
420 |
cont_Iwhen3,cont2cont_CF1L]) 1)); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
421 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
422 |
Goalw [sscase_def,sinl_def,sinr_def] |
9245 | 423 |
"sscase`f`g`UU = UU"; |
424 |
by (stac inst_ssum_pcpo 1); |
|
425 |
by (stac beta_cfun 1); |
|
426 |
by tac; |
|
427 |
by (stac beta_cfun 1); |
|
428 |
by tac; |
|
429 |
by (stac beta_cfun 1); |
|
430 |
by tac; |
|
431 |
by (simp_tac Ssum0_ss 1); |
|
432 |
qed "sscase1"; |
|
2566 | 433 |
|
434 |
||
435 |
val tac = (REPEAT (resolve_tac (cont_lemmas1 @ [cont_Iwhen1,cont_Iwhen2, |
|
436 |
cont_Iwhen3,cont_Isinl,cont_Isinr,cont2cont_CF1L]) 1)); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
437 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
438 |
Goalw [sscase_def,sinl_def,sinr_def] |
9245 | 439 |
"x~=UU==> sscase`f`g`(sinl`x) = f`x"; |
440 |
by (stac beta_cfun 1); |
|
441 |
by tac; |
|
442 |
by (stac beta_cfun 1); |
|
443 |
by tac; |
|
444 |
by (stac beta_cfun 1); |
|
445 |
by tac; |
|
446 |
by (stac beta_cfun 1); |
|
447 |
by tac; |
|
448 |
by (asm_simp_tac Ssum0_ss 1); |
|
449 |
qed "sscase2"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
450 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
451 |
Goalw [sscase_def,sinl_def,sinr_def] |
9245 | 452 |
"x~=UU==> sscase`f`g`(sinr`x) = g`x"; |
453 |
by (stac beta_cfun 1); |
|
454 |
by tac; |
|
455 |
by (stac beta_cfun 1); |
|
456 |
by tac; |
|
457 |
by (stac beta_cfun 1); |
|
458 |
by tac; |
|
459 |
by (stac beta_cfun 1); |
|
460 |
by tac; |
|
461 |
by (asm_simp_tac Ssum0_ss 1); |
|
462 |
qed "sscase3"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
463 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
464 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
465 |
Goalw [sinl_def,sinr_def] |
9245 | 466 |
"(sinl`x << sinl`y) = (x << y)"; |
467 |
by (stac beta_cfun 1); |
|
468 |
by tac; |
|
469 |
by (stac beta_cfun 1); |
|
470 |
by tac; |
|
471 |
by (rtac less_ssum3a 1); |
|
472 |
qed "less_ssum4a"; |
|
473 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
474 |
Goalw [sinl_def,sinr_def] |
9245 | 475 |
"(sinr`x << sinr`y) = (x << y)"; |
476 |
by (stac beta_cfun 1); |
|
477 |
by tac; |
|
478 |
by (stac beta_cfun 1); |
|
479 |
by tac; |
|
480 |
by (rtac less_ssum3b 1); |
|
481 |
qed "less_ssum4b"; |
|
482 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
483 |
Goalw [sinl_def,sinr_def] |
9245 | 484 |
"(sinl`x << sinr`y) = (x = UU)"; |
485 |
by (stac beta_cfun 1); |
|
486 |
by tac; |
|
487 |
by (stac beta_cfun 1); |
|
488 |
by tac; |
|
489 |
by (rtac less_ssum3c 1); |
|
490 |
qed "less_ssum4c"; |
|
491 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
492 |
Goalw [sinl_def,sinr_def] |
9245 | 493 |
"(sinr`x << sinl`y) = (x = UU)"; |
494 |
by (stac beta_cfun 1); |
|
495 |
by tac; |
|
496 |
by (stac beta_cfun 1); |
|
497 |
by tac; |
|
498 |
by (rtac less_ssum3d 1); |
|
499 |
qed "less_ssum4d"; |
|
500 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
501 |
Goalw [sinl_def,sinr_def] |
9245 | 502 |
"chain(Y) ==> (!i.? x.(Y i)=sinl`x)|(!i.? y.(Y i)=sinr`y)"; |
503 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl]) 1); |
|
504 |
by (etac ssum_lemma4 1); |
|
505 |
qed "ssum_chainE"; |
|
506 |
||
507 |
||
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
508 |
Goalw [sinl_def,sinr_def,sscase_def] |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
509 |
"[| chain(Y); !i.? x. Y(i) = sinl`x |] ==>\ |
9245 | 510 |
\ lub(range(Y)) = sinl`(lub(range(%i. sscase`(LAM x. x)`(LAM y. UU)`(Y i))))"; |
511 |
by (stac beta_cfun 1); |
|
512 |
by tac; |
|
513 |
by (stac beta_cfun 1); |
|
514 |
by tac; |
|
515 |
by (stac beta_cfun 1); |
|
516 |
by tac; |
|
517 |
by (stac (beta_cfun RS ext) 1); |
|
518 |
by tac; |
|
519 |
by (rtac thelub_ssum1a 1); |
|
520 |
by (atac 1); |
|
521 |
by (rtac allI 1); |
|
522 |
by (etac allE 1); |
|
523 |
by (etac exE 1); |
|
524 |
by (rtac exI 1); |
|
525 |
by (etac box_equals 1); |
|
526 |
by (rtac refl 1); |
|
527 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinl]) 1); |
|
528 |
qed "thelub_ssum2a"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
529 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
530 |
Goalw [sinl_def,sinr_def,sscase_def] |
4721
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents:
4098
diff
changeset
|
531 |
"[| chain(Y); !i.? x. Y(i) = sinr`x |] ==>\ |
9245 | 532 |
\ lub(range(Y)) = sinr`(lub(range(%i. sscase`(LAM y. UU)`(LAM x. x)`(Y i))))"; |
533 |
by (stac beta_cfun 1); |
|
534 |
by tac; |
|
535 |
by (stac beta_cfun 1); |
|
536 |
by tac; |
|
537 |
by (stac beta_cfun 1); |
|
538 |
by tac; |
|
539 |
by (stac (beta_cfun RS ext) 1); |
|
540 |
by tac; |
|
541 |
by (rtac thelub_ssum1b 1); |
|
542 |
by (atac 1); |
|
543 |
by (rtac allI 1); |
|
544 |
by (etac allE 1); |
|
545 |
by (etac exE 1); |
|
546 |
by (rtac exI 1); |
|
547 |
by (etac box_equals 1); |
|
548 |
by (rtac refl 1); |
|
549 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2, cont_Iwhen3]) 1); |
|
550 |
qed "thelub_ssum2b"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
551 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
552 |
Goalw [sinl_def,sinr_def] |
9245 | 553 |
"[| chain(Y); lub(range(Y)) = sinl`x|] ==> !i.? x. Y(i)=sinl`x"; |
554 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2, cont_Iwhen3]) 1); |
|
555 |
by (etac ssum_lemma9 1); |
|
556 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2, cont_Iwhen3]) 1); |
|
557 |
qed "thelub_ssum2a_rev"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
558 |
|
9248
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
559 |
Goalw [sinl_def,sinr_def] |
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents:
9245
diff
changeset
|
560 |
"[| chain(Y); lub(range(Y)) = sinr`x|] ==> !i.? x. Y(i)=sinr`x"; |
9245 | 561 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2, cont_Iwhen3]) 1); |
562 |
by (etac ssum_lemma10 1); |
|
563 |
by (asm_simp_tac (Ssum0_ss addsimps [cont_Isinr,cont_Isinl,cont_Iwhen1,cont_Iwhen2, cont_Iwhen3]) 1); |
|
564 |
qed "thelub_ssum2b_rev"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
565 |
|
9169 | 566 |
Goal "chain(Y) ==>\ |
5439 | 567 |
\ lub(range(Y)) = sinl`(lub(range(%i. sscase`(LAM x. x)`(LAM y. UU)`(Y i))))\ |
9169 | 568 |
\ | lub(range(Y)) = sinr`(lub(range(%i. sscase`(LAM y. UU)`(LAM x. x)`(Y i))))"; |
569 |
by (rtac (ssum_chainE RS disjE) 1); |
|
570 |
by (atac 1); |
|
571 |
by (rtac disjI1 1); |
|
572 |
by (etac thelub_ssum2a 1); |
|
573 |
by (atac 1); |
|
574 |
by (rtac disjI2 1); |
|
575 |
by (etac thelub_ssum2b 1); |
|
576 |
by (atac 1); |
|
577 |
qed "thelub_ssum3"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
578 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
579 |
|
9169 | 580 |
Goal "sscase`sinl`sinr`z=z"; |
581 |
by (res_inst_tac [("p","z")] ssumE 1); |
|
582 |
by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [sscase1,sscase2,sscase3]) 1); |
|
583 |
by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [sscase1,sscase2,sscase3]) 1); |
|
584 |
by (asm_simp_tac ((simpset_of Cfun3.thy) addsimps [sscase1,sscase2,sscase3]) 1); |
|
585 |
qed "sscase4"; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
586 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
587 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
588 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
589 |
(* install simplifier for Ssum *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
590 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
591 |
|
1274 | 592 |
val Ssum_rews = [strict_sinl,strict_sinr,defined_sinl,defined_sinr, |
5439 | 593 |
sscase1,sscase2,sscase3]; |
1274 | 594 |
|
595 |
Addsimps [strict_sinl,strict_sinr,defined_sinl,defined_sinr, |
|
5439 | 596 |
sscase1,sscase2,sscase3]; |