Documentation

Complexitylib.Classes.P.Cobham.Internal.PolyLen

Polynomial lengths inside the algebra #

A computation in Cobham's algebra measures sizes by string lengths, so a polynomial time or space bound has to be available as a string of that length. smash multiplies lengths and concatenation adds them, so Horner's scheme builds, for any polynomial with natural coefficients, a member of the algebra whose output has exactly the polynomial's value as its length.

Main definitions #

Main results #

Horner evaluation of a coefficient list, lowest coefficient first.

Equations
Instances For

    The string whose length is the Horner value of the coefficient list at |s|: constants contribute blocks of that many bits, and each multiplication by |s| is one smash.

    Equations
    Instances For
      theorem Complexity.Cobham.lenOfCoeffs_mem {n : } (as : List ) {g : (Fin nList Bool)List Bool} (hg : Cobham g) :
      Cobham fun (v : Fin nList Bool) => lenOfCoeffs as (g v)

      The Horner string is in the algebra.

      theorem Complexity.Cobham.hornerEval_map_range (f : ) (d n : ) :
      hornerEval (List.map f (List.range d)) n = iFinset.range d, f i * n ^ i

      Horner evaluation of a truncated coefficient sequence is the truncated power sum.

      noncomputable def Complexity.Cobham.polyLen (q : Polynomial ) (s : List Bool) :

      The string realizing a polynomial's value as its length.

      Equations
      Instances For
        @[simp]

        The polynomial's value is the string's length.

        theorem Complexity.Cobham.polyLen_mem {n : } (q : Polynomial ) {g : (Fin nList Bool)List Bool} (hg : Cobham g) :
        Cobham fun (v : Fin nList Bool) => polyLen q (g v)

        The polynomial-length string is in the algebra.