在 Coq 中是否有一种类似“eapply”的策略适用于“存在”目标?

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

我在目标是存在的证明中有以下内容,目标 属性 是假设之一。

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

我知道我可以exists y. apply H.来证明当前目标,但我想知道是否有更聪明的策略可以直接使用假设来证明这里存在的目标,比如eapply H?

因为这是一个统一,所以不必在 exists X. 中编写 X 部分就好了。

如果不存在这样的策略,我该如何编写?

有这样一种战术,叫做eexists。 它完全符合您的预期。

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


使用示例:

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.