src/HOLCF/Fix.ML
changeset 2354 b4a1e3306aa0
parent 2275 dbce3dce821a
child 2566 cbf02fc74332
equal deleted inserted replaced
2353:7405e3cac88a 2354:b4a1e3306aa0
   228         (rtac allI 1),
   228         (rtac allI 1),
   229         (rtac (less_fun RS iffD1 RS spec) 1),
   229         (rtac (less_fun RS iffD1 RS spec) 1),
   230         (etac (monofun_iterate RS monofunE RS spec RS spec RS mp) 1)
   230         (etac (monofun_iterate RS monofunE RS spec RS spec RS mp) 1)
   231         ]);
   231         ]);
   232 
   232 
   233 
       
   234 (* ------------------------------------------------------------------------ *)
   233 (* ------------------------------------------------------------------------ *)
   235 (* since iterate is not monotone in its first argument, special lemmas must *)
   234 (* since iterate is not monotone in its first argument, special lemmas must *)
   236 (* be derived for lubs in this argument                                     *)
   235 (* be derived for lubs in this argument                                     *)
   237 (* ------------------------------------------------------------------------ *)
   236 (* ------------------------------------------------------------------------ *)
   238 
   237 
   587 
   586 
   588 
   587 
   589 bind_thm ("adm_flat", flat_imp_chain_finite RS adm_chain_finite);
   588 bind_thm ("adm_flat", flat_imp_chain_finite RS adm_chain_finite);
   590 (* flat(?x::?'a) ==> adm(?P::?'a => bool) *)
   589 (* flat(?x::?'a) ==> adm(?P::?'a => bool) *)
   591 
   590 
       
   591 (* ------------------------------------------------------------------------ *)
       
   592 (* some properties of flat			 			    *)
       
   593 (* ------------------------------------------------------------------------ *)
       
   594 
       
   595 qed_goalw "flatdom2monofun" Fix.thy [flat_def] 
       
   596   "[| flat(x::'a::pcpo); f UU = UU |] ==> monofun (f::'a=>'b::pcpo)" 
       
   597 (fn prems => 
       
   598 	[
       
   599 	cut_facts_tac prems 1,
       
   600 	fast_tac ((HOL_cs addss !simpset) addSIs [monofunI]) 1
       
   601 	]);
       
   602 
       
   603 
   592 qed_goalw "flat_void" Fix.thy [flat_def] "flat(UU::void)"
   604 qed_goalw "flat_void" Fix.thy [flat_def] "flat(UU::void)"
   593  (fn prems =>
   605  (fn prems =>
   594         [
   606         [
   595         (strip_tac 1),
   607         (strip_tac 1),
   596         (rtac disjI1 1),
   608         (rtac disjI1 1),
   599 
   611 
   600 qed_goalw "flat_eq" Fix.thy [flat_def] 
   612 qed_goalw "flat_eq" Fix.thy [flat_def] 
   601         "[| flat (x::'a); (a::'a) ~= UU |] ==> a << b = (a = b)" (fn prems=>[
   613         "[| flat (x::'a); (a::'a) ~= UU |] ==> a << b = (a = b)" (fn prems=>[
   602         (cut_facts_tac prems 1),
   614         (cut_facts_tac prems 1),
   603         (fast_tac (HOL_cs addIs [refl_less]) 1)]);
   615         (fast_tac (HOL_cs addIs [refl_less]) 1)]);
       
   616 
       
   617 
       
   618 (* ------------------------------------------------------------------------ *)
       
   619 (* some lemmata for functions with flat/chain_finite domain/range types	    *)
       
   620 (* ------------------------------------------------------------------------ *)
       
   621 
       
   622 qed_goal "chfin2finch" Fix.thy 
       
   623     "[| is_chain (Y::nat=>'a); chain_finite (x::'a) |] ==> finite_chain Y"
       
   624 (fn prems => 
       
   625 	[
       
   626 	cut_facts_tac prems 1,
       
   627 	fast_tac (HOL_cs addss 
       
   628 		 (!simpset addsimps [chain_finite_def,finite_chain_def])) 1
       
   629 	]);
       
   630 
       
   631 qed_goal "chfindom_monofun2cont" Fix.thy 
       
   632   "[| chain_finite(x::'a::pcpo); monofun f |] ==> cont (f::'a=>'b::pcpo)"
       
   633 (fn prems => 
       
   634 	[
       
   635 	cut_facts_tac prems 1,
       
   636 	rtac monocontlub2cont 1,
       
   637 	 atac 1,
       
   638 	rtac contlubI 1,
       
   639 	strip_tac 1,
       
   640 	dtac (chfin2finch COMP swap_prems_rl) 1,
       
   641 	 atac 1,
       
   642 	rtac antisym_less 1,
       
   643 	 fast_tac ((HOL_cs addIs [is_ub_thelub,ch2ch_monofun]) 
       
   644 	     addss (HOL_ss addsimps [finite_chain_def,maxinch_is_thelub])) 1,
       
   645 	dtac (monofun_finch2finch COMP swap_prems_rl) 1,
       
   646 	 atac 1,
       
   647 	fast_tac ((HOL_cs 
       
   648 	    addIs [is_ub_thelub,(monofunE RS spec RS spec RS mp)]) 
       
   649 	    addss (HOL_ss addsimps [finite_chain_def,maxinch_is_thelub])) 1
       
   650 	]);
       
   651 
       
   652 bind_thm("flatdom_monofun2cont",flat_imp_chain_finite RS chfindom_monofun2cont);
       
   653 (* [| flat ?x; monofun ?f |] ==> cont ?f *)
       
   654 
       
   655 qed_goal "flatdom_strict2cont" Fix.thy 
       
   656   "[| flat(x::'a::pcpo); f UU = UU |] ==> cont (f::'a=>'b::pcpo)" 
       
   657 (fn prems =>
       
   658 	[
       
   659 	cut_facts_tac prems 1,
       
   660 	fast_tac ((HOL_cs addSIs [flatdom2monofun,
       
   661 			flat_imp_chain_finite RS chfindom_monofun2cont])) 1
       
   662 	]);
       
   663 
       
   664 qed_goal "chfin_fappR" Fix.thy 
       
   665     "[| is_chain (Y::nat => 'a->'b); chain_finite(x::'b) |] ==> \
       
   666 \    !s. ? n. lub(range(Y))`s = Y n`s" 
       
   667 (fn prems => 
       
   668 	[
       
   669 	cut_facts_tac prems 1,
       
   670 	rtac allI 1,
       
   671 	rtac (contlub_cfun_fun RS ssubst) 1,
       
   672 	 atac 1,
       
   673 	fast_tac (HOL_cs addSIs [thelubI,lub_finch2,chfin2finch,ch2ch_fappL])1
       
   674 	]);
       
   675 
       
   676 qed_goalw "adm_chfindom" Fix.thy [adm_def]
       
   677 	    "chain_finite (x::'b) ==> adm (%(u::'a->'b). P(u`s))" (fn prems => [
       
   678 	cut_facts_tac prems 1,
       
   679 	strip_tac 1,
       
   680 	dtac chfin_fappR 1,
       
   681 	 atac 1,
       
   682 	eres_inst_tac [("x","s")] allE 1,
       
   683 	fast_tac (HOL_cs addss !simpset) 1]);
       
   684 
       
   685 bind_thm("adm_flatdom",flat_imp_chain_finite RS adm_chfindom);
       
   686 (* flat ?x ==> adm (%u. ?P (u`?s)) *)
       
   687 
   604 
   688 
   605 (* ------------------------------------------------------------------------ *)
   689 (* ------------------------------------------------------------------------ *)
   606 (* lemmata for improved admissibility introdution rule                      *)
   690 (* lemmata for improved admissibility introdution rule                      *)
   607 (* ------------------------------------------------------------------------ *)
   691 (* ------------------------------------------------------------------------ *)
   608 
   692