Documentation

ConvexAnalysis.Smoothing

Nesterov's smoothing technique #

For a real valued Φ that is κ-strongly convex on a closed convex set Q of a real Hilbert space V, the function y ↦ sup_{u ∈ Q} (⟪y, u⟫ - Φ u), the Fenchel conjugate of Φ + ι_Q, is differentiable, its gradient at y is the unique maximizer u y, and u is κ⁻¹-Lipschitz. Nesterov's smoothing of the max-type function f x = sup_{u ∈ Q} (⟪A x, u⟫ - φ u) adds a prox-function: f_μ x = sup_{u ∈ Q} (⟪A x, u⟫ - φ u - μ d u) with d σ-strongly convex on Q. Then f_μ is convex and differentiable with gradient A† (u_μ x), the gradient is ‖A‖² / (μ σ)-Lipschitz, and f_μ ≤ f ≤ f_μ + μ D if 0 ≤ d ≤ D on Q. For d = ½ ‖·‖² the smoothing is a Moreau envelope, and for the norm it is the Huber function. The Moreau envelope of an ℓ-Lipschitz function approximates it within ℓ² μ / 2. The complexity of the smoothing technique with FISTA is in SmoothingComplexity.lean.

Main definitions #

Main statements #

For Φ κ-strongly convex on Q with κ > 0:

Implementation notes #

Nesterov works in finite dimension with arbitrary norms and their dual norms; the library states the Euclidean (Hilbert space) case, with the norm of the inner product on both spaces, so that the operator norm ‖A‖₁,₂ is Mathlib's ‖A‖. Strong convexity is Mathlib's StrongConvexOn Q σ d. The functions are real valued; φ and d matter on Q only, and φ need only be convex and lower semicontinuous on Q, d lower semicontinuous on Q (Nesterov assumes continuity). Nesterov assumes Q bounded. Here only the statements of Nesterov, Theorem 6.1.1 (the maximizer, the gradient, its Lipschitz constant, convexity) allow an unbounded Q. The approximation (6.1.16) and S-FISTA (SmoothingComplexity.lean) assume 0 ≤ d ≤ D on Q, and with the σ-strong convexity of d this forces diam Q ≤ √(8 D / σ) (ConvexAnalysis.diam_le_of_strongConvexOn); so boundedness is not assumed separately there.

The maximizer is a proximal point: with ψ = Φ - κ/2 ‖·‖² + ι_Q, which is convex and lower semicontinuous, p maximizes ⟪y, ·⟫ - Φ on Q iff it is the proximal point of κ⁻¹ ψ at κ⁻¹ y. So existence comes from ConvexAnalysis.ConvexFun.exists_isProxAt, with no compactness. Differentiability and the Lipschitz bound are proved directly from the quadratic decay of the strongly concave objective at its maximizer, as in Nesterov, Theorem 6.1.1.

conjugateOn is a real supremum, which Lean sets to 0 where it is unbounded; the Moreau envelope is taken of an EReal function, so the identification with the Moreau envelope of f assumes the supremum finite everywhere, while the form with the Fenchel conjugate h* needs no such assumption. The identity (h + μ ‖·‖² / 2)* = e_μ (h*) is proved directly: the maximizer p = u_μ y also maximizes ⟪y - μ p, ·⟫ - φ on Q, so y - μ p attains the Moreau envelope.

References #

Tags #

smoothing, Nesterov smoothing, prox-function, strongly convex, Fenchel conjugate, Lipschitz gradient, Moreau envelope, Huber function

noncomputable def ConvexAnalysis.conjugateOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] (Q : Set V) (Φ : V → ℝ) (y : V) :

