lean

Compile and verify Lean 4 code with Mathlib integration.

1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/AMGrobelnik/ai-inventor-old3 --skill lean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean
Source: https://github.com/AMGrobelnik/ai-inventor-old3/tree/main/.claude/skills/aii_lean
Command: npx skills add https://github.com/AMGrobelnik/ai-inventor-old3 --skill lean

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lean-interact, lean-explore, requests, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of compiling, verifying, and interacting with Lean 4 formal proofs, significantly speeding up theorem proving and formal verification tasks.

Core Features & Use Cases

  • Code Verification: Compile and check Lean 4 code for correctness.
  • Tactic Suggestion: Get suggestions for tactics to fill sorry placeholders in proofs.
  • Mathlib Search: Search Mathlib for relevant lemmas using natural language or type patterns.
  • Use Case: A mathematician is formalizing a complex theorem in Lean 4. They use the lean skill to quickly check their progress, get suggestions for the next proof step, and search for existing lemmas in Mathlib to complete their formalization.

Quick Start

Use the lean skill to verify the provided Lean 4 code snippet.

Frequently Asked Questions about lean

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

FAQPage Schema
How do I verify Lean 4 code and check formal proofs for correctness?

You can verify Lean 4 code by compiling and checking it for correctness. This process automates formal verification and theorem proving tasks, confirming the validity of your mathematical proofs.

Can I search Mathlib for lemmas using natural language or type patterns?

Yes, you can search Mathlib for relevant lemmas using natural language or type patterns. This semantic and pattern-based search helps find existing formalizations to complete your current theorem.

How do I get tactic suggestions to fill sorry placeholders in Lean 4 proofs?

You can get automated tactic suggestions to fill sorry placeholders in Lean 4 proofs. This feature provides recommended next proof steps to bridge gaps in your formalization.

Do I need a specific environment setup to compile and verify Lean 4 proofs?

Yes, you need a Lean 4 environment and access to Mathlib to compile and verify proofs. These dependencies are required to execute the formal verification and theorem proving tasks.

What is the best way to speed up theorem proving and formal verification in Lean 4?

The best way to speed up theorem proving is to automate compiling, verifying, and interacting with Lean 4 formal proofs. This includes searching Mathlib for existing lemmas and getting tactic suggestions.

Why does my Lean 4 formalization require searching Mathlib during theorem proving?

Searching Mathlib during theorem proving is required to find relevant existing lemmas using natural language or type patterns. This prevents duplicating proofs and helps complete complex formalizations efficiently.