Agentic Coding · Masterclass · Universities & research

Lean and Coding Agents: A Masterclass on Formalising Mathematical Proofs

Formalise proofs faster without lowering the bar, as the coding agent suggests tactics and lemmas and the Lean kernel decides whether a proof really holds.

  • Workshops & trainings since 2014
  • jocapps GmbH · Freiburg, Germany
  • The team behind Mathe-VollLogo
Format
Masterclass
Duration
1 day (7.5 hours)
Delivery
Live online · On-site (in-house) · Hybrid
Group size
4–10 participants
Level
Advanced
Language
German or English

Tools: Lean · Mathlib · Lake · Claude Code · VS Code

Formalising in Lean loses a lot of time to small things: finding the right Mathlib lemma, decoding a type class error, rewriting an inequality into the shape a tactic expects. Combining Lean with coding agents has a special advantage: unlike prose, every suggestion is checked by the Lean kernel, so a wrong proof cannot slip through. In this masterclass you set up Claude Code for a Lean project, let the agent iterate against the compiler and break theorems into checkable subgoals with sorry placeholders. You also see where agents reach their limits and your mathematical judgement remains essential.

Who the Lean masterclass is for

Mathematicians, doctoral researchers and advanced students who have some experience with Lean and Mathlib and want to speed up formalisation projects with coding agents.

What you'll walk away with

  • Set up a Lean project with Mathlib so that a coding agent can build, check and iterate
  • Break theorems into subgoals with sorry placeholders and have the agent close specific gaps
  • Find suitable Mathlib lemmas with search tactics and support from the agent
  • Feed error messages and goal states back to the agent so that it makes useful corrections
  • Judge whether a formalisation captures the intended statement rather than merely compiling

Typical scenarios

  1. A research group formalises a lemma on convergent sequences; the agent closes the routine estimates while the group concentrates on choosing the right definitions.
  2. In a doctoral project the agent resolves a type class error, and review reveals that in doing so it had weakened the statement of the theorem.
  3. For a course, Lean exercises are created whose model proofs the agent writes and the kernel checks before they reach students.

Does this fit your team?

Pick a few dates that suit you. The request is non-binding, and the agenda is tailored in a short call beforehand.

Request dates

What the Lean masterclass covers

  1. Lean, Mathlib and the agentProject setup with Lake, build commands, an instruction file for the agent and why the compiler is the decisive check.
  2. Breaking proofs into subgoalsBlueprint thinking on a small scale: helper lemmas with sorry, dependencies and a sensible order for the agent.
  3. Finding lemmasSearch tactics such as exact? and apply?, Mathlib naming conventions and prompts that make the agent cite matches instead of guessing.
  4. Iterating against the compilerError messages and goal states as feedback, stopping criteria and dealing with slow tactics such as simp in large contexts.
  5. Protecting statementsHow to stop the agent from weakening theorems, adding hypotheses or hiding sorry, and how to spot it in review.
  6. Limits and division of labourWhere agents help dependably, where they fail on new mathematics and how groups share out the formalisation work.

Before the Lean masterclass: prerequisites

  • Some experience with Lean and Mathlib, for example from tutorials or small proofs of your own
  • A laptop with a working Lean installation, VS Code and a coding agent
  • Optional: a theorem of your own or an ongoing formalisation project

Materials you keep

  • A project template with an instruction file and a check script against hidden sorry placeholders
  • Prompt patterns for subgoals, lemma search and error messages
  • A review checklist that protects statements and hypotheses from silent changes

How it works

  1. Request with preferred datesTick the date proposals that suit you or name a period of your own.
  2. Short callWe talk about your goals, prior knowledge and the tools your team already uses.
  3. Agenda for your teamYou receive a plan tailored to your group, with exercises that match your subject and material.
  4. Course and materialsThe course runs online, on-site or hybrid, and you keep the materials afterwards.

Why train with us

  • jocapps GmbH has offered workshops and trainings since 2014. The topics have moved with the technology; today the focus is on agentic coding and prompt engineering.
  • Hands-on rather than slides: you practise on realistic examples from maths and STEM, or on your own tasks, code or prompts if you wish.
  • Online, on-site or hybrid, held in German or English.
  • jocapps GmbH is certified to ISO 27001 (information security) and ISO 9001 (quality management).

Questions about the Lean masterclass

Can the agent prove new theorems on its own?

For routine steps in areas that Mathlib covers well it can often help. With new mathematics it usually needs your decomposition into subgoals. The masterclass shows how to prepare that decomposition so that the agent can take over the tedious intermediate steps.

Why is a proof that compiles not automatically correct?

The kernel ensures that the proof matches the formal statement. It does not check whether that statement means what you set out to prove. Poorly chosen definitions, extra hypotheses or a weakened theorem therefore remain a job for human review.

How much Lean do we really need to know?

You should be able to write simple proofs yourself, read goal states and use common tactics. Without that foundation you cannot judge what the agent proposes. For complete beginners we recommend working through an introductory Lean tutorial first.

Is the masterclass held online or on-site, and in which language?

Both are possible: live online, at your premises (in-house) or hybrid. The course is held in German or English; you choose when you send the request.

Can the content be tailored to our team?

Yes. The agenda, examples and emphasis are agreed in the call beforehand, based on your team's prior knowledge, subjects and tools. On request we work with your own exercises, data or code.