Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 3.1 — obtuse-angle and Pythagorean inequalities for the projection

Proved
BubeckCO.PSGD.proj_inner_nonpos_and_pythag

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

convex-analysisconvex-optimizationprojection

Let X⊆RnX \subseteq \mathbb{R}^nX⊆Rn be compact and convex (the standing assumption of Chapter 3), ∥⋅∥\|\cdot\|∥⋅∥ the Euclidean norm and ΠX\Pi_XΠX​ the Euclidean projection onto XXX. For every x∈Xx \in Xx∈X and y∈Rny \in \mathbb{R}^ny∈Rn,

(ΠX(y)−x)⊤(ΠX(y)−y)≤0and∥ΠX(y)−x∥2+∥y−ΠX(y)∥2≤∥y−x∥2.(\Pi_X(y) - x)^\top (\Pi_X(y) - y) \le 0 \qquad\text{and}\qquad \|\Pi_X(y) - x\|^2 + \|y - \Pi_X(y)\|^2 \le \|y - x\|^2 .(ΠX​(y)−x)⊤(ΠX​(y)−y)≤0and∥ΠX​(y)−x∥2+∥y−ΠX​(y)∥2≤∥y−x∥2.

The second inequality says in particular that projecting onto XXX does not increase the distance to any point of XXX; this is the step of the analysis of projected subgradient descent that controls the projection (3.3).

Formalization Note ΠX(y)\Pi_X(y)ΠX​(y) is encoded as any point ppp with IsEuclideanProj X y p. Both clauses are stated, as a conjunction.

Differences from the source:

  • encoding: Π_X(y), the argmin of ‖y − z‖ over z ∈ X → any p with IsEuclideanProj X y p; reason: for non-empty closed convex X (here compact and convex) the argmin exists and is unique, so both describe the same point
Preamble
import Mathlib
import Definitions.Def_BubeckCO_PSGD_IsEuclideanProj
Formal statement
namespace BubeckCO.PSGD

/-- **Lemma 3.1 (projection inequalities).**
Bubeck, Convex Optimization: Algorithms and Complexity, Found. Trends Mach. Learn. 8(3-4), 2015,
p. 263 (PDF p. 36), Lemma 3.1: "Let `x ∈ X` and `y ∈ ℝⁿ`, then
`(Π_X(y) − x)ᵀ(Π_X(y) − y) ≤ 0`, which also implies
`‖Π_X(y) − x‖² + ‖y − Π_X(y)‖² ≤ ‖y − x‖²`."

Under the Chapter 3 standing assumption (`X ⊂ ℝⁿ` compact and convex, p. 262–263), for
`x ∈ X`, `y ∈ ℝⁿ` and `p = Π_X(y)`, both `⟪p − x, p − y⟫ ≤ 0` and
`‖p − x‖² + ‖y − p‖² ≤ ‖y − x‖²` hold.

**Formalization Note.** `ℝⁿ` is `EuclideanSpace ℝ (Fin n)` with the Euclidean norm. `Π_X(y)` is
encoded as any `p` with `IsEuclideanProj X y p`; for non-empty closed convex `X` this `p` exists
and is unique, so it is `Π_X(y)`. Both clauses of the lemma are stated, as a conjunction. -/
theorem proj_inner_nonpos_and_pythag {n : ℕ} (X : Set (EuclideanSpace ℝ (Fin n)))
    (hXcompact : IsCompact X) (hXconv : Convex ℝ X)
    (x : EuclideanSpace ℝ (Fin n)) (hx : x ∈ X) (y p : EuclideanSpace ℝ (Fin n))
    (hp : IsEuclideanProj X y p) :
    inner ℝ (p - x) (p - y) ≤ 0 ∧ ‖p - x‖ ^ 2 + ‖y - p‖ ^ 2 ≤ ‖y - x‖ ^ 2 := by sorry

end BubeckCO.PSGD
Source
Bubeck, Convex Optimization: Algorithms and Complexity, Found. Trends Mach. Learn. 8(3-4), 2015, p. 263 (PDF p. 36), Lemma 3.1

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