Definition list2set {U} (l: list U) : Ensemble U :=
fun x => List.In x l.
Program Definition ff U (F: Ensemble U) (l : sig (@NoDup (sig F))) : sig (@NoDup U) :=
(map (@proj1_sig _ _) (proj1_sig l)).
Next Obligation.
induction H. constructor.
simpl.
constructor.
contradict H.
clear - H.
induction l; simpl in H. contradiction.
destruct H; simpl; [left | right].
destruct a; destruct x; simpl. apply exist_ext; auto.
apply IHl. auto.
auto.
Qed.

(* Specifications: *)
Lemma NoDup_finite:
forall U (F: Ensemble U), Finite F -> Finite (fun l: sig (@NoDup _) => Forall F (proj1_sig l)).
Lemma finite_list_bound:
forall U (F: Ensemble U), Finite F -> Finite (list_bound F).
Lemma finite_expr_bound:
forall n, Finite n -> Finite (expr_bound n).
Lemma finite_pure_bound: forall n, Finite n -> Finite (pure_bound n).
Lemma finite_space_bound: forall n, Finite n -> Finite (space_bound n).
Lemma finite_pures_bound: forall n, Finite n -> Finite (pures_bound n).
Lemma finite_spaces_bound: forall n, Finite n -> Finite (spaces_bound n).
Lemma clause_bound_finite: forall n, Finite n -> Finite (clause_bound n).
Definition var2nat v := nat_of_P (id2pos v).
Lemma Finite_var_upto:
forall v, Finite (var_upto v).