A chain of accepted blocks raises the ledger by at most the summed subsidies
ProvedBitcoinUtxo.chain_boundFor every subsidy function , list of blocks each with pairwise distinct txids, view with distinct outpoints and height , if then
import Definitions.Def_BitcoinUtxo open BitcoinUtxo
theorem BitcoinUtxo.chain_bound {T : Type} [DecidableEq T] (subsidy : Nat → Int) :
∀ (blocks : List (List (Tx T))) (u : UtxoSet T) (h : Nat) (u' : UtxoSet T),
keysNodup u → (∀ b ∈ blocks, (b.map Tx.txid).Nodup) →
connectChain subsidy u h blocks = some u' →
totalValue u' ≤ totalValue u + subsidySum subsidy h blocks.length := 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.chain_bound.
Let be any type with decidable equality. A UTXO set over is a finite ordered list of pairs (outpoint, coin), where an outpoint is with , , and a coin carries an output (integer , Boolean ), a height and a Boolean . is the coin of the first entry of at outpoint , or "none". is the integer sum of over all entries of . says the outpoints of are pairwise distinct. A transaction has fields , (outpoints), (outputs with integer values and unspendable flags) and Boolean ; a block is a list of transactions; is the sum of its output values. and .
For , is "some " exactly when: (i) is non-empty with true, every other transaction's false, and every transaction of having non-empty and , duplicate-free , all output values in and all partial sums of output values in ; (ii) for every and every , has no entry at ; (iii) processing left to right from succeeds: a coinbase-flagged transaction is applied by adding, for , the coin (output , height , flag true) at (replacing any entry there; skipped if is unspendable) with no checks and no fee change; a non-coinbase transaction requires that every input outpoint be present in the current set, that no input coin be a coinbase coin with (truncated subtraction), that each input value and each running total of input values be in , that the input total , that and that the accumulated fee ; it then removes every entry at each input outpoint and adds its outputs at height with flag false as above; (iv) for the final . The result is the final set and fee.
Then is "some " exactly when there are sets with for every (the fees are discarded); for it is "some ". Finally
which is when .
The theorem states: for every type with decidable equality and every function , for every list of blocks over , every UTXO set over , every height and every UTXO set , if
- : the outpoints of are pairwise distinct;
- for every block occurring in , the list of transaction ids of has no duplicates (distinctness is required within each block only; the same transaction id may occur in different blocks);
- ;
then
a non-strict integer inequality.
The quantifiers over , , , are all universal and come after is fixed. For the third hypothesis forces and the conclusion reads . The function is arbitrary (it may take negative values), and the conclusion does not assert .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.