简体   繁体   English

Coq 中的判别目标

[英]Discriminate goal in Coq

I have two conditions for nat numbers:我对 nat 数字有两个条件:

H:  a < b
H1: b < a

How to discriminate goal?如何区分目标? Does exist any tactics for < ? < 是否存在任何策略?

Use lia :使用lia

From Coq Require Import Lia.

Goal forall a b, a < b -> b < a -> False.
  lia.
Qed.

You can learn more about lia and other decision procedures for arithmetic here .您可以在此处了解有关lia和其他算术决策程序的更多信息。

For reference, doing a manual proof is not so difficult in this case:作为参考,在这种情况下进行手动证明并不是那么困难:

From mathcomp Require Import all_ssreflect.

Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Lemma foo a b (a_lt_b : a < b) : b < a -> False.
Proof. by rewrite ltnNge (ltnW a_lt_b). Qed.

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

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