Definition le_f x y :=
exists n, f n = x /\ forall n', f n' = y -> n <= n'.

(* Specifications: *)
Lemma gen (A : list X) :
{ x | ~ x el A /\ forall y, ~ y el A -> le_f x y}.
Lemma gen_le_f A :
forall x, ~ x el A -> le_f (gen' A) x.