(* Regular FRACTRAN programs define a deterministic step relation *)

(* Specifications: *)
Lemma fractran_step_fun l x y1 y2 : fractran_regular l -> l // x → y1 -> l // x → y2 -> y1 = y2.
(* Regular FRACTRAN programs deefine a linearly bounded step relation The bound computed in the following proofs is very lazy. Indeed we choose p1+...+pn whereas ideally, one could choose max(ceil(pi/qi)) where l = [p1/q1;...;pn/qn] *)
Lemma fractran_step_bound l : fractran_regular l -> { k | forall x y, l // x → y -> y <= k*x }.
Definition fractran_stop l x := forall z, ~ l // x → z.