(**************************************************************)
(*   Copyright Dominique Larchey-Wendling [*]                 *)
(*                                                            *)
(*                             [*] Affiliation LORIA -- CNRS  *)
(**************************************************************)
(*      This file is distributed under the terms of the       *)
(*         CeCILL v2 FREE SOFTWARE LICENSE AGREEMENT          *)
(**************************************************************)
(** ** Reflexive transitive closure is Diophantine *)
Set Implicit Arguments.
Local Notation power := (mscal mult 1).
Section df_seq.
(** If R is a diophantine binary relation then the predicate fun c q n => is_seq R c q n is also diophantine. It states that the first (n+1) digits of c in base q say x0,...,xn form a R-sequence, ie x0 R x1 R ... R xn *)
Variable (R : nat -> nat -> Prop) (HR : 𝔻R (fun ν => R (ν 1) (ν 0))).

(* Specifications: *)
Theorem dio_rel_is_seq c q n : 𝔻P c -> 𝔻P q -> 𝔻P n
-> 𝔻R (fun ν => is_seq R (c ν) (q ν) (n ν)).