Draft — mutable and not usable as a dependency; its citation marks the draft state.

The Immerman–Vardi theorem

lax-979537·formalized by Szymon Toruńczyk @szymtor·Codex 6·created 2026-09-08·GitHub @82ef67e·Lean v4.30.0 epoch · mathlib c5ea00351c28

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this submission may be incorrect.

No flags have been submitted.

    Community review

    Flag this submission

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    Abstract

    This submission proves the Immerman–Vardi theorem: on finite linearly ordered relational structures, a query is definable in first-order logic with least fixed points if and only if it is decidable in deterministic polynomial time. The statement covers queries of every fixed arity, including Boolean queries.

    The concepts specify finite ordered structures, syntactically positive fixed-point formulas and their semantics, an explicit dense binary encoding, and polynomial time using mathlib's finite Turing machines. Empty universes and nullary relations are included.

    Both computational directions are proved. A concrete Turing-machine decoder and relation-table evaluator decide each fixed FO(LFP) query in polynomial time. Conversely, a finite positive rule system represents the initialized, polynomially bounded computation of an arbitrary finite multi-stack Turing machine. Its least fixed point is proved equal to the encoded computation; an accepting-output formula defines the query on sufficiently large domains, and finite diagrams handle the remaining domains.

    The proofs include the fixed-point laws, positivity and monotonicity, encoding injectivity, and the simulation and runtime arguments. The main theorems use only Lean's standard background axioms, with no unproved simulation assumptions.

    Concepts

    Concept map

    Proven claimDefinitionThis submissionOther submissionA → B: B builds on A

    Proofs

    Proof networkview on GitHub

    assumptions conclusionProven claimStatement 1, 2, … of a claim with several statementsThis submissionProof — click to open

    Proof code is not displayed; the archive records each proof's checked relationship between claims.

    Related submissions

    Submission map

    This submissionOther submissionA → B: B's concepts build on A

    Cite this

    @misc{lax-979537,
      author = {Szymon Toruńczyk and Codex 6},
      title = {The Immerman–Vardi theorem},
      year = {2026},
      howpublished = {Lax Archive, lax-979537},
      url = {https://laxarchive.org/lax-979537/},
      note = {draft},
    }

    References

    1. Leonid Libkin. Elements of Finite Model Theory. Springer, 2004. doi:10.1007/978-3-662-07003-1 · homepages.inf.ed.ac.uk/libkin/fmt/fmt.pdf
    2. Neil Immerman. Relational Queries Computable in Polynomial Time. Information and Control 68(1–3):86–104, 1986. doi:10.1016/S0019-9958(86)80029-8 · people.cs.umass.edu/~immerman/pub/query.pdf
    3. Moshe Y. Vardi. The Complexity of Relational Query Languages. In Proceedings of the Fourteenth Annual ACM Symposium on Theory of Computing 137–146, 1982. doi:10.1145/800070.802186 · cs.rice.edu/~vardi/papers/stoc82.pdf

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…