Balanced digit extraction:
ProvedIntMul.HvdH.balanced_digitinteger-multiplication
Let be an even integer and let with and . Then the low balanced digit of is recovered as
This is the digit-reading step of Kronecker unpacking in Lemma 2.5 of Harvey–van der Hoeven (there , so reads the last bits).
Preamble
import Mathlib
Formal statement
namespace IntMul.HvdH
theorem balanced_digit (B : ℤ) (hB : 0 < B) (hBe : Even B) (c W' : ℤ) (hc : 2 * |c| < B) :
c = (c + B * W' + B / 2) % B - B / 2 := by sorry
end IntMul.HvdHSource
Harvey, van der Hoeven, Integer multiplication in time O(n log n), Annals of Math. 193 (2021), https://hal.science/hal-02070778, Section 2.5, Lemma 2.5 (Kronecker substitution)