简体   繁体   English

Coq:如何将一个假设应用于另一个假设

[英]Coq: how to apply one hypothesis to another

Assume I have two hypotheses in the context, a_b : A -> B and a : A . 假设我在上下文中有两个假设, a_b : A -> Ba : A I should be able to apply a_b to a to gain a further hypothesis, b : B . 我应该能够将a_b应用于a以获得进一步的假设, b : B

That is, given the following state: 也就是说,给定以下状态:

1 subgoal
A : Prop
B : Prop
C : Prop
a_b : A -> B
a : A
______________________________________(1/1)
C

There should be some tactic, foo (a_b a) , to transform this into the following state: 应该有一些策略, foo (a_b a) ,将其转换为以下状态:

1 subgoal
A : Prop
B : Prop
C : Prop
a_b : A -> B
a : A
b : B
______________________________________(1/1)
C

But I don't know what foo is. 但我不知道foo是什么。

One thing I can do is this: 我能做的一件事是:

 assert B as b.
 apply a_b.
 exact a.

but this is rather long-winded, and scales badly if instead of a_b a I have some larger expression. 但这是相当冗长的,如果不是a_b a我有一些更大的表达,那就会严重缩放。

Another thing I can do is: 我能做的另一件事是:

specialize (a_b a).

but this replaces the a_b hypothesis, which I don't want to do. 但这取代了我不想做的a_b假设。

pose proof (a_b a) as B.

应该做你想做的事。

你可以使用“在a中应用a_b”。

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

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