Agent skill

Lean Check

by flonat in flonat/flonat-research

Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry.

MITAuto-check: notes

Install Lean Check

skills CLI
$ npx skills add flonat/flonat-research --skill lean-check -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install flonat/flonat-research lean-check --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/flonat/flonat-research.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lean-check .claude/skills/lean-check && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lean-check
GitHub stars
145
Token cost
~1.6k tokens
SKILL.md length
713 words
Files
1
Skills in repo
83
Repo updated
First seen
Licence
MIT

At a glance

Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry.

  • Works in 5 steps: State the lemma FAITHFULLY (the hard… → Write the module into the mathlib… → Prove with mathlib tactics; iterate → …
  • The mathematical claim can be stated faithfully and machine-checked
  • SKILL.md covers When to Use, When NOT to Use, Position in the verification… and Toolchain (pre-seeded — do not…, plus 6 more sections
  • Calls ssh

What it does

Lean Check is an agent skill from flonat/flonat-research. Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry. Use when the mathematical claim can be stated faithfully and machine-checked. For numerical falsification or symbolic algebra, use $numerical-check or $symbolic-check.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows. The licence is MIT.

When your agent uses it

  • The mathematical claim can be stated faithfully and machine-checked

Example prompts

  • “/lean-check”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, AskUserQuestion

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. State the lemma FAITHFULLY (the hard part — get this right or the check is worthless)
  2. Write the module into the mathlib project scratch (NEVER the Overleaf paper)
  3. Prove with mathlib tactics; iterate
  4. Build and read the verdict
  5. Emit the verification report + keep the .lean

What it can do on your machine

Read from SKILL.md and the folder at commit da27600. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • ssh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use ssh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Lean Check loads about 1.6k tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 713 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from flonat/flonat-research at commit da27600, republished under its MIT licence (© flonat). 713 words, ~1,632 tokens.

Download SKILL.mdSave it as .claude/skills/lean-check/SKILL.md (or your agent's skills folder).
name
lean-check
description
Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean `lake build` without `sorry`. Use when the mathematical claim can be stated faithfully and machine-checked. For numerical falsification or symbolic algebra, use $numerical-check or $symbolic-check.
allowed-tools
Read, Write, Edit, Bash, AskUserQuestion

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

SituationUse instead
Stress-test / hunt a counterexample to a distributional claimnumerical-check (R1)
Verify an algebra / derivative / limit / closed-form stepsymbolic-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.
2. Write the module into the mathlib project scratch (NEVER the Overleaf paper)

Write to ~/lean-verify/mathlib_verify/MathlibVerify/<Name>.lean:

lean
import Mathlib
theorem <name> (<hyps>) : <conclusion> := by
  <tactic proof>
3. Prove with mathlib tactics; iterate
  • Try: simp, norm_num, ring, linarith/nlinarith, positivity, gcongr, field_simp, exact?, apply?, polyrith.
  • Iterate on the proof, not the statement. If you find yourself weakening the statement to make it build, STOP — that's cheating the check.
4. Build and read the verdict
bash
cd ~/lean-verify/mathlib_verify && lake build MathlibVerify.<Name>
  • Exit 0 + no sorry → candidate VERIFIED. Confirm no shortcuts:
    • grep -n 'sorry\|admit' MathlibVerify/<Name>.lean → must be empty.
    • Add #print axioms <name> and rebuild → must show only propext, Classical.choice, Quot.sound (mathlib's standard axioms); sorryAx present ⇒ NOT proven.
  • Statement doesn't typecheck → formalization error (fix the statement, re-verify fidelity).
  • Builds but proof won't close after honest effort → INCONCLUSIVE (unproven; claim may still be true). Failing to prove is NOT a disproof.
  • You prove the negation (¬ <claim>) → FALSIFIED.
Show full SKILL.md (252 more words)Show less
5. Emit the verification report + keep the .lean

Verdict semantics (important)

OutcomeVerdict
Faithful statement, clean build, no sorry, standard axioms onlyVERIFIED
Proved the negationFALSIFIED
Faithful statement, proof didn't close after real effortINCONCLUSIVE (unproven)
Can't faithfully formalize the claimINCONCLUSIVE (not formalizable)
Toolchain / build-system failureERROR

Anti-Patterns

  • Don't trust a green build without checking sorry/admit and #print axioms — a sorry builds fine and proves nothing.
  • Don't weaken/alter the statement to make it build — the statement is the claim; a proof of a different statement is false confidence.
  • Don't read "proof didn't close" as FALSIFIED — inability to prove ≠ disproof.
  • Don't force a rich probabilistic/measure-theoretic claim into a lossy Lean proxy — report not-formalizable and escalate to domain-reviewer.
  • Don't write into paper-{venue}/paper/ or re-scaffold mathlib — use the seeded project scratch.
  • Don't run bare python/toolchain guesses — Lean via lake only.

Output — Verification Report (shared *-check shape)

Write to reviews/<scope>/verify-lean/<YYYY-MM-DD-HHMM>.md, and copy the .lean module beside it (or note its path):

claim:    <informal statement> ⟶ <Lean statement (verbatim)>
fidelity: <one line: why the Lean statement faithfully encodes the claim>
method:   R3 Lean 4 (v4.31.0) + mathlib; lake build; sorry-free; axioms = <#print axioms output>
verdict:  VERIFIED | FALSIFIED | INCONCLUSIVE (unproven|not formalizable) | ERROR
reproduce: cd ~/lean-verify/mathlib_verify && lake build MathlibVerify.<Name>   (module attached)

Verification (did this skill work?)

  • lake build MathlibVerify.<Name> exits 0.
  • grep sorry is empty AND #print axioms shows only the standard three.
  • The ## fidelity line exists — no VERIFIED without an explicit statement-faithfulness argument.

Worked example (toolchain smoke)

theorem lc_smoke (a b : ℝ) (h : a ≤ b) : a - 1 < b + 1 := by linarith → lake build exit 0, no sorry, standard axioms → VERIFIED. (A faithful Lean formalization of the median-collapse theorem itself — Φ, medians of distributions, the large-council limit — is a genuine formalization project; lean-check is for the tractable load-bearing lemmas, with R1/R2 covering the rest.)

© flonat, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/lean-check of flonat/flonat-research.

Open the folder on GitHubat commit da27600

Compare with similar skills

Lean Check next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lean Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lean Check this skillflonat/flonat-research145—~1.6kAutomated safety check: NotesMIT
Lean Formalizewanshuiyin/Auto-claude-code-research-in-sleep17k—~5.4kAutomated safety check: NotesMIT
Hermes Agent Skill AuthoringNousResearch/hermes-agent252k—~3.6kAutomated safety check: PassMIT
Configuring Oauth2 Authorization Flowmukul975/Anthropic-Cybersecurity-Skills34k—~1.7kAutomated safety check: PassApache-2.0
Authoring Skillsvercel/next.js143k—~1kAutomated safety check: PassMIT
Abp Authorizationabpframework/abp14k—~1.3kAutomated safety check: PassLGPL-3.0

Similar skills

  • Lean Formalize

    wanshuiyin/Auto-claude-code-research-in-sleep

    Develop and verify a mathematical proof in Lean, continue an incomplete Lean project, or audit whether it proves the original statement.

    17k GitHub stars~5.4k tokensUpdated today
    Auto-check: notes
  • Hermes Agent Skill Authoring

    NousResearch/hermes-agent

    Author in-repo SKILL.md files: frontmatter and structure. An agent skill from NousResearch/hermes-agent.

    252k GitHub stars~3.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Configuring Oauth2 Authorization Flow

    mukul975/Anthropic-Cybersecurity-Skills

    Configures secure OAuth 2.0 authorization flows, including Authorization Code with PKCE, Client Credentials, and Device Authorization Grant, covering flow selection, PKCE implementation, token…

    34k GitHub stars~1.7k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Authoring Skills

    vercel/next.js

    Official

    How to create and maintain agent skills in .agents/skills/. An agent skill from vercel/next.js.

    143k GitHub stars~1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Abp Authorization

    abpframework/abp

    ABP permission system - PermissionDefinitionProvider, [Authorize] attribute, CheckPolicyAsync, IsGrantedAsync, ICurrentUser, IPermissionManager, multi-tenancy side.

    14k GitHub stars~1.3k tokensUpdated today
    Backend & APIsAuto-check passed
  • Implementing GCP Binary Authorization

    mukul975/Anthropic-Cybersecurity-Skills

    Implements GCP Binary Authorization end to end, including creating KMS-backed attestors, Container Analysis notes, deploy-time policies, and signing image attestations, so that only trusted…

    34k GitHub stars~2k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed

More from flonat/flonat-research

All 83 skills in this repo
  • Latex Posters

    flonat/flonat-research

    Create a large-format academic poster in LaTeX using beamerposter, tikzposter, or baposter.

    145 GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check: notes
  • Skill Creator

    flonat/flonat-research

    Create, revise, and evaluate reusable AI workflow skills, including trigger-quality tests.

    145 GitHub stars~4.4k tokensUpdated 8 days ago
    Auto-check passed
  • DOCX

    flonat/flonat-research

    Create, read, edit, or convert Microsoft Word documents while preserving professional document structure.

    145 GitHub stars~1.2k tokensUpdated 8 days ago
    Auto-check passed
  • PDF

    flonat/flonat-research

    Read, create, combine, split, rotate, OCR, watermark, secure, or extract content from PDF files.

    145 GitHub stars~488 tokensUpdated 8 days ago
    Auto-check passed
  • Init Project Orchestration

    flonat/flonat-research

    Create or migrate project-level agents, repeatable project workflows, and planning state from one client-neutral contract, then render repository-scoped adapters for both Claude Code and Codex.

    145 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed
  • Pre Commit Audit

    flonat/flonat-research

    Deliver a fast pre-commit safety scan: file size, anonymity (author / affiliation strings in tex/bib), hardcoded secrets, and invisible-Unicode carriers.

    145 GitHub stars~2.8k tokensUpdated 8 days ago
    Auto-check: notes

Questions about Lean Check

What does Lean Check do?

Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry. Lean Check is an agent skill from flonat/flonat-research. Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry.

When should I use Lean Check?

Lean Check fits situations like: the mathematical claim can be stated faithfully and machine-checked.

How do I install Lean Check in Claude Code?

Run `npx skills add flonat/flonat-research --skill lean-check -a claude-code`. Or copy the skill folder (skills/lean-check in flonat/flonat-research) into .claude/skills/lean-check in your project. Claude Code loads it when a task matches its description.

How do I install Lean Check in Codex?

Run `npx skills add flonat/flonat-research --skill lean-check -a codex`. Or copy the skill folder (skills/lean-check in flonat/flonat-research) into .agents/skills/lean-check in your project. Codex loads it when a task matches its description.

Can I use Lean Check in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add flonat/flonat-research --skill lean-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lean-check, .gemini/skills/lean-check, .github/skills/lean-check and .opencode/skills/lean-check in your project.

What does Lean Check need to run?

Going by SKILL.md and its folder, Lean Check needs the command-line tools its instructions call (ssh). Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, AskUserQuestion.

Does Lean Check access the network?

SKILL.md contains no URLs. Its commands use ssh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Lean Check safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Lean Check use?

Lean Check is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lean Check use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Lean Check?

Skills that share tags, products or a category with Lean Check: Lean Formalize (wanshuiyin/Auto-claude-code-research-in-sleep, 17k stars), Hermes Agent Skill Authoring (NousResearch/hermes-agent, 252k stars), Configuring Oauth2 Authorization Flow (mukul975/Anthropic-Cybersecurity-Skills, 34k stars) and Authoring Skills (vercel/next.js, 143k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lean Check?

flonat (a GitHub user) maintains it in flonat/flonat-research, which has 145 GitHub stars. The repository holds 83 skills in this directory. The repository was last updated on September 29, 2026.

Source: flonat/flonat-research on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.