Logarithms of powers of the base #
Mathlib's Real.logb_rpow computes logb b (b ^ x) = x for a real exponent. Counting,
entropy and amplification arguments meet the natural-number power b ^ k instead, usually
with b = 2. This file states that case once, together with a base-two logarithmic gap bound
and a real-power bound used by the same calculations.
Main results #
Real.logb_self_pow:logb b (b ^ k) = kfor a natural-number exponent, with base-two caseReal.logb_two_pow.Cslib.BitString.logb_cardreads it asnbits in a string ofnbits.Real.two_rpow_le_half_pow:2 ^ x ≤ (1 / 2) ^ nfor realx ≤ -n, the real-power twin ofReal.exp_le_half_powinSpecialFunctions/ExpBounds. It lives here because it needs real powers, whichLog/Basealready imports andExpBoundsdoes not.Real.sub_div_le_logb_sub:(b - a) / b ≤ log₂ b - log₂ afor0 < a ≤ b. Sincelog₂ (b / a) = -log₂ (1 - (b - a) / b)andlog 2 ≤ 1, this is the base-two form of-log (1 - t) ≥ t.
Real.logb_self_pow is not @[simp]: existing simp calls in clients would change normal form.
logb b (b ^ k) = k for a natural-number exponent; the ℕ-power form of
Real.logb_rpow.
A string of n bits carries n bits: log₂ |BitString n| = n.