325 val stmt = [((Binding.empty, atts), [(thesis, [])])]; |
325 val stmt = [((Binding.empty, atts), [(thesis, [])])]; |
326 |
326 |
327 val (facts, goal_ctxt) = elems_ctxt |
327 val (facts, goal_ctxt) = elems_ctxt |
328 |> (snd o ProofContext.add_fixes_i [(Binding.name AutoBind.thesisN, NONE, NoSyn)]) |
328 |> (snd o ProofContext.add_fixes_i [(Binding.name AutoBind.thesisN, NONE, NoSyn)]) |
329 |> fold_map assume_case (obtains ~~ propp) |
329 |> fold_map assume_case (obtains ~~ propp) |
330 |-> (fn ths => ProofContext.note_thmss_i Thm.assumptionK |
330 |-> (fn ths => ProofContext.note_thmss Thm.assumptionK |
331 [((Binding.name Obtain.thatN, []), [(ths, [])])] #> #2 #> pair ths); |
331 [((Binding.name Obtain.thatN, []), [(ths, [])])] #> #2 #> pair ths); |
332 in ((prems, stmt, facts), goal_ctxt) end); |
332 in ((prems, stmt, facts), goal_ctxt) end); |
333 |
333 |
334 structure TheoremHook = GenericDataFun |
334 structure TheoremHook = GenericDataFun |
335 ( |
335 ( |
368 in lthy'' end) |
368 in lthy'' end) |
369 |> after_qed results' |
369 |> after_qed results' |
370 end; |
370 end; |
371 in |
371 in |
372 goal_ctxt |
372 goal_ctxt |
373 |> ProofContext.note_thmss_i Thm.assumptionK |
373 |> ProofContext.note_thmss Thm.assumptionK |
374 [((Binding.name AutoBind.assmsN, []), [(prems, [])])] |
374 [((Binding.name AutoBind.assmsN, []), [(prems, [])])] |
375 |> snd |
375 |> snd |
376 |> Proof.theorem_i before_qed after_qed' (map snd stmt) |
376 |> Proof.theorem_i before_qed after_qed' (map snd stmt) |
377 |> Proof.refine_insert facts |
377 |> Proof.refine_insert facts |
378 |> Library.apply (map (fn (f, _) => f int) (rev (TheoremHook.get (Context.Proof goal_ctxt)))) |
378 |> Library.apply (map (fn (f, _) => f int) (rev (TheoremHook.get (Context.Proof goal_ctxt)))) |