is there a `eapply`-like tactic that works on `exists` goals in Coq?

醉酒当歌 提交于 2019-12-24 15:25:14

问题


I have the following during a proof where the goal is an existential, and the target property is one of the assumptions.

H : x ==> y
...
______________________________________(1/2)
exists t : tm, x ==> t

I know I can do exists y. apply H. to prove the current goal, but I am wondering if there is a more intelligent tactic that can use the assumption directly to prove the existential goal here, like eapply H?

Since this is one unification away, it would be nice not having to write the X part in exists X..

If such a tactic does not exist, how do I write one?


回答1:


There exists such a tactic and it is called eexists. It does exactly what you seem to expect.

https://coq.inria.fr/distrib/current/refman/Reference-Manual010.html#hevea_tactic23


Example use:

Variable T : Type.
Variable R : T -> T -> Prop.

Theorem test : forall x y, R x y -> exists t, R x t.
Proof.
  intros. eexists. apply H.
Qed.


来源:https://stackoverflow.com/questions/34216180/is-there-a-eapply-like-tactic-that-works-on-exists-goals-in-coq

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