Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The split multiplication computes the product

Proved
BitcoinFeerateDiagram.mulFallback_value

by pitimespi · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

bitcoincluster-mempoolfeefracfeerate-diagramformal-verificationmathlibmempoolpolicyrbf

(mulFallback a b).1 · 2^32 + (mulFallback a b).2 = a · b.

Preamble
import Definitions.Def_BitcoinFeerateDiagram
open BitcoinFeerateDiagram BitcoinReplacement
Formal statement
theorem BitcoinFeerateDiagram.mulFallback_value (a b : ℤ) :
    (FeeFrac.mulFallback a b).1 * 2 ^ 32 + (FeeFrac.mulFallback a b).2 = FeeFrac.mul a b := by sorry
Source
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: util/feefrac.h (FeeFrac :20, MulFallback :25-30, DivFallback :40-59, Mul/Div :64-82, operator+/- :120-131, EvaluateFee :147-175, ByRatio :217-240), util/overflow.h (CeilDiv :70-74), util/feefrac.cpp (CompareChunks :12-75), policy/rbf.cpp (ImprovesFeerateDiagram :127-140, PaysForRBF :100-125): https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/util/feefrac.cpp; test vectors from src/test/rbf_tests.cpp (feerate_chunks_utilities) and src/test/feefrac_tests.cpp
Read-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: BitcoinFeerateDiagram.mulFallback_value

Statement. For all integers aaa and bbb, writing mulFallback(a,b)=(H,L)\mathrm{mulFallback}(a, b) = (H, L)mulFallback(a,b)=(H,L),

H⋅232+L=mul(a,b)=a⋅b.H \cdot 2^{32} + L = \mathrm{mul}(a, b) = a\cdot b.H⋅232+L=mul(a,b)=a⋅b.

Binders and edge cases. There are no hypotheses: aaa and bbb range over all integers, including negative values and values outside any 64-bit or 32-bit range. The statement concerns only the combined value H⋅232+LH\cdot 2^{32} + LH⋅232+L; it does not separately state the range of HHH or LLL.

Definitions used, unfolded

Division conventions. Three kinds of division occur.

  • Default integer division n/dn \mathbin{/} dn/d with remainder n mod dn \bmod dnmodd (Euclidean convention). For d>0d > 0d>0: n/d=⌊n/d⌋n / d = \lfloor n/d \rfloorn/d=⌊n/d⌋ and n mod d=n−d⌊n/d⌋∈[0,d)n \bmod d = n - d\lfloor n/d \rfloor \in [0, d)nmodd=n−d⌊n/d⌋∈[0,d), also for negative nnn (e.g. −7/2=−4-7/2 = -4−7/2=−4, −7 mod 2=1-7 \bmod 2 = 1−7mod2=1). For d<0d < 0d<0: n/d=−⌊n/∣d∣⌋n / d = -\lfloor n/|d| \rfloorn/d=−⌊n/∣d∣⌋ and n mod d∈[0,∣d∣)n \bmod d \in [0, |d|)nmodd∈[0,∣d∣). For d=0d = 0d=0: n/0=0n / 0 = 0n/0=0 and n mod 0=nn \bmod 0 = nnmod0=n.
  • Truncated division tdiv⁡(n,d)\operatorname{tdiv}(n,d)tdiv(n,d) with remainder tmod⁡(n,d)=n−d⋅tdiv⁡(n,d)\operatorname{tmod}(n,d) = n - d\cdot\operatorname{tdiv}(n,d)tmod(n,d)=n−d⋅tdiv(n,d): the quotient is rounded toward zero, so the remainder is 000 or has the sign of nnn, with ∣tmod⁡(n,d)∣<∣d∣|\operatorname{tmod}(n,d)| < |d|∣tmod(n,d)∣<∣d∣ (e.g. tdiv⁡(−7,2)=−3\operatorname{tdiv}(-7,2) = -3tdiv(−7,2)=−3, tmod⁡(−7,2)=−1\operatorname{tmod}(-7,2) = -1tmod(−7,2)=−1). For d=0d = 0d=0: tdiv⁡(n,0)=0\operatorname{tdiv}(n,0) = 0tdiv(n,0)=0, tmod⁡(n,0)=n\operatorname{tmod}(n,0) = ntmod(n,0)=n.
  • Rational division in Q\mathbb QQ, with the convention q/0=0q / 0 = 0q/0=0. For q∈Qq \in \mathbb Qq∈Q, ⌊q⌋\lfloor q \rfloor⌊q⌋ is the greatest integer ≤q\le q≤q and ⌈q⌉\lceil q \rceil⌈q⌉ the least integer ≥q\ge q≥q.

Below, [P][P][P] denotes 111 if the condition PPP holds and 000 otherwise.

mul. mul(a,b)=a⋅b\mathrm{mul}(a, b) = a \cdot bmul(a,b)=a⋅b, the exact product of two integers.

mulFallback. For integers a,ba, ba,b, with default (floor) integer division by 232=42949672962^{32} = 4294967296232=4294967296:

ℓ=(a mod 232)⋅b,h=(a/232)⋅b,mulFallback(a,b)=(h+ℓ/232, ℓ mod 232).\ell = (a \bmod 2^{32}) \cdot b,\qquad h = (a / 2^{32}) \cdot b,\qquad \mathrm{mulFallback}(a,b) = \big(h + \ell / 2^{32},\ \ell \bmod 2^{32}\big).ℓ=(amod232)⋅b,h=(a/232)⋅b,mulFallback(a,b)=(h+ℓ/232, ℓmod232).

Here a mod 232∈[0,232)a \bmod 2^{32} \in [0, 2^{32})amod232∈[0,232) and a/232=⌊a/232⌋a / 2^{32} = \lfloor a / 2^{32} \rfloora/232=⌊a/232⌋ also for negative aaa; the second output component lies in [0,232)[0, 2^{32})[0,232). No bounds on a,ba, ba,b are assumed.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me