[英]Coq proof that p<q or p>=q
I'm trying to prove the following trivial lemma:我试图证明以下微不足道的引理:
Lemma lt_or_ge: forall a b : nat,
((a <? b) = false) -> (b <= a).
Proof.
intros a0 b0 H.
I need something like:我需要类似的东西:
((a <? b) = false) -> (a >= b)
But can't seem to find it in Coq libraries.但是在 Coq 库中似乎找不到它。 Any help is appreciated, thanks.
任何帮助表示赞赏,谢谢。
The Search
command only takes into account imported modules, meaning you need to you import Arith
module to get access to a number of useful (and now searchable) lemmas. Search
命令只考虑导入的模块,这意味着您需要导入Arith
模块才能访问许多有用的(现在可搜索的)引理。
A search query like the following one如下所示的搜索查询
From Coq Require Import Arith.
(* queries separated by whitespace mean boolean "and" *)
Search (_ <? _) false (_ <= _).
will get you what you need right away:将立即为您提供所需的东西:
lt_or_ge: forall a b : nat, (a <? b) = false -> b <= a
Nat.ltb_ge: forall x y : nat, (x <? y) = false <-> y <= x
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.