Prove2Me
Navigate
MissionsFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The explicit mean-field map is the mean-field map

Proved
MarkovEntanglement.meanFieldMap_isMeanFieldMap

by tianyipeng · Aug 28, 2026 · Mathlib c5ea003 (Lean v4.30.0)

Fix local kernels P0,P1P_0, P_1P0​,P1​ on a finite local state space SSS, a priority index ν\nuν, a system size NNN and a budget MMM.

The explicit mean-field map on the simplex,

φ(m)y=∑x[(mx−zx(m)) P0(x,y)+zx(m) P1(x,y)],zx(m)=min⁡(mx,max⁡(0,α−∑νy>νxmy)),\varphi(m)_y = \sum_x \big[(m_x - z_x(m))\,P_0(x,y) + z_x(m)\,P_1(x,y)\big], \qquad z_x(m) = \min\Big(m_x, \max\big(0, \alpha - \textstyle\sum_{\nu_y > \nu_x} m_y\big)\Big),φ(m)y​=x∑​[(mx​−zx​(m))P0​(x,y)+zx​(m)P1​(x,y)],zx​(m)=min(mx​,max(0,α−∑νy​>νx​​my​)),

taken at the activation fraction α=M/N\alpha = M/Nα=M/N, satisfies the characterisation of the mean-field map of the NNN-agent system: for every joint state s∈SNs \in S^Ns∈SN and every local state yyy,

φ(m(s))y=1N∑i=1N[(1−pi) P0(si,y)+pi P1(si,y)],\varphi(m(s))_y = \frac{1}{N}\sum_{i=1}^N \Big[(1 - p_i)\,P_0(s_i, y) + p_i\,P_1(s_i, y)\Big],φ(m(s))y​=N1​i=1∑N​[(1−pi​)P0​(si​,y)+pi​P1​(si​,y)],

where m(s)m(s)m(s) is the configuration of sss and pip_ipi​ is the probability with which the index policy activates agent iii.

The two descriptions therefore agree on every configuration an NNN-agent system can actually occupy. This is what licenses proving the asymptotic theorems about the explicit formula, which is defined on the whole simplex, rather than about the characterisation, which pins the map down only on the 1/N1/N1/N-lattice.

The proof is a regrouping of the sum over agents into a sum over local states — the agents in a given state are exchangeable, so only their number matters — together with the observation that truncated natural subtraction in the count of activated agents is exactly the max⁡(0,⋅)\max(0, \cdot)max(0,⋅) of the continuum formula.

Preamble
import Mathlib
import Definitions.Def_markov_entanglement_meanfield

open scoped BigOperators
open MarkovEntanglement
Formal statement
namespace MarkovEntanglement

variable {S : Type*} [Fintype S] [DecidableEq S]

/-- The explicit mean-field map on the simplex agrees, on every configuration an `N`-agent
system can actually occupy, with the characterisation `IsMeanFieldMap` of the previous layer,
provided the activated fraction is `α = M / N`.  This is what licenses proving the asymptotic
theorems about the explicit formula. -/
theorem meanFieldMap_isMeanFieldMap
    (P0 P1 : Matrix S S ℝ) (ν : S → ℝ) (N M : ℕ) (hN : 0 < N) :
    IsMeanFieldMap (N := N) P0 P1 ν M
      (meanFieldMap P0 P1 ν ((M : ℝ) / (N : ℝ))) := by
  sorry

/-! ### M2 — Lemma 7, the mean-field map is piecewise affine -/

end MarkovEntanglement
Source
Shuze Chen and Tianyi Peng, 'Multi-agent Markov Entanglement', arXiv:2506.02385v3, Appendix I, p. 41 (bridging Definition 13 with the mean-field map used in the proof of Theorem 7)
Read-back

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

For every finite type SSS with decidable equality, every pair of matrices P0,P1:S×S→RP_0, P_1 : S \times S \to \mathbb{R}P0​,P1​:S×S→R (arbitrary real matrices — no nonnegativity, no row sums equal to 111, no stochasticity of any kind is assumed), every function ν:S→R\nu : S \to \mathbb{R}ν:S→R (arbitrary — ties ν(x)=ν(y)\nu(x) = \nu(y)ν(x)=ν(y) are permitted), and every pair of natural numbers N,MN, MN,M subject only to the hypothesis N>0N > 0N>0 (in particular MMM is unconstrained: M=0M = 0M=0 is allowed, and M>NM > NM>N is allowed), the following identity holds. Write, for a state assignment s:{0,1,…,N−1}→Ss : \{0,1,\dots,N-1\} \to Ss:{0,1,…,N−1}→S and x∈Sx \in Sx∈S,

  • cs(x):=#{ i:si=x }c_s(x) := \#\{\, i : s_i = x \,\}cs​(x):=#{i:si​=x}, the number of coordinates in state xxx, and ms(x):=cs(x)/N∈Rm_s(x) := c_s(x)/N \in \mathbb{R}ms​(x):=cs​(x)/N∈R (real division, well defined since N>0N > 0N>0);
  • hs(x):=∑y : ν(x)<ν(y)cs(y)h_s(x) := \sum_{y \,:\, \nu(x) < \nu(y)} c_s(y)hs​(x):=∑y:ν(x)<ν(y)​cs​(y), a natural number, the total count of coordinates sitting in states of strictly higher ν\nuν-value than xxx;
  • as(x):=min⁡(cs(x),  M−˙hs(x))a_s(x) := \min\big(c_s(x),\; M \dot- h_s(x)\big)as​(x):=min(cs​(x),M−˙​hs​(x)), where −˙\dot-−˙​ is truncated natural-number subtraction, so M−˙hs(x)=0M \dot- h_s(x) = 0M−˙​hs​(x)=0 whenever hs(x)≥Mh_s(x) \ge Mhs​(x)≥M;
  • ps(x):=as(x)cs(x)p_s(x) := \dfrac{a_s(x)}{c_s(x)}ps​(x):=cs​(x)as​(x)​ if cs(x)≠0c_s(x) \ne 0cs​(x)=0, and ps(x):=0p_s(x) := 0ps​(x):=0 if cs(x)=0c_s(x) = 0cs​(x)=0;

