Samplinglib
Lean gate not recorded for this source state main · 9bb7a7394ab0

GradientDescentValue: mathematical reading route

Read the statements and derivations in source order. Every result has its own optional Lean statement and proof. Source assumptions, library reuse and unproved boundaries are kept explicit.

  1. One gradient step controls comparator energy
  2. A weighted bound on the final function value
Samplinglib mathematical lesson

One gradient step controls comparator energy

AutoSamplingTheory.TechnicalLemmas.Analysis.GradientDescentValue.gradient_step_energy_bound · theorem · Teaching coverage

Read this first

Mathematical statement

For every x,z, one actual gradient step obeys the displayed distance-plus-function energy bound.

\[\begin{gathered}T(x)=x-h\nabla f(x),\\f(y)\le f(x)+\langle\nabla f(x),y-x\rangle+\frac\beta2\|y-x\|^2.\\\|T(x)-z\|^2+2h(f(T(x))-f(z))\\\le(1-\alpha h)\|x-z\|^2.\end{gathered}\]
Lean statement · gradient_step_energy_bound

Actual-gradient one-step arbitrary-comparator energy bound.

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 gradient_step_energy_bound {f : E → ℝ} {α β h : ℝ}
    (hf : ContDiff ℝ 1 f) (hsc : StrongConvexOn univ α f)
    (hh : 0 ≤ h) (hstep : β * h ≤ 1)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x z : E) :
    ‖x - h • gradient f x - z‖ ^ 2 + 2 * h * (f (x - h • gradient f x) - f z) ≤
      (1 - α * h) * ‖x - z‖ ^ 2

Exact module and namespace context

Proof roadmap

  1. 1Compute descent for the actual gradient step

    Put g=∇f(x) and s=T(x)=x−hg. Apply the upper model at x,s. Since h≥0 and βh≤1, βh²‖g‖²≤h‖g‖². This proves the source Lemma3.1 descent estimate using the canonical shared descent interface.

  2. 2Use strong first-order support at an arbitrary comparator

    The compiled first-order support theorem follows from the source chord definition and the genuine gradient, supplied by C¹ differentiability. Set v=x−z and g=∇f(x). No minimum condition on z enters.

  3. 3Expand and cancel the gradient square

    Multiply each function inequality by 2h≥0 and insert the exact squared-distance expansion. The h²‖g‖² terms cancel. This gives the stated one-step energy inequality even when the comparator gap is negative.

Full assumptions and notation

All objects and hypotheses

  • E is a complete real inner-product space and f:E→ℝ is C¹ globally. Its gradient is the actual Riesz representative of its Fréchet derivative.
  • α,β,h are real numbers; h≥0 and βh≤1. No separate nonnegative-modulus assumption is needed by these two inequalities.
  • f is globally α-strongly convex in the chord sense with subtraction (α/2)t(1−t)‖y−x‖². The β quadratic upper model displayed below holds for every x,y in E.
  • T(x)=x−h∇f(x). The comparator z is arbitrary, so f(x)−f(z) may be negative. No minimizer is assumed or constructed.

Mathematical proof

1. Compute descent for the actual gradient step

Put g=∇f(x) and s=T(x)=x−hg. Apply the upper model at x,s. Since h≥0 and βh≤1, βh²‖g‖²≤h‖g‖². This proves the source Lemma3.1 descent estimate using the canonical shared descent interface.

\[\begin{gathered}f(s)-f(x)\le-h\|g\|^2+\tfrac\beta2h^2\|g\|^2,\\f(s)-f(x)\le-\tfrac h2\|g\|^2.\end{gathered}\]
Corresponding Lean step

AutoSamplingTheory.TechnicalLemmas.Analysis.GradientDescentBasic.gradient_step_descent_of_quadratic_upper_bound; inner_smul_right, real_inner_self_eq_norm_sq, norm_smul, mul_le_mul_of_nonneg_right.

2. Use strong first-order support at an arbitrary comparator

The compiled first-order support theorem follows from the source chord definition and the genuine gradient, supplied by C¹ differentiability. Set v=x−z and g=∇f(x). No minimum condition on z enters.

\[f(z)\ge f(x)-\langle g,v\rangle+\tfrac\alpha2\|v\|^2.\]
Corresponding Lean step

StrongConvexFirstOrder.firstOrder_lower_bound_of_strongConvexOn; ContDiff.differentiable_one; DifferentiableAt.hasGradientAt.

3. Expand and cancel the gradient square

Multiply each function inequality by 2h≥0 and insert the exact squared-distance expansion. The h²‖g‖² terms cancel. This gives the stated one-step energy inequality even when the comparator gap is negative.

\[\begin{gathered}\|v-hg\|^2=\|v\|^2-2h\langle g,v\rangle+h^2\|g\|^2,\\\|T(x)-z\|^2+2h(f(T(x))-f(z))\\\le(1-\alpha h)\|v\|^2.\end{gathered}\]
Corresponding Lean step

