3

During a proof, I come to a situation where the current goal/subgoal turned out to be useful in a later stage of the same theorem.

Is there a tactic to "save" the current goal as a lemma as if the current goal is asserted?

Of course, I can copy&paste to assert the goal explicitly, or write a separate Lemma before the current theorem. But I am just curious if shortcuts exist.

Thanks.

thor
  • 21,418
  • 31
  • 87
  • 173

3 Answers3

1

To my knowledge, there is no such feature in Coq, and neither CoqIDE nor ProofGeneral seems to provide one.

Vinz
  • 5,997
  • 1
  • 31
  • 52
1

Leaving this answer for future reference.

I don't know since when it exists, but maybe the abstract tactic could help. It allows you to name a part of the proof and re-use it later, even if you are in a different sub-goal.

frabala
  • 369
  • 4
  • 13
0

If you are using Proof General, you can install a company-coq extension which provides this functionality. It is bound the C-c C-a C-x key sequence.

krokodil
  • 1,326
  • 10
  • 18