Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Equation of state in FLRW cosmology: basic definitions

Definition
CosmologyEOS_Defs

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

cosmologymathematical-physics

Shared definitions for the mission, for real-valued functions of time ttt: scale factor a(t)a(t)a(t), energy density ε(t)\varepsilon(t)ε(t), pressure p(t)p(t)p(t), Newton's constant GGG, cosmological constant Λ\LambdaΛ.

  1. Equation-of-state parameter w=p/εw = p/\varepsilonw=p/ε (eosParameter p ε).
  2. Fluid equation at time ttt: ε˙(t)=−3 a˙(t)a(t) (ε(t)+p(t))\dot\varepsilon(t) = -3\,\dfrac{\dot a(t)}{a(t)}\,(\varepsilon(t)+p(t))ε˙(t)=−3a(t)a˙(t)​(ε(t)+p(t)) (FluidEquation a ε p t).
  3. Flat Friedmann equation at time ttt: (a˙(t)a(t))2=8πG3ε(t)\left(\dfrac{\dot a(t)}{a(t)}\right)^2 = \dfrac{8\pi G}{3}\varepsilon(t)(a(t)a˙(t)​)2=38πG​ε(t) (FlatFriedmannEquation G a ε t).
  4. Acceleration equation at time ttt: 3 a¨(t)a(t)=Λ−4πG(ε(t)+3p(t))3\,\dfrac{\ddot a(t)}{a(t)} = \Lambda - 4\pi G(\varepsilon(t)+3p(t))3a(t)a¨(t)​=Λ−4πG(ε(t)+3p(t)) (AccelerationEquation G Λ a ε p t).
  5. Effective energy density and pressure: ε′=ε+Λ8πG\varepsilon' = \varepsilon + \dfrac{\Lambda}{8\pi G}ε′=ε+8πGΛ​, p′=p−Λ8πGp' = p - \dfrac{\Lambda}{8\pi G}p′=p−8πGΛ​.
  6. Scalar-field equation of state: w(ϕ˙,V)=12ϕ˙2−V12ϕ˙2+Vw(\dot\phi, V) = \dfrac{\frac12\dot\phi^2 - V}{\frac12\dot\phi^2 + V}w(ϕ˙​,V)=21​ϕ˙​2+V21​ϕ˙​2−V​.

These are the objects in which every statement of the mission is phrased.

Formalization Note Derivatives are Mathlib's deriv, which returns 000 at points of non-differentiability, so theorems assume differentiability explicitly. Divisions are total and return 000 on a zero denominator; theorems assume nonzero denominators where it matters.

Definition code
import Mathlib

/-!
# Equation of state in FLRW cosmology — shared definitions

Source: Wikipedia, "Equation of state (cosmology)", revision 1375011367.
All quantities are real-valued; time is a real variable `t`, the scale factor is `a : ℝ → ℝ`,
the energy density is `ε : ℝ → ℝ` and the pressure is `p : ℝ → ℝ` (units with `c = 1`
in the FLRW part).
-/

namespace CosmologyEOS

open Real

/-- The equation-of-state parameter `w = p / ε` of a perfect fluid with pressure `p` and
energy density `ε`. (As a total function it returns `0` when `ε = 0`; theorems that use it
assume `ε ≠ 0`.) -/
noncomputable def eosParameter (p ε : ℝ) : ℝ := p / ε

/-- The FLRW fluid (energy-conservation) equation at time `t`:
`ε̇(t) = -3 (ȧ(t)/a(t)) (ε(t) + p(t))`. -/
def FluidEquation (a ε p : ℝ → ℝ) (t : ℝ) : Prop :=
  deriv ε t = -3 * (deriv a t / a t) * (ε t + p t)

/-- The Friedmann equation of a spatially flat FLRW universe (no cosmological constant)
at time `t`: `(ȧ(t)/a(t))² = (8πG/3) ε(t)`. -/
def FlatFriedmannEquation (G : ℝ) (a ε : ℝ → ℝ) (t : ℝ) : Prop :=
  (deriv a t / a t) ^ 2 = 8 * π * G / 3 * ε t

/-- The Friedmann acceleration equation at time `t`:
`3 ä(t)/a(t) = Λ - 4πG (ε(t) + 3 p(t))`. -/
def AccelerationEquation (G Λ : ℝ) (a ε p : ℝ → ℝ) (t : ℝ) : Prop :=
  3 * (deriv (deriv a) t / a t) = Λ - 4 * π * G * (ε t + 3 * p t)

/-- The effective energy density `ε' = ε + Λ / (8πG)`. -/
noncomputable def effectiveEnergyDensity (G Λ ε : ℝ) : ℝ := ε + Λ / (8 * π * G)

