The Finite_sets library of Coq has an inductive type, specifying that some ensemble is finite:
Inductive Finite : Ensemble U -> Prop :=
| Empty_is_finite : Finite (Empty_set U)
| Union_is_finite :
forall A:Ensemble U,
Finite A -> forall x:U, ~ In U A x -> Finite (Add U A x).
I am trying to prove that membership in a finite set is decidable as follows:
Lemma Finite_dec (A:Type) : forall f:Ensemble A, Finite A f ->
forall x:A, {In A f x} + {~In A f x}.
Proof.
intros.
induction H.
However, Coq produces the following error message:
Cannot find the elimination combinator Finite_rec, the
elimination of the inductive definition Finite on sort Set is
probably not allowed.
My question is, why is Coq not able to generate an elimination combinator for Finite? What is required of an inductive type for this to be possible?
Note: I need an elimination combinator for a different type, which is very similar to Finite, but do not know how to construct this.