author | haftmann |
Thu, 19 Jun 2025 17:15:40 +0200 | |
changeset 82734 | 89347c0cc6a3 |
parent 81620 | 2cb49d09f059 |
permissions | -rw-r--r-- |
42151 | 1 |
(* Title: HOL/HOLCF/LowerPD.thy |
25904 | 2 |
Author: Brian Huffman |
3 |
*) |
|
4 |
||
62175 | 5 |
section \<open>Lower powerdomain\<close> |
25904 | 6 |
|
7 |
theory LowerPD |
|
41284 | 8 |
imports Compact_Basis |
25904 | 9 |
begin |
10 |
||
62175 | 11 |
subsection \<open>Basis preorder\<close> |
25904 | 12 |
|
13 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
14 |
lower_le :: "'a::bifinite pd_basis \<Rightarrow> 'a pd_basis \<Rightarrow> bool" (infix \<open>\<le>\<flat>\<close> 50) where |
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
15 |
"lower_le = (\<lambda>u v. \<forall>x\<in>Rep_pd_basis u. \<exists>y\<in>Rep_pd_basis v. x \<sqsubseteq> y)" |
25904 | 16 |
|
17 |
lemma lower_le_refl [simp]: "t \<le>\<flat> t" |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
18 |
unfolding lower_le_def by fast |
25904 | 19 |
|
20 |
lemma lower_le_trans: "\<lbrakk>t \<le>\<flat> u; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> t \<le>\<flat> v" |
|
21 |
unfolding lower_le_def |
|
22 |
apply (rule ballI) |
|
23 |
apply (drule (1) bspec, erule bexE) |
|
24 |
apply (drule (1) bspec, erule bexE) |
|
25 |
apply (erule rev_bexI) |
|
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
|
26 |
apply (erule (1) below_trans) |
25904 | 27 |
done |
28 |
||
30729
461ee3e49ad3
interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents:
29990
diff
changeset
|
29 |
interpretation lower_le: preorder lower_le |
25904 | 30 |
by (rule preorder.intro, rule lower_le_refl, rule lower_le_trans) |
31 |
||
32 |
lemma lower_le_minimal [simp]: "PDUnit compact_bot \<le>\<flat> t" |
|
33 |
unfolding lower_le_def Rep_PDUnit |
|
34 |
by (simp, rule Rep_pd_basis_nonempty [folded ex_in_conv]) |
|
35 |
||
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
36 |
lemma PDUnit_lower_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<flat> PDUnit y" |
25904 | 37 |
unfolding lower_le_def Rep_PDUnit by fast |
38 |
||
39 |
lemma PDPlus_lower_mono: "\<lbrakk>s \<le>\<flat> t; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<flat> PDPlus t v" |
|
40 |
unfolding lower_le_def Rep_PDPlus by fast |
|
41 |
||
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
|
42 |
lemma PDPlus_lower_le: "t \<le>\<flat> PDPlus t u" |
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
43 |
unfolding lower_le_def Rep_PDPlus by fast |
25904 | 44 |
|
45 |
lemma lower_le_PDUnit_PDUnit_iff [simp]: |
|
40436 | 46 |
"(PDUnit a \<le>\<flat> PDUnit b) = (a \<sqsubseteq> b)" |
25904 | 47 |
unfolding lower_le_def Rep_PDUnit by fast |
48 |
||
49 |
lemma lower_le_PDUnit_PDPlus_iff: |
|
50 |
"(PDUnit a \<le>\<flat> PDPlus t u) = (PDUnit a \<le>\<flat> t \<or> PDUnit a \<le>\<flat> u)" |
|
51 |
unfolding lower_le_def Rep_PDPlus Rep_PDUnit by fast |
|
52 |
||
53 |
lemma lower_le_PDPlus_iff: "(PDPlus t u \<le>\<flat> v) = (t \<le>\<flat> v \<and> u \<le>\<flat> v)" |
|
54 |
unfolding lower_le_def Rep_PDPlus by fast |
|
55 |
||
56 |
lemma lower_le_induct [induct set: lower_le]: |
|
57 |
assumes le: "t \<le>\<flat> u" |
|
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26407
diff
changeset
|
58 |
assumes 1: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)" |
25904 | 59 |
assumes 2: "\<And>t u a. P (PDUnit a) t \<Longrightarrow> P (PDUnit a) (PDPlus t u)" |
60 |
assumes 3: "\<And>t u v. \<lbrakk>P t v; P u v\<rbrakk> \<Longrightarrow> P (PDPlus t u) v" |
|
61 |
shows "P t u" |
|
81620 | 62 |
using le |
63 |
proof (induct t arbitrary: u rule: pd_basis_induct) |
|
64 |
case (PDUnit a) |
|
65 |
then show ?case |
|
66 |
proof (induct u rule: pd_basis_induct) |
|
67 |
case PDUnit |
|
68 |
then show ?case by (simp add: 1) |
|
69 |
next |
|
70 |
case (PDPlus t u) |
|
71 |
from PDPlus(3) consider (t) "PDUnit a \<le>\<flat> t" | (u) "PDUnit a \<le>\<flat> u" |
|
72 |
by (auto simp: lower_le_PDUnit_PDPlus_iff) |
|
73 |
then show ?case |
|
74 |
proof cases |
|
75 |
case t |
|
76 |
then have "P (PDUnit a) t" by (rule PDPlus(1)) |
|
77 |
then show ?thesis by (rule 2) |
|
78 |
next |
|
79 |
case u |
|
80 |
then have "P (PDUnit a) u" by (rule PDPlus(2)) |
|
81 |
then have "P (PDUnit a) (PDPlus u t)" by (rule 2) |
|
82 |
then show ?thesis by (simp only: PDPlus_commute) |
|
83 |
qed |
|
84 |
qed |
|
85 |
next |
|
86 |
case (PDPlus t t') |
|
87 |
then show ?case by (simp add: lower_le_PDPlus_iff 3) |
|
88 |
qed |
|
25904 | 89 |
|
90 |
||
62175 | 91 |
subsection \<open>Type definition\<close> |
25904 | 92 |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
93 |
typedef 'a::bifinite lower_pd (\<open>(\<open>notation=\<open>postfix lower_pd\<close>\<close>'(_')\<flat>)\<close>) = |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
94 |
"{S::'a pd_basis set. lower_le.ideal S}" |
40888
28cd51cff70c
reformulate lemma preorder.ex_ideal, and use it for typedefs
huffman
parents:
40774
diff
changeset
|
95 |
by (rule lower_le.ex_ideal) |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
96 |
|
41288
a19edebad961
powerdomain theories require class 'bifinite' instead of 'domain'
huffman
parents:
41287
diff
changeset
|
97 |
instantiation lower_pd :: (bifinite) below |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
98 |
begin |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
99 |
|
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
100 |
definition |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
101 |
"x \<sqsubseteq> y \<longleftrightarrow> Rep_lower_pd x \<subseteq> Rep_lower_pd y" |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
102 |
|
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
103 |
instance .. |
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
104 |
end |
25904 | 105 |
|
41288
a19edebad961
powerdomain theories require class 'bifinite' instead of 'domain'
huffman
parents:
41287
diff
changeset
|
106 |
instance lower_pd :: (bifinite) po |
39984 | 107 |
using type_definition_lower_pd below_lower_pd_def |
108 |
by (rule lower_le.typedef_ideal_po) |
|
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
109 |
|
41288
a19edebad961
powerdomain theories require class 'bifinite' instead of 'domain'
huffman
parents:
41287
diff
changeset
|
110 |
instance lower_pd :: (bifinite) cpo |
39984 | 111 |
using type_definition_lower_pd below_lower_pd_def |
112 |
by (rule lower_le.typedef_ideal_cpo) |
|
25904 | 113 |
|
114 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
115 |
lower_principal :: "'a::bifinite pd_basis \<Rightarrow> 'a lower_pd" where |
27373
5794a0e3e26c
remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents:
27310
diff
changeset
|
116 |
"lower_principal t = Abs_lower_pd {u. u \<le>\<flat> t}" |
25904 | 117 |
|
30729
461ee3e49ad3
interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents:
29990
diff
changeset
|
118 |
interpretation lower_pd: |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
119 |
ideal_completion lower_le lower_principal Rep_lower_pd |
39984 | 120 |
using type_definition_lower_pd below_lower_pd_def |
121 |
using lower_principal_def pd_basis_countable |
|
122 |
by (rule lower_le.typedef_ideal_completion) |
|
25904 | 123 |
|
62175 | 124 |
text \<open>Lower powerdomain is pointed\<close> |
25904 | 125 |
|
126 |
lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \<sqsubseteq> ys" |
|
127 |
by (induct ys rule: lower_pd.principal_induct, simp, simp) |
|
128 |
||
41288
a19edebad961
powerdomain theories require class 'bifinite' instead of 'domain'
huffman
parents:
41287
diff
changeset
|
129 |
instance lower_pd :: (bifinite) pcpo |
26927 | 130 |
by intro_classes (fast intro: lower_pd_minimal) |
25904 | 131 |
|
132 |
lemma inst_lower_pd_pcpo: "\<bottom> = lower_principal (PDUnit compact_bot)" |
|
41430
1aa23e9f2c87
change some lemma names containing 'UU' to 'bottom'
huffman
parents:
41402
diff
changeset
|
133 |
by (rule lower_pd_minimal [THEN bottomI, symmetric]) |
25904 | 134 |
|
135 |
||
62175 | 136 |
subsection \<open>Monadic unit and plus\<close> |
25904 | 137 |
|
138 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
139 |
lower_unit :: "'a::bifinite \<rightarrow> 'a lower_pd" where |
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
140 |
"lower_unit = compact_basis.extension (\<lambda>a. lower_principal (PDUnit a))" |
25904 | 141 |
|
142 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
143 |
lower_plus :: "'a::bifinite lower_pd \<rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd" where |
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
144 |
"lower_plus = lower_pd.extension (\<lambda>t. lower_pd.extension (\<lambda>u. |
25904 | 145 |
lower_principal (PDPlus t u)))" |
146 |
||
147 |
abbreviation |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
148 |
lower_add :: "'a::bifinite lower_pd \<Rightarrow> 'a lower_pd \<Rightarrow> 'a lower_pd" |
80914
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
wenzelm
parents:
80786
diff
changeset
|
149 |
(infixl \<open>\<union>\<flat>\<close> 65) where |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
150 |
"xs \<union>\<flat> ys == lower_plus\<cdot>xs\<cdot>ys" |
25904 | 151 |
|
26927 | 152 |
syntax |
81089
8042869c2072
clarified syntax: prefer nonterminal "args", use outer block (with indent);
wenzelm
parents:
80914
diff
changeset
|
153 |
"_lower_pd" :: "args \<Rightarrow> logic" (\<open>(\<open>indent=1 notation=\<open>mixfix lower_pd enumeration\<close>\<close>{_}\<flat>)\<close>) |
26927 | 154 |
translations |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
155 |
"{x,xs}\<flat>" == "{x}\<flat> \<union>\<flat> {xs}\<flat>" |
26927 | 156 |
"{x}\<flat>" == "CONST lower_unit\<cdot>x" |
157 |
||
158 |
lemma lower_unit_Rep_compact_basis [simp]: |
|
159 |
"{Rep_compact_basis a}\<flat> = lower_principal (PDUnit a)" |
|
160 |
unfolding lower_unit_def |
|
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
161 |
by (simp add: compact_basis.extension_principal PDUnit_lower_mono) |
26927 | 162 |
|
25904 | 163 |
lemma lower_plus_principal [simp]: |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
164 |
"lower_principal t \<union>\<flat> lower_principal u = lower_principal (PDPlus t u)" |
25904 | 165 |
unfolding lower_plus_def |
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
166 |
by (simp add: lower_pd.extension_principal |
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
167 |
lower_pd.extension_mono PDPlus_lower_mono) |
25904 | 168 |
|
37770
cddb3106adb8
avoid explicit mandatory prefix markers when prefixes are mandatory implicitly
haftmann
parents:
36635
diff
changeset
|
169 |
interpretation lower_add: semilattice lower_add proof |
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
170 |
fix xs ys zs :: "'a::bifinite lower_pd" |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
171 |
show "(xs \<union>\<flat> ys) \<union>\<flat> zs = xs \<union>\<flat> (ys \<union>\<flat> zs)" |
41402
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
172 |
apply (induct xs rule: lower_pd.principal_induct, simp) |
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
173 |
apply (induct ys rule: lower_pd.principal_induct, simp) |
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
174 |
apply (induct zs rule: lower_pd.principal_induct, simp) |
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
175 |
apply (simp add: PDPlus_assoc) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
176 |
done |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
177 |
show "xs \<union>\<flat> ys = ys \<union>\<flat> xs" |
41402
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
178 |
apply (induct xs rule: lower_pd.principal_induct, simp) |
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
179 |
apply (induct ys rule: lower_pd.principal_induct, simp) |
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
180 |
apply (simp add: PDPlus_commute) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
181 |
done |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
182 |
show "xs \<union>\<flat> xs = xs" |
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
183 |
apply (induct xs rule: lower_pd.principal_induct, simp) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
184 |
apply (simp add: PDPlus_absorb) |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
185 |
done |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
186 |
qed |
26927 | 187 |
|
34973
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
188 |
lemmas lower_plus_assoc = lower_add.assoc |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
189 |
lemmas lower_plus_commute = lower_add.commute |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
190 |
lemmas lower_plus_absorb = lower_add.idem |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
191 |
lemmas lower_plus_left_commute = lower_add.left_commute |
ae634fad947e
dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents:
33808
diff
changeset
|
192 |
lemmas lower_plus_left_absorb = lower_add.left_idem |
26927 | 193 |
|
62175 | 194 |
text \<open>Useful for \<open>simp add: lower_plus_ac\<close>\<close> |
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
195 |
lemmas lower_plus_ac = |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
196 |
lower_plus_assoc lower_plus_commute lower_plus_left_commute |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
197 |
|
62175 | 198 |
text \<open>Useful for \<open>simp only: lower_plus_aci\<close>\<close> |
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
199 |
lemmas lower_plus_aci = |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
200 |
lower_plus_ac lower_plus_absorb lower_plus_left_absorb |
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
201 |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
202 |
lemma lower_plus_below1: "xs \<sqsubseteq> xs \<union>\<flat> ys" |
41402
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
203 |
apply (induct xs rule: lower_pd.principal_induct, simp) |
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
204 |
apply (induct ys rule: lower_pd.principal_induct, simp) |
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
|
205 |
apply (simp add: PDPlus_lower_le) |
25904 | 206 |
done |
207 |
||
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
208 |
lemma lower_plus_below2: "ys \<sqsubseteq> xs \<union>\<flat> ys" |
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
|
209 |
by (subst lower_plus_commute, rule lower_plus_below1) |
25904 | 210 |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
211 |
lemma lower_plus_least: "\<lbrakk>xs \<sqsubseteq> zs; ys \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs \<union>\<flat> ys \<sqsubseteq> zs" |
25904 | 212 |
apply (subst lower_plus_absorb [of zs, symmetric]) |
213 |
apply (erule (1) monofun_cfun [OF monofun_cfun_arg]) |
|
214 |
done |
|
215 |
||
40734 | 216 |
lemma lower_plus_below_iff [simp]: |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
217 |
"xs \<union>\<flat> ys \<sqsubseteq> zs \<longleftrightarrow> xs \<sqsubseteq> zs \<and> ys \<sqsubseteq> zs" |
25904 | 218 |
apply safe |
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
|
219 |
apply (erule below_trans [OF lower_plus_below1]) |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
30729
diff
changeset
|
220 |
apply (erule below_trans [OF lower_plus_below2]) |
25904 | 221 |
apply (erule (1) lower_plus_least) |
222 |
done |
|
223 |
||
40734 | 224 |
lemma lower_unit_below_plus_iff [simp]: |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
225 |
"{x}\<flat> \<sqsubseteq> ys \<union>\<flat> zs \<longleftrightarrow> {x}\<flat> \<sqsubseteq> ys \<or> {x}\<flat> \<sqsubseteq> zs" |
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
226 |
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
|
227 |
apply (induct ys rule: lower_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
228 |
apply (induct zs rule: lower_pd.principal_induct, simp) |
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
229 |
apply (simp add: lower_le_PDUnit_PDPlus_iff) |
25904 | 230 |
done |
231 |
||
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
|
232 |
lemma lower_unit_below_iff [simp]: "{x}\<flat> \<sqsubseteq> {y}\<flat> \<longleftrightarrow> x \<sqsubseteq> y" |
39970
9023b897e67a
simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents:
37770
diff
changeset
|
233 |
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
|
234 |
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
|
235 |
apply simp |
26927 | 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 |
lemmas lower_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
|
239 |
lower_unit_below_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
|
240 |
lower_plus_below_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
|
241 |
lower_unit_below_plus_iff |
25904 | 242 |
|
26927 | 243 |
lemma lower_unit_eq_iff [simp]: "{x}\<flat> = {y}\<flat> \<longleftrightarrow> x = y" |
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
244 |
by (simp add: po_eq_conv) |
26927 | 245 |
|
246 |
lemma lower_unit_strict [simp]: "{\<bottom>}\<flat> = \<bottom>" |
|
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
247 |
using lower_unit_Rep_compact_basis [of compact_bot] |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
248 |
by (simp add: inst_lower_pd_pcpo) |
26927 | 249 |
|
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40002
diff
changeset
|
250 |
lemma lower_unit_bottom_iff [simp]: "{x}\<flat> = \<bottom> \<longleftrightarrow> x = \<bottom>" |
26927 | 251 |
unfolding lower_unit_strict [symmetric] by (rule lower_unit_eq_iff) |
252 |
||
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40002
diff
changeset
|
253 |
lemma lower_plus_bottom_iff [simp]: |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
254 |
"xs \<union>\<flat> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<and> ys = \<bottom>" |
26927 | 255 |
apply safe |
41430
1aa23e9f2c87
change some lemma names containing 'UU' to 'bottom'
huffman
parents:
41402
diff
changeset
|
256 |
apply (rule bottomI, erule subst, rule lower_plus_below1) |
1aa23e9f2c87
change some lemma names containing 'UU' to 'bottom'
huffman
parents:
41402
diff
changeset
|
257 |
apply (rule bottomI, erule subst, rule lower_plus_below2) |
26927 | 258 |
apply (rule lower_plus_absorb) |
259 |
done |
|
260 |
||
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
261 |
lemma lower_plus_strict1 [simp]: "\<bottom> \<union>\<flat> ys = ys" |
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
|
262 |
apply (rule below_antisym [OF _ lower_plus_below2]) |
26927 | 263 |
apply (simp add: lower_plus_least) |
264 |
done |
|
265 |
||
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
266 |
lemma lower_plus_strict2 [simp]: "xs \<union>\<flat> \<bottom> = xs" |
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
|
267 |
apply (rule below_antisym [OF _ lower_plus_below1]) |
26927 | 268 |
apply (simp add: lower_plus_least) |
269 |
done |
|
270 |
||
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
271 |
lemma compact_lower_unit: "compact x \<Longrightarrow> compact {x}\<flat>" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
272 |
by (auto dest!: compact_basis.compact_imp_principal) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
273 |
|
26927 | 274 |
lemma compact_lower_unit_iff [simp]: "compact {x}\<flat> \<longleftrightarrow> compact x" |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
275 |
apply (safe elim!: compact_lower_unit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
276 |
apply (simp only: compact_def lower_unit_below_iff [symmetric]) |
40327 | 277 |
apply (erule adm_subst [OF cont_Rep_cfun2]) |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
278 |
done |
26927 | 279 |
|
280 |
lemma compact_lower_plus [simp]: |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
281 |
"\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs \<union>\<flat> ys)" |
27289 | 282 |
by (auto dest!: lower_pd.compact_imp_principal) |
26927 | 283 |
|
25904 | 284 |
|
62175 | 285 |
subsection \<open>Induction rules\<close> |
25904 | 286 |
|
287 |
lemma lower_pd_induct1: |
|
288 |
assumes P: "adm P" |
|
26927 | 289 |
assumes unit: "\<And>x. P {x}\<flat>" |
81620 | 290 |
assumes insert: "\<And>x ys. \<lbrakk>P {x}\<flat>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<flat> \<union>\<flat> ys)" |
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
291 |
shows "P (xs::'a::bifinite lower_pd)" |
81620 | 292 |
proof (induct xs rule: lower_pd.principal_induct) |
293 |
have *: "P {Rep_compact_basis a}\<flat>" for a |
|
294 |
by (rule unit) |
|
295 |
show "P (lower_principal a)" for a |
|
296 |
proof (induct a rule: pd_basis_induct1) |
|
297 |
case PDUnit |
|
298 |
from * show ?case |
|
299 |
by (simp only: lower_unit_Rep_compact_basis [symmetric]) |
|
300 |
next |
|
301 |
case (PDPlus a t) |
|
302 |
with * have "P ({Rep_compact_basis a}\<flat> \<union>\<flat> lower_principal t)" |
|
303 |
by (rule insert) |
|
304 |
then show ?case |
|
305 |
by (simp only: lower_unit_Rep_compact_basis [symmetric] lower_plus_principal [symmetric]) |
|
306 |
qed |
|
307 |
qed (rule P) |
|
25904 | 308 |
|
81620 | 309 |
lemma lower_pd_induct [case_names adm lower_unit lower_plus, induct type: lower_pd]: |
25904 | 310 |
assumes P: "adm P" |
26927 | 311 |
assumes unit: "\<And>x. P {x}\<flat>" |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
312 |
assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs \<union>\<flat> ys)" |
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
313 |
shows "P (xs::'a::bifinite lower_pd)" |
81620 | 314 |
proof (induct xs rule: lower_pd.principal_induct) |
315 |
show "P (lower_principal a)" for a |
|
316 |
proof (induct a rule: pd_basis_induct) |
|
317 |
case PDUnit |
|
318 |
then show ?case |
|
319 |
by (simp only: lower_unit_Rep_compact_basis [symmetric] unit) |
|
320 |
next |
|
321 |
case PDPlus |
|
322 |
then show ?case |
|
323 |
by (simp only: lower_plus_principal [symmetric] plus) |
|
324 |
qed |
|
325 |
qed (rule P) |
|
25904 | 326 |
|
327 |
||
62175 | 328 |
subsection \<open>Monadic bind\<close> |
25904 | 329 |
|
330 |
definition |
|
331 |
lower_bind_basis :: |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
332 |
"'a::bifinite pd_basis \<Rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b::bifinite lower_pd" where |
25904 | 333 |
"lower_bind_basis = fold_pd |
334 |
(\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a)) |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
335 |
(\<lambda>x y. \<Lambda> f. x\<cdot>f \<union>\<flat> y\<cdot>f)" |
25904 | 336 |
|
26927 | 337 |
lemma ACI_lower_bind: |
51489 | 338 |
"semilattice (\<lambda>x y. \<Lambda> f. x\<cdot>f \<union>\<flat> y\<cdot>f)" |
25904 | 339 |
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
|
340 |
apply (simp add: lower_plus_assoc) |
25904 | 341 |
apply (simp add: lower_plus_commute) |
29990
b11793ea15a3
avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents:
29672
diff
changeset
|
342 |
apply (simp add: eta_cfun) |
25904 | 343 |
done |
344 |
||
345 |
lemma lower_bind_basis_simps [simp]: |
|
346 |
"lower_bind_basis (PDUnit a) = |
|
347 |
(\<Lambda> f. f\<cdot>(Rep_compact_basis a))" |
|
348 |
"lower_bind_basis (PDPlus t u) = |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
349 |
(\<Lambda> f. lower_bind_basis t\<cdot>f \<union>\<flat> lower_bind_basis u\<cdot>f)" |
25904 | 350 |
unfolding lower_bind_basis_def |
351 |
apply - |
|
26927 | 352 |
apply (rule fold_pd_PDUnit [OF ACI_lower_bind]) |
353 |
apply (rule fold_pd_PDPlus [OF ACI_lower_bind]) |
|
25904 | 354 |
done |
355 |
||
356 |
lemma lower_bind_basis_mono: |
|
357 |
"t \<le>\<flat> u \<Longrightarrow> lower_bind_basis t \<sqsubseteq> lower_bind_basis u" |
|
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
|
358 |
unfolding cfun_below_iff |
25904 | 359 |
apply (erule lower_le_induct, safe) |
27289 | 360 |
apply (simp add: monofun_cfun) |
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
|
361 |
apply (simp add: rev_below_trans [OF lower_plus_below1]) |
40734 | 362 |
apply simp |
25904 | 363 |
done |
364 |
||
365 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
366 |
lower_bind :: "'a::bifinite lower_pd \<rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b::bifinite lower_pd" where |
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
367 |
"lower_bind = lower_pd.extension lower_bind_basis" |
25904 | 368 |
|
41036
4acbacd6c5bc
add set-union-like syntax for powerdomain bind operators
huffman
parents:
40888
diff
changeset
|
369 |
syntax |
4acbacd6c5bc
add set-union-like syntax for powerdomain bind operators
huffman
parents:
40888
diff
changeset
|
370 |
"_lower_bind" :: "[logic, logic, logic] \<Rightarrow> logic" |
81095 | 371 |
(\<open>(\<open>indent=3 notation=\<open>binder lower_bind\<close>\<close>\<Union>\<flat>_\<in>_./ _)\<close> [0, 0, 10] 10) |
80768 | 372 |
|
41036
4acbacd6c5bc
add set-union-like syntax for powerdomain bind operators
huffman
parents:
40888
diff
changeset
|
373 |
translations |
4acbacd6c5bc
add set-union-like syntax for powerdomain bind operators
huffman
parents:
40888
diff
changeset
|
374 |
"\<Union>\<flat>x\<in>xs. e" == "CONST lower_bind\<cdot>xs\<cdot>(\<Lambda> x. e)" |
4acbacd6c5bc
add set-union-like syntax for powerdomain bind operators
huffman
parents:
40888
diff
changeset
|
375 |
|
25904 | 376 |
lemma lower_bind_principal [simp]: |
377 |
"lower_bind\<cdot>(lower_principal t) = lower_bind_basis t" |
|
378 |
unfolding lower_bind_def |
|
41394
51c866d1b53b
rename function ideal_completion.basis_fun to ideal_completion.extension
huffman
parents:
41289
diff
changeset
|
379 |
apply (rule lower_pd.extension_principal) |
25904 | 380 |
apply (erule lower_bind_basis_mono) |
381 |
done |
|
382 |
||
383 |
lemma lower_bind_unit [simp]: |
|
26927 | 384 |
"lower_bind\<cdot>{x}\<flat>\<cdot>f = f\<cdot>x" |
27289 | 385 |
by (induct x rule: compact_basis.principal_induct, simp, simp) |
25904 | 386 |
|
387 |
lemma lower_bind_plus [simp]: |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
388 |
"lower_bind\<cdot>(xs \<union>\<flat> ys)\<cdot>f = lower_bind\<cdot>xs\<cdot>f \<union>\<flat> lower_bind\<cdot>ys\<cdot>f" |
41402
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
389 |
by (induct xs rule: lower_pd.principal_induct, simp, |
b647212cee03
remove lemma ideal_completion.principal_induct2, use principal_induct twice instead
huffman
parents:
41399
diff
changeset
|
390 |
induct ys rule: lower_pd.principal_induct, simp, simp) |
25904 | 391 |
|
392 |
lemma lower_bind_strict [simp]: "lower_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>" |
|
393 |
unfolding lower_unit_strict [symmetric] by (rule lower_bind_unit) |
|
394 |
||
40589 | 395 |
lemma lower_bind_bind: |
396 |
"lower_bind\<cdot>(lower_bind\<cdot>xs\<cdot>f)\<cdot>g = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. lower_bind\<cdot>(f\<cdot>x)\<cdot>g)" |
|
397 |
by (induct xs, simp_all) |
|
398 |
||
25904 | 399 |
|
62175 | 400 |
subsection \<open>Map\<close> |
25904 | 401 |
|
402 |
definition |
|
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
403 |
lower_map :: "('a::bifinite \<rightarrow> 'b::bifinite) \<rightarrow> 'a lower_pd \<rightarrow> 'b lower_pd" where |
26927 | 404 |
"lower_map = (\<Lambda> f xs. lower_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<flat>))" |
25904 | 405 |
|
406 |
lemma lower_map_unit [simp]: |
|
26927 | 407 |
"lower_map\<cdot>f\<cdot>{x}\<flat> = {f\<cdot>x}\<flat>" |
25904 | 408 |
unfolding lower_map_def by simp |
409 |
||
410 |
lemma lower_map_plus [simp]: |
|
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
411 |
"lower_map\<cdot>f\<cdot>(xs \<union>\<flat> ys) = lower_map\<cdot>f\<cdot>xs \<union>\<flat> lower_map\<cdot>f\<cdot>ys" |
25904 | 412 |
unfolding lower_map_def by simp |
413 |
||
40577 | 414 |
lemma lower_map_bottom [simp]: "lower_map\<cdot>f\<cdot>\<bottom> = {f\<cdot>\<bottom>}\<flat>" |
415 |
unfolding lower_map_def by simp |
|
416 |
||
25904 | 417 |
lemma lower_map_ident: "lower_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs" |
418 |
by (induct xs rule: lower_pd_induct, simp_all) |
|
419 |
||
33808 | 420 |
lemma lower_map_ID: "lower_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
|
421 |
by (simp add: cfun_eq_iff ID_def lower_map_ident) |
33808 | 422 |
|
25904 | 423 |
lemma lower_map_map: |
424 |
"lower_map\<cdot>f\<cdot>(lower_map\<cdot>g\<cdot>xs) = lower_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs" |
|
425 |
by (induct xs rule: lower_pd_induct, simp_all) |
|
426 |
||
41110 | 427 |
lemma lower_bind_map: |
428 |
"lower_bind\<cdot>(lower_map\<cdot>f\<cdot>xs)\<cdot>g = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. g\<cdot>(f\<cdot>x))" |
|
429 |
by (simp add: lower_map_def lower_bind_bind) |
|
430 |
||
431 |
lemma lower_map_bind: |
|
432 |
"lower_map\<cdot>f\<cdot>(lower_bind\<cdot>xs\<cdot>g) = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. lower_map\<cdot>f\<cdot>(g\<cdot>x))" |
|
433 |
by (simp add: lower_map_def lower_bind_bind) |
|
434 |
||
33585
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
435 |
lemma ep_pair_lower_map: "ep_pair e p \<Longrightarrow> ep_pair (lower_map\<cdot>e) (lower_map\<cdot>p)" |
61169 | 436 |
apply standard |
33585
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
437 |
apply (induct_tac x rule: lower_pd_induct, simp_all add: ep_pair.e_inverse) |
35901
12f09bf2c77f
fix LaTeX overfull hbox warnings in HOLCF document
huffman
parents:
34973
diff
changeset
|
438 |
apply (induct_tac y rule: lower_pd_induct) |
40734 | 439 |
apply (simp_all add: ep_pair.e_p_below monofun_cfun del: lower_plus_below_iff) |
33585
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
440 |
done |
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
441 |
|
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
442 |
lemma deflation_lower_map: "deflation d \<Longrightarrow> deflation (lower_map\<cdot>d)" |
61169 | 443 |
apply standard |
33585
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
444 |
apply (induct_tac x rule: lower_pd_induct, simp_all add: deflation.idem) |
35901
12f09bf2c77f
fix LaTeX overfull hbox warnings in HOLCF document
huffman
parents:
34973
diff
changeset
|
445 |
apply (induct_tac x rule: lower_pd_induct) |
40734 | 446 |
apply (simp_all add: deflation.below monofun_cfun del: lower_plus_below_iff) |
33585
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
447 |
done |
8d39394fe5cf
ep_pair and deflation lemmas for powerdomain map functions
huffman
parents:
31076
diff
changeset
|
448 |
|
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
449 |
(* FIXME: long proof! *) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
450 |
lemma finite_deflation_lower_map: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
451 |
assumes "finite_deflation d" shows "finite_deflation (lower_map\<cdot>d)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
452 |
proof (rule finite_deflation_intro) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
453 |
interpret d: finite_deflation d by fact |
67682
00c436488398
tuned proofs -- prefer explicit names for facts from 'interpret';
wenzelm
parents:
62175
diff
changeset
|
454 |
from d.deflation_axioms show "deflation (lower_map\<cdot>d)" |
00c436488398
tuned proofs -- prefer explicit names for facts from 'interpret';
wenzelm
parents:
62175
diff
changeset
|
455 |
by (rule deflation_lower_map) |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
456 |
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
|
457 |
hence "finite (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
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
|
462 |
hence *: "finite (lower_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
|
463 |
hence "finite (range (\<lambda>xs. lower_map\<cdot>d\<cdot>xs))" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
464 |
apply (rule rev_finite_subset) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
465 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
466 |
apply (induct_tac xs rule: lower_pd.principal_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
467 |
apply (simp add: adm_mem_finite *) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
468 |
apply (rename_tac t, induct_tac t rule: pd_basis_induct) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
469 |
apply (simp only: lower_unit_Rep_compact_basis [symmetric] lower_map_unit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
470 |
apply simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
471 |
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
|
472 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
473 |
apply (rule imageI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
474 |
apply (rule vimageI2) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
475 |
apply (simp add: Rep_PDUnit) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
476 |
apply (rule range_eqI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
477 |
apply (erule sym) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
478 |
apply (rule exI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
479 |
apply (rule Abs_compact_basis_inverse [symmetric]) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
480 |
apply (simp add: d.compact) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
481 |
apply (simp only: lower_plus_principal [symmetric] lower_map_plus) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
482 |
apply clarsimp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
483 |
apply (rule imageI) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
484 |
apply (rule vimageI2) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
485 |
apply (simp add: Rep_PDPlus) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
486 |
done |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
487 |
thus "finite {xs. lower_map\<cdot>d\<cdot>xs = xs}" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
488 |
by (rule finite_range_imp_finite_fixes) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
489 |
qed |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
490 |
|
81577 | 491 |
|
62175 | 492 |
subsection \<open>Lower powerdomain is bifinite\<close> |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
493 |
|
41286
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
494 |
lemma approx_chain_lower_map: |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
495 |
assumes "approx_chain a" |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
496 |
shows "approx_chain (\<lambda>i. lower_map\<cdot>(a i))" |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
497 |
using assms unfolding approx_chain_def |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
498 |
by (simp add: lub_APP lower_map_ID finite_deflation_lower_map) |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
499 |
|
41288
a19edebad961
powerdomain theories require class 'bifinite' instead of 'domain'
huffman
parents:
41287
diff
changeset
|
500 |
instance lower_pd :: (bifinite) bifinite |
41286
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
501 |
proof |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
502 |
show "\<exists>(a::nat \<Rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd). approx_chain a" |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
503 |
using bifinite [where 'a='a] |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
504 |
by (fast intro!: approx_chain_lower_map) |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
505 |
qed |
3d7685a4a5ff
reintroduce 'bifinite' class, now with existentially-quantified approx function (cf. b525988432e9)
huffman
parents:
41284
diff
changeset
|
506 |
|
81577 | 507 |
|
62175 | 508 |
subsection \<open>Join\<close> |
39974
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 |
81583
b6df83045178
clarified default_sort: "cpo" for bootstrap, "domain" for main HOLCF;
wenzelm
parents:
81577
diff
changeset
|
511 |
lower_join :: "'a::bifinite lower_pd lower_pd \<rightarrow> 'a lower_pd" where |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
512 |
"lower_join = (\<Lambda> xss. lower_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 lower_join_unit [simp]: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
515 |
"lower_join\<cdot>{xs}\<flat> = xs" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
516 |
unfolding lower_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 lower_join_plus [simp]: |
41399
ad093e4638e2
changed syntax of powerdomain binary union operators
huffman
parents:
41394
diff
changeset
|
519 |
"lower_join\<cdot>(xss \<union>\<flat> yss) = lower_join\<cdot>xss \<union>\<flat> lower_join\<cdot>yss" |
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
520 |
unfolding lower_join_def by simp |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
521 |
|
40577 | 522 |
lemma lower_join_bottom [simp]: "lower_join\<cdot>\<bottom> = \<bottom>" |
523 |
unfolding lower_join_def by simp |
|
524 |
||
39974
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
525 |
lemma lower_join_map_unit: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
526 |
"lower_join\<cdot>(lower_map\<cdot>lower_unit\<cdot>xs) = xs" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
527 |
by (induct xs rule: lower_pd_induct, simp_all) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
528 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
529 |
lemma lower_join_map_join: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
530 |
"lower_join\<cdot>(lower_map\<cdot>lower_join\<cdot>xsss) = lower_join\<cdot>(lower_join\<cdot>xsss)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
531 |
by (induct xsss rule: lower_pd_induct, simp_all) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
532 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
533 |
lemma lower_join_map_map: |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
534 |
"lower_join\<cdot>(lower_map\<cdot>(lower_map\<cdot>f)\<cdot>xss) = |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
535 |
lower_map\<cdot>f\<cdot>(lower_join\<cdot>xss)" |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
536 |
by (induct xss rule: lower_pd_induct, simp_all) |
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
537 |
|
b525988432e9
major reorganization/simplification of HOLCF type classes:
huffman
parents:
39970
diff
changeset
|
538 |
end |