The mutation test distributes over an even split
ProvedBitcoinMerkle.hasEqualPair_append_evenFor all lists with even, . With aligned pair boundaries, an equal aligned pair of the concatenation lies entirely in or entirely in .
import Definitions.Def_BitcoinMerkle
theorem BitcoinMerkle.hasEqualPair_append_even {H : Type} [DecidableEq H] :
∀ (l r : List H), l.length % 2 = 0 →
BitcoinMerkle.hasEqualPair (l ++ r) = (BitcoinMerkle.hasEqualPair l || BitcoinMerkle.hasEqualPair r) := 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.hasEqualPair_append_even
Binders and assumptions. The statement is about an arbitrary type (implicit) together with a decidable-equality structure on (an instance assumption; it is used below, since the predicate being discussed tests elements of for equality and the result is a Boolean, so each test must be computable as true or false). Unlike the companion pairUp theorem, there is no pairwise-hash function in this statement. The theorem universally quantifies over two finite lists and of elements of and takes one hypothesis:
i.e. the length of is an even natural number, which includes . There is no hypothesis on : it may be zero, even, or odd. The hypothesis is satisfiable, so the theorem is not vacuous.
The predicate being compared. is the bundle's own Boolean-valued function on lists over , defined by recursion with the following cases:
- — if the list has at least two elements, the answer is
trueexactly when the first two elements are equal, or (Boolean disjunction) when the recursive call on the remainder istrue; - — a single leftover element is never flagged (it is not compared with anything, and in particular not with itself);
- — the empty list is not flagged.
(The last two cases are written in the source as a single catch-all pattern covering every list of length or .) Here denotes the Boolean value of the decidable proposition . Thus, writing the list as , is true if and only if there exists an index with and ; it inspects only the aligned pairs and never the pairs , nor an unpaired trailing element when is odd.
Conclusion. Under the hypothesis that is even, the theorem asserts the following equality of Boolean values (where is list concatenation and is Boolean "or"):
Since both sides are Booleans, this is a two-way statement: the concatenation is flagged if and only if is flagged or is flagged (or both). Equivalently, in terms of the index description above: there is an aligned equal pair in exactly when there is one within or one within , with "aligned" measured from the start of the respective list.
What happens at the boundary. Because is even, the aligned pairs of are exactly the aligned pairs of followed by the aligned pairs of (shifted by , which is even, so alignment is preserved): no inspected pair consists of the last element of and the first element of . If is odd, the final element of is uninspected both in alone and in . If , the right-hand side is and the left-hand side is . If , the right-hand side is and the left-hand side is .
What the statement does not cover. No claim is made when is odd. The theorem concerns only this one-level predicate; it does not mention , , , or the running mutation flag that those definitions thread through repeated levels.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.