Unification for modal logic K is undecidable. A short note
Pawel Pawlowski
cs.LO
Dec 1, 2026 · v1
TL;DR
Full proof of undecidability of unification in modal logic K, including the Markov–Post theorem, formalized in Lean 4 with Mathlib, produced with LLM assistance.
Abstract
We show that unification in the modal logic K is undecidable. On 9.09.2026 we started working on the problem of decidability of unification. After long hours of back and forth, using a custom harness and browser interactions, we arrived at the proof on 29.11.2026. Here we present a short note with an accompanying Lean formalization. It is not the original proof that the LLMs managed to construct. The original proof was very convoluted and not easy for us to read. Here we present a simplification, which we obtained in a dialogue with the models. Later we plan to develop a full paper, since we also obtained more results in the vicinity of this problem, which still need to be properly checked.
Problem
Whether unification in the basic modal logic K is decidable was a long-standing open problem in modal and description logic. Wolter and Zakharyaschev called it a major open question.
Approach
The authors reduce the word problem for finitely presented monoids, which is undecidable by Markov and Post, to unification in K. For words u and v they build a one-variable formula that is unifiable exactly when u and v are equal in the monoid. The proof was found together with LLMs (ChatGPT and Claude models) through a custom harness. The authors and the models then simplified it and formalized it in Lean 4 with Mathlib.
Results
Unification in K is undecidable, already for formulas in one variable. The Lean formalization covers the whole proof, including deriving the Markov–Post theorem from the undecidability of the halting problem. It is available on GitHub.