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

ConvexSmoothGradient: 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. The Bregman gap controls the gradient difference
  2. Convex smooth gradients are cocoercive
  3. A convex smooth function has a Lipschitz gradient
Samplinglib mathematical lesson

The Bregman gap controls the gradient difference

AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSmoothGradient.gradient_gap_sq_le_bregman · theorem · Teaching coverage

Read this first

Mathematical statement

For a positive real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, every ordered pair x,y satisfies the squared gradient difference bound by 2β times its Bregman gap.

\[\begin{gathered}f(y)\le f(x)+\langle\nabla f(x),y-x\rangle+\frac\beta2\|y-x\|^2\\[4pt]B_f(y,x):=f(y)-f(x)-\langle\nabla f(x),y-x\rangle\\[4pt]\|\nabla f(y)-\nabla f(x)\|^2\le 2\beta B_f(y,x)\end{gathered}\]
Lean statement · gradient_gap_sq_le_bregman

For a positive real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, every ordered pair x,y satisfies the squared gradient difference bound by 2β times its Bregman 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_gap_sq_le_bregman {f : E → ℝ} {β : ℝ}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f) (hβ : 0 < β)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x y : E) :
    ‖gradient f y - gradient f x‖ ^ 2 ≤
      2 * β * (f y - f x - inner ℝ (gradient f x) (y - x))

Exact module and namespace context

Proof roadmap

  1. 1Subtract the tangent plane

    Fix x,y and write d=∇f(y)−∇f(x), z=y−d/β. Convexity and the actual gradient give the supporting-plane lower bound at x. This says f minus its tangent plane at x is minimized at x. The positive β makes the trial step meaningful.

  2. 2Apply the upper model at the tilted gradient step

    Apply the original upper model from y to z. Insert z−y=−d/β and z−x=(y−x)−d/β in the two models. Combining the inequalities eliminates f(z). The difference of the two linear terms is ⟨d,d⟩/β.

  3. 3Clear the positive denominator

    Multiplication by 2β gives the shared division-free statement. The Lean proof carries out the same field arithmetic with β≠0 and positive reciprocal. The source reciprocal form is only recovered for β>0.

Full assumptions and notation

All objects and hypotheses

  • E is a complete real inner-product space, f:E→ℝ, and all points range over the entire space E.
  • f is C¹ (ContDiff ℝ 1 f) and convex on E (ConvexOn ℝ Set.univ f). No second derivative is assumed.
  • The genuine gradient is the Riesz representative of the Fréchet derivative. The displayed quadratic upper model holds for every x,y.
  • β is a strictly positive real number. This is the positive denominator domain of source (3.4).

Mathematical proof

1. Subtract the tangent plane

Fix x,y and write d=∇f(y)−∇f(x), z=y−d/β. Convexity and the actual gradient give the supporting-plane lower bound at x. This says f minus its tangent plane at x is minimized at x. The positive β makes the trial step meaningful.

\[f(z)\ge f(x)+\langle\nabla f(x),z-x\rangle.\]
Corresponding Lean step

StrongConvexFirstOrder.firstOrder_lower_bound_of_strongConvexOn at modulus zero; strongConvexOn_zero and hf.differentiable_one.hasGradientAt.

2. Apply the upper model at the tilted gradient step

Apply the original upper model from y to z. Insert z−y=−d/β and z−x=(y−x)−d/β in the two models. Combining the inequalities eliminates f(z). The difference of the two linear terms is ⟨d,d⟩/β.

\[\frac{\|d\|^2}{2\beta}\le f(y)-f(x)-\langle\nabla f(x),y-x\rangle=B_f(y,x).\]
Corresponding Lean step

hu y z; hzx and hzy; inner_sub_left/right, inner_smul_right, norm_smul, real_inner_self_eq_norm_sq.

3. Clear the positive denominator

Multiplication by 2β gives the shared division-free statement. The Lean proof carries out the same field arithmetic with β≠0 and positive reciprocal. The source reciprocal form is only recovered for β>0.

