Course: AI for Mathematics (General Elective), Xiamen University Malaysia
Weight: 20%
Points: 100
Due: Friday, 19 June 2026, 23:59 Malaysia time
Submission: email your files to hoxide@gmail.com
Email subject: [AI4Math XMUM GE] Assignment 2 - <Student Name> - <Student ID>
Use an agentic coding assistant — such as Claude, Codex, opencode, or openclaw — to
obtain, set up, and drive a Lean proving agent that formalizes a mathematical
theorem in Lean 4 with Mathlib, iterating until the Lean kernel accepts the
proof with no sorry and no errors.
You drive the agent with natural-language prompts; the agent sets up the Lean project, writes the Lean code, and checks it against the kernel. You do not need to write the proof tactics by hand.
Recommended: formalize the theorem you proved in Assignment 1 (your
blueprint.md). You already have a complete, human-readable natural-language proof;
Assignment 2 turns that same proof into a machine-checked Lean proof. You may instead
choose another precise theorem if you prefer, subject to the same standard below.
Suitable Lean agent systems include numina-lean-agent and Archon. Both launch a
coding agent (Claude Code) in a loop that writes Lean and verifies it with the Lean
kernel through lean-lsp-mcp. These harnesses are agent-agnostic: because they
drive a coding assistant, they are easy to repoint at another agent (Codex, opencode,
…). You may use any Lean proving agent you can install and run; part of the task is
using a coding assistant to figure out the setup.
Worked examples from class (Euler's partition theorem, formalized two ways, with in-browser Lean links):
lake project) that compiles against Mathlib with no
errors and no sorry.#print axioms <your_theorem> shows only the standard axioms (some subset of
propext, Classical.choice, Quot.sound) — in particular no sorryAx and no
custom axiom.#eval), and note if you obtain a choice-free proof (#print axioms =
[propext, Quot.sound]).Email these two files to hoxide@gmail.com (zip a multi-file project if needed):
Formalization.lean — your Lean formalization (sorry-free, compiles against
Mathlib). If you used a multi-file lake project, attach a .zip of the project (or
the main files).report.pdf (about 2–4 pages) containing:theorem;#print axioms output for your main theorem;live.lean-lang.org link).sorry) and drive the agent to fill in the proof.
Verify after each step with the Lean kernel (lean_diagnostic_messages /
lake env lean), not by eye.#print axioms.Email exactly your Lean file(s) and report.pdf (plus any optional config/links) to
hoxide@gmail.com.