18 |
18 |
19 instance "**" :: ("{finite_po,pcpo}", "{finite_po,pcpo}") finite_po |
19 instance "**" :: ("{finite_po,pcpo}", "{finite_po,pcpo}") finite_po |
20 by (rule typedef_finite_po [OF type_definition_Sprod]) |
20 by (rule typedef_finite_po [OF type_definition_Sprod]) |
21 |
21 |
22 instance "**" :: ("{chfin,pcpo}", "{chfin,pcpo}") chfin |
22 instance "**" :: ("{chfin,pcpo}", "{chfin,pcpo}") chfin |
23 by (rule typedef_chfin [OF type_definition_Sprod less_Sprod_def]) |
23 by (rule typedef_chfin [OF type_definition_Sprod below_Sprod_def]) |
24 |
24 |
25 syntax (xsymbols) |
25 syntax (xsymbols) |
26 "**" :: "[type, type] => type" ("(_ \<otimes>/ _)" [21,20] 20) |
26 "**" :: "[type, type] => type" ("(_ \<otimes>/ _)" [21,20] 20) |
27 syntax (HTML output) |
27 syntax (HTML output) |
28 "**" :: "[type, type] => type" ("(_ \<otimes>/ _)" [21,20] 20) |
28 "**" :: "[type, type] => type" ("(_ \<otimes>/ _)" [21,20] 20) |
65 "Rep_Sprod (:a, b:) = <strictify\<cdot>(\<Lambda> b. a)\<cdot>b, strictify\<cdot>(\<Lambda> a. b)\<cdot>a>" |
65 "Rep_Sprod (:a, b:) = <strictify\<cdot>(\<Lambda> b. a)\<cdot>b, strictify\<cdot>(\<Lambda> a. b)\<cdot>a>" |
66 unfolding spair_def |
66 unfolding spair_def |
67 by (simp add: cont_Abs_Sprod Abs_Sprod_inverse spair_lemma) |
67 by (simp add: cont_Abs_Sprod Abs_Sprod_inverse spair_lemma) |
68 |
68 |
69 lemmas Rep_Sprod_simps = |
69 lemmas Rep_Sprod_simps = |
70 Rep_Sprod_inject [symmetric] less_Sprod_def |
70 Rep_Sprod_inject [symmetric] below_Sprod_def |
71 Rep_Sprod_strict Rep_Sprod_spair |
71 Rep_Sprod_strict Rep_Sprod_spair |
72 |
72 |
73 lemma Exh_Sprod: |
73 lemma Exh_Sprod: |
74 "z = \<bottom> \<or> (\<exists>a b. z = (:a, b:) \<and> a \<noteq> \<bottom> \<and> b \<noteq> \<bottom>)" |
74 "z = \<bottom> \<or> (\<exists>a b. z = (:a, b:) \<and> a \<noteq> \<bottom> \<and> b \<noteq> \<bottom>)" |
75 apply (insert Rep_Sprod [of z]) |
75 apply (insert Rep_Sprod [of z]) |
97 by (simp add: Rep_Sprod_simps strictify_conv_if) |
97 by (simp add: Rep_Sprod_simps strictify_conv_if) |
98 |
98 |
99 lemma spair_strict_iff [simp]: "((:x, y:) = \<bottom>) = (x = \<bottom> \<or> y = \<bottom>)" |
99 lemma spair_strict_iff [simp]: "((:x, y:) = \<bottom>) = (x = \<bottom> \<or> y = \<bottom>)" |
100 by (simp add: Rep_Sprod_simps strictify_conv_if) |
100 by (simp add: Rep_Sprod_simps strictify_conv_if) |
101 |
101 |
102 lemma spair_less_iff: |
102 lemma spair_below_iff: |
103 "((:a, b:) \<sqsubseteq> (:c, d:)) = (a = \<bottom> \<or> b = \<bottom> \<or> (a \<sqsubseteq> c \<and> b \<sqsubseteq> d))" |
103 "((:a, b:) \<sqsubseteq> (:c, d:)) = (a = \<bottom> \<or> b = \<bottom> \<or> (a \<sqsubseteq> c \<and> b \<sqsubseteq> d))" |
104 by (simp add: Rep_Sprod_simps strictify_conv_if) |
104 by (simp add: Rep_Sprod_simps strictify_conv_if) |
105 |
105 |
106 lemma spair_eq_iff: |
106 lemma spair_eq_iff: |
107 "((:a, b:) = (:c, d:)) = |
107 "((:a, b:) = (:c, d:)) = |
158 by simp |
158 by simp |
159 |
159 |
160 lemma surjective_pairing_Sprod2: "(:sfst\<cdot>p, ssnd\<cdot>p:) = p" |
160 lemma surjective_pairing_Sprod2: "(:sfst\<cdot>p, ssnd\<cdot>p:) = p" |
161 by (cases p, simp_all) |
161 by (cases p, simp_all) |
162 |
162 |
163 lemma less_sprod: "x \<sqsubseteq> y = (sfst\<cdot>x \<sqsubseteq> sfst\<cdot>y \<and> ssnd\<cdot>x \<sqsubseteq> ssnd\<cdot>y)" |
163 lemma below_sprod: "x \<sqsubseteq> y = (sfst\<cdot>x \<sqsubseteq> sfst\<cdot>y \<and> ssnd\<cdot>x \<sqsubseteq> ssnd\<cdot>y)" |
164 apply (simp add: less_Sprod_def sfst_def ssnd_def cont_Rep_Sprod) |
164 apply (simp add: below_Sprod_def sfst_def ssnd_def cont_Rep_Sprod) |
165 apply (rule less_cprod) |
165 apply (rule below_cprod) |
166 done |
166 done |
167 |
167 |
168 lemma eq_sprod: "(x = y) = (sfst\<cdot>x = sfst\<cdot>y \<and> ssnd\<cdot>x = ssnd\<cdot>y)" |
168 lemma eq_sprod: "(x = y) = (sfst\<cdot>x = sfst\<cdot>y \<and> ssnd\<cdot>x = ssnd\<cdot>y)" |
169 by (auto simp add: po_eq_conv less_sprod) |
169 by (auto simp add: po_eq_conv below_sprod) |
170 |
170 |
171 lemma spair_less: |
171 lemma spair_below: |
172 "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<sqsubseteq> (:a, b:) = (x \<sqsubseteq> a \<and> y \<sqsubseteq> b)" |
172 "\<lbrakk>x \<noteq> \<bottom>; y \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> (:x, y:) \<sqsubseteq> (:a, b:) = (x \<sqsubseteq> a \<and> y \<sqsubseteq> b)" |
173 apply (cases "a = \<bottom>", simp) |
173 apply (cases "a = \<bottom>", simp) |
174 apply (cases "b = \<bottom>", simp) |
174 apply (cases "b = \<bottom>", simp) |
175 apply (simp add: less_sprod) |
175 apply (simp add: below_sprod) |
176 done |
176 done |
177 |
177 |
178 lemma sfst_less_iff: "sfst\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:y, ssnd\<cdot>x:)" |
178 lemma sfst_below_iff: "sfst\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:y, ssnd\<cdot>x:)" |
179 apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) |
179 apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) |
180 apply (simp add: less_sprod) |
180 apply (simp add: below_sprod) |
181 done |
181 done |
182 |
182 |
183 lemma ssnd_less_iff: "ssnd\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:sfst\<cdot>x, y:)" |
183 lemma ssnd_below_iff: "ssnd\<cdot>x \<sqsubseteq> y = x \<sqsubseteq> (:sfst\<cdot>x, y:)" |
184 apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) |
184 apply (cases "x = \<bottom>", simp, cases "y = \<bottom>", simp) |
185 apply (simp add: less_sprod) |
185 apply (simp add: below_sprod) |
186 done |
186 done |
187 |
187 |
188 subsection {* Compactness *} |
188 subsection {* Compactness *} |
189 |
189 |
190 lemma compact_sfst: "compact x \<Longrightarrow> compact (sfst\<cdot>x)" |
190 lemma compact_sfst: "compact x \<Longrightarrow> compact (sfst\<cdot>x)" |
191 by (rule compactI, simp add: sfst_less_iff) |
191 by (rule compactI, simp add: sfst_below_iff) |
192 |
192 |
193 lemma compact_ssnd: "compact x \<Longrightarrow> compact (ssnd\<cdot>x)" |
193 lemma compact_ssnd: "compact x \<Longrightarrow> compact (ssnd\<cdot>x)" |
194 by (rule compactI, simp add: ssnd_less_iff) |
194 by (rule compactI, simp add: ssnd_below_iff) |
195 |
195 |
196 lemma compact_spair: "\<lbrakk>compact x; compact y\<rbrakk> \<Longrightarrow> compact (:x, y:)" |
196 lemma compact_spair: "\<lbrakk>compact x; compact y\<rbrakk> \<Longrightarrow> compact (:x, y:)" |
197 by (rule compact_Sprod, simp add: Rep_Sprod_spair strictify_conv_if) |
197 by (rule compact_Sprod, simp add: Rep_Sprod_spair strictify_conv_if) |
198 |
198 |
199 lemma compact_spair_iff: |
199 lemma compact_spair_iff: |