Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Multidimensional complex DFT Fn1,…,nd\mathcal F_{n_1,\dots,n_d}Fn1​,…,nd​​ (Harvey–van der Hoeven §2.4)

Definition
IntMul_HvdH_Tensor

by avi · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theoryinteger-multiplication

An element of ⨂i=1dCni\bigotimes_{i=1}^d \mathbb C^{n_i}⨂i=1d​Cni​ is a ddd-dimensional array u=(uj1,…,jd)u=(u_{j_1,\dots,j_d})u=(uj1​,…,jd​​), indexed by ∏iZ/niZ\prod_i \mathbb Z/n_i\mathbb Z∏i​Z/ni​Z (so, as in §2.4 of the paper, an index jij_iji​ is always read modulo nin_ini​). TIdx n is this index set.

dftN n is the normalised multidimensional DFT Fn1,…,nd=⨂iFni\mathcal F_{n_1,\dots,n_d} = \bigotimes_i \mathcal F_{n_i}Fn1​,…,nd​​=⨂i​Fni​​:

(Fn1,…,nd u)j=1n1⋯nd∑k ∏i=1de−2πi jiki/ni  uk,(\mathcal F_{n_1,\dots,n_d}\,u)_{j} = \frac{1}{n_1\cdots n_d}\sum_{k}\ \prod_{i=1}^d e^{-2\pi i\, j_i k_i/n_i}\; u_{k},(Fn1​,…,nd​​u)j​=n1​⋯nd​1​k∑​ i=1∏d​e−2πiji​ki​/ni​uk​,

where ji,ki∈{0,…,ni−1}j_i,k_i\in\{0,\dots,n_i-1\}ji​,ki​∈{0,…,ni​−1} are the canonical representatives. It is a continuous C\mathbb CC-linear map; Mathlib's norm on arrays is the supremum norm ∥u∥=max⁡j∣uj∣\|u\|=\max_j|u_j|∥u∥=maxj​∣uj​∣ of §2.3, so operator norms are those of §2.6. For d=1d=1d=1 it agrees with dft of IntMul_HvdH_Resampling.

Definition code
import Mathlib

/-!
# Multidimensional complex DFTs of Harvey–van der Hoeven

D. Harvey, J. van der Hoeven, *Integer multiplication in time O(n log n)*,
Ann. of Math. 193 (2021), §2.3–§2.4.

An element of `⊗ᵢ ℂ^{nᵢ}` (`1 ≤ i ≤ d`) is a `d`-dimensional array, i.e. a function on the index
set `∏ᵢ ℤ/nᵢℤ`; as in §2.4, an index `jᵢ` is always read modulo `nᵢ`. Mathlib's norm on such
functions is the supremum norm `‖u‖ = max_j |u_j|` of §2.3, and the norm of a continuous linear
map is the operator norm of §2.6.
-/

namespace IntMul.HvdH

open Complex Real

/-- The index set `∏ᵢ ℤ/nᵢℤ` of a `d`-dimensional array of size `n₁ × ⋯ × n_d`. -/
abbrev TIdx {d : ℕ} (n : Fin d → ℕ) : Type := (i : Fin d) → ZMod (n i)

/-- The multidimensional complex DFT `𝓕_{n₁,…,n_d} = ⊗ᵢ 𝓕_{nᵢ}` (§2.4):
`(𝓕 u)_j = (n₁⋯n_d)⁻¹ ∑_k ∏ᵢ e^{-2πi jᵢkᵢ/nᵢ} u_k`. -/
noncomputable def dftN {d : ℕ} (n : Fin d → ℕ) [∀ i, NeZero (n i)] :
    (TIdx n → ℂ) →L[ℂ] (TIdx n → ℂ) :=
  LinearMap.toContinuousLinearMap (Matrix.toLin' (Matrix.of fun j k : TIdx n =>
    ∏ i, (1 / (n i : ℂ)) * exp (-2 * π * I * ((j i).val : ℂ) * ((k i).val : ℂ) / (n i : ℂ))))

end IntMul.HvdH
Source
D. Harvey, J. van der Hoeven, Integer multiplication in time O(n log n), Ann. of Math. 193 (2021), https://doi.org/10.4007/annals.2021.193.2.4 (preprint https://hal.science/hal-02070778v2), §2.3–2.4, pp. 11–13 (multidimensional DFT F_{n1,...,nd}).

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