如何用 ssreflect 反映:无法统一 ?x == ?y 与 "n = n0"
how to reflect with ssreflect: unable to unify ?x == ?y with "n = n0"
编辑:我找到了!我忘记了胁迫。请忽略这个:)
我正在学习 ssreflect 并且不知道如何在此处进行。我的证明状态如下:
n, n0 : nat
============================
n = n0 -> n == n0
起初,我尝试了move/eqP,因为我认为"apply" eqP 到n=n0,其中"apply" 表示"get n==n0 out of the reflection given by eqP"。
但是,这种尝试产生了:
Illegal application (Non-functional construction):
The expression "eqP ?i" of type "?x = ?y"
cannot be applied to the term
"?y0" : "?T0"
我对 y0 和 T0 应该是什么感到困惑。
我也试过了
intros H. eapply (introT eqP) in H.
产生错误的地方
Unable to apply lemma of type "?x = ?y -> ?x == ?y"
on hypothesis of type "n = n0".
我试图将显式参数 n0 和 n 传递给 eqP,只是为了看看它是否有效,
pose proof (eqP n n0).
但这给出了
的错误
In environment
n, n0 : nat
H : n = n0
The term "n" has type "nat"
while it is expected to have type
"is_true (?x == ?y)".
所以,似乎 eqP 既想要又不想要 ?x 和 ?y 的显式实例化。关于为什么 move/eqP 没有按我认为应该的方式行事,以及 eqP 和 (introT eqP) 的类型实际发生了什么,我真的很感激一些概念性的解释。
如果相关,我正在导入
From mathcomp Require Import ssrnat ssreflect ssrfun ssrbool eqtype.
来自 ssreflect。
谢谢。
愚蠢的错误!我有一种我忘记的胁迫;我的实际证明状态是 Nat n = Nat n0 -> n ==n0.
编辑:我找到了!我忘记了胁迫。请忽略这个:)
我正在学习 ssreflect 并且不知道如何在此处进行。我的证明状态如下:
n, n0 : nat
============================
n = n0 -> n == n0
起初,我尝试了move/eqP,因为我认为"apply" eqP 到n=n0,其中"apply" 表示"get n==n0 out of the reflection given by eqP"。 但是,这种尝试产生了:
Illegal application (Non-functional construction):
The expression "eqP ?i" of type "?x = ?y"
cannot be applied to the term
"?y0" : "?T0"
我对 y0 和 T0 应该是什么感到困惑。 我也试过了
intros H. eapply (introT eqP) in H.
产生错误的地方
Unable to apply lemma of type "?x = ?y -> ?x == ?y"
on hypothesis of type "n = n0".
我试图将显式参数 n0 和 n 传递给 eqP,只是为了看看它是否有效,
pose proof (eqP n n0).
但这给出了
In environment
n, n0 : nat
H : n = n0
The term "n" has type "nat"
while it is expected to have type
"is_true (?x == ?y)".
所以,似乎 eqP 既想要又不想要 ?x 和 ?y 的显式实例化。关于为什么 move/eqP 没有按我认为应该的方式行事,以及 eqP 和 (introT eqP) 的类型实际发生了什么,我真的很感激一些概念性的解释。
如果相关,我正在导入
From mathcomp Require Import ssrnat ssreflect ssrfun ssrbool eqtype.
来自 ssreflect。
谢谢。
愚蠢的错误!我有一种我忘记的胁迫;我的实际证明状态是 Nat n = Nat n0 -> n ==n0.