Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Two-phase Newton complexity bound

Proved
ConvexOptimization.newton_two_phase_iteration_bound

by Shuze Chen · Aug 13, 2026 · Mathlib c5ea003 (Lean v4.30.0)

convexoptimizationnewtonmethodoptimizationalgorithms

The two-phase complexity bound for Newton's method with backtracking — inequality (9.36) of Boyd & Vandenberghe, the goal of this mission.

Let f:Rn→Rf : \mathbb{R}^n \to \mathbb{R}f:Rn→R be twice differentiable with gradient field ∇f\nabla f∇f and Hessian field ∇2f\nabla^2 f∇2f, and assume, for constants 0<m≤M0 < m \le M0<m≤M and L>0L > 0L>0,

mI⪯∇2f(x)⪯MI(x∈Rn),∥∇2f(x)−∇2f(y)∥≤L∥x−y∥2(x,y∈Rn).m I \preceq \nabla^2 f(x) \preceq M I \quad (x \in \mathbb{R}^n), \qquad \lVert \nabla^2 f(x) - \nabla^2 f(y)\rVert \le L \lVert x - y\rVert_2 \quad (x, y \in \mathbb{R}^n).mI⪯∇2f(x)⪯MI(x∈Rn),∥∇2f(x)−∇2f(y)∥≤L∥x−y∥2​(x,y∈Rn).

Let x⋆x^{\star}x⋆ be a global minimizer, p⋆=f(x⋆)p^{\star} = f(x^{\star})p⋆=f(x⋆), fix backtracking parameters α∈(0,1/2)\alpha \in (0,1/2)α∈(0,1/2), β∈(0,1)\beta \in (0,1)β∈(0,1), and let (xk)(x_k)(xk​) be any damped Newton sequence with backtracking. Put

η=min⁡{1, 3(1−2α)}m2L,γ=αβη2mM2,ε0=2m3L2.\eta = \min\{1,\,3(1-2\alpha)\}\frac{m^{2}}{L}, \qquad \gamma = \frac{\alpha\beta\eta^{2}m}{M^{2}}, \qquad \varepsilon_0 = \frac{2m^{3}}{L^{2}} .η=min{1,3(1−2α)}Lm2​,γ=M2αβη2m​,ε0​=L22m3​.

Then for every accuracy ε\varepsilonε with 0<ε≤ε0/40 < \varepsilon \le \varepsilon_0/40<ε≤ε0​/4 and every K∈NK \in \mathbb{N}K∈N satisfying

K  ≥  f(x0)−p⋆γ  +  log⁡2log⁡2(ε0/ε),K \;\ge\; \frac{f(x_0) - p^{\star}}{\gamma} \;+\; \log_2\log_2\bigl(\varepsilon_0/\varepsilon\bigr),K≥γf(x0​)−p⋆​+log2​log2​(ε0​/ε),

the iterate xKx_KxK​ is ε\varepsilonε-optimal:

f(xK)−p⋆  ≤  ε.f(x_K) - p^{\star} \;\le\; \varepsilon .f(xK​)−p⋆≤ε.

The two summands are the two phases: at most (f(x0)−p⋆)/γ(f(x_0) - p^{\star})/\gamma(f(x0​)−p⋆)/γ damped iterations, each buying a fixed decrease γ\gammaγ, followed by a quadratically convergent phase whose length grows like log⁡2log⁡2(1/ε)\log_2\log_2(1/\varepsilon)log2​log2​(1/ε) — six iterations already give ε≈5⋅10−20ε0\varepsilon \approx 5\cdot 10^{-20}\varepsilon_0ε≈5⋅10−20ε0​. The bound is dimension-free, and its dependence on the accuracy is doubly logarithmic rather than logarithmic, which is the precise sense in which Newton's method outperforms every first-order method.

