Borrowing it
Nothing to install: this file belongs to nasqret/lean-interact. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/nasqret/lean-interact/main/.claude/skills/formalize/SKILL.mdgit clone --depth 1 https://github.com/nasqret/lean-interactWrote 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.
[](https://agentmods.dev/skills/nasqret/lean-interact/formalize)<a href="https://agentmods.dev/skills/nasqret/lean-interact/formalize"><img src="https://agentmods.dev/badge/skills/nasqret/lean-interact/formalize/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.
<a href="https://agentmods.dev/skills/nasqret/lean-interact/formalize"><img src="https://agentmods.dev/badge/skills/nasqret/lean-interact/formalize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00168 | $0.04398 |
| Opus 5.5 | $0.00067 | $0.01759 |
| Sonnet 5.5 | $0.00034 | $0.00880 |
| Haiku 4.5 | $0.00017 | $0.00440 |
Grade A, and why
formalize 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.
formalize
The core loop of this repository. The user — a working mathematician who knows the mathematics and is learning Lean — types a sentence of ordinary mathematics; you return compiled Lean plus a short teaching note.
Repository root: /path/to/lean-interact, the directory this clone lives in. Use absolute
paths when reading and editing files. Run the tools/ scripts from the repository root with
repo-relative paths (python3 tools/mlq.py …): that is the form .claude/settings.json
allows without a permission prompt, and it is the form to show the user.
Before the first formalization of a session, read MEMORY.md and
vault/Formalization Style.md. They contain decisions you would otherwise contradict.
Run the steps in order. Do not skip steps because the claim looks easy; the cheap steps are the ones that prevent the expensive mistakes.
Step 1 - UNDERSTAND
Restate the claim as precise mathematics before touching any file. Make explicit, in one short paragraph:
- every quantifier and its range;
- every hypothesis, including the ones ordinary prose leaves silent (
pprime often means odd; "a/b" often meansb ∣ a; "the order of a" presupposesgcd(a, n) = 1); - the ambient type.
Choose the ambient type using vault/Nat vs Int vs ZMod.md. If that note is not present
yet, use the table in vault/Formalization Style.md section 1. The short version:
| The claim is about | Type |
|---|---|
| counting, divisibility, gcd, primes, no subtraction | ℕ, with Nat.ModEq for congruences |
| genuine differences, negatives, Bezout coefficients | ℤ, with Int.ModEq |
| a fixed numeral modulus, ring or unit structure mod n, squares, orders | ZMod n |
a quantified modulus n |
Nat.ModEq / Int.ModEq, never ZMod n (dependent type pain) |
Ambiguity rule. Ask at most ONE short question, and only if the answer would change the
statement. Otherwise state the assumption in one clause and continue:
"Taking n > 0 and a coprime to n; say if you meant otherwise." Never open a
formalization with a list of questions.
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.
- 2mo ago First seen · 315 lines · 168 tokens per session scan A 4f6a803e68ff
formalize is a skill published in the GitHub repository nasqret/lean-interact (11 stars, last pushed 2mo ago), licensed MIT. It adds 168 tokens to every session and 4,398 once invoked, about $0.0007 per session on Opus 5.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-08-31.
Other skills, from other repositories
screen
Screen informal↔Lean 4 statement pairs for faithfulness defects. Use whenever writing, editing, translating, or reviewing Lean 4 theorem or definition statements that are meant to formalize informal mathematics: after drafting a statement, before committing formalizations, when auditing a benchmark file, or when the…
lean-probe
Fast Lean 4 proof verification for coding agents via the LeanProbe MCP server's warm REPL. Use when you need to know whether Lean 4 code compiles (no errors, no sorry), iterate on a declaration inside a Lake/Mathlib project, test a replacement proof candidate, or explore a goal tactic by tactic — far faster than lake…
mathlib-api
Evidence-driven workflow for designing a Mathlib definition and the API around it. Use when adding a new structure/def intended for mathlib; when choosing between design alternatives (index type as field vs parameter, Set vs indexed family, coarse set vs finer indexed structure and when the fine one should exist at…
lean-expert
Lean 4 theorem-prover expertise for agents -- current versions, tactic cookbook, Mathlib search, compiler-error recoveries. Use when proving, debugging, or explaining Lean 4 proofs via leanforge-mcp.
pub-cycle
Publication Cycle — scans the main theory paper, identifies new paper extractions and existing paper gaps, then orchestrates the full review+fix pipeline. Workflow: Triage → Codex review+fix (2 rounds) → ChatGPT review → Codex fix → Claude review → Codex fix → ChatGPT journal-targeted acceptance gate. During wait…
lean4-proof
This skill covers proving bounds on recursively-defined sequences in Lean 4, using the pattern of.