问题
I am trying to prove a theorem in Isabelle and I am stuck in this step:
theorem exists_prime_factor: " (n > Suc 0) ⟶ (∃xs::nat list. prod_list xs = n ∧ all_prime xs)"
proof (induct n rule: less_induct)
case (less k)
assume HI: "⋀y::nat. (y < k ⟹ Suc 0 < y ⟶ (∃xs. prod_list xs = y ∧ all_prime xs))"
then show ?case
proof -
show "(Suc 0 < k) ⟶ (∃xs. prod_list xs = k ∧ all_prime xs)"
proof -
assume "Suc 0 < k" then show "(∃xs. prod_list xs = k ∧ all_prime xs)" sorry
In the last goal I need to prove an implication. As usual I assume the premises and try to show the conclusion. However when I write the last line I get "Failed to refine any pending goal". Is it because of the induction principle I applied before? Because without that induction I am able to to use the implication introduction rule as usual (assume premises then show conclusion).
Does anyone have an idea of what might be going on?
Thank you very much.
回答1:
The "problem" indeed has to do with the proof -
. The statement opens a new subproof without applying any proof methods to the goal. If you write proof
without -
, the proof method rule
will be applied implicitly, which does the trick in this situation.
proof rule
picks the most straight-forward rule to apply to your goal. In this case, this will be equivalent to proof (rule impI)
, because the object level statement you want to prove is of the form "a --> b"
. impI
is the introduction rule for implication. It allows you to lift an object level implication of the form "a --> b"
to the meta logical "a" ==> "b"
.
You need your goals to be of the form "a" ==> "b"
to continue with subproofs of the form assume "a" [...] show "b"
.
来源:https://stackoverflow.com/questions/32928771/failed-to-refine-any-pending-goal