简体   繁体   English

Coq 证明 p <q or p>=q</q>

[英]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.

相关问题 如何在Coq中证明(p-&gt; q)-&gt;(〜p \\ / q) - How to prove (p -> q) -> (~ p \/ q) in Coq 如何在 Coq 中证明 (~Q -&gt; ~P) - &gt; (P -&gt; Q) - How to prove (~Q -> ~P) - > (P -> Q) in Coq 使用Coq Proof Assistant证明(p-&gt; q)-&gt;(〜q-&gt;〜p) - Proving (p->q)->(~q->~p) using Coq Proof Assistant 在 Coq 中如何证明或证伪 `forall (PQ : Prop), (P -&gt; Q) -&gt; (Q -&gt; P) -&gt; P = Q.`? - How or is that possible to prove or falsify `forall (P Q : Prop), (P -> Q) -> (Q -> P) -> P = Q.` in Coq? 我如何证明所有 PQ:Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q。 在考克? - how do I prove forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q. in coq? 如何在coq中证明引理“(P \\ / Q)/ \\ ~P - &gt; Q.” - How to prove the lemma “(P \/ Q) /\ ~P -> Q.” in coq? 如何证明所有人(pq:Prop),〜p-&gt;〜((p-&gt; q)-&gt; p) 使用coq - How to prove forall (p q:Prop), ~p->~((p ->q) ->p). using coq Coq:在没有 `contradiction` 策略的情况下证明 `P -&gt; ~P -&gt; Q`? - Coq: proving `P -> ~P -> Q` without `contradiction` tactic? 如何在 Coq 中将 P-&gt;Q-&gt;R 形式的命题同时应用于两个假设 P 和 Q? - How do I apply the proposition of the form P->Q->R to two hypotheses P and Q simultaneously in Coq? 如何证明(R-&gt; P)[在Coq证明助手中]? - How to prove (R -> P) [in the Coq proof assistant]?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM