2278
|
1 |
(* Title: HOLCF/Up3.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Franz Regensburger
|
|
4 |
Copyright 1993 Technische Universitaet Muenchen
|
|
5 |
|
|
6 |
Lemmas for Up3.thy
|
|
7 |
*)
|
|
8 |
|
|
9 |
open Up3;
|
|
10 |
|
|
11 |
(* -------------------------------------------------------------------------*)
|
|
12 |
(* some lemmas restated for class pcpo *)
|
|
13 |
(* ------------------------------------------------------------------------ *)
|
|
14 |
|
|
15 |
qed_goal "less_up3b" Up3.thy "~ Iup(x) << UU"
|
|
16 |
(fn prems =>
|
|
17 |
[
|
|
18 |
(stac inst_up_pcpo 1),
|
|
19 |
(rtac less_up2b 1)
|
|
20 |
]);
|
|
21 |
|
|
22 |
qed_goal "defined_Iup2" Up3.thy "Iup(x) ~= UU"
|
|
23 |
(fn prems =>
|
|
24 |
[
|
|
25 |
(stac inst_up_pcpo 1),
|
|
26 |
(rtac defined_Iup 1)
|
|
27 |
]);
|
|
28 |
|
|
29 |
(* ------------------------------------------------------------------------ *)
|
|
30 |
(* continuity for Iup *)
|
|
31 |
(* ------------------------------------------------------------------------ *)
|
|
32 |
|
|
33 |
qed_goal "contlub_Iup" Up3.thy "contlub(Iup)"
|
|
34 |
(fn prems =>
|
|
35 |
[
|
|
36 |
(rtac contlubI 1),
|
|
37 |
(strip_tac 1),
|
|
38 |
(rtac trans 1),
|
|
39 |
(rtac (thelub_up1a RS sym) 2),
|
|
40 |
(fast_tac HOL_cs 3),
|
|
41 |
(etac (monofun_Iup RS ch2ch_monofun) 2),
|
|
42 |
(res_inst_tac [("f","Iup")] arg_cong 1),
|
|
43 |
(rtac lub_equal 1),
|
|
44 |
(atac 1),
|
|
45 |
(rtac (monofun_Ifup2 RS ch2ch_monofun) 1),
|
|
46 |
(etac (monofun_Iup RS ch2ch_monofun) 1),
|
|
47 |
(asm_simp_tac Up0_ss 1)
|
|
48 |
]);
|
|
49 |
|
|
50 |
qed_goal "cont_Iup" Up3.thy "cont(Iup)"
|
|
51 |
(fn prems =>
|
|
52 |
[
|
|
53 |
(rtac monocontlub2cont 1),
|
|
54 |
(rtac monofun_Iup 1),
|
|
55 |
(rtac contlub_Iup 1)
|
|
56 |
]);
|
|
57 |
|
|
58 |
|
|
59 |
(* ------------------------------------------------------------------------ *)
|
|
60 |
(* continuity for Ifup *)
|
|
61 |
(* ------------------------------------------------------------------------ *)
|
|
62 |
|
|
63 |
qed_goal "contlub_Ifup1" Up3.thy "contlub(Ifup)"
|
|
64 |
(fn prems =>
|
|
65 |
[
|
|
66 |
(rtac contlubI 1),
|
|
67 |
(strip_tac 1),
|
|
68 |
(rtac trans 1),
|
|
69 |
(rtac (thelub_fun RS sym) 2),
|
|
70 |
(etac (monofun_Ifup1 RS ch2ch_monofun) 2),
|
|
71 |
(rtac ext 1),
|
|
72 |
(res_inst_tac [("p","x")] upE 1),
|
|
73 |
(asm_simp_tac Up0_ss 1),
|
|
74 |
(rtac (lub_const RS thelubI RS sym) 1),
|
|
75 |
(asm_simp_tac Up0_ss 1),
|
|
76 |
(etac contlub_cfun_fun 1)
|
|
77 |
]);
|
|
78 |
|
|
79 |
|
|
80 |
qed_goal "contlub_Ifup2" Up3.thy "contlub(Ifup(f))"
|
|
81 |
(fn prems =>
|
|
82 |
[
|
|
83 |
(rtac contlubI 1),
|
|
84 |
(strip_tac 1),
|
|
85 |
(rtac disjE 1),
|
|
86 |
(stac thelub_up1a 2),
|
|
87 |
(atac 2),
|
|
88 |
(atac 2),
|
|
89 |
(asm_simp_tac Up0_ss 2),
|
|
90 |
(stac thelub_up1b 3),
|
|
91 |
(atac 3),
|
|
92 |
(atac 3),
|
|
93 |
(fast_tac HOL_cs 1),
|
|
94 |
(asm_simp_tac Up0_ss 2),
|
|
95 |
(rtac (chain_UU_I_inverse RS sym) 2),
|
|
96 |
(rtac allI 2),
|
|
97 |
(res_inst_tac [("p","Y(i)")] upE 2),
|
|
98 |
(asm_simp_tac Up0_ss 2),
|
|
99 |
(rtac notE 2),
|
|
100 |
(dtac spec 2),
|
|
101 |
(etac spec 2),
|
|
102 |
(atac 2),
|
|
103 |
(stac contlub_cfun_arg 1),
|
|
104 |
(etac (monofun_Ifup2 RS ch2ch_monofun) 1),
|
|
105 |
(rtac lub_equal2 1),
|
|
106 |
(rtac (monofun_fapp2 RS ch2ch_monofun) 2),
|
|
107 |
(etac (monofun_Ifup2 RS ch2ch_monofun) 2),
|
|
108 |
(etac (monofun_Ifup2 RS ch2ch_monofun) 2),
|
|
109 |
(rtac (chain_mono2 RS exE) 1),
|
|
110 |
(atac 2),
|
|
111 |
(etac exE 1),
|
|
112 |
(etac exE 1),
|
|
113 |
(rtac exI 1),
|
|
114 |
(res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1),
|
|
115 |
(atac 1),
|
|
116 |
(rtac defined_Iup2 1),
|
|
117 |
(rtac exI 1),
|
|
118 |
(strip_tac 1),
|
|
119 |
(res_inst_tac [("p","Y(i)")] upE 1),
|
|
120 |
(asm_simp_tac Up0_ss 2),
|
|
121 |
(res_inst_tac [("P","Y(i) = UU")] notE 1),
|
|
122 |
(fast_tac HOL_cs 1),
|
|
123 |
(stac inst_up_pcpo 1),
|
|
124 |
(atac 1)
|
|
125 |
]);
|
|
126 |
|
|
127 |
qed_goal "cont_Ifup1" Up3.thy "cont(Ifup)"
|
|
128 |
(fn prems =>
|
|
129 |
[
|
|
130 |
(rtac monocontlub2cont 1),
|
|
131 |
(rtac monofun_Ifup1 1),
|
|
132 |
(rtac contlub_Ifup1 1)
|
|
133 |
]);
|
|
134 |
|
|
135 |
qed_goal "cont_Ifup2" Up3.thy "cont(Ifup(f))"
|
|
136 |
(fn prems =>
|
|
137 |
[
|
|
138 |
(rtac monocontlub2cont 1),
|
|
139 |
(rtac monofun_Ifup2 1),
|
|
140 |
(rtac contlub_Ifup2 1)
|
|
141 |
]);
|
|
142 |
|
|
143 |
|
|
144 |
(* ------------------------------------------------------------------------ *)
|
|
145 |
(* continuous versions of lemmas for ('a)u *)
|
|
146 |
(* ------------------------------------------------------------------------ *)
|
|
147 |
|
|
148 |
qed_goalw "Exh_Up1" Up3.thy [up_def] "z = UU | (? x. z = up`x)"
|
|
149 |
(fn prems =>
|
|
150 |
[
|
|
151 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1),
|
|
152 |
(stac inst_up_pcpo 1),
|
|
153 |
(rtac Exh_Up 1)
|
|
154 |
]);
|
|
155 |
|
|
156 |
qed_goalw "inject_up" Up3.thy [up_def] "up`x=up`y ==> x=y"
|
|
157 |
(fn prems =>
|
|
158 |
[
|
|
159 |
(cut_facts_tac prems 1),
|
|
160 |
(rtac inject_Iup 1),
|
|
161 |
(etac box_equals 1),
|
|
162 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1),
|
|
163 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1)
|
|
164 |
]);
|
|
165 |
|
|
166 |
qed_goalw "defined_up" Up3.thy [up_def] " up`x ~= UU"
|
|
167 |
(fn prems =>
|
|
168 |
[
|
|
169 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1),
|
|
170 |
(rtac defined_Iup2 1)
|
|
171 |
]);
|
|
172 |
|
|
173 |
qed_goalw "upE1" Up3.thy [up_def]
|
|
174 |
"[| p=UU ==> Q; !!x. p=up`x==>Q|] ==>Q"
|
|
175 |
(fn prems =>
|
|
176 |
[
|
|
177 |
(rtac upE 1),
|
|
178 |
(resolve_tac prems 1),
|
|
179 |
(etac (inst_up_pcpo RS ssubst) 1),
|
|
180 |
(resolve_tac (tl prems) 1),
|
|
181 |
(asm_simp_tac (Up0_ss addsimps [cont_Iup]) 1)
|
|
182 |
]);
|
|
183 |
|
2566
|
184 |
val tac = (simp_tac (!simpset addsimps [cont_Iup,cont_Ifup1,
|
|
185 |
cont_Ifup2,cont2cont_CF1L]) 1);
|
2278
|
186 |
|
|
187 |
qed_goalw "fup1" Up3.thy [up_def,fup_def] "fup`f`UU=UU"
|
|
188 |
(fn prems =>
|
|
189 |
[
|
|
190 |
(stac inst_up_pcpo 1),
|
|
191 |
(stac beta_cfun 1),
|
2566
|
192 |
tac,
|
2278
|
193 |
(stac beta_cfun 1),
|
2566
|
194 |
tac,
|
2278
|
195 |
(simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1)
|
|
196 |
]);
|
|
197 |
|
|
198 |
qed_goalw "fup2" Up3.thy [up_def,fup_def] "fup`f`(up`x)=f`x"
|
|
199 |
(fn prems =>
|
|
200 |
[
|
|
201 |
(stac beta_cfun 1),
|
|
202 |
(rtac cont_Iup 1),
|
|
203 |
(stac beta_cfun 1),
|
2566
|
204 |
tac,
|
2278
|
205 |
(stac beta_cfun 1),
|
|
206 |
(rtac cont_Ifup2 1),
|
|
207 |
(simp_tac (Up0_ss addsimps [cont_Iup,cont_Ifup1,cont_Ifup2]) 1)
|
|
208 |
]);
|
|
209 |
|
|
210 |
qed_goalw "less_up4b" Up3.thy [up_def,fup_def] "~ up`x << UU"
|
|
211 |
(fn prems =>
|
|
212 |
[
|
|
213 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1),
|
|
214 |
(rtac less_up3b 1)
|
|
215 |
]);
|
|
216 |
|
|
217 |
qed_goalw "less_up4c" Up3.thy [up_def,fup_def]
|
|
218 |
"(up`x << up`y) = (x<<y)"
|
|
219 |
(fn prems =>
|
|
220 |
[
|
|
221 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1),
|
|
222 |
(rtac less_up2c 1)
|
|
223 |
]);
|
|
224 |
|
|
225 |
qed_goalw "thelub_up2a" Up3.thy [up_def,fup_def]
|
|
226 |
"[| is_chain(Y); ? i x. Y(i) = up`x |] ==>\
|
|
227 |
\ lub(range(Y)) = up`(lub(range(%i. fup`(LAM x. x)`(Y i))))"
|
|
228 |
(fn prems =>
|
|
229 |
[
|
|
230 |
(cut_facts_tac prems 1),
|
|
231 |
(stac beta_cfun 1),
|
2566
|
232 |
tac,
|
2278
|
233 |
(stac beta_cfun 1),
|
2566
|
234 |
tac,
|
2278
|
235 |
(stac (beta_cfun RS ext) 1),
|
2566
|
236 |
tac,
|
2278
|
237 |
(rtac thelub_up1a 1),
|
|
238 |
(atac 1),
|
|
239 |
(etac exE 1),
|
|
240 |
(etac exE 1),
|
|
241 |
(rtac exI 1),
|
|
242 |
(rtac exI 1),
|
|
243 |
(etac box_equals 1),
|
|
244 |
(rtac refl 1),
|
|
245 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1)
|
|
246 |
]);
|
|
247 |
|
|
248 |
|
|
249 |
|
|
250 |
qed_goalw "thelub_up2b" Up3.thy [up_def,fup_def]
|
|
251 |
"[| is_chain(Y); ! i x. Y(i) ~= up`x |] ==> lub(range(Y)) = UU"
|
|
252 |
(fn prems =>
|
|
253 |
[
|
|
254 |
(cut_facts_tac prems 1),
|
|
255 |
(stac inst_up_pcpo 1),
|
|
256 |
(rtac thelub_up1b 1),
|
|
257 |
(atac 1),
|
|
258 |
(strip_tac 1),
|
|
259 |
(dtac spec 1),
|
|
260 |
(dtac spec 1),
|
|
261 |
(rtac swap 1),
|
|
262 |
(atac 1),
|
|
263 |
(dtac notnotD 1),
|
|
264 |
(etac box_equals 1),
|
|
265 |
(rtac refl 1),
|
|
266 |
(simp_tac (Up0_ss addsimps [cont_Iup]) 1)
|
|
267 |
]);
|
|
268 |
|
|
269 |
|
|
270 |
qed_goal "up_lemma2" Up3.thy " (? x.z = up`x) = (z~=UU)"
|
|
271 |
(fn prems =>
|
|
272 |
[
|
|
273 |
(rtac iffI 1),
|
|
274 |
(etac exE 1),
|
|
275 |
(hyp_subst_tac 1),
|
|
276 |
(rtac defined_up 1),
|
|
277 |
(res_inst_tac [("p","z")] upE1 1),
|
|
278 |
(etac notE 1),
|
|
279 |
(atac 1),
|
|
280 |
(etac exI 1)
|
|
281 |
]);
|
|
282 |
|
|
283 |
|
|
284 |
qed_goal "thelub_up2a_rev" Up3.thy
|
|
285 |
"[| is_chain(Y); lub(range(Y)) = up`x |] ==> ? i x. Y(i) = up`x"
|
|
286 |
(fn prems =>
|
|
287 |
[
|
|
288 |
(cut_facts_tac prems 1),
|
|
289 |
(rtac exE 1),
|
|
290 |
(rtac chain_UU_I_inverse2 1),
|
|
291 |
(rtac (up_lemma2 RS iffD1) 1),
|
|
292 |
(etac exI 1),
|
|
293 |
(rtac exI 1),
|
|
294 |
(rtac (up_lemma2 RS iffD2) 1),
|
|
295 |
(atac 1)
|
|
296 |
]);
|
|
297 |
|
|
298 |
qed_goal "thelub_up2b_rev" Up3.thy
|
|
299 |
"[| is_chain(Y); lub(range(Y)) = UU |] ==> ! i x. Y(i) ~= up`x"
|
|
300 |
(fn prems =>
|
|
301 |
[
|
|
302 |
(cut_facts_tac prems 1),
|
|
303 |
(rtac allI 1),
|
|
304 |
(rtac (not_ex RS iffD1) 1),
|
|
305 |
(rtac contrapos 1),
|
|
306 |
(etac (up_lemma2 RS iffD1) 2),
|
|
307 |
(fast_tac (HOL_cs addSDs [chain_UU_I RS spec]) 1)
|
|
308 |
]);
|
|
309 |
|
|
310 |
|
|
311 |
qed_goal "thelub_up3" Up3.thy
|
|
312 |
"is_chain(Y) ==> lub(range(Y)) = UU |\
|
|
313 |
\ lub(range(Y)) = up`(lub(range(%i. fup`(LAM x.x)`(Y i))))"
|
|
314 |
(fn prems =>
|
|
315 |
[
|
|
316 |
(cut_facts_tac prems 1),
|
|
317 |
(rtac disjE 1),
|
|
318 |
(rtac disjI1 2),
|
|
319 |
(rtac thelub_up2b 2),
|
|
320 |
(atac 2),
|
|
321 |
(atac 2),
|
|
322 |
(rtac disjI2 2),
|
|
323 |
(rtac thelub_up2a 2),
|
|
324 |
(atac 2),
|
|
325 |
(atac 2),
|
|
326 |
(fast_tac HOL_cs 1)
|
|
327 |
]);
|
|
328 |
|
|
329 |
qed_goal "fup3" Up3.thy "fup`up`x=x"
|
|
330 |
(fn prems =>
|
|
331 |
[
|
|
332 |
(res_inst_tac [("p","x")] upE1 1),
|
|
333 |
(asm_simp_tac ((simpset_of "Cfun3") addsimps [fup1,fup2]) 1),
|
|
334 |
(asm_simp_tac ((simpset_of "Cfun3") addsimps [fup1,fup2]) 1)
|
|
335 |
]);
|
|
336 |
|
|
337 |
(* ------------------------------------------------------------------------ *)
|
|
338 |
(* install simplifier for ('a)u *)
|
|
339 |
(* ------------------------------------------------------------------------ *)
|
|
340 |
|
|
341 |
val up_rews = [fup1,fup2,defined_up];
|
|
342 |
|