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