Formalize
Turn informal mathematics into Lean 4 statement skeletons. The output should be
faithful declarations with real mathematical content and proofs left as
:= by sorry.
When to Use
Use this skill when:
- A theorem, lemma, proposition, corollary, or definition needs to be
formalized from informal mathematics.
- An existing Lean declaration's statement needs to be corrected to match its
informal source.
- A blueprint, textbook excerpt, paper note, or user-written statement needs a
Lean declaration skeleton.
Workflow
- Read the source statement and the local Lean context where the declaration
will live.
- Extract the mathematical structure:
- objects and ambient types
- hypotheses and typeclass assumptions
- conclusion
- subclaims, directions, uniqueness clauses, and indexed families
- Audit the source definitions first: resolve each named concept and list every
condition it entails (continuity, topology, completeness, etc.), so nothing
implicit is dropped. See reference-formalizer.md.
- Acid-test the Mathlib definitions: use the
lean-searchskill tools (leandex,
lean-explore, loogle, …) to find candidate types, read their actual
definitions, and confirm the axioms match the source condition by condition.
Prefer bundled Mathlib structures; bridge or define custom only when needed.
- Choose the declaration kind (
deffor a constructed object,structurefor
data-plus-properties, theorem for an asserted proposition).
- Write the Lean declaration and any necessary supporting definitions. Leave
theorem proofs as := by sorry.
- Review the draft against reference-reviewer.md.
Fix semantic mismatches before accepting the declaration.
- Verify with the local Lean checker from the
verificationskill, usually:
python cli_tools/lean.py check FILE
Only accept the result when the semantic review passes and Lean reports no
errors other than intentional sorry warnings.
Boundaries
- Do not prove the theorem.
- Do not do proof search.
- Do not weaken, specialize, or otherwise distort the statement just to make it
compile.
References
- Read reference-formalizer.md for statement-writing
rules and common Lean encodings.
- Read reference-reviewer.md for the strict audit
checklist.