Skip to content

proof(merkle): Stage 1.1 — buildMerkleTree/getLeafHash soundness (re-land after #46)#47

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV
Jun 15, 2026
Merged

proof(merkle): Stage 1.1 — buildMerkleTree/getLeafHash soundness (re-land after #46)#47
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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, so buildGetLeaf + MerkleBuild never reached main (and Scratch.idr landed orphaned, not even in the ipkg). This re-lands the verified proof cleanly on top of current main:

  • buildGetLeaf (Ochrance.Filesystem.MerkleBuild): getLeafHash (buildMerkleTree hs) (finToNat i) = Just (index i hs) — total, machine-checked, no believe_me/assert_*/postulate/holes; builds under --total.
  • Ochrance.Util.VectLemmas (the orphan Scratch.idr, renamed + SPDX): indexAppendLeft/Right, indexReplace (transport cancellation), finToNatReplace, splitAtConcat.
  • Merkle.idr: powerTwoSucc + getLeafHash exportpublic 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/powerTwoSucc transport wall was cleared with no buildMerkleTree reshape. Verified locally on idris2 0.8.0: idris2 --build ochrance.ipkg19/19, exit 0.

https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ


Generated by Claude Code

… (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
hyperpolymath enabled auto-merge (squash) June 15, 2026 17:55
@hyperpolymath
hyperpolymath merged commit 205df0a into main Jun 15, 2026
19 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-noether-hkgAV branch June 15, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants