The negacyclic ring R[X] / (X^n + 1) on coefficient vectors #
For n ≠ 0, an element of R[X] / (X^n + 1) has a unique representative of degree less than n,
so it is stored as its coefficient vector Fin n → R. Multiplication by a is the linear action of
the n × n negacyclic (anticirculant) matrix rotMatrix a, whose column j holds the coefficients
of X^j · a mod (X^n + 1): negacyclicMul a b = rotMatrix a *ᵥ b. Over a commutative ring
negacyclicMul is commutative and associative, rotMatrix is multiplicative, and the polynomial
inner product innerPoly b r = ∑ j, negacyclicMul (b j) (r j) is symmetric.
Negacyclic R n packages the coefficient vector as a ring. It is a one-field structure rather
than a synonym of Fin n → R, so that a * b always means negacyclicMul: a synonym would
unfold to the function type, where * also elaborates as the pointwise product. The coefficient
vector is Negacyclic.coeffs, and Negacyclic.ofCoeffs builds an element from one; addition,
negation and scalar multiplication act coefficientwise. For [CommRing R] and every n,
Negacyclic R n is a commutative R-algebra with 1 the constant polynomial. At n = 0 it is
the zero ring on Fin 0 → R, a chosen zero-dimensional extension rather than the quotient:
there X^0 + 1 = 2 and R[X] / (2) is generally nonzero. Sampling, encoding and norm bounds
transfer along Negacyclic.coeffsEquiv and Negacyclic.coeffsLinearEquiv, and innerPoly
becomes the dot product ⬝ᵥ over Negacyclic R n (Negacyclic.ofCoeffs_innerPoly).
Main definitions #
Cslib.rotMatrix,Cslib.negacyclicMul: the negacyclic multiplication matrix and multiplication on coefficient vectors.Cslib.innerPoly: the inner product∑ j, negacyclicMul (b j) (r j)of coefficient-vector tuples.Cslib.Negacyclic: the commutative ringR[X] / (X^n + 1)(n ≠ 0) on coefficient vectors, withNegacyclic.coeffsEquivandNegacyclic.coeffsLinearEquivtoFin n → R.
Main results #
Cslib.negacyclicMul_add,Cslib.add_negacyclicMul,Cslib.map_negacyclicMul: bilinearity and ring-map compatibility ofnegacyclicMul.Cslib.negacyclicMul_comm,Cslib.rotMatrix_negacyclicMul,Cslib.negacyclicMul_assoc: commutativity, multiplicativity ofrotMatrixand associativity over a commutative ring.Cslib.abs_negacyclicMul_le,Cslib.abs_negacyclicMul_le_sum_abs_mul,Cslib.abs_innerPoly_le:ℓ_∞andℓ₁-ℓ_∞coefficient bounds overℤ.Cslib.Negacyclic.instCommRing,Cslib.Negacyclic.instAlgebra: the commutativeR-algebra structure, withNegacyclic.coeffs_mulandNegacyclic.coeffs_one.Cslib.Negacyclic.ofCoeffs_innerPoly:innerPolyis the dot product overNegacyclic R n.
Negacyclic multiplication of coefficient vectors #
Negacyclic multiplication distributes over addition on the right.
Negacyclic multiplication distributes over addition on the left.
Negacyclic multiplication with zero on the right is zero.
Negacyclic multiplication with zero on the left is zero.
Negacyclic multiplication commutes with negation on the right.
Negacyclic multiplication commutes with negation on the left.
Negacyclic multiplication distributes over subtraction on the right.
Negacyclic multiplication distributes over subtraction on the left.
Negacyclic multiplication commutes with scalar multiplication on the left.
Negacyclic multiplication commutes with scalar multiplication on the right.
Commutativity and associativity #
Commutativity of negacyclic polynomial multiplication: a * b = b * a in
R[X] / (X^n + 1) over any commutative ring R.
Associativity of negacyclic polynomial multiplication: (a * b) * c = a * (b * c) in
R[X] / (X^n + 1) over any commutative ring R.
Coefficient bounds over ℤ #
Infinity-norm bound for negacyclic multiplication: if ‖a‖_∞ ≤ α and ‖b‖_∞ ≤ β, then
every coefficient of negacyclicMul a b has absolute value at most n * α * β.
ℓ₁-ℓ∞ bound for negacyclic multiplication: if ‖b‖_∞ ≤ β, then every coefficient of
negacyclicMul a b has absolute value at most ‖a‖₁ · β.
Inner products of coefficient-vector tuples #
Polynomial inner product ⟨b, r⟩ = ∑ j : Fin k, negacyclicMul (b j) (r j) over
R[X] / (X^n + 1).
Infinity-norm bound for innerPoly: if every coefficient of a has absolute value at most
α and every coefficient of b has absolute value at most β, then every coefficient of
innerPoly a b has absolute value at most k * n * α * β.
The ring Negacyclic R n #
For n ≠ 0, the negacyclic ring R[X] / (X^n + 1), stored as the coefficient vector of the
unique representative of degree less than n. Multiplication is negacyclicMul, never the
pointwise product of coefficient vectors. For n = 0 this is the zero ring, a chosen extension
rather than the quotient R[X] / (2).
- ofCoeffs :: (
- coeffs : Fin n → R
The coefficient vector of the representative of degree less than
n. - )
Instances For
Coefficient vectors as a plain equivalence, for transferring sampling and encodings.
Coefficient vectors as an S-linear equivalence.
The constant polynomial 1: coefficient 1 in degree zero and 0 elsewhere.
Multiplying by the coefficients of the constant polynomial 1 is the identity.
Multiplying by the coefficients of the constant polynomial 1 on the right is the
identity.
algebraMap R (Negacyclic R n) r is the constant polynomial r.
A numeral is the constant polynomial with that value.