src/HOLCF/Representable.thy
changeset 35525 fa231b86cb1e
parent 35514 a2cfa413eaab
child 35527 f4282471461d
equal deleted inserted replaced
35524:a2a59e92b02e 35525:fa231b86cb1e
   414 
   414 
   415 subsubsection {* Representable type constructors *}
   415 subsubsection {* Representable type constructors *}
   416 
   416 
   417 text "Functions between representable types are representable."
   417 text "Functions between representable types are representable."
   418 
   418 
   419 instantiation "->" :: (rep, rep) rep
   419 instantiation cfun :: (rep, rep) rep
   420 begin
   420 begin
   421 
   421 
   422 definition emb_cfun_def: "emb = udom_emb oo cfun_map\<cdot>prj\<cdot>emb"
   422 definition emb_cfun_def: "emb = udom_emb oo cfun_map\<cdot>prj\<cdot>emb"
   423 definition prj_cfun_def: "prj = cfun_map\<cdot>emb\<cdot>prj oo udom_prj"
   423 definition prj_cfun_def: "prj = cfun_map\<cdot>emb\<cdot>prj oo udom_prj"
   424 
   424 
   429 
   429 
   430 end
   430 end
   431 
   431 
   432 text "Strict products of representable types are representable."
   432 text "Strict products of representable types are representable."
   433 
   433 
   434 instantiation "**" :: (rep, rep) rep
   434 instantiation sprod :: (rep, rep) rep
   435 begin
   435 begin
   436 
   436 
   437 definition emb_sprod_def: "emb = udom_emb oo sprod_map\<cdot>emb\<cdot>emb"
   437 definition emb_sprod_def: "emb = udom_emb oo sprod_map\<cdot>emb\<cdot>emb"
   438 definition prj_sprod_def: "prj = sprod_map\<cdot>prj\<cdot>prj oo udom_prj"
   438 definition prj_sprod_def: "prj = sprod_map\<cdot>prj\<cdot>prj oo udom_prj"
   439 
   439 
   444 
   444 
   445 end
   445 end
   446 
   446 
   447 text "Strict sums of representable types are representable."
   447 text "Strict sums of representable types are representable."
   448 
   448 
   449 instantiation "++" :: (rep, rep) rep
   449 instantiation ssum :: (rep, rep) rep
   450 begin
   450 begin
   451 
   451 
   452 definition emb_ssum_def: "emb = udom_emb oo ssum_map\<cdot>emb\<cdot>emb"
   452 definition emb_ssum_def: "emb = udom_emb oo ssum_map\<cdot>emb\<cdot>emb"
   453 definition prj_ssum_def: "prj = ssum_map\<cdot>prj\<cdot>prj oo udom_prj"
   453 definition prj_ssum_def: "prj = ssum_map\<cdot>prj\<cdot>prj oo udom_prj"
   454 
   454 
   782 use "Tools/Domain/domain_take_proofs.ML"
   782 use "Tools/Domain/domain_take_proofs.ML"
   783 use "Tools/Domain/domain_isomorphism.ML"
   783 use "Tools/Domain/domain_isomorphism.ML"
   784 
   784 
   785 setup {*
   785 setup {*
   786   fold Domain_Isomorphism.add_type_constructor
   786   fold Domain_Isomorphism.add_type_constructor
   787     [(@{type_name "->"}, @{term cfun_defl}, @{const_name cfun_map}, @{thm REP_cfun},
   787     [(@{type_name cfun}, @{term cfun_defl}, @{const_name cfun_map}, @{thm REP_cfun},
   788         @{thm isodefl_cfun}, @{thm cfun_map_ID}, @{thm deflation_cfun_map}),
   788         @{thm isodefl_cfun}, @{thm cfun_map_ID}, @{thm deflation_cfun_map}),
   789 
   789 
   790      (@{type_name "++"}, @{term ssum_defl}, @{const_name ssum_map}, @{thm REP_ssum},
   790      (@{type_name ssum}, @{term ssum_defl}, @{const_name ssum_map}, @{thm REP_ssum},
   791         @{thm isodefl_ssum}, @{thm ssum_map_ID}, @{thm deflation_ssum_map}),
   791         @{thm isodefl_ssum}, @{thm ssum_map_ID}, @{thm deflation_ssum_map}),
   792 
   792 
   793      (@{type_name "**"}, @{term sprod_defl}, @{const_name sprod_map}, @{thm REP_sprod},
   793      (@{type_name sprod}, @{term sprod_defl}, @{const_name sprod_map}, @{thm REP_sprod},
   794         @{thm isodefl_sprod}, @{thm sprod_map_ID}, @{thm deflation_sprod_map}),
   794         @{thm isodefl_sprod}, @{thm sprod_map_ID}, @{thm deflation_sprod_map}),
   795 
   795 
   796      (@{type_name "*"}, @{term cprod_defl}, @{const_name cprod_map}, @{thm REP_cprod},
   796      (@{type_name "*"}, @{term cprod_defl}, @{const_name cprod_map}, @{thm REP_cprod},
   797         @{thm isodefl_cprod}, @{thm cprod_map_ID}, @{thm deflation_cprod_map}),
   797         @{thm isodefl_cprod}, @{thm cprod_map_ID}, @{thm deflation_cprod_map}),
   798 
   798