\[\|\nabla f(y)-\nabla f(x)\|^2\le 2\beta B_f(y,x)\]
Corresponding Lean step

mul_le_mul_iff_right₀, inv_pos, field_simp and nlinarith; the reciprocal source form is also compiled in Tests.Shared.ConvexSmoothGradient.

Lean verification

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

Lean proof · gradient_gap_sq_le_bregman

Fix x,y and write d=∇f(y)−∇f(x), z=y−d/β. Convexity and the actual gradient give the supporting-plane lower bound at x. This says f minus its tangent plane at x is minimized at x. The positive β makes the trial step meaningful. Apply the original upper model from y to z. Insert z−y=−d/β and z−x=(y−x)−d/β in the two models. Combining the inequalities eliminates f(z). The difference of the two linear terms is ⟨d,d⟩/β. Multiplication by 2β gives the shared division-free statement. The Lean proof carries out the same field arithmetic with β≠0 and positive reciprocal. The source reciprocal form is only recovered for β>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_gap_sq_le_bregman {f : E → ℝ} {β : ℝ}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f) (hβ : 0 < β)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x y : E) :
    ‖gradient f y - gradient f x‖ ^ 2 ≤
      2 * β * (f y - f x - inner ℝ (gradient f x) (y - x)) := by
  let d := gradient f y - gradient f x
  let z := y - β⁻¹ • d
  have hl := StrongConvexFirstOrder.firstOrder_lower_bound_of_strongConvexOn
    (strongConvexOn_zero.mpr hc)
    (fun w _ => (hf.differentiable_one w).hasGradientAt) (mem_univ x) (mem_univ z)
  simp only [zero_div, zero_mul, add_zero] at hl
  have hh := hu y z
  have hzx : z - x = (y - x) - β⁻¹ • d := by dsimp [z]; abel
  rw [hzx, inner_sub_right, inner_smul_right] at hl
  have hzy : z - y = -(β⁻¹ • d) := by dsimp [z]; abel
  rw [hzy, inner_neg_right, inner_smul_right, norm_neg, norm_smul,
    Real.norm_eq_abs, mul_pow, sq_abs] at hh
  have hd : inner ℝ (gradient f y) d - inner ℝ (gradient f x) d = ‖d‖ ^ 2 := by
    rw [← inner_sub_left]
    exact real_inner_self_eq_norm_sq d
  have h := le_trans hl hh
  have hb : β ≠ 0 := ne_of_gt hβ
  apply (mul_le_mul_iff_right₀ (inv_pos.mpr hβ)).mp
  field_simp [hb] at h ⊢
  nlinarith

Exact module and namespace context

Scope and omitted-condition boundaries
  • The complete real inner-product space explicitly generalizes the source Euclidean space. A constrained set is not covered: the trial gradient step must remain in the domain. No Riemannian, stochastic, or companion-paper theorem is claimed.
  • Definition1.12 permits β≥0, but the reciprocal in (3.4) and the suggested step 1/β require β>0; the source does not state that restriction explicitly. The first declaration covers this positive domain. The scaled (3.5) and Lipschitz conclusions are separately established at β=0.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • strongConvexOn_zero; ContDiff.differentiable_one; DifferentiableAt.hasGradientAt
  • inner_sub_left; inner_sub_right; inner_smul_right; norm_smul; real_inner_self_eq_norm_sq; mul_le_mul_iff_right₀; inv_pos

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

Convex smooth gradients are cocoercive

AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSmoothGradient.gradient_cocoercive · theorem · Teaching coverage

Read this first

Mathematical statement

For a nonnegative real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, every ordered pair x,y satisfies the division-free cocoercivity inequality.

