Organizations: School of Mathematical Sciences, Center for Statistical Science, Peking University · Department of Statistics and Data Science, National University of Singapore · Department of Statistics and Data Science, School of Management, Fudan University · Department of Computer Science/Statistics, The University of British Columbia
Theoretical results in statistics and machine learning rest on long, technically delicate proofs, and fluent arguments generated by large language models are not necessarily correct. Automated formalization makes such arguments mechanically checkable, and automated proving goes further by discovering machine-checked proofs for statements whose proofs are incomplete or missing altogether. Both require reconstructing assumptions from source materials, accessing specialized mathematical infrastructure and managing long proof developments. We present Statopia, an ecosystem that jointly develops Statopia Prover, an independent agent specialized for formalizing and proving results in statistics and machine learning, and Statlib, a Lean~4 library built with the prover and organized for automated use. The prover controls its own execution without relying on external coding agents. It is built for formal proof discovery and checking existing proofs. A natural-language proof, when available, guides its search but is not required: from a statement alone, the prover develops the argument itself and constructs a Lean proof. Its workflow integrates source preparation, statement review, library supported planning and proof construction. Dynamic proof dependency graphs and task groups support parallel, resumable proof development. Statlib's shared definitions and theorem interfaces are organized for retrieval and composition by agents, and its coverage of statistics keeps expanding. Verified results and usage feedback from the prover inform reviewed library updates, so that proof development drives this expansion. A cross-platform application provides an interactive workspace for uploading source files and running tasks locally or in the cloud.
Figures & tables
Figure 1: Prover and library co-design in the Statopia ecosystem. Statlib provides structured statistical knowledge that supports efficient retrieval and reuse during proof construction, while actual proving produces verified results and usage signals that guide subsequent library development.
Name
Full-pipeline automation
Independent proving runtime
Built-in domain library
Proof-driven library evolution
Domain- specific modeling
Graphical task workspace
Statopia Prover + Statlib 1
✓
✓
✓
✓
✓
✓
Stat-Lean 2
✓
–
✓
✓
✓
–
KAPPA 3
✓
–
–
–
✓
–
CausalSmith + Causalean 4
✓
–
✓
✓
✓
–
ProofLoom + SOptLib 5
✓
–
✓
✓
✓
–
AI4SLT / FoML / StatsMLlib 6
–
–
✓
–
✓
–
Table 1: Reported capabilities of Lean proving systems and domain libraries, grouped by project family. Marks are the column-wise union across the cited family members, not a claim that all capabilities coexist in one release. The domain-library column requires a project’s own built-in or companion domain library; support for connecting external libraries alone does not qualify.
Figure 2: System overview of Statopia. Users submit sources, with or without proofs, to a workspace, which organizes formalization work into task groups, tasks and proof DAGs. Statopia Prover prepares each task, develops its proof and accepts results only after the final verification checks. Statlib supplies checked declarations for reuse and receives verified results only through reviewed promotion (dashed). Lean runs on a local or cloud host, and language models are accessed through replaceable APIs.
Figure 3: Layered architecture of Statlib and its prover-facing search surface. Mathlib provides the general mathematical foundations. The statistical vocabulary supports operational and bridge lemmas, which combine into reusable theorem families and domain modules. Declaration data and curated aliases make these components retrievable by Statopia Prover. Retrieved declarations are checked before they are used in proof planning and construction, and final proof acceptance still depends on Lean elaboration, the build and the integrity checks.
Proof procedure
Problems
Lean lines
Mean min.
Mean USD
USD/line
Single file
41
5,192
32.81
0.22
0.00174
Dynamic DAG
42
32,510
89.80
0.90
0.00117
Combined
83
37,702
61.65
0.57
0.00125
Table 2: Statistics benchmark results.
Task
Time (min.)
Lean lines
USD
USD/line
Reference Time (min.)
Problem 1
37.63
720
0.88
0.00122
24
Problem 2
264.93
4,410
12.90
0.00293
360
Problem 3
292.68
7,680
10.89
0.00142
869
Problem 4
36.03
549
0.41
0.00074
39
Problem 5
23.61
402
0.28
0.00069
65
Problem 6
50.54
1,214
0.81
0.00067
139
Table 3: Results of Statopia Prover on six guided IMO 2026 tasks. For reference, the AxiomProver times are taken from AxiomMath’s public repository ( AxiomMath, 2026 ) . The two evaluations follow different protocols, so the timing columns are not a controlled comparison of efficiency.
Repeated deep regression ( Yan et al., 2025 ) , Thm. 2.1.
44
8,774
4/4
2
Table 4: Statistical paper developments. Files and lines count the complete Lean package of each case, tasks are given as verified over total, and external citations count the cited results that each package retains as citation inputs instead of proving them (Section 3.2 ).
Figure 4: The archived main-task DAG for Gaussian approximation. Its nine verified nodes comprise the main target, six local helpers and two task interfaces (purple dashed borders). B and T connect to the supporting tasks in Figure 5 . Arrows point from prerequisites to consumers.
Figure 5: The Gaussian task group: six verified tasks (green) and three retained citation inputs (white). Each green box represents a task with its own proof DAG. The Bentkus and Slepian tasks are reused by multiple consumers; B and T supply the interfaces in Figure 4 . Dashed arrows mark uses of citation inputs, which were kept unproved under the default setting (Section 3.2 ).
Figure 6: Statlib contributions to the final CCK comparison proof. Cyan boxes group the 21 reused named Statlib theorems, with the number of distinct theorems in parentheses; green boxes summarize their roles in the paper-specific proof. Arrows show the main mathematical uses and do not form a complete dependency graph of tasks or nodes. The interval bound is obtained from Statlib’s Nazarov theorem, and the Stein identity remains an explicit citation input.
Library component
Public definitions and results
Purpose of the interface
Statlib files
Network vocabulary
Affine layers, network realization, network classes and parameter counts
State approximation problems using shared objects and architecture budgets.
Vocabulary/NeuralNetwork
Network algebra
Linear-combination constructions, affine precomposition and depth padding
Combine or adapt networks with explicit realization and size guarantees.
Selected tent-weight, partition and weighted approximation bounds
Combine local error estimates into an approximation bound on the domain.
Approximation/NeuralNetworkAlgebra
Statistical interfaces
Bounds transferring a candidate’s pointwise or integrated squared error to network-class approximation error
Use a concrete network construction to bound the approximation term in a statistical analysis.
Approximation/NeuralNetwork
Table 5: Reusable definitions and results that the neural network approximation development exposes in Statlib. The last column gives the main Statlib source files for each component, relative to Statlib/Nonparametric/ and without the .lean extension.
Papers in statistical theory rest on long proofs that few readers check line by line. We present KAPPA (Kit of Agents for Proof-checking Papers with a proof Assistant), open-source software that organizes language model agents, run by Claude Code, to translate the proofs of a LaTeX paper into the proof assistant Lean 4 with its library Mathlib and check them there, result by result. Each numbered result receives one of four verdicts: verified unconditionally; verified conditionally, with every cited or unproved input stated as a named hypothesis; issue recorded, with its place in the paper and the side at fault; or unfinished, with the reason. The kit follows the paper's own proof step by step, rather than finding a new one. Separate agents write and review, each statement is compared with the paper before it is proved and fingerprinted afterwards, and every verdict rests on evidence that can be rerun without a language model. The kit runs unattended for hours, waits out usage limits, re-checks only what a revision changed and reports its cost by role, model and result. We describe the design, walk through a complete run, and apply the kit to four example papers with answer keys and to three published statistical papers, checked blind in their versions from before public corrections. In all three, the kit found the published error at the step that the correction names, together with further problems that we confirmed by hand. Given the same papers directly, the same language model working with Lean classified fewer results correctly on the longest paper and reported some statements narrower than the paper's as proved; no verdict of the kit claimed more than its Lean evidence showed.
Zihua She, Xiao Wang
Department of Statistics, Purdue University, West Lafayette, IN 47907, USA
Asymptotic statistical theory is a challenging domain for AI-assisted formalization: its central results mix convergence statements, asymptotic expansions, functional analysis, and regularity conditions that have a large gap from existing infrastructure in Lean 4 formalization. To address these challenges, we propose a hypothesis-disciplined Lean 4 formalization pipeline built from multiple agents: a manager that coordinates seven specialist roles for proof planning, skeleton scaffolding, Mathlib reconnaissance, proof construction, integration, independent review, and audit. The main methodological discipline is the hypothesis-disciplined audit, implemented by the Auditor agent: every main-theorem hypothesis and concept-layer field must be anchored in the source mathematical prose, justified as a Lean encoding adapter, marked as source-implied, or rejected as an unsupported strengthening. Using this workflow, we build a systematic formalization of asymptotic statistical theory, especially the parametric and semi-parametric models' asymptotic distribution and efficiency results. The resulting Lean development is axiom-clean and source-faithful, with Lean-checked and human-audited proofs of core parametric and semi-parametric theorems organized so that theorem-agnostic infrastructure and statistical concept definitions are separated from theorem-specific assembly. The formalization results are available at https://github.com/junwei-lu/Lean-Asymptotic-Statistical-Theory.
Tingzhou Wei, Zeyu Zheng, Ethan X. Fang +1
Department of Biostatistics & Bioinformatics, Duke University · Department of Mathematical Sciences, Carnegie Mellon University · Department of Biostatistics, Harvard T.H. Chan School of Public Health
Formalizing research-level stochastic optimization in Lean requires both an algorithm model and domain theory connecting foundational libraries to convergence proofs. Revising a model to restore provability can change the mathematical claim. We introduce ProofLoom, a fully automated LLM-agent system for Proof-Obligation-Driven Theory Construction. Given a published algorithm, target theorem, and source proof, ProofLoom autonomously constructs the Lean model and supporting theory. Open proof obligations drive the development of definitions, interfaces, lemmas, and proof plans. Signature contracts record evidence and obligations for model revisions; an independent Judge rejects unsupported assumptions and weakened conclusions. Planner expands the published argument into intermediate claims, and Audit checks whether the Lean proof follows it. Across tasks, SOptLib accumulates verified mathematics and construction experience: reusable results are extracted, generalized, and verified, while modeling decisions and failed proof routes are recorded. Later tasks retrieve these results and records and contribute new developments, forming a cycle of construction, accumulation, and reuse. On fifteen textbook and research-paper tasks, ProofLoom obtains mean human ratings of 6.3/7 and 6.4/7, compared with 4.9/7 and 5.0/7 for the strongest of six baselines. Across 33 developments, it produces 490,693 lines of algorithm-local Lean code with no sorry. The formalizations also expose 28 incorrect formulas, proof gaps, and algorithm-analysis mismatches in published sources across 22 developments, each with checked evidence.