Documentation

CslibFrontier.Crypto.Negligible.InversePolynomial

Inverse-polynomial characterizations and examples of negligible functions #

Equivalent forms of Cslib.Crypto.Negligible, subexponential decay bounds, and inverse-polynomial non-negligibility criteria from [BS23], v0.6, §2.3.1 (printed pp. 28–29).

Negligible ε is defined as superpolynomial decay ∀ k : ℕ, Tendsto (fun n => n ^ k * ε n) atTop (𝓝 0) over ℕ → ℝ≥0. This module proves its equivalence with the inverse-polynomial comparisons of Definition 2.5 (ε n < 1 / n ^ k, ε n ≤ 1 / n ^ k, and ε n ≤ 1 / p n for positive polynomially bounded p : ℕ → ℕ), with Definition 2.5's real-exponent condition ∀ c : ℝ, 0 < c → ∀ᶠ n in atTop, (ε n : ℝ) < 1 / (n : ℝ) ^ c, and with Theorem 2.11's real-exponent limit condition ∀ c : ℝ, 0 < c → Tendsto (fun n => (ε n : ℝ) * (n : ℝ) ^ c) atTop (𝓝 0), as well as Theorem 2.11 directly for signed functions f : ℕ → ℝ (eventually_abs_lt_inv_rpow_iff_tendsto_mul_rpow).

For the negligible functions of Example 2.10 (2 ^ (-√n) and n ^ (-log n), alongside 2 ^ (-n) in CslibFrontier.Crypto.Negligible.Dyadic), PolynomiallyLowerBounded.sqrt registers Nat.sqrt as a polynomially lower-bounded parameter schedule, and negligible_inv_pow_of_tendsto_atTop and negligible_inv_rpow_of_tendsto_atTop prove ((n : ℝ≥0) ^ f n)⁻¹ negligible whenever f tends to infinity, covering both natural and real square-root and logarithmic exponents.

For the remark after Definition 2.7 ("if f is a poly-bounded function, then 1 / f is definitely not a negligible function"), PolynomiallyBoundedNNReal.not_negligible_inv and PolynomiallyBounded.not_negligible_inv show that the reciprocal of any frequently positive polynomially bounded function is not negligible, and negligible_inv_iff shows that under total division ((0 : ℝ≥0)⁻¹ = 0) the reciprocal is negligible if and only if the function is eventually zero. This yields not_negligible_inv_pow for ((n : ℝ≥0) ^ k)⁻¹, and PolynomiallyBoundedNNReal.toNNReal_log bounds Real.toNNReal (Real.log (p n : ℝ)) for polynomially bounded p : ℕ → ℕ. Concrete instances from Examples 2.10 and 2.11 (including 1 / (1000 n ^ 4 + n ^ 2 log n) and the piecewise function equal to 1 / n on even n and 2 ^ (-n) on odd n) are checked in CslibFrontierTests.Crypto.NegligibleInversePolynomial.

Main results #

Deviations from [BS23] #

References #

Theorem 2.11 and Definition 2.5 equivalences #

Definition 2.5 ([BS23], p. 28) with natural exponents in ℝ≥0 (strict inequality): ε is negligible if and only if for every natural exponent k, ε n < 1 / n ^ k eventually.

Definition 2.5 ([BS23], p. 28) with natural exponents in ℝ≥0 (non-strict inequality): ε is negligible if and only if for every natural exponent k, ε n ≤ 1 / n ^ k eventually.

theorem Cslib.Crypto.negligible_iff_eventually_le_inv_polynomial {ε : ℕ → NNReal} :
Negligible ε ↔ ∀ (p : ℕ → ℕ), PolynomiallyBounded p → (∀ (n : ℕ), 0 < p n) → ∀ᶠ (n : ℕ) in Filter.atTop, ↑(ε n) ≤ 1 / ↑(p n)

Two-way form of Negligible.eventually_le_inv_polynomial: ε is negligible if and only if it is eventually bounded by the reciprocal of every positive polynomially bounded natural function.

theorem Cslib.Crypto.negligible_iff_eventually_lt_inv_rpow {ε : ℕ → NNReal} :
Negligible ε ↔ ∀ (c : ℝ), 0 < c → ∀ᶠ (n : ℕ) in Filter.atTop, ↑(ε n) < 1 / ↑n ^ c

Definition 2.5 ([BS23], p. 28): ε is negligible if and only if for every real c > 0, (ε n : ℝ) < 1 / (n : ℝ) ^ c eventually.

theorem Cslib.Crypto.negligible_iff_tendsto_mul_rpow {ε : ℕ → NNReal} :
Negligible ε ↔ ∀ (c : ℝ), 0 < c → Filter.Tendsto (fun (n : ℕ) => ↑(ε n) * ↑n ^ c) Filter.atTop (nhds 0)

Theorem 2.11 ([BS23], p. 28) for ε : ℕ → ℝ≥0: ε is negligible if and only if for every real c > 0, ε n * n ^ c → 0 as n → ∞.