\[\begin{gathered}f(y)\le f(x)+\langle\nabla f(x),y-x\rangle+\frac\beta2\|y-x\|^2\\[4pt]B_f(y,x):=f(y)-f(x)-\langle\nabla f(x),y-x\rangle\\[4pt]\|\nabla f(y)-\nabla f(x)\|^2\le\beta\langle\nabla f(y)-\nabla f(x),y-x\rangle\end{gathered}\]
Lean statement · gradient_cocoercive

For a nonnegative real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, every ordered pair x,y satisfies the division-free cocoercivity inequality.

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_cocoercive {f : E → ℝ} {β : ℝ}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f) (hβ : 0 ≤ β)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x y : E) :
    ‖gradient f y - gradient f x‖ ^ 2 ≤
      β * inner ℝ (gradient f y - gradient f x) (y - x)

Exact module and namespace context

Proof roadmap

  1. 1Use a strictly positive relaxed modulus

    Fix x,y and set d=∇f(y)−∇f(x). For ε>0, the β upper model implies the (β+ε) model because squared norm is nonnegative. Thus the positive-modulus Bregman bound applies even when β=0.

  2. 2Exchange endpoints and add

    The values f(x),f(y) cancel. The two Bregman gaps sum to the gradient-displacement pairing, while reversing the gradient difference preserves its squared norm.

  3. 3Include the zero boundary by a real limit

    Let ε decrease to zero. The right side is affine and continuous in ε, and order is closed in ℝ. This proves the scaled bound for all β≥0. At β=0 the norm square must be zero, so the gradient is constant; no inverse at zero is used.

Full assumptions and notation

All objects and hypotheses

  • E is a complete real inner-product space, f:E→ℝ, and all points range over the entire space E.
  • f is C¹ (ContDiff ℝ 1 f) and convex on E (ConvexOn ℝ Set.univ f). No second derivative is assumed.
  • The genuine gradient is the Riesz representative of the Fréchet derivative. The displayed quadratic upper model holds for every x,y.
  • β is a nonnegative real number, including zero.

Mathematical proof

1. Use a strictly positive relaxed modulus

Fix x,y and set d=∇f(y)−∇f(x). For ε>0, the β upper model implies the (β+ε) model because squared norm is nonnegative. Thus the positive-modulus Bregman bound applies even when β=0.

\[\|d\|^2\le2(\beta+\varepsilon)B_f(y,x),\qquad\|d\|^2\le2(\beta+\varepsilon)B_f(x,y).\]
Corresponding Lean step

hu' follows by real arithmetic from hu and sq_nonneg; two calls of gradient_gap_sq_le_bregman.

2. Exchange endpoints and add

The values f(x),f(y) cancel. The two Bregman gaps sum to the gradient-displacement pairing, while reversing the gradient difference preserves its squared norm.

\[B_f(y,x)+B_f(x,y)=\langle d,y-x\rangle,\qquad\|d\|^2\le(\beta+\varepsilon)\langle d,y-x\rangle.\]
Corresponding Lean step

hxy and hyx; norm_sub_rev, inner_neg_right, inner_sub_left and nlinarith.

3. Include the zero boundary by a real limit

Let ε decrease to zero. The right side is affine and continuous in ε, and order is closed in ℝ. This proves the scaled bound for all β≥0. At β=0 the norm square must be zero, so the gradient is constant; no inverse at zero is used.

\[\|\nabla f(y)-\nabla f(x)\|^2\le\beta\langle\nabla f(y)-\nabla f(x),y-x\rangle\]
Corresponding Lean step

Tendsto.add/mul and tendsto_id.mono_left nhdsWithin_le_nhds; ge_of_tendsto with self_mem_nhdsWithin.

Lean verification

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

Lean proof · gradient_cocoercive

