Build1 publisher3 min readPublished
MathCode's bet is that proofs should accumulate, not evaporate
The Math-AI project turns plain-language mathematics into Lean 4 theorems, then files whatever compiles into a reusable library. The architecture is the claim, not the benchmark.
The Engineer · Build desk
Drafted by a language model from the sources cited here and checked against its claim ledger before publication. How we use AISend a correction

What happened
- Public materials most clearly associate Yifan Zhang (@yifanzhang_) with Math-AI, the open research community behind MathCode, a terminal AI coding assistant that converts mathematics written in ordinary language into Lean 4 statements, attempts formal proofs and saves successful results for later use.
- MathCode's project page dates the project to April 2026.
- MathCode should be read as a continuing open-source research project rather than a new launch.
- Zhang describes himself as a Princeton University PhD student and Princeton AI Lab Fellow working on language-model reasoning, reinforcement learning, pretraining and model architecture.
- Math-AI presents itself as an open research community, with code, models and research materials published through GitHub and Hugging Face; its public materials do not present MathCode as a commercial service, and the project has no disclosed pricing, revenue or customer figures.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
Math-AI, an open research community, has published MathCode, a terminal assistant that converts mathematics written in ordinary language into Lean 4 statements, attempts formal proofs, and saves the successful ones for later use [1]. The project page dates the work to April 2026, and it reads as a continuing open-source research project rather than a launch [2][3], which is the right frame: the interesting part is not what it proves today but what it keeps.
The public materials most clearly associate Yifan Zhang with Math-AI [1]. Zhang describes himself as a Princeton PhD student and Princeton AI Lab Fellow working on language-model reasoning, reinforcement learning, pretraining and model architecture [4]. Math-AI publishes code, models and research materials through GitHub and Hugging Face, does not present MathCode as a commercial service, and discloses no pricing, revenue or customer figures [5].
The loop itself is familiar to anyone who has watched a coding agent work. A user submits something like "prove that the square of an even number is even"; MathCode formalizes it as a Lean theorem, generates candidates, compiles them, and feeds Lean's errors back in to guide the next attempt [6][7]. It can split a theorem into subgoals, run several planning strategies in parallel, and stitch the surviving pieces together [8]. It searches LeanSearch and Loogle for existing Mathlib lemmas and returns structured compiler diagnostics to the model [9].
The engineering that makes that loop affordable is local state. MathCode ships as a terminal application for macOS on Arm and Linux on x86_64, installs a bundled Lean toolchain, holds a persistent language server open, and writes generated work to a LeanFormalizations directory [10][11]. A browser interface exists, but the terminal is the primary workflow [12]. According to the project's own documentation, the persistent Lean process cuts compilation checks to roughly 0.4 seconds after warmup, against about 30 seconds when Lean has to restart and reload its libraries [13]. That is a factor of about 75 [14], and it is a vendor figure, not an independent benchmark [13]. Directionally it addresses the real constraint: iterative proof repair is only viable if failure is cheap.
Credit where it is structural. MathCode builds on the AUTOLEAN project for the underlying formalization and proving pipeline; Math-AI's contribution is the working environment around it, meaning persistent state, library search, iterative repair, parallel planning, and interfaces for retaining what the agent has already proved [15]. That last item is the actual thesis. Theorems that compile can be named automatically, written into a reusable Lean library, and imported into later sessions [16]. MathCode also generates an Obsidian vault mapping dependencies among theorems and lemmas [17]. A run stops being a transcript and becomes a dependency graph the next run can query.
The failure mode is equally structural. Users can store conversational assumptions as compile-checked axiom declarations [18], and Lean will happily verify that a proof follows from premises that do not describe anything real [19]. The documentation includes consistency-review tools for stored axioms [20], but a knowledge base assembled this way inherits every specification error anyone ever committed to it.
Two things worth tracking. First, dependency: the default path runs through OpenAI's Codex CLI and its authentication, with Anthropic-compatible and OpenAI-compatible backends also documented, so proof quality, latency and cost still ride on an external provider [21][22]. Second, whether anyone reports reuse rates from the accumulated library, because a library nobody imports is just a log directory.