我如何表明,如果假设不暗示,那就与说命题等于false(COQ)一样?

发布于 2025-01-30 23:39:00 字数 192 浏览 3 评论 0原文

我想证明两个字符不等。我的环境目前看起来像这样:

H: c1 = c2 -> not
_____________________
Goal: (c1 =? c2)%char = false

它不允许我应用H或重写H来解决目标,而H不可逆转。目标直接源于假设,那么我该如何证明这一点?我需要助手引理吗?

I want to prove two characters are not equal. My environment currently looks like this:

H: c1 = c2 -> not
_____________________
Goal: (c1 =? c2)%char = false

It won't allow me to apply H or rewrite H to solve the goal, and H is not invertible. The goal directly follows from the hypothesis, so how can I prove this? Do I need a helper lemma?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ可否回来 2025-02-06 23:39:00

看起来您的假设中有一个错别字h
您是指不是(C1 = C2)(或c1<> c2,还是c1 = c2 - > false)?

如果是这样,您可以应用标准库的引理:

Search (_ =? _)%char. 

Goal forall c1 c2: ascii,
    c1 <> c2 -> (c1 =? c2)%char = false.
Proof.
  intros c1 c2; apply eqb_neq.
Qed.

也可能有趣的是,查看eqb_neq的证明,以了解如何证明这种引理。

Looks like there is a typo in your hypothesis H ?
Do you mean not (c1 = c2) (or c1 <> c2, or c1 = c2 -> False) ?

If so, you may apply a lemma of Standard Library:

Search (_ =? _)%char. 

Goal forall c1 c2: ascii,
    c1 <> c2 -> (c1 =? c2)%char = false.
Proof.
  intros c1 c2; apply eqb_neq.
Qed.

It may be interesting to look at the proof of eqb_neqtoo, in order to understand how to prove this kind of lemmas.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文