Documentation

CslibFrontier.Foundations.Analysis.SpecialFunctions.Logb

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 is not @[simp]: existing simp calls in clients would change normal form.

theorem Real.logb_self_pow {b : ℝ} (b_pos : 0 < b) (b_ne_one : b ≠ 1) (k : ℕ) :
logb b (b ^ k) = ↑k

logb b (b ^ k) = k for a natural-number exponent; the ℕ-power form of Real.logb_rpow.

theorem Real.logb_two_pow (k : ℕ) :
logb 2 (2 ^ k) = ↑k

log₂ (2 ^ k) = k.

theorem Real.two_rpow_le_half_pow (n : ℕ) {x : ℝ} (hx : x ≤ -↑n) :
2 ^ x ≤ (1 / 2) ^ n

2 ^ x ≤ (1 / 2) ^ n whenever the real exponent satisfies x ≤ -n.

theorem Real.sub_div_le_logb_sub {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) :
(b - a) / b ≤ logb 2 b - logb 2 a

The relative gap (b - a) / b is at most the base-two logarithmic gap log₂ b - log₂ a for 0 < a ≤ b.

A string of n bits carries n bits: log₂ |BitString n| = n.