coq - 在 Coq 中证明矛盾
问题描述
我试图用 来证明一个简单的引理Coq
,但在排除不可行的情况时遇到了一些麻烦。这是我的引理:
Theorem helper : forall (a b : bool),
((negb a) = (negb b)) -> (a = b).
Proof.
intros a b.
intros H.
destruct a.
- destruct b.
+ reflexivity.
+ (** this case is trivially true *)
H
由于假设是错误的,因此相关的子目标是微不足道的。我怎么告诉这个Coq
?
1 subgoal
H : negb true = negb false
______________________________________(1/1)
true = false
解决方案
当假设不同的构造函数之间相等时(在这种情况下H : false = true
),您可以使用discriminate.
在其他情况下,当您有False
假设时,您可以使用contradiction.
推荐阅读
- reactjs - borderBottomRightRadius 在 React Native 中不起作用
- python - OpenCV Python中的视频文件与实时网络摄像头提要窗口大小
- java - 在android中使用日志调试的正确方法?断点
- c# - “SettingsViewModel”类型不包括任何可访问的构造函数。有没有办法摆脱这个错误?
- sqlite - 如何删除sqlite3中数据库的所有文件?
- ios - 如何创建轮播视图
- java - 在执行实际操作之前对 Web 元素进行一些标准验证
- java - 不了解 Java 中的一些基本编译错误
- cassandra-3.0 - Cassandra 数据类型持续时间在 sstableloader 中失败
- reactjs - 我试图通过单击按钮返回上一页做出反应