lean4

Inspect Lean 4 proof goals and search mathlib via LSP diagnostics.

192|34|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/frenzymath/Archon --skill lean4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean4
Source: https://github.com/frenzymath/Archon/tree/main/src/archon/.archon-src/skills/lean4/skills/lean4
Command: npx skills add https://github.com/frenzymath/Archon --skill lean4

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sorry_analyzer.py, check_axioms_inline.sh, smart_search.sh, find_golfable.py, find_usages.sh.

What problem does it solve?

Lean developers often grapple with diagnosing Lean errors, locating relevant lemmas in mathlib, and coordinating cross-file proof tasks. This Skill provides an LSP-driven assistant that surfaces diagnostics, searches mathlib, and guides interactive formalization while preserving the user's code.

Core Features & Use Cases

  • LSP-based goal inspection, error parsing, and targeted lemma search
  • Script primitives for sorry analysis, axiom checks, and repair guidance
  • Cross-tool coordination with lake builds, reference navigation, and learning Lean 4 concepts
  • Safe, bounded proof cycles that orchestrate plan → work → checkpoint → review → replan

Quick Start

Start a guided Lean 4 session with /lean4:prove to begin interactive proof assistance.

Frequently Asked Questions about lean4

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

FAQPage Schema
How do I search mathlib for relevant lemmas during a Lean 4 proof?

This proof assistant searches mathlib by applying LSP-driven guidance to inspect Lean 4 proof goals and surface targeted lemmas, helping you locate relevant theorems for your current proof state.

How do I fix Lean 4 errors when my lake build fails?

This assistant fixes Lean 4 errors by parsing LSP diagnostics from your lake build, identifying proof blockers, and generating repair guidance while safely preserving your existing code.

What is the best way to find and analyze sorry placeholders in Lean 4 files?

The best way to analyze sorry placeholders in Lean 4 files is using a dedicated sorry analyzer script that identifies incomplete proofs and provides targeted guidance for formalizing the remaining goals.

Can I use LSP to navigate references and check mathlib axioms in Lean 4?

Yes, you can use LSP to navigate cross-file references and check mathlib axioms in Lean 4, coordinating proof tasks with standard mathlib axioms to verify formalization correctness.

Does this proof assistant modify my original Lean 4 code during automated repair?

No, this proof assistant preserves your original Lean 4 code during automated repair, applying bounded proof cycles that orchestrate plan, work, checkpoint, review, and replan phases for safety.

Why does my Lean 4 proof search get stuck in infinite tactic cycles?

Lean 4 proof searches get stuck without bounded cycles; this assistant enforces bounded proof cycles per goal, applying safe tactics using standard mathlib axioms to prevent infinite loops.