1 (* Title: HOLCF/sprod3.thy |
1 (* Title: HOLCF/Sprod3.thy |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Franz Regensburger |
3 Author: Franz Regensburger |
4 Copyright 1993 Technische Universitaet Muenchen |
4 Copyright 1993 Technische Universitaet Muenchen |
5 |
5 |
6 Lemmas for Sprod3.thy |
6 Lemmas for Sprod.thy |
7 *) |
7 *) |
8 |
8 |
9 open Sprod3; |
9 open Sprod3; |
10 |
10 |
|
11 (* for compatibility with old HOLCF-Version *) |
|
12 qed_goal "inst_sprod_pcpo" thy "UU = Ispair UU UU" |
|
13 (fn prems => |
|
14 [ |
|
15 (simp_tac (HOL_ss addsimps [UU_def,UU_sprod_def]) 1) |
|
16 ]); |
11 (* ------------------------------------------------------------------------ *) |
17 (* ------------------------------------------------------------------------ *) |
12 (* continuity of Ispair, Isfst, Issnd *) |
18 (* continuity of Ispair, Isfst, Issnd *) |
13 (* ------------------------------------------------------------------------ *) |
19 (* ------------------------------------------------------------------------ *) |
14 |
20 |
15 qed_goal "sprod3_lemma1" Sprod3.thy |
21 qed_goal "sprod3_lemma1" thy |
16 "[| is_chain(Y); x~= UU; lub(range(Y))~= UU |] ==>\ |
22 "[| is_chain(Y); x~= UU; lub(range(Y))~= UU |] ==>\ |
17 \ Ispair (lub(range Y)) x =\ |
23 \ Ispair (lub(range Y)) x =\ |
18 \ Ispair (lub(range(%i. Isfst(Ispair(Y i) x)))) \ |
24 \ Ispair (lub(range(%i. Isfst(Ispair(Y i) x)))) \ |
19 \ (lub(range(%i. Issnd(Ispair(Y i) x))))" |
25 \ (lub(range(%i. Issnd(Ispair(Y i) x))))" |
20 (fn prems => |
26 (fn prems => |
213 (etac sprod3_lemma6 1), |
219 (etac sprod3_lemma6 1), |
214 (atac 1) |
220 (atac 1) |
215 ]); |
221 ]); |
216 |
222 |
217 |
223 |
218 qed_goal "cont_Ispair1" Sprod3.thy "cont(Ispair)" |
224 qed_goal "cont_Ispair1" thy "cont(Ispair)" |
219 (fn prems => |
225 (fn prems => |
220 [ |
226 [ |
221 (rtac monocontlub2cont 1), |
227 (rtac monocontlub2cont 1), |
222 (rtac monofun_Ispair1 1), |
228 (rtac monofun_Ispair1 1), |
223 (rtac contlub_Ispair1 1) |
229 (rtac contlub_Ispair1 1) |
224 ]); |
230 ]); |
225 |
231 |
226 |
232 |
227 qed_goal "cont_Ispair2" Sprod3.thy "cont(Ispair(x))" |
233 qed_goal "cont_Ispair2" thy "cont(Ispair(x))" |
228 (fn prems => |
234 (fn prems => |
229 [ |
235 [ |
230 (rtac monocontlub2cont 1), |
236 (rtac monocontlub2cont 1), |
231 (rtac monofun_Ispair2 1), |
237 (rtac monofun_Ispair2 1), |
232 (rtac contlub_Ispair2 1) |
238 (rtac contlub_Ispair2 1) |
233 ]); |
239 ]); |
234 |
240 |
235 qed_goal "contlub_Isfst" Sprod3.thy "contlub(Isfst)" |
241 qed_goal "contlub_Isfst" thy "contlub(Isfst)" |
236 (fn prems => |
242 (fn prems => |
237 [ |
243 [ |
238 (rtac contlubI 1), |
244 (rtac contlubI 1), |
239 (strip_tac 1), |
245 (strip_tac 1), |
240 (stac (lub_sprod RS thelubI) 1), |
246 (stac (lub_sprod RS thelubI) 1), |
279 (etac (defined_IsfstIssnd RS conjunct1) 2), |
285 (etac (defined_IsfstIssnd RS conjunct1) 2), |
280 (fast_tac (HOL_cs addSDs [monofun_Isfst RS ch2ch_monofun RS |
286 (fast_tac (HOL_cs addSDs [monofun_Isfst RS ch2ch_monofun RS |
281 chain_UU_I RS spec]) 1) |
287 chain_UU_I RS spec]) 1) |
282 ]); |
288 ]); |
283 |
289 |
284 qed_goal "cont_Isfst" Sprod3.thy "cont(Isfst)" |
290 qed_goal "cont_Isfst" thy "cont(Isfst)" |
285 (fn prems => |
291 (fn prems => |
286 [ |
292 [ |
287 (rtac monocontlub2cont 1), |
293 (rtac monocontlub2cont 1), |
288 (rtac monofun_Isfst 1), |
294 (rtac monofun_Isfst 1), |
289 (rtac contlub_Isfst 1) |
295 (rtac contlub_Isfst 1) |
290 ]); |
296 ]); |
291 |
297 |
292 qed_goal "cont_Issnd" Sprod3.thy "cont(Issnd)" |
298 qed_goal "cont_Issnd" thy "cont(Issnd)" |
293 (fn prems => |
299 (fn prems => |
294 [ |
300 [ |
295 (rtac monocontlub2cont 1), |
301 (rtac monocontlub2cont 1), |
296 (rtac monofun_Issnd 1), |
302 (rtac monofun_Issnd 1), |
297 (rtac contlub_Issnd 1) |
303 (rtac contlub_Issnd 1) |
298 ]); |
304 ]); |
299 |
305 |
300 (* |
306 qed_goal "spair_eq" thy "[|x1=x2;y1=y2|] ==> (|x1,y1|) = (|x2,y2|)" |
301 -------------------------------------------------------------------------- |
|
302 more lemmas for Sprod3.thy |
|
303 |
|
304 -------------------------------------------------------------------------- |
|
305 *) |
|
306 |
|
307 qed_goal "spair_eq" Sprod3.thy "[|x1=x2;y1=y2|] ==> (|x1,y1|) = (|x2,y2|)" |
|
308 (fn prems => |
307 (fn prems => |
309 [ |
308 [ |
310 (cut_facts_tac prems 1), |
309 (cut_facts_tac prems 1), |
311 (fast_tac HOL_cs 1) |
310 (fast_tac HOL_cs 1) |
312 ]); |
311 ]); |
313 |
312 |
314 (* ------------------------------------------------------------------------ *) |
313 (* ------------------------------------------------------------------------ *) |
315 (* convert all lemmas to the continuous versions *) |
314 (* convert all lemmas to the continuous versions *) |
316 (* ------------------------------------------------------------------------ *) |
315 (* ------------------------------------------------------------------------ *) |
317 |
316 |
318 qed_goalw "beta_cfun_sprod" Sprod3.thy [spair_def] |
317 qed_goalw "beta_cfun_sprod" thy [spair_def] |
319 "(LAM x y.Ispair x y)`a`b = Ispair a b" |
318 "(LAM x y.Ispair x y)`a`b = Ispair a b" |
320 (fn prems => |
319 (fn prems => |
321 [ |
320 [ |
322 (stac beta_cfun 1), |
321 (stac beta_cfun 1), |
323 (simp_tac (!simpset addsimps [cont_Ispair2, cont_Ispair1, |
322 (simp_tac (!simpset addsimps [cont_Ispair2, cont_Ispair1, |
337 (etac box_equals 1), |
336 (etac box_equals 1), |
338 (rtac beta_cfun_sprod 1), |
337 (rtac beta_cfun_sprod 1), |
339 (rtac beta_cfun_sprod 1) |
338 (rtac beta_cfun_sprod 1) |
340 ]); |
339 ]); |
341 |
340 |
342 qed_goalw "inst_sprod_pcpo2" Sprod3.thy [spair_def] "UU = (|UU,UU|)" |
341 qed_goalw "inst_sprod_pcpo2" thy [spair_def] "UU = (|UU,UU|)" |
343 (fn prems => |
342 (fn prems => |
344 [ |
343 [ |
345 (rtac sym 1), |
344 (rtac sym 1), |
346 (rtac trans 1), |
345 (rtac trans 1), |
347 (rtac beta_cfun_sprod 1), |
346 (rtac beta_cfun_sprod 1), |
348 (rtac sym 1), |
347 (rtac sym 1), |
349 (rtac inst_sprod_pcpo 1) |
348 (rtac inst_sprod_pcpo 1) |
350 ]); |
349 ]); |
351 |
350 |
352 qed_goalw "strict_spair" Sprod3.thy [spair_def] |
351 qed_goalw "strict_spair" thy [spair_def] |
353 "(a=UU | b=UU) ==> (|a,b|)=UU" |
352 "(a=UU | b=UU) ==> (|a,b|)=UU" |
354 (fn prems => |
353 (fn prems => |
355 [ |
354 [ |
356 (cut_facts_tac prems 1), |
355 (cut_facts_tac prems 1), |
357 (rtac trans 1), |
356 (rtac trans 1), |
359 (rtac trans 1), |
358 (rtac trans 1), |
360 (rtac (inst_sprod_pcpo RS sym) 2), |
359 (rtac (inst_sprod_pcpo RS sym) 2), |
361 (etac strict_Ispair 1) |
360 (etac strict_Ispair 1) |
362 ]); |
361 ]); |
363 |
362 |
364 qed_goalw "strict_spair1" Sprod3.thy [spair_def] "(|UU,b|) = UU" |
363 qed_goalw "strict_spair1" thy [spair_def] "(|UU,b|) = UU" |
365 (fn prems => |
364 (fn prems => |
366 [ |
365 [ |
367 (stac beta_cfun_sprod 1), |
366 (stac beta_cfun_sprod 1), |
368 (rtac trans 1), |
367 (rtac trans 1), |
369 (rtac (inst_sprod_pcpo RS sym) 2), |
368 (rtac (inst_sprod_pcpo RS sym) 2), |
370 (rtac strict_Ispair1 1) |
369 (rtac strict_Ispair1 1) |
371 ]); |
370 ]); |
372 |
371 |
373 qed_goalw "strict_spair2" Sprod3.thy [spair_def] "(|a,UU|) = UU" |
372 qed_goalw "strict_spair2" thy [spair_def] "(|a,UU|) = UU" |
374 (fn prems => |
373 (fn prems => |
375 [ |
374 [ |
376 (stac beta_cfun_sprod 1), |
375 (stac beta_cfun_sprod 1), |
377 (rtac trans 1), |
376 (rtac trans 1), |
378 (rtac (inst_sprod_pcpo RS sym) 2), |
377 (rtac (inst_sprod_pcpo RS sym) 2), |
379 (rtac strict_Ispair2 1) |
378 (rtac strict_Ispair2 1) |
380 ]); |
379 ]); |
381 |
380 |
382 qed_goalw "strict_spair_rev" Sprod3.thy [spair_def] |
381 qed_goalw "strict_spair_rev" thy [spair_def] |
383 "(|x,y|)~=UU ==> ~x=UU & ~y=UU" |
382 "(|x,y|)~=UU ==> ~x=UU & ~y=UU" |
384 (fn prems => |
383 (fn prems => |
385 [ |
384 [ |
386 (cut_facts_tac prems 1), |
385 (cut_facts_tac prems 1), |
387 (rtac strict_Ispair_rev 1), |
386 (rtac strict_Ispair_rev 1), |
388 (rtac (beta_cfun_sprod RS subst) 1), |
387 (rtac (beta_cfun_sprod RS subst) 1), |
389 (rtac (inst_sprod_pcpo RS subst) 1), |
388 (rtac (inst_sprod_pcpo RS subst) 1), |
390 (atac 1) |
389 (atac 1) |
391 ]); |
390 ]); |
392 |
391 |
393 qed_goalw "defined_spair_rev" Sprod3.thy [spair_def] |
392 qed_goalw "defined_spair_rev" thy [spair_def] |
394 "(|a,b|) = UU ==> (a = UU | b = UU)" |
393 "(|a,b|) = UU ==> (a = UU | b = UU)" |
395 (fn prems => |
394 (fn prems => |
396 [ |
395 [ |
397 (cut_facts_tac prems 1), |
396 (cut_facts_tac prems 1), |
398 (rtac defined_Ispair_rev 1), |
397 (rtac defined_Ispair_rev 1), |
399 (rtac (beta_cfun_sprod RS subst) 1), |
398 (rtac (beta_cfun_sprod RS subst) 1), |
400 (rtac (inst_sprod_pcpo RS subst) 1), |
399 (rtac (inst_sprod_pcpo RS subst) 1), |
401 (atac 1) |
400 (atac 1) |
402 ]); |
401 ]); |
403 |
402 |
404 qed_goalw "defined_spair" Sprod3.thy [spair_def] |
403 qed_goalw "defined_spair" thy [spair_def] |
405 "[|a~=UU; b~=UU|] ==> (|a,b|) ~= UU" |
404 "[|a~=UU; b~=UU|] ==> (|a,b|) ~= UU" |
406 (fn prems => |
405 (fn prems => |
407 [ |
406 [ |
408 (cut_facts_tac prems 1), |
407 (cut_facts_tac prems 1), |
409 (stac beta_cfun_sprod 1), |
408 (stac beta_cfun_sprod 1), |
410 (stac inst_sprod_pcpo 1), |
409 (stac inst_sprod_pcpo 1), |
411 (etac defined_Ispair 1), |
410 (etac defined_Ispair 1), |
412 (atac 1) |
411 (atac 1) |
413 ]); |
412 ]); |
414 |
413 |
415 qed_goalw "Exh_Sprod2" Sprod3.thy [spair_def] |
414 qed_goalw "Exh_Sprod2" thy [spair_def] |
416 "z=UU | (? a b. z=(|a,b|) & a~=UU & b~=UU)" |
415 "z=UU | (? a b. z=(|a,b|) & a~=UU & b~=UU)" |
417 (fn prems => |
416 (fn prems => |
418 [ |
417 [ |
419 (rtac (Exh_Sprod RS disjE) 1), |
418 (rtac (Exh_Sprod RS disjE) 1), |
420 (rtac disjI1 1), |
419 (rtac disjI1 1), |
458 (rtac strict_Isfst 1), |
457 (rtac strict_Isfst 1), |
459 (rtac (inst_sprod_pcpo RS subst) 1), |
458 (rtac (inst_sprod_pcpo RS subst) 1), |
460 (atac 1) |
459 (atac 1) |
461 ]); |
460 ]); |
462 |
461 |
463 qed_goalw "strict_sfst1" Sprod3.thy [sfst_def,spair_def] |
462 qed_goalw "strict_sfst1" thy [sfst_def,spair_def] |
464 "sfst`(|UU,y|) = UU" |
463 "sfst`(|UU,y|) = UU" |
465 (fn prems => |
464 (fn prems => |
466 [ |
465 [ |
467 (stac beta_cfun_sprod 1), |
466 (stac beta_cfun_sprod 1), |
468 (stac beta_cfun 1), |
467 (stac beta_cfun 1), |
469 (rtac cont_Isfst 1), |
468 (rtac cont_Isfst 1), |
470 (rtac strict_Isfst1 1) |
469 (rtac strict_Isfst1 1) |
471 ]); |
470 ]); |
472 |
471 |
473 qed_goalw "strict_sfst2" Sprod3.thy [sfst_def,spair_def] |
472 qed_goalw "strict_sfst2" thy [sfst_def,spair_def] |
474 "sfst`(|x,UU|) = UU" |
473 "sfst`(|x,UU|) = UU" |
475 (fn prems => |
474 (fn prems => |
476 [ |
475 [ |
477 (stac beta_cfun_sprod 1), |
476 (stac beta_cfun_sprod 1), |
478 (stac beta_cfun 1), |
477 (stac beta_cfun 1), |
479 (rtac cont_Isfst 1), |
478 (rtac cont_Isfst 1), |
480 (rtac strict_Isfst2 1) |
479 (rtac strict_Isfst2 1) |
481 ]); |
480 ]); |
482 |
481 |
483 qed_goalw "strict_ssnd" Sprod3.thy [ssnd_def] |
482 qed_goalw "strict_ssnd" thy [ssnd_def] |
484 "p=UU==>ssnd`p=UU" |
483 "p=UU==>ssnd`p=UU" |
485 (fn prems => |
484 (fn prems => |
486 [ |
485 [ |
487 (cut_facts_tac prems 1), |
486 (cut_facts_tac prems 1), |
488 (stac beta_cfun 1), |
487 (stac beta_cfun 1), |
490 (rtac strict_Issnd 1), |
489 (rtac strict_Issnd 1), |
491 (rtac (inst_sprod_pcpo RS subst) 1), |
490 (rtac (inst_sprod_pcpo RS subst) 1), |
492 (atac 1) |
491 (atac 1) |
493 ]); |
492 ]); |
494 |
493 |
495 qed_goalw "strict_ssnd1" Sprod3.thy [ssnd_def,spair_def] |
494 qed_goalw "strict_ssnd1" thy [ssnd_def,spair_def] |
496 "ssnd`(|UU,y|) = UU" |
495 "ssnd`(|UU,y|) = UU" |
497 (fn prems => |
496 (fn prems => |
498 [ |
497 [ |
499 (stac beta_cfun_sprod 1), |
498 (stac beta_cfun_sprod 1), |
500 (stac beta_cfun 1), |
499 (stac beta_cfun 1), |
501 (rtac cont_Issnd 1), |
500 (rtac cont_Issnd 1), |
502 (rtac strict_Issnd1 1) |
501 (rtac strict_Issnd1 1) |
503 ]); |
502 ]); |
504 |
503 |
505 qed_goalw "strict_ssnd2" Sprod3.thy [ssnd_def,spair_def] |
504 qed_goalw "strict_ssnd2" thy [ssnd_def,spair_def] |
506 "ssnd`(|x,UU|) = UU" |
505 "ssnd`(|x,UU|) = UU" |
507 (fn prems => |
506 (fn prems => |
508 [ |
507 [ |
509 (stac beta_cfun_sprod 1), |
508 (stac beta_cfun_sprod 1), |
510 (stac beta_cfun 1), |
509 (stac beta_cfun 1), |
511 (rtac cont_Issnd 1), |
510 (rtac cont_Issnd 1), |
512 (rtac strict_Issnd2 1) |
511 (rtac strict_Issnd2 1) |
513 ]); |
512 ]); |
514 |
513 |
515 qed_goalw "sfst2" Sprod3.thy [sfst_def,spair_def] |
514 qed_goalw "sfst2" thy [sfst_def,spair_def] |
516 "y~=UU ==>sfst`(|x,y|)=x" |
515 "y~=UU ==>sfst`(|x,y|)=x" |
517 (fn prems => |
516 (fn prems => |
518 [ |
517 [ |
519 (cut_facts_tac prems 1), |
518 (cut_facts_tac prems 1), |
520 (stac beta_cfun_sprod 1), |
519 (stac beta_cfun_sprod 1), |
521 (stac beta_cfun 1), |
520 (stac beta_cfun 1), |
522 (rtac cont_Isfst 1), |
521 (rtac cont_Isfst 1), |
523 (etac Isfst2 1) |
522 (etac Isfst2 1) |
524 ]); |
523 ]); |
525 |
524 |
526 qed_goalw "ssnd2" Sprod3.thy [ssnd_def,spair_def] |
525 qed_goalw "ssnd2" thy [ssnd_def,spair_def] |
527 "x~=UU ==>ssnd`(|x,y|)=y" |
526 "x~=UU ==>ssnd`(|x,y|)=y" |
528 (fn prems => |
527 (fn prems => |
529 [ |
528 [ |
530 (cut_facts_tac prems 1), |
529 (cut_facts_tac prems 1), |
531 (stac beta_cfun_sprod 1), |
530 (stac beta_cfun_sprod 1), |
561 (rtac cont_Isfst 1), |
560 (rtac cont_Isfst 1), |
562 (rtac (surjective_pairing_Sprod RS sym) 1) |
561 (rtac (surjective_pairing_Sprod RS sym) 1) |
563 ]); |
562 ]); |
564 |
563 |
565 |
564 |
566 qed_goalw "less_sprod5b" Sprod3.thy [sfst_def,ssnd_def,spair_def] |
565 qed_goalw "lub_sprod2" thy [sfst_def,ssnd_def,spair_def] |
567 "p1~=UU ==> (p1<<p2) = (sfst`p1<<sfst`p2 & ssnd`p1<<ssnd`p2)" |
|
568 (fn prems => |
|
569 [ |
|
570 (cut_facts_tac prems 1), |
|
571 (stac beta_cfun 1), |
|
572 (rtac cont_Issnd 1), |
|
573 (stac beta_cfun 1), |
|
574 (rtac cont_Issnd 1), |
|
575 (stac beta_cfun 1), |
|
576 (rtac cont_Isfst 1), |
|
577 (stac beta_cfun 1), |
|
578 (rtac cont_Isfst 1), |
|
579 (rtac less_sprod3b 1), |
|
580 (rtac (inst_sprod_pcpo RS subst) 1), |
|
581 (atac 1) |
|
582 ]); |
|
583 |
|
584 |
|
585 qed_goalw "less_sprod5c" Sprod3.thy [sfst_def,ssnd_def,spair_def] |
|
586 "[|(|xa,ya|) << (|x,y|);xa~=UU;ya~=UU;x~=UU;y~=UU|] ==>xa<<x & ya << y" |
|
587 (fn prems => |
|
588 [ |
|
589 (cut_facts_tac prems 1), |
|
590 (rtac less_sprod4c 1), |
|
591 (REPEAT (atac 2)), |
|
592 (rtac (beta_cfun_sprod RS subst) 1), |
|
593 (rtac (beta_cfun_sprod RS subst) 1), |
|
594 (atac 1) |
|
595 ]); |
|
596 |
|
597 qed_goalw "lub_sprod2" Sprod3.thy [sfst_def,ssnd_def,spair_def] |
|
598 "[|is_chain(S)|] ==> range(S) <<| \ |
566 "[|is_chain(S)|] ==> range(S) <<| \ |
599 \ (| lub(range(%i.sfst`(S i))), lub(range(%i.ssnd`(S i))) |)" |
567 \ (| lub(range(%i.sfst`(S i))), lub(range(%i.ssnd`(S i))) |)" |
600 (fn prems => |
568 (fn prems => |
601 [ |
569 [ |
602 (cut_facts_tac prems 1), |
570 (cut_facts_tac prems 1), |
662 (stac beta_cfun 1), |
630 (stac beta_cfun 1), |
663 (Simp_tac 1), |
631 (Simp_tac 1), |
664 (rtac surjective_pairing_Sprod2 1) |
632 (rtac surjective_pairing_Sprod2 1) |
665 ]); |
633 ]); |
666 |
634 |
667 |
|
668 (* ------------------------------------------------------------------------ *) |
635 (* ------------------------------------------------------------------------ *) |
669 (* install simplifier for Sprod *) |
636 (* install simplifier for Sprod *) |
670 (* ------------------------------------------------------------------------ *) |
637 (* ------------------------------------------------------------------------ *) |
671 |
638 |
672 val Sprod_rews = [strict_spair1,strict_spair2,strict_sfst1,strict_sfst2, |
639 val Sprod_rews = [strict_spair1,strict_spair2,strict_sfst1,strict_sfst2, |
673 strict_ssnd1,strict_ssnd2,sfst2,ssnd2,defined_spair, |
640 strict_ssnd1,strict_ssnd2,sfst2,ssnd2,defined_spair, |
674 ssplit1,ssplit2]; |
641 ssplit1,ssplit2]; |
675 |
642 Addsimps Sprod_rews; |
676 Addsimps [strict_spair1,strict_spair2,strict_sfst1,strict_sfst2, |
643 |
677 strict_ssnd1,strict_ssnd2,sfst2,ssnd2,defined_spair, |
|
678 ssplit1,ssplit2]; |
|