Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Sect. 2 (p. 5) — τ\tauτ is the root of f(ρ)=∑nmax⁡{yn−ρ,0}−af(\rho)=\sum_n \max\{y_n-\rho,0\}-af(ρ)=∑n​max{yn​−ρ,0}−a; sign test and bracket

Proved
SimplexProj.Condat.threshold_root_bracket

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

projectionroot-findingsimplex

Let N≥1N \ge 1N≥1, a>0a > 0a>0, y∈RNy \in \mathbb{R}^Ny∈RN, let x=PΔ(y)x = P_\Delta(y)x=PΔ​(y) be the Euclidean projection of yyy onto the simplex of radius aaa, and let τ\tauτ be the threshold of Proposition 2.2, so xn=max⁡{yn−τ,0}x_n = \max\{y_n - \tau, 0\}xn​=max{yn​−τ,0} for all nnn. Let ymax⁡y_{\max}ymax​ and ymin⁡y_{\min}ymin​ be the largest and smallest entries of yyy and define

f(ρ):=∑n=1Nmax⁡{yn−ρ,0}−a(ρ∈R).f(\rho) := \sum_{n=1}^N \max\{y_n - \rho, 0\} - a \qquad (\rho \in \mathbb{R}).f(ρ):=n=1∑N​max{yn​−ρ,0}−a(ρ∈R).

Then: f(τ)=0f(\tau) = 0f(τ)=0; fff is convex; fff is piecewise linear with breakpoints at the yny_nyn​ (it is affine on every closed interval [ρ1,ρ2][\rho_1, \rho_2][ρ1​,ρ2​] whose interior contains no yny_nyn​); fff is strictly decreasing on (−∞,ymax⁡](-\infty, y_{\max}](−∞,ymax​] and f(ρ)=−af(\rho) = -af(ρ)=−a for every ρ≥ymax⁡\rho \ge y_{\max}ρ≥ymax​; for every ρ\rhoρ, f(ρ)<0f(\rho) < 0f(ρ)<0 implies ρ>τ\rho > \tauρ>τ and f(ρ)>0f(\rho) > 0f(ρ)>0 implies ρ<τ\rho < \tauρ<τ; f(ymin⁡−a/N)≥0f(y_{\min} - a/N) \ge 0f(ymin​−a/N)≥0, f(ymax⁡−a/N)≤0f(y_{\max} - a/N) \le 0f(ymax​−a/N)≤0 and f(ymax⁡−a)≥0f(y_{\max} - a) \ge 0f(ymax​−a)≥0; and consequently

max⁡{ymax⁡−a, ymin⁡−a/N}≤τ≤ymax⁡−a/N.\max\{y_{\max} - a,\ y_{\min} - a/N\} \le \tau \le y_{\max} - a/N.max{ymax​−a, ymin​−a/N}≤τ≤ymax​−a/N.

These are the properties Condat lists in Sect. 2 when viewing the search for τ\tauτ as root finding; the sign test is what lets an algorithm discard entries on one side of a trial value ρ\rhoρ.

Formalization Note. fff, ymax⁡y_{\max}ymax​ and ymin⁡y_{\min}ymin​ are given as variables pinned by the hypotheses hf, IsGreatest (Set.range y) ymax and IsLeast (Set.range y) ymin. "Piecewise linear with breakpoints at the yny_nyn​" is rendered as: fff is affine on every interval [ρ1,ρ2][\rho_1, \rho_2][ρ1​,ρ2​] with no yny_nyn​ in (ρ1,ρ2)(\rho_1, \rho_2)(ρ1​,ρ2​).

Preamble
import Mathlib
import Definitions.Def_SimplexProj_Condat_IsSimplexProjection
Formal statement
namespace SimplexProj.Condat

/-- Condat, Sect. 2, p. 5: with `f ρ = ∑ₙ max {y_n - ρ, 0} - a` and `τ` the threshold of
Proposition 2.2 (`x = P_Δ(y)`, `x_n = max {y_n - τ, 0}`): `τ` is a root of `f`; `f` is convex,
piecewise linear with breakpoints at the `y_n` (affine on every closed interval whose interior
contains no `y_n`), strictly decreasing on `(-∞, y_max]` and equal to `-a` on `[y_max, +∞)`;
`f ρ < 0 → ρ > τ` and `f ρ > 0 → ρ < τ`; `f (y_min - a/N) ≥ 0`, `f (y_max - a/N) ≤ 0`,
`f (y_max - a) ≥ 0`; hence `τ ∈ [max {y_max - a, y_min - a/N}, y_max - a/N]`.
Standing assumptions of p. 1: `N ≥ 1`, `a > 0`. -/
theorem threshold_root_bracket (N : ℕ) (hN : 1 ≤ N) (a : ℝ) (ha : 0 < a)
    (y x : Fin N → ℝ) (hx : IsSimplexProjection a y x)
    (τ : ℝ) (hτ : ∀ n, x n = max (y n - τ) 0)
    (f : ℝ → ℝ) (hf : ∀ ρ, f ρ = ∑ n, max (y n - ρ) 0 - a)
    (ymax ymin : ℝ) (hmax : IsGreatest (Set.range y) ymax) (hmin : IsLeast (Set.range y) ymin) :
    f τ = 0 ∧
    ConvexOn ℝ Set.univ f ∧
    (∀ ρ₁ ρ₂ : ℝ, ρ₁ ≤ ρ₂ → (∀ n, y n ∉ Set.Ioo ρ₁ ρ₂) →
      ∃ c d : ℝ, ∀ ρ ∈ Set.Icc ρ₁ ρ₂, f ρ = c * ρ + d) ∧
    StrictAntiOn f (Set.Iic ymax) ∧
    (∀ ρ ∈ Set.Ici ymax, f ρ = -a) ∧
    (∀ ρ : ℝ, f ρ < 0 → τ < ρ) ∧
    (∀ ρ : ℝ, 0 < f ρ → ρ < τ) ∧
    0 ≤ f (ymin - a / N) ∧ f (ymax - a / N) ≤ 0 ∧ 0 ≤ f (ymax - a) ∧
    max (ymax - a) (ymin - a / N) ≤ τ ∧ τ ≤ ymax - a / N := by sorry

