Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

MLP: second-layer connected four-point correlator and the four-point vertex (eq. 4.43)

Proved
DeepLearningTheory.mlp_second_layer_connected_four_point

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

deep-learning-theorymachine-learningprobability

Genesis of non-Gaussianity. Consider an MLP at initialization (eqs. 4.3–4.4) with a measurable activation σ\sigmaσ of polynomial growth and n1≥1n_1\ge1n1​≥1. For inputs xα1,…,xα4x_{\alpha_1},\dots,x_{\alpha_4}xα1​​,…,xα4​​ (not necessarily distinct) and second-layer neurons i1,…,i4i_1,\dots,i_4i1​,…,i4​, the connected four-point correlator of the second-layer preactivations,

E[zi1;α1(2)zi2;α2(2)zi3;α3(2)zi4;α4(2)]∣connected=E[z1z2z3z4]−E[z1z2]E[z3z4]−E[z1z3]E[z2z4]−E[z1z4]E[z2z3]\mathbb{E}\big[z^{(2)}_{i_1;\alpha_1}z^{(2)}_{i_2;\alpha_2}z^{(2)}_{i_3;\alpha_3}z^{(2)}_{i_4;\alpha_4}\big]\Big|_{\text{connected}}=\mathbb{E}\big[z_1z_2z_3z_4\big]-\mathbb{E}[z_1z_2]\mathbb{E}[z_3z_4]-\mathbb{E}[z_1z_3]\mathbb{E}[z_2z_4]-\mathbb{E}[z_1z_4]\mathbb{E}[z_2z_3]E[zi1​;α1​(2)​zi2​;α2​(2)​zi3​;α3​(2)​zi4​;α4​(2)​]​connected​=E[z1​z2​z3​z4​]−E[z1​z2​]E[z3​z4​]−E[z1​z3​]E[z2​z4​]−E[z1​z4​]E[z2​z3​]

(with za=zia;αa(2)z_a=z^{(2)}_{i_a;\alpha_a}za​=zia​;αa​(2)​), equals

1n1[δi1i2δi3i4V(α1α2)(α3α4)(2)+δi1i3δi2i4V(α1α3)(α2α4)(2)+δi1i4δi2i3V(α1α4)(α2α3)(2)],\frac{1}{n_1}\Big[\delta_{i_1i_2}\delta_{i_3i_4}V^{(2)}_{(\alpha_1\alpha_2)(\alpha_3\alpha_4)}+\delta_{i_1i_3}\delta_{i_2i_4}V^{(2)}_{(\alpha_1\alpha_3)(\alpha_2\alpha_4)}+\delta_{i_1i_4}\delta_{i_2i_3}V^{(2)}_{(\alpha_1\alpha_4)(\alpha_2\alpha_3)}\Big],n1​1​[δi1​i2​​δi3​i4​​V(α1​α2​)(α3​α4​)(2)​+δi1​i3​​δi2​i4​​V(α1​α3​)(α2​α4​)(2)​+δi1​i4​​δi2​i3​​V(α1​α4​)(α2​α3​)(2)​],

where the four-point vertex is

V(α1α2)(α3α4)(2)=(CW(2))2[⟨σα1σα2σα3σα4⟩G(1)−⟨σα1σα2⟩G(1)⟨σα3σα4⟩G(1)].V^{(2)}_{(\alpha_1\alpha_2)(\alpha_3\alpha_4)}=\big(C_W^{(2)}\big)^2\Big[\langle\sigma_{\alpha_1}\sigma_{\alpha_2}\sigma_{\alpha_3}\sigma_{\alpha_4}\rangle_{G^{(1)}}-\langle\sigma_{\alpha_1}\sigma_{\alpha_2}\rangle_{G^{(1)}}\langle\sigma_{\alpha_3}\sigma_{\alpha_4}\rangle_{G^{(1)}}\Big].V(α1​α2​)(α3​α4​)(2)​=(CW(2)​)2[⟨σα1​​σα2​​σα3​​σα4​​⟩G(1)​−⟨σα1​​σα2​​⟩G(1)​⟨σα3​​σα4​​⟩G(1)​].

The second-layer distribution is therefore non-Gaussian at finite width, with non-Gaussianity suppressed by 1/n11/n_11/n1​.