theorem Cslib.Crypto.eventually_abs_lt_inv_rpow_iff_tendsto_mul_rpow {f : ℕ → ℝ} :
(∀ (c : ℝ), 0 < c → ∀ᶠ (n : ℕ) in Filter.atTop, |f n| < 1 / ↑n ^ c) ↔ ∀ (c : ℝ), 0 < c → Filter.Tendsto (fun (n : ℕ) => f n * ↑n ^ c) Filter.atTop (nhds 0)

Theorem 2.11 ([BS23], p. 28) for real-valued f : ℕ → ℝ: Definition 2.5 (∀ c > 0, eventually |f n| < 1 / n ^ c) is equivalent to ∀ c > 0, lim (f n * n ^ c) = 0.

Example 2.10 negligible functions (2 ^ (-√n) and n ^ (-log n)) #

Natural square roots preserve a polynomial lower bound (n ≤ (√n + 1) ^ 2).

Reindexing ((2 : ℝ≥0) ^ g n)⁻¹ along any polynomially lower-bounded schedule g is negligible.

Example 2.10 ([BS23], p. 28), natural square root: ((2 : ℝ≥0) ^ Nat.sqrt n)⁻¹ is negligible.

Example 2.10 ([BS23], p. 28), real square root: ((2 : ℝ≥0) ^ Real.sqrt n)⁻¹ is negligible.

Example 2.10 ([BS23], p. 28), negative real square-root exponent: (2 : ℝ≥0) ^ (-Real.sqrt n) is negligible.

For any real exponent f : ℕ → ℝ tending to infinity, ((n : ℝ≥0) ^ f n)⁻¹ is negligible.

For any real exponent f : ℕ → ℝ tending to infinity, (n : ℝ≥0) ^ (-f n) is negligible.

For any natural exponent f : ℕ → ℕ tending to infinity, ((n : ℝ≥0) ^ f n)⁻¹ is negligible.

theorem Cslib.Crypto.negligible_inv_pow_log {b : ℕ} (hb : 1 < b) :
Negligible fun (n : ℕ) => (↑n ^ Nat.log b n)⁻¹

Example 2.10 ([BS23], p. 28), natural logarithm: for 1 < b, ((n : ℝ≥0) ^ Nat.log b n)⁻¹ is negligible.

Example 2.10 ([BS23], p. 28), real logarithm: ((n : ℝ≥0) ^ Real.log n)⁻¹ is negligible.

Example 2.10 ([BS23], p. 28), negative real logarithm exponent: (n : ℝ≥0) ^ (-Real.log n) is negligible.

Non-negligibility of inverse polynomials #

Real logarithms of polynomially bounded natural functions are polynomially bounded in ℝ≥0 (Real.toNNReal (Real.log (p n)) ≤ p n).

theorem Cslib.Crypto.not_negligible_of_frequently_ge {ε : ℕ → NNReal} {c : NNReal} (hc : c ≠ 0) (h : ∃ᶠ (n : ℕ) in Filter.atTop, c ≤ ε n) :

A function that frequently takes values at least a positive constant c is not negligible.

theorem Cslib.Crypto.not_negligible_of_eventually_ge {ε : ℕ → NNReal} {c : NNReal} (hc : c ≠ 0) (h : ∀ᶠ (n : ℕ) in Filter.atTop, c ≤ ε n) :

A function that is eventually at least a positive constant c is not negligible.

A function that is eventually equal to 1 is not negligible.

A function that is frequently bounded below by the reciprocal of positive values of a polynomially bounded ℝ≥0 function is not negligible.

Remark after Definition 2.7 ([BS23], p. 29): if P is a polynomially bounded ℝ≥0 function that is frequently positive, its reciprocal (P n)⁻¹ is not negligible.

Under Lean's total division (0 : ℝ≥0)⁻¹ = 0, the reciprocal of a polynomially bounded ℝ≥0 function P is negligible if and only if P is eventually zero.

theorem Cslib.Crypto.not_negligible_inv_pow (k : ℕ) :
¬Negligible fun (n : ℕ) => (↑n ^ k)⁻¹

Inverse powers ((n : ℝ≥0) ^ k)⁻¹ are not negligible for any natural exponent k ([BS23], Example 2.10, p. 28).

theorem Cslib.PolynomiallyBounded.not_negligible_inv {p : ℕ → ℕ} (hp : PolynomiallyBounded p) (hpos : ∃ᶠ (n : ℕ) in Filter.atTop, 0 < p n) :
¬Crypto.Negligible fun (n : ℕ) => (↑(p n))⁻¹

Remark after Definition 2.7 ([BS23], p. 29): if p : ℕ → ℕ is polynomially bounded and frequently positive, (p n : ℝ≥0)⁻¹ is not negligible.

For a polynomially bounded p : ℕ → ℕ, (p n : ℝ≥0)⁻¹ is negligible if and only if p is eventually zero.