Section wf_chains.
Variables (X : Type) (R : X -> X -> Prop).
Inductive chain : nat -> X -> X -> Prop :=
| in_chain_0 : forall x, chain 0 x x
| in_chain_1 : forall n x y z, R x y -> chain n y z -> chain (S n) x z.
Hint Constructors chain : core.
Fact chain_inv_0 x y : chain 0 x y -> x = y.

Corollary chain_snoc n x y z : chain n x y -> R y z -> chain (S n) x z.