I am working on a tactic that would create two new hypothesis
x0 : D
x0_Linked : P x0
from an hypothesis of that form
H : forall x : D, P x
Here is my Ltac code :
Ltac mytactic h t x :=
match type of h with
| (forall (_: ?X1), _) => evar (x : X1) ; pose ( t := h x )
| _ => idtac "Erreur: Aucun pour tout decomposable dans l'hypothese."
end
.
were h
is the hypothesis to decompose, x
the name of the new variable and t
the name of the new hypothesis. The tactic works as intended but at the end of the proof I get this :
testproof< exact H0.
All the remaining goals are on the shelf.
1 subgoal
subgoal 1 is:
D
The evar
tactic seem to have created a new type named D instead of using the existing one. Note that if I use
Coq< Variable x0 : D.
in coqtop instead it works perfectly.