Lean Census: A Distributional Analysis of AI-Generated Lean Code
AI systems now produce Lean libraries with millions of lines and little human review. Existing audits rely mostly on expert or LLM judgment and do not compare library-wide distributions against human-written code.
Six libraries are compared with Mathlib: two human-written (CSLib, PhysLib) and four AI-generated (FormalFrontier, Tau Ceti, CSLib Frontier, Atlas). For each, distributions are computed for inline claims (have/suffices) per theorem, proof length, declaration reuse, instances, private declarations, and explicit arguments. Each is read against the variation across Mathlib's 26 top-level areas.
Every AI-generated library falls outside the human-written range on inline claims, proof length, instances, private declarations, and explicit arguments. AI-generated proofs have 0.81–3.22 inline claims per theorem versus 0.21–0.64 for human-written ones, and median proof length is 22–49 tokens versus 10–17. Mathlib's Archive matches the AI libraries on proof structure but not on design choices, suggesting purpose explains part of the proof-structure gap.
| Library | Inline claims/theorem | Instances | Private |
|---|---|---|---|
| Mathlib | 0.21 | 10.7% | 1.1% |
| PhysLib (human) | 0.64 | 5.4% | 3.4% |
| Tau Ceti (AI) | 0.89 | 3.2% | 14.0% |
| Atlas (AI) | 3.22 | 1.2% | 37.1% |
