Section fractran_utils.
Implicit Type l : list (nat*nat).
Fact fractran_step_nil_inv x y : nil /F/ x → y <-> False.
Fact mul_pos_inj_l q x y : q <> 0 -> q*x = q*y -> x = y.
(* Regular FRACTRAN programs define a deterministic step relation *)
(* 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 /F/ x → y -> y <= k*x }.