(** The divisibility results are no so complicated when we do not need to show that encode_state is injective ... *)
Local Fact divides_from_eq x y t : x*y = t -> divides x t.
Local Fact prime_div_mult4 p w x y z : prime p -> divides p (w*x*y*z) -> divides p w \/ divides p x \/ divides p y \/ divides p z.
Local Hint Resolve encode_mm_instr_regular'.

Theorem mm_fractran_simulation n P v :
@mm_no_self_loops n (1, P)
-> (1,P) /MM/ (1,v) ↓ <-> encode_mm_instr 1 P /F/ ps 1 * exp 0 v ↓.