norm_sub_sq_real; inner_smul_right; real_inner_comm; norm_smul; two nonnegative multiplications and nlinarith.

Lean verification

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

Lean proof · gradient_step_energy_bound

Put g=∇f(x) and s=T(x)=x−hg. Apply the upper model at x,s. Since h≥0 and βh≤1, βh²‖g‖²≤h‖g‖². This proves the source Lemma3.1 descent estimate using the canonical shared descent interface. The compiled first-order support theorem follows from the source chord definition and the genuine gradient, supplied by C¹ differentiability. Set v=x−z and g=∇f(x). No minimum condition on z enters. Multiply each function inequality by 2h≥0 and insert the exact squared-distance expansion. The h²‖g‖² terms cancel. This gives the stated one-step energy inequality even when the comparator gap is negative.

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 gradient_step_energy_bound {f : E → ℝ} {α β h : ℝ}
    (hf : ContDiff ℝ 1 f) (hsc : StrongConvexOn univ α f)
    (hh : 0 ≤ h) (hstep : β * h ≤ 1)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x z : E) :
    ‖x - h • gradient f x - z‖ ^ 2 + 2 * h * (f (x - h • gradient f x) - f z) ≤
      (1 - α * h) * ‖x - z‖ ^ 2 := by
  have hl := StrongConvexFirstOrder.firstOrder_lower_bound_of_strongConvexOn
    hsc (fun w _ => (hf.differentiable_one w).hasGradientAt) (mem_univ x) (mem_univ z)
  have hd := GradientDescentBasic.gradient_step_descent_of_quadratic_upper_bound hh hstep hu x
  have hn : z - x = -(x - z) := by abel
  rw [hn, inner_neg_right, norm_neg] at hl
  have hl' := mul_le_mul_of_nonneg_left hl (by positivity : 0 ≤ 2 * h)
  have hd' := mul_le_mul_of_nonneg_left hd (by positivity : 0 ≤ 2 * h)
  rw [show x - h • gradient f x - z = (x - z) - h • gradient f x by abel,
    norm_sub_sq_real, inner_smul_right, real_inner_comm (gradient f x),
    norm_smul, Real.norm_eq_abs, mul_pow, sq_abs]
  nlinarith

Exact module and namespace context

Scope and omitted-condition boundaries
  • This is shared optimization textbook mathematics, not companion-paper progress. C¹ on a complete real Hilbert space generalizes the section’s C² Euclidean setting. Signed α and β are explicit extensions of the nonnegative source moduli; no reciprocal of either is used. The actual comparator formulation is justified by source (3.3).
  • The source prints h≤1/β without h≥0. The latter is essential: f(t)=t²/2, α=0, β=1, x=0, z=1 and h=−1 meet the printed upper restriction, but (3.3) would assert 2≤1. The division-free βh≤1 presentation includes β=0; it agrees with the printed reciprocal restriction only for β>0.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • ContDiff.differentiable_one; DifferentiableAt.hasGradientAt
  • norm_sub_sq_real; inner_smul_right; real_inner_self_eq_norm_sq; norm_smul

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.

Samplinglib mathematical lesson

A weighted bound on the final function value

AutoSamplingTheory.TechnicalLemmas.Analysis.GradientDescentValue.gradient_descent_weighted_value_bound · theorem · Teaching coverage

Read this first

Mathematical statement

For every initial point x₀, comparator z and natural N, actual iterates obey the displayed finite-geometric-sum bound under q≥0.

\[\begin{gathered}T(x)=x-h\nabla f(x),\\f(y)\le f(x)+\langle\nabla f(x),y-x\rangle+\frac\beta2\|y-x\|^2.\\x_n=T^n(x_0),\quad q=1-\alpha h\ge0,\\S_N=\sum_{k=0}^{N-1}q^k,\quad R=\|x_0-z\|,\\2hS_N(f(x_N)-f(z))\le q^N R^2.\end{gathered}\]
Lean statement · gradient_descent_weighted_value_bound

Actual-iterate finite weighted final comparator gap.

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 gradient_descent_weighted_value_bound {f : E → ℝ} {α β h : ℝ}
    (hf : ContDiff ℝ 1 f) (hsc : StrongConvexOn univ α f)
    (hh : 0 ≤ h) (hstep : β * h ≤ 1) (hcoeff : α * h ≤ 1)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x₀ z : E) (N : ℕ) :
    2 * h * (∑ k ∈ range N, (1 - α * h) ^ k) *
        (f ((fun x => x - h • gradient f x)^[N] x₀) - f z) ≤
      (1 - α * h) ^ N * ‖x₀ - z‖ ^ 2

Exact module and namespace context

