Compiles Mathlib and Lean 4 projects, measuring written and unfolded statement/proof lengths to compare compression and reuse of AI-generated versus human theorems.
Abstract
Science is cumulative. The abundant results now generated by AI agents are therefore useful for the advancement of science only if they compress knowledge effectively enough to be reused in later work. Shared libraries of formal mathematics now allow us to measure the compression and reuse of mathematical results, since every theorem is built from a common set of primitives through named definitions and lemmas, and dependency among the theorems is recorded precisely through their calls to one another. Here we define three dimensions of knowledge compression (conceptual, technical, and deductive) for the problem statements and proofs of Mathlib, the main library of the Lean proof assistant. From these dimensions we define a compression debt, which measures the extent to which a proof is written out in full instead of split into named lemmas that can be called in later work. Comparing 192 main theorems written by OpenAI's AI agents with the main theorems of 51 human-led projects and all 156,127 theorems in Mathlib, we find that all groups of authors are less likely to build on a theorem with higher compression debt, and that, conditioning on theorem length, AI agents build on theorems with the same compression debt as human authors. However, AI agents contribute theorems with a far higher compression debt, with written proofs that are roughly 20 times longer than the proofs of human authors for problem statements of similar length. We also find that future review and maintenance shorten the proofs of human authors, lowering their compression debt, but by only a few percent over several years, far less than what is required to close the gap in compression debt between AI and human authors. Our results reveal a gap between how AI uses and contributes to cumulative knowledge, and provide a quantitative framework for assessing how knowledge is organized for reuse across scientific fields.
Problem
AI agents now produce many formal mathematical results, but such results only advance cumulative knowledge if they are compressed well enough to be reused. No quantitative measure existed for how well AI-written formal proofs are organized for reuse compared with human-written ones.
Approach
Every declaration in Lean is measured by written length (each call counts as one token) and unfolded length (calls recursively expanded to Lean core primitives). These lengths define three log-ratio coordinates: conceptual, technical, and deductive compression. From them the authors define a compression debt, which measures how much of a proof is written out in full rather than split into reusable named lemmas. They compare 192 main theorems from OpenAI's AI-agent release with main theorems from 51 human-led Mathlib-based projects, found through a PRISMA-style census of GitHub, and with all 156,127 Mathlib theorems. Reuse is modeled with logistic regressions on later calls.
Figure S2: Written lengths of statements and proofs in Mathlib. Written proof length (including the lemmas written for the theorem) as a function of written statement length. Gray points give the theorems of Mathlib at commit d13f23b , with integer lengths jittered so that the cloud is visible. On these log axes, deductive compression D is the vertical distance from the line D=0 . Dashed lines mar
Results
All author groups are less likely to build on theorems with higher compression debt, and AI agents call theorems with the same compression debt as humans once theorem length is held fixed. However, AI-written proofs are about 20 times longer than human proofs for statements of similar length. Human proofs shorten during review and maintenance by only a few percent over years, far too little to close the gap.