(*! Indexed version of safety (not needed here) *)

Inductive iter {X} (R : Rel X) : nat -> Rel X :=
  | iter_O x : iter R O x x
  | iter_S n x y z : R x y -> iter R n y z -> iter R (S n) x z.(*! Indexed version of safety (not needed here) *)

Inductive iter {X} (R : Rel X) : nat -> Rel X :=
  | iter_O x : iter R O x x
  | iter_S n x y z : R x y -> iter R n y z -> iter R (S n) x z.(*! Indexed version of safety (not needed here) *)

Inductive iter {X} (R : Rel X) : nat -> Rel X :=
  | iter_O x : iter R O x x
  | iter_S n x y z : R x y -> iter R n y z -> iter R (S n) x z.Definition safe_ n {X} (R : Rel X) x := forall y m, m < n -> iter R m x y -> exists z, R y z.

Lemma safe_S {X} (R : Rel X) n x : safe_ (S n) R x -> safe_ n R x.