Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The Boltzmann equation with the BGK collision operator

Definition
BoltzmannBGK_model

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

analysiskinetic-theorymathematical-physicspartial-differential-equations

This file fixes the kinetic model of Question 1 of the source paper: the Boltzmann equation with the BGK collision operator, together with the hydrodynamic moments it is built from. Velocities and positions range over three-dimensional Euclidean space, particles have unit mass and the Boltzmann constant is 111.

For a distribution function f:R3→Rf:\mathbb R^3\to\mathbb Rf:R3→R on velocity space the three moments are the mass density, the bulk velocity and the temperature,

ρ[f]=∫f dv,u[f]=1ρ[f]∫v f dv,θ[f]=13ρ[f]∫∣v−u[f]∣2f dv.\rho[f]=\int f\,\mathrm dv,\qquad u[f]=\frac1{\rho[f]}\int v\,f\,\mathrm dv,\qquad \theta[f]=\frac1{3\rho[f]}\int |v-u[f]|^2 f\,\mathrm dv .ρ[f]=∫fdv,u[f]=ρ[f]1​∫vfdv,θ[f]=3ρ[f]1​∫∣v−u[f]∣2fdv.

The Maxwellian with parameters (ρ,u,θ)(\rho,u,\theta)(ρ,u,θ) is

Mρ,u,θ(v)=ρ(2πθ)3/2exp⁡(−∣v−u∣22θ),M_{\rho,u,\theta}(v)=\frac{\rho}{(2\pi\theta)^{3/2}}\exp\Big(-\frac{|v-u|^2}{2\theta}\Big),Mρ,u,θ​(v)=(2πθ)3/2ρ​exp(−2θ∣v−u∣2​),

the local Maxwellian of fff is f(0)=Mρ[f],u[f],θ[f]f^{(0)}=M_{\rho[f],u[f],\theta[f]}f(0)=Mρ[f],u[f],θ[f]​, and the BGK collision operator with relaxation time τ\tauτ is C[f]=−1τ (f−f(0))C[f]=-\tfrac1\tau\,(f-f^{(0)})C[f]=−τ1​(f−f(0)). A distribution function is called admissible when it is everywhere strictly positive, integrable, and has a finite second velocity moment. Finally, a time-dependent field f(t,x,v)f(t,x,v)f(t,x,v) solves the BGK equation when it is differentiable in ttt and in xxx and satisfies

∂f∂t+v⋅∇xf=C[f],\frac{\partial f}{\partial t}+v\cdot\nabla_x f = C[f],∂t∂f​+v⋅∇x​f=C[f],

where the collision operator acts on the velocity profile f(t,x,⋅)f(t,x,\cdot)f(t,x,⋅) at each fixed time and position.

This is the model on which every statement of the mission rests: the conservation laws, the entropy inequality and the slab reduction are all phrased in terms of these moments and this operator.

Formalization Note Integrals are Bochner integrals against the Lebesgue measure on EuclideanSpace ℝ (Fin 3); the bulk velocity is a vector-valued integral. Division by the density is Lean's total division, so the moments of the zero function are junk values rather than errors, which is why positivity of the density is assumed wherever it matters. The directional derivative v⋅∇xfv\cdot\nabla_x fv⋅∇x​f is expressed as the Fréchet derivative in xxx evaluated at the vector vvv.

Definition code
import Mathlib

noncomputable section

open MeasureTheory Real

namespace BoltzmannBGK

/-- Velocity space (and position space): three–dimensional Euclidean space. -/
abbrev Vel := EuclideanSpace ℝ (Fin 3)

/-- Mass density of a distribution function, `ρ[f] = ∫ f dv` (particles have unit mass). -/
def density (f : Vel → ℝ) : ℝ := ∫ v, f v

/-- Bulk (mean) velocity, `u[f] = (1/ρ) ∫ v f dv`. -/
def bulkVelocity (f : Vel → ℝ) : Vel := (density f)⁻¹ • ∫ v, f v • v

/-- Temperature, `θ[f] = (1/(3ρ)) ∫ |v - u|² f dv` (unit mass, Boltzmann constant `k_B = 1`). -/
def temperature (f : Vel → ℝ) : ℝ :=
  (∫ v, ‖v - bulkVelocity f‖ ^ 2 * f v) / (3 * density f)

