lean-dependent-types

Resolve dependent type issues in Lean 4 with recursion and scoping guidance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses common challenges when dealing with dependent types in Lean 4, such as recursion limits, namespace scoping, and visibility issues, helping you maintain clean and provable code.

Core Features & Use Cases

  • Recursive Type Handling: Mitigate issues like max recursion in expressions involving recursive data types like List.ofFn.
  • Namespace Scope Clarification: Guidance on creating definitions in nested namespaces and maintaining correct scoping.
  • Visibility Issues Resolution: Tips on managing access controls with protected vs. private visibility, essential for cross-file usage.
  • Transitive Equality Proving: Techniques for proper chain rule applications when proving transitive equality.
  • State Composition Theorem Handling: How to use composition theorems effectively with nested state management using if let statements.
  • Alpha-Equivalence Handling: Strategies for if let issues due to mismatched match motives and proof structure alignment.

Quick Start

Use the lean-dependent-types skill to rewrite complex dependent type scenarios in Lean 4.

Frequently Asked Questions about lean-dependent-types

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

FAQPage Schema
How do I fix max recursion depth errors in Lean 4 when using recursive types like List.ofFn?

To fix max recursion errors in Lean 4 recursive types, you should apply specific rewriting strategies and state composition best practices to manage expression depth and maintain provable code.

How do I resolve namespace scope and visibility issues in Lean 4 dependent types?

Resolving namespace scope and visibility issues in Lean 4 requires correctly using nested namespaces and managing access controls with protected versus private declarations for cross-file usage.

What is the best way to prove transitive equality in Lean 4 dependent type expressions?

Proving transitive equality in Lean 4 involves applying chain rule techniques correctly to align proof structures and manage mismatched match motives effectively.

Why do my if let statements fail due to alpha-equivalence in Lean 4?

Alpha-equivalence issues in Lean 4 if let statements occur due to mismatched match motives, which require aligning the proof structure to resolve the failure.

Do I need to understand type theory to use dependent types in Lean 4?

Yes, using dependent types in Lean 4 requires a solid understanding of type theory and mathematical reasoning, alongside familiarity with Lean's specific logic programming syntax.