Fixed-point approximation of the diagonal resampling map (Harvey–van der Hoeven Lemma 4.8)
DefinitionIntMul_HvdH_DiagApproxinteger-multiplication
Computable approximation of the diagonal map of Gaussian resampling. Its entries are , where .
kOf s t l, so that . Here round is computed as .dTilde p s t α lis the approximationexpPos p (s²) (α² k_ℓ) (2α²-2)of (Lemma 2.14).Dapprox p s t α U lmultiplies the fixed-point input bydTildeand divides by , rounding each component towards zero.
Definition code
import Definitions.Def_IntMul_HvdH_RealExp
/-! Fixed-point approximation of the diagonal map `D' = D / 2^{2α²-2}` of Gaussian resampling
(Harvey–van der Hoeven Lemma 4.8). Gaussian integers are pairs `(re, im) : ℤ × ℤ`, and a
fixed-point vector of precision `p` is `U : ℕ → ℤ × ℤ` standing for `2^{-p} U`. -/
namespace IntMul.HvdH
/-- `k_ℓ = (tℓ - s·round(tℓ/s))²`, so that `α² β_ℓ² = α² k_ℓ / s²`. -/
def kOf (s t l : ℕ) : ℕ :=
(((t * l : ℕ) : ℤ) - (s : ℤ) * (((2 * t * l + s) / (2 * s) : ℕ) : ℤ)).natAbs ^ 2
/-- Approximation of `2^p d'_ℓ = 2^p e^{πα²β_ℓ²} / 2^{2α²-2}` via `expPos` (Lemma 2.14). -/
def dTilde (p s t α l : ℕ) : ℤ := expPos p (s ^ 2) (α ^ 2 * kOf s t l) (2 * α ^ 2 - 2)
/-- Lemma 4.8: `(D̃' U)_ℓ = ρ(d̃'_ℓ U_ℓ)`, rounding each component towards zero. -/
def Dapprox (p s t α : ℕ) (U : ℕ → ℤ × ℤ) (l : ℕ) : ℤ × ℤ :=
((dTilde p s t α l * (U l).1).tdiv (2 ^ p), (dTilde p s t α l * (U l).2).tdiv (2 ^ p))
end IntMul.HvdH
Source
Harvey, van der Hoeven, Integer multiplication in time O(n log n), Annals of Math. 193 (2021), https://hal.science/hal-02070778, Lemma 4.8 and Section 4.2 (definition of D)