/-- The Maxwellian distribution with mass density `ρ`, bulk velocity `u` and temperature `θ`:
`ρ (2πθ)^(-3/2) exp (-|v - u|²/(2θ))`. -/
def maxwellian (ρ : ℝ) (u : Vel) (θ : ℝ) (v : Vel) : ℝ :=
  ρ / (2 * π * θ) ^ (3 / 2 : ℝ) * exp (-(‖v - u‖ ^ 2 / (2 * θ)))

/-- The local Maxwellian `f⁽⁰⁾` attached to `f`: the Maxwellian whose density, bulk velocity and
temperature are those of `f`. -/
def localMaxwellian (f : Vel → ℝ) : Vel → ℝ :=
  maxwellian (density f) (bulkVelocity f) (temperature f)

/-- The BGK collision operator `C[f] = -(1/τ) (f - f⁽⁰⁾)`. -/
def collision (τ : ℝ) (f : Vel → ℝ) (v : Vel) : ℝ :=
  -(1 / τ) * (f v - localMaxwellian f v)

/-- A distribution function that is everywhere positive, integrable, and has a finite second
moment in velocity. -/
structure IsKineticState (f : Vel → ℝ) : Prop where
  pos : ∀ v, 0 < f v
  integrable : Integrable f
  integrable_sq : Integrable fun v => ‖v‖ ^ 2 * f v

/-- The Boltzmann equation with the BGK collision operator,
`∂f/∂t + v · ∇ₓ f = C[f]`, for `f : time → position → velocity → ℝ` and relaxation time `τ`. -/
structure IsBGKSolution (τ : ℝ) (f : ℝ → Vel → Vel → ℝ) : Prop where
  differentiable_time : ∀ x v, Differentiable ℝ fun t => f t x v
  differentiable_space : ∀ t v, Differentiable ℝ fun x => f t x v
  equation : ∀ t x v,
    deriv (fun s => f s x v) t + fderiv ℝ (fun y => f t y v) x v = collision τ (f t x) v

end BoltzmannBGK
Source
Oxford Honour School of Mathematical and Theoretical Physics Part C / MSc in Mathematical and Theoretical Physics, examination paper A15089W1, KINETIC THEORY, Hilary Term 2019 (Thursday 10 January 2019), Question 1, page 2. https://web.archive.org/web/20250913150648/https://mmathphys.physics.ox.ac.uk/sites/default/files/mmathphys/documents/media/kt_2019.pdf Part (a) and equation (*).
Read-back

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

Provenance note — this read-back is NOT blind and NOT independent testimony. It was written by the same agent that drafted the Lean statements in this proposal, at the explicit instruction of the proposal owner, and not by a separate auditor with a fresh context. It therefore carries the drafter's knowledge of what the code was intended to say, and a reviewer must not treat it as an outside check on faithfulness.

This bundle works over V=R3V=\mathbb R^3V=R3 (three-dimensional Euclidean space, with the Euclidean norm) and over its Lebesgue measure; every integral below is a Bochner integral over all of VVV, with the convention that a non-integrable integrand gives the value 000.

For a real-valued function fff on VVV it defines three numbers. The density is ρ[f]=∫Vf(v) dv\rho[f]=\int_V f(v)\,\mathrm dvρ[f]=∫V​f(v)dv. The bulk velocity is the vector u[f]=ρ[f]−1∫Vf(v) v dv∈Vu[f]=\rho[f]^{-1}\int_V f(v)\,v\,\mathrm dv \in Vu[f]=ρ[f]−1∫V​f(v)vdv∈V, where the inverse is total division (so u[f]=0u[f]=0u[f]=0 when ρ[f]=0\rho[f]=0ρ[f]=0). The temperature is the scalar

θ[f]=∫V∥v−u[f]∥2f(v) dv3 ρ[f],\theta[f]=\frac{\int_V \lVert v-u[f]\rVert^2 f(v)\,\mathrm dv}{3\,\rho[f]},θ[f]=3ρ[f]∫V​∥v−u[f]∥2f(v)dv​,

