试图解决 eqb_trans 我卡住了:
Theorem eqb_trans : forall n m p,
n =? m = true ->
m =? p = true ->
n =? p = true.
显然,我们应该使用 eqb_true 来解决它:
Theorem eqb_true : forall n m,
n =? m = true -> n = m.
--------------------------------------------
Proof.
intros n m p H1 H2. apply eqb_true in H1.
apply eqb_true with (n:=m)(m:=p) in H2.
此时我们有:
n, m, p : nat
H1 : n = m
H2 : m = p
============================
(n =? p) = true
现在我想在目标上使用 eqb_true :
apply eqb_true with (m:=p).
但是在这里我们得到一个错误:
Unable to unify "?M1056 = p" with "(n =? p) = true".
为什么它不起作用?怎么修?