通常,当以“证明”模式证明一个陈述时,我发现自己需要一些尚未陈述或证明的中间陈述。为了说明它们,我通常使用subgoal
命令,然后proof-
更改为“状态”模式。然而,在这个过程中,所有的局部假设都被删除了。一个典型的例子可能看起来像这样
lemma "0 < n ⟷ ((2::nat)^n < 3^n)"
apply(auto)
subgoal
proof-
have "0<n" sorry (* here I would like to refer to the assumption from the subgoal *)
then show ?thesis sorry
qed
subgoal sorry
done
我知道我可以assume
明确地陈述假设。然而,当涉及多个假设时,这很快就会变得相当乏味。有没有更简单的方法来简单地引用所有假设?或者,是否有一种直接在“证明”模式下实现带有简短证明的语句的好方法?