Documentation

CslibFrontier.Computability.PolyTime.Int.Negacyclic

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 #

Main results #

Multiply the first n coefficients modulo X^n + 1 and then reduce modulo q. Short lists are zero-padded; excess coefficients are ignored.

@[simp]

Output length is the requested dimension, including the empty dimension.