extremal_principle_infinite_descent

Solve extremal-principle and infinite-descent proofs in Lean 4 with structured patterns.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/bneb/perqed --skill extremal-principle-infinite-descent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extremal_principle_infinite_descent
Source: https://github.com/bneb/perqed/tree/main/.agents/skills/extremal_principle_infinite_descent
Command: npx skills add https://github.com/bneb/perqed --skill extremal-principle-infinite-descent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It provides a structured approach for formalizing extremal principles and infinite-descent proofs in Lean 4, enabling termination arguments and minimal-counterexample reasoning.

Core Features & Use Cases

  • Lean 4 templates for extremal principle and infinite descent
  • Minimal-counterexample extraction using Nat.find and Nat.find_min
  • Well-founded recursion patterns with termination guarantees

Quick Start

Prove a simple theorem by assuming the smallest counterexample and deriving a contradiction in Lean 4.

Frequently Asked Questions about extremal_principle_infinite_descent

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

FAQPage Schema
How do I prove impossibility results using infinite descent in Lean 4?

Infinite descent in Lean 4 is formalized by assuming a minimal counterexample and deriving a smaller one. This Skill provides structured extremal-principle templates using Nat.find to establish logical contradictions for mathematical proofs.

What is the best way to extract a minimal counterexample in Lean 4?

Extracting a minimal counterexample in Lean 4 uses the Nat.find and Nat.find_spec tactics. This Skill supplies patterns to isolate the smallest element satisfying a property, enabling well-founded termination arguments for natural number proofs.

How do I prove termination with well-founded relations in Lean 4?

Proving termination in Lean 4 requires defining a measure that decreases recursively. This Skill offers WellFoundedRelation templates and descent measures to guarantee termination when formalizing mathematical functions over natural numbers.

Can I use extremal principle patterns for finite sets in Lean 4?

Yes, the extremal principle applies to finite sets in Lean 4 through the extremal_finset template. This approach supports well-ordering arguments on finite collections, allowing you to derive contradictions from minimal elements within finset structures.

When should I use Nat.find versus a custom WellFoundedRelation in Lean 4?

Use Nat.find for minimal-counterexample extraction on natural numbers, while custom WellFoundedRelation definitions suit broader termination proofs. This Skill provides both patterns, applying Nat.find_spec for direct contradictions and termination measures for recursive functions.