proof(merkle): Stage 1.1 — buildMerkleTree/getLeafHash soundness (re-land after #46)#47
Merged
Merged
Conversation
… (Stage 1.1)
buildGetLeaf : {n} -> (hs : Vect (power 2 n) HashBytes) -> (i : Fin (power 2 n)) -> getLeafHash (buildMerkleTree hs) (finToNat i) = Just (index i hs). Total, machine-checked, no believe_me/assert/postulate/holes; whole package builds under --total.
New Ochrance.Util.VectLemmas (indexAppendLeft/Right, indexReplace transport-cancellation, finToNatReplace, splitAtConcat) and Ochrance.Filesystem.MerkleBuild (buildGetLeaf + buildGetLeafSplit + compareNat bridge lemmas). The replace/powerTwoSucc transport is discharged by indexReplace; split halves by indexAppend*; the Bool 'idx < power 2 k' branch via compareNat (the Ord Nat default, not Data.Nat.lt). Merkle.idr: powerTwoSucc + getLeafHash export->public export (visibility only, no logic change).
https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
hyperpolymath
enabled auto-merge (squash)
June 15, 2026 17:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-land of the Stage 1.1 proof (PR #46's merge dropped it)
PR #46 squash-merged at its helpers-only state (
03ce34f) — the follow-up commit carrying the actual proof wasn't included, sobuildGetLeaf+MerkleBuildnever reachedmain(andScratch.idrlanded orphaned, not even in the ipkg). This re-lands the verified proof cleanly on top of currentmain:buildGetLeaf(Ochrance.Filesystem.MerkleBuild):getLeafHash (buildMerkleTree hs) (finToNat i) = Just (index i hs)— total, machine-checked, nobelieve_me/assert_*/postulate/holes; builds under--total.Ochrance.Util.VectLemmas(the orphanScratch.idr, renamed + SPDX):indexAppendLeft/Right,indexReplace(transport cancellation),finToNatReplace,splitAtConcat.Merkle.idr:powerTwoSucc+getLeafHashexport→public export(visibility only, no logic change).ochrance.ipkg: registers the two new modules (which proof(merkle): Stage 1 — buildMerkleTree correctness (WIP) #46 dropped).The flagged
replace/powerTwoSucctransport wall was cleared with nobuildMerkleTreereshape. Verified locally on idris2 0.8.0:idris2 --build ochrance.ipkg→ 19/19, exit 0.https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
Generated by Claude Code