again with total division.

For real numbers ρ,θ\rho,\thetaρ,θ, a vector u∈Vu\in Vu∈V and v∈Vv\in Vv∈V it defines

Mρ,u,θ(v)=ρ(2πθ)3/2exp⁡ ⁣(−∥v−u∥22θ),M_{\rho,u,\theta}(v)=\frac{\rho}{(2\pi\theta)^{3/2}}\exp\!\Big(-\frac{\lVert v-u\rVert^2}{2\theta}\Big),Mρ,u,θ​(v)=(2πθ)3/2ρ​exp(−2θ∥v−u∥2​),

where (2πθ)3/2(2\pi\theta)^{3/2}(2πθ)3/2 is a real power: for 2πθ≤02\pi\theta\le 02πθ≤0 this is the real-power convention (in particular it is 000 when 2πθ=02\pi\theta=02πθ=0, making the quotient a division by zero, which is 000), and no positivity of ρ\rhoρ or θ\thetaθ is required by the definition itself. The local Maxwellian of fff is the function v↦Mρ[f], u[f], θ[f](v)v\mapsto M_{\rho[f],\,u[f],\,\theta[f]}(v)v↦Mρ[f],u[f],θ[f]​(v), i.e. the parameters are read off from fff by the three formulas above. The collision operator is, for a real τ\tauτ,

Cτ[f](v)=−1τ(f(v)−Mρ[f],u[f],θ[f](v)),C_\tau[f](v)=-\frac1\tau\big(f(v)-M_{\rho[f],u[f],\theta[f]}(v)\big),Cτ​[f](v)=−τ1​(f(v)−Mρ[f],u[f],θ[f]​(v)),

with 1/τ1/\tau1/τ again total division, so C0[f]=0C_0[f]=0C0​[f]=0 identically.

Two predicates are defined. A function fff is an admissible state when all three of the following hold: f(v)>0f(v)>0f(v)>0 for every v∈Vv\in Vv∈V (strict, at every point, not almost everywhere); fff is integrable; and v↦∥v∥2f(v)v\mapsto \lVert v\rVert^2 f(v)v↦∥v∥2f(v) is integrable. Note the second moment is taken about the origin, not about u[f]u[f]u[f].

A family f(t,x,v)f(t,x,v)f(t,x,v), with t∈Rt\in\mathbb Rt∈R and x,v∈Vx,v\in Vx,v∈V, is a BGK solution with parameter τ\tauτ when all three of the following hold: for all x,vx,vx,v the map t↦f(t,x,v)t\mapsto f(t,x,v)t↦f(t,x,v) is differentiable on all of R\mathbb RR; for all t,vt,vt,v the map x↦f(t,x,v)x\mapsto f(t,x,v)x↦f(t,x,v) is (Fréchet) differentiable on all of VVV; and for all t,x,vt,x,vt,x,v,

∂∂tf(t,x,v)+(Dxf(t,⋅,v))x[v]  =  Cτ[f(t,x,⋅)](v),\frac{\partial}{\partial t}f(t,x,v) + \big(D_x f(t,\cdot,v)\big)_x[v] \;=\; C_\tau\big[f(t,x,\cdot)\big](v),∂t∂​f(t,x,v)+(Dx​f(t,⋅,v))x​[v]=Cτ​[f(t,x,⋅)](v),

where (Dxf)x[v](D_x f)_x[v](Dx​f)x​[v] is the derivative in the position variable evaluated on the vector vvv — that is, the directional derivative of f(t,⋅,v)f(t,\cdot,v)f(t,⋅,v) at xxx in the direction vvv — and the right-hand side applies the collision operator to the velocity profile f(t,x,⋅)f(t,x,\cdot)f(t,x,⋅) at the frozen time ttt and position xxx, so its density, bulk velocity and temperature are those of that profile.

No claim is asserted by this bundle; it introduces notation only. Degenerate inputs are not excluded anywhere: ρ[f]=0\rho[f]=0ρ[f]=0, θ[f]≤0\theta[f]\le0θ[f]≤0, τ=0\tau=0τ=0, and non-integrable fff all produce well-defined junk values rather than errors.

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