proposition: Lemma maybe_reachable_trans' {M} n {m k X X' Y Z} : m + n <= k -> X = X' -> maybe_reachable M n Y Z -> maybe_reachable M m X Y -> maybe_reachable M k X' Z.
proof: Proof. move /reachable_n_mon => H <- HYZ [?|]; first last. { move=> [Z' [HZ' ?]]. right. exists Z'. constructor; last done. apply: H. apply: reachable_n_mon; last by eassumption. by lia. } move: HYZ => [? | [Z' [HZ' ?]]]. { left. apply: H. by apply: reachable_n_trans; eassumption. } right. exists Z'. constructor; last done. apply: H. by apply: reachable_n_trans; 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