Equal tagged hashes have equal tag hashes and messages, or their two preimages collide
ProvedBitcoinTapSoundnessV2.tagged_collisionFor tags and messages : if tagged t m = tagged t' m' then either sha256 (ascii t) = sha256 (ascii t') and , or Collides (taggedPre t m) (taggedPre t' m'): the two explicit 64-byte-prefixed preimages differ and hash alike.
import Definitions.Def_BitcoinTapSoundnessV2 import Definitions.Def_BitcoinSer import Definitions.Def_BitcoinTaproot import Definitions.Def_BitcoinSig open BitcoinTapSoundnessV2 BitcoinSer BitcoinTaproot
theorem BitcoinTapSoundnessV2.tagged_collision (t t' : String) (m m' : BitcoinSer.Bytes)
(h : BitcoinTaproot.tagged t m = BitcoinTaproot.tagged t' m') :
(BitcoinSer.sha256 (BitcoinSig.ascii t) = BitcoinSer.sha256 (BitcoinSig.ascii t') ∧ m = m') ∨
BitcoinTapSoundnessV2.Collides (BitcoinTapSoundnessV2.taggedPre t m) (BitcoinTapSoundnessV2.taggedPre t' m') := 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: BitcoinTapSoundnessV2.tagged_collision
Statement. For all strings and all byte strings (finite lists of 8-bit bytes, any length), if
then at least one of the following holds (inclusive disjunction):
- and ; or
- .
Unfoldings. is the bundle's executable SHA-256: a total function on byte strings that appends , zero bytes until the length is , and the original bit-length as 8 big-endian bytes, then folds the SHA-256 compression function over the 64-byte chunks from the standard initial state and outputs the eight 32-bit state words big-endian (32 bytes). is the list of UTF-8 code units of the string , each as a byte. is the preamble's , i.e.
and , a string of length . is .
Edge cases and what is silently included. Alternative 1 does not assert : it asserts only that the two tag strings have the same SHA-256 (which holds in particular when , and would also hold for two different strings with colliding hashes) together with . Alternative 2 names the two explicit - and -byte preimages and asserts that they are different byte strings and have equal SHA-256; the equal-SHA-256 part is, by unfolding, the hypothesis itself, so the additional content of alternative 2 is . Either or both alternatives may hold. The strings may be empty, and may be empty or of different lengths.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.