Formal Verification of Algebraic Complexity Class Separation: What Lean 4 Proves About VP vs. VNP

    This article examines a formally verified result in Lean 4 claiming that the algebraic complexity classes VP and VNP differ over any field, addressing the long-standing Valiant conjecture. It explains the algebraic background behind the result, including determinants, permanents, and arithmetic circuits, outlines the main proof strategy and its key reductions, and walks through how formal verification turns a mathematical argument into machine-checkable code. Developers will find practical takeaways on layered proofs, trusted checking, and building reliable systems around formal invariants.

    1. What Happened: An Algebraic P/NP Separation, Formally Verified

    A recent result produced independently by an AI programming and automated reasoning system has drawn attention: over any field, the algebraic complexity classes VP and VNP are not equal. This resolves the algebraic counterpart of the long-standing P versus NP question, corresponding to the Valiant conjecture in theoretical computer science, and the entire argument has been formalized end to end in Lean 4 and checked by machine.

    It is worth emphasizing that this result has not yet gone through the traditional manual peer review process used by human mathematicians. Its significance lies in demonstrating a viable path of “automated proof discovery plus formal verification.”

    For developers, the most interesting part is not the mathematical result itself, but the engineering paradigm behind it: decompose a complex argument into composable lemmas, constrain every inference step with a type system, and let the machine do the checking. This closely mirrors the software engineering idea of using types and tests to guarantee correctness, except that the objects being asserted are mathematical propositions rather than program behavior.

    2. Problem Setup: Determinants, Permanents, and Arithmetic Circuits

    To understand the result, start with linear algebra. For a 2×2 matrix, the determinant is ad−bc. Replace the minus sign with a plus sign and you get ad+bc, which is the permanent. As the dimension grows, the number of terms in both expansions explodes, but their computational complexity is completely different: the determinant can be computed in polynomial time via Gaussian elimination, while the permanent is believed to have no equally efficient algorithm.

    In algebraic complexity theory, the objects of computation are usually written as families of polynomials, and the computational model is the arithmetic circuit: a directed acyclic graph consisting of addition gates, multiplication gates, and constant gates, with variables as inputs and a target polynomial as output. If a family of polynomials can be computed by circuits whose size (number of gates) is bounded by a polynomial, it belongs to VP. Counting-type polynomial families such as the permanent and the Hamiltonian cycle polynomial form VNP. Whether VP equals VNP is the algebraic version of P versus NP.

    The lower bound established by this result can be stated as follows: over the real numbers and over any field of characteristic not equal to 2, the number of gates required by arithmetic circuits computing the m×m permanent is lower bounded on the order of m raised to c·(log m)^(1/3) (where c is a positive constant). For the Hamiltonian cycle polynomial, the corresponding super-polynomial lower bound holds over fields of any characteristic. Since the lower bound grows faster than any polynomial, neither the permanent nor the Hamiltonian cycle polynomial belongs to VP, which means VP is a proper subset of VNP.

    3. Key Abstractions in the Proof: From Attacking the Target to Constructing Intermediate Polynomials

    The proof does not attack the permanent directly. Instead, it performs two steps of “problem transformation,” a common strategy in complexity lower-bound proofs:

    1. Reduce the target polynomial to a polynomial related to network connectivity.
    2. Or reduce it to a universal automaton polynomial with weighted halting branches.

    The argument then handles two geometric cases:

    • Flat case: Euclidean distance can represent the spectral point distance of a tensor. Using routing networks on the complete graph and properties of tensor rank for balanced separators, the proof derives a super-polynomial gate-count lower bound.
    • Contracting case: The geometric distance exhibits contraction, which yields a class of Poincaré inequalities and translates into re-routing rules for tree-like networks.

    This method of “first constructing an object that is harder to analyze but has clearer structure, then transferring the lower bound back to the original problem” is similar to introducing an intermediate representation (IR) in engineering and then optimizing: the intermediate layer makes constraints explicit and easier for the machine to verify step by step.

    4. Formal Verification: Writing the Proof as Checkable Code

    Interactive theorem provers such as Lean 4 express mathematical propositions as types and proofs as programs. The core benefit is “trusted checking”: as long as the kernel and axioms are consistent, the machine can confirm each inference one by one. A schematic proof skeleton looks like this (illustrative of structure only, not a real interface):

    1. theorem vp_ne_vnp :
    2. ∀ (F : Field), VP F ≠ VNP F := by
    3. intro F
    4. -- 1. Reduce to the network connectivity polynomial
    5. -- 2. Establish lower bounds in the flat and contracting cases
    6. -- 3. Use the super-polynomial lower bound to show membership outside VP
    7. sorry

    In practical engineering, the process typically follows these steps:

    1. Formalize the foundational library: define fields, polynomial families, arithmetic circuits, and size measures.
    2. Layer the lemmas: split the big theorem into small lemmas that can be verified independently, reducing the cost of a single check.
    3. Automate with tactics: use rewriting, congruence, and linear algebra tactics to handle repetitive patterns.
    4. Continuous integration: run machine checks on every commit to prevent proof “rot.”
    5. Reproducible builds: pin dependency versions and compiler flags so that others can re-run the verification.

    5. Takeaways for Developers

    • Correctness can be mechanized: complex systems can borrow the idea of “propositions as types, proofs as programs,” expressing key invariants as checkable formal assertions.
    • Lower bounds transfer to performance engineering: circuit-size lower bounds remind us that problem structure determines the upper limit of algorithms, so before optimizing we should first judge whether a polynomial-time shortcut exists.
    • Approximations and boundary cases matter: the original work also extends the result to the closure under approximation by formal Laurent series, showing that in engineering “approximately correct” and “strictly correct” must be modeled separately.
    • A new human-AI collaboration paradigm: automated reasoning handles search and construction, formal verification tools act as gatekeepers, and humans handle problem selection and explanation.

    In summary, the significance of this event goes beyond separating two complexity classes. It also validates the closed loop of “automated research plus machine verification.” For technical teams, a practical starting point is to pilot formal verification internally, beginning with core invariants and key protocol proofs, and gradually build trusted software engineering capabilities.