Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Example solution 2: mean squared displacement ⟨‖x‖²⟩ = 2nDt

Proved
FickDiffusion.mean_squared_displacement

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

diffusionpde

Let n∈Nn\in\mathbb Nn∈N, D>0D>0D>0 and t>0t>0t>0. The position (relative to its starting point) of a particle diffusing in Rn\mathbb R^nRn with diffusion coefficient DDD has density φD(n)(⋅,t)\varphi^{(n)}_D(\cdot,t)φD(n)​(⋅,t) at time ttt, where

φD(n)(x,t)=(4πDt)−n/2exp⁡(−∥x∥24Dt).\varphi^{(n)}_D(x,t)=(4\pi Dt)^{-n/2}\exp\Big(-\frac{\|x\|^2}{4Dt}\Big).φD(n)​(x,t)=(4πDt)−n/2exp(−4Dt∥x∥2​).

Its mean squared displacement is

∫Rn∥x∥2 φD(n)(x,t) dx=2nDt.\int_{\mathbb R^n}\|x\|^2\,\varphi^{(n)}_D(x,t)\,dx=2nDt .∫Rn​∥x∥2φD(n)​(x,t)dx=2nDt.

This is the diffusion-length law used throughout the article: the root-mean-square distance travelled grows like 2nDt\sqrt{2nDt}2nDt​.

Formalization Note Rn\mathbb R^nRn is EuclideanSpace ℝ (Fin n) with its Lebesgue (volume) measure and Euclidean norm; the Brownian particle is modelled by its Gaussian transition density, i.e. the nnn-dimensional fundamental solution of Fick's second law. For n=0n=0n=0 both sides are 000.

Preamble
import Mathlib
import Definitions.Def_FickDiffusion_defs

open Real Filter Topology MeasureTheory
Formal statement
namespace FickDiffusion

theorem mean_squared_displacement (n : ℕ) (D t : ℝ) (hD : 0 < D) (ht : 0 < t) :
    ∫ x, ‖x‖ ^ 2 * heatKernelEuclid n D x t = 2 * n * D * t := by sorry

end FickDiffusion
Source
Wikipedia, "Fick's laws of diffusion" (PDF snapshot supplied by the proposer, 21 pp.), https://en.wikipedia.org/wiki/Fick%27s_laws_of_diffusion, section "Example solution 2: Brownian particle and mean squared displacement" (p. 7), first displayed equation
Read-back

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

Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted the Lean statements, with full knowledge of the source and of the intended meaning, at the explicit instruction of the account owner. It is not a blind audit. Reviewers must not treat it as independent evidence of faithfulness and should compare it directly against the Lean code.

For every natural number nnn and all real D,tD,tD,t with D>0D>0D>0 and t>0t>0t>0:

∫Rn∥x∥2⋅(4πDt)−n/2exp⁡ ⁣(−∥x∥24Dt) dx  =  2 n D t,\int_{\mathbb R^n}\|x\|^2\cdot(4\pi Dt)^{-n/2}\exp\!\Big(\frac{-\|x\|^2}{4Dt}\Big)\,dx\;=\;2\,n\,D\,t,∫Rn​∥x∥2⋅(4πDt)−n/2exp(4Dt−∥x∥2​)dx=2nDt,

where Rn\mathbb R^nRn is nnn-dimensional Euclidean space (functions {0,…,n−1}→R\{0,\dots,n-1\}\to\mathbb R{0,…,n−1}→R with the Euclidean norm ∥⋅∥\|\cdot\|∥⋅∥), the integral is the Bochner integral with respect to its standard volume (Lebesgue) measure (000 by convention if not integrable), and (4πDt)−n/2(4\pi Dt)^{-n/2}(4πDt)−n/2 is the real power of a positive base. The case n=0n=0n=0 is included (then R0\mathbb R^0R0 is a single point and the right-hand side is 000).

Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 10, 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