and, for a real-valued function m:S→Rm : S \to \mathbb{R}m:S→R (not required to be a probability vector) and the specific scalar α:=M/N∈R\alpha := M/N \in \mathbb{R}α:=M/N∈R (real division of the two given naturals; not required to lie in [0,1][0,1][0,1]),

  • H(m,x):=∑y : ν(x)<ν(y)m(y)H(m,x) := \sum_{y \,:\, \nu(x) < \nu(y)} m(y)H(m,x):=∑y:ν(x)<ν(y)​m(y);
  • F(m,x):=min⁡(m(x),  max⁡(0,  α−H(m,x)))F(m,x) := \min\big(m(x),\; \max(0,\; \alpha - H(m,x))\big)F(m,x):=min(m(x),max(0,α−H(m,x)));
  • φ(m)(y):=∑x∈S[(m(x)−F(m,x)) P0(x,y)  +  F(m,x) P1(x,y)]\varphi(m)(y) := \displaystyle\sum_{x \in S} \Big[\big(m(x) - F(m,x)\big)\, P_0(x,y) \;+\; F(m,x)\, P_1(x,y)\Big]φ(m)(y):=x∈S∑​[(m(x)−F(m,x))P0​(x,y)+F(m,x)P1​(x,y)].

The assertion is that for every s:{0,1,…,N−1}→Ss : \{0,1,\dots,N-1\} \to Ss:{0,1,…,N−1}→S and every y∈Sy \in Sy∈S,

φ(ms)(y)  =  ∑i=0N−11N[(1−ps(si)) P0(si,y)  +  ps(si) P1(si,y)].\varphi\big(m_s\big)(y) \;=\; \sum_{i=0}^{N-1} \frac{1}{N}\Big[\big(1 - p_s(s_i)\big)\, P_0(s_i, y) \;+\; p_s(s_i)\, P_1(s_i, y)\Big].φ(ms​)(y)=i=0∑N−1​N1​[(1−ps​(si​))P0​(si​,y)+ps​(si​)P1​(si​,y)].

Note that the left-hand side sums over states x∈Sx \in Sx∈S using the continuum quantities α=M/N\alpha = M/Nα=M/N, HHH, FFF applied to the empirical configuration msm_sms​, while the right-hand side sums over the NNN coordinates iii using the integer-arithmetic quantities hsh_shs​, asa_sas​, psp_sps​ built from counts and truncated subtraction; the claim is that these two expressions agree exactly, as real numbers, for all such sss and yyy. No hypothesis constrains ν\nuν to be injective, constrains M≤NM \le NM≤N, or asserts any non-degeneracy; the only hypothesis besides the type-class assumptions on SSS is N>0N > 0N>0. Degenerate cases silently included: M=0M = 0M=0 (then as≡0a_s \equiv 0as​≡0, ps≡0p_s \equiv 0ps​≡0, and α=0\alpha = 0α=0, so F(ms,x)=min⁡(ms(x),max⁡(0,−H))=0F(m_s, x) = \min(m_s(x), \max(0, -H)) = 0F(ms​,x)=min(ms​(x),max(0,−H))=0 when H≥0H \ge 0H≥0); M≥NM \ge NM≥N (then α≥1\alpha \ge 1α≥1); states xxx never visited by sss, for which cs(x)=0c_s(x) = 0cs​(x)=0 and ps(x)p_s(x)ps​(x) is defined to be 000 by the guard rather than by division; and the case where SSS is empty, in which — since N>0N > 0N>0 forces the type of maps {0,…,N−1}→S\{0,\dots,N-1\} \to S{0,…,N−1}→S to be empty — the universally quantified statement is vacuously satisfied.

Human review
  • Endorsed by Shuze Chen · Aug 28, 2026

  • Endorsed by tianyipeng · Aug 30, 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.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me