Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

MLP: second-layer two-point correlator (eq. 4.41)

Proved
DeepLearningTheory.mlp_second_layer_two_point

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

deep-learning-theorymachine-learningprobability

For an MLP at initialization with a measurable activation σ\sigmaσ of polynomial growth and n1≥1n_1\ge1n1​≥1, two inputs xα1,xα2x_{\alpha_1},x_{\alpha_2}xα1​​,xα2​​ and second-layer neurons i1,i2i_1,i_2i1​,i2​,

E[zi1;α1(2)zi2;α2(2)]=δi1i2(Cb(2)+CW(2) ⟨σα1σα2⟩G(1)).\mathbb{E}\big[z^{(2)}_{i_1;\alpha_1}z^{(2)}_{i_2;\alpha_2}\big]=\delta_{i_1i_2}\Big(C_b^{(2)}+C_W^{(2)}\,\langle\sigma_{\alpha_1}\sigma_{\alpha_2}\rangle_{G^{(1)}}\Big).E[zi1​;α1​(2)​zi2​;α2​(2)​]=δi1​i2​​(Cb(2)​+CW(2)​⟨σα1​​σα2​​⟩G(1)​).

This is the first step of the kernel recursion G(ℓ+1)=Cb+CW⟨σσ⟩G(ℓ)G^{(\ell+1)}=C_b+C_W\langle\sigma\sigma\rangle_{G^{(\ell)}}G(ℓ+1)=Cb​+CW​⟨σσ⟩G(ℓ)​.

Preamble
import Mathlib
import Definitions.Def_DLT_DeepLinearNetwork
import Definitions.Def_DLT_MLPInit

open MeasureTheory ProbabilityTheory
open scoped NNReal
Formal statement
namespace DeepLearningTheory

theorem mlp_second_layer_two_point {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] (n : ℕ → ℕ) (Cb CW : ℕ → ℝ≥0) (σ : ℝ → ℝ)
    (b : Ω → ℕ → ℕ → ℝ) (W : Ω → ℕ → ℕ → ℕ → ℝ) (hinit : IsMLPInit P n Cb CW b W)
    (hσm : Measurable σ) (hσ : HasPolyGrowth σ) (hn₁ : 0 < n 1) (x : Fin 2 → ℕ → ℝ) (i₁ i₂ : ℕ) (hi₁ : i₁ < n 2) (hi₂ : i₂ < n 2) :
    ∫ ω, mlpPreact n σ (b ω) (W ω) (x 0) 2 i₁ * mlpPreact n σ (b ω) (W ω) (x 1) 2 i₂ ∂P
      = kron i₁ i₂ * ((Cb 2 : ℝ) + (CW 2 : ℝ) *
          gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 0) * σ (u 1))) := by sorry

end DeepLearningTheory
Source
Daniel A. Roberts and Sho Yaida (with Boris Hanin), *The Principles of Deep Learning Theory*, arXiv:2106.10165v2, https://arxiv.org/abs/2106.10165, §4.2, pp. 81–82, eqs. (4.37), (4.41) (page numbers are the book's printed page numbers)
Read-back

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

Non-blind read-back. This read-back was written by the same agent that drafted the Lean statement, with full knowledge of the source text and of the intended meaning. It is not independent testimony and must not be mistaken for a blind audit; reviewers should compare the Lean code against the source themselves.

Let (Ω,P)(\Omega,P)(Ω,P) be a probability space, n:N→Nn:\mathbb{N}\to\mathbb{N}n:N→N widths, Cb,CW:N→R≥0C_b,C_W:\mathbb{N}\to\mathbb{R}_{\ge0}Cb​,CW​:N→R≥0​, σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R any function, and b,Wb,Wb,W random bias/weight fields satisfying IsMLPInit (all biases bi(ℓ)b^{(\ell)}_ibi(ℓ)​ and weights Wij(ℓ)W^{(\ell)}_{ij}Wij(ℓ)​ with ℓ≥1\ell\ge1ℓ≥1, i<nℓi<n_\elli<nℓ​, j<nℓ−1j<n_{\ell-1}j<nℓ−1​ mutually independent; bi(ℓ)∼N(0,Cb(ℓ))b^{(\ell)}_i\sim\mathcal{N}(0,C_b^{(\ell)})bi(ℓ)​∼N(0,Cb(ℓ)​), Wij(ℓ)∼N(0,CW(ℓ)/nℓ−1)W^{(\ell)}_{ij}\sim\mathcal{N}(0,C_W^{(\ell)}/n_{\ell-1})Wij(ℓ)​∼N(0,CW(ℓ)​/nℓ−1​)). Write zi(ℓ)(x)z^{(\ell)}_i(x)zi(ℓ)​(x) for the MLP preactivation at (b(ω),W(ω))(b(\omega),W(\omega))(b(ω),W(ω)) and G(1)G^{(1)}G(1) for the first-layer metric Gαβ(1)=Cb(1)+CW(1)1n0∑j<n0xα(j)xβ(j)G^{(1)}_{\alpha\beta}=C_b^{(1)}+C_W^{(1)}\frac1{n_0}\sum_{j<n_0}x_\alpha(j)x_\beta(j)Gαβ(1)​=Cb(1)​+CW(1)​n0​1​∑j<n0​​xα​(j)xβ​(j) of the listed inputs. Assume moreover that σ\sigmaσ is measurable and has polynomial growth (∣σ(u)∣≤C(1+∣u∣)k|\sigma(u)|\le C(1+|u|)^k∣σ(u)∣≤C(1+∣u∣)k). Assume n1>0n_1>0n1​>0. Then for every pair of inputs x0,x1x_0,x_1x0​,x1​ and all i1,i2<n2i_1,i_2<n_2i1​,i2​<n2​: ∫zi1(2)(x0) zi2(2)(x1) dP=δi1i2(Cb(2)+CW(2)⟨σ(u0)σ(u1)⟩G(1))\int z^{(2)}_{i_1}(x_0)\,z^{(2)}_{i_2}(x_1)\,dP=\delta_{i_1i_2}\big(C_b^{(2)}+C_W^{(2)}\langle\sigma(u_0)\sigma(u_1)\rangle_{G^{(1)}}\big)∫zi1​(2)​(x0​)zi2​(2)​(x1​)dP=δi1​i2​​(Cb(2)​+CW(2)​⟨σ(u0​)σ(u1​)⟩G(1)​), with G(1)G^{(1)}G(1) the 2×22\times22×2 first-layer metric of x0,x1x_0,x_1x0​,x1​ and zi(2)=bi(2)+∑j<n1Wij(2)σ(zj(1))z^{(2)}_i=b^{(2)}_i+\sum_{j<n_1}W^{(2)}_{ij}\sigma(z^{(1)}_j)zi(2)​=bi(2)​+∑j<n1​​Wij(2)​σ(zj(1)​). Here ⟨F⟩G(1)\langle F\rangle_{G^{(1)}}⟨F⟩G(1)​ is the integral of FFF against Mathlib's centered multivariate Gaussian with covariance matrix G(1)G^{(1)}G(1) (the inputs may repeat, so G(1)G^{(1)}G(1) may be singular).

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