Documentation

Complexitylib.Asymptotics.PolyBound

Polynomial bounds on natural-number functions #

PolyBound f says f is dominated pointwise (at every argument, not merely eventually) by the evaluation of a natural polynomial. Resource bookkeeping assembles time and space bounds by addition, multiplication, and monotonicity, so an everywhere-bound closed under those operations is easier to carry through a construction than a big-O statement; PolyBound.bigO converts to the big-O form the complexity classes are stated in.

Main results #

Pointwise domination by the evaluation of a natural polynomial.

Equations
Instances For
    theorem Complexity.PolyBound.const (value : ) :
    PolyBound fun (x : ) => value
    theorem Complexity.PolyBound.id :
    PolyBound fun (inputLength : ) => inputLength
    theorem Complexity.PolyBound.add {f g : } (hf : PolyBound f) (hg : PolyBound g) :
    PolyBound fun (inputLength : ) => f inputLength + g inputLength
    theorem Complexity.PolyBound.mul {f g : } (hf : PolyBound f) (hg : PolyBound g) :
    PolyBound fun (inputLength : ) => f inputLength * g inputLength
    theorem Complexity.PolyBound.mono {f g : } (hg : PolyBound g) (hle : ∀ (inputLength : ), f inputLength g inputLength) :
    theorem Complexity.PolyBound.max {f g : } (hf : PolyBound f) (hg : PolyBound g) :
    PolyBound fun (inputLength : ) => Max.max (f inputLength) (g inputLength)
    theorem Complexity.PolyBound.eval (p : Polynomial ) :
    PolyBound fun (inputLength : ) => Polynomial.eval inputLength p
    theorem Complexity.PolyBound.pow {f : } (hf : PolyBound f) (exponent : ) :
    PolyBound fun (inputLength : ) => f inputLength ^ exponent
    theorem Complexity.PolyBound.bigO {f : } (hf : PolyBound f) :
    ∃ (d : ), BigO f fun (x : ) => x ^ d

    A polynomial bound is a big-O bound by the polynomial's degree.