Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 1 (p. 45): decomposition of Dt(x,y)D_t(x,y)Dt​(x,y) into a forecast term and a calibration error

Proved
CalibratedCE.Convergence.empDist_decomposition

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

calibrationempirical-distributionp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let player 1 issue forecasts f(s)f(s)f(s) (vectors in Rn\mathbb{R}^nRn) and play x(s)=R1(f(s))x(s) = R_1(f(s))x(s)=R1​(f(s)) in round sss, for some function R1R_1R1​ from forecasts to S(1)S(1)S(1), and let y(s)∈S(2)y(s) \in S(2)y(s)∈S(2) be player 2's plays. Fix t∈Nt \in \mathbb{N}t∈N, a∈S(1)a \in S(1)a∈S(1), b∈S(2)b \in S(2)b∈S(2), and let Pt(a)P_t(a)Pt​(a) be the set of forecasts issued in the first ttt rounds at which player 1 plays aaa, i.e. the forecasts in Mp(a)M_p(a)Mp​(a) actually used. With N(p,t)N(p, t)N(p,t) and ρ(p,b,t)\rho(p, b, t)ρ(p,b,t) as in the definition of calibration,

Dt(a,b)=t−1∑p∈Pt(a)∣{r<t:f(r)=p, y(r)=b}∣=t−1∑p∈Pt(a)ρ(p,b,t) N(p,t)=t−1∑p∈Pt(a)pb N(p,t)+t−1∑p∈Pt(a)(ρ(p,b,t)−pb)N(p,t).\begin{aligned} D_t(a, b) &= t^{-1} \sum_{p \in P_t(a)} |\{ r < t : f(r) = p,\ y(r) = b \}| \\ &= t^{-1} \sum_{p \in P_t(a)} \rho(p, b, t)\, N(p, t) \\ &= t^{-1} \sum_{p \in P_t(a)} p_b\, N(p, t) + t^{-1} \sum_{p \in P_t(a)} \big(\rho(p, b, t) - p_b\big) N(p, t). \end{aligned}Dt​(a,b)​=t−1p∈Pt​(a)∑​∣{r<t:f(r)=p, y(r)=b}∣=t−1p∈Pt​(a)∑​ρ(p,b,t)N(p,t)=t−1p∈Pt​(a)∑​pb​N(p,t)+t−1p∈Pt​(a)∑​(ρ(p,b,t)−pb​)N(p,t).​

The first term is what the forecasts predict; the second is controlled by calibration. The identity needs no calibration or best-reply hypothesis.

Formalization Note The paper writes the sums over p∈Mp(x)p \in M_p(x)p∈Mp​(x); only the issued forecasts contribute, so the sums run over them. At t=0t = 0t=0 both sides are 000 by the convention 0−1=00^{-1} = 00−1=0. The paper's first display line, the sum of χ(y,r)\chi(y, r)χ(y,r) over rounds with f(r)∈Mp(x)f(r) \in M_p(x)f(r)∈Mp​(x), is the definition of DtD_tDt​ and is not restated.

Preamble
import Mathlib
import Definitions.Def_CalibratedCE_Shared_Calibration
import Definitions.Def_CalibratedCE_Convergence_EmpDist
Formal statement
namespace CalibratedCE.Convergence

/-- Proof of Theorem 1, p. 45, the decomposition display: when player 1 plays `R₁ (f₁ s)` in
round `s`, the empirical frequency of `(a, b)` splits into a forecast-weighted main term and a
calibration error term. The sums run over the forecasts issued in the first `t` rounds at
which player 1 plays `a`. -/
theorem empDist_decomposition {m n : ℕ} (R₁ : (Fin n → ℝ) → Fin m) (f₁ : ℕ → Fin n → ℝ)
    (y : ℕ → Fin n) (t : ℕ) (a : Fin m) (b : Fin n) :
    empDist (fun s => R₁ (f₁ s)) y t a b =
        (t : ℝ)⁻¹ * ∑ p ∈ ((Finset.range t).image f₁).filter (fun p => R₁ p = a),
          (((Finset.range t).filter (fun r => f₁ r = p ∧ y r = b)).card : ℝ) ∧
    empDist (fun s => R₁ (f₁ s)) y t a b =
        (t : ℝ)⁻¹ * ∑ p ∈ ((Finset.range t).image f₁).filter (fun p => R₁ p = a),
          Shared.rho f₁ y p b t * (Shared.N f₁ p t : ℝ) ∧
    empDist (fun s => R₁ (f₁ s)) y t a b =
        (t : ℝ)⁻¹ * ∑ p ∈ ((Finset.range t).image f₁).filter (fun p => R₁ p = a),
          p b * (Shared.N f₁ p t : ℝ) +
        (t : ℝ)⁻¹ * ∑ p ∈ ((Finset.range t).image f₁).filter (fun p => R₁ p = a),
          (Shared.rho f₁ y p b t - p b) * (Shared.N f₁ p t : ℝ) := by sorry

