(** 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'.

Lemma one_step_backward m i P i1 v1 st :
@mm_no_self_loops m (i, P)
-> encode_mm_instr i P /F/ @encode_state m (i1,v1) → st
-> exists i2 v2, st = @encode_state m (i2,v2)
/\ (i, P) /MM/ (i1, v1) → (i2,v2).