Proof roadmap

  1. 1Obtain a signed forced recurrence and monotonicity

    Define x_n=T^n(x₀), u_n=‖x_n−z‖², g_n=f(x_n)−f(z), and q=1−αh≥0. The one-step energy inequality gives the recurrence, and shared descent gives g_(n+1)≤g_n. The gaps themselves need not be nonnegative.

  2. 2Reuse product-form discrete Grönwall

    Apply Mathlib’s recurrence theorem with constant coefficient q and forcing −2h g_(n+1). This theorem permits signed forcing. Constant products become powers; no inverse of q is introduced, so q=0 is admitted.

  3. 3Replace earlier gaps by the final gap

    For k<N, monotonicity gives g_N≤g_(k+1). Multiply by the nonpositive coefficient −2h and then the nonnegative weight q^(N−1−k). Sum, discard u_N≥0, and reverse the finite index. Write S_N=Σ_(k=0)^(N−1)q^k and R=‖x₀−z‖. This proves the final bound also for N=0.

Full assumptions and notation

All objects and hypotheses

  • E is a complete real inner-product space and f:E→ℝ is C¹ globally. Its gradient is the actual Riesz representative of its Fréchet derivative.
  • α,β,h are real numbers; h≥0 and βh≤1. No separate nonnegative-modulus assumption is needed by these two inequalities.
  • f is globally α-strongly convex in the chord sense with subtraction (α/2)t(1−t)‖y−x‖². The β quadratic upper model displayed below holds for every x,y in E.
  • T(x)=x−h∇f(x). The comparator z is arbitrary, so f(x)−f(z) may be negative. No minimizer is assumed or constructed.
  • N∈ℕ, T⁰ is the identity, q=1−αh≥0 and S_N=Σ_(k=0)^(N−1)q^k; in particular S₀=0. No upper bound q≤1 is required by the weighted inequality.

Mathematical proof

1. Obtain a signed forced recurrence and monotonicity

Define x_n=T^n(x₀), u_n=‖x_n−z‖², g_n=f(x_n)−f(z), and q=1−αh≥0. The one-step energy inequality gives the recurrence, and shared descent gives g_(n+1)≤g_n. The gaps themselves need not be nonnegative.

\[\begin{gathered}u_{n+1}\le q u_n-2h g_{n+1},\\g_{n+1}\le g_n.\end{gathered}\]
Corresponding Lean step

gradient_step_energy_bound; AutoSamplingTheory.TechnicalLemmas.Analysis.GradientDescentBasic.gradient_step_descent_of_quadratic_upper_bound; Function.iterate_succ_apply'; antitone_nat_of_succ_le.

2. Reuse product-form discrete Grönwall

Apply Mathlib’s recurrence theorem with constant coefficient q and forcing −2h g_(n+1). This theorem permits signed forcing. Constant products become powers; no inverse of q is introduced, so q=0 is admitted.

\[u_N\le q^N u_0-2h\sum_{k=0}^{N-1}q^{N-1-k}g_{k+1}.\]
Corresponding Lean step

discrete_gronwall_prod_general; Finset.prod_const; Nat.card_Ico; Nat.Ico_zero_eq_range; Finset.card_range.

3. Replace earlier gaps by the final gap

For k<N, monotonicity gives g_N≤g_(k+1). Multiply by the nonpositive coefficient −2h and then the nonnegative weight q^(N−1−k). Sum, discard u_N≥0, and reverse the finite index. Write S_N=Σ_(k=0)^(N−1)q^k and R=‖x₀−z‖. This proves the final bound also for N=0.

\[\begin{gathered}2h\sum_{k=0}^{N-1}q^{N-1-k}g_N\le q^N u_0,\\2hS_Ng_N\le q^N R^2.\end{gathered}\]
Corresponding Lean step

Finset.sum_le_sum; pow_nonneg; Finset.sum_range_reflect; Finset.mul_sum; sq_nonneg.

Lean verification

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

Lean proof · gradient_descent_weighted_value_bound

