A tagged hash is the SHA-256 of its preimage
ProvedBitcoinTapSoundnessV2.tagged_pretagged t m = sha256 (taggedPre t m), by definition of taggedHash.
import Definitions.Def_BitcoinTapSoundnessV2 import Definitions.Def_BitcoinSer import Definitions.Def_BitcoinTaproot open BitcoinTapSoundnessV2 BitcoinSer BitcoinTaproot
theorem BitcoinTapSoundnessV2.tagged_pre (t : String) (m : BitcoinSer.Bytes) :
BitcoinTaproot.tagged t m = BitcoinSer.sha256 (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_pre
Statement. For every string and every byte string (a finite list of 8-bit bytes, of any length including empty),
Unfoldings. is the bundle's executable SHA-256: a total function on byte strings that appends the byte , zero bytes until the length is , and the original bit-length as 8 big-endian bytes; splits into 64-byte chunks; folds the SHA-256 compression function over them from the standard initial state; and emits the eight 32-bit state words as big-endian 4-byte groups. is the list of UTF-8 code units of , each as a byte.
The left-hand side, , is defined in the preamble as , where lets and returns ; so
The right-hand side uses , so the right-hand side is
Edge cases and what is silently included. The statement is an equality of byte strings (32-byte outputs of ) with no hypotheses; it holds for the empty string and the empty byte string as well. Both sides unfold to the same expression; the theorem asserts nothing about collisions, distinctness, or any property of beyond its being a function.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.