lean-impl

Translate Python, Go, or Dafny source code into formal Lean 4 models.

5|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/nicholls-inc/claude-code-marketplace --skill lean-impl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-impl
Source: https://github.com/nicholls-inc/claude-code-marketplace/tree/main/crosscheck/skills/lean-impl
Command: npx skills add https://github.com/nicholls-inc/claude-code-marketplace --skill lean-impl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps translate source implementations into formal Lean 4 models suitable for verification and testing.

Core Features & Use Cases

  • Source translation: Converts imperative or effectful code into pure functional Lean definitions aligned with formal specifications.
  • Verification readiness: Ensures code is buildable and consistent with Lean's type system, aiding formal verification efforts.
  • Use Case: Automate the process of turning a production module in Python or Go into a Lean model that can be checked for correctness against specifications.

Quick Start

Use the lean-impl skill to convert the source implementation of the specified module into a Lean model.

Frequently Asked Questions about lean-impl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate source code into a Lean 4 model for formal verification?

Translating source code into a Lean 4 model for formal verification involves converting imperative implementations into pure functional definitions aligned with formal specifications. This ensures the model is buildable and consistent with Lean's type system.

Can I use Lean 4 modeling on Python or Go source code?

Yes, Lean 4 modeling applies to modules in languages like Python, Go, or extracted Dafny code. The process transforms these source implementations into formal Lean definitions suitable for testing and proof integration.

What is the best way to prepare Python code for formal verification?

The best way to prepare Python code for formal verification is to translate the source implementation into a formal Lean 4 model. This converts effectful code into pure functional definitions ready for correctness checking against specifications.

Does Lean 4 verification require the translated model to match a spec stub?

Yes, Lean 4 verification requires the translated model to match the spec stub. The transformation ensures the generated formal model is buildable and consistent with the provided specification stubs for formal analysis.

Why does my source translation fail Lean's type system checks?

Source translation can fail Lean's type system checks if the imperative source code cannot be cleanly converted into pure functional definitions. The process requires ensuring the generated model remains consistent with Lean's strict type requirements.