end SimplexProj.Condat
Source
Condat, Fast Projection onto the Simplex and the ℓ1 Ball, HAL hal-01056171v2, p. 5, Sect. 2
Read-back

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

The theorem has these hypotheses:

  • NNN is a natural number with N≥1N \ge 1N≥1.
  • aaa is a real number with a>0a > 0a>0.
  • yyy and xxx are vectors in RN\mathbb{R}^NRN (real-valued functions on {0,…,N−1}\{0,\dots,N-1\}{0,…,N−1}).
  • xxx is a simplex projection of yyy with radius aaa. This means ∑nxn=a\sum_n x_n = a∑n​xn​=a, every xn≥0x_n \ge 0xn​≥0, and ∑n(xn−yn)2≤∑n(zn−yn)2\sum_n (x_n - y_n)^2 \le \sum_n (z_n - y_n)^2∑n​(xn​−yn​)2≤∑n​(zn​−yn​)2 for every zzz with ∑nzn=a\sum_n z_n = a∑n​zn​=a and all zn≥0z_n \ge 0zn​≥0.
  • τ\tauτ is a real number with xn=max⁡{yn−τ,0}x_n = \max\{y_n - \tau, 0\}xn​=max{yn​−τ,0} for every nnn.
  • f:R→Rf : \mathbb{R} \to \mathbb{R}f:R→R is a function satisfying, for every real ρ\rhoρ,
f(ρ)=(∑nmax⁡{yn−ρ, 0})−a.f(\rho) = \Big(\sum_{n} \max\{y_n - \rho,\ 0\}\Big) - a .f(ρ)=(n∑​max{yn​−ρ, 0})−a.
  • ymax⁡y_{\max}ymax​ is the greatest value among the entries of yyy: it equals some yny_nyn​, and every yn≤ymax⁡y_n \le y_{\max}yn​≤ymax​.
  • ymin⁡y_{\min}ymin​ is the least value among the entries of yyy: it equals some yny_nyn​, and every yn≥ymin⁡y_n \ge y_{\min}yn​≥ymin​.

In the conclusion, a/Na/Na/N divides by NNN viewed as a real number. The theorem concludes all twelve of the following:

  1. f(τ)=0f(\tau) = 0f(τ)=0.
  2. fff is convex on all of R\mathbb{R}R.
  3. For all reals ρ1≤ρ2\rho_1 \le \rho_2ρ1​≤ρ2​ such that no entry yny_nyn​ lies in the open interval (ρ1,ρ2)(\rho_1, \rho_2)(ρ1​,ρ2​), there are reals c,dc, dc,d with f(ρ)=cρ+df(\rho) = c\rho + df(ρ)=cρ+d for every ρ∈[ρ1,ρ2]\rho \in [\rho_1, \rho_2]ρ∈[ρ1​,ρ2​].
  4. fff is strictly decreasing on (−∞,ymax⁡](-\infty, y_{\max}](−∞,ymax​]: if ρ<ρ′≤ymax⁡\rho < \rho' \le y_{\max}ρ<ρ′≤ymax​, then f(ρ)>f(ρ′)f(\rho) > f(\rho')f(ρ)>f(ρ′).
  5. f(ρ)=−af(\rho) = -af(ρ)=−a for every ρ≥ymax⁡\rho \ge y_{\max}ρ≥ymax​.
  6. For every real ρ\rhoρ: if f(ρ)<0f(\rho) < 0f(ρ)<0, then τ<ρ\tau < \rhoτ<ρ.
  7. For every real ρ\rhoρ: if f(ρ)>0f(\rho) > 0f(ρ)>0, then ρ<τ\rho < \tauρ<τ.
  8. f(ymin⁡−a/N)≥0f(y_{\min} - a/N) \ge 0f(ymin​−a/N)≥0.
  9. f(ymax⁡−a/N)≤0f(y_{\max} - a/N) \le 0f(ymax​−a/N)≤0.
  10. f(ymax⁡−a)≥0f(y_{\max} - a) \ge 0f(ymax​−a)≥0.
  11. max⁡{ymax⁡−a, ymin⁡−a/N}≤τ\max\{y_{\max} - a,\ y_{\min} - a/N\} \le \taumax{ymax​−a, ymin​−a/N}≤τ.
  12. τ≤ymax⁡−a/N\tau \le y_{\max} - a/Nτ≤ymax​−a/N.

Degenerate cases:

  • N≥1N \ge 1N≥1, so a/Na/Na/N never divides by zero, and ymax⁡y_{\max}ymax​ and ymin⁡y_{\min}ymin​ are entries of yyy.
  • In item 3, the case ρ1=ρ2\rho_1 = \rho_2ρ1​=ρ2​ is allowed; there the interval is a single point and the claim is immediate.
  • When N=1N = 1N=1, ymax⁡=ymin⁡=y0y_{\max} = y_{\min} = y_0ymax​=ymin​=y0​, and a/N=aa/N = aa/N=a, so the bounds in items 11–12 read y0−a≤τ≤y0−ay_0 - a \le \tau \le y_0 - ay0​−a≤τ≤y0​−a.
Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 21, 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