Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite-width statistics at a single input: ⟨⋅⟩K\langle\cdot\rangle_K⟨⋅⟩K​, χ∥\chi_\parallelχ∥​, κ4\kappa_4κ4​, Σ(ℓ)\Sigma^{(\ell)}Σ(ℓ)

Definition
LesHouchesWidth_FiniteWidth

by LG · Sep 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

machine-learningneural-networksprobability

Finite-width statistics of a Gaussian-initialized network at a single input (Lecture 4).

For the network z(ℓ)z^{(\ell)}z(ℓ) with Gaussian initialization of Mission I, a single input xxx, constants Cb,CWC_b,C_WCb​,CW​ and nonlinearity σ\sigmaσ:

  1. ⟨f⟩K=∫f dN(0,K)\langle f\rangle_K=\int f\,d\mathcal N(0,K)⟨f⟩K​=∫fdN(0,K) (gaussAvg). ⟨g⟩K\langle g\rangle_K⟨g⟩K​ for ggg of mmm variables is taken against mmm i.i.d. N(0,K)\mathcal N(0,K)N(0,K) coordinates (gaussAvgVec).
  2. VarK[σ2]=⟨σ4⟩K−⟨σ2⟩K2\mathrm{Var}_K[\sigma^2]=\langle\sigma^4\rangle_K-\langle\sigma^2\rangle_K^2VarK​[σ2]=⟨σ4⟩K​−⟨σ2⟩K2​ (gaussVarSq).
  3. χ∥(K)=CW ddK⟨σ2⟩K\chi_\parallel(K)=C_W\,\frac{d}{dK}\langle\sigma^2\rangle_Kχ∥​(K)=CW​dKd​⟨σ2⟩K​ (chiParallel), so that χ∥(ℓ)=χ∥(K(ℓ))=∂K(ℓ+1)/∂K(ℓ)\chi^{(\ell)}_\parallel=\chi_\parallel(K^{(\ell)})=\partial K^{(\ell+1)}/\partial K^{(\ell)}χ∥(ℓ)​=χ∥​(K(ℓ))=∂K(ℓ+1)/∂K(ℓ).
  4. σ\sigmaσ is polynomially bounded if ∣σ(t)∣≤C(1+∣t∣k)|\sigma(t)|\le C(1+|t|^k)∣σ(t)∣≤C(1+∣t∣k) (PolyBounded).
  5. κ4(ℓ)=13(E[(zi(ℓ))4]−3E[(zi(ℓ))2]2)\kappa^{(\ell)}_4=\frac13\big(\mathbb E[(z^{(\ell)}_i)^4]-3\mathbb E[(z^{(\ell)}_i)^2]^2\big)κ4(ℓ)​=31​(E[(zi(ℓ)​)4]−3E[(zi(ℓ)​)2]2) (kappa4) and G(ℓ)=E[(zi(ℓ))2]G^{(\ell)}=\mathbb E[(z^{(\ell)}_i)^2]G(ℓ)=E[(zi(ℓ)​)2] (dressedTwoPoint).
  6. Σ(ℓ)=Cb+CWnℓ∑jσ(zj(ℓ))2\Sigma^{(\ell)}=C_b+\frac{C_W}{n_\ell}\sum_j\sigma(z^{(\ell)}_j)^2Σ(ℓ)=Cb​+nℓ​CW​​∑j​σ(zj(ℓ)​)2 as a function of the layer-ℓ\ellℓ preactivation vector (collectiveSigma).

Formalization Note Variances K<0K<0K<0 are treated as 000 by gaussAvg. chiParallel uses Mathlib's deriv, which is 000 where the map is not differentiable.

Definition code
import Mathlib
import Definitions.Def_LesHouchesWidth_GaussianMLP

/-!
# Finite-width statistics at a single input (Les Houches lectures, Lecture 4)

Definitions used in Lecture 4 (Sections 4.2, 4.7–4.10) of arXiv:2309.01592v3, for the network
`mlpZ` with Gaussian initialization (eq. (119)) evaluated at a single input `x`.
-/

namespace LesHouchesWidth

