Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The class KKK of piecewise smooth functions, Gf(x)G_f(x)Gf​(x), Pˉδ,ε(x)\bar P_{\delta,\varepsilon}(x)Pˉδ,ε​(x) and runs of the rμ(α)r_\mu(\alpha)rμ​(α)-algorithm

Definition
ShorNonsmooth_RAlgorithm_RAlgorithm

by mikedeng1 · Oct 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

nonsmooth-optimizationp2o-batch-b23ap2o-gran-per-chapterp2o-plan-bookp2o-v1piecewise-smoothr-algorithmspace-dilation
  1. The class KKK. Let EnE_nEn​ be partitioned into mmm closed sets Dˉ1,…,Dˉm\bar D_1, \dots, \bar D_mDˉ1​,…,Dˉm​, each the closure of its interior DiD_iDi​, whose interiors DiD_iDi​ are mutually disjoint and each homeomorphic to an open ball or to an open halfspace. Let fif_ifi​ be continuous, continuously differentiable functions defined on open sets Di+⊃DˉiD_i^+ \supset \bar D_iDi+​⊃Dˉi​. A function fff belongs to KKK (is formed from the fif_ifi​ on the Dˉi\bar D_iDˉi​) if

    (a) f(x)=fi(x)f(x) = f_i(x)f(x)=fi​(x) for all x∈Dix \in D_ix∈Di​, and

    (b) f(x)=fi(x)=fj(x)f(x) = f_i(x) = f_j(x)f(x)=fi​(x)=fj​(x) for all x∈Dˉi∩Dˉjx \in \bar D_i \cap \bar D_jx∈Dˉi​∩Dˉj​.

    For such fff the set of almost-gradients at xxx is the set of gradients of the incident pieces,

Gf(x)={ ∇fi(x):x∈Dˉi },G_f(x) = \{\, \nabla f_i(x) : x \in \bar D_i \,\},Gf​(x)={∇fi​(x):x∈Dˉi​},

a single vector inside a piece and {∇fi1(x),…,∇fik(x)}\{\nabla f_{i_1}(x), \dots, \nabla f_{i_k}(x)\}{∇fi1​​(x),…,∇fik​​(x)} on a common boundary of pieces i1,…,iki_1, \dots, i_ki1​,…,ik​.

  1. The set Pˉδ,ε(x)\bar P_{\delta,\varepsilon}(x)Pˉδ,ε​(x). For δ,ε>0\delta, \varepsilon > 0δ,ε>0, Pˉδ,ε(x)\bar P_{\delta,\varepsilon}(x)Pˉδ,ε​(x) is the closed convex hull of
Pδ,ε(x)=(⋃y∈Sδ(x)Gf(y))∪(⋃z∈Gf(x)Sε(z)),P_{\delta,\varepsilon}(x) = \Big(\bigcup_{y \in S_\delta(x)} G_f(y)\Big) \cup \Big(\bigcup_{z \in G_f(x)} S_\varepsilon(z)\Big),Pδ,ε​(x)=(y∈Sδ​(x)⋃​Gf​(y))∪(z∈Gf​(x)⋃​Sε​(z)),

