为什么我不能在假设上应用f_ qual?
在我的假设列表中,我有:
X : Type
l' : list X
n' : nat
H : S (length l') = S n'
我的目标是长度L'= n'
。
因此,我在h 中尝试了f_equal。但是我会收到以下错误:
语法错误:[tatic:ltac_use_default]预期[tatic:tatic]之后(在[vernac:tactic_command]))。
我认为我应该能够应用<我错了代码> f_equal to h
以删除双方的s
?
In my list of hypothesis, I have:
X : Type
l' : list X
n' : nat
H : S (length l') = S n'
My goal is length l' = n'
.
So I tried f_equal in H
. But I get the following error:
Syntax error: [tactic:ltac_use_default] expected after [tactic:tactic] (in [vernac:tactic_command]).
Am I wrong in thinking I should be able to apply f_equal
to H
in order to remove the S
on both sides?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
f_equal
是关于平等的一致性。它可用于证明fx = f y
来自x = y
。但是,它不能用于从fx = f y
中推导x = y
,因为这通常不正确,只有当f
是注入时。这是一种特殊的情况,因为
s
是归纳类型的构造函数,并且构造函数确实是注入性的。例如,您可以使用反转H
之类的策略来获得所需的平等。涉及
f_equal
的另一个解决方案是应用一个删除s
喜欢的函数,然后使用
f_equal
is about congruence of equality. It can be used to provef x = f y
fromx = y
. However, it cannot be used to deducex = y
fromf x = f y
because that is not true in general, only whenf
is injective.Here it is a particular case as
S
is a constructor of an inductive type, and constructors are indeed injective. You could for instance use tactics likeinversion H
to obtain the desired equality.Another solution involving
f_equal
would be to apply a function that removes theS
likeand then use
f_equal
告诉您,如果x = y
,则fx = f y
。换句话说,当您有x = y
和需要fx = f y
时,您可以使用> f_equal
。您的情况是相反的。您有
fx = f y
,并且您需要x = y
,因此您不能使用f_equal
。如果您考虑自己的结论,那么只有当
s
是注射时才正确。您需要其他策略。f_equal
tells you that ifx = y
, thenf x = f y
. In other words, when you havex = y
and needf x = f y
, you can usef_equal
.Your situation is the reverse. You have
f x = f y
and you needx = y
, so you can't usef_equal
.If you think about your conclusion, it is only true when
S
is an injection. You need a different tactic.