/-- The effective pressure `p' = p - Λ / (8πG)`. -/
noncomputable def effectivePressure (G Λ p : ℝ) : ℝ := p - Λ / (8 * π * G)

/-- The equation-of-state parameter of a homogeneous scalar field with time derivative
`φ̇ = phiDot` and potential energy `V`:
`w = (½ φ̇² - V) / (½ φ̇² + V)` (equal to `0` when the denominator vanishes). -/
noncomputable def scalarFieldEOS (phiDot V : ℝ) : ℝ :=
  (phiDot ^ 2 / 2 - V) / (phiDot ^ 2 / 2 + V)

end CosmologyEOS
Source
Wikipedia, "Equation of state (cosmology)", revision 1375011367, https://en.wikipedia.org/w/index.php?title=Equation_of_state_(cosmology)&oldid=1375011367, sections: lead (w = p/ε), 'FLRW equations and the equation of state', 'Scalar modeling'
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 statement below, with full knowledge of the source text and of the intended meaning. It was not produced by a blind, independent auditor, so it must not be mistaken for independent testimony; reviewers should compare the Lean code with the source themselves.

The file declares, in the namespace CosmologyEOS, the following objects (all real numbers or real functions of a real variable ttt).

  • eosParameter(p,ε)=p/ε\mathrm{eosParameter}(p,\varepsilon) = p/\varepsiloneosParameter(p,ε)=p/ε, with the convention that the value is 000 when ε=0\varepsilon = 0ε=0.
  • FluidEquation(a,ε,p,t)\mathrm{FluidEquation}(a,\varepsilon,p,t)FluidEquation(a,ε,p,t) is the proposition ε′(t)=−3⋅a′(t)a(t)⋅(ε(t)+p(t))\varepsilon^{\prime}(t) = -3\cdot\dfrac{a^{\prime}(t)}{a(t)}\cdot(\varepsilon(t)+p(t))ε′(t)=−3⋅a(t)a′(t)​⋅(ε(t)+p(t)), where f′(t)f^{\prime}(t)f′(t) is the derivative of fff at ttt if fff is differentiable there and 000 otherwise, and x/0=0x/0 = 0x/0=0.
  • FlatFriedmannEquation(G,a,ε,t)\mathrm{FlatFriedmannEquation}(G,a,\varepsilon,t)FlatFriedmannEquation(G,a,ε,t) is the proposition (a′(t)a(t))2=8πG3 ε(t)\left(\dfrac{a^{\prime}(t)}{a(t)}\right)^2 = \dfrac{8\pi G}{3}\,\varepsilon(t)(a(t)a′(t)​)2=38πG​ε(t) (same conventions).
  • AccelerationEquation(G,Λ,a,ε,p,t)\mathrm{AccelerationEquation}(G,\Lambda,a,\varepsilon,p,t)AccelerationEquation(G,Λ,a,ε,p,t) is the proposition 3⋅a′′(t)a(t)=Λ−4πG(ε(t)+3p(t))3\cdot\dfrac{a^{\prime\prime}(t)}{a(t)} = \Lambda - 4\pi G(\varepsilon(t)+3p(t))3⋅a(t)a′′(t)​=Λ−4πG(ε(t)+3p(t)), where a′′a^{\prime\prime}a′′ is the derivative (same convention) of the derivative function of aaa.
  • effectiveEnergyDensity(G,Λ,ε)=ε+Λ/(8πG)\mathrm{effectiveEnergyDensity}(G,\Lambda,\varepsilon) = \varepsilon + \Lambda/(8\pi G)effectiveEnergyDensity(G,Λ,ε)=ε+Λ/(8πG) and effectivePressure(G,Λ,p)=p−Λ/(8πG)\mathrm{effectivePressure}(G,\Lambda,p) = p - \Lambda/(8\pi G)effectivePressure(G,Λ,p)=p−Λ/(8πG); both reduce to ε\varepsilonε, resp. ppp, when G=0G = 0G=0 (division by zero gives 000).
  • scalarFieldEOS(ϕ˙,V)=ϕ˙2/2−Vϕ˙2/2+V\mathrm{scalarFieldEOS}(\dot\phi, V) = \dfrac{\dot\phi^2/2 - V}{\dot\phi^2/2 + V}scalarFieldEOS(ϕ˙​,V)=ϕ˙​2/2+Vϕ˙​2/2−V​, equal to 000 when ϕ˙2/2+V=0\dot\phi^2/2 + V = 0ϕ˙​2/2+V=0.

No hypotheses are attached to any of these definitions; positivity, differentiability and nonvanishing conditions must be supplied by the theorems that use them.

Human review
  • Endorsed by marwahaha · Oct 21, 2026

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