SkillsReviewed · wanshuiyin

Lean Formalize

Lean Formalize is an AI assistant skill for researchers and developers building or auditing mathematical proofs, but its full workflow needs Lean tooling and separately configured reviewer integrations. It focuses on preserving the original mathematical claim, connecting intermediate lemmas and checking the final theorem's logical assumptions.

Researched 17 Nov 2026

In short.

Lean Formalize is an AI assistant skill for researchers and developers seeking checked mathematical proofs, but users must supply working Lean tools and host-specific reviewer integrations. It covers new proofs, incomplete projects, audits and reproducible handoffs. Its central distinction is between compiling a declaration and proving the intended mathematical statement with all necessary connections established. The documentation is detailed, but operational compatibility, effectiveness and total cost are unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected skills/lean-formalize folder at revision 9f30e834d24a337dbdd06fb20a1150d4376dfa59: SKILL.md and its three reference documents. The repository-root LICENSE is included as the related notice above the selected folder. Shared routing documents, helper implementations, other skills, reviewer services and externally linked projects are outside this evidence. No commands, installation, Lean builds or reviewer calls were executed; operational behavior and outcomes remain unassessed.

The overview

Identity

Lean Formalize is the lean-formalize skill folder in wanshuiyin/Auto-claude-code-research-in-sleep. SKILL.md is its entry point, accompanied by references on adversarial review, Lean implementation and final verification. It provides instructions for an AI coding assistant; Lean supplies the formal proof-checking machinery.

Original resource location: [https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/tree/main/skills/lean-formalize].

Assessment

The strongest feature is its attention to proving the right claim. It requires comparison with the original statement, checks that intermediate assumptions are actually established, and distinguishes a completed proof from unfinished review or reproduction requirements.

This makes the design useful for projects where an apparently successful formalization could conceal a weaker theorem or an unconstructed certificate. No end-to-end execution results or comparative benchmarks establish how reliably an assistant follows the procedure.

Intended users

The skill addresses mathematical researchers and developers starting a Lean formalization, continuing an incomplete proof, auditing an exported theorem or preparing a proof handoff. It accepts a statement, prose proof, proof file, Lean project or audit request as a starting point.

Beginners should understand that Lean checks precisely encoded statements: choosing definitions and developing the mathematical argument remain necessary. The supplied documents are working procedures, not an introductory Lean course or a complete installation guide. Ordinary mathematical drafting can use a lighter process.

Capabilities

The instructions cover specification, proof decomposition, library search, implementation, diagnosis of build errors, integration at actual callers, statement review and final dependency auditing. They also address finite computations, certificates, representation changes and performance bottlenecks.

For delivery, the skill calls for proof sources, pinned configuration, relevant verification output and reproducible commands. Audit mode is scoped to inspection and reporting; it explicitly separates that task from silently repairing or weakening a theorem.

Using it

Requirements

Implementation requires an assistant host with project-file access and command execution, plus a compatible Lean environment. Lake package configuration and locked dependencies matter for Lake projects; Mathlib is relevant only when the proof uses it. The instructions favor existing pinned environments.

Substantial projects also depend on authorized reviewer integrations. The entry point describes Codex MCP as the Claude Code default and documents other reviewer routes, but actual availability is unknown. Shared routing documents, a reviewer_route.py helper and other referenced skills lie outside the captured folder, so their implementations are not established by this evidence.

How it works

The process starts by fixing objects, hypotheses, quantifiers and the intended conclusion. It then maps intermediate lemmas to the original inputs, implements missing connections and assembles the exported theorem. Final checks inspect the actual definitions, theorem type and transitive axioms: the assumptions used directly or indirectly by its proof.

Three review checkpoints examine the encoding, important arguments and final assembly. The first seeks an independent translation of the Lean definitions before revealing the intended interpretation. Reviewers from different model families provide additional scrutiny, but the documents explicitly reject model agreement as mathematical proof.

Setup

Keep SKILL.md with its three reference documents and preserve the repository license notice. Before implementation, identify the original statement, project entry point, Lean toolchain, dependency lockfile and current proof state. The skill discourages unnecessary dependency changes or restarting an existing proof framework.

The full review procedure also needs the linked host-routing material and working reviewer transports. The captured folder provides no self-contained installer or demonstrated compatibility matrix, so loading it alone does not establish that every described integration will work.

Example

