Pinning: descendants attached to a transaction raise the cost of replacing it by their total fee
ProvedBitcoinReplacement.pinning_costFor a valid replacement , a transaction and a multiset with R.evicted: . Whoever attaches descendants of total fee to forces any replacement of to pay at least more.
import Definitions.Def_BitcoinReplacement
theorem BitcoinReplacement.pinning_cost (rate : BitcoinReplacement.FeeRate)
(t : BitcoinReplacement.Tx) (D : Multiset BitcoinReplacement.Tx)
(R : BitcoinReplacement.Replacement) (hR : BitcoinReplacement.Valid rate R)
(hD : t ::ₘ D ≤ R.evicted) :
t.fee + BitcoinReplacement.totalFee D + rate.getFee R.new.vsize ≤ R.new.fee := 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: BitcoinReplacement.pinning_cost
Setting (unfolded from the preamble). All declarations live in a namespace BitcoinReplacement. A transaction is a pair of natural numbers together with a proof that ; may be . Two transactions are equal exactly when their fees and virtual sizes agree. A fee rate is a pair of natural numbers together with a proof that ; may be , and nothing identifies with . For a fee rate and a natural number ,
computed with natural-number (rounding-down) division; since the inner subtraction is exact, and the value equals . In particular , and for every whenever .
A replacement consists of a transaction , a multiset of transactions , a multiset of transactions , and a proof that as multisets (every transaction value occurs in at most as many times as it occurs in ). Either multiset may be empty, may itself occur in , and no other relation between the three components is imposed. For a multiset of transactions, , summed with multiplicity, so .
is valid at rate (written ) when all three of the following hold:
- () for every transaction value occurring in , (a strict cross-multiplied comparison in ; vacuously true when is empty; nothing is required of elements of that do not occur in );
- (, first conjunct) ;
- (, second conjunct) , where is truncated natural-number subtraction (it returns when the subtrahend exceeds the minuend; under item 2 it coincides with ordinary subtraction).
For a transaction and a multiset of transactions, denotes the multiset obtained from by adding one further copy of .
Statement. For every fee rate , every transaction , every multiset of transactions, and every replacement such that holds (all three conditions above) and such that
as multisets (every transaction value occurs in at most as often as in ; in particular occurs in at least once more than it occurs in ), the following inequality of natural numbers holds:
Edge cases and scope. may be empty, in which case the hypothesis says only that occurs in and the conclusion reads . need not be all of ; the inequality is only , with the fees of any remaining evicted elements not appearing on the left. Nothing relates or to . No positivity assumption is made on ; if the term is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.