Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(1), p. 3 — dist²_K is C¹ with derivative 2(w − Π_K(w))

Proved
NCPSeqOpt.AugLag.eq_1_dist_sq_deriv

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

convex-analysisdistance-functionp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1projection

Let E\mathbb EE be a finite-dimensional real inner product space and K⊆E\mathcal K\subseteq\mathbb EK⊆E a nonempty closed convex cone. Write dist⁡K(w)=min⁡{∥w−v∥:v∈K}\operatorname{dist}_{\mathcal K}(w)=\min\{\|w-v\|:v\in\mathcal K\}distK​(w)=min{∥w−v∥:v∈K}. Then w↦dist⁡K2(w)w\mapsto\operatorname{dist}^2_{\mathcal K}(w)w↦distK2​(w) is continuously differentiable, and its gradient is

D(dist⁡K2)(w)=2(w−ΠK(w))for every w∈E.(1)D(\operatorname{dist}^2_{\mathcal K})(w)=2\big(w-\Pi_{\mathcal K}(w)\big)\qquad\text{for every }w\in\mathbb E. \tag{1}D(distK2​)(w)=2(w−ΠK​(w))for every w∈E.(1)

Formula (1) is what yields the derivative (20) of the augmented Lagrangian and the derivative of Ψ(x)=12∥ΠK∘(G(x))∥2\Psi(x)=\tfrac12\|\Pi_{\mathcal K^\circ}(G(x))\|^2Ψ(x)=21​∥ΠK∘​(G(x))∥2 used in Theorem 4.2.

Formalization Note dist⁡K\operatorname{dist}_{\mathcal K}distK​ is Mathlib's Metric.infDist, an infimum, which equals the page's minimum for a nonempty closed set. The derivative is stated as a gradient (HasGradientAt) at every point, together with ContDiff ℝ 1.

Preamble
import Mathlib
import Definitions.Def_MoreauProx_Decomposition_Cones
import Definitions.Def_NCPSeqOpt_AugLag_Setting
Formal statement
namespace NCPSeqOpt.AugLag

open MoreauProx.Decomposition
open scoped InnerProductSpace
open Filter Topology

theorem eq_1_dist_sq_deriv {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
    [FiniteDimensional ℝ E] (K : Set E) (hK : IsClosedConvexCone K) :
    ContDiff ℝ 1 (fun v => Metric.infDist v K ^ 2) ∧
      ∀ w : E, HasGradientAt (fun v => Metric.infDist v K ^ 2) ((2 : ℝ) • (w - proj K w)) w := by sorry

end NCPSeqOpt.AugLag
Source
Andreani, Gómez, Haeser, Mito & Ramos, On Optimality Conditions for Nonlinear Conic Programming, author's manuscript (revised 2021-04-20; Math. Oper. Res. doi:10.1287/moor.2021.1203), §2.1, (1), p. 3
Human review
  • Endorsed by Shuze Chen · Oct 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 23, 2026

    Confirmed by the mission captain (proposal self-audit).

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me