Normalize a coefficient array by discarding all trailing zeros. The compiled runtime
uses the value-equal trimTrailingZerosImpl (proved by trimTrailingZeros_eq_impl,
registered @[csimp]), which pops trailing zeros off the array in place instead of
round-tripping through coeffs.toList.
9.3. Constructors and normalization
Every constructor routes through normalization so the no-trailing-zeros
invariant holds by construction. Callers never trim by hand. The
primitive normalizer drops trailing zeros from a raw array, and
Hex.DensePoly.ofCoeffs wraps it to build a polynomial.
Hex.DensePoly.trimTrailingZeros.{u} {R : Type u} [Zero R] [DecidableEq R] (coeffs : Array R) : Array RHex.DensePoly.trimTrailingZeros.{u} {R : Type u} [Zero R] [DecidableEq R] (coeffs : Array R) : Array R
Hex.DensePoly.ofCoeffs.{u} {R : Type u} [Zero R] [DecidableEq R] (coeffs : Array R) : Hex.DensePoly RHex.DensePoly.ofCoeffs.{u} {R : Type u} [Zero R] [DecidableEq R] (coeffs : Array R) : Hex.DensePoly R
Build a dense polynomial from a raw coefficient array by normalizing away trailing zeros.
Build a dense polynomial from a coefficient list by normalizing away trailing zeros.
The remaining constructors build the common shapes directly. The zero polynomial is the empty array; a constant collapses to zero when its scalar is zero; a monomial collapses likewise.
The zero polynomial.
Build the constant polynomial with value c. The zero constant collapses to the zero
polynomial.
Build the monomial c * x^n. The zero coefficient collapses to the zero polynomial.