Documentation

CslibFrontier.Computability.Complexity.FineGrained.Bounds

Scalar bounds for fine-grained runtime transfers #

These arithmetic estimates absorb additive linear changes of a natural parameter into a fixed exponential factor, compare and absorb terms into exponential-times-polynomial envelopes 2 ^ x * (L + 1) ^ e, and bound the time of a polynomial-time reduction followed by a computation. They are shared by decision, function-computation and randomized runtime transfers without mentioning a machine or error model.

Main results #

theorem Cslib.Complexity.two_rpow_le_two_rpow_mul_of_le_mul_add {δ : ℝ} {n m c : ℕ} (hδ : 0 ≤ δ) (hn : n ≤ c * m + c) :
2 ^ (δ * ↑n) ≤ 2 ^ (δ * ↑c) * 2 ^ (↑c * δ * ↑m)

An additive linear bound on a natural parameter splits its exponential at rate δ ≥ 0 into a constant factor and an exponential at rate c * δ.

theorem Cslib.Complexity.two_rpow_le_natCeil_mul_of_le_mul_add {δ : ℝ} {n m c : ℕ} (hδ : 0 ≤ δ) (hn : n ≤ c * m + c) :
2 ^ (δ * ↑n) ≤ ↑⌈2 ^ (δ * ↑c)⌉₊ * 2 ^ (↑c * δ * ↑m)

An additive linear bound on a natural parameter rescales its exponential rate, with the additive part absorbed by a natural ceiling constant.

theorem Cslib.Complexity.natCast_mul_div_add_one_le {δ : ℝ} (hδ : 0 ≤ δ) (c : ℕ) :
↑c * (δ / (↑c + 1)) ≤ δ

Rescaling a rate δ ≥ 0 by 1 / (c + 1) leaves room for a factor c: the step that transfers a bound for every rate δ > 0 along a parameter change by the factor c.

Exponential-times-polynomial envelopes #

Exponential runtime bounds have the form 2 ^ x * (L + 1) ^ e for an exponent x ≥ 0 and the length L of the encoded input. The envelope is at least 1, grows in x and e, and absorbs polynomials of lower degree and additive constants.

theorem Cslib.Complexity.one_le_two_rpow_mul_pow {x : ℝ} {L e : ℕ} (hx : 0 ≤ x) :
1 ≤ 2 ^ x * (↑L + 1) ^ e

An exponential-times-polynomial envelope with nonnegative exponent is at least 1.

theorem Cslib.Complexity.two_rpow_mul_pow_le_two_rpow_mul_pow {x y : ℝ} {L d e : ℕ} (hxy : x ≤ y) (hde : d ≤ e) :
2 ^ x * (↑L + 1) ^ d ≤ 2 ^ y * (↑L + 1) ^ e

An exponential-times-polynomial envelope grows with its exponent and its degree.

theorem Cslib.Complexity.pow_le_two_rpow_mul_pow {x : ℝ} {L d e : ℕ} (hx : 0 ≤ x) (hde : d ≤ e) :
(↑L + 1) ^ d ≤ 2 ^ x * (↑L + 1) ^ e

A polynomial of degree d ≤ e is below the envelope 2 ^ x * (L + 1) ^ e, x ≥ 0.

theorem Cslib.Complexity.two_rpow_mul_pow_le_natCeil_mul_add_of_le {x y : ℝ} {L e : ℕ} {K : ℝ} (h : 2 ^ x ≤ K * 2 ^ y) :
2 ^ x * (↑L + 1) ^ e ≤ ↑⌈K⌉₊ * (2 ^ y * (↑L + 1) ^ e) + ↑⌈K⌉₊

An exponential factor bounded by K times another one passes to the envelopes, with K rounded up to a natural constant: the bound that DecidableInTimeO.mono and ComputableInTimeO.mono need to replace one exponential rate by another.

theorem Cslib.Complexity.two_rpow_mul_pow_le_natCeil_mul_add {L e : ℕ} {δ : ℝ} {n m c : ℕ} (hδ : 0 ≤ δ) (hn : n ≤ c * m + c) :
2 ^ (δ * ↑n) * (↑L + 1) ^ e ≤ ↑⌈2 ^ (δ * ↑c)⌉₊ * (2 ^ (↑c * δ * ↑m) * (↑L + 1) ^ e) + ↑⌈2 ^ (δ * ↑c)⌉₊

An additive linear bound on a natural parameter rescales an exponential-times-polynomial envelope at rate δ ≥ 0 to one at rate c * δ, up to a natural ceiling constant: the bound that DecidableInTimeO.mono and ComputableInTimeO.mono need to transfer an exponential runtime along the parameter change.

theorem Cslib.Complexity.le_two_mul_mul_of_le_mul_add {t X Y : ℝ} {c : ℕ} (ht : t ≤ ↑c * Y + ↑c) (hY : Y ≤ X) (hX : 1 ≤ X) :
t ≤ 2 * ↑c * X

A runtime t ≤ c * Y + c with Y ≤ X and 1 ≤ X is at most 2 * c * X: an additive constant is absorbed into an envelope that is at least 1.

theorem Cslib.Complexity.reduction_add_time_le {P X Y C T : ℝ} {n l k e : ℕ} (hP : 1 ≤ P) (hX : 1 ≤ X) (hC : 0 ≤ C) (hn : ↑n ≤ ↑l * (P + 1)) (hY : Y ≤ C * X) (hT : T ≤ ↑k * (Y * (↑n + 1) ^ e) + ↑k) :
P + T ≤ (1 + ↑k * C * (2 * ↑l + 1) ^ e + ↑k) * (X * P ^ (e + 1))

Running a computation on a reduced instance. If the reduction runs within time P ≥ 1 and its output has length n ≤ l * (P + 1), a subsequent computation with time T ≤ k * (Y * (n + 1) ^ e) + k, where Y ≤ C * X, C ≥ 0 and X ≥ 1, has total time bounded by a constant times X * P ^ (e + 1).

theorem Cslib.Complexity.two_rpow_mul_rpow_le_of_le_mul_rpow {x y b p : ℝ} {C : ℕ} {K : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hK : 0 ≤ K) (hsize : y ≤ K * x ^ b) (hp : 0 ≤ p) :
2 ^ (↑C * y ^ p) ≤ 2 ^ (↑C * K ^ p * x ^ (b * p))

A polynomial parameter blowup in a power-exponential time bound multiplies the power.

theorem Cslib.Complexity.power_reduction_envelope_le {x y R q r : ℝ} {C d e : ℕ} (hx : 1 ≤ x) (hy : 0 ≤ y) (hR : 0 ≤ R) :
2 ^ (R * x ^ r) * (2 ^ (↑C * x ^ q) * y ^ d) ^ (e + 1) ≤ 2 ^ (↑(⌈R⌉₊ + C * (e + 1)) * x ^ max q r) * y ^ (d * (e + 1))

Composing two power-exponential envelopes raises the reduction envelope to the power e + 1 to pay for the target solver's polynomial factor. The maximum power bounds the sum of the resulting exponents.

theorem Cslib.Complexity.exists_pos_add_mul_lt_one {b p : ℝ} (hp : 0 < p) (hbp : b * p < 1) :
∃ (η : ℝ), 0 < η ∧ (b + η) * p < 1

A strict power saving absorbs a sufficiently small increase in the blowup exponent.