Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Onsager reciprocal relations: Gaussian fluctuations, relaxation and kinetic coefficients

Definition
OnsagerReciprocal_basic

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

mathematical-physicsonsagerthermodynamics

Basic objects of the abstract (Landau–Lifshitz) formulation of the Onsager reciprocal relations, all living in the namespace OnsagerReciprocal.

Let x=(x1,…,xn)∈Rnx=(x_1,\dots,x_n)\in\mathbb R^nx=(x1​,…,xn​)∈Rn be fluctuations of nnn thermodynamic quantities from their equilibrium values, and let β\betaβ be a real n×nn\times nn×n matrix (in the source, βik=−1k ∂2S/∂xi∂xk\beta_{ik}=-\frac1k\,\partial^2 S/\partial x_i\partial x_kβik​=−k1​∂2S/∂xi​∂xk​, a positive definite symmetric matrix) and λ\lambdaλ a real n×nn\times nn×n matrix (the relaxation matrix in x˙i=−λikxk\dot x_i=-\lambda_{ik}x_kx˙i​=−λik​xk​).

  1. Fluctuation weight. wβ(x)=exp⁡ ⁣(−12 βikxixk)w_\beta(x)=\exp\!\big(-\tfrac12\,\beta_{ik}x_ix_k\big)wβ​(x)=exp(−21​βik​xi​xk​) (Einstein summation), the unnormalized Gaussian probability density of the fluctuations.
  2. Equilibrium average. For f:Rn→Rf:\mathbb R^n\to\mathbb Rf:Rn→R,
⟨f⟩β=∫Rnf(x) wβ(x) dx∫Rnwβ(x) dx.\langle f\rangle_\beta=\frac{\int_{\mathbb R^n} f(x)\,w_\beta(x)\,dx}{\int_{\mathbb R^n} w_\beta(x)\,dx}.⟨f⟩β​=∫Rn​wβ​(x)dx∫Rn​f(x)wβ​(x)dx​.
  1. Conjugate quantities. Xi=βikxkX_i=\beta_{ik}x_kXi​=βik​xk​.
  2. Mean relaxation. ξ(t;x0)=e−tλx0\xi(t;x_0)=e^{-t\lambda}x_0ξ(t;x0​)=e−tλx0​, the mean value at time ttt of the fluctuation that takes the value x0x_0x0​ at t=0t=0t=0 (the solution of ξ˙=−λξ\dot\xi=-\lambda\xiξ˙​=−λξ, ξ(0)=x0\xi(0)=x_0ξ(0)=x0​); and Ξ(t;x0)=β ξ(t;x0)\Xi(t;x_0)=\beta\,\xi(t;x_0)Ξ(t;x0​)=βξ(t;x0​).
  3. Kinetic coefficients. γ=λβ−1\gamma=\lambda\beta^{-1}γ=λβ−1, i.e. γik=λil(β−1)lk\gamma_{ik}=\lambda_{il}(\beta^{-1})_{lk}γik​=λil​(β−1)lk​.
  4. Time correlation. Cik(t)=⟨xi(t) xk(0)⟩=⟨ξi(t;x) xk⟩βC_{ik}(t)=\langle x_i(t)\,x_k(0)\rangle=\langle \xi_i(t;x)\,x_k\rangle_\betaCik​(t)=⟨xi​(t)xk​(0)⟩=⟨ξi​(t;x)xk​⟩β​.

These are the objects in which Onsager's principle γik=γki\gamma_{ik}=\gamma_{ki}γik​=γki​ and the intermediate steps of its proof are stated.

Formalization Note Vectors are functions Fin n → ℝ with the product Lebesgue measure. The average is a ratio of Bochner integrals, so it returns junk values (000) if an integrand is not integrable; all theorems using it assume β\betaβ positive definite, which makes every integrand used integrable. The matrix inverse β⁻¹ is Mathlib's Matrix.inv (zero for singular matrices). The entropy SSS and Boltzmann's constant are not modelled: β\betaβ is taken as the primitive datum, exactly as in the source's statement of the principle.

Definition code
import Mathlib

/-!
# Onsager reciprocal relations — basic objects (abstract formulation)

Source: Wikipedia, "Onsager reciprocal relations", section "Abstract formulation" and its
"Proof" subsection (oldid=1355014688), following Landau–Lifshitz, *Statistical Physics, Part 1*.

* `x = (x₁, …, xₙ)` are fluctuations from equilibrium, distributed with the (unnormalized)
  Gaussian weight `w(x) = exp(-½ βᵢₖ xᵢ xₖ)`.
* `Xᵢ = βᵢₖ xₖ` are the thermodynamic conjugate quantities.
* In the quasi-stationary regime `ẋ = -λ x`; the mean value of the fluctuation at time `t`,
  starting from the value `x₀` at `t = 0`, is `ξ(t) = exp(-t λ) x₀`, and `Ξ(t) = β ξ(t)`.
* `γ = λ β⁻¹` are the kinetic coefficients.
-/

namespace OnsagerReciprocal

open Matrix MeasureTheory

variable {n : ℕ}

/-- The unnormalized Gaussian fluctuation weight `w(x) = exp(-½ ∑ᵢₖ βᵢₖ xᵢ xₖ)`. -/
noncomputable def fluctuationWeight (β : Matrix (Fin n) (Fin n) ℝ) (x : Fin n → ℝ) : ℝ :=
  Real.exp (-(1 / 2) * (x ⬝ᵥ (β *ᵥ x)))

