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