ZICQ
中 Log in / Sign up
Newsroom Paper Frontier Research #Mathlib #Lean 4 #AI Research Agents #Knowledge Compression #Formal Mathematics

AI Agents Reuse Mathlib Theorems Effectively but Contribute High-Debt Proofs

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published:

中文阅读 (Chinese) English Version
Co-reading Select any sentence in the article to highlight, annotate, or copy a quote card. Join discussion ↓

Summary:The paper turns Lean’s Mathlib into a dependency graph linking theorems, definitions, lemmas, and their call relationships. It introduces conceptual, technical, and deductive dimensions of knowledge compression, then defines compression debt to capture how much proof content remains written inline instead of being decomposed into reusable named lemmas. Across 192 main theorems generated by OpenAI’s AI agents, main theorems from 51 human-led projects, and all 156,127 theorems in Mathlib, the stu


The central weakness of OpenAI’s AI agents in Lean/Mathlib mathematics is not whether a proof passes the Lean checker, but whether the result becomes a low-debt component that later work can reuse directly. By comparing 192 AI-generated main theorems, main theorems from 51 human-led projects, and all 156,127 theorems in Mathlib, the paper identifies a clear selection-versus-contribution asymmetry: AI behaves much like humans when choosing reusable dependencies, but contributes substantially less modular knowledge.

Core finding: consuming reusable knowledge is not the same as producing it

The study establishes three main results. First, every author group is less likely to build on a theorem with higher compression debt. As debt rises, the theorem becomes less likely to be called directly by later work.

Second, after conditioning on theorem length, the compression debt of theorems selected by AI agents is similar to that of theorems selected by human authors. This suggests that AI does not inherently prefer older, monolithic results. On the dependency-selection side, it can identify the more modular parts of the human mathematical commons.

Third, the gap appears when AI contributes new theorems. For similarly sized problem statements, AI-authored proofs are roughly 20 times longer than human-authored proofs and carry substantially higher compression debt. In other words, AI agents are good at calling existing building blocks but tend to deliver a large, difficult-to-refine proof rather than a reusable knowledge unit. Lean can verify that this proof is correct; it does not automatically reorganize it into a form future agents will want to call.

Measurement mechanism: turning Mathlib into a knowledge dependency graph

Mathlib provides an unusually precise substrate for studying reuse. Theorems, definitions, lemmas, and other declarations form nodes in a dependency graph, while theorem calls form directed edges. Instead of inferring citations from natural-language prose, researchers can observe which formal results a proof actually relies on and whether a new theorem leaves reusable interfaces behind.

The paper separates knowledge compression into three dimensions:

  • Conceptual compression asks whether a statement expresses the problem through more general concepts rather than case-specific descriptions.
  • Technical compression asks whether intermediate work is captured by named definitions and lemmas instead of being re-derived in every proof.
  • Deductive compression asks whether the logical chain is organized through calls to existing named results rather than remaining inside one indivisible proof body.

On this basis, compression debt measures how much proof content remains written inline instead of being decomposed into named lemmas that later work can invoke. It is not simply a line-count metric. A long proof can remain structurally reusable if most of its content is already represented by named dependencies. A shorter proof can still carry high debt if it contains substantial irreducible inline derivation.

The collected abstract does not disclose the exact formulas, weighting scheme, normalization, or uncertainty estimates, so the underlying scores cannot be reproduced from this material alone. At an engineering level, however, compression debt can be understood as the gap between reusable structure already extracted from a proof and residual work still embedded in the proof body.

Why passing Lean is not enough

Formal proofs have two independent quality dimensions. The first is correctness: whether every derivation step is accepted by the Lean kernel. The second is knowledge organization: whether the proof has been decomposed into clearly specified components that can be retrieved, called, reviewed, and maintained. The first is guaranteed by the proof checker; the second is not.

This distinction explains the paper’s practical significance. An AI-generated theorem may be formally valid while imposing substantial maintenance costs. To reuse one section of a monolithic proof, a later system may have to copy text, realign variables, reconstruct local assumptions, and propagate changes to several duplicated locations. Calling a named lemma introduces an explicit dependency edge, but confines most updates to a stable interface and a limited number of call sites.

The study also finds that later human review and maintenance shorten proofs by only a few percent over several years—far from closing the debt gap between AI and human contributions. Post-hoc polishing is therefore not a sufficient strategy. Decomposition must move upstream into agent planning, retrieval, and proof generation.

Interpreting the benchmark and its statistical limits

