| author | nipkow | 
| Tue, 29 Oct 2024 10:26:06 +0100 | |
| changeset 81285 | 34f3ec8d4d24 | 
| parent 80914 | d97fdabd9e2b | 
| child 81577 | a712bf5ccab0 | 
| permissions | -rw-r--r-- | 
| 42151 | 1 | (* Title: HOL/HOLCF/Representable.thy | 
| 25903 | 2 | Author: Brian Huffman | 
| 3 | *) | |
| 4 | ||
| 62175 | 5 | section \<open>Representable domains\<close> | 
| 25903 | 6 | |
| 41285 | 7 | theory Representable | 
| 66453 
cc19f7ca2ed6
session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
 wenzelm parents: 
63040diff
changeset | 8 | imports Algebraic Map_Functions "HOL-Library.Countable" | 
| 25903 | 9 | begin | 
| 10 | ||
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 11 | default_sort cpo | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 12 | |
| 62175 | 13 | subsection \<open>Class of representable domains\<close> | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 14 | |
| 62175 | 15 | text \<open> | 
| 40497 | 16 | We define a ``domain'' as a pcpo that is isomorphic to some | 
| 17 | algebraic deflation over the universal domain; this is equivalent | |
| 18 | to being omega-bifinite. | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 19 | |
| 40497 | 20 | A predomain is a cpo that, when lifted, becomes a domain. | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 21 | Predomains are represented by deflations over a lifted universal | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 22 | domain type. | 
| 62175 | 23 | \<close> | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 24 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 25 | class predomain_syn = cpo + | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 26 | fixes liftemb :: "'a\<^sub>\<bottom> \<rightarrow> udom\<^sub>\<bottom>" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 27 | fixes liftprj :: "udom\<^sub>\<bottom> \<rightarrow> 'a\<^sub>\<bottom>" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 28 | fixes liftdefl :: "'a itself \<Rightarrow> udom u defl" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 29 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 30 | class predomain = predomain_syn + | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 31 | assumes predomain_ep: "ep_pair liftemb liftprj" | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 32 |   assumes cast_liftdefl: "cast\<cdot>(liftdefl TYPE('a)) = liftemb oo liftprj"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 33 | |
| 80914 
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
 wenzelm parents: 
80768diff
changeset | 34 | syntax "_LIFTDEFL" :: "type \<Rightarrow> logic" (\<open>(1LIFTDEFL/(1'(_')))\<close>) | 
| 80768 | 35 | syntax_consts "_LIFTDEFL" \<rightleftharpoons> liftdefl | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 36 | translations "LIFTDEFL('t)" \<rightleftharpoons> "CONST liftdefl TYPE('t)"
 | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 37 | |
| 41436 | 38 | definition liftdefl_of :: "udom defl \<rightarrow> udom u defl" | 
| 39 | where "liftdefl_of = defl_fun1 ID ID u_map" | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 40 | |
| 41436 | 41 | lemma cast_liftdefl_of: "cast\<cdot>(liftdefl_of\<cdot>t) = u_map\<cdot>(cast\<cdot>t)" | 
| 42 | by (simp add: liftdefl_of_def cast_defl_fun1 ep_pair_def finite_deflation_u_map) | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 43 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 44 | class "domain" = predomain_syn + pcpo + | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 45 | fixes emb :: "'a \<rightarrow> udom" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 46 | fixes prj :: "udom \<rightarrow> 'a" | 
| 41287 
029a6fc1bfb8
type 'defl' takes a type parameter again (cf. b525988432e9)
 huffman parents: 
41286diff
changeset | 47 | fixes defl :: "'a itself \<Rightarrow> udom defl" | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 48 | assumes ep_pair_emb_prj: "ep_pair emb prj" | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 49 |   assumes cast_DEFL: "cast\<cdot>(defl TYPE('a)) = emb oo prj"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 50 | assumes liftemb_eq: "liftemb = u_map\<cdot>emb" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 51 | assumes liftprj_eq: "liftprj = u_map\<cdot>prj" | 
| 41436 | 52 |   assumes liftdefl_eq: "liftdefl TYPE('a) = liftdefl_of\<cdot>(defl TYPE('a))"
 | 
| 31113 
15cf300a742f
move bifinite instance for product type from Cprod.thy to Bifinite.thy
 huffman parents: 
31076diff
changeset | 53 | |
| 80914 
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
 wenzelm parents: 
80768diff
changeset | 54 | syntax "_DEFL" :: "type \<Rightarrow> logic" (\<open>(1DEFL/(1'(_')))\<close>) | 
| 80768 | 55 | syntax_consts "_DEFL" \<rightleftharpoons> defl | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 56 | translations "DEFL('t)" \<rightleftharpoons> "CONST defl TYPE('t)"
 | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 57 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 58 | instance "domain" \<subseteq> predomain | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 59 | proof | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 60 | show "ep_pair liftemb (liftprj::udom\<^sub>\<bottom> \<rightarrow> 'a\<^sub>\<bottom>)" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 61 | unfolding liftemb_eq liftprj_eq | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 62 | by (intro ep_pair_u_map ep_pair_emb_prj) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 63 |   show "cast\<cdot>LIFTDEFL('a) = liftemb oo (liftprj::udom\<^sub>\<bottom> \<rightarrow> 'a\<^sub>\<bottom>)"
 | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 64 | unfolding liftemb_eq liftprj_eq liftdefl_eq | 
