The lowest-feerate direct conflict is below the replacement
ProvedBitcoinReplacement.min_direct_feerate_ltFor a valid replacement with at least one direct conflict there is a direct conflict whose exact fee rate is every other direct conflict's and the replacement's.
import Definitions.Def_BitcoinReplacement
theorem BitcoinReplacement.min_direct_feerate_lt (rate : BitcoinReplacement.FeeRate)
(R : BitcoinReplacement.Replacement) (hR : BitcoinReplacement.Valid rate R)
(hne : R.direct ≠ 0) :
∃ t ∈ R.direct, (∀ s ∈ R.direct, t.feeRateQ ≤ s.feeRateQ) ∧
t.feeRateQ < R.new.feeRateQ := 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.min_direct_feerate_lt
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 , write , the exact rational quotient (well defined because ).
Statement. For every fee rate and every replacement such that holds (all three conditions above) and such that is not the empty multiset, there exists a transaction occurring in with both of the following properties:
- for every transaction occurring in , in (non-strict: attains the minimum rational fee rate among the direct multiset's elements);
- in (strict).
Edge cases and scope. The existential is plain existence, not unique existence; several elements of (possibly with equal data, since it is a multiset) may attain the minimum. The non-emptiness hypothesis is on , not on . No positivity assumption is made on . The comparisons are between exact rationals, not the cross-multiplied natural-number comparison used inside the validity condition. Nothing is asserted about elements of that are not in .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.