coqcoqide

Have problem with unable to use destruct tatic in a Definition


I am working with a definition in coq which need to yield something from a Theorem, but cannot destruct in the definition.

Theorem sp : forall (X : Type) (T : X -> Prop)..... , exists (a : X), T a.
Definition yield_sp : (X : Type) (T : X -> Prop) (H : sp X T .....)..... : X.

When I try to destruct H, coq warns that

Case analysis on sort Type is not allowed for inductive definition ex.

I would like to know the reason for it, and further, how to use definition to yield an element from an "exists" proposition.


Solution

  • You cannot extract the witness out of an existence proof. There are a few options: