Samplinglib
Lean gate not recorded for this source state main · ed709a7f320d
Optimisation · §6 · source p. 39

Non-smooth convex optimization

Stable source-facing chapter environment inside the shared Samplinglib reader.

Partially formalizedsource mapFull source closure not claimed
Planned route

Source → theorem map → reusable Lean nodes

01

Source audit

Definitions, theorems, assumptions, proof route, and exact anchors.

02

Upstream alignment

Search Mathlib, Optlib, CvxLean, and shared Samplinglib interfaces; preserve the exact Chewi statement and use a small adapter when conventions differ.

03

Frontier Cells

Only genuinely missing mathematical edges become theorem-sized tasks.

04

Graph placement

Dependencies, consumers, cross-library bridges, and reusable shared interfaces.

Open exact Chewi source ↗

This page establishes a stable source route and truth boundary; it does not claim a completed formalization.

Lipschitz growth bounds every supplied subgradient · Optlib prerequisite

Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen, Optlib (Apache-2.0). Samplinglib native port and original exposition; not quoted textbook prose.

Optlib 5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3 · Lipschitz_to_bounded_subgradient:80–118 · faithful paraphrase

Complete source statement (Samplinglib restatement)

For any globally G-Lipschitz real-valued function on a real inner-product space, every global supporting vector v at x satisfies ‖v‖≤G.

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.

Claim

\[f(x)+\langle v,z-x\rangle\le f(z)\ (\forall z)\quad\Longrightarrow\quad\|v\|\le G.\]

Read the formalized proofs

Each statement and proof below has its own closed Lean disclosure. Samplinglib parents, Mathlib calls and external mathematical sources are distinguished in each proof.

Samplinglib mathematical lesson

Lipschitz growth bounds every supplied subgradient

AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.norm_le_of_supportsAt · theorem · Teaching coverage

Read this first

Mathematical statement

For any globally G-Lipschitz real-valued function on a real inner-product space, every global supporting vector v at x satisfies ‖v‖≤G.

\[f(x)+\langle v,z-x\rangle\le f(z)\ (\forall z)\quad\Longrightarrow\quad\|v\|\le G.\]
Lean statement · norm_le_of_supportsAt

A supplied global supporting vector of a globally G-Lipschitz objective has norm at most G.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

theorem norm_le_of_supportsAt {f : E → ℝ} {G : ℝ≥0} {x g : E}
    (hf : LipschitzWith G f) (hs : SupportsAt f x g) : ‖g‖ ≤ (G : ℝ)

Exact module and namespace context

Proof roadmap

  1. 1Probe in the supporting direction

    Evaluate the global supporting inequality at z=x+v. The pairing is exactly ‖v‖², with no derivative or inverse norm needed.

  2. 2Use the actual Lipschitz bound

    The function increment is at most its absolute value, and global Lipschitz continuity bounds that absolute value by G‖v‖.

  3. 3Keep the zero vector separate

    If v=0 the result is nonnegativity of G. Otherwise ‖v‖>0, so the quadratic inequality implies ‖v‖≤G. This is the same bound as the upstream normalized-direction argument, with a division-free proof.

Full assumptions and notation

All objects and hypotheses

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.

Mathematical proof

1. Probe in the supporting direction

Evaluate the global supporting inequality at z=x+v. The pairing is exactly ‖v‖², with no derivative or inverse norm needed.

\[\|v\|^2\le f(x+v)-f(x).\]
Corresponding Lean step

SupportsAt evaluated at x+g; real_inner_self_eq_norm_sq.

2. Use the actual Lipschitz bound

The function increment is at most its absolute value, and global Lipschitz continuity bounds that absolute value by G‖v‖.

\[f(x+v)-f(x)\le |f(x+v)-f(x)|\le G\|v\|.\]
Corresponding Lean step

LipschitzWith.dist_le_mul; Real.dist_eq; le_abs_self.

3. Keep the zero vector separate

If v=0 the result is nonnegativity of G. Otherwise ‖v‖>0, so the quadratic inequality implies ‖v‖≤G. This is the same bound as the upstream normalized-direction argument, with a division-free proof.

\[\|v\|^2\le G\|v\|\quad\Longrightarrow\quad\|v\|\le G.\]
Corresponding Lean step

norm_nonneg; zero/nonzero split; nlinarith.

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean proof · norm_le_of_supportsAt

Probe at x+v, compare the quadratic lower growth with Lipschitz upper growth, and separate the zero-norm case.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
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

Exact module and namespace context

Source assumptions versus formal assumptions

SourceActual LeanDifference kindWhy it matters
Global real Hilbert supporting-vector inequality and NNReal Lipschitz constant.Existing SupportsAt predicate is the same inequality; no differentiability, chosen global optimizer or norm-bound premise.sameUpstream SubderivAt membership is unbundled into its literal supporting inequality. No theorem conclusion is moved into the inputs.
No completeness used in this upstream direction.No completeness assumption, matching the upstream omit command.sameOnly the real inner-product carrier and global Lipschitz/support facts are used.

No existence or measurable selection of supporting vectors is claimed. The theorem does not require convexity once a global supporting vector is supplied, just as the corresponding upstream direction. This is a native local port of the norm bound, not a bulk import of Optlib or a sampling convergence result.

Encoder–denoiser: accepted · equivalent-after-elaboration

Detected semantic differences

  • scopes: The implementation uses the unnormalized aligned probe x+g rather than the source's unit-vector contradiction. This changes the proof route only. — Source lines 86-118 normalize by ||g||; current module lines 42-53 instead compare ||g||^2 with G||g|| and explicitly handle zero norm.

A generalization is not a source correction. Proposed missing conditions require separate independent repair review. No proposed repair silently changes the original theorem.

Scope and omitted-condition boundaries
  • No existence or measurable selection of supporting vectors is claimed. The theorem does not require convexity once a global supporting vector is supplied, just as the corresponding upstream direction.
  • This is a native local port of the norm bound, not a bulk import of Optlib or a sampling convergence result.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • LipschitzWith.dist_le_mul
  • real_inner_self_eq_norm_sq
  • Real.dist_eq
  • norm_nonneg

Mathematical sources

Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

Which proof obligations and prerequisites are covered?

  • Formalized proof edge; source adapter/review separate For any globally G-Lipschitz real-valued function on a real inner-product space, every global supporting vector v at x satisfies ‖v‖≤G.

The actual subgradient steps telescope weighted objective gaps · Optlib prerequisite

Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen, Optlib (Apache-2.0). Samplinglib native port and original exposition; not quoted textbook prose.

Optlib 5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3 · subgradient_method_converge one-step/telescope:137–232 · faithful paraphrase

Complete source statement (Samplinglib restatement)

Let f be globally G-Lipschitz. For sequences x_k,v_k and nonnegative real steps a_k, suppose v_k supports f at x_k and x_(k+1)=x_k−a_k v_k for every k. For every comparator z and every N≥0, the weighted objective gaps obey the displayed bound, including the terminal squared distance.

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.
  • x,v:ℕ→E and a:ℕ→ℝ. Each a_k≥0; each v_k supports f at x_k; the update x_(k+1)=x_k−a_k v_k is an exact equality.
  • z is any comparator in E, not a supplied minimizer. N is any natural number, including zero. There is no division by a step or horizon.

Claim

\[2\sum_{k=0}^{N-1}a_k\bigl(f(x_k)-f(z)\bigr)\le\|x_0-z\|^2+G^2\sum_{k=0}^{N-1}a_k^2-\|x_N-z\|^2.\]

Read the formalized proofs

Each statement and proof below has its own closed Lean disclosure. Samplinglib parents, Mathlib calls and external mathematical sources are distinguished in each proof.

Samplinglib mathematical lesson

The actual subgradient steps telescope weighted objective gaps

AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.sum_weighted_gap_le · theorem · Teaching coverage

Read this first

Mathematical statement

Let f be globally G-Lipschitz. For sequences x_k,v_k and nonnegative real steps a_k, suppose v_k supports f at x_k and x_(k+1)=x_k−a_k v_k for every k. For every comparator z and every N≥0, the weighted objective gaps obey the displayed bound, including the terminal squared distance.

\[2\sum_{k=0}^{N-1}a_k\bigl(f(x_k)-f(z)\bigr)\le\|x_0-z\|^2+G^2\sum_{k=0}^{N-1}a_k^2-\|x_N-z\|^2.\]
Lean statement · sum_weighted_gap_le

Finite weighted-gap telescope for actual Lipschitz subgradient updates with nonnegative steps.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

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

Exact module and namespace context

Proof roadmap

  1. 1Turn support into a gap estimate

    Use the supporting inequality at the comparator z and reverse the displacement. The norm bound is proved by the preceding theorem inside this proof; it is not a new hypothesis.

  2. 2Expand the actual update

    The squared-distance identity is exact for the supplied recurrence. Multiplying the gap estimate by 2a_k is legitimate because the step is nonnegative; the squared subgradient term is at most a_k²G².

  3. 3Sum and cancel adjacent distances

    Sum the one-step inequality for k=0,…,N−1. Interior squared distances cancel, leaving the initial and terminal terms. The Lean induction performs exactly this finite telescope; the empty sum is the N=0 base case.

Full assumptions and notation

All objects and hypotheses

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.
  • x,v:ℕ→E and a:ℕ→ℝ. Each a_k≥0; each v_k supports f at x_k; the update x_(k+1)=x_k−a_k v_k is an exact equality.
  • z is any comparator in E, not a supplied minimizer. N is any natural number, including zero. There is no division by a step or horizon.

Mathematical proof

1. Turn support into a gap estimate

Use the supporting inequality at the comparator z and reverse the displacement. The norm bound is proved by the preceding theorem inside this proof; it is not a new hypothesis.

\[f(x_k)-f(z)\le\langle v_k,x_k-z\rangle,\qquad\|v_k\|\le G.\]
Corresponding Lean step

SupportsAt evaluated at z; inner_sub_right; norm_le_of_supportsAt.

2. Expand the actual update

The squared-distance identity is exact for the supplied recurrence. Multiplying the gap estimate by 2a_k is legitimate because the step is nonnegative; the squared subgradient term is at most a_k²G².

\[\begin{aligned}\|x_{k+1}-z\|^2&=\|x_k-z\|^2-2a_k\langle v_k,x_k-z\rangle+a_k^2\|v_k\|^2\\&\le\|x_k-z\|^2-2a_k(f(x_k)-f(z))+a_k^2G^2.\end{aligned}\]
Corresponding Lean step

norm_sub_sq_real; norm_smul; sq_abs; pow_le_pow_left₀; mul_le_mul_of_nonneg_left.

3. Sum and cancel adjacent distances

Sum the one-step inequality for k=0,…,N−1. Interior squared distances cancel, leaving the initial and terminal terms. The Lean induction performs exactly this finite telescope; the empty sum is the N=0 base case.

\[\sum_{k=0}^{N-1}\bigl(\|x_k-z\|^2-\|x_{k+1}-z\|^2\bigr)=\|x_0-z\|^2-\|x_N-z\|^2.\]
Corresponding Lean step

Finset.sum_range_succ; induction on N; nlinarith.

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean proof · sum_weighted_gap_le

Prove the support gap and subgradient norm bounds, expand the actual squared-distance update, then telescope by induction.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
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]

Exact module and namespace context

Source assumptions versus formal assumptions

SourceActual LeanDifference kindWhy it matters
Global real Hilbert supporting-vector inequality and NNReal Lipschitz constant.Existing SupportsAt predicate is the same inequality; no differentiability, chosen global optimizer or norm-bound premise.sameUpstream SubderivAt membership is unbundled into its literal supporting inequality. No theorem conclusion is moved into the inputs.
Source algorithm positive steps; proof intermediate with a terminal distance.Nonnegative steps and N=0 also permitted in a division-free weighted estimate.generalizationZero steps/empty sum are algebraic endpoint extensions; not normalized at zero.

This exposes the stronger weighted intermediate estimate used by the upstream convergence proof. It does not assert monotonicity of function values or a last-iterate rate. The source uses positive steps; allowing zero steps and N=0 here is an explicit division-free generalization, not a repair. No stochastic oracle, kernel or expected sampling cost is constructed.

Encoder–denoiser: accepted · equivalent-after-elaboration

Detected semantic differences

  • assumptions: Relative to the raw upstream algorithm, the pinned energy statement weakens positive steps to nonnegative steps and allows N=0. This is a proved division-free generalization, not a repair or a new source hypothesis. — Upstream 139 requires a_n>0 and its horizon is k+1. The local proof only multiplies support inequalities by nonnegative 2a_k, and its empty-horizon base case is exact equality. Both lesson boundary and publication assumption delta disclose this.
  • conclusion: Relative to the raw upstream displayed theorem, this extraction retains individual weighted gaps and the negative terminal square. It is not asserted equivalent to the normalized finite-best-value theorem. — Source 171-232 expands and telescopes squared distances after bounding a common finite-sInf gap. Local 63-86 performs the same algebra before that substitution and keeps the terminal square. The stronger energy result implies the source finite-best bound on its positive-horizon domain, not conversely merely by matching notation.

A generalization is not a source correction. Proposed missing conditions require separate independent repair review. No proposed repair silently changes the original theorem.

Scope and omitted-condition boundaries
  • This exposes the stronger weighted intermediate estimate used by the upstream convergence proof. It does not assert monotonicity of function values or a last-iterate rate.
  • The source uses positive steps; allowing zero steps and N=0 here is an explicit division-free generalization, not a repair. No stochastic oracle, kernel or expected sampling cost is constructed.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • norm_sub_sq_real
  • norm_smul
  • sq_abs
  • Finset.sum_range_succ
  • mul_le_mul_of_nonneg_left

Mathematical sources

Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

Which proof obligations and prerequisites are covered?

  • Formalized proof edge; source adapter/review separate Let f be globally G-Lipschitz. For sequences x_k,v_k and nonnegative real steps a_k, suppose v_k supports f at x_k and x_(k+1)=x_k−a_k v_k for every k. For every comparator z and every N≥0, the weighted objective gaps obey the displayed bound, including the terminal squared distance.

A finite run contains a subgradient iterate with the convergence bound · Optlib prerequisite

Hongjia Chen, Chenyi Li, Wanyi He, Zaiwen Wen, Optlib (Apache-2.0). Samplinglib native port and original exposition; not quoted textbook prose.

Optlib 5da27c5f95aa6a8a45b8c14b968ade4c13ff18c3 · subgradient_method_converge:149–232 · faithful paraphrase

Complete source statement (Samplinglib restatement)

Under the same Lipschitz, support and exact-update assumptions, suppose every step is strictly positive and N>0. For any comparator z, some index i<N satisfies the displayed normalized best-iterate objective-gap bound.

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.
  • x,v:ℕ→E; a:ℕ→ℝ with a_k>0; each v_k supports f at x_k; x_(k+1)=x_k−a_k v_k for every k.
  • N>0, so the finite index set is nonempty and the sum of its positive step sizes is strictly positive.
  • z is arbitrary. Neither attainment of the global infimum nor differentiability is supplied.

Claim

\[\exists i<N:\quad 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}.\]

Read the formalized proofs

Each statement and proof below has its own closed Lean disclosure. Samplinglib parents, Mathlib calls and external mathematical sources are distinguished in each proof.

Samplinglib mathematical lesson

A finite run contains a subgradient iterate with the convergence bound

AutoSamplingTheory.TechnicalLemmas.Analysis.SubgradientMethod.exists_gap_le · theorem · Teaching coverage

Read this first

Mathematical statement

Under the same Lipschitz, support and exact-update assumptions, suppose every step is strictly positive and N>0. For any comparator z, some index i<N satisfies the displayed normalized best-iterate objective-gap bound.

\[\exists i<N:\quad 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}.\]
Lean statement · exists_gap_le

A positive finite subgradient run has a best index with the normalized objective-gap guarantee.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

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)

Exact module and namespace context

Proof roadmap

  1. 1Take a genuine finite minimum

    Choose i minimizing f(x_k) among k<N. This finite choice exists because N>0; it is not a default value of a totalized infimum.

  2. 2Compare the best gap to the weighted gaps

    Multiply each minimum inequality by a_k≥0 and sum. Apply the preceding actual-update telescope, then discard only the nonnegative terminal squared distance.

  3. 3Divide only on the positive domain

    The sum of positive steps over a nonempty finite range is positive. Dividing by twice that sum preserves the inequality and produces the claimed witness.

Full assumptions and notation

All objects and hypotheses

  • E is a real inner-product space with its associated norm. No completeness or finite-dimensionality assumption is imposed.
  • G is a nonnegative real Lipschitz constant and f:E→ℝ is globally G-Lipschitz.
  • SupportsAt f x v means f(x)+⟨v,z−x⟩≤f(z) for every z∈E. It supplies a genuine global supporting vector; no differentiability or totalized gradient is used.
  • x,v:ℕ→E; a:ℕ→ℝ with a_k>0; each v_k supports f at x_k; x_(k+1)=x_k−a_k v_k for every k.
  • N>0, so the finite index set is nonempty and the sum of its positive step sizes is strictly positive.
  • z is arbitrary. Neither attainment of the global infimum nor differentiability is supplied.

