{"slug": "mathcode-mathematical-coding-agent", "title": "MathCode, Mathematical Coding Agent", "summary": "MathCode, a terminal AI coding assistant with a built-in math formalization engine, automatically converts plain-language math problems into Lean 4 theorems and attempts formal proofs, featuring a persistent Lean REPL with compile checks in ~0.4 seconds after warmup, reusable theorem and axiom libraries, agentic proving, and an Obsidian knowledge graph. The open-source tool, released by Team Math-AI on GitHub, requires macOS (arm64) or Linux (x86_64) and the codex CLI, and is based on the AUTOLEAN project.", "body_md": "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.\n\n## Overview\n\n## Quick Start\n\nRequires macOS (arm64) or Linux (x86_64), plus the `codex`\n\nCLI for the default backend.\n\n```\ngit clone https://github.com/math-ai-org/mathcode.git\ncd mathcode\nbash setup.sh\ncodex auth login\nmathcode\n```\n\n`setup.sh`\n\nprepares the release checkout, downloads the bundled runtime and Lean toolchain, and installs a user-local `mathcode`\n\nlauncher. Try it with:\n\n```\nmathcode -p \"prove that the square of an even number is even\"\n```\n\nOutputs are written to `LeanFormalizations/`\n\n. A browser UI is available via `./run webui`\n\n.\n\n## Features\n\n**Persistent Lean REPL**\n\nA persistent Lean language server brings compile checks to **~0.4s** after a one-time warmup, instead of ~30s.\n\n**Theorem Library**\n\nEvery proved theorem is auto-named, stored, and made importable so the prover and planner can reuse it.\n\n**Axiom Library**\n\nStore conversational assumptions as persistent, compile-checked, consistency-reviewed Lean declarations.\n\n**Lean LSP Integration**\n\nSearches leansearch.net and Loogle for verified Mathlib lemmas and uses structured LSP diagnostics for repairs.\n\n**Obsidian Theorem Graph**\n\nGenerates an Obsidian vault that visualizes theorem-to-lemma dependencies as a knowledge graph.\n\n**Agent-Mode Proving**\n\nEach proof becomes an interactive session where the agent writes candidates, reads errors, and recompiles.\n\n**Tree-of-Subgoals**\n\nDecomposes complex theorems into independent subgoals and proves them in parallel, then stitches them back.\n\n**Multi-Planner**\n\nRuns multiple planners in parallel for diverse proof strategies; the prover picks the best approach.\n\n## Citation\n\nIf you use MathCode in research, please cite:\n\n```\n@misc{mathcode2026,\n  title   = {MathCode: A Frontier Mathematical Coding Agent},\n  author  = {Team Math-AI},\n  journal = {math-ai-org.github.io},\n  year    = {2026},\n  month   = {April},\n  url     = {https://github.com/math-ai-org/mathcode}\n}\n```\n\nThe math formalization and proving pipeline is based on the [AUTOLEAN](https://github.com/T3S1AMAX/autolean.git) project.", "url": "https://wpnews.pro/news/mathcode-mathematical-coding-agent", "canonical_source": "https://math-ai-org.github.io/mathcode/", "published_at": "2026-08-16 18:17:10+00:00", "updated_at": "2026-08-16 18:40:56.917528+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "artificial-intelligence"], "entities": ["MathCode", "Team Math-AI", "Lean 4", "AUTOLEAN", "Obsidian", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/mathcode-mathematical-coding-agent", "markdown": "https://wpnews.pro/news/mathcode-mathematical-coding-agent.md", "text": "https://wpnews.pro/news/mathcode-mathematical-coding-agent.txt", "jsonld": "https://wpnews.pro/news/mathcode-mathematical-coding-agent.jsonld"}}