writing-lean-proofs
Structured Lean 4 proof writing and library design following Mathlib conventions
وصف مستورد لم يراجعه محرر بعد
جاء هذا العنصر من مستودعه الأصلي وفحصناه آلياً فقط، ولم يكتب له محرر وصفاً عربياً بعد. اقرأ محتواه بنفسك قبل أن تعتمد عليه. ولا تُفهرس هذه الصفحة في محركات البحث حتى تُراجَع.
التنزيل
اقرأ هذا قبل أن تنزّل
لا يشغّل تلقين أي شيء من هذا العنصر. لكن ما تنزّله يعمل على جهازك إن شغّلته أنت أو سمحت لكلود كود بتشغيله، فاقرأ الملفات أولاً.
- في العنصر ملفات سكربت.
التثبيت
تُثبَّت الإضافات من سوق الإضافات في كلود كود، لا بنسخ الملفات. نزّل الحزمة لتقرأ محتواها وترخيصها.
التعليمات
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).
الملفات
- مجلد.claude-plugin297 بايت
- plugin.json297 بايت
- مجلدevals55 ك.بسكربت
- مجلدcases21 ك.ب
- مجلد01-definitions-review4.7 ك.ب
- مجلدinput1.6 ك.ب
- Felt.lean1.6 ك.ب
- prompt.md39 بايت
- rubric.md3 ك.ب
- مجلد02-missing-api4.4 ك.ب
- مجلدinput2.3 ك.ب
- Bounds.lean2.3 ك.ب
- prompt.md54 بايت
- rubric.md2 ك.ب
- مجلد03-normal-form4.1 ك.ب
- مجلدinput2.2 ك.ب
- WordCmp.lean2.2 ك.ب
- prompt.md42 بايت
- rubric.md1.9 ك.ب
- مجلد04-structural3.7 ك.ب
- مجلدinput1.2 ك.ب
- U32Pairs.lean1.2 ك.ب
- prompt.md56 بايت
- rubric.md2.5 ك.ب
- مجلد05-clean-restraint4.4 ك.ب
- مجلدinput1.8 ك.ب
- Carry.lean1.8 ك.ب
- prompt.md53 بايت
- rubric.md2.5 ك.ب
- مجلدselftest2.9 ك.ب
- bad-review.md780 بايت
- good-review.md2.1 ك.ب
- .gitignore9 بايت
- README.md7.9 ك.ب
- grade-prompt.md1.5 ك.ب
- run.sh22 ك.بسكربت
- مجلدskills89 ك.ب
- مجلدwriting-lean-proofs89 ك.ب
- مجلدreferences74 ك.ب
- anti-patterns.md6.9 ك.ب
- library-design.md7.7 ك.ب
- linting.md22 ك.ب
- llm-techniques.md5.4 ك.ب
- naming-conventions.md2.5 ك.ب
- performance.md5.3 ك.ب
- proof-style.md7.8 ك.ب
- tactics.md16 ك.ب
- SKILL.md16 ك.ب
- مجلدtests1 ك.بسكربت
- self-test.bats1 ك.بسكربت
- LICENSE20 ك.ب
- README.md3.2 ك.ب
ما وجده الفحص الآلي
فحصنا الملفات آلياً وقت الاستيراد. هذا ما نبّه إليه الفحص، ولا يعني أن العنصر ضار ولا أنه سليم: اقرأه بنفسك.
- يحتاج مراجعةملف سكربت
في الملف plugins/writing-lean-proofs/evals/run.sh
- يحتاج مراجعةيحذف ملفات بالقوة وبالتكرار
في الملف plugins/writing-lean-proofs/evals/run.sh، السطر 202
التعليقات (0)
لا تعليقات بعد. كن أول من يعلّق.
سجّل الدخول لتعلّق. التعليق من المستوى 1 (عضو).