Define x_n=T^n(x₀), u_n=‖x_n−z‖², g_n=f(x_n)−f(z), and q=1−αh≥0. The one-step energy inequality gives the recurrence, and shared descent gives g_(n+1)≤g_n. The gaps themselves need not be nonnegative. Apply Mathlib’s recurrence theorem with constant coefficient q and forcing −2h g_(n+1). This theorem permits signed forcing. Constant products become powers; no inverse of q is introduced, so q=0 is admitted. For k<N, monotonicity gives g_N≤g_(k+1). Multiply by the nonpositive coefficient −2h and then the nonnegative weight q^(N−1−k). Sum, discard u_N≥0, and reverse the finite index. Write S_N=Σ_(k=0)^(N−1)q^k and R=‖x₀−z‖. This proves the final bound also for N=0.

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 gradient_descent_weighted_value_bound {f : E → ℝ} {α β h : ℝ}
    (hf : ContDiff ℝ 1 f) (hsc : StrongConvexOn univ α f)
    (hh : 0 ≤ h) (hstep : β * h ≤ 1) (hcoeff : α * h ≤ 1)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x₀ z : E) (N : ℕ) :
    2 * h * (∑ k ∈ range N, (1 - α * h) ^ k) *
        (f ((fun x => x - h • gradient f x)^[N] x₀) - f z) ≤
      (1 - α * h) ^ N * ‖x₀ - z‖ ^ 2 := by
  let T : E → E := fun x => x - h • gradient f x
  let X : ℕ → E := fun n => T^[n] x₀
  let q : ℝ := 1 - α * h
  have hq : 0 ≤ q := sub_nonneg.mpr hcoeff
  have hX (n : ℕ) : X (n + 1) = T (X n) := Function.iterate_succ_apply' _ _ _
  have hm : Antitone (fun n => f (X n)) := by
    apply antitone_nat_of_succ_le
    intro n
    have hd := GradientDescentBasic.gradient_step_descent_of_quadratic_upper_bound hh hstep hu (X n)
    rw [hX]
    dsimp [T]
    have : 0 ≤ h / 2 * ‖gradient f (X n)‖ ^ 2 := by positivity
    linarith
  have hr (n : ℕ) (_ : 0 ≤ n) :
      ‖X (n + 1) - z‖ ^ 2 ≤ q * ‖X n - z‖ ^ 2 + (-2 * h * (f (X (n + 1)) - f z)) := by
    have he := gradient_step_energy_bound hf hsc hh hstep hu (X n) z
    rw [hX]
    dsimp [T, q]
    linarith
  have hg := discrete_gronwall_prod_general (u := fun n => ‖X n - z‖ ^ 2)
    (b := fun n => -2 * h * (f (X (n + 1)) - f z)) (c := fun _ => q) hr (fun _ _ => hq) (Nat.zero_le N)
  simp only [Finset.prod_const, Nat.card_Ico, Nat.Ico_zero_eq_range, Finset.card_range] at hg
  have hs : ∑ k ∈ range N, (-2 * h * (f (X (k + 1)) - f z)) * q ^ (N - (k + 1)) ≤
      ∑ k ∈ range N, (-2 * h * (f (X N) - f z)) * q ^ (N - (k + 1)) := by
    apply sum_le_sum
    intro k hk
    have hm' := hm (by have := mem_range.mp hk; omega : k + 1 ≤ N)
    apply mul_le_mul_of_nonneg_right _ (pow_nonneg hq _)
    have hh' : 0 ≤ 2 * h := by positivity
    nlinarith
  have hsum : (∑ k ∈ range N, q ^ (N - (k + 1))) = ∑ k ∈ range N, q ^ k := by
    rw [← sum_range_reflect (fun k => q ^ k) N]
    apply sum_congr rfl
    intro k _
    congr 1
    omega
  rw [← mul_sum, hsum] at hs
  have hu0 : X 0 = x₀ := rfl
  rw [hu0] at hg
  have huN := sq_nonneg ‖X N - z‖
  change 2 * h * (∑ k ∈ range N, q ^ k) * (f (X N) - f z) ≤ q ^ N * ‖x₀ - z‖ ^ 2
  nlinarith

end AutoSamplingTheory.TechnicalLemmas.Analysis.GradientDescentValue

Exact module and namespace context

Scope and omitted-condition boundaries
  • This is shared optimization textbook mathematics, not companion-paper progress. C¹ on a complete real Hilbert space generalizes the section’s C² Euclidean setting. Signed α and β are explicit extensions of the nonnegative source moduli; no reciprocal of either is used. The actual comparator formulation is justified by source (3.3).
  • The source prints h≤1/β without h≥0. The latter is essential: f(t)=t²/2, α=0, β=1, x=0, z=1 and h=−1 meet the printed upper restriction, but (3.3) would assert 2≤1. The division-free βh≤1 presentation includes β=0; it agrees with the printed reciprocal restriction only for β>0.
  • The weighted adapter explicitly assumes αh≤1, the nonnegative coefficient domain used in the source recurrence proof. It allows q=0 as a product-form endpoint extension. N=0 and h=0 are valid division-free cases; they give no normalized rate.
  • For h>0,N>0, the α=0 O(1/N) rate and the positive-α expression αq^N R²/[2(1−q^N)] are compiled test consumers. The latter includes q=0; equivalence to the printed inverse-power expression is only meaningful for q>0 and is not a public declaration here. No complete Theorem3.4 closure is claimed.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • discrete_gronwall_prod_general
  • Function.iterate_succ_apply'; antitone_nat_of_succ_le
  • Finset.sum_le_sum; Finset.sum_range_reflect; Nat.card_Ico; pow_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.