Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Two-phase iteration count from a residual certificate

Proved
ConvexOptimization.two_phase_iteration_count_of_suboptimality

by Yifan Hong · Aug 15, 2026 · Mathlib c5ea003 (Lean v4.30.0)

convexoptimizationnewtonmethodoptimizationalgorithms

Let ak≥0a_k\ge0ak​≥0 be an objective gap and qk≥0q_k\ge0qk​≥0 a phase-detecting residual. Fix positive constants m,γ,s,η,ε0,εm,\gamma,s,\eta,\varepsilon_0,\varepsilonm,γ,s,η,ε0​,ε such that ε≤ε0/4\varepsilon\le\varepsilon_0/4ε≤ε0​/4,

ε0s2=12m,sη≤12,\varepsilon_0s^2=\frac1{2m},\qquad s\eta\le\frac12,ε0​s2=2m1​,sη≤21​,

and assume the certificate

ak≤qk22m.a_k\le\frac{q_k^2}{2m}.ak​≤2mqk2​​.

Suppose that above the threshold the gap decreases by a fixed amount,

qk≥η⟹ak+1≤ak−γ,q_k\ge\eta\Longrightarrow a_{k+1}\le a_k-\gamma,qk​≥η⟹ak+1​≤ak​−γ,

and below the threshold the scaled residual squares,

qk<η⟹sqk+1≤(sqk)2.q_k<\eta\Longrightarrow s q_{k+1}\le(sq_k)^2.qk​<η⟹sqk+1​≤(sqk​)2.

Then every K∈NK\in\mathbb{N}K∈N satisfying

K≥a0γ+log⁡2 ⁣log⁡2 ⁣(ε0ε)K\ge\frac{a_0}{\gamma}+\log_2\!\log_2\!\left(\frac{\varepsilon_0}{\varepsilon}\right)K≥γa0​​+log2​log2​(εε0​​)

satisfies aK≤εa_K\le\varepsilonaK​≤ε.

This is the reusable discrete bookkeeping theorem behind the two-phase Newton complexity estimate: fixed decrease bounds the damped phase, while repeated squaring produces the doubly logarithmic quadratic-phase budget.

Preamble
import Mathlib
Formal statement
theorem ConvexOptimization.two_phase_iteration_count_of_suboptimality
    (gap measure : ℕ → ℝ) (m decrease scale threshold ε₀ ε : ℝ)
    (hm : 0 < m) (hdecrease : 0 < decrease) (hscale : 0 < scale)
    (hthreshold : 0 < threshold) (hε₀ : 0 < ε₀) (hε : 0 < ε)
    (hεsmall : ε ≤ ε₀ / 4)
    (hnormalization : ε₀ * scale ^ 2 = 1 / (2 * m))
    (hscaledThreshold : scale * threshold ≤ 1 / 2)
    (hgap_nonneg : ∀ k, 0 ≤ gap k)
    (hmeasure_nonneg : ∀ k, 0 ≤ measure k)
    (hdamped : ∀ k, threshold ≤ measure k →
      gap (k + 1) ≤ gap k - decrease)
    (hquadratic : ∀ k, measure k < threshold →
      scale * measure (k + 1) ≤ (scale * measure k) ^ 2)
    (hsuboptimality : ∀ k, gap k ≤ measure k ^ 2 / (2 * m))
    (K : ℕ)
    (hK : gap 0 / decrease +
      Real.logb 2 (Real.logb 2 (ε₀ / ε)) ≤ (K : ℝ)) :
    gap K ≤ ε := by
  sorry
Source
Boyd and Vandenberghe, Convex Optimization, Cambridge University Press, 2004 (seventh printing with corrections, 2009), https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf, section 9.5.3, pp. 488-489, equations (9.32)-(9.36).

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