Library classic
Require Export Classical Omega.
Lemma exists_minimal: forall (P: nat -> Prop),
(exists n, P n) ->
(exists n, P n /\ forall n', n' < n -> ~ P n').
Proof.
destruct 1.
induction x using (well_founded_induction lt_wf).
destruct (classic (forall n, n < x -> ~ P n)).
eauto.
destruct (not_all_ex_not _ _ H1).
destruct (imply_to_and _ _ H2).
generalize (NNPP _ H4).
intros.
eauto.
Qed.
Lemma exists_minimal: forall (P: nat -> Prop),
(exists n, P n) ->
(exists n, P n /\ forall n', n' < n -> ~ P n').
Proof.
destruct 1.
induction x using (well_founded_induction lt_wf).
destruct (classic (forall n, n < x -> ~ P n)).
eauto.
destruct (not_all_ex_not _ _ H1).
destruct (imply_to_and _ _ H2).
generalize (NNPP _ H4).
intros.
eauto.
Qed.