where Sr(c)S_r(c)Sr​(c) is the open ball of radius rrr centred at ccc.

  1. The rμ(α)r_\mu(\alpha)rμ​(α)-algorithm. Fix α>1\alpha > 1α>1, 0≤μ<10 \le \mu < 10≤μ<1 and β=1/α\beta = 1/\alphaβ=1/α. Start from any x0∈Enx_0 \in E_nx0​∈En​, g~0=0\tilde g_0 = 0g~​0​=0 and a nonsingular operator B0B_0B0​. On iteration k+1k + 1k+1 (k=0,1,…k = 0, 1, \dotsk=0,1,…), from xkx_kxk​, g~k\tilde g_kg~​k​, BkB_kBk​:

    (1) choose gf(xk)∈Gf(xk)g_f(x_k) \in G_f(x_k)gf​(xk​)∈Gf​(xk​) with (Bk∗gf(xk),g~k)≤μ∥Bk∗gf(xk)∥ ∥g~k∥(B_k^* g_f(x_k), \tilde g_k) \le \mu \|B_k^* g_f(x_k)\|\,\|\tilde g_k\|(Bk∗​gf​(xk​),g~​k​)≤μ∥Bk∗​gf​(xk​)∥∥g~​k​∥ and put gk∗=Bk∗gf(xk)g_k^* = B_k^* g_f(x_k)gk∗​=Bk∗​gf​(xk​);

    (2) rk=gk∗−g~kr_k = g_k^* - \tilde g_krk​=gk∗​−g~​k​ (required to be nonzero, so that (3) is defined);

    (3) ξk+1=rk/∥rk∥\xi_{k+1} = r_k / \|r_k\|ξk+1​=rk​/∥rk​∥;

    (4) Bk+1=BkRβ(ξk+1)B_{k+1} = B_k R_\beta(\xi_{k+1})Bk+1​=Bk​Rβ​(ξk+1​);

    (5) g~k+1=Rβ(ξk+1) gk∗\tilde g_{k+1} = R_\beta(\xi_{k+1})\, g_k^*g~​k+1​=Rβ​(ξk+1​)gk∗​;

    (6) xk+1=xk−hk+1Bk+1g~k+1x_{k+1} = x_k - h_{k+1} B_{k+1} \tilde g_{k+1}xk+1​=xk​−hk+1​Bk+1​g~​k+1​ (3.48), where hk+1≥0h_{k+1} \ge 0hk+1​≥0 is such that (a) ψ(h)=f(xk−hBk+1g~k+1)\psi(h) = f(x_k - h B_{k+1}\tilde g_{k+1})ψ(h)=f(xk​−hBk+1​g~​k+1​) is nonincreasing on [0,hk+1][0, h_{k+1}][0,hk+1​] and (b) some g∈Gf(xk+1)g \in G_f(x_{k+1})g∈Gf​(xk+1​) satisfies (Bk+1∗g,g~k+1)≤μ∥Bk+1∗g∥ ∥g~k+1∥(B_{k+1}^* g, \tilde g_{k+1}) \le \mu \|B_{k+1}^* g\|\,\|\tilde g_{k+1}\|(Bk+1∗​g,g~​k+1​)≤μ∥Bk+1∗​g∥∥g~​k+1​∥ (3.49).

    A run is any family of sequences xk,g~k,Bk,gf(xk),hk+1x_k, \tilde g_k, B_k, g_f(x_k), h_{k+1}xk​,g~​k​,Bk​,gf​(xk​),hk+1​ obeying these rules. The r(α)r(\alpha)r(α)-algorithm is the case μ=0\mu = 0μ=0.

The class KKK is the setting of the convergence theory of Section 3.7; the run predicate quantifies over every admissible choice of almost-gradients and stepsizes, not over one particular line search.

Formalization Note Bk∗B_k^*Bk∗​ is the adjoint ContinuousLinearMap.adjoint (B k), and B0B_0B0​ is nonsingular as a unit of the operator monoid. The book's step (b) supplies the almost-gradient used in step (1) of the next iteration, so it is encoded as the condition of step (1) at index k+1k + 1k+1. The book writes the segment [0;hk+1][0; h_{k+1}][0;hk+1​], so hk+1≥0h_{k+1} \ge 0hk+1​≥0 is required. Gf(x)G_f(x)Gf​(x) is taken relative to the chosen pieces (Dˉi,fi)(\bar D_i, f_i)(Dˉi​,fi​), as the book does on p. 79; theorems quantify over the representation together with fff.

Definition code
import Mathlib
import Definitions.Def_ShorNonsmooth_RAlgorithm_Widths

open scoped InnerProductSpace

namespace ShorNonsmooth.RAlgorithm

