233 |
233 |
234 (*Type-checking is hardest aspect of proof; |
234 (*Type-checking is hardest aspect of proof; |
235 disjIn selects the correct disjunct after unfolding*) |
235 disjIn selects the correct disjunct after unfolding*) |
236 fun intro_tacsf disjIn prems = |
236 fun intro_tacsf disjIn prems = |
237 [(*insert prems and underlying sets*) |
237 [(*insert prems and underlying sets*) |
238 cut_facts_tac (prems @ (prems RL [PartD1])) 1, |
238 cut_facts_tac prems 1, |
239 rtac (unfold RS ssubst) 1, |
239 rtac (unfold RS ssubst) 1, |
240 REPEAT (resolve_tac [Part_eqI,CollectI] 1), |
240 REPEAT (resolve_tac [Part_eqI,CollectI] 1), |
241 (*Now 2-3 subgoals: typechecking, the disjunction, perhaps equality.*) |
241 (*Now 2-3 subgoals: typechecking, the disjunction, perhaps equality.*) |
242 rtac disjIn 2, |
242 rtac disjIn 2, |
243 REPEAT (ares_tac [refl,exI,conjI] 2), |
243 REPEAT (ares_tac [refl,exI,conjI] 2), |
244 rewrite_goals_tac con_defs, |
244 rewrite_goals_tac con_defs, |
245 (*Now can solve the trivial equation*) |
245 (*Now can solve the trivial equation*) |
246 REPEAT (rtac refl 2), |
246 REPEAT (rtac refl 2), |
247 REPEAT (FIRSTGOAL (eresolve_tac (asm_rl::type_elims) |
247 REPEAT (FIRSTGOAL (eresolve_tac (asm_rl::PartE::type_elims) |
|
248 ORELSE' hyp_subst_tac |
248 ORELSE' dresolve_tac rec_typechecks)), |
249 ORELSE' dresolve_tac rec_typechecks)), |
249 DEPTH_SOLVE (ares_tac type_intrs 1)]; |
250 DEPTH_SOLVE (swap_res_tac type_intrs 1)]; |
250 |
251 |
251 (*combines disjI1 and disjI2 to access the corresponding nested disjunct...*) |
252 (*combines disjI1 and disjI2 to access the corresponding nested disjunct...*) |
252 val mk_disj_rls = |
253 val mk_disj_rls = |
253 let fun f rl = rl RS disjI1 |
254 let fun f rl = rl RS disjI1 |
254 and g rl = rl RS disjI2 |
255 and g rl = rl RS disjI2 |
258 (intr_tms ~~ map intro_tacsf (mk_disj_rls(length intr_tms))); |
259 (intr_tms ~~ map intro_tacsf (mk_disj_rls(length intr_tms))); |
259 |
260 |
260 (********) |
261 (********) |
261 val dummy = writeln "Proving the elimination rule..."; |
262 val dummy = writeln "Proving the elimination rule..."; |
262 |
263 |
263 val elim_rls = [asm_rl, FalseE, conjE, exE, disjE]; |
264 (*Includes rules for succ and Pair since they are common constructions*) |
|
265 val elim_rls = [asm_rl, FalseE, succ_neq_0, sym RS succ_neq_0, |
|
266 Pair_neq_0, sym RS Pair_neq_0, succ_inject, refl_thin, |
|
267 conjE, exE, disjE]; |
264 |
268 |
265 val sumprod_free_SEs = |
269 val sumprod_free_SEs = |
266 map (gen_make_elim [conjE,FalseE]) |
270 map (gen_make_elim [conjE,FalseE]) |
267 ([Su.distinct, Su.distinct', Su.inl_iff, Su.inr_iff, Pr.pair_iff] |
271 ([Su.distinct, Su.distinct', Su.inl_iff, Su.inr_iff, Pr.pair_iff] |
268 RL [iffD1]); |
272 RL [iffD1]); |