A coinbase adds at most its output value
ProvedBitcoinUtxo.coinbase_boundFor every view , coinbase transaction , height , provided no outpoint with is present in and every output value is non-negative,
Equality holds when no output is unspendable.
import Definitions.Def_BitcoinUtxo open BitcoinUtxo
theorem BitcoinUtxo.coinbase_bound {T : Type} [DecidableEq T] (u : UtxoSet T) (tx : Tx T) (h : Nat)
(hcb : tx.isCoinbase = true)
(hfresh : ∀ j, j < tx.vout.length → getCoin u ⟨tx.txid, j⟩ = none)
(hpos : ∀ o ∈ tx.vout, 0 ≤ o.value) :
totalValue (updateCoins u tx h) ≤ totalValue u + valueOut tx := 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 of BitcoinUtxo.coinbase_bound.
Let be any type with decidable equality. A UTXO set over is a finite ordered list of pairs (outpoint, coin): an outpoint is with and ; a coin has an output (an integer and a Boolean ), a height and a Boolean . is the coin of the first entry of with outpoint , or "none". is the integer sum of over all entries of (with multiplicity, no range restriction). A transaction has fields , (a list of outpoints), (a list of outputs with integer and Boolean ) and Boolean ; (zero if is empty).
deletes every entry of outpoint from . is unchanged if , and otherwise prepended to . For a transaction with (the case of this theorem), the inputs are not spent, and
where is the -th output of and is the coin with output , height and coinbase flag true. An unspendable output adds nothing but still consumes its index.
The theorem states: for every type with decidable equality, every UTXO set over , every transaction over and every height , if
- ;
- (freshness) for every natural number , , i.e. has no entry at any of the outpoints (indices are not covered; vacuous when is empty);
- for every output occurring in , ;
then
a non-strict integer inequality.
There is no hypothesis that the outpoints of are pairwise distinct, no hypothesis that passes checkTransaction or any input check, no upper bound on the output values, and no constraint on (which plays no role, since a coinbase-flagged transaction spends nothing). The height enters only as the recorded height of the newly added coins and does not affect the conclusion's quantities.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.