Documentation

CslibFrontier.Foundations.Data.Nat.Power

Inequalities on powers of natural numbers #

Elementary inequalities on powers and products of natural numbers: powers of polynomial bounds M * Y ^ q, powers of two with scaled exponents (products and sums of quantities bounded by 2 ^ (a * k) and 2 ^ (b * k)), and bounds by exponentials.

Main results #

References #

theorem Nat.mul_le_two_pow_add_mul {k a b x y : ℕ} (hx : x ≤ 2 ^ (a * k)) (hy : y ≤ 2 ^ (b * k)) :
x * y ≤ 2 ^ ((a + b) * k)

Products of numbers below 2 ^ (a * k) and 2 ^ (b * k) are below 2 ^ ((a + b) * k).

theorem Nat.add_le_two_pow_add_add_one_mul {k a b x y : ℕ} (hk : 1 ≤ k) (hx : x ≤ 2 ^ (a * k)) (hy : y ≤ 2 ^ (b * k)) :
x + y ≤ 2 ^ ((a + b + 1) * k)

Sums of numbers below 2 ^ (a * k) and 2 ^ (b * k) are below 2 ^ ((a + b + 1) * k).

theorem Nat.pow_le_pow_mul_pow_of_le_mul_pow {a M Y q : ℕ} (h : a ≤ M * Y ^ q) (k : ℕ) :
a ^ k ≤ M ^ k * Y ^ (q * k)

Powers of a polynomial bound: a ≤ M Y ^ q gives a ^ k ≤ M ^ k Y ^ (q k).

theorem Nat.add_one_pow_le_of_le_mul_pow {L p q Y : ℕ} (hY : 0 < Y) (h : L ≤ p * Y ^ q) (k : ℕ) :
(L + 1) ^ k ≤ (p + 1) ^ k * Y ^ (q * k)

Powers of L + 1 under a polynomial bound L ≤ p Y ^ q with 0 < Y: (L + 1) ^ k ≤ (p + 1) ^ k Y ^ (q k).

theorem Nat.le_two_pow_mul (c k : ℕ) (hk : 1 ≤ k) :
c ≤ 2 ^ (c * k)

A constant c is below 2 ^ (c * k) for k ≥ 1.

theorem Nat.mul_add_one_pow_le {R M d : ℕ} (h : (R + 1) * d ≤ M) :
R * (M + 1) ^ d ≤ (R + 1) * M ^ d

(1 + 1 / M) ^ d ≤ 1 + 1 / R when (R + 1) d ≤ M, without denominators.

theorem Nat.add_two_le_two_pow {t : ℕ} (ht : 2 ≤ t) :
t + 2 ≤ 2 ^ t

For t ≥ 2, t + 2 ≤ 2 ^ t.

theorem Nat.two_mul_lt_two_pow {w : ℕ} (hw : 3 ≤ w) :
2 * w < 2 ^ w

For w ≥ 3, 2 * w < 2 ^ w.

theorem Nat.sq_le_two_pow {s : ℕ} :
4 ≤ s → s ^ 2 ≤ 2 ^ s

For s ≥ 4, s ^ 2 ≤ 2 ^ s.

theorem Nat.pow_le_two_pow {D b : ℕ} (hD : 1 ≤ D) (hb : 4 * D ^ 2 ≤ b) :
b ^ D ≤ 2 ^ b

For 1 ≤ D and 4 * D ^ 2 ≤ b, b ^ D ≤ 2 ^ b.

theorem Nat.succ_pow_sub_pow_le (c j : ℕ) :
(c + 1) ^ (j + 1) - c ^ (j + 1) ≤ (j + 1) * (c + 1) ^ j

Consecutive (j + 1)-th powers differ by at most (j + 1) (c + 1) ^ j, the case a = b + 1 of a ^ k - b ^ k ≤ (a - b) k a ^ (k - 1) [AlonMatiasSzegedy1999, proof of Theorem 2.1]; a specialization of Mathlib's abs_pow_sub_pow_le.

theorem Nat.add_le_two_pow_max_succ {l₀ l₁ d₀ d₁ : ℕ} (h₀ : l₀ ≤ 2 ^ d₀) (h₁ : l₁ ≤ 2 ^ d₁) :
l₀ + l₁ ≤ 2 ^ (max d₀ d₁ + 1)

Inductive step for binary-tree leaf-count bounds: if two subtrees of depths d₀ and d₁ have at most 2 ^ d₀ and 2 ^ d₁ leaves, then their parent has at most 2 ^ (max d₀ d₁ + 1) leaves.