| 41436 | 65 | by (simp add: cast_liftdefl_of cast_DEFL u_map_oo) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 66 | qed | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 67 | |
| 62175 | 68 | text \<open> | 
| 69597 | 69 | Constants \<^const>\<open>liftemb\<close> and \<^const>\<open>liftprj\<close> imply class predomain. | 
| 62175 | 70 | \<close> | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 71 | |
| 62175 | 72 | setup \<open> | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 73 | fold Sign.add_const_constraint | 
| 69597 | 74 | [(\<^const_name>\<open>liftemb\<close>, SOME \<^typ>\<open>'a::predomain u \<rightarrow> udom u\<close>), | 
| 75 | (\<^const_name>\<open>liftprj\<close>, SOME \<^typ>\<open>udom u \<rightarrow> 'a::predomain u\<close>), | |
| 76 | (\<^const_name>\<open>liftdefl\<close>, SOME \<^typ>\<open>'a::predomain itself \<Rightarrow> udom u defl\<close>)] | |
| 62175 | 77 | \<close> | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 78 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 79 | interpretation predomain: pcpo_ep_pair liftemb liftprj | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 80 | unfolding pcpo_ep_pair_def by (rule predomain_ep) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 81 | |
| 40497 | 82 | interpretation "domain": pcpo_ep_pair emb prj | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 83 | unfolding pcpo_ep_pair_def by (rule ep_pair_emb_prj) | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 84 | |
| 40497 | 85 | lemmas emb_inverse = domain.e_inverse | 
| 86 | lemmas emb_prj_below = domain.e_p_below | |
| 87 | lemmas emb_eq_iff = domain.e_eq_iff | |
| 88 | lemmas emb_strict = domain.e_strict | |
| 89 | lemmas prj_strict = domain.p_strict | |
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 90 | |
| 62175 | 91 | subsection \<open>Domains are bifinite\<close> | 
| 33587 | 92 | |
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 93 | lemma approx_chain_ep_cast: | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 94 | assumes ep: "ep_pair (e::'a::pcpo \<rightarrow> 'b::bifinite) (p::'b \<rightarrow> 'a)" | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 95 | assumes cast_t: "cast\<cdot>t = e oo p" | 
| 41287 
029a6fc1bfb8
type 'defl' takes a type parameter again (cf. b525988432e9)
 huffman parents: 
41286diff
changeset | 96 | shows "\<exists>(a::nat \<Rightarrow> 'a::pcpo \<rightarrow> 'a). approx_chain a" | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 97 | proof - | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 98 | interpret ep_pair e p by fact | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 99 | obtain Y where Y: "\<forall>i. Y i \<sqsubseteq> Y (Suc i)" | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 100 | and t: "t = (\<Squnion>i. defl_principal (Y i))" | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 101 | by (rule defl.obtain_principal_chain) | 
| 63040 | 102 | define approx where "approx i = (p oo cast\<cdot>(defl_principal (Y i)) oo e)" for i | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 103 | have "approx_chain approx" | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 104 | proof (rule approx_chain.intro) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 105 | show "chain (\<lambda>i. approx i)" | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 106 | unfolding approx_def by (simp add: Y) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 107 | show "(\<Squnion>i. approx i) = ID" | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 108 | unfolding approx_def | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 109 | by (simp add: lub_distribs Y t [symmetric] cast_t cfun_eq_iff) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 110 | show "\<And>i. finite_deflation (approx i)" | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 111 | unfolding approx_def | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 112 | apply (rule finite_deflation_p_d_e) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 113 | apply (rule finite_deflation_cast) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 114 | apply (rule defl.compact_principal) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 115 | apply (rule below_trans [OF monofun_cfun_fun]) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 116 | apply (rule is_ub_thelub, simp add: Y) | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 117 | apply (simp add: lub_distribs Y t [symmetric] cast_t) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 118 | done | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 119 | qed | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 120 | thus "\<exists>(a::nat \<Rightarrow> 'a \<rightarrow> 'a). approx_chain a" by - (rule exI) | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 121 | qed | 
| 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 122 | |
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 123 | instance "domain" \<subseteq> bifinite | 
| 61169 | 124 | by standard (rule approx_chain_ep_cast [OF ep_pair_emb_prj cast_DEFL]) | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 125 | |
| 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 126 | instance predomain \<subseteq> profinite | 
| 61169 | 127 | by standard (rule approx_chain_ep_cast [OF predomain_ep cast_liftdefl]) | 
| 41286 
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
 huffman parents: 
41285diff
changeset | 128 | |
| 62175 | 129 | subsection \<open>Universal domain ep-pairs\<close> | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 130 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 131 | definition "u_emb = udom_emb (\<lambda>i. u_map\<cdot>(udom_approx i))" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 132 | definition "u_prj = udom_prj (\<lambda>i. u_map\<cdot>(udom_approx i))" | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 133 | |
| 41297 | 134 | definition "prod_emb = udom_emb (\<lambda>i. prod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 135 | definition "prod_prj = udom_prj (\<lambda>i. prod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | |
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 136 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 137 | definition "sprod_emb = udom_emb (\<lambda>i. sprod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 138 | definition "sprod_prj = udom_prj (\<lambda>i. sprod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 139 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 140 | definition "ssum_emb = udom_emb (\<lambda>i. ssum_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 141 | definition "ssum_prj = udom_prj (\<lambda>i. ssum_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 142 | |
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 143 | definition "sfun_emb = udom_emb (\<lambda>i. sfun_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 144 | definition "sfun_prj = udom_prj (\<lambda>i. sfun_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))" | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 145 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 146 | lemma ep_pair_u: "ep_pair u_emb u_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 147 | unfolding u_emb_def u_prj_def | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 148 | by (simp add: ep_pair_udom approx_chain_u_map) | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 149 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 150 | lemma ep_pair_prod: "ep_pair prod_emb prod_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 151 | unfolding prod_emb_def prod_prj_def | 
| 41297 | 152 | by (simp add: ep_pair_udom approx_chain_prod_map) | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 153 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 154 | lemma ep_pair_sprod: "ep_pair sprod_emb sprod_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 155 | unfolding sprod_emb_def sprod_prj_def | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 156 | by (simp add: ep_pair_udom approx_chain_sprod_map) | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 157 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 158 | lemma ep_pair_ssum: "ep_pair ssum_emb ssum_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 159 | unfolding ssum_emb_def ssum_prj_def | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 160 | by (simp add: ep_pair_udom approx_chain_ssum_map) | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 161 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 162 | lemma ep_pair_sfun: "ep_pair sfun_emb sfun_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 163 | unfolding sfun_emb_def sfun_prj_def | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 164 | by (simp add: ep_pair_udom approx_chain_sfun_map) | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 165 | |
| 62175 | 166 | subsection \<open>Type combinators\<close> | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 167 | |
| 41437 | 168 | definition u_defl :: "udom defl \<rightarrow> udom defl" | 
| 169 | where "u_defl = defl_fun1 u_emb u_prj u_map" | |
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 170 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 171 | definition prod_defl :: "udom defl \<rightarrow> udom defl \<rightarrow> udom defl" | 
| 41297 | 172 | where "prod_defl = defl_fun2 prod_emb prod_prj prod_map" | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 173 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 174 | definition sprod_defl :: "udom defl \<rightarrow> udom defl \<rightarrow> udom defl" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 175 | where "sprod_defl = defl_fun2 sprod_emb sprod_prj sprod_map" | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 176 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 177 | definition ssum_defl :: "udom defl \<rightarrow> udom defl \<rightarrow> udom defl" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 178 | where "ssum_defl = defl_fun2 ssum_emb ssum_prj ssum_map" | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 179 | |
| 41287 
029a6fc1bfb8
type 'defl' takes a type parameter again (cf. b525988432e9)
 huffman parents: 
41286diff
changeset | 180 | definition sfun_defl :: "udom defl \<rightarrow> udom defl \<rightarrow> udom defl" | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 181 | where "sfun_defl = defl_fun2 sfun_emb sfun_prj sfun_map" | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 182 | |
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 183 | lemma cast_u_defl: | 
| 41437 | 184 | "cast\<cdot>(u_defl\<cdot>A) = u_emb oo u_map\<cdot>(cast\<cdot>A) oo u_prj" | 
| 185 | using ep_pair_u finite_deflation_u_map | |
| 186 | unfolding u_defl_def by (rule cast_defl_fun1) | |
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 187 | |
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 188 | lemma cast_prod_defl: | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 189 | "cast\<cdot>(prod_defl\<cdot>A\<cdot>B) = | 
| 41297 | 190 | prod_emb oo prod_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo prod_prj" | 
| 191 | using ep_pair_prod finite_deflation_prod_map | |
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 192 | unfolding prod_defl_def by (rule cast_defl_fun2) | 
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 193 | |
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 194 | lemma cast_sprod_defl: | 
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 195 | "cast\<cdot>(sprod_defl\<cdot>A\<cdot>B) = | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 196 | sprod_emb oo sprod_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo sprod_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 197 | using ep_pair_sprod finite_deflation_sprod_map | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 198 | unfolding sprod_defl_def by (rule cast_defl_fun2) | 
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 199 | |
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 200 | lemma cast_ssum_defl: | 
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 201 | "cast\<cdot>(ssum_defl\<cdot>A\<cdot>B) = | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 202 | ssum_emb oo ssum_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo ssum_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 203 | using ep_pair_ssum finite_deflation_ssum_map | 
| 40484 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 204 | unfolding ssum_defl_def by (rule cast_defl_fun2) | 
| 
768f7e264e2b
reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
 huffman parents: 
40086diff
changeset | 205 | |
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 206 | lemma cast_sfun_defl: | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 207 | "cast\<cdot>(sfun_defl\<cdot>A\<cdot>B) = | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 208 | sfun_emb oo sfun_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo sfun_prj" | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 209 | using ep_pair_sfun finite_deflation_sfun_map | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 210 | unfolding sfun_defl_def by (rule cast_defl_fun2) | 
| 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 211 | |
| 62175 | 212 | text \<open>Special deflation combinator for unpointed types.\<close> | 
| 41437 | 213 | |
| 214 | definition u_liftdefl :: "udom u defl \<rightarrow> udom defl" | |
| 215 | where "u_liftdefl = defl_fun1 u_emb u_prj ID" | |
| 216 | ||
| 217 | lemma cast_u_liftdefl: | |
| 218 | "cast\<cdot>(u_liftdefl\<cdot>A) = u_emb oo cast\<cdot>A oo u_prj" | |
| 219 | unfolding u_liftdefl_def by (simp add: cast_defl_fun1 ep_pair_u) | |
| 220 | ||
| 221 | lemma u_liftdefl_liftdefl_of: | |
| 222 | "u_liftdefl\<cdot>(liftdefl_of\<cdot>A) = u_defl\<cdot>A" | |
| 223 | by (rule cast_eq_imp_eq) | |
| 224 | (simp add: cast_u_liftdefl cast_liftdefl_of cast_u_defl) | |
| 225 | ||
| 62175 | 226 | subsection \<open>Class instance proofs\<close> | 
| 40506 | 227 | |
| 62175 | 228 | subsubsection \<open>Universal domain\<close> | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 229 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 230 | instantiation udom :: "domain" | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 231 | begin | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 232 | |
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 233 | definition [simp]: | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 234 | "emb = (ID :: udom \<rightarrow> udom)" | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 235 | |
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 236 | definition [simp]: | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 237 | "prj = (ID :: udom \<rightarrow> udom)" | 
| 25903 | 238 | |
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 239 | definition | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 240 | "defl (t::udom itself) = (\<Squnion>i. defl_principal (Abs_fin_defl (udom_approx i)))" | 
| 33808 | 241 | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 242 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 243 | "(liftemb :: udom u \<rightarrow> udom u) = u_map\<cdot>emb" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 244 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 245 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 246 | "(liftprj :: udom u \<rightarrow> udom u) = u_map\<cdot>prj" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 247 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 248 | definition | 
| 41436 | 249 | "liftdefl (t::udom itself) = liftdefl_of\<cdot>DEFL(udom)" | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 250 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 251 | instance proof | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 252 | show "ep_pair emb (prj :: udom \<rightarrow> udom)" | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 253 | by (simp add: ep_pair.intro) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 254 | show "cast\<cdot>DEFL(udom) = emb oo (prj :: udom \<rightarrow> udom)" | 
| 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 255 | unfolding defl_udom_def | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 256 | apply (subst contlub_cfun_arg) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 257 | apply (rule chainI) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 258 | apply (rule defl.principal_mono) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 259 | apply (simp add: below_fin_defl_def) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 260 | apply (simp add: Abs_fin_defl_inverse finite_deflation_udom_approx) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 261 | apply (rule chainE) | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 262 | apply (rule chain_udom_approx) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 263 | apply (subst cast_defl_principal) | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 264 | apply (simp add: Abs_fin_defl_inverse finite_deflation_udom_approx) | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 265 | done | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 266 | qed (fact liftemb_udom_def liftprj_udom_def liftdefl_udom_def)+ | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 267 | |
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 268 | end | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 269 | |
| 62175 | 270 | subsubsection \<open>Lifted cpo\<close> | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 271 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 272 | instantiation u :: (predomain) "domain" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 273 | begin | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 274 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 275 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 276 | "emb = u_emb oo liftemb" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 277 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 278 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 279 | "prj = liftprj oo u_prj" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 280 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 281 | definition | 
| 41437 | 282 |   "defl (t::'a u itself) = u_liftdefl\<cdot>LIFTDEFL('a)"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 283 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 284 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 285 | "(liftemb :: 'a u u \<rightarrow> udom u) = u_map\<cdot>emb" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 286 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 287 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 288 | "(liftprj :: udom u \<rightarrow> 'a u u) = u_map\<cdot>prj" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 289 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 290 | definition | 
| 41436 | 291 |   "liftdefl (t::'a u itself) = liftdefl_of\<cdot>DEFL('a u)"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 292 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 293 | instance proof | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 294 | show "ep_pair emb (prj :: udom \<rightarrow> 'a u)" | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 295 | unfolding emb_u_def prj_u_def | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 296 | by (intro ep_pair_comp ep_pair_u predomain_ep) | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 297 |   show "cast\<cdot>DEFL('a u) = emb oo (prj :: udom \<rightarrow> 'a u)"
 | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 298 | unfolding emb_u_def prj_u_def defl_u_def | 
| 41437 | 299 | by (simp add: cast_u_liftdefl cast_liftdefl assoc_oo) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 300 | qed (fact liftemb_u_def liftprj_u_def liftdefl_u_def)+ | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 301 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 302 | end | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 303 | |
| 41437 | 304 | lemma DEFL_u: "DEFL('a::predomain u) = u_liftdefl\<cdot>LIFTDEFL('a)"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 305 | by (rule defl_u_def) | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 306 | |
| 62175 | 307 | subsubsection \<open>Strict function space\<close> | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 308 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 309 | instantiation sfun :: ("domain", "domain") "domain"
 | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 310 | begin | 
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 311 | |
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 312 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 313 | "emb = sfun_emb oo sfun_map\<cdot>prj\<cdot>emb" | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 314 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 315 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 316 | "prj = sfun_map\<cdot>emb\<cdot>prj oo sfun_prj" | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 317 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 318 | definition | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 319 |   "defl (t::('a \<rightarrow>! 'b) itself) = sfun_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 320 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 321 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 322 |   "(liftemb :: ('a \<rightarrow>! 'b) u \<rightarrow> udom u) = u_map\<cdot>emb"
 | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 323 | |
| 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 324 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 325 |   "(liftprj :: udom u \<rightarrow> ('a \<rightarrow>! 'b) u) = u_map\<cdot>prj"
 | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 326 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 327 | definition | 
| 41436 | 328 |   "liftdefl (t::('a \<rightarrow>! 'b) itself) = liftdefl_of\<cdot>DEFL('a \<rightarrow>! 'b)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 329 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 330 | instance proof | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 331 | show "ep_pair emb (prj :: udom \<rightarrow> 'a \<rightarrow>! 'b)" | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 332 | unfolding emb_sfun_def prj_sfun_def | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 333 | by (intro ep_pair_comp ep_pair_sfun ep_pair_sfun_map ep_pair_emb_prj) | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 334 |   show "cast\<cdot>DEFL('a \<rightarrow>! 'b) = emb oo (prj :: udom \<rightarrow> 'a \<rightarrow>! 'b)"
 | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 335 | unfolding emb_sfun_def prj_sfun_def defl_sfun_def cast_sfun_defl | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 336 | by (simp add: cast_DEFL oo_def sfun_eq_iff sfun_map_map) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 337 | qed (fact liftemb_sfun_def liftprj_sfun_def liftdefl_sfun_def)+ | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 338 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 339 | end | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 340 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 341 | lemma DEFL_sfun: | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 342 |   "DEFL('a::domain \<rightarrow>! 'b::domain) = sfun_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 343 | by (rule defl_sfun_def) | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 344 | |
| 62175 | 345 | subsubsection \<open>Continuous function space\<close> | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 346 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 347 | instantiation cfun :: (predomain, "domain") "domain" | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 348 | begin | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 349 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 350 | definition | 
| 40830 | 351 | "emb = emb oo encode_cfun" | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 352 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 353 | definition | 
| 40830 | 354 | "prj = decode_cfun oo prj" | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 355 | |
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 356 | definition | 
| 40830 | 357 |   "defl (t::('a \<rightarrow> 'b) itself) = DEFL('a u \<rightarrow>! 'b)"
 | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 358 | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 359 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 360 |   "(liftemb :: ('a \<rightarrow> 'b) u \<rightarrow> udom u) = u_map\<cdot>emb"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 361 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 362 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 363 |   "(liftprj :: udom u \<rightarrow> ('a \<rightarrow> 'b) u) = u_map\<cdot>prj"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 364 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 365 | definition | 
| 41436 | 366 |   "liftdefl (t::('a \<rightarrow> 'b) itself) = liftdefl_of\<cdot>DEFL('a \<rightarrow> 'b)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 367 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 368 | instance proof | 
| 40592 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 369 | have "ep_pair encode_cfun decode_cfun" | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 370 | by (rule ep_pair.intro, simp_all) | 
| 
f432973ce0f6
move strict function type into main HOLCF; instance cfun :: (predomain, domain) domain
 huffman parents: 
40506diff
changeset | 371 | thus "ep_pair emb (prj :: udom \<rightarrow> 'a \<rightarrow> 'b)" | 
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 372 | unfolding emb_cfun_def prj_cfun_def | 
| 40830 | 373 | using ep_pair_emb_prj by (rule ep_pair_comp) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 374 |   show "cast\<cdot>DEFL('a \<rightarrow> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<rightarrow> 'b)"
 | 
| 40830 | 375 | unfolding emb_cfun_def prj_cfun_def defl_cfun_def | 
| 376 | by (simp add: cast_DEFL cfcomp1) | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 377 | qed (fact liftemb_cfun_def liftprj_cfun_def liftdefl_cfun_def)+ | 
| 25903 | 378 | |
| 39985 
310f98585107
move stuff from Algebraic.thy to Bifinite.thy and elsewhere
 huffman parents: 
39974diff
changeset | 379 | end | 
| 33504 
b4210cc3ac97
map functions for various types, with ep_pair/deflation/finite_deflation lemmas
 huffman parents: 
31113diff
changeset | 380 | |
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 381 | lemma DEFL_cfun: | 
| 40830 | 382 |   "DEFL('a::predomain \<rightarrow> 'b::domain) = DEFL('a u \<rightarrow>! 'b)"
 | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 383 | by (rule defl_cfun_def) | 
| 39972 
4244ff4f9649
add lemmas finite_deflation_imp_compact, cast_below_cast_iff
 Brian Huffman <brianh@cs.pdx.edu> parents: 
37678diff
changeset | 384 | |
| 62175 | 385 | subsubsection \<open>Strict product\<close> | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 386 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 387 | instantiation sprod :: ("domain", "domain") "domain"
 | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 388 | begin | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 389 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 390 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 391 | "emb = sprod_emb oo sprod_map\<cdot>emb\<cdot>emb" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 392 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 393 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 394 | "prj = sprod_map\<cdot>prj\<cdot>prj oo sprod_prj" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 395 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 396 | definition | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 397 |   "defl (t::('a \<otimes> 'b) itself) = sprod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 398 | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 399 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 400 |   "(liftemb :: ('a \<otimes> 'b) u \<rightarrow> udom u) = u_map\<cdot>emb"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 401 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 402 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 403 |   "(liftprj :: udom u \<rightarrow> ('a \<otimes> 'b) u) = u_map\<cdot>prj"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 404 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 405 | definition | 
| 41436 | 406 |   "liftdefl (t::('a \<otimes> 'b) itself) = liftdefl_of\<cdot>DEFL('a \<otimes> 'b)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 407 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 408 | instance proof | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 409 | show "ep_pair emb (prj :: udom \<rightarrow> 'a \<otimes> 'b)" | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 410 | unfolding emb_sprod_def prj_sprod_def | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 411 | by (intro ep_pair_comp ep_pair_sprod ep_pair_sprod_map ep_pair_emb_prj) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 412 |   show "cast\<cdot>DEFL('a \<otimes> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<otimes> 'b)"
 | 
| 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 413 | unfolding emb_sprod_def prj_sprod_def defl_sprod_def cast_sprod_defl | 
| 40002 
c5b5f7a3a3b1
new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
 huffman parents: 
39989diff
changeset | 414 | by (simp add: cast_DEFL oo_def cfun_eq_iff sprod_map_map) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 415 | qed (fact liftemb_sprod_def liftprj_sprod_def liftdefl_sprod_def)+ | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 416 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 417 | end | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 418 | |
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 419 | lemma DEFL_sprod: | 
| 40497 | 420 |   "DEFL('a::domain \<otimes> 'b::domain) = sprod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 421 | by (rule defl_sprod_def) | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 422 | |
| 62175 | 423 | subsubsection \<open>Cartesian product\<close> | 
| 40830 | 424 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 425 | definition prod_liftdefl :: "udom u defl \<rightarrow> udom u defl \<rightarrow> udom u defl" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 426 | where "prod_liftdefl = defl_fun2 (u_map\<cdot>prod_emb oo decode_prod_u) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 427 | (encode_prod_u oo u_map\<cdot>prod_prj) sprod_map" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 428 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 429 | lemma cast_prod_liftdefl: | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 430 | "cast\<cdot>(prod_liftdefl\<cdot>a\<cdot>b) = | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 431 | (u_map\<cdot>prod_emb oo decode_prod_u) oo sprod_map\<cdot>(cast\<cdot>a)\<cdot>(cast\<cdot>b) oo | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 432 | (encode_prod_u oo u_map\<cdot>prod_prj)" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 433 | unfolding prod_liftdefl_def | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 434 | apply (rule cast_defl_fun2) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 435 | apply (intro ep_pair_comp ep_pair_u_map ep_pair_prod) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 436 | apply (simp add: ep_pair.intro) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 437 | apply (erule (1) finite_deflation_sprod_map) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 438 | done | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 439 | |
| 40830 | 440 | instantiation prod :: (predomain, predomain) predomain | 
| 441 | begin | |
| 442 | ||
| 443 | definition | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 444 | "liftemb = (u_map\<cdot>prod_emb oo decode_prod_u) oo | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 445 | (sprod_map\<cdot>liftemb\<cdot>liftemb oo encode_prod_u)" | 
| 40830 | 446 | |
| 447 | definition | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 448 | "liftprj = (decode_prod_u oo sprod_map\<cdot>liftprj\<cdot>liftprj) oo | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 449 | (encode_prod_u oo u_map\<cdot>prod_prj)" | 
| 40830 | 450 | |
| 451 | definition | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 452 |   "liftdefl (t::('a \<times> 'b) itself) = prod_liftdefl\<cdot>LIFTDEFL('a)\<cdot>LIFTDEFL('b)"
 | 
| 40830 | 453 | |
| 454 | instance proof | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 455 |   show "ep_pair liftemb (liftprj :: udom u \<rightarrow> ('a \<times> 'b) u)"
 | 
| 40830 | 456 | unfolding liftemb_prod_def liftprj_prod_def | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 457 | by (intro ep_pair_comp ep_pair_sprod_map ep_pair_u_map | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 458 | ep_pair_prod predomain_ep, simp_all add: ep_pair.intro) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 459 |   show "cast\<cdot>LIFTDEFL('a \<times> 'b) = liftemb oo (liftprj :: udom u \<rightarrow> ('a \<times> 'b) u)"
 | 
| 40830 | 460 | unfolding liftemb_prod_def liftprj_prod_def liftdefl_prod_def | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 461 | by (simp add: cast_prod_liftdefl cast_liftdefl cfcomp1 sprod_map_map) | 
| 40830 | 462 | qed | 
| 463 | ||
| 464 | end | |
| 465 | ||
| 466 | instantiation prod :: ("domain", "domain") "domain"
 | |
| 467 | begin | |
| 468 | ||
| 469 | definition | |
| 41297 | 470 | "emb = prod_emb oo prod_map\<cdot>emb\<cdot>emb" | 
| 40830 | 471 | |
| 472 | definition | |
| 41297 | 473 | "prj = prod_map\<cdot>prj\<cdot>prj oo prod_prj" | 
| 40830 | 474 | |
| 475 | definition | |
| 476 |   "defl (t::('a \<times> 'b) itself) = prod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | |
| 477 | ||
| 478 | instance proof | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 479 | show 1: "ep_pair emb (prj :: udom \<rightarrow> 'a \<times> 'b)" | 
| 40830 | 480 | unfolding emb_prod_def prj_prod_def | 
| 41297 | 481 | by (intro ep_pair_comp ep_pair_prod ep_pair_prod_map ep_pair_emb_prj) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 482 |   show 2: "cast\<cdot>DEFL('a \<times> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<times> 'b)"
 | 
| 40830 | 483 | unfolding emb_prod_def prj_prod_def defl_prod_def cast_prod_defl | 
| 41297 | 484 | by (simp add: cast_DEFL oo_def cfun_eq_iff prod_map_map) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 485 | show 3: "liftemb = u_map\<cdot>(emb :: 'a \<times> 'b \<rightarrow> udom)" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 486 | unfolding emb_prod_def liftemb_prod_def liftemb_eq | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 487 | unfolding encode_prod_u_def decode_prod_u_def | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 488 | by (rule cfun_eqI, case_tac x, simp, clarsimp) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 489 | show 4: "liftprj = u_map\<cdot>(prj :: udom \<rightarrow> 'a \<times> 'b)" | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 490 | unfolding prj_prod_def liftprj_prod_def liftprj_eq | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 491 | unfolding encode_prod_u_def decode_prod_u_def | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 492 | apply (rule cfun_eqI, case_tac x, simp) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 493 | apply (rename_tac y, case_tac "prod_prj\<cdot>y", simp) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 494 | done | 
| 41436 | 495 |   show 5: "LIFTDEFL('a \<times> 'b) = liftdefl_of\<cdot>DEFL('a \<times> 'b)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 496 | by (rule cast_eq_imp_eq) | 
| 41436 | 497 | (simp add: cast_liftdefl cast_liftdefl_of cast_DEFL 2 3 4 u_map_oo) | 
| 40830 | 498 | qed | 
| 499 | ||
| 500 | end | |
| 501 | ||
| 502 | lemma DEFL_prod: | |
| 503 |   "DEFL('a::domain \<times> 'b::domain) = prod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | |
| 504 | by (rule defl_prod_def) | |
| 505 | ||
| 506 | lemma LIFTDEFL_prod: | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 507 |   "LIFTDEFL('a::predomain \<times> 'b::predomain) =
 | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 508 |     prod_liftdefl\<cdot>LIFTDEFL('a)\<cdot>LIFTDEFL('b)"
 | 
| 40830 | 509 | by (rule liftdefl_prod_def) | 
| 510 | ||
| 62175 | 511 | subsubsection \<open>Unit type\<close> | 
| 41034 | 512 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 513 | instantiation unit :: "domain" | 
| 41034 | 514 | begin | 
| 515 | ||
| 516 | definition | |
| 517 | "emb = (\<bottom> :: unit \<rightarrow> udom)" | |
| 518 | ||
| 519 | definition | |
| 520 | "prj = (\<bottom> :: udom \<rightarrow> unit)" | |
| 521 | ||
| 522 | definition | |
| 523 | "defl (t::unit itself) = \<bottom>" | |
| 524 | ||
| 525 | definition | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 526 | "(liftemb :: unit u \<rightarrow> udom u) = u_map\<cdot>emb" | 
| 41034 | 527 | |
| 528 | definition | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 529 | "(liftprj :: udom u \<rightarrow> unit u) = u_map\<cdot>prj" | 
| 41034 | 530 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 531 | definition | 
| 41436 | 532 | "liftdefl (t::unit itself) = liftdefl_of\<cdot>DEFL(unit)" | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 533 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 534 | instance proof | 
| 41034 | 535 | show "ep_pair emb (prj :: udom \<rightarrow> unit)" | 
| 536 | unfolding emb_unit_def prj_unit_def | |
| 537 | by (simp add: ep_pair.intro) | |
| 538 | show "cast\<cdot>DEFL(unit) = emb oo (prj :: udom \<rightarrow> unit)" | |
| 539 | unfolding emb_unit_def prj_unit_def defl_unit_def by simp | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 540 | qed (fact liftemb_unit_def liftprj_unit_def liftdefl_unit_def)+ | 
| 41034 | 541 | |
| 542 | end | |
| 543 | ||
| 62175 | 544 | subsubsection \<open>Discrete cpo\<close> | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 545 | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 546 | instantiation discr :: (countable) predomain | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 547 | begin | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 548 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 549 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 550 | "(liftemb :: 'a discr u \<rightarrow> udom u) = strictify\<cdot>up oo udom_emb discr_approx" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 551 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 552 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 553 | "(liftprj :: udom u \<rightarrow> 'a discr u) = udom_prj discr_approx oo fup\<cdot>ID" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 554 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 555 | definition | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 556 | "liftdefl (t::'a discr itself) = | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 557 | (\<Squnion>i. defl_principal (Abs_fin_defl (liftemb oo discr_approx i oo (liftprj::udom u \<rightarrow> 'a discr u))))" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 558 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 559 | instance proof | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 560 | show 1: "ep_pair liftemb (liftprj :: udom u \<rightarrow> 'a discr u)" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 561 | unfolding liftemb_discr_def liftprj_discr_def | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 562 | apply (intro ep_pair_comp ep_pair_udom [OF discr_approx]) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 563 | apply (rule ep_pair.intro) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 564 | apply (simp add: strictify_conv_if) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 565 | apply (case_tac y, simp, simp add: strictify_conv_if) | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 566 | done | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 567 |   show "cast\<cdot>LIFTDEFL('a discr) = liftemb oo (liftprj :: udom u \<rightarrow> 'a discr u)"
 | 
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 568 | unfolding liftdefl_discr_def | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 569 | apply (subst contlub_cfun_arg) | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 570 | apply (rule chainI) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 571 | apply (rule defl.principal_mono) | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 572 | apply (simp add: below_fin_defl_def) | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 573 | apply (simp add: Abs_fin_defl_inverse | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 574 | ep_pair.finite_deflation_e_d_p [OF 1] | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 575 | approx_chain.finite_deflation_approx [OF discr_approx]) | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 576 | apply (intro monofun_cfun below_refl) | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 577 | apply (rule chainE) | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 578 | apply (rule chain_discr_approx) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 579 | apply (subst cast_defl_principal) | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 580 | apply (simp add: Abs_fin_defl_inverse | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 581 | ep_pair.finite_deflation_e_d_p [OF 1] | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 582 | approx_chain.finite_deflation_approx [OF discr_approx]) | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 583 | apply (simp add: lub_distribs) | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 584 | done | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 585 | qed | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 586 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 587 | end | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 588 | |
| 62175 | 589 | subsubsection \<open>Strict sum\<close> | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 590 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 591 | instantiation ssum :: ("domain", "domain") "domain"
 | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 592 | begin | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 593 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 594 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 595 | "emb = ssum_emb oo ssum_map\<cdot>emb\<cdot>emb" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 596 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 597 | definition | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 598 | "prj = ssum_map\<cdot>prj\<cdot>prj oo ssum_prj" | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 599 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 600 | definition | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 601 |   "defl (t::('a \<oplus> 'b) itself) = ssum_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 602 | |
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 603 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 604 |   "(liftemb :: ('a \<oplus> 'b) u \<rightarrow> udom u) = u_map\<cdot>emb"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 605 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 606 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 607 |   "(liftprj :: udom u \<rightarrow> ('a \<oplus> 'b) u) = u_map\<cdot>prj"
 | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 608 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 609 | definition | 
| 41436 | 610 |   "liftdefl (t::('a \<oplus> 'b) itself) = liftdefl_of\<cdot>DEFL('a \<oplus> 'b)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 611 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 612 | instance proof | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 613 | show "ep_pair emb (prj :: udom \<rightarrow> 'a \<oplus> 'b)" | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 614 | unfolding emb_ssum_def prj_ssum_def | 
| 41290 
e9c9577d88b5
replace foo_approx functions with foo_emb, foo_prj functions for universal domain embeddings
 huffman parents: 
41287diff
changeset | 615 | by (intro ep_pair_comp ep_pair_ssum ep_pair_ssum_map ep_pair_emb_prj) | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 616 |   show "cast\<cdot>DEFL('a \<oplus> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<oplus> 'b)"
 | 
| 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 617 | unfolding emb_ssum_def prj_ssum_def defl_ssum_def cast_ssum_defl | 
| 40002 
c5b5f7a3a3b1
new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
 huffman parents: 
39989diff
changeset | 618 | by (simp add: cast_DEFL oo_def cfun_eq_iff ssum_map_map) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 619 | qed (fact liftemb_ssum_def liftprj_ssum_def liftdefl_ssum_def)+ | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 620 | |
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 621 | end | 
| 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 622 | |
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 623 | lemma DEFL_ssum: | 
| 40497 | 624 |   "DEFL('a::domain \<oplus> 'b::domain) = ssum_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
 | 
| 39989 
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
 huffman parents: 
39987diff
changeset | 625 | by (rule defl_ssum_def) | 
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 626 | |
| 62175 | 627 | subsubsection \<open>Lifted HOL type\<close> | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 628 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 629 | instantiation lift :: (countable) "domain" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 630 | begin | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 631 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 632 | definition | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 633 | "emb = emb oo (\<Lambda> x. Rep_lift x)" | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 634 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 635 | definition | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 636 | "prj = (\<Lambda> y. Abs_lift y) oo prj" | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 637 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 638 | definition | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 639 |   "defl (t::'a lift itself) = DEFL('a discr u)"
 | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 640 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 641 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 642 | "(liftemb :: 'a lift u \<rightarrow> udom u) = u_map\<cdot>emb" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 643 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 644 | definition | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 645 | "(liftprj :: udom u \<rightarrow> 'a lift u) = u_map\<cdot>prj" | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 646 | |
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 647 | definition | 
| 41436 | 648 |   "liftdefl (t::'a lift itself) = liftdefl_of\<cdot>DEFL('a lift)"
 | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 649 | |
| 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 650 | instance proof | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 651 | note [simp] = cont_Rep_lift cont_Abs_lift Rep_lift_inverse Abs_lift_inverse | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 652 | have "ep_pair (\<Lambda>(x::'a lift). Rep_lift x) (\<Lambda> y. Abs_lift y)" | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 653 | by (simp add: ep_pair_def) | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 654 | thus "ep_pair emb (prj :: udom \<rightarrow> 'a lift)" | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 655 | unfolding emb_lift_def prj_lift_def | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 656 | using ep_pair_emb_prj by (rule ep_pair_comp) | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 657 |   show "cast\<cdot>DEFL('a lift) = emb oo (prj :: udom \<rightarrow> 'a lift)"
 | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 658 | unfolding emb_lift_def prj_lift_def defl_lift_def cast_DEFL | 
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 659 | by (simp add: cfcomp1) | 
| 41292 
2b7bc8d9fd6e
use deflations over type 'udom u' to represent predomains;
 huffman parents: 
41290diff
changeset | 660 | qed (fact liftemb_lift_def liftprj_lift_def liftdefl_lift_def)+ | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 661 | |
| 39987 
8c2f449af35a
move all bifinite class instances to Bifinite.thy
 huffman parents: 
39986diff
changeset | 662 | end | 
| 40491 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 663 | |
| 
6de5839e2fb3
add 'predomain' class: unpointed version of bifinite
 huffman parents: 
40484diff
changeset | 664 | end |