Bench / optimisation
From subgradient energy to a finite-run best iterate
Optimisation · natural-language: L3 (author-assigned; calibration pending)
Why this difficulty?
A standard multi-step energy estimate, finite weighted-minimum argument and step-size calculation with sign and degenerate-case audits. This is L3 rather than a new cross-module research composition; the constant-step corollary is not an aligned Lean target. Calibration remains pending.
Editorial review and exact formal-coverage boundary
AI editorial review accepted after a separately reviewed correction. This is not canonical theorem publication, full Lean coverage or empirical difficulty calibration.
- This core has no aligned Lean QA. Its unchanged supporting module is evidence for the norm, weighted telescope and finite-iterate witness, not certification of the entire prose exercise.
- The explicit constant-step optimization and degenerate-case prose are not separate matching formal conclusions in this core.
- This exact-proposal review does not certify compiler execution, model or human performance, empirical difficulty calibration, theorem publication or whole-Goal completion.
Content-bound review status and evidence hashes · Independent reports and frozen inputs. Historical rejected wording is audit material, not training gold.
Assumptions and conventions
- E is a real inner-product space and \(f:E\to \mathbb{R}\) is globally G-Lipschitz with \(G\ge 0\). Supplied sequences xₖ,gₖ satisfy the global supporting inequality \(f(xₖ)+⟨gₖ,y-xₖ⟩\le f(y)\) for every \(y\in E\) and every \(k\ge 0\).
- The actual recurrence is \[x_{k+1}=x_k-a_k g_k.\] For the energy estimate take \(aₖ\ge 0\); for the normalized best-iterate statement assume aₖ>0 and \(N>0\). The comparator \(z\in E\) is arbitrary, not necessarily a minimizer.
- For the positive-parameter rate corollary fix \(N>0\), \(R>0\), \(G>0\) and \(\|x_{0}-z\|\le R\), then choose the constant step aₖ=R/(G√N). This schedule is selected for that finite horizon.
Natural-language question
Derive the terminal-distance-retaining weighted energy bound, then show that some \(i<N\) satisfies \[f(x_i)-f(z)\le\frac{\|x_0-z\|^2+G^2\sum_{k=0}^{N-1}a_k^2}{2\sum_{k=0}^{N-1}a_k}.\] Deduce the exact RG/√N bound for the stated constant step. Explain what happens at \(N=0\), \(R=0\) or \(G=0\) and which existence/domain claims this reasoning does not provide.
Reference mathematical proof
For each k, test global support at y=xₖ+gₖ and bound the same increment by Lipschitz growth: \[\|g_k\|^2\le f(x_k+g_k)-f(x_k)\le G\|g_k\|.\] If gₖ=0 the norm bound is immediate; otherwise divide by its strictly positive norm to get \(\|g_k\|\le G\). Test support again at z to obtain \[f(x_k)-f(z)\le\langle g_k,x_k-z\rangle.\] No minimizing comparator or differentiability is needed.
Expanding the actual update in the inner-product space gives \[\|x_{k+1}-z\|^2=\|x_k-z\|^2-2a_k\langle g_k,x_k-z\rangle+a_k^2\|g_k\|^2.\] Since \(aₖ\ge 0\), multiplication preserves the support inequality; since \(aₖ^{2}\ge 0\), the norm bound gives \[2a_k(f(x_k)-f(z))\le\|x_k-z\|^2-\|x_{k+1}-z\|^2+G^2a_k^2.\] A negative step would invalidate the first inference.
Sum these finite inequalities; the distance terms telescope exactly: \[2\sum_{k<N}a_k(f(x_k)-f(z))\le\|x_0-z\|^2+G^2\sum_{k<N}a_k^2-\|x_N-z\|^2.\] This statement permits zero steps and \(N=0\). It retains, rather than assumes away, the nonnegative terminal distance.
For \(N>0\) choose i minimizing f(xₖ) over the finite nonempty index set \(\{0,…,N-1\}\). This is a finite minimum, not existence of a global minimizer of f. Put \(A=\sum_{k=0}^{N-1}a_k>0\). Positive weights imply \[A(f(x_i)-f(z))\le\sum_{k<N}a_k(f(x_k)-f(z)).\] Drop the nonpositive terminal term from the upper bound and divide by 2A>0 to obtain the requested ratio.
When a=R/(G√N)>0, the ratio is at most \[\frac{R^2+G^2Na^2}{2Na}=\frac{R^2}{2Na}+\frac{G^2a}{2}=\frac{RG}{\sqrt N}.\] The chosen schedule depends on N; this does not establish that one fixed infinite run uses all these horizon-dependent schedules simultaneously.
At \(N=0\) the energy inequality reduces to \(0\le 0\), but there is no \(i<0\) and division by a zero sum cannot create one (Lean's totalized 0/0 does not repair existence). If \(R=0\) then \(z=x_{0}\) and, for \(N>0\), \(i=0\) already has zero gap. If \(G=0\) global Lipschitz growth makes f constant and the norm lemma forces all supplied gₖ=0; the positive-parameter step formula is unnecessary. These degenerate cases are separate arguments, not a substitution into a formula requiring positive parameters.
Formal support and missing Lean alignment
The existing module proves norm_le_of_supportsAt, then sum_weighted_gap_le (nonnegative steps, including N=0), then exists_gap_le (strictly positive steps and N>0). Its finite-index minimum and positive denominator match the first four proof steps. The full module is shown below unchanged, including imports, namespaces and upstream notices. The explicit step optimization and degenerate-case explanations are additional prose, not a matching formal conclusion. No aligned Lean QA is exported: extracting exists_gap_le alone would leave its same-module energy helper unavailable under the current no-target-module-import task policy. This is a task-context limitation, not an unproved library theorem.
Supporting library Lean (not an aligned QA task)
/-
Copyright (c) 2024 Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors of the upstream mathematical development: Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen
Modified for Samplinglib: native Lean 4.33.0 statements and proofs; reuse SupportsAt,
unbundle algorithm inputs and expose the weighted telescope and a finite index witness.
-/
import AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSubgradient
import Mathlib.Topology.MetricSpace.Lipschitz
import Mathlib.Data.Finset.Max
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
/-!
# Nonsmooth subgradient method
Native port of the norm bound and finite-horizon convergence argument in Optlib
`5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3`,
`Optlib/Algorithm/SubgradientMethod.lean:80–118,137–232` (Apache-2.0).
The existing `ConvexSubgradient.SupportsAt` relation is exactly the global
subgradient inequality. No duplicate predicate or upstream algorithm class is
introduced. Lipschitz growth bounds supplied subgradients, the actual update
telescopes squared distances, and a finite minimizer index supplies the best
iterate bound. Completeness, differentiability and existence of a minimizer are
not needed. This does not construct subgradients or a measurable/random oracle.
-/
namespace AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod
open ConvexSubgradient Finset
open scoped NNReal RealInnerProductSpace
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
/-- Global Lipschitz growth controls every supplied supporting vector.
This is consumed inside the subgradient telescope, not supplied as an extra premise. -/
theorem norm_le_of_supportsAt {f : E → ℝ} {G : ℝ≥0} {x g : E}
(hf : LipschitzWith G f) (hs : SupportsAt f x g) : ‖g‖ ≤ (G : ℝ) := by
have hs' := hs (x + g)
change f x + inner ℝ g (x + g - x) ≤ f (x + g) at hs'
rw [add_sub_cancel_left, real_inner_self_eq_norm_sq] at hs'
have hl : f (x + g) - f x ≤ (G : ℝ) * ‖g‖ := by
calc
f (x + g) - f x ≤ |f (x + g) - f x| := le_abs_self _
_ ≤ (G : ℝ) * ‖g‖ := by
simpa [Real.dist_eq, dist_eq_norm] using hf.dist_le_mul (x + g) x
by_cases hg : ‖g‖ = 0
· simp [hg]
· have hp : 0 < ‖g‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hg)
nlinarith
/-- The actual subgradient recurrence controls the finite weighted objective gaps,
retaining the terminal squared distance. Zero steps and the empty horizon are allowed. -/
theorem sum_weighted_gap_le {f : E → ℝ} {G : ℝ≥0} {x g : ℕ → E} {a : ℕ → ℝ}
(hf : LipschitzWith G f) (ha : ∀ k, 0 ≤ a k)
(hs : ∀ k, SupportsAt f (x k) (g k))
(hx : ∀ k, x (k + 1) = x k - a k • g k) (z : E) (N : ℕ) :
2 * (∑ k ∈ Finset.range N, a k * (f (x k) - f z)) ≤
‖x 0 - z‖ ^ 2 + (G : ℝ) ^ 2 * (∑ k ∈ Finset.range N, (a k) ^ 2) - ‖x N - z‖ ^ 2 := by
have hstep (k : ℕ) :
2 * a k * (f (x k) - f z) ≤
‖x k - z‖ ^ 2 - ‖x (k + 1) - z‖ ^ 2 + (G : ℝ) ^ 2 * (a k) ^ 2 := by
have hs' := hs k z
change f (x k) + inner ℝ (g k) (z - x k) ≤ f z at hs'
have hpair : f (x k) - f z ≤ inner ℝ (g k) (x k - z) := by
rw [inner_sub_right] at hs' ⊢
linarith
have hg := norm_le_of_supportsAt hf (hs k)
have hgsq : ‖g k‖ ^ 2 ≤ (G : ℝ) ^ 2 :=
pow_le_pow_left₀ (norm_nonneg _) hg 2
have hnorm : ‖x (k + 1) - z‖ ^ 2 =
‖x k - z‖ ^ 2 - 2 * a k * inner ℝ (g k) (x k - z) + (a k) ^ 2 * ‖g k‖ ^ 2 := by
rw [hx k, sub_right_comm, norm_sub_sq_real, inner_smul_right,
norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, real_inner_comm (x k - z)]
ring
have hp := mul_le_mul_of_nonneg_left hpair (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (ha k))
have hn := mul_le_mul_of_nonneg_left hgsq (sq_nonneg (a k))
nlinarith
induction N with
| zero => simp
| succ N ih =>
rw [Finset.sum_range_succ, Finset.sum_range_succ]
nlinarith [hstep N]
/-- A positive finite run contains an iterate satisfying the normalized Optlib
subgradient bound, relative to any comparator (not necessarily a minimizer). -/
theorem exists_gap_le {f : E → ℝ} {G : ℝ≥0} {x g : ℕ → E} {a : ℕ → ℝ}
(hf : LipschitzWith G f) (ha : ∀ k, 0 < a k)
(hs : ∀ k, SupportsAt f (x k) (g k))
(hx : ∀ k, x (k + 1) = x k - a k • g k) (z : E) {N : ℕ} (hN : 0 < N) :
∃ i < N, f (x i) - f z ≤
(‖x 0 - z‖ ^ 2 + (G : ℝ) ^ 2 * (∑ k ∈ Finset.range N, (a k) ^ 2)) /
(2 * ∑ k ∈ Finset.range N, a k) := by
have hne : (Finset.range N).Nonempty := ⟨0, Finset.mem_range.mpr hN⟩
obtain ⟨i, hi, hmin⟩ := Finset.exists_min_image (Finset.range N) (fun k => f (x k)) hne
refine ⟨i, Finset.mem_range.mp hi, ?_⟩
have hsumpos : 0 < ∑ k ∈ Finset.range N, a k :=
Finset.sum_pos (fun k _ => ha k) hne
have hlower : (∑ k ∈ Finset.range N, a k) * (f (x i) - f z) ≤
∑ k ∈ Finset.range N, a k * (f (x k) - f z) := by
rw [Finset.sum_mul]
exact Finset.sum_le_sum fun k hk =>
mul_le_mul_of_nonneg_left (sub_le_sub_right (hmin k hk) _) (ha k).le
have he := sum_weighted_gap_le hf (fun k => (ha k).le) hs hx z N
apply (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 2) hsumpos)).mpr
nlinarith [sq_nonneg ‖x N - z‖]
end AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod
Download exact supporting module · Uses the project toolchain and its listed imports; not a standalone replacement QA proof.
Assessment rubric · 4 points
- Derives the one-step squared-distance bound from the actual update, supplied global support and derived norm control, tracking the nonnegative step sign. (1 point)
- Telescopes with the terminal term intact and obtains the normalized bound via a finite nonempty minimum and strictly positive weight sum, without a global minimizer assumption. (1 point)
- Calculates the exact RG/√N constant for the positive finite-horizon step schedule and states its horizon dependence. (1 point)
- Handles \(N=0\), \(R=0\) and \(G=0\) separately, rejecting a nonexistent empty-horizon witness and avoiding unproved oracle/existence/completeness claims. (1 point)
Lean view: not yet aligned
The existing module proves norm_le_of_supportsAt, then sum_weighted_gap_le (nonnegative steps, including N=0), then exists_gap_le (strictly positive steps and N>0). Its finite-index minimum and positive denominator match the first four proof steps. The full module is shown below unchanged, including imports, namespaces and upstream notices. The explicit step optimization and degenerate-case explanations are additional prose, not a matching formal conclusion. No aligned Lean QA is exported: extracting exists_gap_le alone would leave its same-module energy helper unavailable under the current no-target-module-import task policy. This is a task-context limitation, not an unproved library theorem.
Supporting library Lean (not an aligned QA task)
/-
Copyright (c) 2024 Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors of the upstream mathematical development: Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen
Modified for Samplinglib: native Lean 4.33.0 statements and proofs; reuse SupportsAt,
unbundle algorithm inputs and expose the weighted telescope and a finite index witness.
-/
import AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSubgradient
import Mathlib.Topology.MetricSpace.Lipschitz
import Mathlib.Data.Finset.Max
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
/-!
# Nonsmooth subgradient method
Native port of the norm bound and finite-horizon convergence argument in Optlib
`5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3`,
`Optlib/Algorithm/SubgradientMethod.lean:80–118,137–232` (Apache-2.0).
The existing `ConvexSubgradient.SupportsAt` relation is exactly the global
subgradient inequality. No duplicate predicate or upstream algorithm class is
introduced. Lipschitz growth bounds supplied subgradients, the actual update
telescopes squared distances, and a finite minimizer index supplies the best
iterate bound. Completeness, differentiability and existence of a minimizer are
not needed. This does not construct subgradients or a measurable/random oracle.
-/
namespace AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod
open ConvexSubgradient Finset
open scoped NNReal RealInnerProductSpace
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
/-- Global Lipschitz growth controls every supplied supporting vector.
This is consumed inside the subgradient telescope, not supplied as an extra premise. -/
theorem norm_le_of_supportsAt {f : E → ℝ} {G : ℝ≥0} {x g : E}
(hf : LipschitzWith G f) (hs : SupportsAt f x g) : ‖g‖ ≤ (G : ℝ) := by
have hs' := hs (x + g)
change f x + inner ℝ g (x + g - x) ≤ f (x + g) at hs'
rw [add_sub_cancel_left, real_inner_self_eq_norm_sq] at hs'
have hl : f (x + g) - f x ≤ (G : ℝ) * ‖g‖ := by
calc
f (x + g) - f x ≤ |f (x + g) - f x| := le_abs_self _
_ ≤ (G : ℝ) * ‖g‖ := by
simpa [Real.dist_eq, dist_eq_norm] using hf.dist_le_mul (x + g) x
by_cases hg : ‖g‖ = 0
· simp [hg]
· have hp : 0 < ‖g‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hg)
nlinarith
/-- The actual subgradient recurrence controls the finite weighted objective gaps,
retaining the terminal squared distance. Zero steps and the empty horizon are allowed. -/
theorem sum_weighted_gap_le {f : E → ℝ} {G : ℝ≥0} {x g : ℕ → E} {a : ℕ → ℝ}
(hf : LipschitzWith G f) (ha : ∀ k, 0 ≤ a k)
(hs : ∀ k, SupportsAt f (x k) (g k))
(hx : ∀ k, x (k + 1) = x k - a k • g k) (z : E) (N : ℕ) :
2 * (∑ k ∈ Finset.range N, a k * (f (x k) - f z)) ≤
‖x 0 - z‖ ^ 2 + (G : ℝ) ^ 2 * (∑ k ∈ Finset.range N, (a k) ^ 2) - ‖x N - z‖ ^ 2 := by
have hstep (k : ℕ) :
2 * a k * (f (x k) - f z) ≤
‖x k - z‖ ^ 2 - ‖x (k + 1) - z‖ ^ 2 + (G : ℝ) ^ 2 * (a k) ^ 2 := by
have hs' := hs k z
change f (x k) + inner ℝ (g k) (z - x k) ≤ f z at hs'
have hpair : f (x k) - f z ≤ inner ℝ (g k) (x k - z) := by
rw [inner_sub_right] at hs' ⊢
linarith
have hg := norm_le_of_supportsAt hf (hs k)
have hgsq : ‖g k‖ ^ 2 ≤ (G : ℝ) ^ 2 :=
pow_le_pow_left₀ (norm_nonneg _) hg 2
have hnorm : ‖x (k + 1) - z‖ ^ 2 =
‖x k - z‖ ^ 2 - 2 * a k * inner ℝ (g k) (x k - z) + (a k) ^ 2 * ‖g k‖ ^ 2 := by
rw [hx k, sub_right_comm, norm_sub_sq_real, inner_smul_right,
norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, real_inner_comm (x k - z)]
ring
have hp := mul_le_mul_of_nonneg_left hpair (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (ha k))
have hn := mul_le_mul_of_nonneg_left hgsq (sq_nonneg (a k))
nlinarith
induction N with
| zero => simp
| succ N ih =>
rw [Finset.sum_range_succ, Finset.sum_range_succ]
nlinarith [hstep N]
/-- A positive finite run contains an iterate satisfying the normalized Optlib
subgradient bound, relative to any comparator (not necessarily a minimizer). -/
theorem exists_gap_le {f : E → ℝ} {G : ℝ≥0} {x g : ℕ → E} {a : ℕ → ℝ}
(hf : LipschitzWith G f) (ha : ∀ k, 0 < a k)
(hs : ∀ k, SupportsAt f (x k) (g k))
(hx : ∀ k, x (k + 1) = x k - a k • g k) (z : E) {N : ℕ} (hN : 0 < N) :
∃ i < N, f (x i) - f z ≤
(‖x 0 - z‖ ^ 2 + (G : ℝ) ^ 2 * (∑ k ∈ Finset.range N, (a k) ^ 2)) /
(2 * ∑ k ∈ Finset.range N, a k) := by
have hne : (Finset.range N).Nonempty := ⟨0, Finset.mem_range.mpr hN⟩
obtain ⟨i, hi, hmin⟩ := Finset.exists_min_image (Finset.range N) (fun k => f (x k)) hne
refine ⟨i, Finset.mem_range.mp hi, ?_⟩
have hsumpos : 0 < ∑ k ∈ Finset.range N, a k :=
Finset.sum_pos (fun k _ => ha k) hne
have hlower : (∑ k ∈ Finset.range N, a k) * (f (x i) - f z) ≤
∑ k ∈ Finset.range N, a k * (f (x k) - f z) := by
rw [Finset.sum_mul]
exact Finset.sum_le_sum fun k hk =>
mul_le_mul_of_nonneg_left (sub_le_sub_right (hmin k hk) _) (ha k).le
have he := sum_weighted_gap_le hf (fun k => (ha k).le) hs hx z N
apply (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 2) hsumpos)).mpr
nlinarith [sq_nonneg ‖x N - z‖]
end AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod
Download exact supporting module · Uses the project toolchain and its listed imports; not a standalone replacement QA proof.
This support theorem does not certify the complete QA or its explanatory counterexamples.
What this does—and does not—verify
This is a deterministic comparator bound for already supplied iterates, supports and steps. It does not construct a subgradient, prove a measurable/random algorithm or establish query complexity, constrained/projected convergence, last-iterate convergence or a global minimizer's existence. Strict positive steps are retained for the source best-iterate theorem even though some weaker sufficient conditions could also be mathematically valid. The full Lean module supports the energy/best-iterate portion, not every corollary in this QA.
Existing library mathematics reused; no new mathematical leaf or paper-completion credit. The editorial panel records the exact current review scope and remaining unformalized explanation.
Sources, graph location and dependencies
Original formula exercise over the Samplinglib-native Optlib port, sharing a family with sogb-019 (both public-dev; never independent train/test families). Copyright (c) 2024 Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen, Apache-2.0; upstream Optlib 5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3, Optlib/Algorithm/SubgradientMethod.lean:80–118,137–232. The optional module source preserves its full notice and Samplinglib modifications. The constant-step corollary and edge-case explanation are ASTIS-authored mathematics, not a claim that a new formal theorem or QA pair exists.
Exact local source and full context · Locate the existing Lean declaration
AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.exists_gap_le
ASTIS formal support (not an equivalent QA)
AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSubgradient.SupportsAtAutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.norm_le_of_supportsAtAutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.sum_weighted_gap_le
Mathlib facts / definitions
norm_sub_sq_realFinset.sum_range_succFinset.exists_min_imageFinset.sum_posle_div_iff₀
Binding SHA-256: 15a19933c0cbddea0e5e89962c7375f05183709493c77749fe4f0115c0155931