Formalization Note The hypothesis ε≤ε0/4\varepsilon \le \varepsilon_0/4ε≤ε0​/4 is stated as ε ≤ m ^ 3 / (2 * L ^ 2); it is needed because the book's count is valid once the quadratic phase has genuinely begun, and for ε∈(ε0/4,ε0)\varepsilon \in (\varepsilon_0/4, \varepsilon_0)ε∈(ε0​/4,ε0​) the literal bound (9.36) fails. The quantities η\etaη and γ\gammaγ are inlined into the hypothesis on KKK rather than introduced as abbreviations, and log⁡2\log_2log2​ is Mathlib's Real.logb 2. The iterates are governed by the mission's damped-Newton predicate, so the conclusion holds for every faithful run. Source: B&V §9.5.3, p. 491, eq. (9.36).

Preamble
import Mathlib
import Definitions.Def_ConvexOptimization_IsBacktrackingStep
import Definitions.Def_ConvexOptimization_IsDampedNewtonSequence

open scoped RealInnerProductSpace ENNReal
open MeasureTheory

Formal statement
theorem ConvexOptimization.newton_two_phase_iteration_bound {n : ℕ} (m M L α β ε : ℝ)
    (hm : 0 < m) (hmM : m ≤ M) (hL : 0 < L)
    (hα0 : 0 < α) (hα : α < 1 / 2) (hβ0 : 0 < β) (hβ1 : β < 1)
    (hε0 : 0 < ε) (hεsmall : ε ≤ m ^ 3 / (2 * L ^ 2))
    (f : EuclideanSpace ℝ (Fin n) → ℝ)
    (g : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n))
    (hg : ∀ x, HasGradientAt f (g x) x)
    (H : EuclideanSpace ℝ (Fin n) →
      EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n))
    (hH : ∀ x, HasFDerivAt g (H x) x)
    (hHm : ∀ x v, m * ‖v‖ ^ 2 ≤ ⟪H x v, v⟫)
    (hHM : ∀ x v, ⟪H x v, v⟫ ≤ M * ‖v‖ ^ 2)
    (hHL : ∀ x y, ‖H x - H y‖ ≤ L * ‖x - y‖)
    (xstar : EuclideanSpace ℝ (Fin n)) (hstar : IsMinOn f Set.univ xstar)
    (x : ℕ → EuclideanSpace ℝ (Fin n))
    (hnewton : IsDampedNewtonSequence f g H α β x)
    (K : ℕ)
    (hK : (f (x 0) - f xstar) /
        (α * β * (min 1 (3 * (1 - 2 * α)) * m ^ 2 / L) ^ 2 * m / M ^ 2) +
        Real.logb 2 (Real.logb 2 (2 * m ^ 3 / L ^ 2 / ε)) ≤ (K : ℝ)) :
    f (x K) - f xstar ≤ ε := by
  sorry
Source
Boyd & Vandenberghe 2004, Convex Optimization, Cambridge University Press (seventh printing with corrections, 2009), https://web.stanford.edu/~boyd/cvxbook/, pp. 491, §9.5.3 eq. (9.36) (total complexity of Newton's method with backtracking: (f(x0) - p*)/gamma + log2 log2(eps0/eps)). Formalized with the extra hypothesis eps <= eps0/4 = m^3/(2 L^2), without which the printed double-log budget fails for eps in (eps0/4, eps0)
Read-back

What the Lean code literally says, in plain math · claude-fable-5

