Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 8 — generalized projections onto a convex set do not increase A-distances to points of the set

Proved
LogRegretOCO.ONS.gen_proj_ineq

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

convex-analysisgeneralized-projectionp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let P⊆Rn\mathcal P\subseteq\mathbb R^nP⊆Rn be convex, let AAA be a positive semidefinite n×nn\times nn×n matrix, let y∈Rny\in\mathbb R^ny∈Rn, and let z=ΠPA(y)z=\Pi^{A}_{\mathcal P}(y)z=ΠPA​(y) be a generalized projection of yyy onto P\mathcal PP with respect to AAA, i.e. z∈Pz\in\mathcal Pz∈P minimises (y−x)⊤A(y−x)(y-x)^\top A(y-x)(y−x)⊤A(y−x) over x∈Px\in\mathcal Px∈P. Then for every a∈Pa\in\mathcal Pa∈P,

(y−a)⊤A (y−a) ≥ (z−a)⊤A (z−a).(y-a)^\top A\,(y-a)\ \ge\ (z-a)^\top A\,(z-a).(y−a)⊤A(y−a) ≥ (z−a)⊤A(z−a).

This is the generalized Pythagorean inequality; in the analysis of the Online Newton Step it shows that the projection step can only decrease the AtA_tAt​-distance to the comparator.

Formalization Note "Positive semidefinite" is Mathlib's Matrix.PosSemidef (symmetric with nonnegative quadratic form). The paper's display defines ΠPA[y]\Pi^A_{\mathcal P}[y]ΠPA​[y] with "min"; it means the minimising point (argmin), which is what the predicate encodes. No existence or uniqueness of the projection is assumed: the conclusion holds for every minimiser.

Preamble
import Mathlib
import Definitions.Def_LogRegretOCO_ONS_Basic
Formal statement
namespace LogRegretOCO.ONS

/-- Lemma 8 (folklore; Hazan–Agarwal–Kale 2007, p. 188). Let `P ⊆ ℝⁿ` be convex, `A` positive
semidefinite, `y ∈ ℝⁿ`, and `z` a generalized projection of `y` onto `P` with respect to `A`.
Then `(y − a)ᵀ A (y − a) ≥ (z − a)ᵀ A (z − a)` for every `a ∈ P`. -/
theorem gen_proj_ineq {n : ℕ} (P : Set (EuclideanSpace ℝ (Fin n))) (hP : Convex ℝ P)
    (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosSemidef)
    (y z : EuclideanSpace ℝ (Fin n)) (hz : IsGenProj P A y z) :
    ∀ a ∈ P, quadForm A (z - a) ≤ quadForm A (y - a) := by sorry

end LogRegretOCO.ONS
Source
Hazan, Agarwal, Kale, Logarithmic regret algorithms for online convex optimization, Mach Learn 69 (2007), p. 188, Lemma 8
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let n∈Nn\in\mathbb{N}n∈N and let P⊆RnP\subseteq\mathbb{R}^nP⊆Rn be convex. Let AAA be a real n×nn\times nn×n matrix that is positive semidefinite, meaning both:

  • AAA is symmetric;
  • v⊤Av≥0v^\top A v\ge 0v⊤Av≥0 for all vvv.

Let y,z∈Rny,z\in\mathbb{R}^ny,z∈Rn.

Hypothesis. zzz is a generalized projection of yyy onto PPP with respect to AAA. That is:

  • z∈Pz\in Pz∈P;
  • (y−z)⊤A(y−z)≤(y−w)⊤A(y−w)(y-z)^\top A(y-z)\le (y-w)^\top A(y-w)(y−z)⊤A(y−z)≤(y−w)⊤A(y−w) for every w∈Pw\in Pw∈P.

Conclusion. For every a∈Pa\in Pa∈P,

(z−a)⊤A (z−a)  ≤  (y−a)⊤A (y−a).(z-a)^\top A\,(z-a)\;\le\;(y-a)^\top A\,(y-a).(z−a)⊤A(z−a)≤(y−a)⊤A(y−a).

Assumptions not made: closedness or boundedness of PPP is not assumed. The existence of the minimizer zzz is itself a hypothesis.

Degenerate cases:

  • PPP empty: the projection hypothesis cannot hold, so the statement is vacuous.
  • y∈Py\in Py∈P: then zzz attains (y−z)⊤A(y−z)≤0(y-z)^\top A (y-z)\le 0(y−z)⊤A(y−z)≤0. With a=ya=ya=y the conclusion says (z−y)⊤A(z−y)≤0(z-y)^\top A(z-y)\le 0(z−y)⊤A(z−y)≤0.
  • A=0A=0A=0:
    • every point of PPP is a generalized projection;
    • the conclusion is 0≤00\le 00≤0.
  • n=0n=0n=0: both sides are 000.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me