open MeasureTheory ProbabilityTheory

/-- `⟨f⟩_K = ∫ f(z) exp(-z²/(2K)) dz / √(2πK)`, the average of `f` against the centered
Gaussian of variance `K` (Section 4.2). -/
noncomputable def gaussAvg (K : ℝ) (f : ℝ → ℝ) : ℝ :=
  ∫ t, f t ∂(gaussianReal 0 K.toNNReal)

/-- `⟨g⟩_K` for a function of `m` variables, averaged against `m` i.i.d. centered Gaussians of
variance `K` (the Gaussian with covariance `K · I_m`). -/
noncomputable def gaussAvgVec (m : ℕ) (K : ℝ) (g : (Fin m → ℝ) → ℝ) : ℝ :=
  ∫ y, g y ∂(Measure.pi fun _ : Fin m => gaussianReal 0 K.toNNReal)

/-- `Var_K[σ²] = ⟨σ⁴⟩_K - ⟨σ²⟩_K²`. -/
noncomputable def gaussVarSq (σ : ℝ → ℝ) (K : ℝ) : ℝ :=
  gaussAvg K (fun t => σ t ^ 4) - gaussAvg K (fun t => σ t ^ 2) ^ 2

/-- The parallel susceptibility `χ_∥(K) = C_W ∂_K ⟨σ²⟩_K = ∂K^{(ℓ+1)}/∂K^{(ℓ)}` (Theorem 4.1). -/
noncomputable def chiParallel (CW : ℝ) (σ : ℝ → ℝ) (K : ℝ) : ℝ :=
  CW * deriv (fun K' => gaussAvg K' (fun t => σ t ^ 2)) K

/-- `σ` is polynomially bounded: `|σ(t)| ≤ C (1 + |t|^k)` for some `C`, `k`. -/
def PolyBounded (σ : ℝ → ℝ) : Prop :=
  ∃ C : ℝ, ∃ k : ℕ, ∀ t, |σ t| ≤ C * (1 + |t| ^ k)

/-- The normalized connected four-point function of neuron `i` in layer `ℓ` at input `x`
(Section 4.8): `κ₄^{(ℓ)} = (1/3) (E[(z^{(ℓ)}_i)⁴] - 3 E[(z^{(ℓ)}_i)²]²)`. -/
noncomputable def kappa4 (Cb CW : ℝ) (σ : ℝ → ℝ) (n : ℕ → ℕ) (L : ℕ) (x : Fin (n 0) → ℝ)
    (ℓ : ℕ) (i : Fin (n ℓ)) : ℝ :=
  (1 / 3) * (∫ θ, (mlpZ Cb CW σ θ x ℓ i) ^ 4 ∂(stdGaussianParams n L) -
    3 * (∫ θ, (mlpZ Cb CW σ θ x ℓ i) ^ 2 ∂(stdGaussianParams n L)) ^ 2)

/-- The dressed two-point function `G^{(ℓ)} = E[(z^{(ℓ)}_i)²]` (Theorem 4.2). -/
noncomputable def dressedTwoPoint (Cb CW : ℝ) (σ : ℝ → ℝ) (n : ℕ → ℕ) (L : ℕ)
    (x : Fin (n 0) → ℝ) (ℓ : ℕ) (i : Fin (n ℓ)) : ℝ :=
  ∫ θ, (mlpZ Cb CW σ θ x ℓ i) ^ 2 ∂(stdGaussianParams n L)

/-- The collective observable `Σ^{(ℓ)} = C_b + (C_W / n_ℓ) ∑_j σ(z^{(ℓ)}_j)²` (Lemma 4.4). -/
noncomputable def collectiveSigma (Cb CW : ℝ) (σ : ℝ → ℝ) (n : ℕ → ℕ) (ℓ : ℕ)
    (z : Fin (n ℓ) → ℝ) : ℝ :=
  Cb + CW / (n ℓ : ℝ) * ∑ j, σ (z j) ^ 2