/-- The equilibrium average `⟨f⟩ = (∫ f(x) w(x) dx) / (∫ w(x) dx)` with respect to the
Gaussian fluctuation distribution (Lebesgue measure on `ℝⁿ`). -/
noncomputable def fluctuationAverage (β : Matrix (Fin n) (Fin n) ℝ)
    (f : (Fin n → ℝ) → ℝ) : ℝ :=
  (∫ x, f x * fluctuationWeight β x) / ∫ x, fluctuationWeight β x

/-- The thermodynamic conjugate quantities `Xᵢ = βᵢₖ xₖ`. -/
def conjugate (β : Matrix (Fin n) (Fin n) ℝ) (x : Fin n → ℝ) : Fin n → ℝ :=
  β *ᵥ x

/-- The mean value `ξ(t) = exp(-t λ) x₀` of the fluctuation at time `t`, given that it takes
the value `x₀` at `t = 0`; it is the solution of `ξ̇ = -λ ξ`, `ξ(0) = x₀`. -/
noncomputable def meanFluctuation (lam : Matrix (Fin n) (Fin n) ℝ) (t : ℝ)
    (x₀ : Fin n → ℝ) : Fin n → ℝ :=
  NormedSpace.exp ((-t) • lam) *ᵥ x₀

/-- The mean value `Ξ(t) = β ξ(t)` of the conjugate quantities at time `t`. -/
noncomputable def meanConjugate (β lam : Matrix (Fin n) (Fin n) ℝ) (t : ℝ)
    (x₀ : Fin n → ℝ) : Fin n → ℝ :=
  β *ᵥ meanFluctuation lam t x₀

/-- The kinetic coefficients `γ = λ β⁻¹`, i.e. `γᵢₖ = λᵢₗ (β⁻¹)ₗₖ`. -/
noncomputable def kineticCoeff (β lam : Matrix (Fin n) (Fin n) ℝ) :
    Matrix (Fin n) (Fin n) ℝ :=
  lam * β⁻¹

/-- The time correlation `⟨xᵢ(t) xₖ(0)⟩ = ⟨ξᵢ(t) xₖ⟩` in the equilibrium ensemble. -/
noncomputable def timeCorrelation (β lam : Matrix (Fin n) (Fin n) ℝ) (t : ℝ)
    (i k : Fin n) : ℝ :=
  fluctuationAverage β (fun x => meanFluctuation lam t x i * x k)

end OnsagerReciprocal
Source
Wikipedia, "Onsager reciprocal relations", https://en.wikipedia.org/w/index.php?title=Onsager_reciprocal_relations&oldid=1355014688, section "Abstract formulation" and its "Proof" subsection (pp. 5-6 of the PDF export), following L. D. Landau, E. M. Lifshitz, Statistical Physics, Part 1 (1975). Definitions: w = Ã exp(-½ β_ik x_i x_k); X_i = β_ik x_k; ẋ_i = -λ_ik x_k; γ_ik = λ_il β⁻¹_lk; mean values ξ_i(t), Ξ_i(t) (Proof).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Non-blind read-back — not independent testimony. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement, with full knowledge of the source text and of the intended meaning. It was not produced by a blind, independent auditor, so reviewers must not treat it as independent testimony; compare the Lean code against the source yourself.

This file declares, for every n∈Nn\in\mathbb Nn∈N and real n×nn\times nn×n matrices β,λ\beta,\lambdaβ,λ (no hypotheses are imposed by the definitions themselves):

  1. wβ(x)=exp⁡(−12∑i,kxiβikxk)w_\beta(x)=\exp\big(-\tfrac12\sum_{i,k}x_i\beta_{ik}x_k\big)wβ​(x)=exp(−21​∑i,k​xi​βik​xk​) for x∈Rnx\in\mathbb R^nx∈Rn.
  2. For any real function fff on Rn\mathbb R^nRn, ⟨f⟩β\langle f\rangle_\beta⟨f⟩β​ is the real number (∫f wβ dx)/(∫wβ dx)\big(\int f\,w_\beta\,dx\big)\big/\big(\int w_\beta\,dx\big)(∫fwβ​dx)/(∫wβ​dx), integrals with respect to Lebesgue measure on Rn\mathbb R^nRn. If f wβf\,w_\betafwβ​ is not Lebesgue integrable its integral is taken to be 000; if the denominator is 000 (e.g. wβw_\betawβ​ not integrable, which happens for instance when β=0\beta=0β=0) the quotient is 000.
  3. X=βxX=\beta xX=βx (matrix–vector product).
  4. ξ(t;x0)=exp⁡((−t)λ) x0\xi(t;x_0)=\exp((-t)\lambda)\,x_0ξ(t;x0​)=exp((−t)λ)x0​, where exp⁡\expexp is the matrix exponential series; Ξ(t;x0)=β ξ(t;x0)\Xi(t;x_0)=\beta\,\xi(t;x_0)Ξ(t;x0​)=βξ(t;x0​). Defined for all real ttt, including negative ttt.
  5. γ=λ β−1\gamma=\lambda\,\beta^{-1}γ=λβ−1, where β−1\beta^{-1}β−1 is the true inverse when det⁡β≠0\det\beta\neq 0detβ=0 and the zero matrix otherwise (so γ=0\gamma=0γ=0 for singular β\betaβ).
  6. Cik(t)=⟨ x↦ξi(t;x) xk ⟩βC_{ik}(t)=\langle\, x\mapsto \xi_i(t;x)\,x_k\,\rangle_\betaCik​(t)=⟨x↦ξi​(t;x)xk​⟩β​ for i,k∈{1,…,n}i,k\in\{1,\dots,n\}i,k∈{1,…,n}.

When n=0n=0n=0 all vectors are empty, R0\mathbb R^0R0 carries the unit point mass, wβ≡1w_\beta\equiv1wβ​≡1, and every average of a function fff equals fff at the unique point.

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