end CalibratedCE.Convergence
Source
Foster and Vohra, Calibrated learning and correlated equilibrium, Games Econ. Behav. 21 (1997), p. 45, proof of Theorem 1 (display)
Read-back

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

The inputs are all arbitrary; none of them is assumed to satisfy a best-reply or distribution condition:

  • natural numbers m,nm,nm,n;
  • a function R1:Rn→[m]R_1:\mathbb{R}^n\to[m]R1​:Rn→[m];
  • a sequence of vectors f1(0),f1(1),⋯∈Rnf_1(0),f_1(1),\dots\in\mathbb{R}^nf1​(0),f1​(1),⋯∈Rn (forecasts, not assumed to be probability vectors);
  • a sequence y0,y1,…y_0,y_1,\dotsy0​,y1​,… in [n][n][n];
  • a time t∈Nt\in\mathbb{N}t∈N;
  • a pair a∈[m]a\in[m]a∈[m], b∈[n]b\in[n]b∈[n].

Notation used below:

  • Player 1's play is xs=R1(f1(s))x_s=R_1(f_1(s))xs​=R1​(f1​(s)).
  • Dt(a,b)=#{s<t:xs=a, ys=b}/tD_t(a,b)=\#\{s<t:x_s=a,\ y_s=b\}/tDt​(a,b)=#{s<t:xs​=a, ys​=b}/t is the empirical frequency (defined as 000 when t=0t=0t=0).
  • Pt(a)P_t(a)Pt​(a) is the finite set of distinct vectors among f1(0),…,f1(t−1)f_1(0),\dots,f_1(t-1)f1​(0),…,f1​(t−1) that R1R_1R1​ maps to aaa.
  • N(p,t)N(p,t)N(p,t) and ρ(p,b,t)\rho(p,b,t)ρ(p,b,t) are two quantities defined in a separate shared calibration module whose definitions are not included in this code. Both are treated as real numbers and depend on the forecast sequence f1f_1f1​ (and, for ρ\rhoρ, on yyy). This read-back cannot unfold them.

The theorem asserts three equalities simultaneously:

Dt(a,b)=1t∑p∈Pt(a)#{r<t:f1(r)=p, yr=b},D_t(a,b)=\frac1t\sum_{p\in P_t(a)}\#\{r<t: f_1(r)=p,\ y_r=b\},Dt​(a,b)=t1​p∈Pt​(a)∑​#{r<t:f1​(r)=p, yr​=b}, Dt(a,b)=1t∑p∈Pt(a)ρ(p,b,t) N(p,t),D_t(a,b)=\frac1t\sum_{p\in P_t(a)}\rho(p,b,t)\,N(p,t),Dt​(a,b)=t1​p∈Pt​(a)∑​ρ(p,b,t)N(p,t), Dt(a,b)=1t∑p∈Pt(a)pb N(p,t)  +  1t∑p∈Pt(a)(ρ(p,b,t)−pb) N(p,t).D_t(a,b)=\frac1t\sum_{p\in P_t(a)}p_b\,N(p,t)\;+\;\frac1t\sum_{p\in P_t(a)}\big(\rho(p,b,t)-p_b\big)\,N(p,t).Dt​(a,b)=t1​p∈Pt​(a)∑​pb​N(p,t)+t1​p∈Pt​(a)∑​(ρ(p,b,t)−pb​)N(p,t).

Here 1t\frac1tt1​ means the inverse of ttt, taken to be 000 when t=0t=0t=0.

Degenerate cases:

  • t=0t=0t=0. P0(a)P_0(a)P0​(a) is empty and 1/0=01/0=01/0=0, so all sides equal 000.
  • m=0m=0m=0 or n=0n=0n=0. No R1R_1R1​ or no yyy exists, so the statement is vacuous.
  • What the second and third lines depend on. Whether they hold depends entirely on the unshown definitions of NNN and ρ\rhoρ. Given the second line, the third is an algebraic rearrangement of it.
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me