lean-wf-recursion

Guide constructing well-founded recursion proofs in Lean 4.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/fmhall/lean-png --skill lean-wf-recursion-fmhall
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-wf-recursion
Source: https://github.com/fmhall/lean-png/tree/main/.claude/skills/lean-wf-recursion
Command: npx skills add https://github.com/fmhall/lean-png --skill lean-wf-recursion-fmhall

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of constructing and understanding well-founded recursion proofs in Lean 4, providing a guide for various proof patterns and strategies.

Core Features & Use Cases

  • Proof Patterns: Offers detailed guidance on unfolding well-founded functions, functional induction, and termination measures.
  • WF Conversion: Assists in converting fuel-based functions to well-founded recursion, including step-by-step templates and best practices.
  • Use Case: For a Lean 4 user struggling to prove termination of a recursive function, this Skill provides a structured approach to constructing a proof.

Quick Start

Apply the lean-wf-recursion skill to a Lean 4 function to understand the appropriate unfolding strategy for proving well-founded recursion.

Frequently Asked Questions about lean-wf-recursion

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

FAQPage Schema
What is well-founded recursion in Lean 4?

Well-founded recursion in Lean 4 is a proof technique that ensures recursive functions terminate by requiring a decreasing measure over a well-founded relation, allowing the compiler to safely accept the function definition.

How do I convert fuel-based functions to well-founded recursion in Lean 4?

Converting fuel-based functions to well-founded recursion involves replacing the fuel parameter with a termination measure, using structured templates to transform the function and establish the necessary decreasing proofs.

What are the best strategies for unfolding well-founded functions in Lean 4?

The best strategies for unfolding well-founded functions involve applying functional induction and selecting appropriate termination measures to break down the recursive structure and simplify the termination proof.

Do I need prior Lean 4 experience to use well-founded recursion proofs?

Yes, you need a basic understanding of Lean 4 and well-founded recursion concepts, as this guide focuses on practical application of proof patterns rather than introductory Lean 4 syntax or basic theorem proving.