proposition: Lemma reachable_n_trans {M} n m X Y Z : reachable_n M n X Y -> reachable_n M m Y Z -> reachable_n M (n+m) X Z.
proof: Proof. elim: n X Y. { move=> X Y /=. move Hn: (0) => n HXY. case: HXY Hn; [done | by lia]. } move=> n IH X Y /=. move Hn': (S n) => n' HXY. case: HXY Hn' => [| {}n' {}X Y1 Y2] *. { apply: reachable_n_mon; last by eassumption. by lia. } have ?: n' = n by lia. subst n'. apply: reach_step; first by eassumption. by apply: IH; eassumption. Qed.
imports: List Lia Relation_Operators Undecidability.StackMachines.Util(Nat_facts List_facts) Undecidability.StackMachines.Reductions.CM1_HALT_to_SMNdl_UB.SMX ssreflect ssrbool ssrfun