(*
Fact dio_rel_compose (R T : nat -> nat -> (nat -> nat) -> Prop) :
     dio_rel (fun ν => R (ν 0) (ν 1) (fun n => ν (S (S n))))
  -> dio_rel (fun ν => T (ν 0) (ν 1) (fun n => ν (S (S n))))
  -> dio_rel (fun ν => exists x, R (ν 0) x (fun n => ν (S (S n))) /\ T x (ν 1) (fun n => ν (S (S n)))).
Proof.
  intros H1 H2.
  apply dio_rel_exst, dio_rel_conj.
  + revert H1; apply dio_rel_ren with (f := fun n => match n with 0 => 1 | 1 => 0 | S (S n) => S (S (S n)) end).
  + revert H2; apply dio_rel_ren with (f := fun n => match n with 0 => 0 | 1 => 2 | S (S n) => S (S (S n)) end).
Defined.
*)

Fact dio_rel_power_subst a b (R : nat -> (nat -> nat) -> Prop) : 
                  𝔻P a -> 𝔻P b
      -> 𝔻R (fun ν => R (ν 0) (fun n => ν (S n)))
      -> 𝔻R (fun ν => R (power (a ν) (b ν)) ν).

Lemma dio_rel_rel_iter n x y : 𝔻P n -> 𝔻P x -> 𝔻P y -> 𝔻R (fun ν => rel_iter R (n ν) (x ν) (y ν)).