Formalization Note All Gaussian averages are taken with the first-layer metric of the four inputs xα1,…,xα4x_{\alpha_1},\dots,x_{\alpha_4}xα1​​,…,xα4​​, which may be singular.

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_connected_four_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 4 → ℕ → ℝ) (i : Fin 4 → ℕ) (hi : ∀ a, i a < n 2) :
    (∫ ω, mlpPreact n σ (b ω) (W ω) (x 0) 2 (i 0) * mlpPreact n σ (b ω) (W ω) (x 1) 2 (i 1) *
        mlpPreact n σ (b ω) (W ω) (x 2) 2 (i 2) * mlpPreact n σ (b ω) (W ω) (x 3) 2 (i 3) ∂P)
      - (∫ ω, mlpPreact n σ (b ω) (W ω) (x 0) 2 (i 0) * mlpPreact n σ (b ω) (W ω) (x 1) 2 (i 1) ∂P) * (∫ ω, mlpPreact n σ (b ω) (W ω) (x 2) 2 (i 2) * mlpPreact n σ (b ω) (W ω) (x 3) 2 (i 3) ∂P)
      - (∫ ω, mlpPreact n σ (b ω) (W ω) (x 0) 2 (i 0) * mlpPreact n σ (b ω) (W ω) (x 2) 2 (i 2) ∂P) * (∫ ω, mlpPreact n σ (b ω) (W ω) (x 1) 2 (i 1) * mlpPreact n σ (b ω) (W ω) (x 3) 2 (i 3) ∂P)
      - (∫ ω, mlpPreact n σ (b ω) (W ω) (x 0) 2 (i 0) * mlpPreact n σ (b ω) (W ω) (x 3) 2 (i 3) ∂P) * (∫ ω, mlpPreact n σ (b ω) (W ω) (x 1) 2 (i 1) * mlpPreact n σ (b ω) (W ω) (x 2) 2 (i 2) ∂P)
      = (1 / (n 1 : ℝ)) *
          (kron (i 0) (i 1) * kron (i 2) (i 3) * ((CW 2 : ℝ) ^ 2 *
            (gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x)
                (fun u => σ (u 0) * σ (u 1) * σ (u 2) * σ (u 3))
              - gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 0) * σ (u 1)) *
                gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 2) * σ (u 3))))
          + kron (i 0) (i 2) * kron (i 1) (i 3) * ((CW 2 : ℝ) ^ 2 *
            (gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x)
                (fun u => σ (u 0) * σ (u 1) * σ (u 2) * σ (u 3))
              - gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 0) * σ (u 2)) *
                gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 1) * σ (u 3))))
          + kron (i 0) (i 3) * kron (i 1) (i 2) * ((CW 2 : ℝ) ^ 2 *
            (gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x)
                (fun u => σ (u 0) * σ (u 1) * σ (u 2) * σ (u 3))
              - gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 0) * σ (u 3)) *
                gaussAvg (firstLayerMetric (Cb 1) (CW 1) (n 0) x) (fun u => σ (u 1) * σ (u 2))))) := 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.40), (4.42), (4.43) (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. Let x0,…,x3x_0,\dots,x_3x0​,…,x3​ be four inputs with 4×44\times44×4 first-layer metric G(1)G^{(1)}G(1), and i0,…,i3i_0,\dots,i_3i0​,…,i3​ indices with each ia<n2i_a<n_2ia​<n2​. Write za=zia(2)(xa)z_a=z^{(2)}_{i_a}(x_a)za​=zia​(2)​(xa​) and Eac=∫zazc dPE_{ac}=\int z_az_c\,dPEac​=∫za​zc​dP. Then

∫z0z1z2z3 dP−E01E23−E02E13−E03E12=1n1(δi0i1δi2i3V01∣23+δi0i2δi1i3V02∣13+δi0i3δi1i2V03∣12),\int z_0z_1z_2z_3\,dP-E_{01}E_{23}-E_{02}E_{13}-E_{03}E_{12}=\frac1{n_1}\Big(\delta_{i_0i_1}\delta_{i_2i_3}V_{01|23}+\delta_{i_0i_2}\delta_{i_1i_3}V_{02|13}+\delta_{i_0i_3}\delta_{i_1i_2}V_{03|12}\Big),∫z0​z1​z2​z3​dP−E01​E23​−E02​E13​−E03​E12​=n1​1​(δi0​i1​​δi2​i3​​V01∣23​+δi0​i2​​δi1​i3​​V02∣13​+δi0​i3​​δi1​i2​​V03∣12​),

where Vac∣de=(CW(2))2(⟨σ(u0)σ(u1)σ(u2)σ(u3)⟩G(1)−⟨σ(ua)σ(uc)⟩G(1)⟨σ(ud)σ(ue)⟩G(1))V_{ac|de}=(C_W^{(2)})^2\big(\langle\sigma(u_0)\sigma(u_1)\sigma(u_2)\sigma(u_3)\rangle_{G^{(1)}}-\langle\sigma(u_a)\sigma(u_c)\rangle_{G^{(1)}}\langle\sigma(u_d)\sigma(u_e)\rangle_{G^{(1)}}\big)Vac∣de​=(CW(2)​)2(⟨σ(u0​)σ(u1​)σ(u2​)σ(u3​)⟩G(1)​−⟨σ(ua​)σ(uc​)⟩G(1)​⟨σ(ud​)σ(ue​)⟩G(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