src/HOL/Tools/Function/induction_schema.ML
changeset 59058 a78612c67ec0
parent 58963 26bf09b95dda
child 59580 cbc38731d42f
equal deleted inserted replaced
59057:5b649fb2f2e1 59058:a78612c67ec0
   337     val induct_rule =
   337     val induct_rule =
   338       @{thm "wf_induct_rule"}
   338       @{thm "wf_induct_rule"}
   339       |> (curry op COMP) wf_thm
   339       |> (curry op COMP) wf_thm
   340       |> (curry op COMP) istep
   340       |> (curry op COMP) istep
   341 
   341 
   342     val steps_sorted = map snd (sort (int_ord o pairself fst) steps)
   342     val steps_sorted = map snd (sort (int_ord o apply2 fst) steps)
   343   in
   343   in
   344     (steps_sorted, induct_rule)
   344     (steps_sorted, induct_rule)
   345   end
   345   end
   346 
   346 
   347 
   347 
   354     val ([Rn,xn], ctxt'') = Variable.variant_fixes ["R","x"] ctxt'
   354     val ([Rn,xn], ctxt'') = Variable.variant_fixes ["R","x"] ctxt'
   355     val R = Free (Rn, mk_relT ST)
   355     val R = Free (Rn, mk_relT ST)
   356     val x = Free (xn, ST)
   356     val x = Free (xn, ST)
   357     val cert = cterm_of (Proof_Context.theory_of ctxt)
   357     val cert = cterm_of (Proof_Context.theory_of ctxt)
   358 
   358 
   359     val ineqss = mk_ineqs R scheme
   359     val ineqss = mk_ineqs R scheme |> map (map (apply2 (Thm.assume o cert)))
   360       |> map (map (pairself (Thm.assume o cert)))
       
   361     val complete =
   360     val complete =
   362       map_range (mk_completeness ctxt scheme #> cert #> Thm.assume) (length branches)
   361       map_range (mk_completeness ctxt scheme #> cert #> Thm.assume) (length branches)
   363     val wf_thm = mk_wf R scheme |> cert |> Thm.assume
   362     val wf_thm = mk_wf R scheme |> cert |> Thm.assume
   364 
   363 
   365     val (descent, pres) = split_list (flat ineqss)
   364     val (descent, pres) = split_list (flat ineqss)