Fix x,y and set d=∇f(y)−∇f(x). For ε>0, the β upper model implies the (β+ε) model because squared norm is nonnegative. Thus the positive-modulus Bregman bound applies even when β=0. The values f(x),f(y) cancel. The two Bregman gaps sum to the gradient-displacement pairing, while reversing the gradient difference preserves its squared norm. Let ε decrease to zero. The right side is affine and continuous in ε, and order is closed in ℝ. This proves the scaled bound for all β≥0. At β=0 the norm square must be zero, so the gradient is constant; no inverse at zero is used.

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_cocoercive {f : E → ℝ} {β : ℝ}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f) (hβ : 0 ≤ β)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + β / 2 * ‖y - x‖ ^ 2)
    (x y : E) :
    ‖gradient f y - gradient f x‖ ^ 2 ≤
      β * inner ℝ (gradient f y - gradient f x) (y - x) := by
  have he (ε : ℝ) (hε : 0 < ε) :
      ‖gradient f y - gradient f x‖ ^ 2 ≤
        (β + ε) * inner ℝ (gradient f y - gradient f x) (y - x) := by
    have hu' (a b : E) : f b ≤ f a + inner ℝ (gradient f a) (b - a) +
        (β + ε) / 2 * ‖b - a‖ ^ 2 := by
      have := hu a b
      nlinarith [sq_nonneg ‖b - a‖]
    have hxy := gradient_gap_sq_le_bregman hf hc (add_pos_of_nonneg_of_pos hβ hε) hu' x y
    have hyx := gradient_gap_sq_le_bregman hf hc (add_pos_of_nonneg_of_pos hβ hε) hu' y x
    rw [norm_sub_rev (gradient f x), show x - y = -(y - x) by abel, inner_neg_right] at hyx
    rw [inner_sub_left]
    nlinarith
  have ht : Tendsto (fun ε : ℝ => (β + ε) *
      inner ℝ (gradient f y - gradient f x) (y - x)) (𝓝[>] 0)
      (𝓝 (β * inner ℝ (gradient f y - gradient f x) (y - x))) := by
    simpa using (tendsto_const_nhds.add (tendsto_id.mono_left nhdsWithin_le_nhds :
      Tendsto (fun ε : ℝ => ε) (𝓝[>] 0) (𝓝 0))).mul tendsto_const_nhds
  apply ge_of_tendsto ht
  filter_upwards [self_mem_nhdsWithin] with ε hε
  exact he ε hε

Exact module and namespace context

Scope and omitted-condition boundaries
  • The complete real inner-product space explicitly generalizes the source Euclidean space. A constrained set is not covered: the trial gradient step must remain in the domain. No Riemannian, stochastic, or companion-paper theorem is claimed.
  • Definition1.12 permits β≥0, but the reciprocal in (3.4) and the suggested step 1/β require β>0; the source does not state that restriction explicitly. The first declaration covers this positive domain. The scaled (3.5) and Lipschitz conclusions are separately established at β=0.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • norm_sub_rev; inner_neg_right; inner_sub_left
  • Tendsto.add; Tendsto.mul; tendsto_id; nhdsWithin_le_nhds; ge_of_tendsto; self_mem_nhdsWithin

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 convex smooth function has a Lipschitz gradient

AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSmoothGradient.gradient_lipschitz · theorem · Teaching coverage

Read this first

Mathematical statement

For a nonnegative real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, its genuine gradient is β-Lipschitz everywhere.

\[\begin{gathered}f(y)\le f(x)+\langle\nabla f(x),y-x\rangle+\frac\beta2\|y-x\|^2\\[4pt]B_f(y,x):=f(y)-f(x)-\langle\nabla f(x),y-x\rangle\\[4pt]\|\nabla f(y)-\nabla f(x)\|\le\beta\|y-x\|\end{gathered}\]
Lean statement · gradient_lipschitz

For a nonnegative real β and a C¹ convex real-valued function on a complete real inner-product space satisfying the global β quadratic upper model, its genuine gradient is β-Lipschitz everywhere.

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_lipschitz {f : E → ℝ} {β : NNReal}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + (β : ℝ) / 2 * ‖y - x‖ ^ 2) :
    LipschitzWith β (gradient f)

Exact module and namespace context

