[英]Idiomatic Proof by Contradiction in Isabelle?
So far I wrote proofs by contradiction in the following style in Isabelle (using a pattern by Jeremy Siek ): 到目前为止,我在Isabelle的以下风格中使用矛盾来编写证据(使用Jeremy Siek的模式):
lemma "<expression>"
proof -
{
assume "¬ <expression>"
then have False sorry
}
then show ?thesis by blast
qed
Is there a way that works without the nested raw proof block { ... }
? 有没有一种方法可以在没有嵌套的原始证据块
{ ... }
?
There is the rule ccontr
for classical proofs by contradiction: 通过矛盾有经典证据的规则
ccontr
:
have "<expression>"
proof (rule ccontr)
assume "¬ <expression>"
then show False sorry
qed
It may sometimes help to use by contradiction
to prove the last step. 有时可能有助于
by contradiction
来证明最后一步。
There is also the rule classical
(which looks less intuitive): 还有
classical
规则(看起来不那么直观):
have "<expression>"
proof (rule classical)
assume "¬ <expression>"
then show "<expression>" sorry
qed
For further examples using classical
, see $ISABELLE_HOME/src/HOL/Isar_Examples/Drinker.thy 有关使用
classical
更多示例,请参阅$ ISABELLE_HOME / src / HOL / Isar_Examples / Drinker.thy
For better understanding of rule classical
it can be printed in structured Isar style like this: 为了更好地理解规则
classical
它可以打印成结构化的Isar风格,如下所示:
print_statement classical
Output: 输出:
theorem classical:
obtains "¬ thesis"
Thus the pure evil to intuitionists appears a bit more intuitive: in order to prove some arbitrary thesis, we may assume that its negation holds. 因此,对直觉主义者的纯粹邪恶似乎更直观:为了证明某些任意论点,我们可以假设它的否定成立。
The corresponding canonical proof pattern is this: 相应的规范证明模式是这样的:
notepad
begin
have A
proof (rule classical)
assume "¬ ?thesis"
then show ?thesis sorry
qed
end
Here ?thesis
is the concrete thesis of the above claim of A
, which may be an arbitrarily complex statement. 这里的
?thesis
是A
的上述主张的具体论点,可能是一个任意复杂的陈述。 This quasi abstraction via the abbreviation ?thesis
is typical for idiomatic Isar, to emphasize the structure of reasoning. 这种通过缩写
?thesis
准抽象是典型的惯用Isar,强调推理的结构。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.