Undefined hash types are rejected
ProvedBitcoinTaproot.sighash_type_invalidFor a hash type outside , sigHashSchnorr is none (the signature check fails).
import Definitions.Def_BitcoinTaproot open BitcoinTaproot BitcoinSer BitcoinSig BitcoinVerify open BitcoinScript hiding Bytes Byte
theorem BitcoinTaproot.sighash_type_invalid (tx : Tx) (spent : List TxOut) (inPos hashType : Nat) (tapscript : Bool) (ed : ExecData)
(h : ¬ (hashType ≤ 3 ∨ (0x81 ≤ hashType ∧ hashType ≤ 0x83))) :
BitcoinTaproot.sigHashSchnorr tx spent inPos hashType tapscript ed = none := 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: BitcoinTaproot.sighash_type_invalid
Binders. : a transaction (record with a natural-number version, a list of inputs, a list of outputs, a natural-number lock time); : a list of transaction outputs (each an integer value and a byte-string script); : natural numbers; : a Boolean; : an ExecData record (a Boolean annexPresent, byte strings annexHash and tapleafHash, a natural codeseparatorPos).
Hypothesis. , i.e. .
Conclusion.
Unfolded: returns an optional byte string; its very first step is the test "if not ( or ) then ", and only otherwise does it compute the tagged hash of the BIP341-style message (epoch byte, hash-type byte, version, lock time, the optional four prevout/amount/scriptPubKey/sequence hashes, the optional outputs hash, the spend-type byte, the per-input data or input index, the optional annex hash, the optional single-output hash, and the optional tapscript extension). The hypothesis is exactly the negation of that guard, so the conclusion is that the first branch is taken.
Edge cases the quantifiers include. (excluded by the guard and therefore covered by this theorem); any including values above ; with no inputs or outputs; beyond the input list; of any length, all irrelevant since the guard fails first.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.