Proof roadmap

  1. 1Combine cocoercivity with Cauchy–Schwarz

    Write d=∇f(y)−∇f(x), v=y−x. Multiply the inner-product upper bound by the nonnegative β and combine it with cocoercivity.

  2. 2Cancel only a positive gradient difference

    If ‖d‖=0, the desired inequality is immediate. Otherwise ‖d‖>0 and cancellation yields the Lipschitz estimate. This does not divide by β and therefore includes β=0.

Full assumptions and notation

All objects and hypotheses

  • E is a complete real inner-product space, f:E→ℝ, and all points range over the entire space E.
  • f is C¹ (ContDiff ℝ 1 f) and convex on E (ConvexOn ℝ Set.univ f). No second derivative is assumed.
  • The genuine gradient is the Riesz representative of the Fréchet derivative. The displayed quadratic upper model holds for every x,y.
  • β:NNReal encodes exactly a nonnegative real number, including zero.

Mathematical proof

1. Combine cocoercivity with Cauchy–Schwarz

Write d=∇f(y)−∇f(x), v=y−x. Multiply the inner-product upper bound by the nonnegative β and combine it with cocoercivity.

\[\|d\|^2\le\beta\langle d,v\rangle\le\beta\|d\|\|v\|.\]
Corresponding Lean step

gradient_cocoercive and real_inner_le_norm; mul_le_mul_of_nonneg_left uses β.coe_nonneg.

2. Cancel only a positive gradient difference

If ‖d‖=0, the desired inequality is immediate. Otherwise ‖d‖>0 and cancellation yields the Lipschitz estimate. This does not divide by β and therefore includes β=0.

\[\|\nabla f(y)-\nabla f(x)\|\le\beta\|y-x\|\]
Corresponding Lean step

lipschitzWith_iff_norm_sub_le; by_cases on the norm, norm_nonneg, mul_le_mul_iff_left₀ 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_lipschitz

Write d=∇f(y)−∇f(x), v=y−x. Multiply the inner-product upper bound by the nonnegative β and combine it with cocoercivity. If ‖d‖=0, the desired inequality is immediate. Otherwise ‖d‖>0 and cancellation yields the Lipschitz estimate. This does not divide by β and therefore includes β=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_lipschitz {f : E → ℝ} {β : NNReal}
    (hf : ContDiff ℝ 1 f) (hc : ConvexOn ℝ univ f)
    (hu : ∀ x y, f y ≤ f x + inner ℝ (gradient f x) (y - x) + (β : ℝ) / 2 * ‖y - x‖ ^ 2) :
    LipschitzWith β (gradient f) := by
  rw [lipschitzWith_iff_norm_sub_le]
  intro x y
  have h := gradient_cocoercive hf hc β.coe_nonneg hu y x
  have hs := mul_le_mul_of_nonneg_left
    (real_inner_le_norm (gradient f x - gradient f y) (x - y)) β.coe_nonneg
  by_cases hz : ‖gradient f x - gradient f y‖ = 0
  · rw [hz]
    positivity
  · apply (mul_le_mul_iff_left₀ (lt_of_le_of_ne (norm_nonneg _) (Ne.symm hz))).mp
    nlinarith

end AutoSamplingTheory.TechnicalLemmas.Analysis.ConvexSmoothGradient

Exact module and namespace context

Scope and omitted-condition boundaries
  • The complete real inner-product space explicitly generalizes the source Euclidean space. A constrained set is not covered: the trial gradient step must remain in the domain. No Riemannian, stochastic, or companion-paper theorem is claimed.
  • Definition1.12 permits β≥0, but the reciprocal in (3.4) and the suggested step 1/β require β>0; the source does not state that restriction explicitly. The first declaration covers this positive domain. The scaled (3.5) and Lipschitz conclusions are separately established at β=0.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

Mathlib API called (external library)

  • lipschitzWith_iff_norm_sub_le; real_inner_le_norm
  • mul_le_mul_of_nonneg_left; mul_le_mul_iff_left₀; 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.