MathCode, Mathematical Coding Agent

Hacker News Top Tools

Summary

MathCode is an AI-powered coding assistant that converts mathematical problems into Lean 4 theorems and attempts formal proofs, featuring a persistent REPL, theorem libraries, and agent-mode proving.

No content available
Original Article
View Cached Full Text

Cached at: 08/16/26, 09:46 PM

# MathCode — A Frontier Mathematical Coding Agent Source: [https://math-ai-org.github.io/mathcode/](https://math-ai-org.github.io/mathcode/) ## 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\. ![MathCode demo](https://math-ai-org.github.io/mathcode/Demo.png) ## 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 REPL** A persistent Lean language server brings compile checks to**~0\.4s**after a one\-time warmup, instead of ~30s\. **Theorem Library** Every proved theorem is auto\-named, stored, and made importable so the prover and planner can reuse it\. **Axiom Library** Store conversational assumptions as persistent, compile\-checked, consistency\-reviewed Lean declarations\. **Lean LSP Integration** Searches leansearch\.net and Loogle for verified Mathlib lemmas and uses structured LSP diagnostics for repairs\. **Obsidian Theorem Graph** Generates an Obsidian vault that visualizes theorem\-to\-lemma dependencies as a knowledge graph\. **Agent\-Mode Proving** Each proof becomes an interactive session where the agent writes candidates, reads errors, and recompiles\. **Tree\-of\-Subgoals** Decomposes complex theorems into independent subgoals and proves them in parallel, then stitches them back\. **Multi\-Planner** Runs 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](https://github.com/T3S1AMAX/autolean.git)project\.

Similar Articles

AI Co-Mathematician: Accelerating Mathematicians with Agentic AI

Hugging Face Daily Papers

This paper introduces the AI Co-Mathematician, a workbench that uses agentic AI to support mathematicians in open-ended research tasks like ideation and theorem proving. Early tests show the system achieving state-of-the-art results on hard problem-solving benchmarks, including a 48% score on FrontierMath Tier 4.

Math-to-Manim

Hacker News Top

Math-to-Manim is an open-source tool that uses AI agents to convert math and physics prompts into Manim explainer videos, generating artifacts like lesson plans, storyboards, and scene specs.

@ChrisHayduk: https://x.com/ChrisHayduk/status/2076196217109746095

X AI KOLs Timeline

This article compares two AI approaches for mathematical problem solving: DeepMind's AlphaProof, which uses reinforcement learning in the Lean proof language, and OpenAI's raw LLM that achieved a gold medal at the 2025 International Math Olympiad without formal methods.

ProofCouncil: An LLM Agent for Solving Open Mathematical Problems

arXiv cs.AI

Introduces ProofCouncil, an LLM-based agent with an author-critic architecture that autonomously solves open mathematical problems. It achieved the best performance in the FirstProof challenge, solving 6 of 10 problems correctly, and shows promise on a broader set of 30 open problems.