lean-fuel-induction

Guide Lean 4 fuel-based recursion proofs with loop invariants and termination.

112|9|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/kim-em/lean-zip --skill lean-fuel-induction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-fuel-induction
Source: https://github.com/kim-em/lean-zip/tree/main/.claude/skills/lean-fuel-induction
Command: npx skills add https://github.com/kim-em/lean-zip --skill lean-fuel-induction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance and patterns for tackling complex proof obligations in Lean 4, specifically those involving fuel-based recursion, loop invariants, and intricate state management.

Core Features & Use Cases

  • Fuel Independence Proofs: Strategies for proving properties of functions that depend on a fuel parameter.
  • Loop Invariant Proofs: Techniques for establishing invariants in recursive functions and stateful operations.
  • Proof Optimization: Advice on reducing maxRecDepth and maxHeartbeats for faster compilation and robust proofs.
  • Use Case: When proving a property about a recursive function that consumes fuel, use this Skill's patterns to structure your induction and handle recursive calls efficiently.

Quick Start

Use the lean-fuel-induction skill to understand how to prove fuel independence for a recursive function.

Frequently Asked Questions about lean-fuel-induction

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

FAQPage Schema
How do I prove fuel independence for a recursive function in Lean 4?

To prove fuel independence in Lean 4, you structure your induction to show that a recursive function's output remains consistent regardless of its fuel parameter. This Skill provides proof patterns to handle recursive calls efficiently.

How do I establish loop invariants for stateful recursive operations in Lean 4?

You establish loop invariants in Lean 4 by threading invariants through monadic operations during stateful recursion. This Skill guides you through techniques to maintain and prove these invariants across recursive calls.

Why should I avoid using forIn on Range for loop invariants in Lean 4?

Avoiding `forIn` on `Range` in Lean 4 prevents complex proof obligations and compilation limits. This Skill addresses these challenges by offering structured proof patterns for fuel-based recursion instead.

How do I optimize Lean 4 proof compilation when dealing with complex termination proofs?

You optimize Lean 4 proof compilation by managing `maxRecDepth` and `maxHeartbeats` parameters. This Skill provides advice on reducing these limits to achieve faster compilation and more robust termination proofs.

What are fuel-based recursion proofs in Lean 4 and when do I need them?

Fuel-based recursion proofs in Lean 4 are techniques for verifying functions that depend on a fuel parameter for termination. You need them when proving properties about recursive functions that consume fuel to guarantee termination.