Native negacyclic multiplication of coefficient lists #
The existing truncated integer polynomial product supplies the coefficients below 2*n.
Subtracting its upper half from its lower half reduces modulo X^n + 1. Inputs are
truncated to n coefficients and missing entries are zero. The output always has length n.
At modulus zero, signed remainder followed by toNat truncates each integer result at zero;
canonical modular semantics require positive modulus.
Main definitions #
negacyclicMulResidues: total multiplication of binary-natural coefficient lists.
Main results #
computableInPolyTime_negacyclicMulResidues: one plain certificate for all unary dimensions, binary moduli, and framed binary coefficient lists.
@[simp]
Output length is the requested dimension, including the empty dimension.
theorem Cslib.computableInPolyTime_negacyclicMulResidues :
Turing.MultiTapeTM.ComputableInPolyTime
(fun (x : (ℕ × ℕ) × List ℕ × List ℕ) => negacyclicMulResidues x.1.1 x.1.2 x.2.1 x.2.2)
(Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encNat)
(Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)
(Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)))
(Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)
The dimension is unary, while the modulus and all coefficients are binary. The bound charges the complete input lists, including coefficients beyond the requested dimension.