Summary (Overview)

  • First autonomous multi-agent formalization of a research-level theorem in theoretical physics: the fundamental theorem of matrix-product states (FT-MPS), verified in the Lean 4 proof assistant.
  • Team of six specialized LLM agents (orchestrator, proof writer, library scout, simplifier, blueprint synchronizer, reviewer) coordinated via a shared mathematical blueprint and persistent memory, with only intermittent human oversight.
  • Novel proof discovery: The system autonomously proved the injective case of FT-MPS via the Skolem-Noether theorem, an approach not standard in the literature.
  • Extensive library development: Produced TNLean, a Lean 4 tensor-network library of ~227,000 lines, including quantum information infrastructure (completely positive maps, quantum Perron-Frobenius theory, quantum Wielandt bound).
  • Physical application: Extended the formalization to symmetry-protected topological (SPT) phases, proving a cohomological invariant theorem for injective symmetric MPS.

Introduction and Theoretical Foundation

Background

Proof assistants (e.g., Lean 4, Coq) verify mathematical arguments step-by-step. While AI systems have automated proofs for competition problems and isolated lemmas, research-level formalizations (e.g., Liquid Tensor Experiment, Fermat's Last Theorem) have remained primarily human-led efforts requiring months or years of expert work.

Key challenge: Theoretical physics results often lack the mathematical rigor of pure mathematics, requiring formalization to "fill in" informal reasoning with rigorous, machine-checkable statements.

The Fundamental Theorem of Matrix-Product States (FT-MPS)

A translationally invariant matrix-product state (MPS) on NN sites with periodic boundary conditions is parameterized by a rank-3 tensor AA:

ψN(A)=i1,,iN=0d1tr(Ai1Ai2AiN)i1iN(1)|\psi_N(A)\rangle = \sum_{i_1,\dots,i_N=0}^{d-1} \operatorname{tr}\left(A^{i_1} A^{i_2} \dots A^{i_N}\right) |i_1 \dots i_N\rangle \tag{1}

where A=i=0d1AiiA = \sum_{i=0}^{d-1} A^i |i\rangle and AiMD(C)A^i \in M_D(\mathbb{C}) (the space of D×DD \times D complex matrices). Here dd is the local Hilbert-space dimension and DD is the bond dimension.

Key definitions:

  • Transfer operator: EA:MD(C)MD(C)E_A: M_D(\mathbb{C}) \to M_D(\mathbb{C}) defined by EA(X)=i=0d1AiX(Ai)E_A(X) = \sum_{i=0}^{d-1} A^i X (A^i)^\dagger
  • Normal tensor: AA is normal if EAE_A has spectral radius 1 and a unique eigenvalue λ\lambda with λ=1|\lambda| = 1
  • Canonical form (CF): Ai=k=1rμkAkiA^i = \bigoplus_{k=1}^{r} \mu_k A_k^i where μkC\mu_k \in \mathbb{C} and AkA_k are normal tensors

Theorem 1 (Fundamental Theorem of MPS, equal case): Let AA and BB be two tensors in CF. Then AA and BB generate the same MPV family, ψN(A)=ψN(B)|\psi_N(A)\rangle = |\psi_N(B)\rangle for every N1N \geq 1, if and only if there exists an invertible matrix XX such that for all i=0,1,,d1i = 0, 1, \dots, d-1:

Bi=XAiX1(2)B^i = X A^i X^{-1} \tag{2}

Methodology

Multi-Agent Architecture

The system (built on TeXRA software) employs six specialized agent roles:

AgentFunctionModel Tier
OrchestratorAssigns tasks, combines results, manages workflowMost capable
Proof Writer (lean)Constructs Lean proofs, responds to type-checking feedbackMost capable, most expensive
Library Scout (leanSearch)Surveys Mathlib for existing lemmas and resultsInexpensive
Simplifier (leanSimplifier)Refactors code, extracts reusable strategies, retires failed attemptsInexpensive
Blueprint Synchronizer (leanBlueprint)Keeps blueprint prose aligned with Lean declarationsInexpensive
ReviewerAutomated cross-checking of claims against literatureRuns automatically

Coordination Patterns

Three recurring orchestration patterns:

  1. Parallel dispatch (Fig. 4a): Independent subtasks T1,,TrT_1, \dots, T_r dispatched to workers on disjoint scopes
  2. Scout-then-prove (Fig. 4b): Inexpensive scout surveys library, emits design memo; expensive prover invoked only after feasible route identified
  3. Review-repair cycles (Fig. 4c): Reviewer flags issues, fixer applies patches; loop terminates on acceptance or after 5 iterations

Blueprint and Persistent Memory

  • Blueprint: A human-readable mathematical specification linking definitions, theorem statements, and dependencies to Lean code. Serves as the interface between literature and formalization.
  • Persistent memory: Records scouting results, proof strategies, counterexamples, and technique notes across sessions (bounded working periods).
  • Human oversight: Strategic only (not tactical) — the supervisor reviews the blueprint, sets mathematical intent, but never writes Lean code or chooses proof tactics.

Empirical Validation / Results

Formalization Scale

  • Core development: ~62,000 lines of code, 2,300 declarations, 233 files
  • Full TNLean library: ~227,000 lines
  • Blueprint: 12 chapters, 150 pages
  • Cost: 20,206totalAPIcost(20,206 total API cost (5,548 for FT-MPS alone)
  • Verification: Every step of the FT-MPS proof chain verified with no remaining sorry markers

Key Findings on Challenges

1. Weakening of theorems: The agents initially proved FT-MPS under a "doubly stochastic gauge" assumption (requiring both unital and trace-preserving transfer operators simultaneously, which is impossible for generic MPS tensors). This produced a formally correct but narrower theorem.

2. Finite vs. asymptotic limits: Early attempts replaced finite-NN MPV comparisons with asymptotic norm comparisons, which proved statements with wrong hypotheses. The correct proof keeps comparisons at fixed finite NN.

3. Edge cases: Proof assistants require explicit handling of edge cases (D=0D=0, N=0N=0) that carry no physical meaning; adding assumptions D1D \geq 1 and N1N \geq 1 removed large irrelevant proof branches.

4. Blueprint-Lean misalignment: Several reviews found discrepancies where Lean statements were correct but blueprint prose had drifted.

Novel Proof Route

The injective case of FT-MPS was proven via the Skolem-Noether theorem (about automorphisms of central simple algebras), leveraging Mathlib's existing ring-theory library. This is not the standard approach in the MPS literature.

Physical Application: SPT Phases

Theorem 2 (A cohomological invariant from injective symmetric MPS): Let AA be an injective MPS tensor of bond dimension D1D \geq 1, and U:GGLd(C)U: G \to GL_d(\mathbb{C}) an onsite linear representation of a finite group GG. Define A~gi:=jU(g)ijAj\widetilde{A}_g^i := \sum_j U(g)_{ij} A^j. If AA is invariant under UU (i.e., ψN(A)=ψN(A~g)|\psi_N(A)\rangle = |\psi_N(\widetilde{A}_g)\rangle for all gGg \in G, N1N \geq 1), then for each gGg \in G there is an invertible matrix X(g)GLD(C)X(g) \in GL_D(\mathbb{C}), unique up to a nonzero scalar, such that:

A~gi=X(g)AiX(g)1(3)\widetilde{A}_g^i = X(g) A^i X(g)^{-1} \tag{3}

With ρ(g):=X(g1)\rho(g) := X(g^{-1}), the maps ρ(g)\rho(g) form a projective representation with 2-cocycle ω(g,h)C×\omega(g,h) \in \mathbb{C}^\times. The cohomology class [ω]H2(G,C×)[\omega] \in H^2(G, \mathbb{C}^\times) is unchanged by rescaling gauges and depends only on the symmetric tensor AA with on-site action UU.


Theoretical and Practical Implications

For Autoformalization

  • Mathematical intent is the main bottleneck: The paper demonstrates that "enforcing the correct mathematical intent" — not individual lemma proofs — is the primary challenge in large-scale autoformalization. Lean checks proofs but not statement choices.
  • Definitions are more dangerous than proofs: Confirms Buzzard's warning in a concrete setting; incorrect definitions propagate errors through hundreds of downstream lemmas.
  • Context window constraints: No LLM context window can hold source literature + blueprint + growing formal library simultaneously, necessitating the multi-agent split with persistent memory.
  • Blueprint as essential infrastructure: Review and blueprint synchronization are not auxiliary but central to correctness at scale.

For Physics

  • TNLean library provides verified infrastructure for tensor-network theory, quantum information (CP maps, Perron-Frobenius theory), and quantum many-body physics.
  • SPT classification: The formalization of the cohomological invariant connects FT-MPS to the classification of 1D bosonic SPT phases, with natural extensions to parent Hamiltonians and gapped paths.

Cost-Effectiveness

The recorded cost of 20,206(withFTMPSaloneat20,206 (with FT-MPS alone at 5,548) represents a significant reduction compared to traditional human-led formalization efforts spanning months or years.


Conclusion

This work demonstrates that a team of specialized AI agents, coordinated through a shared blueprint with sporadic human supervision, can autonomously formalize research-level theorems in theoretical physics. The FT-MPS formalization succeeded with:

  • Novel proof discovery (Skolem-Noether route for injective case)
  • Extensive library development (TNLean, ~227,000 lines)
  • Physical applications (SPT phase classification)

Key insight: The main bottleneck is not proof search but enforcing mathematical intent — ensuring the formalized statement matches the intended theorem. This requires blueprint review, automated cross-checking, and strategic human oversight.

Future directions:

  • Formalization of FT-MPS with boundaries, higher-dimensional tensor-network states, parent Hamiltonians, matrix-product operators
  • Larger targets: low individual degree test, MIP^* = RE theorem
  • The released technique notes and distilled memory files are project-independent and can seed other autoformalization efforts

Related papers