简体   繁体   English

如何轻松地在Coq中证明以下内容,例如仅使用假设?

[英]How to easily prove the following in Coq such as using only assumptions?

是否有一种简单的方法可以证明Coq中的以下内容,例如仅使用假设?

(P -> (Q /\ R)) -> (~Q) -> ~P

The question is a bit vague... Do you wonder if it is possible (yes), what the answer is (see Arthur's comment above), or how to think about solving these problems? 这个问题有点含糊……您是否想知道是否有可能(是),答案是什么(请参见上面的亚瑟评论),或者如何考虑解决这些问题?

In the latter case, remember that the goal is to create a "lambda-term" with the specified type. 在后一种情况下,请记住目标是创建具有指定类型的“ lambda项”。 You can either use "tactics" which are helping you construct the term "from the outside and inwards. It is good to do it by hand a couple of times to understand what is going on and what the tactics really do, which I think is why you are given this exercise. 您可以使用“策略”来帮助您构筑“从内而外”的术语。最好是手动操作几次,以了解正在发生的事情以及该策略的实际作用,我认为这是为什么要进行此练习。

If you look at your example, 如果看你的例子,

(P -> (Q /\ R)) -> (~Q) -> ~P

you can see that it is a function of three (!) arguments. 您会看到它是三个(!)参数的函数。 It is because the last type ~P really means P -> False , so the types of the arguments to the function that you need to create are 这是因为最后一个类型~P实际上意味着P -> False ,因此您需要创建的函数的参数类型

P -> (Q /\ R)
Q -> False
P

and the function should construct a term of type 函数应该构造一个类型项

False

You can create a term fun ABC => _ where A, B, C has the types above, (this is what the tactic intros does), and you need to come up with a term that should go into the hole _ by combining the terms A, B, C and the raw gallina constructions. 您可以创建一个fun ABC => _的术语fun ABC => _ ,其中A, B, C具有上面的类型(这是该方法的intros ),并且您需要提出一个应结合到_的术语术语A, B, C和原始Gallina结构。

In this case, when you have managed to create a term of type Q /\\ R you will have to "destruct" it to get the term of type Q , (Hint: for that you will have to use the match construction). 在这种情况下,当您成功创建了Q /\\ R类型的项时,您将必须对其进行“分解”以获得Q类型的项(提示:为此,您将必须使用match结构)。

Hope this helps without spoiling the fun! 希望这会有所帮助,而不会破坏乐趣!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM