lean-check

lean-check is a skill for Claude Code from flonat/flonat-research. It costs 63 tokens per session (1,729 once invoked), scanned A, original, MIT.

A workflow for expressing a mathematical theorem in Lean 4 and checking it with mathlib, a library of formal mathematics. A successful build verifies the proof mechanically without unfinished placeholders.

In plain words
What is it for?
Use it to formalize important lemmas or theorems and verify them with a clean Lean build.
Why use it?
It provides a machine-checked test of whether a theorem and its proof are formally correct.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; $skill-name invocation.

Good fit Use it to formalize important lemmas or theorems and verify them with a clean Lean build.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/flonat/flonat-research/lean-check
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add flonat/flonat-research --skill lean-check
Clone the repo
git clone --depth 1 https://github.com/flonat/flonat-research

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lean-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/flonat/flonat-research/lean-check/github.svg)](https://agentmods.dev/skills/flonat/flonat-research/lean-check)
Your own site
<a href="https://agentmods.dev/skills/flonat/flonat-research/lean-check"><img src="https://agentmods.dev/badge/skills/flonat/flonat-research/lean-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lean-check

Your own site · 80×15
<a href="https://agentmods.dev/skills/flonat/flonat-research/lean-check"><img src="https://agentmods.dev/badge/skills/flonat/flonat-research/lean-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,729 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 88
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01729
Opus 5 $0.00032 $0.00864
Sonnet 5 $0.00013 $0.00346
Haiku 4.5 $0.00006 $0.00173

Measured 6d ago against content hash 513068ee1f24, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

lean-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lean-check/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lean Check: Machine-Prove a Self-Authored Lemma

Formalize a lemma/theorem in Lean 4 + mathlib and let the kernel check it. A lake build that succeeds with no sorry and no extra axioms is a machine-verified proof — the strongest guarantee available.

When to Use

  • A critical lemma whose correctness you want beyond doubt (the load-bearing step of a theorem).
  • lean-check, "formalize this in Lean", "machine-check this lemma", "prove this in Lean 4".
  • After numerical-check fails to falsify a claim and it's important enough to prove.

When NOT to Use

Situation Use instead
Stress-test / hunt a counterexample to a distributional claim numerical-check (R1)
Verify an algebra / derivative / limit / closed-form step symbolic-check (R2)
A statement too rich to faithfully formalize in reasonable time (heavy measure theory, bespoke objects) domain-reviewer — do NOT force a lossy Lean statement

Position in the verification spectrum

R3 — formal machine proof. The top rung: lake build (clean, sorry-free) = a kernel-checked theorem. Cost is high (formalization effort + statement fidelity), so reserve it for the claims that matter most; use R1/R2 to triage first.

Toolchain (pre-seeded — do not re-download)

  • Machine: Mac Mini ([server]). Check hostname; if on the MacBook, run via ssh mini.
  • Project: ~/lean-verify/mathlib_verify/ — Lean 4.31.0, mathlib v4.31.0 (cache-backed, ~7.2 GB .lake). Health check: cd ~/lean-verify/mathlib_verify && lake build MathlibVerify.SmokeTest.
  • Refresh mathlib later: lake update && lake exe cache get.

Procedure

1. State the lemma FAITHFULLY (the hard part — get this right or the check is worthless)

  • Write the Lean statement so it provably matches the informal claim. A too-weak, too-strong, or subtly-different statement that happens to build gives false confidence — the single worst failure mode.
  • Before proving, read the Lean statement back against the paper's exact hypotheses and conclusion. State every hypothesis (domains, 0 < ρ < 1, StrictMono, etc.). When unsure the encoding is faithful, ask the user to confirm the statement.
  • If the object cannot be faithfully stated in available mathlib (e.g. a bespoke distributional limit), STOP — report INCONCLUSIVE (not faithfully formalizable); do not ship a lossy proxy.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 116 lines · 63 tokens per session scan A 513068ee1f24

Subscribe to this mod's changes

lean-check is a skill published in the GitHub repository flonat/flonat-research (132 stars, last pushed 14d ago), licensed MIT. It adds 63 tokens to every session and 1,729 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

mathmodel-skill

An end-to-end workflow for mathematical-modeling competitions, including CUMCM, MCM/ICM, and the Electrical Cup. It guides teams from choosing a problem through modeling, solving, checking, writing, rule compliance, and final review.

handsomeZR-netizen/mathmodel-skill · 127 tokens

latex-compile

Compile a LaTeX document and fix every error plus aesthetic issue (overfull/underfull boxes, widows, alignment, fonts) for a clean PDF and log. Use this instead of running pdflatex/latexmk manually — it avoids the latexmk stale-log trap and silent grep failures on binary log output, and it reformats rather than…

Mexregkan/claude-for-researchers · 79 tokens

nb-to-wolfbook

Convert Mathematica .nb or .m files to Wolfbook .wb format so they open and run in VS Code. Use when bringing existing .nb/.m files into Wolfbook, or to make an existing .wb bridge-safe.

Mexregkan/claude-for-researchers · 53 tokens

sync-wb-nb

Propagate a change made in a Wolfbook .wb notebook into the paired .nb notebook so the two stay identical. Use immediately after every .wb edit.

Mexregkan/claude-for-researchers · 38 tokens

wolfram-headless

Run heavy Wolfram Language (wolframscript) computations from Claude Code reliably, and diagnose the misleading "The product exited because of a license error". Use whenever invoking wolframscript on a non-trivial computation, when a wolframscript job dies with a "license error" despite a valid license, or when Wolfram…

Mexregkan/claude-for-researchers · 84 tokens

cross-validate

Format a result, derivation, or numerical value for independent verification by a second model. Use when you want a cross-check on an important or contested result.

Mexregkan/claude-for-researchers · 36 tokens