lean
Installation
SKILL.md
Lean 4 programming and proof development
Resolve bundled resources from the skill root; run Lake commands from the consumer's package root. Use official Lean documentation and the reference matching the actual compiler, not a different /latest/ release.
Step 1: Fix the contract and trust level
- Identify the task: installation, existing package change, executable behavior, mathematical formalization, or validation of an untrusted proof. Read project instructions,
lean-toolchain, Lake configuration, manifest, affected imports and declarations before changing them. - Record exact theorem statements, binders, hypotheses, type classes, definitions and intended informal meaning. Preserve the requested statement; proving a weaker, shadowed or vacuous proposition is not completion.
- Separate Lean's formal model from an external program/system. A kernel-checked theorem proves its elaborated proposition relative to its definitions and axioms, not that an unmodeled implementation matches it.
- Treat Lake configurations, imports, macros, tactics and
#evalas executable code. Review ordinary project code before building. For untrusted/AI-generated proof submissions, readreferences/proofs-mathlib-trust.mdbefore loading them; use the sandboxed validation route and a trusted challenge when statement identity matters.
Gate: the target statement/runtime contract, toolchain selection and executable trust boundary are explicit.