NTT Domain #
This file defines the radix-2 NTT domain parameters and basic raw-polynomial shape helpers used by forward/inverse NTT.
@[inline]
Inverse root of unity.
Instances For
@[inline]
Multiplicative inverse of the domain size in R.
Instances For
theorem
CompPoly.CPolynomial.NTT.Domain.requiredLength_eq_zero_of_left_trim_size_zero
{R : Type u_1}
[Field R]
[BEq R]
(p q : Raw R)
(hp : Array.size p.trim = 0)
:
theorem
CompPoly.CPolynomial.NTT.Domain.requiredLength_eq_zero_of_right_trim_size_zero
{R : Type u_1}
[Field R]
[BEq R]
(p q : Raw R)
(hq : Array.size q.trim = 0)
:
theorem
CompPoly.CPolynomial.NTT.Domain.requiredLength_eq_of_trim_size_pos
{R : Type u_1}
[Field R]
[BEq R]
(p q : Raw R)
(hp : 0 < Array.size p.trim)
(hq : 0 < Array.size q.trim)
:
The smallest radix-2 exponent that can cover a requested convolution length.
Instances For
@[simp]
theorem
CompPoly.CPolynomial.NTT.size_loadNaturalArray
{R : Type u_1}
[Field R]
(D : Domain R)
(a : Array R)
:
@[simp]
theorem
CompPoly.CPolynomial.NTT.getElem_loadNaturalArray
{R : Type u_1}
[Field R]
(D : Domain R)
(a : Array R)
(i : ℕ)
(hi : i < (loadNaturalArray D a).size)
:
def
CompPoly.CPolynomial.NTT.bestDomainForLength?
{R : Type u_1}
[Field R]
(maxLogN : ℕ)
(domainOfLogN : (logN : ℕ) → logN ≤ maxLogN → Domain R)
(domainOfLogN_logN : ∀ (logN : ℕ) (hlogN : logN ≤ maxLogN), (domainOfLogN logN hlogN).logN = logN)
(requiredLen : ℕ)
:
Option (FittingDomain R requiredLen)
Generic adapter from field-specific radix-2 domain tables to a best-fitting domain lookup.
The adapter chooses logN = Nat.clog 2 requiredLen, then returns none if that exponent
is outside the supported table.