author | wenzelm |
Sat, 27 Nov 2010 14:32:08 +0100 | |
changeset 40742 | dc6439c0b8b1 |
parent 40325 | 24971566ff4f |
child 40770 | 6023808b38d4 |
permissions | -rw-r--r-- |
16697 | 1 |
(* Title: HOLCF/Pcpodef.thy |
2 |
Author: Brian Huffman |
|
3 |
*) |
|
4 |
||
5 |
header {* Subtypes of pcpos *} |
|
6 |
||
7 |
theory Pcpodef |
|
8 |
imports Adm |
|
31738
7b9b9ba532ca
discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents:
31076
diff
changeset
|
9 |
uses ("Tools/pcpodef.ML") |
16697 | 10 |
begin |
11 |
||
12 |
subsection {* Proving a subtype is a partial order *} |
|
13 |
||
14 |
text {* |
|
15 |
A subtype of a partial order is itself a partial order, |
|
16 |
if the ordering is defined in the standard way. |
|
17 |
*} |
|
18 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
19 |
setup {* Sign.add_const_constraint (@{const_name Porder.below}, NONE) *} |
28073 | 20 |
|
16697 | 21 |
theorem typedef_po: |
28073 | 22 |
fixes Abs :: "'a::po \<Rightarrow> 'b::type" |
16697 | 23 |
assumes type: "type_definition Rep Abs A" |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
24 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 25 |
shows "OFCLASS('b, po_class)" |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
26 |
apply (intro_classes, unfold below) |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
27 |
apply (rule below_refl) |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
28 |
apply (erule (1) below_trans) |
26420
57a626f64875
make preorder locale into a superclass of class po
huffman
parents:
26027
diff
changeset
|
29 |
apply (rule type_definition.Rep_inject [OF type, THEN iffD1]) |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
30 |
apply (erule (1) below_antisym) |
16697 | 31 |
done |
32 |
||
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
33 |
setup {* Sign.add_const_constraint (@{const_name Porder.below}, |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
34 |
SOME @{typ "'a::below \<Rightarrow> 'a::below \<Rightarrow> bool"}) *} |
28073 | 35 |
|
25827
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
36 |
subsection {* Proving a subtype is finite *} |
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
37 |
|
27296
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
38 |
lemma typedef_finite_UNIV: |
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
39 |
fixes Abs :: "'a::type \<Rightarrow> 'b::type" |
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
40 |
assumes type: "type_definition Rep Abs A" |
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
41 |
shows "finite A \<Longrightarrow> finite (UNIV :: 'b set)" |
25827
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
42 |
proof - |
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
43 |
assume "finite A" |
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
44 |
hence "finite (Abs ` A)" by (rule finite_imageI) |
27296
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
45 |
thus "finite (UNIV :: 'b set)" |
eec7a1889ca5
moved Abs_image to Typedef.thy; prove finite_UNIV outside the locale
huffman
parents:
26420
diff
changeset
|
46 |
by (simp only: type_definition.Abs_image [OF type]) |
25827
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
47 |
qed |
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
23152
diff
changeset
|
48 |
|
17812 | 49 |
subsection {* Proving a subtype is chain-finite *} |
50 |
||
40035 | 51 |
lemma ch2ch_Rep: |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
52 |
assumes below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
40035 | 53 |
shows "chain S \<Longrightarrow> chain (\<lambda>i. Rep (S i))" |
54 |
unfolding chain_def below . |
|
17812 | 55 |
|
56 |
theorem typedef_chfin: |
|
57 |
fixes Abs :: "'a::chfin \<Rightarrow> 'b::po" |
|
58 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
59 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
17812 | 60 |
shows "OFCLASS('b, chfin_class)" |
25921 | 61 |
apply intro_classes |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
62 |
apply (drule ch2ch_Rep [OF below]) |
25921 | 63 |
apply (drule chfin) |
17812 | 64 |
apply (unfold max_in_chain_def) |
65 |
apply (simp add: type_definition.Rep_inject [OF type]) |
|
66 |
done |
|
67 |
||
16697 | 68 |
subsection {* Proving a subtype is complete *} |
69 |
||
70 |
text {* |
|
71 |
A subtype of a cpo is itself a cpo if the ordering is |
|
72 |
defined in the standard way, and the defining subset |
|
73 |
is closed with respect to limits of chains. A set is |
|
74 |
closed if and only if membership in the set is an |
|
75 |
admissible predicate. |
|
76 |
*} |
|
77 |
||
40035 | 78 |
lemma typedef_is_lubI: |
79 |
assumes below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
|
80 |
shows "range (\<lambda>i. Rep (S i)) <<| Rep x \<Longrightarrow> range S <<| x" |
|
81 |
unfolding is_lub_def is_ub_def below by simp |
|
82 |
||
16918 | 83 |
lemma Abs_inverse_lub_Rep: |
16697 | 84 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::po" |
85 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
86 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 87 |
and adm: "adm (\<lambda>x. x \<in> A)" |
16918 | 88 |
shows "chain S \<Longrightarrow> Rep (Abs (\<Squnion>i. Rep (S i))) = (\<Squnion>i. Rep (S i))" |
89 |
apply (rule type_definition.Abs_inverse [OF type]) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
90 |
apply (erule admD [OF adm ch2ch_Rep [OF below]]) |
16697 | 91 |
apply (rule type_definition.Rep [OF type]) |
92 |
done |
|
93 |
||
16918 | 94 |
theorem typedef_lub: |
16697 | 95 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::po" |
96 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
97 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 98 |
and adm: "adm (\<lambda>x. x \<in> A)" |
16918 | 99 |
shows "chain S \<Longrightarrow> range S <<| Abs (\<Squnion>i. Rep (S i))" |
40035 | 100 |
proof - |
101 |
assume S: "chain S" |
|
102 |
hence "chain (\<lambda>i. Rep (S i))" by (rule ch2ch_Rep [OF below]) |
|
103 |
hence "range (\<lambda>i. Rep (S i)) <<| (\<Squnion>i. Rep (S i))" by (rule cpo_lubI) |
|
104 |
hence "range (\<lambda>i. Rep (S i)) <<| Rep (Abs (\<Squnion>i. Rep (S i)))" |
|
105 |
by (simp only: Abs_inverse_lub_Rep [OF type below adm S]) |
|
106 |
thus "range S <<| Abs (\<Squnion>i. Rep (S i))" |
|
107 |
by (rule typedef_is_lubI [OF below]) |
|
108 |
qed |
|
16697 | 109 |
|
16918 | 110 |
lemmas typedef_thelub = typedef_lub [THEN thelubI, standard] |
111 |
||
16697 | 112 |
theorem typedef_cpo: |
113 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::po" |
|
114 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
115 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 116 |
and adm: "adm (\<lambda>x. x \<in> A)" |
117 |
shows "OFCLASS('b, cpo_class)" |
|
16918 | 118 |
proof |
119 |
fix S::"nat \<Rightarrow> 'b" assume "chain S" |
|
120 |
hence "range S <<| Abs (\<Squnion>i. Rep (S i))" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
121 |
by (rule typedef_lub [OF type below adm]) |
16918 | 122 |
thus "\<exists>x. range S <<| x" .. |
123 |
qed |
|
16697 | 124 |
|
35900
aa5dfb03eb1e
remove LaTeX hyperref warnings by avoiding antiquotations within section headings
huffman
parents:
31738
diff
changeset
|
125 |
subsubsection {* Continuity of \emph{Rep} and \emph{Abs} *} |
16697 | 126 |
|
127 |
text {* For any sub-cpo, the @{term Rep} function is continuous. *} |
|
128 |
||
129 |
theorem typedef_cont_Rep: |
|
130 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::cpo" |
|
131 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
132 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 133 |
and adm: "adm (\<lambda>x. x \<in> A)" |
134 |
shows "cont Rep" |
|
135 |
apply (rule contI) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
136 |
apply (simp only: typedef_thelub [OF type below adm]) |
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
137 |
apply (simp only: Abs_inverse_lub_Rep [OF type below adm]) |
26027 | 138 |
apply (rule cpo_lubI) |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
139 |
apply (erule ch2ch_Rep [OF below]) |
16697 | 140 |
done |
141 |
||
142 |
text {* |
|
143 |
For a sub-cpo, we can make the @{term Abs} function continuous |
|
144 |
only if we restrict its domain to the defining subset by |
|
145 |
composing it with another continuous function. |
|
146 |
*} |
|
147 |
||
148 |
theorem typedef_cont_Abs: |
|
149 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::cpo" |
|
150 |
fixes f :: "'c::cpo \<Rightarrow> 'a::cpo" |
|
151 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
152 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16918 | 153 |
and adm: "adm (\<lambda>x. x \<in> A)" (* not used *) |
16697 | 154 |
and f_in_A: "\<And>x. f x \<in> A" |
40325 | 155 |
shows "cont f \<Longrightarrow> cont (\<lambda>x. Abs (f x))" |
156 |
unfolding cont_def is_lub_def is_ub_def ball_simps below |
|
157 |
by (simp add: type_definition.Abs_inverse [OF type f_in_A]) |
|
16697 | 158 |
|
17833 | 159 |
subsection {* Proving subtype elements are compact *} |
160 |
||
161 |
theorem typedef_compact: |
|
162 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::cpo" |
|
163 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
164 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
17833 | 165 |
and adm: "adm (\<lambda>x. x \<in> A)" |
166 |
shows "compact (Rep k) \<Longrightarrow> compact k" |
|
167 |
proof (unfold compact_def) |
|
168 |
have cont_Rep: "cont Rep" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
169 |
by (rule typedef_cont_Rep [OF type below adm]) |
17833 | 170 |
assume "adm (\<lambda>x. \<not> Rep k \<sqsubseteq> x)" |
171 |
with cont_Rep have "adm (\<lambda>x. \<not> Rep k \<sqsubseteq> Rep x)" by (rule adm_subst) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
172 |
thus "adm (\<lambda>x. \<not> k \<sqsubseteq> x)" by (unfold below) |
17833 | 173 |
qed |
174 |
||
16697 | 175 |
subsection {* Proving a subtype is pointed *} |
176 |
||
177 |
text {* |
|
178 |
A subtype of a cpo has a least element if and only if |
|
179 |
the defining subset has a least element. |
|
180 |
*} |
|
181 |
||
16918 | 182 |
theorem typedef_pcpo_generic: |
16697 | 183 |
fixes Abs :: "'a::cpo \<Rightarrow> 'b::cpo" |
184 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
185 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 186 |
and z_in_A: "z \<in> A" |
187 |
and z_least: "\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x" |
|
188 |
shows "OFCLASS('b, pcpo_class)" |
|
189 |
apply (intro_classes) |
|
190 |
apply (rule_tac x="Abs z" in exI, rule allI) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
191 |
apply (unfold below) |
16697 | 192 |
apply (subst type_definition.Abs_inverse [OF type z_in_A]) |
193 |
apply (rule z_least [OF type_definition.Rep [OF type]]) |
|
194 |
done |
|
195 |
||
196 |
text {* |
|
197 |
As a special case, a subtype of a pcpo has a least element |
|
198 |
if the defining subset contains @{term \<bottom>}. |
|
199 |
*} |
|
200 |
||
16918 | 201 |
theorem typedef_pcpo: |
16697 | 202 |
fixes Abs :: "'a::pcpo \<Rightarrow> 'b::cpo" |
203 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
204 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 205 |
and UU_in_A: "\<bottom> \<in> A" |
206 |
shows "OFCLASS('b, pcpo_class)" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
207 |
by (rule typedef_pcpo_generic [OF type below UU_in_A], rule minimal) |
16697 | 208 |
|
35900
aa5dfb03eb1e
remove LaTeX hyperref warnings by avoiding antiquotations within section headings
huffman
parents:
31738
diff
changeset
|
209 |
subsubsection {* Strictness of \emph{Rep} and \emph{Abs} *} |
16697 | 210 |
|
211 |
text {* |
|
212 |
For a sub-pcpo where @{term \<bottom>} is a member of the defining |
|
213 |
subset, @{term Rep} and @{term Abs} are both strict. |
|
214 |
*} |
|
215 |
||
216 |
theorem typedef_Abs_strict: |
|
217 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
218 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 219 |
and UU_in_A: "\<bottom> \<in> A" |
220 |
shows "Abs \<bottom> = \<bottom>" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
221 |
apply (rule UU_I, unfold below) |
16697 | 222 |
apply (simp add: type_definition.Abs_inverse [OF type UU_in_A]) |
223 |
done |
|
224 |
||
225 |
theorem typedef_Rep_strict: |
|
226 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
227 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 228 |
and UU_in_A: "\<bottom> \<in> A" |
229 |
shows "Rep \<bottom> = \<bottom>" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
230 |
apply (rule typedef_Abs_strict [OF type below UU_in_A, THEN subst]) |
16697 | 231 |
apply (rule type_definition.Abs_inverse [OF type UU_in_A]) |
232 |
done |
|
233 |
||
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40089
diff
changeset
|
234 |
theorem typedef_Abs_bottom_iff: |
25926 | 235 |
assumes type: "type_definition Rep Abs A" |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
236 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
25926 | 237 |
and UU_in_A: "\<bottom> \<in> A" |
238 |
shows "x \<in> A \<Longrightarrow> (Abs x = \<bottom>) = (x = \<bottom>)" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
239 |
apply (rule typedef_Abs_strict [OF type below UU_in_A, THEN subst]) |
25926 | 240 |
apply (simp add: type_definition.Abs_inject [OF type] UU_in_A) |
241 |
done |
|
242 |
||
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40089
diff
changeset
|
243 |
theorem typedef_Rep_bottom_iff: |
25926 | 244 |
assumes type: "type_definition Rep Abs A" |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
245 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
25926 | 246 |
and UU_in_A: "\<bottom> \<in> A" |
247 |
shows "(Rep x = \<bottom>) = (x = \<bottom>)" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
248 |
apply (rule typedef_Rep_strict [OF type below UU_in_A, THEN subst]) |
25926 | 249 |
apply (simp add: type_definition.Rep_inject [OF type]) |
250 |
done |
|
251 |
||
16697 | 252 |
theorem typedef_Abs_defined: |
253 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
254 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 255 |
and UU_in_A: "\<bottom> \<in> A" |
256 |
shows "\<lbrakk>x \<noteq> \<bottom>; x \<in> A\<rbrakk> \<Longrightarrow> Abs x \<noteq> \<bottom>" |
|
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40089
diff
changeset
|
257 |
by (simp add: typedef_Abs_bottom_iff [OF type below UU_in_A]) |
16697 | 258 |
|
259 |
theorem typedef_Rep_defined: |
|
260 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
261 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
16697 | 262 |
and UU_in_A: "\<bottom> \<in> A" |
263 |
shows "x \<noteq> \<bottom> \<Longrightarrow> Rep x \<noteq> \<bottom>" |
|
40321
d065b195ec89
rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents:
40089
diff
changeset
|
264 |
by (simp add: typedef_Rep_bottom_iff [OF type below UU_in_A]) |
16697 | 265 |
|
19519 | 266 |
subsection {* Proving a subtype is flat *} |
267 |
||
268 |
theorem typedef_flat: |
|
269 |
fixes Abs :: "'a::flat \<Rightarrow> 'b::pcpo" |
|
270 |
assumes type: "type_definition Rep Abs A" |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
271 |
and below: "op \<sqsubseteq> \<equiv> \<lambda>x y. Rep x \<sqsubseteq> Rep y" |
19519 | 272 |
and UU_in_A: "\<bottom> \<in> A" |
273 |
shows "OFCLASS('b, flat_class)" |
|
274 |
apply (intro_classes) |
|
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
275 |
apply (unfold below) |
19519 | 276 |
apply (simp add: type_definition.Rep_inject [OF type, symmetric]) |
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents:
29138
diff
changeset
|
277 |
apply (simp add: typedef_Rep_strict [OF type below UU_in_A]) |
19519 | 278 |
apply (simp add: ax_flat) |
279 |
done |
|
280 |
||
16697 | 281 |
subsection {* HOLCF type definition package *} |
282 |
||
31738
7b9b9ba532ca
discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents:
31076
diff
changeset
|
283 |
use "Tools/pcpodef.ML" |
16697 | 284 |
|
285 |
end |