SaaS & Software·Aug 16, 2026

MathCode, Mathematical Coding Agent

Overview MathCode is a terminal AI coding assistant with a built-in math formalization engine. Give it a math problem in plain language and it will automatically convert it into a Lean 4 theorem and attempt a formal proof — with a persisten

Hacker News2 min readSingle source
MathCode, Mathematical Coding Agent
Image · Hacker News
The gist
5-point summary · 1 min

Overview MathCode is a terminal AI coding assistant with a built-in math formalization engine. Give it a math problem in plain language and it will automatically convert it into a Lean 4 theorem and attempt a formal proof — with a persisten

  • Try it with: mathcode -p "prove that the square of an even number is even" Outputs are written to LeanFormalizations/.
  • Features Persistent Lean REPLA persistent Lean language server brings compile checks to ~0.4s after a one-time warmup, instead of ~30s.
  • Theorem LibraryEvery proved theorem is auto-named, stored, and made importable so the prover and planner can reuse it.
  • Obsidian Theorem GraphGenerates an Obsidian vault that visualizes theorem-to-lemma dependencies as a knowledge graph.
  • Agent-Mode ProvingEach proof becomes an interactive session where the agent writes candidates, reads errors, and recompiles.

Overview MathCode is a terminal AI coding assistant with a built-in math formalization engine. Give it a math problem in plain language and it will automatically convert it into a Lean 4 theorem and attempt a formal proof — with a persistent Lean REPL, reusable theorem and axiom libraries, agentic proving, and an Obsidian knowledge graph. Quick Start Requires macOS (arm64) or Linux (x86_64), plus the codex CLI for the default backend. git clone https://github.com/math-ai-org/mathcode.git cd mathcode bash setup.sh codex auth login mathcode setup.sh prepares the release checkout, downloads the bundled runtime and Lean toolchain, and installs a user-local mathcode launcher. Try it with: mathcode -p "prove that the square of an even number is even" Outputs are written to LeanFormalizations/. A browser UI is available via./run webui. Features Persistent Lean REPLA persistent Lean language server brings compile checks to ~0.4s after a one-time warmup, instead of ~30s. Theorem LibraryEvery proved theorem is auto-named, stored, and made importable so the prover and planner can reuse it. Axiom LibraryStore conversational assumptions as persistent, compile-checked, consistency-reviewed Lean declarations. Lean LSP IntegrationSearches leansearch.net and Loogle for verified Mathlib lemmas and uses structured LSP diagnostics for repairs. Obsidian Theorem GraphGenerates an Obsidian vault that visualizes theorem-to-lemma dependencies as a knowledge graph. Agent-Mode ProvingEach proof becomes an interactive session where the agent writes candidates, reads errors, and recompiles. Tree-of-SubgoalsDecomposes complex theorems into independent subgoals and proves them in parallel, then stitches them back. Multi-PlannerRuns multiple planners in parallel for diverse proof strategies; the prover picks the best approach. Citation If you use MathCode in research, please cite: @misc{mathcode2026, title = {MathCode: A Frontier Mathematical Coding Agent}, author = {Team Math-AI}, journal = {math-ai-org.github.io}, year = {2026}, month = {April}, url = {https://github.com/math-ai-org/mathcode} } The math formalization and proving pipeline is based on the AUTOLEAN project.

Integrity note  ·  Xela does not rewrite or paraphrase article content. The excerpt above is the source publication's own words, sanitized for display. For the full piece — including any quotes, charts, or images — read it at Hacker News. Xela's rewritten version is off for this story, so there's no editorial angle attached — you're getting the source's reporting unfiltered. When the rewrite is on, we add a What this means block underneath with the operator/trader takeaway.

What people are saying

Discussion

Hot takes

0/280

Loading takes…

Comments

Discussion · 0

Sign in to comment, like, and save articles.

Sign in

Loading comments…

Newsletter

Track saas & software every morning.

Daily digest tuned to this beat. The 5 stories most worth your time. Unsubscribe anytime.