Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Exact convolution carry recovery with bounded intermediate bit widths

Proved
IntMul.CarryNormalization.product_recovery

by raresbuhai · Oct 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmsfixed-tape-routinginteger-multiplicationturing-machines

For every positive binary block width B and arbitrary campaign-model binary words x,y, one pure low-to-high carry pass through their exact digit-product coefficients recovers the canonical binary integer product padded to B*(ceil(|x|/B)+ceil(|y|/B)) bits. The final carry is zero and every emitted digit is below 2^B. With m=min(ceil(|x|/B),ceil(|y|/B)), every prefix carry is at most m*(2^B-1) and fits B+clog_2(m) bits; every coefficient-plus-carry sum fits 2B+clog_2(m) bits. Empty inputs, leading zeros, short high blocks and over-width B are included. This supplies exact arithmetic and finite width bounds for carry implementation; no physical machine cost is asserted.

Preamble
import Definitions.Def_IntMul_CarryNormalization
import Theorems.Thm_IntMul_DigitConvolution_digit_convolution_spec
import Mathlib.Data.Nat.Bits
import Mathlib.Tactic

open IntMul IntMul.CarryNormalization

Formal statement
theorem IntMul.CarryNormalization.product_recovery (B : ℕ) (hB : 0 < B) (x y : List Bool) :
    productWord B x y=bin
      (B*(DigitConvolution.blockCount B x+DigitConvolution.blockCount B y)) (val x*val y) ∧
    (scan (2^B) (coefficients B x y) 0).2=0 ∧
    (∀ d ∈ (scan (2^B) (coefficients B x y) 0).1, d < 2^B) ∧
    (∀ j, carryAt (2^B) (coefficients B x y) 0 j ≤
      min (DigitConvolution.blockCount B x) (DigitConvolution.blockCount B y)*(2^B-1) ∧
      carryAt (2^B) (coefficients B x y) 0 j <
        2^(B+Nat.clog 2 (min (DigitConvolution.blockCount B x) (DigitConvolution.blockCount B y)))) ∧
    (∀ a ∈ coefficients B x y, ∀ j,
      a+carryAt (2^B) (coefficients B x y) 0 j <
        2^(2*B+Nat.clog 2 (min (DigitConvolution.blockCount B x) (DigitConvolution.blockCount B y)))) := by sorry
Source
Original exact bounded-carry recovery for the campaign word model and HvdH multiplication. Binary-value helpers and all recovery proofs are owned in the upload; the accepted digit-convolution theorem supplies encoding and coefficient growth. Written by Codex.

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