(** Proving that [safe'] implies [safe] (the reverse implication
      only holds if we replace [f] with a coinductive stream) *)

  Definition safe' f := forall i, R (f i) (f (1 + i)).

(* Specifications: *)
Lemma safe'_safe x : (exists f, f 0 = x /\ safe' f) -> safe x.
Lemma safe_safe' x : (forall P, P \/ ~P) -> FunctionalChoice -> safe x -> (exists f, f 0 = x /\ safe' f).
Lemma not_ex_forall {A} (P : A -> Prop) : (~ex P) <-> (forall x, ~P x).
Lemma safeN_S n x : safeN (S n) x -> safeN n x.
Lemma safeN_le n n' x : n <= n' -> safeN n' x -> safeN n x.
Lemma konigsafe x : (forall P, P \/ ~P) -> (forall x, finite (R x)) -> (forall n, safeN n x) -> safe x.