Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Png/Proofs.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Png.Proofs.RoundTrip
import Png.Proofs.Verify
File renamed without changes.
2 changes: 1 addition & 1 deletion Proofs/Verify.lean → Png/Proofs/Verify.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
the verified bar.
-/

import Proofs.RoundTrip
import Png.Proofs.RoundTrip

#print axioms Png.Proofs.parse_print
2 changes: 0 additions & 2 deletions Proofs.lean

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A PNG chunk parser and printer in Lean. It reads the chunk layer of a PNG file: the signature, then each chunk's length, type, data, and CRC-32 check. It does not decode pixels, and it does not inflate IDAT data. The main claim is proved: parsing what the printer wrote returns the same chunk list. The tests run the parser against real PNG files built with Python's zlib and against a strict oracle written from the rules; see `tests/TEST-RESULTS.md` for the counts.

Status: in progress. The specification has not yet been approved by a reviewer apart from its author, and no statement file (`Spec.lean`) has been added by a reviewer, so this is not verified.
Status: in progress. The specification has not yet been approved by a reviewer apart from its author, and no statement file (`Png/Spec.lean`) has been added by a reviewer, so this is not verified.

## What is proved

The definitions are in `Png/Value.lean` (the chunk type, the printer, and the well-formedness rules), `Png/Parse.lean` (the parser), and `Png/Crc32.lean` (the CRC-32). The proofs are in `Proofs/RoundTrip.lean`.
The definitions are in `Png/Value.lean` (the chunk type, the printer, and the well-formedness rules), `Png/Parse.lean` (the parser), and `Png/Crc32.lean` (the CRC-32). The proofs are in `Png/Proofs/RoundTrip.lean`.

| Claim | Theorem |
|-------|---------|
Expand Down Expand Up @@ -52,7 +52,7 @@ Needs Linux, elan, and Python 3.11 or later.

```
lake build
grep -rn "sorry" --include="*.lean" Png Proofs Main.lean Png.lean Proofs.lean
grep -rn "sorry" --include="*.lean" Png Main.lean Png.lean
python3 tests/run_tests.py
```

Expand Down
5 changes: 3 additions & 2 deletions lakefile.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name = "png"
version = "0.1.0"
license = "Apache-2.0"
defaultTargets = ["Png", "Proofs", "png"]
defaultTargets = ["Png", "PngProofs", "png"]

[[lean_lib]]
name = "Png"

[[lean_lib]]
name = "Proofs"
name = "PngProofs"
roots = ["Png.Proofs"]

[[lean_exe]]
name = "png"
Expand Down
2 changes: 1 addition & 1 deletion tests/TEST-RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Written by `tests/run_tests.py`. Rerun it to check these numbers.

## Axiom check

Recorded on 2026-10-26 against the head of this pull request, on Lean 4.35.0. The line below is the output printed for `Proofs/Verify.lean` during a clean `lake build` (17 jobs).
Recorded on 2026-10-26 against the head of this pull request, on Lean 4.35.0. The line below is the output printed for `Png/Proofs/Verify.lean` during a clean `lake build` (17 jobs).

```text
'Png.Proofs.parse_print' depends on axioms: [propext, Quot.sound]
Expand Down