1 (* Title: HOLCF/Up2.ML |
1 (* Title: HOLCF/Up2.ML |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Franz Regensburger |
3 Author: Franz Regensburger |
4 Copyright 1993 Technische Universitaet Muenchen |
4 Copyright 1993 Technische Universitaet Muenchen |
5 |
5 |
6 Lemmas for up2.thy |
6 Lemmas for Up2.thy |
7 *) |
7 *) |
8 |
8 |
9 open Up2; |
9 open Up2; |
|
10 |
|
11 (* for compatibility with old HOLCF-Version *) |
|
12 qed_goal "inst_up_po" thy "(op <<)=(%x1 x2.case Rep_Up(x1) of \ |
|
13 \ Inl(y1) => True \ |
|
14 \ | Inr(y2) => (case Rep_Up(x2) of Inl(z1) => False \ |
|
15 \ | Inr(z2) => y2<<z2))" |
|
16 (fn prems => |
|
17 [ |
|
18 (fold_goals_tac [po_def,less_up_def]), |
|
19 (rtac refl 1) |
|
20 ]); |
10 |
21 |
11 (* -------------------------------------------------------------------------*) |
22 (* -------------------------------------------------------------------------*) |
12 (* type ('a)u is pointed *) |
23 (* type ('a)u is pointed *) |
13 (* ------------------------------------------------------------------------ *) |
24 (* ------------------------------------------------------------------------ *) |
14 |
25 |
15 qed_goal "minimal_up" Up2.thy "UU_up << z" |
26 qed_goal "minimal_up" thy "Abs_Up(Inl ()) << z" |
16 (fn prems => |
27 (fn prems => |
17 [ |
28 [ |
18 (stac inst_up_po 1), |
29 (simp_tac (!simpset addsimps [po_def,less_up1a]) 1) |
19 (rtac less_up1a 1) |
30 ]); |
|
31 |
|
32 bind_thm ("UU_up_def",minimal_up RS minimal2UU RS sym); |
|
33 |
|
34 qed_goal "least_up" thy "? x::'a u.!y.x<<y" |
|
35 (fn prems => |
|
36 [ |
|
37 (res_inst_tac [("x","Abs_Up(Inl ())")] exI 1), |
|
38 (rtac (minimal_up RS allI) 1) |
20 ]); |
39 ]); |
21 |
40 |
22 (* -------------------------------------------------------------------------*) |
41 (* -------------------------------------------------------------------------*) |
23 (* access to less_up in class po *) |
42 (* access to less_up in class po *) |
24 (* ------------------------------------------------------------------------ *) |
43 (* ------------------------------------------------------------------------ *) |
25 |
44 |
26 qed_goal "less_up2b" Up2.thy "~ Iup(x) << UU_up" |
45 qed_goal "less_up2b" thy "~ Iup(x) << Abs_Up(Inl ())" |
27 (fn prems => |
46 (fn prems => |
28 [ |
47 [ |
29 (stac inst_up_po 1), |
48 (simp_tac (!simpset addsimps [po_def,less_up1b]) 1) |
30 (rtac less_up1b 1) |
|
31 ]); |
49 ]); |
32 |
50 |
33 qed_goal "less_up2c" Up2.thy "(Iup(x)<<Iup(y)) = (x<<y)" |
51 qed_goal "less_up2c" thy "(Iup(x)<<Iup(y)) = (x<<y)" |
34 (fn prems => |
52 (fn prems => |
35 [ |
53 [ |
36 (stac inst_up_po 1), |
54 (simp_tac (!simpset addsimps [po_def,less_up1c]) 1) |
37 (rtac less_up1c 1) |
|
38 ]); |
55 ]); |
39 |
56 |
40 (* ------------------------------------------------------------------------ *) |
57 (* ------------------------------------------------------------------------ *) |
41 (* Iup and Ifup are monotone *) |
58 (* Iup and Ifup are monotone *) |
42 (* ------------------------------------------------------------------------ *) |
59 (* ------------------------------------------------------------------------ *) |
43 |
60 |
44 qed_goalw "monofun_Iup" Up2.thy [monofun] "monofun(Iup)" |
61 qed_goalw "monofun_Iup" thy [monofun] "monofun(Iup)" |
45 (fn prems => |
62 (fn prems => |
46 [ |
63 [ |
47 (strip_tac 1), |
64 (strip_tac 1), |
48 (etac (less_up2c RS iffD2) 1) |
65 (etac (less_up2c RS iffD2) 1) |
49 ]); |
66 ]); |
50 |
67 |
51 qed_goalw "monofun_Ifup1" Up2.thy [monofun] "monofun(Ifup)" |
68 qed_goalw "monofun_Ifup1" thy [monofun] "monofun(Ifup)" |
52 (fn prems => |
69 (fn prems => |
53 [ |
70 [ |
54 (strip_tac 1), |
71 (strip_tac 1), |
55 (rtac (less_fun RS iffD2) 1), |
72 (rtac (less_fun RS iffD2) 1), |
56 (strip_tac 1), |
73 (strip_tac 1), |
58 (asm_simp_tac Up0_ss 1), |
75 (asm_simp_tac Up0_ss 1), |
59 (asm_simp_tac Up0_ss 1), |
76 (asm_simp_tac Up0_ss 1), |
60 (etac monofun_cfun_fun 1) |
77 (etac monofun_cfun_fun 1) |
61 ]); |
78 ]); |
62 |
79 |
63 qed_goalw "monofun_Ifup2" Up2.thy [monofun] "monofun(Ifup(f))" |
80 qed_goalw "monofun_Ifup2" thy [monofun] "monofun(Ifup(f))" |
64 (fn prems => |
81 (fn prems => |
65 [ |
82 [ |
66 (strip_tac 1), |
83 (strip_tac 1), |
67 (res_inst_tac [("p","x")] upE 1), |
84 (res_inst_tac [("p","x")] upE 1), |
68 (asm_simp_tac Up0_ss 1), |
85 (asm_simp_tac Up0_ss 1), |
80 |
97 |
81 (* ------------------------------------------------------------------------ *) |
98 (* ------------------------------------------------------------------------ *) |
82 (* Some kind of surjectivity lemma *) |
99 (* Some kind of surjectivity lemma *) |
83 (* ------------------------------------------------------------------------ *) |
100 (* ------------------------------------------------------------------------ *) |
84 |
101 |
85 |
102 qed_goal "up_lemma1" thy "z=Iup(x) ==> Iup(Ifup(LAM x.x)(z)) = z" |
86 qed_goal "up_lemma1" Up2.thy "z=Iup(x) ==> Iup(Ifup(LAM x.x)(z)) = z" |
|
87 (fn prems => |
103 (fn prems => |
88 [ |
104 [ |
89 (cut_facts_tac prems 1), |
105 (cut_facts_tac prems 1), |
90 (asm_simp_tac Up0_ss 1) |
106 (asm_simp_tac Up0_ss 1) |
91 ]); |
107 ]); |
92 |
108 |
93 (* ------------------------------------------------------------------------ *) |
109 (* ------------------------------------------------------------------------ *) |
94 (* ('a)u is a cpo *) |
110 (* ('a)u is a cpo *) |
95 (* ------------------------------------------------------------------------ *) |
111 (* ------------------------------------------------------------------------ *) |
96 |
112 |
97 qed_goal "lub_up1a" Up2.thy |
113 qed_goal "lub_up1a" thy |
98 "[|is_chain(Y);? i x.Y(i)=Iup(x)|] ==>\ |
114 "[|is_chain(Y);? i x.Y(i)=Iup(x)|] ==>\ |
99 \ range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x.x) (Y(i))))))" |
115 \ range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x.x) (Y(i))))))" |
100 (fn prems => |
116 (fn prems => |
101 [ |
117 [ |
102 (cut_facts_tac prems 1), |
118 (cut_facts_tac prems 1), |
103 (rtac is_lubI 1), |
119 (rtac is_lubI 1), |
104 (rtac conjI 1), |
120 (rtac conjI 1), |
105 (rtac ub_rangeI 1), |
121 (rtac ub_rangeI 1), |
106 (rtac allI 1), |
122 (rtac allI 1), |
107 (res_inst_tac [("p","Y(i)")] upE 1), |
123 (res_inst_tac [("p","Y(i)")] upE 1), |
108 (res_inst_tac [("s","UU_up"),("t","Y(i)")] subst 1), |
124 (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1), |
109 (etac sym 1), |
125 (etac sym 1), |
110 (rtac minimal_up 1), |
126 (rtac minimal_up 1), |
111 (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1), |
127 (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1), |
112 (atac 1), |
128 (atac 1), |
113 (rtac (less_up2c RS iffD2) 1), |
129 (rtac (less_up2c RS iffD2) 1), |
115 (etac (monofun_Ifup2 RS ch2ch_monofun) 1), |
131 (etac (monofun_Ifup2 RS ch2ch_monofun) 1), |
116 (strip_tac 1), |
132 (strip_tac 1), |
117 (res_inst_tac [("p","u")] upE 1), |
133 (res_inst_tac [("p","u")] upE 1), |
118 (etac exE 1), |
134 (etac exE 1), |
119 (etac exE 1), |
135 (etac exE 1), |
120 (res_inst_tac [("P","Y(i)<<UU_up")] notE 1), |
136 (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1), |
121 (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1), |
137 (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1), |
122 (atac 1), |
138 (atac 1), |
123 (rtac less_up2b 1), |
139 (rtac less_up2b 1), |
124 (hyp_subst_tac 1), |
140 (hyp_subst_tac 1), |
125 (etac (ub_rangeE RS spec) 1), |
141 (etac (ub_rangeE RS spec) 1), |
129 (rtac is_lub_thelub 1), |
145 (rtac is_lub_thelub 1), |
130 (etac (monofun_Ifup2 RS ch2ch_monofun) 1), |
146 (etac (monofun_Ifup2 RS ch2ch_monofun) 1), |
131 (etac (monofun_Ifup2 RS ub2ub_monofun) 1) |
147 (etac (monofun_Ifup2 RS ub2ub_monofun) 1) |
132 ]); |
148 ]); |
133 |
149 |
134 qed_goal "lub_up1b" Up2.thy |
150 qed_goal "lub_up1b" thy |
135 "[|is_chain(Y);!i x. Y(i)~=Iup(x)|] ==>\ |
151 "[|is_chain(Y);!i x. Y(i)~=Iup(x)|] ==>\ |
136 \ range(Y) <<| UU_up" |
152 \ range(Y) <<| Abs_Up (Inl ())" |
137 (fn prems => |
153 (fn prems => |
138 [ |
154 [ |
139 (cut_facts_tac prems 1), |
155 (cut_facts_tac prems 1), |
140 (rtac is_lubI 1), |
156 (rtac is_lubI 1), |
141 (rtac conjI 1), |
157 (rtac conjI 1), |
142 (rtac ub_rangeI 1), |
158 (rtac ub_rangeI 1), |
143 (rtac allI 1), |
159 (rtac allI 1), |
144 (res_inst_tac [("p","Y(i)")] upE 1), |
160 (res_inst_tac [("p","Y(i)")] upE 1), |
145 (res_inst_tac [("s","UU_up"),("t","Y(i)")] ssubst 1), |
161 (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1), |
146 (atac 1), |
162 (atac 1), |
147 (rtac refl_less 1), |
163 (rtac refl_less 1), |
148 (rtac notE 1), |
164 (rtac notE 1), |
149 (dtac spec 1), |
165 (dtac spec 1), |
150 (dtac spec 1), |
166 (dtac spec 1), |