Section Reduction.
Variable MX : SMX.SMX (State := State) (Symbol := Symbol).
Variable deterministic_MX : SMX.deterministic MX.
Variable length_preserving_MX : forall s t X s' t' Y b,
In ((s, t, X), (s', t', Y), b) MX -> length (s ++ t) = length (s' ++ t') /\ 1 <= length (s ++ t).
Variable flip_consistent_MX : forall s1 t1 X c b1 s2 t2 c2 b2,
In ((s1, t1, X), c, b1) MX -> In ((s2, t2, X), c2, b2) MX -> b1 = b2.
Local Definition SMX_Instruction := SMX.Instruction (State := State) (Symbol := Symbol).
Definition encode_Symbol (a: Symbol) : bool := if a is zero then false else true.
Definition decode_Symbol (a: bool) : Symbol := if a is false then zero else one.
Definition encode_Stack (s: list Symbol) : list bool := map encode_Symbol s.
Definition decode_Stack (s: list bool) : list Symbol := map decode_Symbol s.

Lemma inverse_simulation_step L R X : exists (x: State) (b_x: bool) (l r: list Symbol) (b_y: bool),
forall L' R' Y, step MN (L, R, X) (L', R', Y) ->
exists (y: State) (l' r': list Symbol),
(L, R, X) = (encode_Stack l, encode_Stack r, to_nat (x, b_x)) /\
(L', R', Y) = (encode_Stack l', encode_Stack r', to_nat (y, b_y)) /\
match b_x, b_y with
| false, false => SMX.step MX (l, r, x) (l', r', y)
| false, true => SMX.step MX (l, r, x) (r', l', y)
| true, false => SMX.step MX (r, l, x) (l', r', y)
| true, true => SMX.step MX (r, l, x) (r', l', y)
end.