/-- Shor (1985), p. 79: the data from which a function of the **class `K`** is formed.
A partition of `E_n` into `m` closed sets `D̄₁, …, D̄_m` (`D i`), each the closure of its
interior `D_i`, whose interiors `D_i` are homeomorphic to an open ball ("open sphere") or to an open halfspace and are mutually disjoint,
together with continuous, continuously differentiable functions `f_i` (`fi i`) defined on open
sets `D_i⁺ ⊃ D̄_i` (`U i`). The values of `fi i` outside `U i` play no role. -/
structure KRep (n : ℕ) where
  /-- the number `m` of pieces -/
  m : ℕ
  /-- the closed pieces `D̄_i` -/
  D : Fin m → Set (EuclideanSpace ℝ (Fin n))
  isClosed_D : ∀ i, IsClosed (D i)
  /-- `D̄_i` is the closure of its interior `D_i` (the book's bar notation) -/
  closure_interior_D : ∀ i, closure (interior (D i)) = D i
  /-- the pieces cover `E_n` -/
  iUnion_D : (⋃ i, D i) = Set.univ
  /-- the interiors `D_i` are mutually disjoint -/
  disjoint_interior : Pairwise fun i j => Disjoint (interior (D i)) (interior (D j))
  /-- each interior `D_i` is homeomorphic to an open ball or to an open halfspace -/
  interior_homeomorph : ∀ i,
    Nonempty (interior (D i) ≃ₜ Metric.ball (0 : EuclideanSpace ℝ (Fin n)) 1) ∨
      ∃ a : EuclideanSpace ℝ (Fin n), a ≠ 0 ∧
        Nonempty (interior (D i) ≃ₜ {x : EuclideanSpace ℝ (Fin n) | 0 < ⟪a, x⟫_ℝ})
  /-- the smooth pieces `f_i` -/
  fi : Fin m → EuclideanSpace ℝ (Fin n) → ℝ
  /-- the open domains `D_i⁺` of the `f_i` -/
  U : Fin m → Set (EuclideanSpace ℝ (Fin n))
  isOpen_U : ∀ i, IsOpen (U i)
  D_subset_U : ∀ i, D i ⊆ U i
  /-- `f_i` is continuous and continuously differentiable on `D_i⁺` -/
  contDiffOn_fi : ∀ i, ContDiffOn ℝ 1 (fi i) (U i)

namespace KRep

variable {n : ℕ}

/-- Shor (1985), p. 79: `f ∈ K` is formed from the functions `f_i` on `D̄_i`:
(a) `f(x) = f_i(x)` for all `x ∈ D_i`, (b) `f(x) = f_i(x) = f_j(x)` for all `x ∈ D̄_i ∩ D̄_j`. -/
def Forms (P : KRep n) (f : EuclideanSpace ℝ (Fin n) → ℝ) : Prop :=
  (∀ i, ∀ x ∈ interior (P.D i), f x = P.fi i x) ∧
    (∀ i j, ∀ x ∈ P.D i ∩ P.D j, f x = P.fi i x ∧ f x = P.fi j x)

/-- Shor (1985), p. 79: for `f ∈ K`, the set of almost-gradients `G_f(x)` consists of the gradients
`g_{f_i}(x)` of the pieces `f_i` with `x ∈ D̄_i` (one gradient in the interior of a piece,
`{g_{f_{i₁}}(x), …, g_{f_{i_k}}(x)}` on a common boundary of pieces `i₁, …, i_k`). -/
def Gf (P : KRep n) (x : EuclideanSpace ℝ (Fin n)) : Set (EuclideanSpace ℝ (Fin n)) :=
  {g | ∃ i, x ∈ P.D i ∧ g = gradient (P.fi i) x}

/-- Shor (1985), p. 82: `P̄_{δ,ε}(x)`, the convex closure of
`P_{δ,ε}(x) = (⋃_{y ∈ S_δ(x)} G_f(y)) ∪ (⋃_{z ∈ G_f(x)} S_ε(z))`, with `S_r(c)` the open ball of
radius `r` centred at `c`. -/
noncomputable def Pbar (P : KRep n) (δ ε : ℝ) (x : EuclideanSpace ℝ (Fin n)) :
    Set (EuclideanSpace ℝ (Fin n)) :=
  closedConvexHull ℝ ((⋃ y ∈ Metric.ball x δ, P.Gf y) ∪ (⋃ z ∈ P.Gf x, Metric.ball z ε))

end KRep

/-- The unit vector `v / ‖v‖`. -/
noncomputable def unitDir {n : ℕ} (v : EuclideanSpace ℝ (Fin n)) : EuclideanSpace ℝ (Fin n) :=
  ‖v‖⁻¹ • v

/-- Shor (1985), p. 78, steps (1)–(7): the sequences `x_k`, `g̃_k`, `B_k`, the almost-gradients
`g_k = g_f(x_k)` chosen in step (1), and the stepsizes `h_{k+1}` form a run of the
**`r_μ(α)`-algorithm** applied to `f ∈ K` (formed from `P`). With `β = 1/α`, `A_k = B_k⁻¹`:

* `g̃₀ = 0` and `B₀` is nonsingular (`x₀` arbitrary);
* (1) `g_k ∈ G_f(x_k)` with `(B_k* g_k, g̃_k) ≤ μ ‖B_k* g_k‖ ‖g̃_k‖`, and `g_k* = B_k* g_k`;
* (2) `r_k = g_k* - g̃_k`, which must be nonzero for (3) to be defined;
* (3) `ξ_{k+1} = r_k / ‖r_k‖`;
* (4) `B_{k+1} = B_k R_β(ξ_{k+1})`;
* (5) `g̃_{k+1} = R_β(ξ_{k+1}) g_k*`;
* (6) `x_{k+1} = x_k - h_{k+1} B_{k+1} g̃_{k+1}` (3.48) with `h_{k+1} ≥ 0` such that
  (a) `ψ(h) = f(x_k - h B_{k+1} g̃_{k+1})` is nonincreasing on `[0, h_{k+1}]`, and
  (b) some `g ∈ G_f(x_{k+1})` satisfies (3.49); the book uses that `g` in step (1) of the next
  iteration, so (b) is the condition of step (1) at index `k + 1` and is encoded by `g_mem`,
  `g_angle` there.

The adjoint `B_k*` is `ContinuousLinearMap.adjoint (B k)`. -/
structure IsRun {n : ℕ} (P : KRep n) (f : EuclideanSpace ℝ (Fin n) → ℝ) (α μ : ℝ)
    (x gt g : ℕ → EuclideanSpace ℝ (Fin n))
    (B : ℕ → EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) (h : ℕ → ℝ) : Prop where
  gt_zero : gt 0 = 0
  isUnit_B_zero : IsUnit (B 0)
  g_mem : ∀ k, g k ∈ P.Gf (x k)
  g_angle : ∀ k, ⟪ContinuousLinearMap.adjoint (B k) (g k), gt k⟫_ℝ ≤
    μ * ‖ContinuousLinearMap.adjoint (B k) (g k)‖ * ‖gt k‖
  r_ne_zero : ∀ k, ContinuousLinearMap.adjoint (B k) (g k) - gt k ≠ 0
  B_succ : ∀ k, B (k + 1) =
    (B k).comp (dilation (1 / α) (unitDir (ContinuousLinearMap.adjoint (B k) (g k) - gt k)))
  gt_succ : ∀ k, gt (k + 1) =
    dilation (1 / α) (unitDir (ContinuousLinearMap.adjoint (B k) (g k) - gt k))
      (ContinuousLinearMap.adjoint (B k) (g k))
  h_nonneg : ∀ k, 0 ≤ h (k + 1)
  x_succ : ∀ k, x (k + 1) = x k - h (k + 1) • B (k + 1) (gt (k + 1))
  antitoneOn_step : ∀ k,
    AntitoneOn (fun t : ℝ => f (x k - t • B (k + 1) (gt (k + 1)))) (Set.Icc 0 (h (k + 1)))

end ShorNonsmooth.RAlgorithm
Source
Shor, Minimization Methods for Non-Differentiable Functions, Springer 1985, p. 78, the rμ(α)r_\mu(\alpha)rμ​(α)-algorithm, steps (1)–(7), (3.48)–(3.49); p. 79, the class KKK and Gf(x)G_f(x)Gf​(x) for f∈Kf \in Kf∈K; p. 82, Pˉδ,ε(x)\bar P_{\delta,\varepsilon}(x)Pˉδ,ε​(x) and the r(α)r(\alpha)r(α)-algorithm (μ=0\mu = 0μ=0)

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me