lean-roundtrip-proofs

Generate roundtrip theorems for Lean 4 PNG encoding and decoding.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a library of roundtrip theorems for Lean 4, enabling the verification of encoding and decoding processes for PNG images.

Core Features & Use Cases

  • Roundtrip Theorems: Proves that encoding and decoding processes are inverses of each other, ensuring data integrity.
  • Suffix Invariance: Demonstrates that appending extra bits to decoder input does not affect the decoded result.
  • goR Pattern: A pattern for decoding with remaining bits, useful for padding extraction and framing proofs.

Quick Start

Use the lean-roundtrip-proofs skill to prove the roundtrip theorem for a given PNG image.

Frequently Asked Questions about lean-roundtrip-proofs

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

FAQPage Schema
How do I prove encoding and decoding are inverses for PNG images in Lean 4?

To prove PNG images roundtrip successfully in Lean 4, generate roundtrip theorems that formally verify encoding and decoding processes are inverses of each other, ensuring data integrity throughout the transformation cycle.

What is a roundtrip theorem in formal verification?

A roundtrip theorem in formal verification proves that a decoding process perfectly reconstructs the original data from its encoded form. This Skill uses Lean 4 to generate these theorems for PNG image data integrity.

Does appending extra bits to a PNG decoder input affect the decoded result?

Appending extra bits to a PNG decoder input does not affect the decoded result due to suffix invariance. This Skill demonstrates this property within Lean 4 roundtrip proofs, ensuring decoding robustness against trailing data.

How do I extract padding and framing data using Lean 4 formal verification?

Extract padding and framing data in Lean 4 using the goR pattern. This decoding pattern manages remaining bits, allowing you to formally verify that appended suffixes and padding maintain original PNG data integrity.

Can I use Lean 4 to verify PNG image encoding without losing data?

Yes, you can use Lean 4 to verify PNG image encoding without losing data. This Skill generates formal roundtrip theorems that mathematically prove your encoding and decoding processes preserve complete data integrity.

What are the limitations of proving PNG roundtrip theorems in Lean 4?

The limitations of proving PNG roundtrip theorems in Lean 4 depend on the complexity of your encoding and decoding processes. This Skill focuses specifically on formal verification for PNG image data integrity and suffix invariance.