Closure properties of polynomial bounds #
PolynomiallyBounded is closed under the operations that arise when accounting for sizes and
running times: addition, multiplication, fixed powers, composition, truncated subtraction,
max/min, division and remainder, logarithms and conditionals. Every closure lemma is
registered with fun_prop, so a goal such as
example (hf : PolynomiallyBounded f) : PolynomiallyBounded (fun n => 2 * f n ^ 3 + n - 5) := by
fun_prop
is discharged automatically from the local hypothesis hf. This is the arithmetic engine behind
the complexity calculus: time and size polynomials of composite constructions are stated as
expressions in the component bounds and collapsed by fun_prop.
Main results #
Nat.mul_add_one_pow_le_two_pow: an explicit boundc * (n + 1) ^ dis at mostc * 2 ^ d * n ^ d + c.Cslib.PolynomiallyBounded.mono: a function eventually below a polynomially bounded one is polynomially bounded.Cslib.PolynomiallyBounded.add,mul,pow,comp: the closure rules proper.Cslib.PolynomiallyBounded.polynomial_eval: evaluation of a polynomial.Cslib.PolynomiallyBounded.tsub,max,min,div,mod,log,ite: operations that never exceed one of their arguments.
A function eventually dominated by a polynomially bounded function is polynomially bounded.
A function dominated pointwise by a polynomially bounded function is polynomially bounded.
Constants are polynomially bounded.
The identity is polynomially bounded.
Sums of polynomially bounded functions are polynomially bounded.
Products of polynomially bounded functions are polynomially bounded.
Fixed powers of a polynomially bounded function are polynomially bounded.
Compositions of polynomially bounded functions are polynomially bounded.
Evaluating a polynomial with natural coefficients is polynomially bounded. This is how the
certificate lengths of NP, given by polynomials, enter bound computations.
Truncated subtraction does not exceed its first argument.
The maximum of two polynomially bounded functions is polynomially bounded.
The minimum does not exceed its first argument.
Division does not exceed the dividend.
A remainder does not exceed the dividend.
A logarithm does not exceed its argument.
A case distinction between polynomially bounded functions is polynomially bounded.