lean-array-list

Provide Lean 4 proof strategies and lemmas for ByteArray, Array, and List operations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill unit helps users with Lean 4 proofs involving operations on byte collections, arrays, and lists, simplifying indexing, length conversions, and more.

Core Features & Use Cases

  • Proof Patterns: Provides detailed guidance on proving various properties like indexing, length conversions, and list array roundtrip operations.
  • Indexing: Explains how to use getElem?_pos/getElem!_pos for array lookups and the getElem!_def/getElem?_eq_some_iff for panic-indexed array proofs.
  • Length Conversions: Shows how to bridge Array.length_toList, List.size_toArray, and other length conversions.
  • Use Case: When you're trying to prove that a function defined on ByteArray, Array, or List maintains its structure under certain transformations, this Skill unit offers a roadmap.

Quick Start

Activate the skill by referencing it in your Lean 4 proof environment and use the provided instructions for specific proof patterns and lemmas.

Frequently Asked Questions about lean-array-list

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

FAQPage Schema
How do I prove properties about ByteArray indexing in Lean 4?

To prove ByteArray indexing properties in Lean 4, use theorems like getElem?_pos and getElem!_def to handle array lookups and panic-indexed proofs.

What is the best way to handle List and Array length conversions in Lean 4 proofs?

Handling List and Array length conversions in Lean 4 involves bridging lemmas like Array.length_toList and List.size_toArray to maintain structural equality during transformations.

How do I prove a function maintains its structure during List to Array roundtrip operations?

Proving a function maintains structure during List to Array roundtrip operations requires applying specific Lean 4 proof patterns and lemmas for list array roundtrips.

Do I need prior Lean 4 experience to use these Array and List proof patterns?

Yes, using these Array and List proof patterns requires knowledge of Lean 4 syntax and semantics, along with an active Lean 4 formal verification environment.

Why does my Lean 4 proof fail when converting between Array toList and size?

Lean 4 proofs converting between Array toList and size often fail without explicitly applying length conversion lemmas to bridge the structural gap between data types.