6 Lemmas for cprod2.thy |
6 Lemmas for cprod2.thy |
7 *) |
7 *) |
8 |
8 |
9 open Cprod2; |
9 open Cprod2; |
10 |
10 |
11 val less_cprod3a = prove_goal Cprod2.thy |
11 qed_goal "less_cprod3a" Cprod2.thy |
12 "p1=<UU,UU> ==> p1 << p2" |
12 "p1=<UU,UU> ==> p1 << p2" |
13 (fn prems => |
13 (fn prems => |
14 [ |
14 [ |
15 (cut_facts_tac prems 1), |
15 (cut_facts_tac prems 1), |
16 (rtac (inst_cprod_po RS ssubst) 1), |
16 (rtac (inst_cprod_po RS ssubst) 1), |
20 (rtac conjI 1), |
20 (rtac conjI 1), |
21 (rtac minimal 1), |
21 (rtac minimal 1), |
22 (rtac minimal 1) |
22 (rtac minimal 1) |
23 ]); |
23 ]); |
24 |
24 |
25 val less_cprod3b = prove_goal Cprod2.thy |
25 qed_goal "less_cprod3b" Cprod2.thy |
26 "(p1 << p2) = (fst(p1)<<fst(p2) & snd(p1)<<snd(p2))" |
26 "(p1 << p2) = (fst(p1)<<fst(p2) & snd(p1)<<snd(p2))" |
27 (fn prems => |
27 (fn prems => |
28 [ |
28 [ |
29 (rtac (inst_cprod_po RS ssubst) 1), |
29 (rtac (inst_cprod_po RS ssubst) 1), |
30 (rtac less_cprod1b 1) |
30 (rtac less_cprod1b 1) |
31 ]); |
31 ]); |
32 |
32 |
33 val less_cprod4a = prove_goal Cprod2.thy |
33 qed_goal "less_cprod4a" Cprod2.thy |
34 "<x1,x2> << <UU,UU> ==> x1=UU & x2=UU" |
34 "<x1,x2> << <UU,UU> ==> x1=UU & x2=UU" |
35 (fn prems => |
35 (fn prems => |
36 [ |
36 [ |
37 (cut_facts_tac prems 1), |
37 (cut_facts_tac prems 1), |
38 (rtac less_cprod2a 1), |
38 (rtac less_cprod2a 1), |
39 (etac (inst_cprod_po RS subst) 1) |
39 (etac (inst_cprod_po RS subst) 1) |
40 ]); |
40 ]); |
41 |
41 |
42 val less_cprod4b = prove_goal Cprod2.thy |
42 qed_goal "less_cprod4b" Cprod2.thy |
43 "p << <UU,UU> ==> p = <UU,UU>" |
43 "p << <UU,UU> ==> p = <UU,UU>" |
44 (fn prems => |
44 (fn prems => |
45 [ |
45 [ |
46 (cut_facts_tac prems 1), |
46 (cut_facts_tac prems 1), |
47 (rtac less_cprod2b 1), |
47 (rtac less_cprod2b 1), |
48 (etac (inst_cprod_po RS subst) 1) |
48 (etac (inst_cprod_po RS subst) 1) |
49 ]); |
49 ]); |
50 |
50 |
51 val less_cprod4c = prove_goal Cprod2.thy |
51 qed_goal "less_cprod4c" Cprod2.thy |
52 " <xa,ya> << <x,y> ==> xa<<x & ya << y" |
52 " <xa,ya> << <x,y> ==> xa<<x & ya << y" |
53 (fn prems => |
53 (fn prems => |
54 [ |
54 [ |
55 (cut_facts_tac prems 1), |
55 (cut_facts_tac prems 1), |
56 (rtac less_cprod2c 1), |
56 (rtac less_cprod2c 1), |
60 |
60 |
61 (* ------------------------------------------------------------------------ *) |
61 (* ------------------------------------------------------------------------ *) |
62 (* type cprod is pointed *) |
62 (* type cprod is pointed *) |
63 (* ------------------------------------------------------------------------ *) |
63 (* ------------------------------------------------------------------------ *) |
64 |
64 |
65 val minimal_cprod = prove_goal Cprod2.thy "<UU,UU><<p" |
65 qed_goal "minimal_cprod" Cprod2.thy "<UU,UU><<p" |
66 (fn prems => |
66 (fn prems => |
67 [ |
67 [ |
68 (rtac less_cprod3a 1), |
68 (rtac less_cprod3a 1), |
69 (rtac refl 1) |
69 (rtac refl 1) |
70 ]); |
70 ]); |
71 |
71 |
72 (* ------------------------------------------------------------------------ *) |
72 (* ------------------------------------------------------------------------ *) |
73 (* Pair <_,_> is monotone in both arguments *) |
73 (* Pair <_,_> is monotone in both arguments *) |
74 (* ------------------------------------------------------------------------ *) |
74 (* ------------------------------------------------------------------------ *) |
75 |
75 |
76 val monofun_pair1 = prove_goalw Cprod2.thy [monofun] "monofun(Pair)" |
76 qed_goalw "monofun_pair1" Cprod2.thy [monofun] "monofun(Pair)" |
77 (fn prems => |
77 (fn prems => |
78 [ |
78 [ |
79 (strip_tac 1), |
79 (strip_tac 1), |
80 (rtac (less_fun RS iffD2) 1), |
80 (rtac (less_fun RS iffD2) 1), |
81 (strip_tac 1), |
81 (strip_tac 1), |
82 (rtac (less_cprod3b RS iffD2) 1), |
82 (rtac (less_cprod3b RS iffD2) 1), |
83 (simp_tac pair_ss 1), |
83 (simp_tac pair_ss 1), |
84 (asm_simp_tac Cfun_ss 1) |
84 (asm_simp_tac Cfun_ss 1) |
85 ]); |
85 ]); |
86 |
86 |
87 val monofun_pair2 = prove_goalw Cprod2.thy [monofun] "monofun(Pair(x))" |
87 qed_goalw "monofun_pair2" Cprod2.thy [monofun] "monofun(Pair(x))" |
88 (fn prems => |
88 (fn prems => |
89 [ |
89 [ |
90 (strip_tac 1), |
90 (strip_tac 1), |
91 (rtac (less_cprod3b RS iffD2) 1), |
91 (rtac (less_cprod3b RS iffD2) 1), |
92 (simp_tac pair_ss 1), |
92 (simp_tac pair_ss 1), |
93 (asm_simp_tac Cfun_ss 1) |
93 (asm_simp_tac Cfun_ss 1) |
94 ]); |
94 ]); |
95 |
95 |
96 val monofun_pair = prove_goal Cprod2.thy |
96 qed_goal "monofun_pair" Cprod2.thy |
97 "[|x1<<x2; y1<<y2|] ==> <x1,y1> << <x2,y2>" |
97 "[|x1<<x2; y1<<y2|] ==> <x1,y1> << <x2,y2>" |
98 (fn prems => |
98 (fn prems => |
99 [ |
99 [ |
100 (cut_facts_tac prems 1), |
100 (cut_facts_tac prems 1), |
101 (rtac trans_less 1), |
101 (rtac trans_less 1), |
108 |
108 |
109 (* ------------------------------------------------------------------------ *) |
109 (* ------------------------------------------------------------------------ *) |
110 (* fst and snd are monotone *) |
110 (* fst and snd are monotone *) |
111 (* ------------------------------------------------------------------------ *) |
111 (* ------------------------------------------------------------------------ *) |
112 |
112 |
113 val monofun_fst = prove_goalw Cprod2.thy [monofun] "monofun(fst)" |
113 qed_goalw "monofun_fst" Cprod2.thy [monofun] "monofun(fst)" |
114 (fn prems => |
114 (fn prems => |
115 [ |
115 [ |
116 (strip_tac 1), |
116 (strip_tac 1), |
117 (res_inst_tac [("p","x")] PairE 1), |
117 (res_inst_tac [("p","x")] PairE 1), |
118 (hyp_subst_tac 1), |
118 (hyp_subst_tac 1), |
120 (hyp_subst_tac 1), |
120 (hyp_subst_tac 1), |
121 (asm_simp_tac pair_ss 1), |
121 (asm_simp_tac pair_ss 1), |
122 (etac (less_cprod4c RS conjunct1) 1) |
122 (etac (less_cprod4c RS conjunct1) 1) |
123 ]); |
123 ]); |
124 |
124 |
125 val monofun_snd = prove_goalw Cprod2.thy [monofun] "monofun(snd)" |
125 qed_goalw "monofun_snd" Cprod2.thy [monofun] "monofun(snd)" |
126 (fn prems => |
126 (fn prems => |
127 [ |
127 [ |
128 (strip_tac 1), |
128 (strip_tac 1), |
129 (res_inst_tac [("p","x")] PairE 1), |
129 (res_inst_tac [("p","x")] PairE 1), |
130 (hyp_subst_tac 1), |
130 (hyp_subst_tac 1), |
136 |
136 |
137 (* ------------------------------------------------------------------------ *) |
137 (* ------------------------------------------------------------------------ *) |
138 (* the type 'a * 'b is a cpo *) |
138 (* the type 'a * 'b is a cpo *) |
139 (* ------------------------------------------------------------------------ *) |
139 (* ------------------------------------------------------------------------ *) |
140 |
140 |
141 val lub_cprod = prove_goal Cprod2.thy |
141 qed_goal "lub_cprod" Cprod2.thy |
142 " is_chain(S) ==> range(S) <<| \ |
142 " is_chain(S) ==> range(S) <<| \ |
143 \ < lub(range(%i.fst(S(i)))),lub(range(%i.snd(S(i))))> " |
143 \ < lub(range(%i.fst(S(i)))),lub(range(%i.snd(S(i))))> " |
144 (fn prems => |
144 (fn prems => |
145 [ |
145 [ |
146 (cut_facts_tac prems 1), |
146 (cut_facts_tac prems 1), |
168 val thelub_cprod = (lub_cprod RS thelubI); |
168 val thelub_cprod = (lub_cprod RS thelubI); |
169 (* "is_chain(?S1) ==> lub(range(?S1)) = *) |
169 (* "is_chain(?S1) ==> lub(range(?S1)) = *) |
170 (* <lub(range(%i. fst(?S1(i)))), lub(range(%i. snd(?S1(i))))>" *) |
170 (* <lub(range(%i. fst(?S1(i)))), lub(range(%i. snd(?S1(i))))>" *) |
171 |
171 |
172 |
172 |
173 val cpo_cprod = prove_goal Cprod2.thy |
173 qed_goal "cpo_cprod" Cprod2.thy |
174 "is_chain(S::nat=>'a*'b)==>? x.range(S)<<| x" |
174 "is_chain(S::nat=>'a*'b)==>? x.range(S)<<| x" |
175 (fn prems => |
175 (fn prems => |
176 [ |
176 [ |
177 (cut_facts_tac prems 1), |
177 (cut_facts_tac prems 1), |
178 (rtac exI 1), |
178 (rtac exI 1), |