From bc7b61f1738d40128c6821ea0ffd89a13ca29af7 Mon Sep 17 00:00:00 2001 From: ahrazzle <38987266+ahrazzle@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:50:58 -0500 Subject: [PATCH 1/2] Move proof modules and spec names under Png --- Png/Proofs.lean | 2 ++ {Proofs => Png/Proofs}/RoundTrip.lean | 0 {Proofs => Png/Proofs}/Verify.lean | 2 +- Proofs.lean | 2 -- README.md | 6 +++--- lakefile.toml | 5 +++-- tests/TEST-RESULTS.md | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 Png/Proofs.lean rename {Proofs => Png/Proofs}/RoundTrip.lean (100%) rename {Proofs => Png/Proofs}/Verify.lean (92%) delete mode 100644 Proofs.lean diff --git a/Png/Proofs.lean b/Png/Proofs.lean new file mode 100644 index 0000000..569a369 --- /dev/null +++ b/Png/Proofs.lean @@ -0,0 +1,2 @@ +import Png.Proofs.RoundTrip +import Png.Proofs.Verify diff --git a/Proofs/RoundTrip.lean b/Png/Proofs/RoundTrip.lean similarity index 100% rename from Proofs/RoundTrip.lean rename to Png/Proofs/RoundTrip.lean diff --git a/Proofs/Verify.lean b/Png/Proofs/Verify.lean similarity index 92% rename from Proofs/Verify.lean rename to Png/Proofs/Verify.lean index fe6388e..9b45f93 100644 --- a/Proofs/Verify.lean +++ b/Png/Proofs/Verify.lean @@ -6,6 +6,6 @@ the verified bar. -/ -import Proofs.RoundTrip +import Png.Proofs.RoundTrip #print axioms Png.Proofs.parse_print diff --git a/Proofs.lean b/Proofs.lean deleted file mode 100644 index b877d25..0000000 --- a/Proofs.lean +++ /dev/null @@ -1,2 +0,0 @@ -import Proofs.RoundTrip -import Proofs.Verify diff --git a/README.md b/README.md index 25a3027..76b7896 100644 --- a/README.md +++ b/README.md @@ -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 | |-------|---------| @@ -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 Proofs Main.lean Png.lean Png/Proofs.lean python3 tests/run_tests.py ``` diff --git a/lakefile.toml b/lakefile.toml index a91e752..b9dc45b 100644 --- a/lakefile.toml +++ b/lakefile.toml @@ -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" diff --git a/tests/TEST-RESULTS.md b/tests/TEST-RESULTS.md index f9ac030..bf88b52 100644 --- a/tests/TEST-RESULTS.md +++ b/tests/TEST-RESULTS.md @@ -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] From e4aa9fc5d3039d9523a6af89cefca29dd90875f9 Mon Sep 17 00:00:00 2001 From: orda-aska Date: Thu, 29 Oct 2026 20:13:48 +0000 Subject: [PATCH 2/2] Drop the removed Proofs directory from the README's sorry check Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QwrvNdsMA6RtgKxXn1Pmhf --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76b7896..ff496a1 100644 --- a/README.md +++ b/README.md @@ -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 Png/Proofs.lean +grep -rn "sorry" --include="*.lean" Png Main.lean Png.lean python3 tests/run_tests.py ```