writing-lean-proofs
Structured Lean 4 proof writing and library design following Mathlib conventions
Imported description, not reviewed yet
This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.
Download
Read this before you download
Talqeen never runs anything from this item. But what you download runs on your machine if you run it or let Claude Code run it, so read the files first.
- The item has script files.
Install
Plugins are installed from a plugin marketplace in Claude Code, not by copying files. Download the package to read its content and its license.
Instructions
writing-lean-proofs
Structured Lean 4 proof writing and library design following Mathlib conventions — for proofs and libraries that humans and LLMs can review, repair, and extend.
What it does
Guides Claude (and Codex, via marketplace compatibility) through a design-top-down, prove-bottom-up workflow:
- Design definitions and their API first — total functions with junk values, bundled morphisms/subobjects, simp-normal forms, API lemmas in the same file before first use.
- Build a sorry skeleton — state the theorem and its lemmas as
compiling
sorrystubs (spec-driven development, as practiced by the Liquid Tensor Experiment, PFR, and FLT projects), then thehave/suffices/calcskeleton inside each proof. - Fill goals one at a time — focusing dots, honest
showlines, calc chains, simp discipline. - Verify mechanically — compile and lint; never eyeball-check style.
Plus: the extraction ladder (when a have graduates to a lemma), Mathlib
naming so lemma names are guessable, an anti-pattern catalog mapped to the
linters that catch each one, and evidence-based techniques specific to
LLM-written proofs (goal-state annotation, typed-have skeletons,
verification in the loop).
Why these rules
Every principle is sourced from Mathlib's style/review/naming guides, the Mathlib maintenance papers, retrospectives of large formalizations (perfectoid spaces, LTE, PFR, FLT), Mathematics in Lean, Theorem Proving in Lean 4, and the ImProver paper (ICLR 2025) for LLM-specific techniques. The claims were verified against the primary sources; commonly overstated rules (e.g. turning Mathlib's general one-tactic-per-line recommendation into an absolute requirement) are qualified in the anti-patterns reference.
Contents
All paths below are relative to skills/writing-lean-proofs/:
SKILL.md— workflow, extraction ladder, quick-reference rulesreferences/library-design.md— definitions, APIs, abstraction boundaries, project decompositionreferences/proof-style.md— tactic proof structurereferences/naming-conventions.md— Mathlib namingreferences/anti-patterns.md— anti-patterns → rationale → enforcing linterreferences/llm-techniques.md— LLM-specific drafting techniquesreferences/linting.md— axiom audits, library versus self-contained CI linter profiles, and project-specific lintersreferences/performance.md— proof and reduction-cost diagnosisreferences/tactics.md— safe, bounded, traceable tactic metaprogramming
Evals
evals/ contains a review-flow eval suite: Lean fixtures (derived from a
real formal-verification project) with known planted flaws and known
non-flaws, natural review prompts, per-case rubrics, and a runner that
compares a baseline arm against a skill arm using an LLM judge. See
evals/README.md. evals/run.sh --self-test checks offline
grader-schema and isolation fixtures; --self-test-live checks the real grader
against known-bad and known-good reviews and makes paid model calls.
When not to use
Lean-as-programming-language work without proofs, other proof assistants (Coq/Isabelle/Agda), Lean 3 codebases, or projects with a conflicting house style (defer to their CONTRIBUTING).
Files
- folder.claude-plugin297 B
- plugin.json297 B
- folderevals55 KBscript
- foldercases21 KB
- folder01-definitions-review4.7 KB
- folderinput1.6 KB
- Felt.lean1.6 KB
- prompt.md39 B
- rubric.md3 KB
- folder02-missing-api4.4 KB
- folderinput2.3 KB
- Bounds.lean2.3 KB
- prompt.md54 B
- rubric.md2 KB
- folder03-normal-form4.1 KB
- folderinput2.2 KB
- WordCmp.lean2.2 KB
- prompt.md42 B
- rubric.md1.9 KB
- folder04-structural3.7 KB
- folderinput1.2 KB
- U32Pairs.lean1.2 KB
- prompt.md56 B
- rubric.md2.5 KB
- folder05-clean-restraint4.4 KB
- folderinput1.8 KB
- Carry.lean1.8 KB
- prompt.md53 B
- rubric.md2.5 KB
- folderselftest2.9 KB
- bad-review.md780 B
- good-review.md2.1 KB
- .gitignore9 B
- README.md7.9 KB
- grade-prompt.md1.5 KB
- run.sh22 KBscript
- folderskills89 KB
- folderwriting-lean-proofs89 KB
- folderreferences74 KB
- anti-patterns.md6.9 KB
- library-design.md7.7 KB
- linting.md22 KB
- llm-techniques.md5.4 KB
- naming-conventions.md2.5 KB
- performance.md5.3 KB
- proof-style.md7.8 KB
- tactics.md16 KB
- SKILL.md16 KB
- foldertests1 KBscript
- self-test.bats1 KBscript
- LICENSE20 KB
- README.md3.2 KB
What the automatic scan found
We scanned the files automatically when they were imported. This is what the scan pointed at. It does not mean the item is harmful, and it does not mean it is safe: read it yourself.
- Needs a lookA script file
In file plugins/writing-lean-proofs/evals/run.sh
- Needs a lookDeletes files forcibly and recursively
In file plugins/writing-lean-proofs/evals/run.sh, line 202
Comments (0)
No comments yet. Be the first.
Sign in to comment. Commenting comes at level 1 (Member).