Documentation

HexPolyFast.Reverse

def Hex.DensePoly.reverseSeries {R : Type u} [Zero R] [DecidableEq R] (f : DensePoly R) (n : Nat) :

Reverse a dense polynomial from its leading end into an exactly n-term truncated series, padding with zeros when n exceeds the polynomial size.

Equations
Instances For
    theorem Hex.DensePoly.coeff_reverseSeries {R : Type u} [Zero R] [DecidableEq R] (f : DensePoly R) (n i : Nat) (hi : i < n) :
    (f.reverseSeries n).coeff i = if i < f.size then f.coeff (f.size - 1 - i) else 0

    Coefficient law for zero-extending polynomial reversal.

    theorem Hex.DensePoly.coeff_reverseSeries_of_lt {R : Type u} [Zero R] [DecidableEq R] (f : DensePoly R) (n i : Nat) (hi : i < n) (hf : i < f.size) :
    (f.reverseSeries n).coeff i = f.coeff (f.size - 1 - i)

    Inside the polynomial support, reversal reads down from the leading coefficient.

    theorem Hex.DensePoly.coeff_reverseSeries_of_size_le {R : Type u} [Zero R] [DecidableEq R] (f : DensePoly R) (n i : Nat) (hi : i < n) (hf : f.size ≤ i) :

    Outside the polynomial support, reversal is zero rather than the constant coefficient selected by saturated Nat subtraction.

    def Hex.DensePoly.polyOfSeries {R : Type u} [Zero R] [DecidableEq R] {n : Nat} (a : TSeries R n) :

    Convert all represented coefficients of a truncated series to a normalized dense polynomial.

    Equations
    Instances For
      theorem Hex.DensePoly.coeff_polyOfSeries {R : Type u} [Zero R] [DecidableEq R] {n : Nat} (a : TSeries R n) (i : Nat) :
      (polyOfSeries a).coeff i = if i < n then a.coeff i else 0

      Coefficient law for conversion from a fixed series prefix.

      theorem Hex.DensePoly.coeff_polyOfSeries_of_lt {R : Type u} [Zero R] [DecidableEq R] {n : Nat} (a : TSeries R n) (i : Nat) (hi : i < n) :

      Converting a series to a polynomial and reading a represented coefficient returns the original coefficient.

      theorem Hex.DensePoly.coeff_polyOf_reverseSeries {R : Type u} [Zero R] [DecidableEq R] (f : DensePoly R) (n i : Nat) :
      (polyOfSeries (f.reverseSeries n)).coeff i = if i < n then if i < f.size then f.coeff (f.size - 1 - i) else 0 else 0

      Converting a reversed polynomial prefix back to a polynomial exposes the same guarded reversal coefficient law.