Merkle root of two hashes
ProvedBitcoinMerkle.root_pairFor every , and hashes , : one level is processed, producing , and the flag is set exactly when the two leaves are equal. This is the smallest instance of the mutation check.
import Definitions.Def_BitcoinMerkle
theorem BitcoinMerkle.root_pair {H : Type} [DecidableEq H] (c : H → H → H) (z : H) (a b : H) :
BitcoinMerkle.computeMerkleRoot c z [a, b] = (c a b, decide (a = b)) := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: BitcoinMerkle.root_pair
Binders and assumptions. is an arbitrary type with decidable equality (for the Boolean is exactly when and otherwise). is an arbitrary two-argument operation and an arbitrary element; nothing is assumed about either. are two arbitrary elements — they may be equal or distinct. There are no further hypotheses.
Conclusion.
an equality of ordered pairs in : the first component of the result on the two-element list is exactly (with as first argument and as second), and the second component is the Boolean that is if and if .
Unfolding (computeMerkleRoot). , where (rootLoop) on a list and Boolean is
with the first entry of or if , Boolean "or", (pairUp) given by , , , and (hasEqualPair) the Boolean , . On : the loop test holds, so the loop performs one pass producing the list and the flag ; then fails and the result is . The theorem asserts this pair equals .
What is and is not claimed. The statement concerns only two-element inputs. The flag component is a Boolean (the decision of ), not a proposition; the theorem says the flag is precisely in the case and precisely in the case . The element does not appear in the right-hand side (it is unused for a nonempty input). The claim holds for every and , with no restriction on whether equals , , , or anything else.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.