250 |
250 |
251 (********) |
251 (********) |
252 val dummy = writeln " Proving the elimination rule..."; |
252 val dummy = writeln " Proving the elimination rule..."; |
253 |
253 |
254 (*Breaks down logical connectives in the monotonic function*) |
254 (*Breaks down logical connectives in the monotonic function*) |
255 val basic_elim_tac = |
255 fun basic_elim_tac ctxt = |
256 REPEAT (SOMEGOAL (eresolve_tac (Ind_Syntax.elim_rls @ Su.free_SEs) |
256 REPEAT (SOMEGOAL (eresolve_tac (Ind_Syntax.elim_rls @ Su.free_SEs) |
257 ORELSE' bound_hyp_subst_tac ctxt1)) |
257 ORELSE' bound_hyp_subst_tac ctxt)) |
258 THEN prune_params_tac |
258 THEN prune_params_tac |
259 (*Mutual recursion: collapse references to Part(D,h)*) |
259 (*Mutual recursion: collapse references to Part(D,h)*) |
260 THEN (PRIMITIVE (fold_rule part_rec_defs)); |
260 THEN (PRIMITIVE (fold_rule part_rec_defs)); |
261 |
261 |
262 (*Elimination*) |
262 (*Elimination*) |
263 val elim = rule_by_tactic (Proof_Context.init_global thy1) basic_elim_tac |
263 val elim = rule_by_tactic (Proof_Context.init_global thy1) (basic_elim_tac ctxt1) |
264 (unfold RS Ind_Syntax.equals_CollectD) |
264 (unfold RS Ind_Syntax.equals_CollectD) |
265 |
265 |
266 (*Applies freeness of the given constructors, which *must* be unfolded by |
266 (*Applies freeness of the given constructors, which *must* be unfolded by |
267 the given defs. Cannot simply use the local con_defs because |
267 the given defs. Cannot simply use the local con_defs because |
268 con_defs=[] for inference systems. |
268 con_defs=[] for inference systems. |
269 Proposition A should have the form t:Si where Si is an inductive set*) |
269 Proposition A should have the form t:Si where Si is an inductive set*) |
270 fun make_cases ctxt A = |
270 fun make_cases ctxt A = |
271 rule_by_tactic ctxt |
271 rule_by_tactic ctxt |
272 (basic_elim_tac THEN ALLGOALS (asm_full_simp_tac ctxt) THEN basic_elim_tac) |
272 (basic_elim_tac ctxt THEN ALLGOALS (asm_full_simp_tac ctxt) THEN basic_elim_tac ctxt) |
273 (Thm.assume A RS elim) |
273 (Thm.assume A RS elim) |
274 |> Drule.export_without_context_open; |
274 |> Drule.export_without_context_open; |
275 |
275 |
276 fun induction_rules raw_induct thy = |
276 fun induction_rules raw_induct thy = |
277 let |
277 let |