Mathematical proof

1. Take a genuine finite minimum

Choose i minimizing f(x_k) among k<N. This finite choice exists because N>0; it is not a default value of a totalized infimum.

\[i<N,\qquad f(x_i)\le f(x_k)\quad(k<N).\]
Corresponding Lean step

Finset.exists_min_image; range nonempty from 0<N.

2. Compare the best gap to the weighted gaps

Multiply each minimum inequality by a_k≥0 and sum. Apply the preceding actual-update telescope, then discard only the nonnegative terminal squared distance.

\[\begin{aligned}\left(\sum_{k<N}a_k\right)(f(x_i)-f(z))&\le\sum_{k<N}a_k(f(x_k)-f(z)),\\2\left(\sum_{k<N}a_k\right)(f(x_i)-f(z))&\le\|x_0-z\|^2+G^2\sum_{k<N}a_k^2.\end{aligned}\]
Corresponding Lean step

Finset.sum_le_sum; Finset.sum_mul; sum_weighted_gap_le; sq_nonneg.

3. Divide only on the positive domain

The sum of positive steps over a nonempty finite range is positive. Dividing by twice that sum preserves the inequality and produces the claimed witness.

\[2\sum_{k<N}a_k>0.\]
Corresponding Lean step

Finset.sum_pos; le_div_iff₀. No zero-step quotient is asserted.

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean proof · exists_gap_le

Choose a minimizing finite index, bound its gap by the weighted gaps, use the actual-update telescope, and divide by the proved positive total step.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
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

Exact module and namespace context

Source assumptions versus formal assumptions

SourceActual LeanDifference kindWhy it matters
Global real Hilbert supporting-vector inequality and NNReal Lipschitz constant.Existing SupportsAt predicate is the same inequality; no differentiability, chosen global optimizer or norm-bound premise.sameUpstream SubderivAt membership is unbundled into its literal supporting inequality. No theorem conclusion is moved into the inputs.
Positive steps, k+1 iterates and real sInf of finitely many values.N>0 and an actual finite minimizing index; denominator positivity is derived.sameFinite attained minimum equals the real sInf; x₀ is represented literally by x 0.

The upstream theorem writes the best finite value as a real sInf over k+1 iterates. An actual minimizing index is equivalent on this nonempty finite set; N>0 corresponds to its k+1 horizon. No claim is made about the last iterate, existence of subgradient selectors, asymptotic iterate convergence, stochastic selection, PBPS/SPHMC or sampling complexity. These are reusable Optlib-source components placed beside Optimisation Chapter6; the complete Chewi chapter statement/route is not silently declared finished.

Encoder–denoiser: accepted · equivalent-after-elaboration

Detected semantic differences

  • conclusion: The raw upstream unnormalized real sInf presentation is replaced by an equivalent finite-index normalized presentation on the same positive-horizon/positive-step domain. — N=k+1 makes the objective-value set finite and nonempty; it has an attained minimum. The strictly positive total step permits reversible division by 2A. Actual code derives both conditions rather than adding them as unexplained gates.
  • objects: The upstream algorithm class and initial equality are unbundled into actual sequences and x(0). This does not add a semantic premise. — Source 137-143 and 226 identify x0 with the initial iterate. The local declaration 90-96 writes x 0 directly while preserving support and exact update.

A generalization is not a source correction. Proposed missing conditions require separate independent repair review. No proposed repair silently changes the original theorem.

Scope and omitted-condition boundaries
  • The upstream theorem writes the best finite value as a real sInf over k+1 iterates. An actual minimizing index is equivalent on this nonempty finite set; N>0 corresponds to its k+1 horizon.
  • No claim is made about the last iterate, existence of subgradient selectors, asymptotic iterate convergence, stochastic selection, PBPS/SPHMC or sampling complexity.
  • These are reusable Optlib-source components placed beside Optimisation Chapter6; the complete Chewi chapter statement/route is not silently declared finished.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • Finset.exists_min_image
  • Finset.sum_pos
  • Finset.sum_le_sum
  • Finset.sum_mul
  • le_div_iff₀

Mathematical sources

Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

Which proof obligations and prerequisites are covered?

  • Formalized proof edge; source adapter/review separate Under the same Lipschitz, support and exact-update assumptions, suppose every step is strictly positive and N>0. For any comparator z, some index i<N satisfies the displayed normalized best-iterate objective-gap bound.