end LesHouchesWidth
Source
Bahri, Hanin, Brossollet, Erba, Keup, Pacelli, Simon, *Les Houches Lectures on Deep Learning at Large & Infinite Width*, arXiv:2309.01592v3 (https://arxiv.org/abs/2309.01592), p. 28 (Section 4.2, Gaussian averages), pp. 31–33 (Theorem 4.1, Section 4.8, Theorem 4.2), p. 34 (Lemma 4.4).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) - non-blind, same agent as drafter

Non-blind read-back. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement, with full knowledge of the source and of the intended meaning. It is not independent testimony and should not be treated as a blind audit; an independent read-back is still recommended before launch.

The file imports the Gaussian-initialized network of Def_LesHouchesWidth_GaussianMLP and defines, in namespace LesHouchesWidth:

  • gaussAvg K f =∫f(t) dN(0,max⁡(K,0))(t)=\int f(t)\,d\mathcal N(0,\max(K,0))(t)=∫f(t)dN(0,max(K,0))(t), the average of fff under the centered normal law with variance KKK. It is the point mass at 000 if K≤0K\le0K≤0, and the value is 000 if fff is not integrable.
  • gaussAvgVec m K g =∫g(y) d(N(0,max⁡(K,0))⊗m)(y)=\int g(y)\,d\big(\mathcal N(0,\max(K,0))^{\otimes m}\big)(y)=∫g(y)d(N(0,max(K,0))⊗m)(y) for g:Rm→Rg:\mathbb R^m\to\mathbb Rg:Rm→R.
  • gaussVarSq σ K =gaussAvg(K,σ4)−gaussAvg(K,σ2)2=\mathrm{gaussAvg}(K,\sigma^4)-\mathrm{gaussAvg}(K,\sigma^2)^2=gaussAvg(K,σ4)−gaussAvg(K,σ2)2.
  • chiParallel CW σ K =CW⋅ddK′[gaussAvg(K′,σ2)]K′=K=C_W\cdot\frac{d}{dK'}\big[\mathrm{gaussAvg}(K',\sigma^2)\big]_{K'=K}=CW​⋅dK′d​[gaussAvg(K′,σ2)]K′=K​, using Mathlib's deriv, which is 000 if the map is not differentiable at KKK. For K≤0K\le0K≤0 the function K′↦gaussAvg(K′,σ2)K'\mapsto\mathrm{gaussAvg}(K',\sigma^2)K′↦gaussAvg(K′,σ2) is constant on K′≤0K'\le0K′≤0.
  • PolyBounded σ: there exist a real CCC and a natural number kkk with ∣σ(t)∣≤C(1+∣t∣k)|\sigma(t)|\le C(1+|t|^k)∣σ(t)∣≤C(1+∣t∣k) for all real ttt.
  • kappa4 Cb CW σ n L x ℓ i =13(∫(zi(ℓ))4 dθ−3(∫(zi(ℓ))2 dθ)2)=\frac13\big(\int(z^{(\ell)}_i)^4\,d\theta-3(\int(z^{(\ell)}_i)^2\,d\theta)^2\big)=31​(∫(zi(ℓ)​)4dθ−3(∫(zi(ℓ)​)2dθ)2). Here z(ℓ)=z^{(\ell)}=z(ℓ)= mlpZ Cb CW σ θ x ℓ and θ\thetaθ is i.i.d. standard normal. For ℓ=0\ell=0ℓ=0 this is computed from the deterministic input. Non-integrable integrands contribute 000.
  • dressedTwoPoint Cb CW σ n L x ℓ i =∫(zi(ℓ))2 dθ=\int(z^{(\ell)}_i)^2\,d\theta=∫(zi(ℓ)​)2dθ.
  • collectiveSigma Cb CW σ n ℓ z =Cb+CWnℓ∑j<nℓσ(zj)2=C_b+\frac{C_W}{n_\ell}\sum_{j<n_\ell}\sigma(z_j)^2=Cb​+nℓ​CW​​∑j<nℓ​​σ(zj​)2 for a vector z∈Rnℓz\in\mathbb R^{n_\ell}z∈Rnℓ​, with CW/0C_W/0CW​/0 read as 000.
Human review
  • Endorsed by Shuze Chen · Sep 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Sep 24, 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