For every n∈Nn \in \mathbb{N}n∈N (including 000) and reals m,M,L,α,β,εm, M, L, \alpha, \beta, \varepsilonm,M,L,α,β,ε with 0<m0 < m0<m, m≤Mm \le Mm≤M, 0<L0 < L0<L, 0<α<120 < \alpha < \tfrac120<α<21​, 0<β<10 < \beta < 10<β<1, 0<ε0 < \varepsilon0<ε, and ε≤m3/(2L2)\varepsilon \le m^3/(2L^2)ε≤m3/(2L2), given: fff with gradient field ggg (for every xxx, g(x)g(x)g(x) is the gradient of fff at xxx); a Hessian field HHH (for every xxx, ggg is Fréchet-differentiable at xxx with derivative HxH_xHx​); the bounds m∥v∥2≤⟨Hx(v),v⟩≤M∥v∥2m\lVert v \rVert^2 \le \langle H_x(v), v \rangle \le M \lVert v \rVert^2m∥v∥2≤⟨Hx​(v),v⟩≤M∥v∥2 for all x,vx, vx,v; the operator-norm Lipschitz condition ∥Hx−Hy∥≤L∥x−y∥\lVert H_x - H_y \rVert \le L \lVert x - y \rVert∥Hx​−Hy​∥≤L∥x−y∥ for all x,yx, yx,y; a global minimizer x\*x^\*x\* of fff over the whole space (f(x\*)≤f(y)f(x^\*) \le f(y)f(x\*)≤f(y) for all yyy, assumed to exist as data); a sequence x:N→Rnx : \mathbb{N} \to \mathbb{R}^nx:N→Rn that is a damped-Newton backtracking sequence, meaning for every kkk there exist Δ\DeltaΔ and ttt with Hxk(Δ)=−g(xk)H_{x_k}(\Delta) = -g(x_k)Hxk​​(Δ)=−g(xk​), t=βjt = \beta^jt=βj for some natural jjj, f(xk+tΔ)≤f(xk)+αt⟨g(xk),Δ⟩f(x_k + t\Delta) \le f(x_k) + \alpha t \langle g(x_k), \Delta \ranglef(xk​+tΔ)≤f(xk​)+αt⟨g(xk​),Δ⟩, (t=1t = 1t=1 or Armijo fails at t/βt/\betat/β), and xk+1=xk+tΔx_{k+1} = x_k + t\Deltaxk+1​=xk​+tΔ (x0x_0x0​ unconstrained); and a natural number KKK satisfying the real inequality

f(x0)−f(x\*)α β (min⁡(1, 3(1−2α))⋅m2/L)2 m / M2  +  log⁡2 ⁣(log⁡2(2m3L2 ε))  ≤  K,\frac{f(x_0) - f(x^\*)}{\alpha\, \beta\, \big(\min(1,\ 3(1-2\alpha)) \cdot m^2 / L\big)^{2}\, m \,/\, M^2} \;+\; \log_2\!\Big(\log_2\Big(\frac{2 m^3}{L^2\, \varepsilon}\Big)\Big) \;\le\; K,αβ(min(1, 3(1−2α))⋅m2/L)2m/M2f(x0​)−f(x\*)​+log2​(log2​(L2ε2m3​))≤K,

where the first denominator is exactly αβη2m/M2\alpha \beta \eta^2 m / M^2αβη2m/M2 with η=min⁡(1,3(1−2α))⋅m2/L\eta = \min(1, 3(1-2\alpha)) \cdot m^2/Lη=min(1,3(1−2α))⋅m2/L, the doubly-divided expression 2m3/L2/ε2 m^3 / L^2 / \varepsilon2m3/L2/ε means 2m3/(L2ε)2m^3/(L^2 \varepsilon)2m3/(L2ε), and log⁡2\log_2log2​ is the real base-2 logarithm with the junk convention that the logarithm of a nonpositive argument is 000 (here ε≤m3/(2L2)\varepsilon \le m^3/(2L^2)ε≤m3/(2L2) makes the inner argument ≥4\ge 4≥4, hence the inner log⁡2≥2\log_2 \ge 2log2​≥2 and the outer log⁡2≥1\log_2 \ge 1log2​≥1, so neither hits the junk case); then the conclusion is:

f(xK)−f(x\*)≤ε,f(x_K) - f(x^\*) \le \varepsilon,f(xK​)−f(x\*)≤ε,

asserted at the single index KKK (though since KKK is any natural number satisfying the displayed inequality, the statement applies to every such KKK).

Human review
  • Endorsed by Community (Bot) · Aug 13, 2026

  • Endorsed by Shuze Chen · Aug 13, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

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.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me