MathCode is a terminal AI coding assistant that converts plain‑language math problems into Lean 4 theorems and attempts formal proofs.
MathCode is a terminal AI coding assistant that converts plain‑language math problems into Lean 4 theorems and attempts formal proofs. It runs on macOS (arm64) or Linux (x86_64) and requires the codex CLI for its default backend.
The software is based on the AUTOLEAN project and includes a persistent Lean REPL, reusable theorem and axiom libraries, and an Obsidian knowledge graph that visualizes theorem dependencies.
Setup involves cloning the repository, running setup.sh, authenticating with codex, and launching mathcode. The command line example "mathcode -p \"prove that the square of an even number is even\"" generates a Lean file in the MathFormalizations directory, and a browser UI can be started with ./run webui. The persistent Lean language server compiles checks in about 0.4 seconds after warmup, compared to roughly 30 seconds without it. Additional features include auto‑named and importable theorems, conversational axiom storage, structured LSP diagnostics, and an agentic proving mode that iteratively refines candidates. The tool also decomposes complex proofs into parallel subgoals, runs multiple planners simultaneously, and selects the optimal strategy.
Users are advised to cite the project as described in the repository citation file when using MathCode in research.
- Publisher
- Hacker News
- Reliability
- high
- Published
- 8/17/2026, 10:00:30 AM
- Retrieved
- 8/17/2026, 10:00:30 AM
- Relevance
- 80%
- Confidence
- 85%

