equal
deleted
inserted
replaced
9 (* ------------------------------------------------------------------------ *) |
9 (* ------------------------------------------------------------------------ *) |
10 (* A non-emptyness result for Sssum *) |
10 (* A non-emptyness result for Sssum *) |
11 (* ------------------------------------------------------------------------ *) |
11 (* ------------------------------------------------------------------------ *) |
12 |
12 |
13 Goalw [Ssum_def] "Sinl_Rep(a):Ssum"; |
13 Goalw [Ssum_def] "Sinl_Rep(a):Ssum"; |
14 by (rtac CollectI 1); |
14 by (Blast_tac 1); |
15 by (rtac disjI1 1); |
|
16 by (rtac exI 1); |
|
17 by (rtac refl 1); |
|
18 qed "SsumIl"; |
15 qed "SsumIl"; |
19 |
16 |
20 Goalw [Ssum_def] "Sinr_Rep(a):Ssum"; |
17 Goalw [Ssum_def] "Sinr_Rep(a):Ssum"; |
21 by (rtac CollectI 1); |
18 by (Blast_tac 1); |
22 by (rtac disjI2 1); |
|
23 by (rtac exI 1); |
|
24 by (rtac refl 1); |
|
25 qed "SsumIr"; |
19 qed "SsumIr"; |
26 |
20 |
27 Goal "inj_on Abs_Ssum Ssum"; |
21 Goal "inj_on Abs_Ssum Ssum"; |
28 by (rtac inj_on_inverseI 1); |
22 by (rtac inj_on_inverseI 1); |
29 by (etac Abs_Ssum_inverse 1); |
23 by (etac Abs_Ssum_inverse 1); |
127 by (etac (inj_on_Abs_Ssum RS inj_onD) 1); |
121 by (etac (inj_on_Abs_Ssum RS inj_onD) 1); |
128 by (rtac SsumIr 1); |
122 by (rtac SsumIr 1); |
129 by (rtac SsumIr 1); |
123 by (rtac SsumIr 1); |
130 qed "inject_Isinr"; |
124 qed "inject_Isinr"; |
131 |
125 |
|
126 AddSDs [inject_Isinl, inject_Isinr]; |
|
127 |
132 Goal "a1~=a2 ==> Isinl(a1) ~= Isinl(a2)"; |
128 Goal "a1~=a2 ==> Isinl(a1) ~= Isinl(a2)"; |
133 by (rtac contrapos 1); |
129 by (Blast_tac 1); |
134 by (etac inject_Isinl 2); |
|
135 by (atac 1); |
|
136 qed "inject_Isinl_rev"; |
130 qed "inject_Isinl_rev"; |
137 |
131 |
138 Goal "b1~=b2 ==> Isinr(b1) ~= Isinr(b2)"; |
132 Goal "b1~=b2 ==> Isinr(b1) ~= Isinr(b2)"; |
139 by (rtac contrapos 1); |
133 by (Blast_tac 1); |
140 by (etac inject_Isinr 2); |
|
141 by (atac 1); |
|
142 qed "inject_Isinr_rev"; |
134 qed "inject_Isinr_rev"; |
143 |
135 |
144 (* ------------------------------------------------------------------------ *) |
136 (* ------------------------------------------------------------------------ *) |
145 (* Exhaustion of the strict sum ++ *) |
137 (* Exhaustion of the strict sum ++ *) |
146 (* choice of the bottom representation is arbitrary *) |
138 (* choice of the bottom representation is arbitrary *) |
157 by (rtac disjI1 1); |
149 by (rtac disjI1 1); |
158 by (rtac exI 1); |
150 by (rtac exI 1); |
159 by (rtac conjI 1); |
151 by (rtac conjI 1); |
160 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
152 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
161 by (etac arg_cong 1); |
153 by (etac arg_cong 1); |
162 by (res_inst_tac [("Q","Sinl_Rep(a)=Sinl_Rep(UU)")] contrapos 1); |
154 by (res_inst_tac [("Q","Sinl_Rep(a)=Sinl_Rep(UU)")] contrapos_nn 1); |
163 by (etac arg_cong 2); |
155 by (etac arg_cong 2); |
164 by (etac contrapos 1); |
156 by (etac contrapos_nn 1); |
165 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
157 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
166 by (rtac trans 1); |
158 by (rtac trans 1); |
167 by (etac arg_cong 1); |
159 by (etac arg_cong 1); |
168 by (etac arg_cong 1); |
160 by (etac arg_cong 1); |
169 by (etac exE 1); |
161 by (etac exE 1); |
173 by (rtac disjI2 1); |
165 by (rtac disjI2 1); |
174 by (rtac exI 1); |
166 by (rtac exI 1); |
175 by (rtac conjI 1); |
167 by (rtac conjI 1); |
176 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
168 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
177 by (etac arg_cong 1); |
169 by (etac arg_cong 1); |
178 by (res_inst_tac [("Q","Sinr_Rep(b)=Sinl_Rep(UU)")] contrapos 1); |
170 by (res_inst_tac [("Q","Sinr_Rep(b)=Sinl_Rep(UU)")] contrapos_nn 1); |
179 by (hyp_subst_tac 2); |
171 by (hyp_subst_tac 2); |
180 by (rtac (strict_SinlSinr_Rep RS sym) 2); |
172 by (rtac (strict_SinlSinr_Rep RS sym) 2); |
181 by (etac contrapos 1); |
173 by (etac contrapos_nn 1); |
182 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
174 by (rtac (Rep_Ssum_inverse RS sym RS trans) 1); |
183 by (rtac trans 1); |
175 by (rtac trans 1); |
184 by (etac arg_cong 1); |
176 by (etac arg_cong 1); |
185 by (etac arg_cong 1); |
177 by (etac arg_cong 1); |
186 qed "Exh_Ssum"; |
178 qed "Exh_Ssum"; |
260 by (rtac inject_Isinl 1); |
252 by (rtac inject_Isinl 1); |
261 by (fast_tac HOL_cs 1); |
253 by (fast_tac HOL_cs 1); |
262 by (strip_tac 1); |
254 by (strip_tac 1); |
263 by (res_inst_tac [("P","Isinl(x) = Isinr(b)")] notE 1); |
255 by (res_inst_tac [("P","Isinl(x) = Isinr(b)")] notE 1); |
264 by (fast_tac HOL_cs 2); |
256 by (fast_tac HOL_cs 2); |
265 by (rtac contrapos 1); |
257 by (rtac contrapos_nn 1); |
266 by (etac noteq_IsinlIsinr 2); |
258 by (etac noteq_IsinlIsinr 2); |
267 by (fast_tac HOL_cs 1); |
259 by (fast_tac HOL_cs 1); |
268 qed "Iwhen2"; |
260 qed "Iwhen2"; |
269 |
261 |
270 Goalw [Iwhen_def] |
262 Goalw [Iwhen_def] |
280 by (atac 1); |
272 by (atac 1); |
281 by (rtac conjI 1); |
273 by (rtac conjI 1); |
282 by (strip_tac 1); |
274 by (strip_tac 1); |
283 by (res_inst_tac [("P","Isinr(y) = Isinl(a)")] notE 1); |
275 by (res_inst_tac [("P","Isinr(y) = Isinl(a)")] notE 1); |
284 by (fast_tac HOL_cs 2); |
276 by (fast_tac HOL_cs 2); |
285 by (rtac contrapos 1); |
277 by (rtac contrapos_nn 1); |
286 by (etac (sym RS noteq_IsinlIsinr) 2); |
278 by (etac (sym RS noteq_IsinlIsinr) 2); |
287 by (fast_tac HOL_cs 1); |
279 by (fast_tac HOL_cs 1); |
288 by (strip_tac 1); |
280 by (strip_tac 1); |
289 by (rtac cfun_arg_cong 1); |
281 by (rtac cfun_arg_cong 1); |
290 by (rtac inject_Isinr 1); |
282 by (rtac inject_Isinr 1); |