1

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?

thor
  • 21,418
  • 31
  • 87
  • 173

1 Answers1

4

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.
Ptival
  • 9,167
  • 36
  • 53
  • Thanks for the answer. It seems that `eexists` is the same with `exists`. I still have to do `eexists y. apply H`, and need to figure out the unification, i.e. `y` myself. It would be nice if I can do something like `eexists H.` or even just `eassumption` to complete the unification. – thor Dec 11 '15 at 11:48
  • 1
    @tinlyx I added an example, you don't need to specify `y`. – Ptival Dec 11 '15 at 12:39
  • Thanks. An extra question. Is there a way to avoid the `apply H` part? I can imagine something like `eassumption` that tries `apply` on every assumption. I tried `assumption` and got `Error: No such assumption.` – thor Dec 11 '15 at 13:04
  • @tinlyx `eexists. eassumption.` works perfectly for the above example. `eauto.` works too, btw. – Anton Trunov Dec 15 '15 at 20:05