src/HOLCF/Domain.thy
changeset 31230 50deb3badfba
parent 31076 99fe356cbbc2
child 32126 a5042f260440
equal deleted inserted replaced
31229:8a890890d143 31230:50deb3badfba
   200   by rule auto
   200   by rule auto
   201 
   201 
   202 lemmas exh_casedists = exh_casedist1 exh_casedist2 exh_casedist3
   202 lemmas exh_casedists = exh_casedist1 exh_casedist2 exh_casedist3
   203 
   203 
   204 
   204 
       
   205 subsection {* Combinators for building copy functions *}
       
   206 
       
   207 definition
       
   208   cfun_fun :: "('b \<rightarrow> 'a) \<rightarrow> ('c \<rightarrow> 'd) \<rightarrow> ('a \<rightarrow> 'c) \<rightarrow> ('b \<rightarrow> 'd)"
       
   209 where
       
   210   "cfun_fun = (\<Lambda> f g p. g oo p oo f)"
       
   211 
       
   212 definition
       
   213   ssum_fun :: "('a \<rightarrow> 'b) \<rightarrow> ('c \<rightarrow> 'd) \<rightarrow> 'a \<oplus> 'c \<rightarrow> 'b \<oplus> 'd"
       
   214 where
       
   215   "ssum_fun = (\<Lambda> f g. sscase\<cdot>(sinl oo f)\<cdot>(sinr oo g))"
       
   216 
       
   217 definition
       
   218   sprod_fun :: "('a \<rightarrow> 'b) \<rightarrow> ('c \<rightarrow> 'd) \<rightarrow> 'a \<otimes> 'c \<rightarrow> 'b \<otimes> 'd"
       
   219 where
       
   220   "sprod_fun = (\<Lambda> f g. ssplit\<cdot>(\<Lambda> x y. (:f\<cdot>x, g\<cdot>y:)))"
       
   221 
       
   222 definition
       
   223   cprod_fun :: "('a \<rightarrow> 'b) \<rightarrow> ('c \<rightarrow> 'd) \<rightarrow> 'a \<times> 'c \<rightarrow> 'b \<times> 'd"
       
   224 where
       
   225   "cprod_fun = (\<Lambda> f g. csplit\<cdot>(\<Lambda> x y. <f\<cdot>x, g\<cdot>y>))"
       
   226 
       
   227 definition
       
   228   u_fun :: "('a \<rightarrow> 'b) \<rightarrow> 'a u \<rightarrow> 'b u"
       
   229 where
       
   230   "u_fun = (\<Lambda> f. fup\<cdot>(up oo f))"
       
   231 
       
   232 lemma cfun_fun_strict: "b\<cdot>\<bottom> = \<bottom> \<Longrightarrow> cfun_fun\<cdot>a\<cdot>b\<cdot>\<bottom> = \<bottom>"
       
   233 unfolding cfun_fun_def expand_cfun_eq by simp
       
   234 
       
   235 lemma ssum_fun_strict: "ssum_fun\<cdot>a\<cdot>b\<cdot>\<bottom> = \<bottom>"
       
   236 unfolding ssum_fun_def by simp
       
   237 
       
   238 lemma sprod_fun_strict: "sprod_fun\<cdot>a\<cdot>b\<cdot>\<bottom> = \<bottom>"
       
   239 unfolding sprod_fun_def by simp
       
   240 
       
   241 lemma u_fun_strict: "u_fun\<cdot>a\<cdot>\<bottom> = \<bottom>"
       
   242 unfolding u_fun_def by simp
       
   243 
       
   244 lemma ssum_fun_sinl: "x \<noteq> \<bottom> \<Longrightarrow> ssum_fun\<cdot>f\<cdot>g\<cdot>(sinl\<cdot>x) = sinl\<cdot>(f\<cdot>x)"
       
   245 by (simp add: ssum_fun_def)
       
   246 
       
   247 lemma ssum_fun_sinr: "x \<noteq> \<bottom> \<Longrightarrow> ssum_fun\<cdot>f\<cdot>g\<cdot>(sinr\<cdot>x) = sinr\<cdot>(g\<cdot>x)"
       
   248 by (simp add: ssum_fun_def)
       
   249 
       
   250 lemma sprod_fun_spair:
       
   251   "x \<noteq> \<bottom> \<Longrightarrow> y \<noteq> \<bottom> \<Longrightarrow> sprod_fun\<cdot>f\<cdot>g\<cdot>(:x, y:) = (:f\<cdot>x, g\<cdot>y:)"
       
   252 by (simp add: sprod_fun_def)
       
   253 
       
   254 lemma u_fun_up: "u_fun\<cdot>a\<cdot>(up\<cdot>x) = up\<cdot>(a\<cdot>x)"
       
   255 by (simp add: u_fun_def)
       
   256 
       
   257 lemmas domain_fun_stricts =
       
   258   ssum_fun_strict sprod_fun_strict u_fun_strict
       
   259 
       
   260 lemmas domain_fun_simps =
       
   261   ssum_fun_sinl ssum_fun_sinr sprod_fun_spair u_fun_up
       
   262 
       
   263 
   205 subsection {* Installing the domain package *}
   264 subsection {* Installing the domain package *}
   206 
   265 
   207 lemmas con_strict_rules =
   266 lemmas con_strict_rules =
   208   sinl_strict sinr_strict spair_strict1 spair_strict2
   267   sinl_strict sinr_strict spair_strict1 spair_strict2
   209 
   268