The analysis draws on three data layers: 192 main theorems written by OpenAI’s AI agents, main theorems from 51 human-led projects, and all 156,127 theorems in Mathlib. Conditioning on statement length reduces the trivial association between longer prompts and longer proofs, but it does not fully control mathematical difficulty.

Several questions require the full paper:

  1. Statement length does not capture constraint count, proof-search depth, cross-module dependencies, or the novelty of required techniques.
  2. The criteria used to designate a theorem as a “main theorem,” and the sampling of projects and individual declarations, can affect the observed distribution.
  3. The abstract does not identify the AI model versions, generation budgets, prompting strategy, handling of failed proofs, or the domain and age composition of human projects.
  4. The roughly 20-fold ratio is not an absolute quality score. A longer proof is not necessarily an incorrect proof, but it creates more reuse and maintenance friction.
  5. The abstract provides no variance, confidence intervals, significance tests, or independent replication. The reported associations should not automatically be interpreted as causal mechanisms.

Plausible explanations include objective mismatch—agents are rewarded for closing the current proof target rather than designing reusable interfaces—the lack of an explicit cost for duplicated derivation, the global planning burden of naming and abstraction, and the fact that agents are optimized to continue an existing proof context. These remain hypotheses rather than established causal findings.

Engineering trade-offs: lower debt is not automatically better

Modularity has a cost. Splitting a long proof into multiple lemmas adds declarations, type signatures, imports, and dependency edges. It also creates more context switches. Excessive decomposition can produce semantically thin lemmas with vague names, reduce readability, and increase compilation and review overhead.

| Proof strategy | Main benefit | Main cost | | --- | --- | --- | | Monolithic long proof | Concentrated goal with few interfaces | Repeated derivation, weak reuse, and cascading maintenance work | | Named-lemma decomposition | Searchable, callable, and locally maintainable | Requires stable interfaces and dependency management | | Extreme fragmentation | Many small graph nodes | May reduce semantic coherence, compilation efficiency, and readability |

Compression debt should therefore be treated as a diagnostic signal rather than a universal optimization target. A genuinely useful low-debt theorem also needs nontrivial local semantics, stable interfaces, and manageable dependency concentration.

Deployment guidance for AI mathematics teams

Build the dependency graph from the formal environment. Extract declaration calls and track parent dependencies, child dependencies, in-degree, out-degree, proof-body size, and downstream citations. Lean declarations should be the source of truth rather than an inferred graph.

Move interface design into the planning phase. Before generating the proof body, ask the agent to identify reusable theorems and plan the names, types, and dependency order of intermediate lemmas. Promote recurring local goals into named lemmas, but do not mechanically fragment goals that occur once and have no independent semantics.

Rank retrieval by relevance and debt. When searching for dependencies, combine semantic match with compression-debt signals. Low debt should only affect ranking; it cannot replace semantic verification and may otherwise favor superficially concise but unsuitable results.

Add debt metrics to continuous integration. Track proof-to-statement length ratio, inline subproof count, named-dependency fan-in and fan-out, downstream reuse, churn caused by changes, and build time. Thresholds should be calibrated to each project’s distribution rather than imposed as a universal line limit.

Change the agent reward function. Include downstream citations, interface stability, duplicated-derivation removal, and maintenance cost, not only proof acceptance. A system optimized only to close the current goal will naturally prefer monolithic output.

Run controlled human-versus-agent comparisons. Apply human workflows, the existing agent workflow, and a decomposition-aware workflow to the same task set. Measure correctness, proof cost, downstream reuse, and maintenance work over time. Compression is worthwhile only when reuse benefits exceed the extra planning and review expense.

The framework could extend to code repositories and scientific knowledge graphs, but the signal would not be directly portable. Lean exposes explicit theorem calls, whereas dynamic code paths and implicit scientific citations require instrumentation or extraction and separate calibration.

Bottom line

AI agents already select formal mathematical dependencies at a compression-debt level similar to human authors, but they do not convert that selection behavior into comparably modular contributions. The next generation of AI mathematics systems should optimize not merely for longer or more successful proofs, but for stable intermediate interfaces, reduced duplicated derivation, and measurable downstream reuse and maintenance gains.


Source: ArXiv AI (cs.AI) (2026-12-04)

— END —

Tags: #Mathlib #Lean 4 #AI Research Agents #Knowledge Compression #Formal Mathematics

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

What's your take on this story?
Explore & Submit Works

Community Comments

Loading live comments and annotations…