lean-array-list

Prove Lean 4 properties for ByteArray, Array, and List manipulation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides essential patterns and lemmas for proving properties related to Lean 4's ByteArray, Array, and List types, specifically focusing on indexing, length conversions, and data roundtrips.

Core Features & Use Cases

  • Indexing Proofs: Simplifies proving equalities for element access (data[pos]).
  • Length Conversions: Bridges Array.size and List.length for seamless proofs.
  • Data Roundtrips: Handles conversions between List, Array, and ByteArray with Nat and UInt8.
  • Use Case: When proving that a specific byte at an index in a ByteArray meets a certain condition, this Skill offers the lemmas to correctly access and reason about that byte.

Quick Start

Use the lean-array-list skill to prove that myArray[i]! is equal to myArray.getD i 0 when myArray contains Nat elements.

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 equalities for ByteArray element access in Lean 4?

To prove ByteArray element access equalities in Lean 4, you can apply specific lemmas for `getElem?` and `getElem!` to correctly access and reason about bytes at a given index.

What is the best way to convert between List length and Array size during Lean 4 proofs?

Converting between List length and Array size in Lean 4 requires applying length conversion proof patterns that bridge `Array.size` and `List.length` for seamless formal verification.

How do I handle data roundtrips between ByteArray and List in Lean 4 formal verification?

Handling data roundtrips between ByteArray and List in Lean 4 involves applying proof patterns for data conversions between `List`, `Array`, and `ByteArray` with `Nat` and `UInt8`.

Does Lean 4 support formal verification of indexing with Fin coercion?

Lean 4 supports formal verification of indexing with `Fin` coercion by providing specific lemma applications that simplify proving equalities for element access and data manipulation.

When do I need specific lemmas for getElem? in Lean 4 array proofs?

You need specific lemmas for `getElem?` in Lean 4 array proofs when proving that a specific byte at an index in a `ByteArray` meets a certain condition, ensuring rigorous formal verification.