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 {x y} :
reachable MN x y -> x = y \/
let '(L, R, X) := x in let '(L', R', Y) := y in
exists (x y: State) (b_x b_y: bool) (l r 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.reachable MX (l, r, x) (l', r', y)
| false, true => SMX.reachable MX (l, r, x) (r', l', y)
| true, false => SMX.reachable MX (r, l, x) (l', r', y)
| true, true => SMX.reachable MX (r, l, x) (r', l', y)
end.