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 #
Cslib.Crypto.negligible_iff_eventually_lt_inv_pow,Cslib.Crypto.negligible_iff_eventually_le_inv_pow,Cslib.Crypto.negligible_iff_eventually_le_inv_polynomial: natural-exponent inverse-polynomial characterizations ofNegligible.Cslib.Crypto.negligible_iff_eventually_lt_inv_rpow,Cslib.Crypto.negligible_iff_tendsto_mul_rpow,Cslib.Crypto.eventually_abs_lt_inv_rpow_iff_tendsto_mul_rpow: real-exponent characterizations (Definition 2.5 and Theorem 2.11).Cslib.Crypto.PolynomiallyLowerBounded.sqrt,Cslib.Crypto.negligible_inv_two_pow_of_polynomiallyLowerBounded,Cslib.Crypto.negligible_inv_two_pow_sqrt,Cslib.Crypto.negligible_inv_two_rpow_sqrt,Cslib.Crypto.negligible_two_rpow_neg_sqrt: square-root schedule closure and2 ^ (-√n)(Example 2.10).Cslib.Crypto.negligible_inv_rpow_of_tendsto_atTop,Cslib.Crypto.negligible_rpow_neg_of_tendsto_atTop,Cslib.Crypto.negligible_inv_pow_of_tendsto_atTop,Cslib.Crypto.negligible_inv_pow_log,Cslib.Crypto.negligible_inv_rpow_log,Cslib.Crypto.negligible_rpow_neg_log: superpolynomial decay ofn ^ (-f n)whenf n → ∞, andn ^ (-log n)(Example 2.10).Cslib.Crypto.PolynomiallyBoundedNNReal.toNNReal_log,Cslib.Crypto.not_negligible_of_frequently_ge,Cslib.Crypto.not_negligible_of_eventually_ge,Cslib.Crypto.not_negligible_of_eventually_eq_one,Cslib.Crypto.not_negligible_of_frequently_inv_le,Cslib.Crypto.PolynomiallyBoundedNNReal.not_negligible_inv,Cslib.Crypto.PolynomiallyBoundedNNReal.negligible_inv_iff,Cslib.PolynomiallyBounded.not_negligible_inv,Cslib.PolynomiallyBounded.negligible_inv_iff,Cslib.Crypto.not_negligible_inv_pow: non-negligibility of inverse polynomials (Remark after Definition 2.7 and Example 2.10).
Deviations from [BS23] #
- Functions are indexed by
ℕrather thanℤ_{≥ 1}, andNegligiblehas codomainℝ≥0(since advantages and probabilities are nonnegative);eventually_abs_lt_inv_rpow_iff_tendsto_mul_rpowalso states Theorem 2.11 directly for signedf : ℕ → ℝ. - Definition 2.6 ("
fis super-poly if1 / fis negligible", p. 28) is not given a separate named predicate: across the library it is written directly asNegligible (fun n => (f n)⁻¹)orNegligible (fun n => 1 / f n). Because(0 : ℝ≥0)⁻¹ = 0in Lean, a wrapperSuperPoly fdefined asNegligible (fun n => (f n)⁻¹)would hold forf = 0. - For the same reason (
0⁻¹ = 0), the remark after Definition 2.7 (p. 29) that1 / fis not negligible for polynomially boundedfrequires the positivity hypothesis∃ᶠ n in atTop, 0 < f n, whichnegligible_inv_iffshows is both necessary and sufficient. - In Example 2.10 (p. 28),
n ^ (-log n)is provided for both the discrete logarithmNat.log b nwith1 < b(negligible_inv_pow_log, false forb ≤ 1whereNat.log b n = 0) and the real logarithmReal.log (n : ℝ)(negligible_inv_rpow_log,negligible_rpow_neg_log).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, v0.6, §2.3.1, pp. 28–29.
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.
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 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 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.
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.
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).
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.
Inverse powers ((n : ℝ≥0) ^ k)⁻¹ are not negligible for any natural exponent k
([BS23], Example 2.10, p. 28).
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.