繁体   English   中英

Quick Chick eqBoolArrowA_correct 定理

[英]Quick Chick eqBoolArrowA_correct theorem

通过软件基础的 Quick Chick 课程我坚持以下定理:

Class Eq A :=
{
    eqb: A -> A -> bool;
}.


Instance eqBoolArrowA {A : Type} `{Eq A} : Eq (bool -> A) :=
{
  eqb f1 f2 :=
           (andb (eqb (f1 false) (f2 false)) (eqb (f1 true) (f2 true)))
}.

Theorem eqBoolArrowA_correct : forall (f1 f2 : bool -> bool -> nat),
                                      (eqb f1 f2) = true <-> true = true.
Proof.
  intros. split.
  - destruct (f1 =? f2).
    + intro. assumption.
    + intros H. discriminate H.
  - intros _. destruct (f1 =? f2).
    + reflexivity.
    +

在这里我们得到:

1 subgoal (ID 164)

  f1, f2 : bool -> bool -> nat
  ============================
  false = true

证明true = true -> (eqb f1 f2) = true似乎是不可能的,因为(eqb f1 f2)可能为 false,在这种情况下,我们在空上下文中得到false = true ,这是无法证明的。

这个定理是不正确的还是我遗漏了什么?

该定理无效。

任何命题P <-> true = true等价于P ,并且对于所有函数f1, f2 : bool -> A eqb f1 f2 = true是无效f1, f2 : bool -> A (至少当A有两个或更多居民时)。

暂无
暂无

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

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