Combining two Coq hypotheses

▼魔方 西西 提交于 2019-12-07 21:54:52

问题


So I have two hypotheses, one that is h : A -> B, and the other which is h2 : A. How can I get h3 : B to appear in my hypotheses?


回答1:


pose proof (h h2) as h3.

introduces h3 : B as a new hypothesis,

specialize (h h2).

modifies h : A -> B into h : B -- this can be useful if you won't need h later, and symmetrically,

apply h in h2.

converts h2 : A into h2 : B.

Another (not very convenient) way would be to

assert B as h3 by exact (h h2).

That's what the pose proof variant is equivalent to.

Also, in a simple case like the following, you can solve your goal without introducing a new hypothesis:

Goal forall (A B : Prop), (A -> B) -> A -> B.
  intros A B h h2.
  apply (h h2).
Qed.


来源:https://stackoverflow.com/questions/40448703/combining-two-coq-hypotheses

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!