Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (10): first-layer covariance E[zi(1)(x)zi(1)(x′)]=K(1)(x,x′)\mathbb E[z^{(1)}_i(x)z^{(1)}_i(x')]=K^{(1)}(x,x')E[zi(1)​(x)zi(1)​(x′)]=K(1)(x,x′)

Proved
LesHouchesWidth.covariance_first_layer

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

machine-learningneural-networksprobability

For a network with Gaussian initialization bi(1)∼N(0,σb2)b^{(1)}_i\sim\mathcal N(0,\sigma_b^2)bi(1)​∼N(0,σb2​) and Wij(1)∼N(0,σw2/n0)W^{(1)}_{ij}\sim\mathcal N(0,\sigma_w^2/n_0)Wij(1)​∼N(0,σw2​/n0​), any inputs x,x′∈Rn0x,x'\in\mathbb R^{n_0}x,x′∈Rn0​ and any first-layer neuron iii,

E[zi(1)(x) zi(1)(x′)]=σb2+σw2 x⋅x′n0=K(1)(x,x′).\mathbb E\big[z^{(1)}_i(x)\,z^{(1)}_i(x')\big]=\sigma_b^2+\sigma_w^2\,\frac{x\cdot x'}{n_0}=K^{(1)}(x,x').E[zi(1)​(x)zi(1)​(x′)]=σb2​+σw2​n0​x⋅x′​=K(1)(x,x′).

This is the base case of the NNGP kernel recursion.

Formalization Note In Lecture 1 this quantity is written E[zi0(x)zi0(x′)]=K0(x,x′)\mathbb E[z^0_i(x)z^0_i(x')]=K^0(x,x')E[zi0​(x)zi0​(x′)]=K0(x,x′); the series uses the layer indexing of Lectures 4–5.

Preamble
import Mathlib
import Definitions.Def_LesHouchesWidth_GaussianMLP
Formal statement
namespace LesHouchesWidth

open MeasureTheory ProbabilityTheory

theorem covariance_first_layer (σb σw : ℝ) (φ : ℝ → ℝ) (n : ℕ → ℕ) (L : ℕ)
    (x x' : Fin (n 0) → ℝ) (i : Fin (n 1)) :
    ∫ θ, mlpZ (σb ^ 2) (σw ^ 2) φ θ x 1 i * mlpZ (σb ^ 2) (σw ^ 2) φ θ x' 1 i
        ∂(stdGaussianParams n L) =
      nngpKernel (σb ^ 2) (σw ^ 2) φ 1 x x' := by sorry

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. 4, eq. (10) (Lecture 1, Section 1.3, proof of Result 1).
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.

Let σb,σw∈R\sigma_b,\sigma_w\in\mathbb Rσb​,σw​∈R be arbitrary, let φ:R→R\varphi:\mathbb R\to\mathbb Rφ:R→R be arbitrary (it plays no role), and let n:N→Nn:\mathbb N\to\mathbb Nn:N→N and L∈NL\in\mathbb NL∈N be arbitrary. Let x,x′∈Rn0x,x'\in\mathbb R^{n_0}x,x′∈Rn0​ and let i<n1i<n_1i<n1​. With parameters distributed as i.i.d. standard Gaussians, biases ∣σb∣ θ|\sigma_b|\,\theta∣σb​∣θ and first-layer weights σw2/n0 θ\sqrt{\sigma_w^2/n_0}\,\thetaσw2​/n0​​θ, the theorem asserts

∫zi(1)(θ,x) zi(1)(θ,x′) dθ=σb2+σw2 ∑j<n0xjxj′n0,\int z^{(1)}_i(\theta,x)\,z^{(1)}_i(\theta,x')\,d\theta=\sigma_b^2+\sigma_w^2\,\frac{\sum_{j<n_0}x_jx'_j}{n_0},∫zi(1)​(θ,x)zi(1)​(θ,x′)dθ=σb2​+σw2​n0​∑j<n0​​xj​xj′​​,

where zi(1)(θ,x)=bi(1)+∑jWij(1)xjz^{(1)}_i(\theta,x)=b^{(1)}_i+\sum_jW^{(1)}_{ij}x_jzi(1)​(θ,x)=bi(1)​+∑j​Wij(1)​xj​. There are no hypotheses. If n0=0n_0=0n0​=0, the right side is σb2\sigma_b^2σb2​, since division by zero gives 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