Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Polynomial versus exponential growth: two elementary bounds on bit length and polynomial evaluation

Definition
MIPRE_Foundations_Cost_Growth

by thomasvidick · Oct 15, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theorymip-remipre-formalizationrecursive-compression

This bundle contains no definitions; it holds two lemmas about natural numbers, the arithmetic behind the threshold of the recursive compression argument. Let Nat.size n be the number of binary digits of nnn (with Nat.size 0 = 0), and for a polynomial QQQ over N\mathbb{N}N (Mathlib's Polynomial ℕ) let deg⁡Q\deg QdegQ be Q.natDegree, QiQ_iQi​ the coefficient Q.coeff i and Q(y)Q(y)Q(y) the evaluation Q.eval y.

MIPRE.Cost.two_pow_size_le (n : ℕ) : 2 ^ Nat.size n ≤ 2 * n + 1.

MIPRE.Cost.polynomial_eval_le_sum_coeff_mul_pow (Q : Polynomial ℕ) {y : ℕ} (hy : 1 ≤ y): a polynomial over N\mathbb{N}N is bounded by its coefficient sum times the top power,

Q(y)  ≤  (∑i=0deg⁡QQi) ydeg⁡Q(y≥1).Q(y) \;\le\; \Big(\sum_{i=0}^{\deg Q} Q_i\Big)\, y^{\deg Q} \qquad (y \ge 1).Q(y)≤(i=0∑degQ​Qi​)ydegQ(y≥1).

The second bound is the step that turns "bounded by some polynomial" into a bound by a single monomial, which is how a polynomially bounded function is shown to fall under 2n2^n2n, and under nλn^\lambdanλ for one exponent λ\lambdaλ and all n≥2n \ge 2n≥2, in the bundle on polynomially bounded functions; the first relates the bit length of nnn to nnn itself.

Formalization Note. The sum is over Finset.range (Q.natDegree + 1). The hypothesis 1≤y1 \le y1≤y is needed because the proof bounds each yiy^iyi with i≤deg⁡Qi \le \deg Qi≤degQ by ydeg⁡Qy^{\deg Q}ydegQ. Both statements are over ℕ, with truncated subtraction playing no role. The module's threshold statement (for every polynomial QQQ there is KKK with Q(x+log⁡n)≤n+1Q(x + \log n) \le n + 1Q(x+logn)≤n+1 whenever n≥2K+1+xn \ge 2^{K+1+x}n≥2K+1+x) and the auxiliary bound AσD≤2σA \sigma^D \le 2^\sigmaAσD≤2σ are not part of this bundle.

Definition code
/-
Copyright (c) 2026 Thomas Vidick. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Thomas Vidick
-/
/- Generated for Prove2Me from vidick/MIPRE-formalization@70cbf1c, MIPRE/Foundations/Cost/Growth.lean (definition bundle: declarations the uploaded statements rest on);
   produced mechanically by prove2me/tools/gen.py, never edited by hand. -/
import Mathlib.Algebra.Polynomial.Eval.Defs
import Mathlib.Algebra.Polynomial.Eval.Degree
import Mathlib.Data.List.Basic
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.Size
import Definitions.Def_MIPRE_Foundations_Cost_Basic
import Definitions.Def_MIPRE_Foundations_Cost_Basic_B
import Definitions.Def_MIPRE_Foundations_Cost_Encoding
import Definitions.Def_MIPRE_Foundations_Cost_Encoding_B
import Definitions.Def_MIPRE_Foundations_Cost_PolyTime

/-!
# Polynomial versus exponential growth

The arithmetic behind the threshold of the recursive compression argument
(`planning/compression-track.md`, K3 step 4): for every polynomial `Q` over `ℕ` there is a
constant `K` such that `n ≥ 2 ^ (K + 1 + x)` forces `Q (x + log n) ≤ n + 1`
(`exists_threshold`). The proof is elementary: a polynomial is bounded by its coefficient
sum times the top power (`polynomial_eval_le_sum_coeff_mul_pow`), and `A · σ ^ D ≤ 2 ^ σ`
as soon as `σ ≥ A (D + 1) ^ (D + 1)` (`mul_pow_le_two_pow`).
-/

namespace MIPRE.Cost

open Polynomial

/-- `2 ^ size n ≤ 2n + 1`. -/
theorem two_pow_size_le (n : ℕ) : 2 ^ Nat.size n ≤ 2 * n + 1 := by
  rcases Nat.eq_zero_or_pos n with rfl | hn
  · simp
  · have h : Nat.size n - 1 < Nat.size n := by
      have := Nat.size_pos.2 hn; omega
    have h2 : 2 ^ (Nat.size n - 1) ≤ n := Nat.lt_size.1 h
    have h3 : 2 ^ Nat.size n = 2 * 2 ^ (Nat.size n - 1) := by
      rw [← pow_succ']; congr 1; have := Nat.size_pos.2 hn; omega
    omega

/-- A polynomial over `ℕ` is bounded by its coefficient sum times the top power. -/
theorem polynomial_eval_le_sum_coeff_mul_pow (Q : Polynomial ℕ) {y : ℕ} (hy : 1 ≤ y) :
    Q.eval y ≤ (∑ i ∈ Finset.range (Q.natDegree + 1), Q.coeff i) * y ^ Q.natDegree := by
  rw [Polynomial.eval_eq_sum_range, Finset.sum_mul]
  refine Finset.sum_le_sum fun i hi => ?_
  exact Nat.mul_le_mul_left _
    (Nat.pow_le_pow_right hy (Nat.lt_succ_iff.mp (Finset.mem_range.mp hi)))

end MIPRE.Cost
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Foundations/Cost/Growth.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me