Commit db0f830
proof(merkle): Stage 1.2 — root-fold law (root of buildMerkleTree = foldRoot over leaves)
Prove the Merkle root is a deterministic, representation-independent fold over the
leaf vector: rootHashWith h (buildMerkleTree hs) = foldRoot h hs, generic over the
combiner h (XOR and BLAKE3 alike).
- foldRoot: the leaf-only spec of the root (singleton -> element; a 2^(S k) vector
splits at 2^k and combines its two sub-folds with h, the same split
buildMerkleTree uses).
- rootFoldSplit: the inductive step on the already-split halves, so the
rootHashWith-of-Node reduction is clean and decoupled from the `with` abstraction
(mirrors buildGetLeafSplit; the IH is a higher-order argument).
- rootFoldLaw: the theorem; base Refl, step via rootFoldSplit applied to the IH.
Pairs with buildGetLeaf to fully characterise buildMerkleTree (leaves + root) and
hands the Stage-4 binding argument a leaf-only handle on the root.
Machine-checked, axiom-free, total (clean --total build, 19/19). PROOFS.adoc marks
Stage 1.2 DONE and adds rootFoldLaw/foldRoot to the proven surface.
https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ1 parent 0785a9f commit db0f830
2 files changed
Lines changed: 48 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
0 commit comments