问题
I'm going through chapter 5 of concrete semantics.
I got some error while working through this toy example proof:
lemma
shows "¬ ev (Suc 0)"
I know this is more than needed (since by cases
) magically solves everything & gives a finished proof, but I wanted to make explicit the cases.
I tried this:
lemma
shows "¬ ev (Suc 0)"
proof (rule notI)
assume "ev (Suc 0)"
then show False
proof (cases)
case ev0
then show ?case by blast
next
case evSS
then show ?case sorry
qed
but if I put my mouse on the ?cases
I get a complaint by Isabelle's (type checker?) verifier:
proof (chain)
picking this:
Failed to refine any pending goal
Local statement fails to refine any pending goal
Failed attempt to solve goal by exported rule:
HOL.induct_true
what does this error mean?
Why can't I make the proof explicit with the case
syntax here? even if it's trivial?
How question is, how do you close a case immediately?
If there are no cases to be proved you can close a proof immediately with qed.
is referenced later but I can't make it work for real proofs.
回答1:
The auto-generated proof outline is sometimes just wrong. This is one such case.
The reason why cases
solves your goal here is that it does some pre-simplification of the cases (as documented in §6.5.2 of the Isabelle/Isar reference manual). This is enough to make both cases disappear automatically here, since they are clearly impossible. Your proof state therefore has no proof obligations left, and Isar only allows you to prove things with show
that you still have to prove. That's why you get the error message Failed to refine any pending goal
: There simply are no pending goals.
You can disable the pre-simplification of cases
using the (no_simp)
parameter, i.e.
proof (cases (no_simp))
Note however that cases
does not define the ?case
variable because it does not change the goal. Just use ?thesis
instead.
来源:https://stackoverflow.com/questions/61921839/why-cant-i-make-my-cases-explicit-in-isabelle-when-the-proof-is-already-complet