The real valued conjugate of Φ + ι_Q: conjugateOn Q Φ y = ⨆ u : Q, ⟪y, u⟫ - Φ u. It is meant for sets on which the supremum is finite (Lean's sSup of an unbounded set is 0).

Equations
Instances For
    noncomputable def ConvexAnalysis.nesterovSmoothing {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] (A : E →L[ℝ] V) (Q : Set V) (φ d : V → ℝ) (μ : ℝ) (x : E) :

    Nesterov's smoothing f_μ x = sup_{u ∈ Q} (⟪A x, u⟫ - φ u - μ d u) Nesterov, (6.1.14); d is the prox-function and μ the smoothing parameter. For μ = 0 this is the nonsmooth max-type function f x = sup_{u ∈ Q} (⟪A x, u⟫ - φ u).

    Equations
    Instances For
      theorem ConvexAnalysis.inner_sub_add_le_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} (hΦ : StrongConvexOn Q κ Φ) {y p v : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) (hv : v ∈ Q) :
      inner ℝ y v - Φ v + κ / 2 * ‖v - p‖ ^ 2 ≤ inner ℝ y p - Φ p

      Quadratic decay at the maximizer: if p maximizes ⟪y, ·⟫ - Φ on Q and Φ is κ-strongly convex on Q, then ⟪y, v⟫ - Φ v + κ / 2 ‖v - p‖² ≤ ⟪y, p⟫ - Φ p on Q.

      theorem ConvexAnalysis.eq_of_isMaxOn_inner_sub {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) {y p q : V} (hp : p ∈ Q) (hpmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) (hq : q ∈ Q) (hqmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q q) :
      p = q

      The maximizer of ⟪y, ·⟫ - Φ on Q is unique for strongly convex Φ (κ > 0).

      theorem ConvexAnalysis.exists_isMaxOn_inner_sub {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) (hlsc : LowerSemicontinuousOn Φ Q) (y : V) :
      ∃ p ∈ Q, IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p

      Existence of the maximizer of ⟪y, ·⟫ - Φ on a nonempty closed Q in a complete space, for Φ κ-strongly convex (κ > 0) and lower semicontinuous on Q. It is the proximal point of κ⁻¹ (Φ - κ/2 ‖·‖² + ι_Q) at κ⁻¹ y.

      theorem ConvexAnalysis.conjugateOn_eq_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) :
      conjugateOn Q Φ y = inner ℝ y p - Φ p

      The value of conjugateOn at y is attained at a maximizer.

      theorem ConvexAnalysis.conjugateOn_le_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) (z : V) :
      conjugateOn Q Φ z ≤ conjugateOn Q Φ y + inner ℝ (z - y) p + ‖z - y‖ ^ 2 / (2 * κ)

      The upper half of the sandwich (a descent lemma): if p maximizes ⟪y, ·⟫ - Φ on Q, then conjugateOn Q Φ z ≤ conjugateOn Q Φ y + ⟪z - y, p⟫ + ‖z - y‖² / (2κ) for every z.

      theorem ConvexAnalysis.le_conjugateOn_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) (z : V) :
      conjugateOn Q Φ y + inner ℝ (z - y) p ≤ conjugateOn Q Φ z

      The lower half of the sandwich: a maximizer p at y is a subgradient, conjugateOn Q Φ y + ⟪z - y, p⟫ ≤ conjugateOn Q Φ z.

      theorem ConvexAnalysis.hasGradientAt_conjugateOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} [CompleteSpace V] (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) :

      The conjugate of a strongly convex function is differentiable (BC, Theorem 18.15, the implication from strong convexity of f* to Lipschitz continuity of ∇f, here for Φ + ι_Q with real valued Φ): if Φ is κ-strongly convex on Q (κ > 0) and p maximizes ⟪y, ·⟫ - Φ on Q, then conjugateOn Q Φ has gradient p at y.

      theorem ConvexAnalysis.gradient_conjugateOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} [CompleteSpace V] (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) :

      The gradient of conjugateOn Q Φ at y is the maximizer.

      theorem ConvexAnalysis.mul_norm_sub_le_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} (hΦ : StrongConvexOn Q κ Φ) {y z p q : V} (hp : p ∈ Q) (hpmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) (hq : q ∈ Q) (hqmax : IsMaxOn (fun (u : V) => inner ℝ z u - Φ u) Q q) :
      κ * ‖p - q‖ ≤ ‖y - z‖

      The maximizers are κ⁻¹-Lipschitz: if p maximizes at y and q at z, then κ ‖p - q‖ ≤ ‖y - z‖ (indeed κ ‖p - q‖² ≤ ⟪y - z, p - q⟫).

      theorem ConvexAnalysis.norm_gradient_conjugateOn_sub_le {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) (hlsc : LowerSemicontinuousOn Φ Q) (y z : V) :

      The gradient of the conjugate of a κ-strongly convex function is κ⁻¹-Lipschitz (BC, Theorem 18.15), if the maximizers exist everywhere (exists_isMaxOn_inner_sub).

      theorem ConvexAnalysis.convexOn_conjugateOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {κ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hΦ : StrongConvexOn Q κ Φ) (hκ : 0 < κ) (hlsc : LowerSemicontinuousOn Φ Q) :

      The conjugate of a κ-strongly convex, lower semicontinuous Φ on a nonempty closed Q is convex.

      Nesterov's smoothing #

      @[simp]
      theorem ConvexAnalysis.nesterovSmoothing_zero {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} (x : E) :
      nesterovSmoothing A Q φ d 0 x = conjugateOn Q φ (A x)

      For μ = 0, nesterovSmoothing is the nonsmooth function f x = conjugateOn Q φ (A x).

      theorem ConvexAnalysis.exists_isMaxOn_nesterovSmoothing {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hd : StrongConvexOn Q σ d) (hdlsc : LowerSemicontinuousOn d Q) (hσ : 0 < σ) (hμ : 0 < μ) (x : E) :
      ∃ p ∈ Q, IsMaxOn (fun (u : V) => inner ℝ (A x) u - (φ u + μ * d u)) Q p

      The smoothing problem has a maximizer u_μ x at every x (unique by eq_of_isMaxOn_inner_sub), for a nonempty closed Q, φ convex and lower semicontinuous on Q and d σ-strongly convex and lower semicontinuous on Q, σ, μ > 0 Nesterov, Theorem 6.1.1.

      theorem ConvexAnalysis.hasGradientAt_nesterovSmoothing {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ : ℝ} [CompleteSpace E] [CompleteSpace V] (hφ : ConvexOn ℝ Q φ) (hd : StrongConvexOn Q σ d) (hσ : 0 < σ) (hμ : 0 < μ) {x : E} {p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ (A x) u - (φ u + μ * d u)) Q p) :

      Nesterov's smoothing theorem, the gradient Nesterov, Theorem 6.1.1: if u_μ x = p maximizes ⟪A x, ·⟫ - φ - μ d on Q, then f_μ has gradient A† p at x.

      theorem ConvexAnalysis.gradient_nesterovSmoothing {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ : ℝ} [CompleteSpace E] [CompleteSpace V] (hφ : ConvexOn ℝ Q φ) (hd : StrongConvexOn Q σ d) (hσ : 0 < σ) (hμ : 0 < μ) {x : E} {p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ (A x) u - (φ u + μ * d u)) Q p) :

      The gradient of f_μ at x is A† (u_μ x) ((6.1.15) in Nesterov, Theorem 6.1.1), for the maximizer u_μ x = p of ⟪A x, ·⟫ - φ - μ d on Q.

      theorem ConvexAnalysis.norm_gradient_nesterovSmoothing_sub_le {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ : ℝ} [CompleteSpace E] [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hd : StrongConvexOn Q σ d) (hdlsc : LowerSemicontinuousOn d Q) (hσ : 0 < σ) (hμ : 0 < μ) (x y : E) :
      ‖gradient (nesterovSmoothing A Q φ d μ) x - gradient (nesterovSmoothing A Q φ d μ) y‖ ≤ ‖A‖ ^ 2 / (μ * σ) * ‖x - y‖

      Nesterov's smoothing theorem, the Lipschitz constant Nesterov, Theorem 6.1.1 (there with σ = 1; L_μ = ‖A‖² / (μ σ) in [Nes05]): the gradient of f_μ is ‖A‖² / (μ σ)-Lipschitz.

      theorem ConvexAnalysis.convexOn_nesterovSmoothing {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hd : StrongConvexOn Q σ d) (hdlsc : LowerSemicontinuousOn d Q) (hσ : 0 < σ) (hμ : 0 < μ) :

      f_μ is convex Nesterov, Theorem 6.1.1.

      theorem ConvexAnalysis.nesterovSmoothing_le {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {μ : ℝ} (hμ : 0 ≤ μ) (hd0 : ∀ u ∈ Q, 0 ≤ d u) (hQne : Q.Nonempty) {x : E} (hbdd : BddAbove (Set.range fun (u : ↑Q) => inner ℝ (A x) ↑u - φ ↑u)) :
      nesterovSmoothing A Q φ d μ x ≤ conjugateOn Q φ (A x)

      The lower bound of the approximation, f_μ x ≤ f x, for μ ≥ 0, d ≥ 0 on Q, at every x where f x is finite Nesterov, (6.1.16).

      theorem ConvexAnalysis.le_nesterovSmoothing_add {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {μ D : ℝ} (hμ : 0 ≤ μ) (hdD : ∀ u ∈ Q, d u ≤ D) (hQne : Q.Nonempty) {x : E} (hbdd : BddAbove (Set.range fun (u : ↑Q) => inner ℝ (A x) ↑u - (φ ↑u + μ * d ↑u))) :
      conjugateOn Q φ (A x) ≤ nesterovSmoothing A Q φ d μ x + μ * D

      The upper bound of the approximation, f x ≤ f_μ x + μ D, for μ ≥ 0, d ≤ D on Q, at every x where f_μ x is finite Nesterov, (6.1.16).

      theorem ConvexAnalysis.nesterovSmoothing_le_and_le_add {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ d : V → ℝ} {σ μ D : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hd : StrongConvexOn Q σ d) (hdlsc : LowerSemicontinuousOn d Q) (hσ : 0 < σ) (hμ : 0 < μ) (hd0 : ∀ u ∈ Q, 0 ≤ d u) (hdD : ∀ u ∈ Q, d u ≤ D) (x : E) :
      nesterovSmoothing A Q φ d μ x ≤ conjugateOn Q φ (A x) ∧ conjugateOn Q φ (A x) ≤ nesterovSmoothing A Q φ d μ x + μ * D

      The smoothing approximates f uniformly Nesterov, (6.1.16): in the setting of Nesterov's theorem, with 0 ≤ d ≤ D on Q, f_μ x ≤ f x ≤ f_μ x + μ D at every x; both are finite.

      theorem ConvexAnalysis.mul_norm_sub_sq_le_of_strongConvexOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {d : V → ℝ} {σ D : ℝ} (hd : StrongConvexOn Q σ d) (hd0 : ∀ u ∈ Q, 0 ≤ d u) (hdD : ∀ u ∈ Q, d u ≤ D) {u v : V} (hu : u ∈ Q) (hv : v ∈ Q) :
      σ * ‖u - v‖ ^ 2 ≤ 8 * D

      A bounded strongly convex prox-function lives on a bounded set: if d is σ-strongly convex on Q and 0 ≤ d ≤ D on Q, then σ ‖u - v‖² ≤ 8 D for all u, v ∈ Q, by strong convexity at the midpoint of u and v. So the hypotheses of the approximation ConvexAnalysis.nesterovSmoothing_le_and_le_add force Q to be bounded (ConvexAnalysis.diam_le_of_strongConvexOn).

      theorem ConvexAnalysis.diam_le_of_strongConvexOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {d : V → ℝ} {σ D : ℝ} (hd : StrongConvexOn Q σ d) (hσ : 0 < σ) (hd0 : ∀ u ∈ Q, 0 ≤ d u) (hdD : ∀ u ∈ Q, d u ≤ D) :
      Metric.diam Q ≤ √(8 * D / σ)

      The diameter of Q is at most √(8 D / σ) if d is σ-strongly convex on Q, σ > 0, and 0 ≤ d ≤ D on Q (ConvexAnalysis.mul_norm_sub_sq_le_of_strongConvexOn).

      theorem ConvexAnalysis.isBounded_of_strongConvexOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {d : V → ℝ} {σ D : ℝ} (hd : StrongConvexOn Q σ d) (hσ : 0 < σ) (hd0 : ∀ u ∈ Q, 0 ≤ d u) (hdD : ∀ u ∈ Q, d u ≤ D) :

      Q is bounded if some σ-strongly convex d, σ > 0, satisfies 0 ≤ d ≤ D on Q (ConvexAnalysis.diam_le_of_strongConvexOn).

      theorem ConvexAnalysis.strongConvexOn_half_norm_sq {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} (hQ : Convex ℝ Q) :
      StrongConvexOn Q 1 fun (u : V) => ‖u‖ ^ 2 / 2

      The prox-function ½ ‖·‖² is 1-strongly convex on every convex set.

      The Moreau envelope as a smoothing #

      theorem ConvexAnalysis.fenchelConjugate_coe_add_convexIndicator_le_iff {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {y : V} {c : ℝ} :
      fenchelConjugate ((fun (u : V) => ↑(Φ u)) + convexIndicator Q) y ≤ ↑c ↔ ∀ u ∈ Q, inner ℝ y u - Φ u ≤ c

      The Fenchel conjugate of Φ + ι_Q is at most c at y iff ⟪y, u⟫ - Φ u ≤ c on Q.

      theorem ConvexAnalysis.inner_sub_le_fenchelConjugate_coe_add_convexIndicator {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {u : V} (hu : u ∈ Q) (y : V) :
      ↑(inner ℝ y u - Φ u) ≤ fenchelConjugate ((fun (u : V) => ↑(Φ u)) + convexIndicator Q) y

      Fenchel–Young for Φ + ι_Q: ⟪y, u⟫ - Φ u ≤ (Φ + ι_Q)* y for u ∈ Q.

      theorem ConvexAnalysis.fenchelConjugate_coe_add_convexIndicator_eq_of_isMaxOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} {y p : V} (hp : p ∈ Q) (hmax : IsMaxOn (fun (u : V) => inner ℝ y u - Φ u) Q p) :
      fenchelConjugate ((fun (u : V) => ↑(Φ u)) + convexIndicator Q) y = ↑(inner ℝ y p - Φ p)

      If p maximizes ⟪y, ·⟫ - Φ on Q, the Fenchel conjugate of Φ + ι_Q at y is ⟪y, p⟫ - Φ p.

      theorem ConvexAnalysis.fenchelConjugate_coe_add_convexIndicator_eq_conjugateOn {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {Φ : V → ℝ} (hQne : Q.Nonempty) {y : V} (hbdd : BddAbove (Set.range fun (u : ↑Q) => inner ℝ y ↑u - Φ ↑u)) :
      fenchelConjugate ((fun (u : V) => ↑(Φ u)) + convexIndicator Q) y = ↑(conjugateOn Q Φ y)

      Where the supremum is finite, conjugateOn Q Φ y is the Fenchel conjugate of Φ + ι_Q at y, for nonempty Q.

      theorem ConvexAnalysis.bddAbove_inner_sub_of_isBounded {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {φ : V → ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQb : Bornology.IsBounded Q) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (y : V) :
      BddAbove (Set.range fun (u : ↑Q) => inner ℝ y ↑u - φ ↑u)

      On a bounded closed Q of a complete space, the supremum defining conjugateOn Q φ y is finite at every y, for φ convex and lower semicontinuous on Q: φ + ι_Q has a continuous affine minorant (ConvexFun.exists_affine_minorant).

      theorem ConvexAnalysis.coe_nesterovSmoothing_eq_moreauEnvelope {E : Type u_1} {V : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {A : E →L[ℝ] V} {φ : V → ℝ} {μ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hμ : 0 < μ) (x : E) :
      ↑(nesterovSmoothing A Q φ (fun (u : V) => ‖u‖ ^ 2 / 2) μ x) = moreauEnvelope μ (fenchelConjugate ((fun (u : V) => ↑(φ u)) + convexIndicator Q)) (A x)

      The Moreau envelope is the smoothing with d = ½ ‖·‖²: for the prox-function d u = ‖u‖² / 2 (σ = 1), f_μ x = e_μ h* (A x) with h = φ + ι_Q, that is (h + μ ‖·‖² / 2)* = e_μ (h*); for A = id this says that f_μ is the Moreau envelope of the nonsmooth f = h* (moreauEnvelope_coe_nesterovSmoothing_zero). This is the case f = φ + ι_Q of BC, Proposition 14.1, (f + γ ‖·‖² / 2)* = e_γ (f*) for f ∈ Γ₀(H); here Q is closed and nonempty, φ real valued, convex and lower semicontinuous on Q, and V complete. The proof is direct: the maximizer p = u_μ (A x) is also the maximizer of ⟪A x - μ p, ·⟫ - φ on Q, so A x - μ p attains the infimum in the Moreau envelope.

      theorem ConvexAnalysis.moreauEnvelope_coe_nesterovSmoothing_zero {V : Type u_2} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {Q : Set V} {φ : V → ℝ} {μ : ℝ} [CompleteSpace V] (hQ : IsClosed Q) (hQne : Q.Nonempty) (hφ : ConvexOn ℝ Q φ) (hφlsc : LowerSemicontinuousOn φ Q) (hbdd : ∀ (y : V), BddAbove (Set.range fun (u : ↑Q) => inner ℝ y ↑u - φ ↑u)) (hμ : 0 < μ) (x : V) :
      moreauEnvelope μ (fun (y : V) => ↑(nesterovSmoothing (ContinuousLinearMap.id ℝ V) Q φ (fun (u : V) => ‖u‖ ^ 2 / 2) 0 y)) x = ↑(nesterovSmoothing (ContinuousLinearMap.id ℝ V) Q φ (fun (u : V) => ‖u‖ ^ 2 / 2) μ x)

      The Moreau envelope of the nonsmooth function is the smoothing with d = ½ ‖·‖²: for A = id and d u = ‖u‖² / 2, f_μ = e_μ f with f = nesterovSmoothing id Q φ d 0 as an EReal function, if the supremum defining f is finite everywhere (for example for bounded Q, bddAbove_inner_sub_of_isBounded). BC, Proposition 14.1 for φ + ι_Q. Compare Beck, Section 10.8.3: by Beck, Theorem 10.51 the Moreau envelope of an ℓ-Lipschitz convex function is a μ⁻¹-smooth approximation with β = ℓ² / 2 (ConvexAnalysis.toReal_moreauEnvelope_le_and_le_add); for Q ⊆ B(0, ℓ), f is ℓ-Lipschitz and the constant D = sup_Q ‖u‖² / 2 of the smoothing is at most ℓ² / 2.

      theorem ConvexAnalysis.toReal_moreauEnvelope_le_and_le_add {E : Type u_1} [NormedAddCommGroup E] {μ : ℝ} {h : E → ℝ} {ℓ : ℝ} (hh : ∀ (x y : E), |h x - h y| ≤ ℓ * ‖x - y‖) (hμ : 0 < μ) (x : E) :
      (moreauEnvelope μ (fun (y : E) => ↑(h y)) x).toReal ≤ h x ∧ h x ≤ (moreauEnvelope μ (fun (y : E) => ↑(h y)) x).toReal + ℓ ^ 2 * μ / 2

      The Moreau envelope of a Lipschitz function approximates it uniformly, the bounds of Beck, Theorem 10.51: if |h x - h y| ≤ ℓ ‖x - y‖ and μ > 0, then the envelope e_μ h is finite and e_μ h x ≤ h x ≤ e_μ h x + ℓ² μ / 2. Beck assumes h convex and bounds h u - h x below by a subgradient of norm at most ℓ; the Lipschitz bound itself suffices: h u + ‖u - x‖² / (2μ) ≥ h x - ℓ ‖u - x‖ + ‖u - x‖² / (2μ) ≥ h x - ℓ² μ / 2. For convex h the envelope is convex and has a μ⁻¹-Lipschitz gradient (ConvexAnalysis.ConvexFun.convexOn_moreauEnvelope, ConvexAnalysis.ConvexFun.hasGradientAt_moreauEnvelope, ConvexAnalysis.ConvexFun.lipschitzWith_gradient_moreauEnvelope), so it is a μ⁻¹-smooth approximation of h with parameters (1, ℓ² / 2) in the sense of Beck, Definition 10.43.

      The Huber function #

      noncomputable def ConvexAnalysis.huber {E : Type u_1} [NormedAddCommGroup E] (μ : ℝ) (x : E) :

      The Huber function H_μ x = ‖x‖² / (2μ) if ‖x‖ ≤ μ and ‖x‖ - μ / 2 otherwise Beck, (6.43); Nesterov, (6.1.43) is the scalar function ψ_μ with H_μ x = ψ_μ ‖x‖. It is meant for μ > 0; for μ = 0 it is the norm (huber_zero).

      Equations
      Instances For
        @[simp]
        theorem ConvexAnalysis.huber_zero {E : Type u_1} [NormedAddCommGroup E] (x : E) :

        H_0 = ‖·‖, the nonsmooth function that H_μ approximates.

        The norm is the support function of the unit ball: sup_{‖u‖ ≤ 1} ⟪x, u⟫ = ‖x‖, that is f = ‖·‖ for Q the unit ball and φ = 0.

        theorem ConvexAnalysis.isMaxOn_huber {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} (hμ : 0 < μ) (x : E) :
        (max ‖x‖ μ)⁻¹ • x ∈ Metric.closedBall 0 1 ∧ IsMaxOn (fun (u : E) => inner ℝ x u - (0 u + μ * (‖u‖ ^ 2 / 2))) (Metric.closedBall 0 1) ((max ‖x‖ μ)⁻¹ • x) ∧ inner ℝ x ((max ‖x‖ μ)⁻¹ • x) - (0 ((max ‖x‖ μ)⁻¹ • x) + μ * (‖(max ‖x‖ μ)⁻¹ • x‖ ^ 2 / 2)) = huber μ x

        The maximizer of the smoothing of the norm is u_μ x = x / max ‖x‖ μ: it lies in the unit ball and maximizes ⟪x, ·⟫ - μ ‖·‖² / 2 there, with value H_μ x.

        theorem ConvexAnalysis.nesterovSmoothing_closedBall_eq_huber {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} (hμ : 0 < μ) (x : E) :
        nesterovSmoothing (ContinuousLinearMap.id ℝ E) (Metric.closedBall 0 1) 0 (fun (u : E) => ‖u‖ ^ 2 / 2) μ x = huber μ x

        The Huber function is Nesterov's smoothing of the norm Nesterov, (6.1.43) (the display before it, Section 6.1.4.2, for the Euclidean norm on ℝⁿ): for μ > 0, sup_{‖u‖ ≤ 1} (⟪x, u⟫ - μ ‖u‖² / 2) = H_μ x, that is A = id, Q the unit ball, φ = 0 and d = ½ ‖·‖². Equivalently, (ι_{B(0, 1)} + ½ ‖·‖²)* is the generalized Huber function BC, Example 13.7, here scaled by μ.

        theorem ConvexAnalysis.huber_le_norm {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} (hμ : 0 < μ) (x : E) :

        The Huber function is below the norm, H_μ ≤ ‖·‖, from f_μ ≤ f ((6.1.16) in Nesterov, Section 6.1); Beck, Example 10.53.

        theorem ConvexAnalysis.norm_le_huber_add {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} (hμ : 0 < μ) (x : E) :
        ‖x‖ ≤ huber μ x + μ / 2

        The norm is at most H_μ + μ / 2, from f ≤ f_μ + μ D with D = 1 / 2 ((6.1.16) in Nesterov, Section 6.1): so H_μ is a μ⁻¹-smooth approximation of the norm with parameters (1, 1 / 2) in the sense of Beck, Definition 10.43, as in Beck, Example 10.53.

        The Huber function is convex (Nesterov, Theorem 6.1.1).

        theorem ConvexAnalysis.hasGradientAt_huber {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} [CompleteSpace E] (hμ : 0 < μ) (x : E) :

        The gradient of the Huber function is x / max ‖x‖ μ (Nesterov, Theorem 6.1.1, with the maximizer isMaxOn_huber; Beck, Example 6.62).

        theorem ConvexAnalysis.gradient_huber {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} [CompleteSpace E] (hμ : 0 < μ) (x : E) :

        The gradient of the Huber function.

        The gradient of the Huber function is μ⁻¹-Lipschitz (Nesterov, Theorem 6.1.1 with ‖id‖ ≤ 1 and σ = 1; Beck, Example 6.62).

        theorem ConvexAnalysis.moreauEnvelope_norm {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : ℝ} [CompleteSpace E] (hμ : 0 < μ) (x : E) :
        moreauEnvelope μ (fun (y : E) => ↑‖y‖) x = ↑(huber μ x)

        The Huber function is the Moreau envelope of the norm, H_μ = e_μ ‖·‖ Beck, Example 6.54; BC, Example 14.5 computes e₁ (ρ ‖·‖) = ρ H_ρ, which is μ e_μ ‖·‖ for ρ = μ. Here it is the case Q the unit ball, φ = 0 of moreauEnvelope_coe_nesterovSmoothing_zero.