Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2, Eq. (2) — dual form of the ECE as a supremum over sign tests

Proved
CalibratedMA.Randomized.eq_2

by mikedeng1 · Nov 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

calibrationp2o-batch-stoc27ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let D\mathcal DD be a distribution on X×[0,1]\mathcal X\times[0,1]X×[0,1] and QQQ a randomized predictor, with realized prediction P∼QXP\sim Q_XP∼QX​. Then

ECE(Q)=sup⁡h:[0,1]→{−1,1}E[h(P)(Y−P)],(2)\mathrm{ECE}(Q)=\sup_{h:[0,1]\to\{-1,1\}}\mathbb E[h(P)(Y-P)],\tag{2}ECE(Q)=h:[0,1]→{−1,1}sup​E[h(P)(Y−P)],(2)

where hhh ranges over sign-valued one-dimensional tests of the prediction value.

The dual form turns calibration into a family of test residuals. Theorem 4.1 uses it with the finitely many sign tests on the support of the rounded predictor.

Formalization Note. The supremum is stated with IsLUB over measurable h:R→{−1,1}h:\mathbb R\to\{-1,1\}h:R→{−1,1}. P∈[0,1]P\in[0,1]P∈[0,1] almost surely, so only the values of hhh on [0,1][0,1][0,1] matter.

Differences from the source:

  • encoding: h:[0,1]→{−1,1}h:[0,1]\to\{-1,1\}h:[0,1]→{−1,1} arbitrary → h:R→{−1,1}h:\mathbb R\to\{-1,1\}h:R→{−1,1} measurable; reason: E[h(P)(Y−P)]\mathbb E[h(P)(Y-P)]E[h(P)(Y−P)] is undefined for non-measurable hhh, and the maximizer sign(E[Y−P∣P])\mathrm{sign}(\mathbb E[Y-P\mid P])sign(E[Y−P∣P]) is a measurable function of PPP, so the supremum is unchanged.
  • encoding: sup⁡\supsup → IsLUB; reason: same value, without the junk value of a real supremum.
  • encoding: a distribution on X × [0,1] and a randomized predictor → a probability measure D on X × ℝ with Y ∈ [0,1] almost surely and IsRandomizedPredictor Q; reason: the support and measurability conditions give the same joint law and finite expectations.
Preamble
import Mathlib
import Definitions.Def_CalibratedMA_Randomized_Setting

open MeasureTheory
Formal statement
namespace CalibratedMA.Randomized

/-- Section 2, Eq. (2) (p. 12): the expected calibration error is the supremum of the
sign-test residuals `E[h(P)(Y − P)]` over (measurable) `h : [0,1] → {−1, 1}`. -/
theorem eq_2 {X : Type*} [MeasurableSpace X] (D : Measure (X × ℝ)) [IsProbabilityMeasure D]
    (hD : ∀ᵐ z ∂D, z.2 ∈ Set.Icc (0 : ℝ) 1) (Q : X → Measure ℝ)
    (hQ : IsRandomizedPredictor Q) :
    IsLUB {v : ℝ | ∃ h : ℝ → ℝ, Measurable h ∧ (∀ p, h p = 1 ∨ h p = -1) ∧
        v = ∫ w, h w.2.2 * (w.2.1 - w.2.2) ∂(jointLaw D Q)} (ECE D Q) := by sorry

end CalibratedMA.Randomized
Source
Jiuyao Lu, Georgy Noarov, Aaron Roth, Calibrated Multiaccuracy: Deterministic and Randomized Sample Complexity, STOC 2027 submission #900 (October 2026), p. 12, Section 2, Eq. (2)
Human review
  • Endorsed by Shuze Chen · Nov 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Nov 10, 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