author | huffman |
Tue, 26 Oct 2010 14:19:59 -0700 | |
changeset 40216 | 366309dfaf60 |
parent 40002 | c5b5f7a3a3b1 |
child 40321 | d065b195ec89 |
permissions | -rw-r--r-- |
25904 | 1 |
(* Title: HOLCF/ConvexPD.thy |
2 |
Author: Brian Huffman |
|
3 |
*) |
|
4 |
||
5 |
header {* Convex powerdomain *} |
|
6 |
||
7 |
theory ConvexPD |
|
8 |
imports UpperPD LowerPD |
|
9 |
begin |
|
10 |
||
11 |
subsection {* Basis preorder *} |
|
12 |
||
13 |
definition |
|
14 |
convex_le :: "'a pd_basis \<Rightarrow> 'a pd_basis \<Rightarrow> bool" (infix "\<le>\<natural>" 50) where |
|
15 |
"convex_le = (\<lambda>u v. u \<le>\<sharp> v \<and> u \<le>\<flat> v)" |
|
16 |
||
17 |
lemma convex_le_refl [simp]: "t \<le>\<natural> t" |
|
18 |
unfolding convex_le_def by (fast intro: upper_le_refl lower_le_refl) |
|
19 |
||
20 |
lemma convex_le_trans: "\<lbrakk>t \<le>\<natural> u; u \<le>\<natural> v\<rbrakk> \<Longrightarrow> t \<le>\<natural> v" |
|
21 |
unfolding convex_le_def by (fast intro: upper_le_trans lower_le_trans) |
|
22 |
||
30729
461ee3e49ad3
interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents:
29990
diff
changeset
|
23 |
interpretation convex_le: preorder convex_le |
25904 | 24 |
by (rule preorder.intro, rule convex_le_refl, rule convex_le_trans) |
25 |
||
26 |
lemma upper_le_minimal [simp]: "PDUnit compact_bot \<le>\<natural> t" |
|
27 |
unfolding convex_le_def Rep_PDUnit by simp |
|
28 |
||
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
29 |
lemma PDUnit_convex_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<natural> PDUnit y" |
25904 | 30 |
unfolding convex_le_def by (fast intro: PDUnit_upper_mono PDUnit_lower_mono) |
31 |
||
32 |
lemma PDPlus_convex_mono: "\<lbrakk>s \<le>\<natural> t; u \<le>\<natural> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<natural> PDPlus t v" |
|
33 |
unfolding convex_le_def by (fast intro: PDPlus_upper_mono PDPlus_lower_mono) |
|
34 |
||
35 |
lemma convex_le_PDUnit_PDUnit_iff [simp]: |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
36 |
"(PDUnit a \<le>\<natural> PDUnit b) = a \<sqsubseteq> b" |
25904 | 37 |
unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit by fast |
38 |
||
39 |
lemma convex_le_PDUnit_lemma1: |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
40 |
"(PDUnit a \<le>\<natural> t) = (\<forall>b\<in>Rep_pd_basis t. a \<sqsubseteq> b)" |
25904 | 41 |
unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit |
42 |
using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast |
|
43 |
||
44 |
lemma convex_le_PDUnit_PDPlus_iff [simp]: |
|
45 |
"(PDUnit a \<le>\<natural> PDPlus t u) = (PDUnit a \<le>\<natural> t \<and> PDUnit a \<le>\<natural> u)" |
|
46 |
unfolding convex_le_PDUnit_lemma1 Rep_PDPlus by fast |
|
47 |
||
48 |
lemma convex_le_PDUnit_lemma2: |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
49 |
"(t \<le>\<natural> PDUnit b) = (\<forall>a\<in>Rep_pd_basis t. a \<sqsubseteq> b)" |
25904 | 50 |
unfolding convex_le_def upper_le_def lower_le_def Rep_PDUnit |
51 |
using Rep_pd_basis_nonempty [of t, folded ex_in_conv] by fast |
|
52 |
||
53 |
lemma convex_le_PDPlus_PDUnit_iff [simp]: |
|
54 |
"(PDPlus t u \<le>\<natural> PDUnit a) = (t \<le>\<natural> PDUnit a \<and> u \<le>\<natural> PDUnit a)" |
|
55 |
unfolding convex_le_PDUnit_lemma2 Rep_PDPlus by fast |
|
56 |
||
57 |
lemma convex_le_PDPlus_lemma: |
|
58 |
assumes z: "PDPlus t u \<le>\<natural> z" |
|
59 |
shows "\<exists>v w. z = PDPlus v w \<and> t \<le>\<natural> v \<and> u \<le>\<natural> w" |
|
60 |
proof (intro exI conjI) |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
61 |
let ?A = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis t. a \<sqsubseteq> b}" |
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
62 |
let ?B = "{b\<in>Rep_pd_basis z. \<exists>a\<in>Rep_pd_basis u. a \<sqsubseteq> b}" |
25904 | 63 |
let ?v = "Abs_pd_basis ?A" |
64 |
let ?w = "Abs_pd_basis ?B" |
|
65 |
have Rep_v: "Rep_pd_basis ?v = ?A" |
|
66 |
apply (rule Abs_pd_basis_inverse) |
|
67 |
apply (rule Rep_pd_basis_nonempty [of t, folded ex_in_conv, THEN exE]) |
|
68 |
apply (cut_tac z, simp only: convex_le_def lower_le_def, clarify) |
|
69 |
apply (drule_tac x=x in bspec, simp add: Rep_PDPlus, erule bexE) |
|
70 |
apply (simp add: pd_basis_def) |
|
71 |
apply fast |
|
72 |
done |
|
73 |
have Rep_w: "Rep_pd_basis ?w = ?B" |
|
74 |
apply (rule Abs_pd_basis_inverse) |
|
75 |
apply (rule Rep_pd_basis_nonempty [of u, folded ex_in_conv, THEN exE]) |
|
76 |
apply (cut_tac z, simp only: convex_le_def lower_le_def, clarify) |
|
77 |
apply (drule_tac x=x in bspec, simp add: Rep_PDPlus, erule bexE) |
|
78 |
apply (simp add: pd_basis_def) |
|
79 |
apply fast |
|
80 |
done |
|
81 |
show "z = PDPlus ?v ?w" |
|
82 |
apply (insert z) |
|
83 |
apply (simp add: convex_le_def, erule conjE) |
|
84 |
apply (simp add: Rep_pd_basis_inject [symmetric] Rep_PDPlus) |
|
85 |
apply (simp add: Rep_v Rep_w) |
|
86 |
apply (rule equalityI) |
|
87 |
apply (rule subsetI) |
|
88 |
apply (simp only: upper_le_def) |
|
89 |
apply (drule (1) bspec, erule bexE) |
|
90 |
apply (simp add: Rep_PDPlus) |
|
91 |
apply fast |
|
92 |
apply fast |
|
93 |
done |
|
94 |
show "t \<le>\<natural> ?v" "u \<le>\<natural> ?w" |
|
95 |
apply (insert z) |
|
96 |
apply (simp_all add: convex_le_def upper_le_def lower_le_def Rep_PDPlus Rep_v Rep_w) |
|
97 |
apply fast+ |
|
98 |
done |
|
99 |
qed |
|
100 |
||
101 |
lemma convex_le_induct [induct set: convex_le]: |
|
102 |
assumes le: "t \<le>\<natural> u" |
|
103 |
assumes 2: "\<And>t u v. \<lbrakk>P t u; P u v\<rbrakk> \<Longrightarrow> P t v" |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
104 |
assumes 3: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)" |
25904 | 105 |
assumes 4: "\<And>t u v w. \<lbrakk>P t v; P u w\<rbrakk> \<Longrightarrow> P (PDPlus t u) (PDPlus v w)" |
106 |
shows "P t u" |
|
107 |
using le apply (induct t arbitrary: u rule: pd_basis_induct) |
|
108 |
apply (erule rev_mp) |
|
109 |
apply (induct_tac u rule: pd_basis_induct1) |
|
110 |
apply (simp add: 3) |
|
111 |
apply (simp, clarify, rename_tac a b t) |
|
112 |
apply (subgoal_tac "P (PDPlus (PDUnit a) (PDUnit a)) (PDPlus (PDUnit b) t)") |
|
113 |
apply (simp add: PDPlus_absorb) |
|
114 |
apply (erule (1) 4 [OF 3]) |
|
115 |
apply (drule convex_le_PDPlus_lemma, clarify) |
|
116 |
apply (simp add: 4) |
|
117 |
done |
|
118 |
||
119 |
||
120 |
subsection {* Type definition *} |
|
121 |
||
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
122 |
typedef (open) 'a convex_pd = |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
123 |
"{S::'a pd_basis set. convex_le.ideal S}" |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
124 |
by (fast intro: convex_le.ideal_principal) |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
125 |
|
39986 | 126 |
instantiation convex_pd :: (bifinite) below |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
127 |
begin |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
128 |
|
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
129 |
definition |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
130 |
"x \<sqsubseteq> y \<longleftrightarrow> Rep_convex_pd x \<subseteq> Rep_convex_pd y" |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
131 |
|
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
132 |
instance .. |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
133 |
end |
25904 | 134 |
|
39986 | 135 |
instance convex_pd :: (bifinite) po |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
136 |
using type_definition_convex_pd below_convex_pd_def |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
137 |
by (rule convex_le.typedef_ideal_po) |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
138 |
|
39986 | 139 |
instance convex_pd :: (bifinite) cpo |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
140 |
using type_definition_convex_pd below_convex_pd_def |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
141 |
by (rule convex_le.typedef_ideal_cpo) |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
142 |
|
25904 | 143 |
definition |
144 |
convex_principal :: "'a pd_basis \<Rightarrow> 'a convex_pd" where |
|
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
145 |
"convex_principal t = Abs_convex_pd {u. u \<le>\<natural> t}" |
25904 | 146 |
|
30729
461ee3e49ad3
interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents:
29990
diff
changeset
|
147 |
interpretation convex_pd: |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
148 |
ideal_completion convex_le convex_principal Rep_convex_pd |
39984 | 149 |
using type_definition_convex_pd below_convex_pd_def |
150 |
using convex_principal_def pd_basis_countable |
|
151 |
by (rule convex_le.typedef_ideal_completion) |
|
25904 | 152 |
|
27289 | 153 |
text {* Convex powerdomain is pointed *} |
25904 | 154 |
|
155 |
lemma convex_pd_minimal: "convex_principal (PDUnit compact_bot) \<sqsubseteq> ys" |
|
156 |
by (induct ys rule: convex_pd.principal_induct, simp, simp) |
|
157 |
||
39986 | 158 |
instance convex_pd :: (bifinite) pcpo |
26927 | 159 |
by intro_classes (fast intro: convex_pd_minimal) |
25904 | 160 |
|
161 |
lemma inst_convex_pd_pcpo: "\<bottom> = convex_principal (PDUnit compact_bot)" |
|
162 |
by (rule convex_pd_minimal [THEN UU_I, symmetric]) |
|
163 |
||
164 |
||
26927 | 165 |
subsection {* Monadic unit and plus *} |
25904 | 166 |
|
167 |
definition |
|
168 |
convex_unit :: "'a \<rightarrow> 'a convex_pd" where |
|
169 |
"convex_unit = compact_basis.basis_fun (\<lambda>a. convex_principal (PDUnit a))" |
|
170 |
||
171 |
definition |
|
172 |
convex_plus :: "'a convex_pd \<rightarrow> 'a convex_pd \<rightarrow> 'a convex_pd" where |
|
173 |
"convex_plus = convex_pd.basis_fun (\<lambda>t. convex_pd.basis_fun (\<lambda>u. |
|
174 |
convex_principal (PDPlus t u)))" |
|
175 |
||
176 |
abbreviation |
|
177 |
convex_add :: "'a convex_pd \<Rightarrow> 'a convex_pd \<Rightarrow> 'a convex_pd" |
|
178 |
(infixl "+\<natural>" 65) where |
|
179 |
"xs +\<natural> ys == convex_plus\<cdot>xs\<cdot>ys" |
|
180 |
||
26927 | 181 |
syntax |
182 |
"_convex_pd" :: "args \<Rightarrow> 'a convex_pd" ("{_}\<natural>") |
|
183 |
||
184 |
translations |
|
185 |
"{x,xs}\<natural>" == "{x}\<natural> +\<natural> {xs}\<natural>" |
|
186 |
"{x}\<natural>" == "CONST convex_unit\<cdot>x" |
|
187 |
||
188 |
lemma convex_unit_Rep_compact_basis [simp]: |
|
189 |
"{Rep_compact_basis a}\<natural> = convex_principal (PDUnit a)" |
|
190 |
unfolding convex_unit_def |
|
27289 | 191 |
by (simp add: compact_basis.basis_fun_principal PDUnit_convex_mono) |
26927 | 192 |
|
25904 | 193 |
lemma convex_plus_principal [simp]: |
26927 | 194 |
"convex_principal t +\<natural> convex_principal u = convex_principal (PDPlus t u)" |
25904 | 195 |
unfolding convex_plus_def |
196 |
by (simp add: convex_pd.basis_fun_principal |
|
197 |
convex_pd.basis_fun_mono PDPlus_convex_mono) |
|
198 |
||
37770
cddb3106adb8
avoid explicit mandatory prefix markers when prefixes are mandatory implicitly
haftmann
parents:
36635
diff
changeset
|
199 |
interpretation convex_add: semilattice convex_add proof |
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
200 |
fix xs ys zs :: "'a convex_pd" |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
201 |
show "(xs +\<natural> ys) +\<natural> zs = xs +\<natural> (ys +\<natural> zs)" |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
202 |
apply (induct xs ys arbitrary: zs rule: convex_pd.principal_induct2, simp, simp) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
203 |
apply (rule_tac x=zs in convex_pd.principal_induct, simp) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
204 |
apply (simp add: PDPlus_assoc) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
205 |
done |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
206 |
show "xs +\<natural> ys = ys +\<natural> xs" |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
207 |
apply (induct xs ys rule: convex_pd.principal_induct2, simp, simp) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
208 |
apply (simp add: PDPlus_commute) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
209 |
done |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
210 |
show "xs +\<natural> xs = xs" |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
211 |
apply (induct xs rule: convex_pd.principal_induct, simp) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
212 |
apply (simp add: PDPlus_absorb) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
213 |
done |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
214 |
qed |
26927 | 215 |
|
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
216 |
lemmas convex_plus_assoc = convex_add.assoc |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
217 |
lemmas convex_plus_commute = convex_add.commute |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
218 |
lemmas convex_plus_absorb = convex_add.idem |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
219 |
lemmas convex_plus_left_commute = convex_add.left_commute |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
220 |
lemmas convex_plus_left_absorb = convex_add.left_idem |
26927 | 221 |
|
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
222 |
text {* Useful for @{text "simp add: convex_plus_ac"} *} |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
223 |
lemmas convex_plus_ac = |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
224 |
convex_plus_assoc convex_plus_commute convex_plus_left_commute |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
225 |
|
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
226 |
text {* Useful for @{text "simp only: convex_plus_aci"} *} |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
227 |
lemmas convex_plus_aci = |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
228 |
convex_plus_ac convex_plus_absorb convex_plus_left_absorb |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
229 |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
230 |
lemma convex_unit_below_plus_iff [simp]: |
26927 | 231 |
"{x}\<natural> \<sqsubseteq> ys +\<natural> zs \<longleftrightarrow> {x}\<natural> \<sqsubseteq> ys \<and> {x}\<natural> \<sqsubseteq> zs" |
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
232 |
apply (induct x rule: compact_basis.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
233 |
apply (induct ys rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
234 |
apply (induct zs rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
235 |
apply simp |
25904 | 236 |
done |
237 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
238 |
lemma convex_plus_below_unit_iff [simp]: |
26927 | 239 |
"xs +\<natural> ys \<sqsubseteq> {z}\<natural> \<longleftrightarrow> xs \<sqsubseteq> {z}\<natural> \<and> ys \<sqsubseteq> {z}\<natural>" |
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
240 |
apply (induct xs rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
241 |
apply (induct ys rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
242 |
apply (induct z rule: compact_basis.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
243 |
apply simp |
25904 | 244 |
done |
245 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
246 |
lemma convex_unit_below_iff [simp]: "{x}\<natural> \<sqsubseteq> {y}\<natural> \<longleftrightarrow> x \<sqsubseteq> y" |
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
247 |
apply (induct x rule: compact_basis.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
248 |
apply (induct y rule: compact_basis.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
249 |
apply simp |
26927 | 250 |
done |
251 |
||
252 |
lemma convex_unit_eq_iff [simp]: "{x}\<natural> = {y}\<natural> \<longleftrightarrow> x = y" |
|
253 |
unfolding po_eq_conv by simp |
|
254 |
||
255 |
lemma convex_unit_strict [simp]: "{\<bottom>}\<natural> = \<bottom>" |
|
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
256 |
using convex_unit_Rep_compact_basis [of compact_bot] |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
257 |
by (simp add: inst_convex_pd_pcpo) |
26927 | 258 |
|
259 |
lemma convex_unit_strict_iff [simp]: "{x}\<natural> = \<bottom> \<longleftrightarrow> x = \<bottom>" |
|
260 |
unfolding convex_unit_strict [symmetric] by (rule convex_unit_eq_iff) |
|
261 |
||
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
262 |
lemma compact_convex_unit: "compact x \<Longrightarrow> compact {x}\<natural>" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
263 |
by (auto dest!: compact_basis.compact_imp_principal) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
264 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
265 |
lemma compact_convex_unit_iff [simp]: "compact {x}\<natural> \<longleftrightarrow> compact x" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
266 |
apply (safe elim!: compact_convex_unit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
267 |
apply (simp only: compact_def convex_unit_below_iff [symmetric]) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
268 |
apply (erule adm_subst [OF cont_Rep_CFun2]) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
269 |
done |
26927 | 270 |
|
271 |
lemma compact_convex_plus [simp]: |
|
272 |
"\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<natural> ys)" |
|
27289 | 273 |
by (auto dest!: convex_pd.compact_imp_principal) |
26927 | 274 |
|
25904 | 275 |
|
276 |
subsection {* Induction rules *} |
|
277 |
||
278 |
lemma convex_pd_induct1: |
|
279 |
assumes P: "adm P" |
|
26927 | 280 |
assumes unit: "\<And>x. P {x}\<natural>" |
281 |
assumes insert: "\<And>x ys. \<lbrakk>P {x}\<natural>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<natural> +\<natural> ys)" |
|
25904 | 282 |
shows "P (xs::'a convex_pd)" |
27289 | 283 |
apply (induct xs rule: convex_pd.principal_induct, rule P) |
284 |
apply (induct_tac a rule: pd_basis_induct1) |
|
25904 | 285 |
apply (simp only: convex_unit_Rep_compact_basis [symmetric]) |
286 |
apply (rule unit) |
|
287 |
apply (simp only: convex_unit_Rep_compact_basis [symmetric] |
|
288 |
convex_plus_principal [symmetric]) |
|
289 |
apply (erule insert [OF unit]) |
|
290 |
done |
|
291 |
||
292 |
lemma convex_pd_induct: |
|
293 |
assumes P: "adm P" |
|
26927 | 294 |
assumes unit: "\<And>x. P {x}\<natural>" |
295 |
assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<natural> ys)" |
|
25904 | 296 |
shows "P (xs::'a convex_pd)" |
27289 | 297 |
apply (induct xs rule: convex_pd.principal_induct, rule P) |
298 |
apply (induct_tac a rule: pd_basis_induct) |
|
25904 | 299 |
apply (simp only: convex_unit_Rep_compact_basis [symmetric] unit) |
300 |
apply (simp only: convex_plus_principal [symmetric] plus) |
|
301 |
done |
|
302 |
||
303 |
||
304 |
subsection {* Monadic bind *} |
|
305 |
||
306 |
definition |
|
307 |
convex_bind_basis :: |
|
308 |
"'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b convex_pd) \<rightarrow> 'b convex_pd" where |
|
309 |
"convex_bind_basis = fold_pd |
|
310 |
(\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a)) |
|
26927 | 311 |
(\<lambda>x y. \<Lambda> f. x\<cdot>f +\<natural> y\<cdot>f)" |
25904 | 312 |
|
26927 | 313 |
lemma ACI_convex_bind: |
36635
080b755377c0
locale predicates of classes carry a mandatory "class" prefix
haftmann
parents:
35901
diff
changeset
|
314 |
"class.ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<natural> y\<cdot>f)" |
25904 | 315 |
apply unfold_locales |
26041
c2e15e65165f
locales ACf, ACIf, ACIfSL and ACIfSLlin have been abandoned in favour of the existing algebraic classes ab_semigroup_mult, ab_semigroup_idem_mult, lower_semilattice (resp. uper_semilattice) and linorder
haftmann
parents:
25925
diff
changeset
|
316 |
apply (simp add: convex_plus_assoc) |
25904 | 317 |
apply (simp add: convex_plus_commute) |
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
318 |
apply (simp add: eta_cfun) |
25904 | 319 |
done |
320 |
||
321 |
lemma convex_bind_basis_simps [simp]: |
|
322 |
"convex_bind_basis (PDUnit a) = |
|
323 |
(\<Lambda> f. f\<cdot>(Rep_compact_basis a))" |
|
324 |
"convex_bind_basis (PDPlus t u) = |
|
26927 | 325 |
(\<Lambda> f. convex_bind_basis t\<cdot>f +\<natural> convex_bind_basis u\<cdot>f)" |
25904 | 326 |
unfolding convex_bind_basis_def |
327 |
apply - |
|
26927 | 328 |
apply (rule fold_pd_PDUnit [OF ACI_convex_bind]) |
329 |
apply (rule fold_pd_PDPlus [OF ACI_convex_bind]) |
|
25904 | 330 |
done |
331 |
||
332 |
lemma monofun_LAM: |
|
333 |
"\<lbrakk>cont f; cont g; \<And>x. f x \<sqsubseteq> g x\<rbrakk> \<Longrightarrow> (\<Lambda> x. f x) \<sqsubseteq> (\<Lambda> x. g x)" |
|
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
|
334 |
by (simp add: cfun_below_iff) |
25904 | 335 |
|
336 |
lemma convex_bind_basis_mono: |
|
337 |
"t \<le>\<natural> u \<Longrightarrow> convex_bind_basis t \<sqsubseteq> convex_bind_basis u" |
|
338 |
apply (erule convex_le_induct) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
339 |
apply (erule (1) below_trans) |
27289 | 340 |
apply (simp add: monofun_LAM monofun_cfun) |
341 |
apply (simp add: monofun_LAM monofun_cfun) |
|
25904 | 342 |
done |
343 |
||
344 |
definition |
|
345 |
convex_bind :: "'a convex_pd \<rightarrow> ('a \<rightarrow> 'b convex_pd) \<rightarrow> 'b convex_pd" where |
|
346 |
"convex_bind = convex_pd.basis_fun convex_bind_basis" |
|
347 |
||
348 |
lemma convex_bind_principal [simp]: |
|
349 |
"convex_bind\<cdot>(convex_principal t) = convex_bind_basis t" |
|
350 |
unfolding convex_bind_def |
|
351 |
apply (rule convex_pd.basis_fun_principal) |
|
352 |
apply (erule convex_bind_basis_mono) |
|
353 |
done |
|
354 |
||
355 |
lemma convex_bind_unit [simp]: |
|
26927 | 356 |
"convex_bind\<cdot>{x}\<natural>\<cdot>f = f\<cdot>x" |
27289 | 357 |
by (induct x rule: compact_basis.principal_induct, simp, simp) |
25904 | 358 |
|
359 |
lemma convex_bind_plus [simp]: |
|
26927 | 360 |
"convex_bind\<cdot>(xs +\<natural> ys)\<cdot>f = convex_bind\<cdot>xs\<cdot>f +\<natural> convex_bind\<cdot>ys\<cdot>f" |
27289 | 361 |
by (induct xs ys rule: convex_pd.principal_induct2, simp, simp, simp) |
25904 | 362 |
|
363 |
lemma convex_bind_strict [simp]: "convex_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>" |
|
364 |
unfolding convex_unit_strict [symmetric] by (rule convex_bind_unit) |
|
365 |
||
366 |
||
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
367 |
subsection {* Map *} |
25904 | 368 |
|
369 |
definition |
|
370 |
convex_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a convex_pd \<rightarrow> 'b convex_pd" where |
|
26927 | 371 |
"convex_map = (\<Lambda> f xs. convex_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<natural>))" |
25904 | 372 |
|
373 |
lemma convex_map_unit [simp]: |
|
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
374 |
"convex_map\<cdot>f\<cdot>{x}\<natural> = {f\<cdot>x}\<natural>" |
25904 | 375 |
unfolding convex_map_def by simp |
376 |
||
377 |
lemma convex_map_plus [simp]: |
|
26927 | 378 |
"convex_map\<cdot>f\<cdot>(xs +\<natural> ys) = convex_map\<cdot>f\<cdot>xs +\<natural> convex_map\<cdot>f\<cdot>ys" |
25904 | 379 |
unfolding convex_map_def by simp |
380 |
||
381 |
lemma convex_map_ident: "convex_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs" |
|
382 |
by (induct xs rule: convex_pd_induct, simp_all) |
|
383 |
||
33808 | 384 |
lemma convex_map_ID: "convex_map\<cdot>ID = ID" |
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
|
385 |
by (simp add: cfun_eq_iff ID_def convex_map_ident) |
33808 | 386 |
|
25904 | 387 |
lemma convex_map_map: |
388 |
"convex_map\<cdot>f\<cdot>(convex_map\<cdot>g\<cdot>xs) = convex_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs" |
|
389 |
by (induct xs rule: convex_pd_induct, simp_all) |
|
390 |
||
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
391 |
lemma ep_pair_convex_map: "ep_pair e p \<Longrightarrow> ep_pair (convex_map\<cdot>e) (convex_map\<cdot>p)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
392 |
apply default |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
393 |
apply (induct_tac x rule: convex_pd_induct, simp_all add: ep_pair.e_inverse) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
394 |
apply (induct_tac y rule: convex_pd_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
395 |
apply (simp_all add: ep_pair.e_p_below monofun_cfun) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
396 |
done |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
397 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
398 |
lemma deflation_convex_map: "deflation d \<Longrightarrow> deflation (convex_map\<cdot>d)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
399 |
apply default |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
400 |
apply (induct_tac x rule: convex_pd_induct, simp_all add: deflation.idem) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
401 |
apply (induct_tac x rule: convex_pd_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
402 |
apply (simp_all add: deflation.below monofun_cfun) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
403 |
done |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
404 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
405 |
(* FIXME: long proof! *) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
406 |
lemma finite_deflation_convex_map: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
407 |
assumes "finite_deflation d" shows "finite_deflation (convex_map\<cdot>d)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
408 |
proof (rule finite_deflation_intro) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
409 |
interpret d: finite_deflation d by fact |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
410 |
have "deflation d" by fact |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
411 |
thus "deflation (convex_map\<cdot>d)" by (rule deflation_convex_map) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
412 |
have "finite (range (\<lambda>x. d\<cdot>x))" by (rule d.finite_range) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
413 |
hence "finite (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
414 |
by (rule finite_vimageI, simp add: inj_on_def Rep_compact_basis_inject) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
415 |
hence "finite (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x)))" by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
416 |
hence "finite (Rep_pd_basis -` (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
417 |
by (rule finite_vimageI, simp add: inj_on_def Rep_pd_basis_inject) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
418 |
hence *: "finite (convex_principal ` Rep_pd_basis -` (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))))" by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
419 |
hence "finite (range (\<lambda>xs. convex_map\<cdot>d\<cdot>xs))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
420 |
apply (rule rev_finite_subset) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
421 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
422 |
apply (induct_tac xs rule: convex_pd.principal_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
423 |
apply (simp add: adm_mem_finite *) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
424 |
apply (rename_tac t, induct_tac t rule: pd_basis_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
425 |
apply (simp only: convex_unit_Rep_compact_basis [symmetric] convex_map_unit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
426 |
apply simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
427 |
apply (subgoal_tac "\<exists>b. d\<cdot>(Rep_compact_basis a) = Rep_compact_basis b") |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
428 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
429 |
apply (rule imageI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
430 |
apply (rule vimageI2) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
431 |
apply (simp add: Rep_PDUnit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
432 |
apply (rule range_eqI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
433 |
apply (erule sym) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
434 |
apply (rule exI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
435 |
apply (rule Abs_compact_basis_inverse [symmetric]) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
436 |
apply (simp add: d.compact) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
437 |
apply (simp only: convex_plus_principal [symmetric] convex_map_plus) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
438 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
439 |
apply (rule imageI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
440 |
apply (rule vimageI2) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
441 |
apply (simp add: Rep_PDPlus) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
442 |
done |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
443 |
thus "finite {xs. convex_map\<cdot>d\<cdot>xs = xs}" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
444 |
by (rule finite_range_imp_finite_fixes) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
445 |
qed |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
446 |
|
39986 | 447 |
subsection {* Convex powerdomain is a bifinite domain *} |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
448 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
449 |
definition |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
450 |
convex_approx :: "nat \<Rightarrow> udom convex_pd \<rightarrow> udom convex_pd" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
451 |
where |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
452 |
"convex_approx = (\<lambda>i. convex_map\<cdot>(udom_approx i))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
453 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
454 |
lemma convex_approx: "approx_chain convex_approx" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
455 |
proof (rule approx_chain.intro) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
456 |
show "chain (\<lambda>i. convex_approx i)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
457 |
unfolding convex_approx_def by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
458 |
show "(\<Squnion>i. convex_approx i) = ID" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
459 |
unfolding convex_approx_def |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
460 |
by (simp add: lub_distribs convex_map_ID) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
461 |
show "\<And>i. finite_deflation (convex_approx i)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
462 |
unfolding convex_approx_def |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
463 |
by (intro finite_deflation_convex_map finite_deflation_udom_approx) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
464 |
qed |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
465 |
|
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
466 |
definition convex_defl :: "defl \<rightarrow> defl" |
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
467 |
where "convex_defl = defl_fun1 convex_approx convex_map" |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
468 |
|
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
469 |
lemma cast_convex_defl: |
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
470 |
"cast\<cdot>(convex_defl\<cdot>A) = |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
471 |
udom_emb convex_approx oo convex_map\<cdot>(cast\<cdot>A) oo udom_prj convex_approx" |
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
472 |
unfolding convex_defl_def |
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
473 |
apply (rule cast_defl_fun1 [OF convex_approx]) |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
474 |
apply (erule finite_deflation_convex_map) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
475 |
done |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
476 |
|
39986 | 477 |
instantiation convex_pd :: (bifinite) bifinite |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
478 |
begin |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
479 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
480 |
definition |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
481 |
"emb = udom_emb convex_approx oo convex_map\<cdot>emb" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
482 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
483 |
definition |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
484 |
"prj = convex_map\<cdot>prj oo udom_prj convex_approx" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
485 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
486 |
definition |
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
487 |
"defl (t::'a convex_pd itself) = convex_defl\<cdot>DEFL('a)" |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
488 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
489 |
instance proof |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
490 |
show "ep_pair emb (prj :: udom \<rightarrow> 'a convex_pd)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
491 |
unfolding emb_convex_pd_def prj_convex_pd_def |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
492 |
using ep_pair_udom [OF convex_approx] |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
493 |
by (intro ep_pair_comp ep_pair_convex_map ep_pair_emb_prj) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
494 |
next |
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
495 |
show "cast\<cdot>DEFL('a convex_pd) = emb oo (prj :: udom \<rightarrow> 'a convex_pd)" |
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
496 |
unfolding emb_convex_pd_def prj_convex_pd_def defl_convex_pd_def cast_convex_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
|
497 |
by (simp add: cast_DEFL oo_def cfun_eq_iff convex_map_map) |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
498 |
qed |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
499 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
500 |
end |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
501 |
|
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
502 |
text {* DEFL of type constructor = type combinator *} |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
503 |
|
39989
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
504 |
lemma DEFL_convex: "DEFL('a convex_pd) = convex_defl\<cdot>DEFL('a)" |
ad60d7311f43
renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents:
39986
diff
changeset
|
505 |
by (rule defl_convex_pd_def) |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
506 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
507 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
508 |
subsection {* Join *} |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
509 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
510 |
definition |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
511 |
convex_join :: "'a convex_pd convex_pd \<rightarrow> 'a convex_pd" where |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
512 |
"convex_join = (\<Lambda> xss. convex_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
513 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
514 |
lemma convex_join_unit [simp]: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
515 |
"convex_join\<cdot>{xs}\<natural> = xs" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
516 |
unfolding convex_join_def by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
517 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
518 |
lemma convex_join_plus [simp]: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
519 |
"convex_join\<cdot>(xss +\<natural> yss) = convex_join\<cdot>xss +\<natural> convex_join\<cdot>yss" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
520 |
unfolding convex_join_def by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
521 |
|
25904 | 522 |
lemma convex_join_map_unit: |
523 |
"convex_join\<cdot>(convex_map\<cdot>convex_unit\<cdot>xs) = xs" |
|
524 |
by (induct xs rule: convex_pd_induct, simp_all) |
|
525 |
||
526 |
lemma convex_join_map_join: |
|
527 |
"convex_join\<cdot>(convex_map\<cdot>convex_join\<cdot>xsss) = convex_join\<cdot>(convex_join\<cdot>xsss)" |
|
528 |
by (induct xsss rule: convex_pd_induct, simp_all) |
|
529 |
||
530 |
lemma convex_join_map_map: |
|
531 |
"convex_join\<cdot>(convex_map\<cdot>(convex_map\<cdot>f)\<cdot>xss) = |
|
532 |
convex_map\<cdot>f\<cdot>(convex_join\<cdot>xss)" |
|
533 |
by (induct xss rule: convex_pd_induct, simp_all) |
|
534 |
||
535 |
||
536 |
subsection {* Conversions to other powerdomains *} |
|
537 |
||
538 |
text {* Convex to upper *} |
|
539 |
||
540 |
lemma convex_le_imp_upper_le: "t \<le>\<natural> u \<Longrightarrow> t \<le>\<sharp> u" |
|
541 |
unfolding convex_le_def by simp |
|
542 |
||
543 |
definition |
|
544 |
convex_to_upper :: "'a convex_pd \<rightarrow> 'a upper_pd" where |
|
545 |
"convex_to_upper = convex_pd.basis_fun upper_principal" |
|
546 |
||
547 |
lemma convex_to_upper_principal [simp]: |
|
548 |
"convex_to_upper\<cdot>(convex_principal t) = upper_principal t" |
|
549 |
unfolding convex_to_upper_def |
|
550 |
apply (rule convex_pd.basis_fun_principal) |
|
27289 | 551 |
apply (rule upper_pd.principal_mono) |
25904 | 552 |
apply (erule convex_le_imp_upper_le) |
553 |
done |
|
554 |
||
555 |
lemma convex_to_upper_unit [simp]: |
|
26927 | 556 |
"convex_to_upper\<cdot>{x}\<natural> = {x}\<sharp>" |
27289 | 557 |
by (induct x rule: compact_basis.principal_induct, simp, simp) |
25904 | 558 |
|
559 |
lemma convex_to_upper_plus [simp]: |
|
26927 | 560 |
"convex_to_upper\<cdot>(xs +\<natural> ys) = convex_to_upper\<cdot>xs +\<sharp> convex_to_upper\<cdot>ys" |
27289 | 561 |
by (induct xs ys rule: convex_pd.principal_induct2, simp, simp, simp) |
25904 | 562 |
|
27289 | 563 |
lemma convex_to_upper_bind [simp]: |
564 |
"convex_to_upper\<cdot>(convex_bind\<cdot>xs\<cdot>f) = |
|
565 |
upper_bind\<cdot>(convex_to_upper\<cdot>xs)\<cdot>(convex_to_upper oo f)" |
|
566 |
by (induct xs rule: convex_pd_induct, simp, simp, simp) |
|
567 |
||
568 |
lemma convex_to_upper_map [simp]: |
|
569 |
"convex_to_upper\<cdot>(convex_map\<cdot>f\<cdot>xs) = upper_map\<cdot>f\<cdot>(convex_to_upper\<cdot>xs)" |
|
570 |
by (simp add: convex_map_def upper_map_def cfcomp_LAM) |
|
571 |
||
572 |
lemma convex_to_upper_join [simp]: |
|
573 |
"convex_to_upper\<cdot>(convex_join\<cdot>xss) = |
|
574 |
upper_bind\<cdot>(convex_to_upper\<cdot>xss)\<cdot>convex_to_upper" |
|
575 |
by (simp add: convex_join_def upper_join_def cfcomp_LAM eta_cfun) |
|
576 |
||
25904 | 577 |
text {* Convex to lower *} |
578 |
||
579 |
lemma convex_le_imp_lower_le: "t \<le>\<natural> u \<Longrightarrow> t \<le>\<flat> u" |
|
580 |
unfolding convex_le_def by simp |
|
581 |
||
582 |
definition |
|
583 |
convex_to_lower :: "'a convex_pd \<rightarrow> 'a lower_pd" where |
|
584 |
"convex_to_lower = convex_pd.basis_fun lower_principal" |
|
585 |
||
586 |
lemma convex_to_lower_principal [simp]: |
|
587 |
"convex_to_lower\<cdot>(convex_principal t) = lower_principal t" |
|
588 |
unfolding convex_to_lower_def |
|
589 |
apply (rule convex_pd.basis_fun_principal) |
|
27289 | 590 |
apply (rule lower_pd.principal_mono) |
25904 | 591 |
apply (erule convex_le_imp_lower_le) |
592 |
done |
|
593 |
||
594 |
lemma convex_to_lower_unit [simp]: |
|
26927 | 595 |
"convex_to_lower\<cdot>{x}\<natural> = {x}\<flat>" |
27289 | 596 |
by (induct x rule: compact_basis.principal_induct, simp, simp) |
25904 | 597 |
|
598 |
lemma convex_to_lower_plus [simp]: |
|
26927 | 599 |
"convex_to_lower\<cdot>(xs +\<natural> ys) = convex_to_lower\<cdot>xs +\<flat> convex_to_lower\<cdot>ys" |
27289 | 600 |
by (induct xs ys rule: convex_pd.principal_induct2, simp, simp, simp) |
25904 | 601 |
|
27289 | 602 |
lemma convex_to_lower_bind [simp]: |
603 |
"convex_to_lower\<cdot>(convex_bind\<cdot>xs\<cdot>f) = |
|
604 |
lower_bind\<cdot>(convex_to_lower\<cdot>xs)\<cdot>(convex_to_lower oo f)" |
|
605 |
by (induct xs rule: convex_pd_induct, simp, simp, simp) |
|
606 |
||
607 |
lemma convex_to_lower_map [simp]: |
|
608 |
"convex_to_lower\<cdot>(convex_map\<cdot>f\<cdot>xs) = lower_map\<cdot>f\<cdot>(convex_to_lower\<cdot>xs)" |
|
609 |
by (simp add: convex_map_def lower_map_def cfcomp_LAM) |
|
610 |
||
611 |
lemma convex_to_lower_join [simp]: |
|
612 |
"convex_to_lower\<cdot>(convex_join\<cdot>xss) = |
|
613 |
lower_bind\<cdot>(convex_to_lower\<cdot>xss)\<cdot>convex_to_lower" |
|
614 |
by (simp add: convex_join_def lower_join_def cfcomp_LAM eta_cfun) |
|
615 |
||
25904 | 616 |
text {* Ordering property *} |
617 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
618 |
lemma convex_pd_below_iff: |
25904 | 619 |
"(xs \<sqsubseteq> ys) = |
620 |
(convex_to_upper\<cdot>xs \<sqsubseteq> convex_to_upper\<cdot>ys \<and> |
|
621 |
convex_to_lower\<cdot>xs \<sqsubseteq> convex_to_lower\<cdot>ys)" |
|
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
622 |
apply (induct xs rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
623 |
apply (induct ys rule: convex_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
624 |
apply (simp add: convex_le_def) |
25904 | 625 |
done |
626 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
627 |
lemmas convex_plus_below_plus_iff = |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
628 |
convex_pd_below_iff [where xs="xs +\<natural> ys" and ys="zs +\<natural> ws", standard] |
26927 | 629 |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
630 |
lemmas convex_pd_below_simps = |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
631 |
convex_unit_below_plus_iff |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
632 |
convex_plus_below_unit_iff |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
633 |
convex_plus_below_plus_iff |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
634 |
convex_unit_below_iff |
26927 | 635 |
convex_to_upper_unit |
636 |
convex_to_upper_plus |
|
637 |
convex_to_lower_unit |
|
638 |
convex_to_lower_plus |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
639 |
upper_pd_below_simps |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
640 |
lower_pd_below_simps |
26927 | 641 |
|
25904 | 642 |
end |