Documentation

CslibFrontier.Foundations.Data.Nat.ClogPow

Logarithmic exponents give polynomial powers #

A word width of c * ⌈log₂ m⌉ bits has a word universe of size 2 ^ (c * ⌈log₂ m⌉). Since 2 ^ ⌈log₂ m⌉ ≤ 2 m ≤ m ^ 2 for m ≠ 0, that universe is at most m ^ e for every e ≥ 2 c (Nat.two_pow_mul_clog_le_pow). This is the step that turns a logarithmic width bound into a polynomial bound on every word value.

Main results #

theorem Nat.two_pow_clog_le_sq {m : ℕ} (hm : m ≠ 0) :
2 ^ clog 2 m ≤ m ^ 2

2 ^ ⌈log₂ m⌉ ≤ m ^ 2 for m ≠ 0.

theorem Nat.two_pow_mul_clog_le_pow {c e m : ℕ} (hm : m ≠ 0) (he : 2 * c ≤ e) :
2 ^ (c * clog 2 m) ≤ m ^ e

A width of c * ⌈log₂ m⌉ bits has a polynomial word universe: 2 ^ (c ⌈log₂ m⌉) ≤ m ^ e for m ≠ 0 and 2 c ≤ e.