equal
deleted
inserted
replaced
15 |
15 |
16 subsection {* Definition of new type for lifting *} |
16 subsection {* Definition of new type for lifting *} |
17 |
17 |
18 datatype 'a u = Ibottom | Iup 'a |
18 datatype 'a u = Ibottom | Iup 'a |
19 |
19 |
|
20 syntax (xsymbols) |
|
21 "u" :: "type \<Rightarrow> type" ("(_\<^sub>\<bottom>)" [1000] 999) |
|
22 |
20 consts |
23 consts |
21 Ifup :: "('a \<rightarrow> 'b::pcpo) \<Rightarrow> 'a u \<Rightarrow> 'b" |
24 Ifup :: "('a \<rightarrow> 'b::pcpo) \<Rightarrow> 'a u \<Rightarrow> 'b" |
22 |
25 |
23 primrec |
26 primrec |
24 "Ifup f Ibottom = \<bottom>" |
27 "Ifup f Ibottom = \<bottom>" |
25 "Ifup f (Iup x) = f\<cdot>x" |
28 "Ifup f (Iup x) = f\<cdot>x" |
26 |
29 |
27 subsection {* Ordering on type @{typ "'a u"} *} |
30 subsection {* Ordering on lifted cpo *} |
28 |
31 |
29 instance u :: (sq_ord) sq_ord .. |
32 instance u :: (sq_ord) sq_ord .. |
30 |
33 |
31 defs (overloaded) |
34 defs (overloaded) |
32 less_up_def: |
35 less_up_def: |
40 by (simp add: less_up_def) |
43 by (simp add: less_up_def) |
41 |
44 |
42 lemma Iup_less [iff]: "(Iup x \<sqsubseteq> Iup y) = (x \<sqsubseteq> y)" |
45 lemma Iup_less [iff]: "(Iup x \<sqsubseteq> Iup y) = (x \<sqsubseteq> y)" |
43 by (simp add: less_up_def) |
46 by (simp add: less_up_def) |
44 |
47 |
45 subsection {* Type @{typ "'a u"} is a partial order *} |
48 subsection {* Lifted cpo is a partial order *} |
46 |
49 |
47 lemma refl_less_up: "(x::'a u) \<sqsubseteq> x" |
50 lemma refl_less_up: "(x::'a u) \<sqsubseteq> x" |
48 by (simp add: less_up_def split: u.split) |
51 by (simp add: less_up_def split: u.split) |
49 |
52 |
50 lemma antisym_less_up: "\<lbrakk>(x::'a u) \<sqsubseteq> y; y \<sqsubseteq> x\<rbrakk> \<Longrightarrow> x = y" |
53 lemma antisym_less_up: "\<lbrakk>(x::'a u) \<sqsubseteq> y; y \<sqsubseteq> x\<rbrakk> \<Longrightarrow> x = y" |
59 |
62 |
60 instance u :: (cpo) po |
63 instance u :: (cpo) po |
61 by intro_classes |
64 by intro_classes |
62 (assumption | rule refl_less_up antisym_less_up trans_less_up)+ |
65 (assumption | rule refl_less_up antisym_less_up trans_less_up)+ |
63 |
66 |
64 subsection {* Type @{typ "'a u"} is a cpo *} |
67 subsection {* Lifted cpo is a cpo *} |
65 |
68 |
66 lemma is_lub_Iup: |
69 lemma is_lub_Iup: |
67 "range S <<| x \<Longrightarrow> range (\<lambda>i. Iup (S i)) <<| Iup x" |
70 "range S <<| x \<Longrightarrow> range (\<lambda>i. Iup (S i)) <<| Iup x" |
68 apply (rule is_lubI) |
71 apply (rule is_lubI) |
69 apply (rule ub_rangeI) |
72 apply (rule ub_rangeI) |
145 done |
148 done |
146 |
149 |
147 instance u :: (cpo) cpo |
150 instance u :: (cpo) cpo |
148 by intro_classes (rule cpo_up) |
151 by intro_classes (rule cpo_up) |
149 |
152 |
150 subsection {* Type @{typ "'a u"} is pointed *} |
153 subsection {* Lifted cpo is pointed *} |
151 |
154 |
152 lemma least_up: "\<exists>x::'a u. \<forall>y. x \<sqsubseteq> y" |
155 lemma least_up: "\<exists>x::'a u. \<forall>y. x \<sqsubseteq> y" |
153 apply (rule_tac x = "Ibottom" in exI) |
156 apply (rule_tac x = "Ibottom" in exI) |
154 apply (rule minimal_up [THEN allI]) |
157 apply (rule minimal_up [THEN allI]) |
155 done |
158 done |