The working-loop reference supplies a finite-set example: if s contains at most 12 elements and t at most 20, it applies Finset.card_union_le to derive that their union contains at most 32. The example illustrates checking a library declaration's arguments and using it with the actual hypotheses. It is a documented example, not an executed result here.

For larger projects, the verification reference gives illustrative commands such as lake build ExampleProof.Main and lake env lean ReviewAudit.lean. ExampleProof is a placeholder project name. The audit then inspects the exported theorem and uses #print axioms to reveal its logical dependencies.

Assessment & evidence

Limitations

The skill cannot guarantee that an arbitrary open problem has a proof or that an assistant will discharge every obligation. Its own guidance distinguishes missing mathematics from syntax or API errors. A successfully compiled conditional lemma can still leave the original theorem unproved.

Reviewer availability can leave requested checkpoints pending even when a formal theorem is checked. Conversely, favorable reviewer opinions cannot replace proof checking. Installation success, host compatibility, runtime behavior and proof-completion rates are untested.

Lean verification also has a boundary: it checks the encoded proposition under its logical assumptions. It does not automatically establish correspondence with the intended mathematics or certify a separate prose explanation.

Why the approach matters

The design addresses two distinct problems: proving an unintended statement and leaving essential assumptions unproved. For example, a declaration of type Target → Target does not supply a proof of Target. Similarly, Certificate x → Desired x still requires construction of Certificate x for the original inputs.

Its final audit therefore combines statement inspection with dependency checking. Searching source text for unfinished proofs is useful, but #print axioms examines what the exported theorem actually depends on. These are concrete safeguards in the documented design; their effectiveness in an assistant session has not been measured.

Alternatives

The entry point directs ordinary prose proofs and derivations toward proof-writer or formula-derivation. It reserves proof-checker for an existing ARIS proof-audit or submission role. Those resources are referenced but not included, so their capabilities, setup and costs are not assessed.

For a small self-contained Lean proof, the guidance allows direct compilation with type and axiom output. It does not require creating a separate multi-module project, and it scales review requirements to the claim unless the user explicitly requests more.

Evidence

The supplied material includes the complete SKILL.md, references/adversarial-review.md, references/lean-working-loop.md and references/verification-and-handoff.md, plus the repository-root LICENSE. Together they establish the intended procedure, illustrative commands and redistribution terms.

The materials do not supply an end-to-end execution transcript for this skill, measured performance or substantive reviewer responses for a completed target. The pinned original entry point is available at [https://raw.githubusercontent.com/wanshuiyin/Auto-claude-code-research-in-sleep/9f30e834d24a337dbdd06fb20a1150d4376dfa59/skills/lean-formalize/SKILL.md].

Access & freshness

Costs

Total operating cost is unknown. The evidence supplies no model rates, subscription requirements, token totals, reviewer-call costs or measured build-resource usage.

The MIT license permits use and redistribution, but does not establish the price of any hosted assistant or reviewer service. Local proof builds and dependency downloads also require resources; their time, storage and compute requirements are not quantified.

Rights and licensing

The supplied repository-root license is MIT, copyright 2026 wanshuiyin. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notice accompany copies or substantial portions. It includes warranty and liability disclaimers.

That notice supports redistribution of the captured skill material with the required notice. Terms for external model services, reviewer bridges and proof-library dependencies are not established by this license.

Source version and compatibility

The supplied snapshot is revision 9f30e834d24a337dbdd06fb20a1150d4376dfa59, captured on 2026-11-17 at 05:44:34.802 UTC. It establishes the content of that revision; subsequent changes are unknown.

Mathlib v4.24.0 appears in the finite-set example, and Lean 4.24.0 appears in the Lake cleanup guidance. These are version-specific examples, not a general compatibility guarantee. Other versions and reviewer bridges require checks against the actual project and host.

Practical next steps

Start with a precise original statement and choose implementation, continuation, audit or handoff mode. Supply the actual proof files and pinned project configuration. Confirm the linked routing dependencies and authorized reviewer tools before expecting the complete review process.

A bounded first use is a small theorem with a known mathematical proof. Check the encoded statement, build its actual target and inspect its type and transitive axioms. Keep any missing mathematical connection, unavailable review or outstanding reproduction requirement explicitly open.

Evidence for this report

LICENSEnotice · checked 2026-11-17
skills/lean-formalize/SKILL.mdselected · checked 2026-11-17