5 *) |
5 *) |
6 |
6 |
7 open Cfun3; |
7 open Cfun3; |
8 |
8 |
9 (* for compatibility with old HOLCF-Version *) |
9 (* for compatibility with old HOLCF-Version *) |
10 qed_goal "inst_cfun_pcpo" thy "UU = fabs(%x. UU)" |
10 qed_goal "inst_cfun_pcpo" thy "UU = Abs_CFun(%x. UU)" |
11 (fn prems => |
11 (fn prems => |
12 [ |
12 [ |
13 (simp_tac (HOL_ss addsimps [UU_def,UU_cfun_def]) 1) |
13 (simp_tac (HOL_ss addsimps [UU_def,UU_cfun_def]) 1) |
14 ]); |
14 ]); |
15 |
15 |
16 (* ------------------------------------------------------------------------ *) |
16 (* ------------------------------------------------------------------------ *) |
17 (* the contlub property for fapp its 'first' argument *) |
17 (* the contlub property for Rep_CFun its 'first' argument *) |
18 (* ------------------------------------------------------------------------ *) |
18 (* ------------------------------------------------------------------------ *) |
19 |
19 |
20 qed_goal "contlub_fapp1" thy "contlub(fapp)" |
20 qed_goal "contlub_Rep_CFun1" thy "contlub(Rep_CFun)" |
21 (fn prems => |
21 (fn prems => |
22 [ |
22 [ |
23 (rtac contlubI 1), |
23 (rtac contlubI 1), |
24 (strip_tac 1), |
24 (strip_tac 1), |
25 (rtac (expand_fun_eq RS iffD2) 1), |
25 (rtac (expand_fun_eq RS iffD2) 1), |
27 (stac thelub_cfun 1), |
27 (stac thelub_cfun 1), |
28 (atac 1), |
28 (atac 1), |
29 (stac Cfunapp2 1), |
29 (stac Cfunapp2 1), |
30 (etac cont_lubcfun 1), |
30 (etac cont_lubcfun 1), |
31 (stac thelub_fun 1), |
31 (stac thelub_fun 1), |
32 (etac (monofun_fapp1 RS ch2ch_monofun) 1), |
32 (etac (monofun_Rep_CFun1 RS ch2ch_monofun) 1), |
33 (rtac refl 1) |
33 (rtac refl 1) |
34 ]); |
34 ]); |
35 |
35 |
36 |
36 |
37 (* ------------------------------------------------------------------------ *) |
37 (* ------------------------------------------------------------------------ *) |
38 (* the cont property for fapp in its first argument *) |
38 (* the cont property for Rep_CFun in its first argument *) |
39 (* ------------------------------------------------------------------------ *) |
39 (* ------------------------------------------------------------------------ *) |
40 |
40 |
41 qed_goal "cont_fapp1" thy "cont(fapp)" |
41 qed_goal "cont_Rep_CFun1" thy "cont(Rep_CFun)" |
42 (fn prems => |
42 (fn prems => |
43 [ |
43 [ |
44 (rtac monocontlub2cont 1), |
44 (rtac monocontlub2cont 1), |
45 (rtac monofun_fapp1 1), |
45 (rtac monofun_Rep_CFun1 1), |
46 (rtac contlub_fapp1 1) |
46 (rtac contlub_Rep_CFun1 1) |
47 ]); |
47 ]); |
48 |
48 |
49 |
49 |
50 (* ------------------------------------------------------------------------ *) |
50 (* ------------------------------------------------------------------------ *) |
51 (* contlub, cont properties of fapp in its first argument in mixfix _[_] *) |
51 (* contlub, cont properties of Rep_CFun in its first argument in mixfix _[_] *) |
52 (* ------------------------------------------------------------------------ *) |
52 (* ------------------------------------------------------------------------ *) |
53 |
53 |
54 qed_goal "contlub_cfun_fun" thy |
54 qed_goal "contlub_cfun_fun" thy |
55 "chain(FY) ==>\ |
55 "chain(FY) ==>\ |
56 \ lub(range FY)`x = lub(range (%i. FY(i)`x))" |
56 \ lub(range FY)`x = lub(range (%i. FY(i)`x))" |
57 (fn prems => |
57 (fn prems => |
58 [ |
58 [ |
59 (cut_facts_tac prems 1), |
59 (cut_facts_tac prems 1), |
60 (rtac trans 1), |
60 (rtac trans 1), |
61 (etac (contlub_fapp1 RS contlubE RS spec RS mp RS fun_cong) 1), |
61 (etac (contlub_Rep_CFun1 RS contlubE RS spec RS mp RS fun_cong) 1), |
62 (stac thelub_fun 1), |
62 (stac thelub_fun 1), |
63 (etac (monofun_fapp1 RS ch2ch_monofun) 1), |
63 (etac (monofun_Rep_CFun1 RS ch2ch_monofun) 1), |
64 (rtac refl 1) |
64 (rtac refl 1) |
65 ]); |
65 ]); |
66 |
66 |
67 |
67 |
68 qed_goal "cont_cfun_fun" thy |
68 qed_goal "cont_cfun_fun" thy |
70 \ range(%i. FY(i)`x) <<| lub(range FY)`x" |
70 \ range(%i. FY(i)`x) <<| lub(range FY)`x" |
71 (fn prems => |
71 (fn prems => |
72 [ |
72 [ |
73 (cut_facts_tac prems 1), |
73 (cut_facts_tac prems 1), |
74 (rtac thelubE 1), |
74 (rtac thelubE 1), |
75 (etac ch2ch_fappL 1), |
75 (etac ch2ch_Rep_CFunL 1), |
76 (etac (contlub_cfun_fun RS sym) 1) |
76 (etac (contlub_cfun_fun RS sym) 1) |
77 ]); |
77 ]); |
78 |
78 |
79 |
79 |
80 (* ------------------------------------------------------------------------ *) |
80 (* ------------------------------------------------------------------------ *) |
81 (* contlub, cont properties of fapp in both argument in mixfix _[_] *) |
81 (* contlub, cont properties of Rep_CFun in both argument in mixfix _[_] *) |
82 (* ------------------------------------------------------------------------ *) |
82 (* ------------------------------------------------------------------------ *) |
83 |
83 |
84 qed_goal "contlub_cfun" thy |
84 qed_goal "contlub_cfun" thy |
85 "[|chain(FY);chain(TY)|] ==>\ |
85 "[|chain(FY);chain(TY)|] ==>\ |
86 \ (lub(range FY))`(lub(range TY)) = lub(range(%i. FY(i)`(TY i)))" |
86 \ (lub(range FY))`(lub(range TY)) = lub(range(%i. FY(i)`(TY i)))" |
87 (fn prems => |
87 (fn prems => |
88 [ |
88 [ |
89 (cut_facts_tac prems 1), |
89 (cut_facts_tac prems 1), |
90 (rtac contlub_CF2 1), |
90 (rtac contlub_CF2 1), |
91 (rtac cont_fapp1 1), |
91 (rtac cont_Rep_CFun1 1), |
92 (rtac allI 1), |
92 (rtac allI 1), |
93 (rtac cont_fapp2 1), |
93 (rtac cont_Rep_CFun2 1), |
94 (atac 1), |
94 (atac 1), |
95 (atac 1) |
95 (atac 1) |
96 ]); |
96 ]); |
97 |
97 |
98 qed_goal "cont_cfun" thy |
98 qed_goal "cont_cfun" thy |
100 \ range(%i.(FY i)`(TY i)) <<| (lub (range FY))`(lub(range TY))" |
100 \ range(%i.(FY i)`(TY i)) <<| (lub (range FY))`(lub(range TY))" |
101 (fn prems => |
101 (fn prems => |
102 [ |
102 [ |
103 (cut_facts_tac prems 1), |
103 (cut_facts_tac prems 1), |
104 (rtac thelubE 1), |
104 (rtac thelubE 1), |
105 (rtac (monofun_fapp1 RS ch2ch_MF2LR) 1), |
105 (rtac (monofun_Rep_CFun1 RS ch2ch_MF2LR) 1), |
106 (rtac allI 1), |
106 (rtac allI 1), |
107 (rtac monofun_fapp2 1), |
107 (rtac monofun_Rep_CFun2 1), |
108 (atac 1), |
108 (atac 1), |
109 (atac 1), |
109 (atac 1), |
110 (etac (contlub_cfun RS sym) 1), |
110 (etac (contlub_cfun RS sym) 1), |
111 (atac 1) |
111 (atac 1) |
112 ]); |
112 ]); |
113 |
113 |
114 |
114 |
115 (* ------------------------------------------------------------------------ *) |
115 (* ------------------------------------------------------------------------ *) |
116 (* cont2cont lemma for fapp *) |
116 (* cont2cont lemma for Rep_CFun *) |
117 (* ------------------------------------------------------------------------ *) |
117 (* ------------------------------------------------------------------------ *) |
118 |
118 |
119 qed_goal "cont2cont_fapp" thy |
119 qed_goal "cont2cont_Rep_CFun" thy |
120 "[|cont(%x. ft x);cont(%x. tt x)|] ==> cont(%x. (ft x)`(tt x))" |
120 "[|cont(%x. ft x);cont(%x. tt x)|] ==> cont(%x. (ft x)`(tt x))" |
121 (fn prems => |
121 (fn prems => |
122 [ |
122 [ |
123 (cut_facts_tac prems 1), |
123 (cut_facts_tac prems 1), |
124 (rtac cont2cont_app2 1), |
124 (rtac cont2cont_app2 1), |
125 (rtac cont2cont_app2 1), |
125 (rtac cont2cont_app2 1), |
126 (rtac cont_const 1), |
126 (rtac cont_const 1), |
127 (rtac cont_fapp1 1), |
127 (rtac cont_Rep_CFun1 1), |
128 (atac 1), |
128 (atac 1), |
129 (rtac cont_fapp2 1), |
129 (rtac cont_Rep_CFun2 1), |
130 (atac 1) |
130 (atac 1) |
131 ]); |
131 ]); |
132 |
132 |
133 |
133 |
134 |
134 |
167 (strip_tac 1), |
167 (strip_tac 1), |
168 (stac thelub_cfun 1), |
168 (stac thelub_cfun 1), |
169 (rtac (p1 RS cont2mono_LAM RS ch2ch_monofun) 1), |
169 (rtac (p1 RS cont2mono_LAM RS ch2ch_monofun) 1), |
170 (rtac (p2 RS cont2mono) 1), |
170 (rtac (p2 RS cont2mono) 1), |
171 (atac 1), |
171 (atac 1), |
172 (res_inst_tac [("f","fabs")] arg_cong 1), |
172 (res_inst_tac [("f","Abs_CFun")] arg_cong 1), |
173 (rtac ext 1), |
173 (rtac ext 1), |
174 (stac (p1 RS beta_cfun RS ext) 1), |
174 (stac (p1 RS beta_cfun RS ext) 1), |
175 (etac (p2 RS cont2contlub RS contlubE RS spec RS mp) 1) |
175 (etac (p2 RS cont2contlub RS contlubE RS spec RS mp) 1) |
176 ]); |
176 ]); |
177 |
177 |
178 (* ------------------------------------------------------------------------ *) |
178 (* ------------------------------------------------------------------------ *) |
179 (* cont2cont tactic *) |
179 (* cont2cont tactic *) |
180 (* ------------------------------------------------------------------------ *) |
180 (* ------------------------------------------------------------------------ *) |
181 |
181 |
182 val cont_lemmas1 = [cont_const, cont_id, cont_fapp2, |
182 val cont_lemmas1 = [cont_const, cont_id, cont_Rep_CFun2, |
183 cont2cont_fapp,cont2cont_LAM]; |
183 cont2cont_Rep_CFun,cont2cont_LAM]; |
184 |
184 |
185 Addsimps cont_lemmas1; |
185 Addsimps cont_lemmas1; |
186 |
186 |
187 (* HINT: cont_tac is now installed in simplifier in Lift.ML ! *) |
187 (* HINT: cont_tac is now installed in simplifier in Lift.ML ! *) |
188 |
188 |
191 |
191 |
192 (* ------------------------------------------------------------------------ *) |
192 (* ------------------------------------------------------------------------ *) |
193 (* function application _[_] is strict in its first arguments *) |
193 (* function application _[_] is strict in its first arguments *) |
194 (* ------------------------------------------------------------------------ *) |
194 (* ------------------------------------------------------------------------ *) |
195 |
195 |
196 qed_goal "strict_fapp1" thy "(UU::'a::cpo->'b)`x = (UU::'b)" |
196 qed_goal "strict_Rep_CFun1" thy "(UU::'a::cpo->'b)`x = (UU::'b)" |
197 (fn prems => |
197 (fn prems => |
198 [ |
198 [ |
199 (stac inst_cfun_pcpo 1), |
199 (stac inst_cfun_pcpo 1), |
200 (stac beta_cfun 1), |
200 (stac beta_cfun 1), |
201 (Simp_tac 1), |
201 (Simp_tac 1), |
320 (rtac exI 1), |
320 (rtac exI 1), |
321 (strip_tac 1), |
321 (strip_tac 1), |
322 (rtac (Istrictify2 RS sym) 1), |
322 (rtac (Istrictify2 RS sym) 1), |
323 (fast_tac HOL_cs 1), |
323 (fast_tac HOL_cs 1), |
324 (rtac ch2ch_monofun 1), |
324 (rtac ch2ch_monofun 1), |
325 (rtac monofun_fapp2 1), |
325 (rtac monofun_Rep_CFun2 1), |
326 (atac 1), |
326 (atac 1), |
327 (rtac ch2ch_monofun 1), |
327 (rtac ch2ch_monofun 1), |
328 (rtac monofun_Istrictify2 1), |
328 (rtac monofun_Istrictify2 1), |
329 (atac 1) |
329 (atac 1) |
330 ]); |
330 ]); |
360 |
360 |
361 (* ------------------------------------------------------------------------ *) |
361 (* ------------------------------------------------------------------------ *) |
362 (* Instantiate the simplifier *) |
362 (* Instantiate the simplifier *) |
363 (* ------------------------------------------------------------------------ *) |
363 (* ------------------------------------------------------------------------ *) |
364 |
364 |
365 Addsimps [minimal,refl_less,beta_cfun,strict_fapp1,strictify1, strictify2]; |
365 Addsimps [minimal,refl_less,beta_cfun,strict_Rep_CFun1,strictify1, strictify2]; |
366 |
366 |
367 |
367 |
368 (* ------------------------------------------------------------------------ *) |
368 (* ------------------------------------------------------------------------ *) |
369 (* use cont_tac as autotac. *) |
369 (* use cont_tac as autotac. *) |
370 (* ------------------------------------------------------------------------ *) |
370 (* ------------------------------------------------------------------------ *) |
374 |
374 |
375 (* ------------------------------------------------------------------------ *) |
375 (* ------------------------------------------------------------------------ *) |
376 (* some lemmata for functions with flat/chfin domain/range types *) |
376 (* some lemmata for functions with flat/chfin domain/range types *) |
377 (* ------------------------------------------------------------------------ *) |
377 (* ------------------------------------------------------------------------ *) |
378 |
378 |
379 qed_goal "chfin_fappR" thy |
379 qed_goal "chfin_Rep_CFunR" thy |
380 "chain (Y::nat => 'a::cpo->'b::chfin)==> !s. ? n. lub(range(Y))`s = Y n`s" |
380 "chain (Y::nat => 'a::cpo->'b::chfin)==> !s. ? n. lub(range(Y))`s = Y n`s" |
381 (fn prems => |
381 (fn prems => |
382 [ |
382 [ |
383 cut_facts_tac prems 1, |
383 cut_facts_tac prems 1, |
384 rtac allI 1, |
384 rtac allI 1, |
385 stac contlub_cfun_fun 1, |
385 stac contlub_cfun_fun 1, |
386 atac 1, |
386 atac 1, |
387 fast_tac (HOL_cs addSIs [thelubI,chfin,lub_finch2,chfin2finch,ch2ch_fappL])1 |
387 fast_tac (HOL_cs addSIs [thelubI,chfin,lub_finch2,chfin2finch,ch2ch_Rep_CFunL])1 |
388 ]); |
388 ]); |
389 |
389 |
390 (* ------------------------------------------------------------------------ *) |
390 (* ------------------------------------------------------------------------ *) |
391 (* continuous isomorphisms are strict *) |
391 (* continuous isomorphisms are strict *) |
392 (* a prove for embedding projection pairs is similar *) |
392 (* a prove for embedding projection pairs is similar *) |
449 (rewtac max_in_chain_def), |
449 (rewtac max_in_chain_def), |
450 (strip_tac 1), |
450 (strip_tac 1), |
451 (rtac exE 1), |
451 (rtac exE 1), |
452 (res_inst_tac [("P","chain(%i. g`(Y i))")] mp 1), |
452 (res_inst_tac [("P","chain(%i. g`(Y i))")] mp 1), |
453 (etac spec 1), |
453 (etac spec 1), |
454 (etac ch2ch_fappR 1), |
454 (etac ch2ch_Rep_CFunR 1), |
455 (rtac exI 1), |
455 (rtac exI 1), |
456 (strip_tac 1), |
456 (strip_tac 1), |
457 (res_inst_tac [("s","f`(g`(Y x))"),("t","Y(x)")] subst 1), |
457 (res_inst_tac [("s","f`(g`(Y x))"),("t","Y(x)")] subst 1), |
458 (etac spec 1), |
458 (etac spec 1), |
459 (res_inst_tac [("s","f`(g`(Y j))"),("t","Y(j)")] subst 1), |
459 (res_inst_tac [("s","f`(g`(Y j))"),("t","Y(j)")] subst 1), |