Documentation

CslibFrontier.Foundations.Data.Nat.SqrtLog.Shifted

The shifted scale (y + 1) / √⌊log₂ (y + 2)⌋ #

The scale n / √⌊log₂ n⌋ of CslibFrontier.Foundations.Data.Nat.SqrtLog, shifted so that it is defined at every size: A (y + 1) / √⌊log₂ (y + 2)⌋. It is monotone up to constants along a linear bound y ≤ C x + C (Nat.mul_succ_div_sqrt_log_two_le), so a time bound stated in a derived size, such as the number of variables of a compiled formula or the number of gates of a linear-size circuit, transfers to the size x it is linear in. The lemma sits in its own module so that clients do not rebuild with the scale API.

Main results #

theorem Nat.mul_succ_div_sqrt_log_two_le {A C x y : ℕ} (h : y ≤ C * x + C) :
A * (y + 1) / (log 2 (y + 2)).sqrt ≤ A * (8 * C + 14) * (x + 1) / (log 2 (x + 2)).sqrt

The shifted scale is monotone up to constants. If y ≤ C x + C, then A (y + 1) / √⌊log₂ (y + 2)⌋ ≤ A (8 C + 14) (x + 1) / √⌊log₂ (x + 2)⌋.