ReasBook is a Lean 4 project for formalizing mathematics from textbooks and research papers. The goal is to preserve the structure of original references while producing machine-checkable proofs. We welcome contributions from researchers, students, and practitioners.
ReasBook is generated using the tool: M2F.
- Try Quokka (https://quokka.reaslab.io/), our publicly available automated formalization system. Quokka can automatically transform long-form mathematical literature into compilable Lean 4 projects containing formally verified statements and proofs.
| Branch | Lean/mathlib | Status | Books/Papers | Last build |
|---|---|---|---|---|
v4.32.0 |
v4.32.0 |
Active | 1 / 0 | Pending |
v4.32.2 |
v4.32.2 |
Active | 0 / 1 | Passed |
v4.30.0 |
v4.30.0 |
Active | 8 / 2 | Passed |
v4.26.0 |
v4.26.0 |
Active | 4 / 2 | Passed |
main is the cross-version catalog. The source code stays on the registered version branches; the lightweight link folders below make each entry discoverable from this branch.
Status: Empty (initialized, no source projects on that branch) · Active (accepting PRs) · Frozen (kept, no new books) · Archived (historical only).
Each directory in these indexes is a landing page for one book or paper. Open a directory and follow its prominent source link to the exact version branch and project folder.
- Books
- Papers
- Theorem dependency maps (currently TR-LALM only)
You do not need to download every ReasBook project or the history of every toolchain branch. First find the book or paper in the tables below and note its version branch and project directory. A single-branch sparse checkout can then download the shared Lean project files and only the selected source directory.
For example, to use First-Order Methods in Optimization from v4.30.0:
git clone --depth 1 --filter=blob:none --no-checkout --single-branch \
--branch v4.30.0 https://github.com/optpku/ReasBook.git
cd ReasBook
git sparse-checkout init --no-cone
git sparse-checkout set \
'/ReasBook/lakefile.lean' \
'/ReasBook/lean-toolchain' \
'/ReasBook/lake-manifest.json' \
'/ReasBook/Books/FirstOrderMethodsOptimization_Beck_2017/**'
git checkout v4.30.0
cd ReasBook
lake exe cache get
lake env lean Books/FirstOrderMethodsOptimization_Beck_2017/Book.leanReplace the branch, Books/Papers directory, project identifier, and Lake
root file with those of the selected entry (Book.lean for a book and
Paper.lean for a paper). Sparse checkout avoids downloading the other
ReasBook sources on that branch; Lake still downloads the required mathlib
dependencies and compiled cache. A normal clone of this repository can fetch
all official version branches, but it does not include independent repositories
in GitHub's forks network.
Titles open their catalog pages; version links open the Lean source directly.
| Formalization | Source | Contributors | Resources |
|---|---|---|---|
| A Concise Course in Algebraic Topology J. Peter May (1999) |
v4.30.0 |
Ze Yuan, Zichen Wang | Docs Verso |
| Analysis II Terence Tao (4th ed., 2022) |
v4.26.0v4.30.0 |
9 contributorsChenyi Li, Min Cui, Qiming Dai, Shu Miao, Wanli Ma, Yi Yuan, Zichen Wang, Ziyu Wang, Zaiwen Wen |
Docs v4.26.0 Docs v4.30.0 Verso |
| Combinatorial Group Theory Magnus, Karrass, and Solitar (2004) |
v4.30.0 |
Zichen Wang | Docs Verso |
| Convex Analysis R. Tyrrell Rockafellar (1970) |
v4.26.0 |
21 contributorsChangyu Zou, Chenyi Li, Guangxuan Pan, Pengfei Hao, Qiming Dai, Shu Miao, Siyuan Shao, Suwu Wu, Wanli Ma, Weiran Shi, Xinyi Guo, Xuran Sun, Yifan Bai, Yijie Wang, Yunfei Zhang, Yunxi Duan, Yuhao Jiang, Zebo Liu, Zhiyan Wang, Zichen Wang, Zaiwen Wen |
Docs Verso |
| Convex Analysis and Monotone Operator Theory in Hilbert Spaces Bauschke and Combettes (2nd ed., 2017) |
v4.30.0 |
Yifan Bai, Zichen Wang, Zaiwen Wen | Docs Verso |
| First-Order Methods in Optimization Amir Beck (2017) |
v4.30.0 |
Shu Miao, Zichen Wang, Zaiwen Wen | Docs Verso |
| Integer Programming Conforti, Cornuejols, and Zambelli (2014) |
v4.26.0 |
38 contributorsBinghe Huang, Chenglin Li, Chenrui Yang, Chenxi Liu, Congyuan Lei, Dongye Song, Fuzhi Wang, Haodong Zhang, Jiangnan Song, Jinmin Song, Junze Qiao, Junzhe Lai, Kaiwen He, Liming Han, Lurong Yang, Meng Zhou, Pengqi Lei, Renran Luo, Siyan Chen, Wangqi Liu, Wenxin Zeng, Wanli Ma, Wenxuan Wu, Xinru Zhu, Xu Han, Xutianshi Tao, Yichao Guo, Youyou Qin, Yuhan Zhang, Yushen Guo, Yutong Zhang, Ze Zhai, Zheng Ma, Zhiyong Chen, Zichen Wang, Zichen Xu, Zihao Liu, Zaiwen Wen |
Docs Verso |
| Introduction to Real Analysis, Volume I Jiri Lebl (v6.2, 2025) |
v4.26.0v4.30.0 |
Zichen Wang, Zaiwen Wen | Docs v4.26.0 Docs v4.30.0 Verso |
| Probability Theory: A Comprehensive Course Achim Klenke (3rd ed., 2020) |
v4.30.0 |
Xuanzhi Ren, Zichen Wang | Docs Verso |
| Lectures on Riemann Surfaces Otto Forster (1981) |
v4.30.0 |
Zichen Wang | Docs Verso |
| Computational Methods for Inverse Problems Curtis R. Vogel (2002) |
v4.32.0 |
Yifan Bai, Wanli Ma, Zichen Wang | — |
Titles open their catalog pages; version links open the Lean source directly.
| Formalization | Source | Contributors | Resources |
|---|---|---|---|
| A Fixed-Penalty Linearized Augmented Lagrangian Method with Classical Multiplier Updates Benqi Liu, Kangkang Deng, Zichen Wang, and Zaiwen Wen |
v4.32.2 |
Zichen Wang, Zaiwen Wen | Docs Theorem map Verso |
| Smooth Minimization of Non-Smooth Functions Yurii Nesterov (2004) |
v4.26.0v4.30.0 |
Wanli Ma, Zichen Wang, Zaiwen Wen | Docs v4.26.0 Docs v4.30.0 Verso |
| On Some Local Rings Mohamad Maassarani (2025) |
v4.26.0v4.30.0 |
Liang Xiao, Haochen Ju, Zichen Wang, Zaiwen Wen | Docs v4.26.0 Docs v4.30.0 Verso |
See CONTRIBUTING.md.
- Book and paper code lives on the registered version branch matching its Lean/mathlib toolchain; only registered stable
vX.Y.Zversions are accepted. - Book and paper code is not merged to
main.mainremains the cross-version catalog, while its link folders point to the corresponding version branches. - PR base, PR title version,
ReasBook/lean-toolchain, andbook.ymlmust all match.
Full Lean build and web build run on a self-hosted runner. Locally:
./build.sh # full build (cache get → shared docs → project docs → core)
BUILD_DOCS=0 ./build.sh # fast preview: core only
./build-web.sh # full pipeline + Verso site
python3 serve.py 18000 # serve at http://127.0.0.1:18000/ReasBook/- Beijing International Center for Mathematical Research, Peking University
- Great Bay University
- Huawei
- iQuest Research
- Sino-Russian Mathematics Center
- National Natural Science Foundation of China
- ReasLab
- An online Lean formalization platform for collaborative theorem development and verification.
- Optlib
- A Lean4 library for mathematical optimization, covering convex analysis, optimality conditions, and algorithm convergence.
- ReasBook
- A Lean4 project for textbook and paper formalization, including both theorem proving and computational problems.
- AMBER
- A Lean4 benchmark for construction and verification in applied mathematics formalization, covering both theorem-proving and computational problems.
- CAM-Bench
- A Lean4 benchmark for formal theorem proving in computational and applied mathematics.
- M2F
- A toolkit for converting natural-language mathematical textbooks into formalization-ready Lean projects.
- SITA
- A structure-to-instance autoformalization framework for generating Lean definitions/theorems with verification feedback.
- lean-tools-mcp
- A Lean MCP server with higher parallel throughput and lower memory usage for heavy imports (especially Mathlib).
- Wanli Ma, Zichen Wang, Zaiwen Wen, A Unified Framework for Formalizing Matrix Decomposition Proofs. (Paper)
- Chenyi Li, Ziyu Wang, Wanyi He, Yuxuan Wu, Shengyang Xu, Zaiwen Wen. Formalization of Complexity Analysis of the First-order Optimization Algorithms, Journal of Automated Reasoning. (Paper)
- Chenyi Li, Zichen Wang, Yifan Bai, Yunxi Duan, Yuqing Gao, Pengfei Hao, Zaiwen Wen. Formalization of Algorithms for Optimization with Block Structures, Science in China Series A: Mathematics. (Paper)
- Chenyi Li, Shengyang Xu, Chumin Sun, Li Zhou, Zaiwen Wen. Formalization of Optimality Conditions for Smooth Constrained Optimization Problems. (Paper)
- Chenyi Li, Zaiwen Wen. An Introduction to Mathematics Formalization Based on Lean. (Paper)
- Wentao Long, Yunfei Zhang, Chenyi Li, Zaiwen Wen, MECA: A Mechanism-Centered Agent for Constructing Well-Specified and Valuable Mathematical Conjectures. (Paper)
- Chenyi Li, Yanchen Nie, Zhenyu Ming, Gong Zhang, Kun Yuan, Zaiwen Wen. OptProver: Bridging Olympiad and Optimization through Continual Training in Formal Theorem Proving, ICML 2026. (Paper)
- Zichen Wang, Wanli Ma, Zhenyu Ming, Gong Zhang, Kun Yuan, Zaiwen Wen. M2F: Automated Formalization of Mathematical Literature at Scale. (Paper)
- Ziyu Wang, Bowen Yang, Chenyi Li, Yuan Zhang, Shihao Zhou, Bin Dong, Zaiwen Wen. Translating Informal Proofs into Formal Proofs Using a Chain of States. (Paper)
- Chenyi Li, Wanli Ma, Zichen Wang, Zaiwen Wen. SITA: A Framework for Structure-to-Instance Theorem Autoformalization, AAAI 2026. (Paper)
- Ziyu Wang, Qiming Dai, Yishan Wu, Zaiwen Wen. FaithSieve: Fine-Grained Evaluation of Math Proofs with Faithful Formal Evidence.
- Ziyu Wang, Qiming Dai, Chenyi Li, Zaiwen Wen, Beyond Formal Correctness: Structure-Aware Evaluation of Informal–Formal Proof Correspondence
- Zichen Wang, Anjie Dong, Zaiwen Wen. Tree-Based Premise Selection for Lean4, NeurIPS 2025. (Paper)
- Shu Miao, Zichen Wang, Anjie Dong, Yishan Wu, Weixi Zhang, Zaiwen Wen. Directed Multi-Relational GCNs for Premise Selection.
- Bowen Yang, Yi Yuan, Chenyi Li, Ziyu Wang, Liangqi Li, Bo Zhang, Zhe Li, Zaiwen Wen. Construction-Verification: A Benchmark for Formalizing Applied Mathematics in Lean 4. (Paper)
- Wentao Long, Yunfei Zhang, Chenyi Li, Li Zhou, Chumin Sun, Zaiwen Wen. CAM-Bench: A Benchmark for Computational and Applied Mathematics in Lean. (Paper)
- Chenyi Li, School of Mathematical Sciences, Peking University, China (
lichenyi@stu.pku.edu.cn) - Wanli Ma, Beijing International Center for Mathematical Research, Peking University, China (
wlma@pku.edu.cn) - Zichen Wang, School of Mathematical Sciences, Peking University, China (
zichenwang25@stu.pku.edu.cn) - Ziyu Wang, School of Mathematical Sciences, Peking University, China (
wangziyu-edu@stu.pku.edu.cn) - Zaiwen Wen, Beijing International Center for Mathematical Research, Peking University, China (
wenzw@pku.edu.cn) - Yifan Bai, Anjie Dong, Yunxi Duan, Xinyi Guo, Pengfei Hao, Yuhao Jiang, Gongxun Li, Yantao Li, Wentao Long, Zebo Liu, Zhenxi Liu, Siyuan Ma, Guangxuan Pan, Siyuan Shao, Weiran Shi, Junren Si, Xuran Sun, Xuan Tang, Feiming Wang, Yijie Wang, Zhiyan Wang, Zixi Wang, Suwu Wu, Mingyue Xu, Lurong Yang, Yunfei Zhang, Jian Yu, Changyun Zou
If you use ReasBook, please cite both the M2F paper and the repository:
M2F paper:
@misc{wang2026m2f,
author = {Zichen Wang and Wanli Ma and Zhenyu Ming and Gong Zhang and
Kun Yuan and Zaiwen Wen},
title = {{M2F}: Automated Formalization of Mathematical Literature at Scale},
year = {2026},
eprint = {2602.17016},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
doi = {10.48550/arXiv.2602.17016},
url = {https://arxiv.org/abs/2602.17016}
}ReasBook software:
@software{reasbook2026,
author = {{ReasBook Contributors}},
title = {{ReasBook}: Formalizations of Mathematical Textbooks and
Research Papers in {Lean 4}},
year = {2026},
url = {https://github.com/optpku/ReasBook},
license = {Apache-2.0}
}When referring to a particular formalization, also cite the original book or
paper and record the ReasBook project directory, version branch, and full commit
SHA. For example: v4.30.0, ReasBook/Books/<project>/, and the output of
git rev-parse HEAD. This repository also provides CITATION.cff
for citation tools and GitHub's citation interface.
ReasBook uses the Apache License 2.0, matching mathlib. Unless an individual file carries a different notice, this license covers ReasBook content on every official branch and in all copies and forks derived from this repository. Fork-specific additions and third-party dependencies remain subject to their respective license notices.