Once set, the mutation flag stays set
ProvedBitcoinMerkle.rootLoop_stickyFor every , and list , : the flag is only ever combined with further tests by disjunction, so a mutation detected at one level is reported at the end regardless of what later levels contain.
import Definitions.Def_BitcoinMerkle
theorem BitcoinMerkle.rootLoop_sticky {H : Type} [DecidableEq H] (c : H → H → H) (z : H)
(hs : List H) : (BitcoinMerkle.rootLoop c z hs true).2 = true := 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.rootLoop_sticky
Binders and assumptions. is an arbitrary type with decidable equality (for the Boolean is exactly when ). is an arbitrary two-argument operation and an arbitrary element; nothing is assumed about either. is an arbitrary finite list over — empty, singleton, or longer, with no condition on its length or entries.
Conclusion.
an equality of Boolean values, where denotes the second component of an ordered pair.
Unfolding (rootLoop). takes a list and a Boolean flag and returns a pair in :
where is the first entry of , or if ; is Boolean "or"; (pairUp) is , , (aligned adjacent pairs combined by , an odd trailing element combined with itself); and (hasEqualPair) is the Boolean , (true iff some aligned position pair within range holds two equal entries; non-aligned pairs and an odd trailing element are not tested).
What is and is not claimed. The statement says that if the loop is started with the flag already , the flag in the final result is , for every input list. Degenerate instances included: and , where the loop body never runs and the result is resp. . Nothing is claimed about the first component (the element of ), and nothing is claimed about runs started with the flag — in particular this statement does not by itself say anything about computeMerkleRoot, which starts the loop with . It is asserted for every and without restriction.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.