1

我正在通过 Coq 8.12.0 参考手册学习 Coq,但无法证明以下引理。

From Coq Require Import Lia Reals Lra List.

Lemma lemma1 : forall (x y:Rbar), Rbar_le x 0 -> Rbar_le y 0
   -> Rbar_le (Rbar_plus x y) 0.

Proof.
destruct x ; destruct y ; simpl ; intuition.
destruct H.
destruct H0.
unfold Rle.
auto with real.
right.
...

然后我被卡住以完成证明。有任何想法吗 ?

4

1 回答 1

2

当您输入策略时,right您在证明中做出了一个未被假设中的事实证实的选择。你应该删除这条线,并尝试找到另一种方法来证明你最初的猜想,这似乎真的可以证明。

实际上,如果您开始展开定义Rle和使用destruct. 你之后的目标...; intuition如下:

1 subgoal (ID 207)

  r, r0 : R
  H : r <= 0
  H0 : r0 <= 0
  ============================
  r + r0 <= 0

这是简单线性算术的目标(因为我们只将变量相加并使用简单的比较)。这是通过一种强大的策略解决的,称为lra. 就叫吧。您的证明的完整脚本在这里:

Lemma lemma1 : forall (x y:Rbar), Rbar_le x 0 -> Rbar_le y 0
   -> Rbar_le (Rbar_plus x y) 0.

Proof.
destruct x ; destruct y ; simpl ; intuition.
lra.
Qed.
于 2021-04-28T05:56:01.110 回答