Statopia: A Prover–Library Ecosystem for Automated Formalization and Proof Discovery in Statistics
Ziyuan Chen, Tong Gan, Wei Zhang, Ruofei Fang, Boyue Tang, Zhenhua Lin, Fang Yao
stat.CO
Nov 8, 2026 · v1
cs.AI
TL;DR
Builds an LLM-based agent that formalizes and proves statistics results in Lean 4, alongside Statlib, a Lean 4 statistics library on top of Mathlib.
Abstract
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.
Problem
Proofs in statistics and machine learning are long and technically delicate. Errors can survive peer review, and LLM-generated arguments are not guaranteed to be correct. Automated formalization in this domain must reconstruct statistical settings, rely on domain infrastructure that Mathlib does not provide, and manage long proof developments.
Approach
Statopia combines Statopia Prover and Statlib. Statopia Prover is a desktop agent with its own execution harness that prepares sources, formalizes statements, plans proofs and constructs Lean proofs using replaceable LLM backends. Dynamic proof dependency graphs (DAGs) and task groups organize the work so it can run in parallel and be resumed. Statlib is a layered Lean 4 library built on Mathlib, covering statistical foundations, high-dimensional and nonparametric statistics, testing, random matrix theory and causal inference; verified results enter it only through a reviewed promotion process.
Results
Using deepseek-v4-flash, the prover solved all 83 problems in a statistics benchmark that supplies no proofs, producing 37,702 Lean lines at a mean cost of $0.57 per problem. It also completed six guided IMO 2026 tasks. Whole-paper formalizations of statistics theorems passed all of their tasks, with some developments exceeding 70k Lean lines.
| Proof procedure | Problems | Lean lines | Mean min. | Mean USD |
|---|
| Single file | 41 | 5,192 | 32.81 | 0.22 |
| Dynamic DAG | 42 | 32,510 | 89.80 | 0.90 |
| Combined | 83 | 37,702 | 61.65 | 0.57 |
Statistics benchmark results by proof procedure