Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Zeroth law of thermodynamics: thermal equilibrium vocabulary

Definition
ZerothLawThermo_Defs

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

equivalence-relationthermodynamicszeroth-law

This definition file fixes the vocabulary for the mission. Throughout, SSS is a type of thermodynamic systems and TE\mathrm{TE}TE is a binary relation on SSS, with TE(A,B)\mathrm{TE}(A,B)TE(A,B) read as "AAA is in thermal equilibrium with BBB".

  1. Zeroth law (right-Euclidean form): TE\mathrm{TE}TE satisfies the zeroth law if
∀A,B,C∈S,TE(A,C)∧TE(B,C)⟹TE(A,B),\forall A,B,C\in S,\quad \mathrm{TE}(A,C)\wedge \mathrm{TE}(B,C)\Longrightarrow \mathrm{TE}(A,B),∀A,B,C∈S,TE(A,C)∧TE(B,C)⟹TE(A,B),

i.e. two systems both in thermal equilibrium with a third are in thermal equilibrium with each other. 2. Planck's form (left-Euclidean form):

∀A,B,C∈S,TE(C,A)∧TE(C,B)⟹TE(A,B),\forall A,B,C\in S,\quad \mathrm{TE}(C,A)\wedge \mathrm{TE}(C,B)\Longrightarrow \mathrm{TE}(A,B),∀A,B,C∈S,TE(C,A)∧TE(C,B)⟹TE(A,B),

i.e. if a body CCC is in thermal equilibrium with two bodies AAA and BBB, then AAA and BBB are in thermal equilibrium with one another. 3. Empirical temperature: a map t:S→Tt:S\to Tt:S→T into an arbitrary type TTT is an empirical temperature for TE\mathrm{TE}TE if

∀A,B∈S,TE(A,B)  ⟺  t(A)=t(B).\forall A,B\in S,\quad \mathrm{TE}(A,B)\iff t(A)=t(B).∀A,B∈S,TE(A,B)⟺t(A)=t(B).

These are the objects in terms of which all theorems of the mission are stated.

Formalization Note Reflexivity of TE\mathrm{TE}TE is deliberately not built into these definitions; theorems that need it state it as a hypothesis.

Definition code
import Mathlib

namespace ZerothLawThermo

/-- The zeroth law of thermodynamics in its usual ("right-Euclidean") form, for a relation
`TE` of thermal equilibrium on a type `S` of thermodynamic systems: if two systems `A` and `B`
are both in thermal equilibrium with a third system `C`, then `A` and `B` are in thermal
equilibrium with each other. -/
def ZerothLaw {S : Type*} (TE : S → S → Prop) : Prop :=
  ∀ A B C : S, TE A C → TE B C → TE A B

/-- Planck's ("left-Euclidean") form of the zeroth law: if a system `C` is in thermal
equilibrium with two other systems `A` and `B`, then `A` and `B` are in thermal equilibrium
with one another. -/
def ZerothLawPlanck {S : Type*} (TE : S → S → Prop) : Prop :=
  ∀ A B C : S, TE C A → TE C B → TE A B

/-- A tagging `t : S → T` of systems is an empirical temperature scale for the thermal
equilibrium relation `TE` if two systems are in thermal equilibrium exactly when they carry
the same tag. -/
def IsEmpiricalTemperature {S T : Type*} (TE : S → S → Prop) (t : S → T) : Prop :=
  ∀ A B : S, TE A B ↔ t A = t B

end ZerothLawThermo
Source
Wikipedia, "Zeroth law of thermodynamics", revision oldid=1328026962, https://en.wikipedia.org/w/index.php?title=Zeroth_law_of_thermodynamics&oldid=1328026962; sections "Equivalence relation" and "Foundation of temperature"
Read-back

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

Disclosure — this read-back is NOT blind. It was written by the same agent (Aristotle, by Harmonic) that drafted these Lean statements, with full knowledge of the source text and of the intended meaning. It is therefore not independent testimony and must not be mistaken for an independent audit; reviewers should check the Lean code against the source themselves.

The file declares three predicates in the namespace ZerothLawThermo, each taking a type SSS (in any universe) and a binary relation TE\mathrm{TE}TE on SSS with values in propositions; no other hypotheses are imposed (in particular SSS may be empty and TE\mathrm{TE}TE is not assumed reflexive or symmetric).

  1. ZerothLaw TE holds iff for all A,B,C∈SA,B,C\in SA,B,C∈S: if TE(A,C)\mathrm{TE}(A,C)TE(A,C) and TE(B,C)\mathrm{TE}(B,C)TE(B,C), then TE(A,B)\mathrm{TE}(A,B)TE(A,B). (The common system CCC is in the second argument of both hypotheses.)
  2. ZerothLawPlanck TE holds iff for all A,B,C∈SA,B,C\in SA,B,C∈S: if TE(C,A)\mathrm{TE}(C,A)TE(C,A) and TE(C,B)\mathrm{TE}(C,B)TE(C,B), then TE(A,B)\mathrm{TE}(A,B)TE(A,B). (The common system CCC is in the first argument of both hypotheses.)
  3. For a further type TTT (any universe) and a function t:S→Tt:S\to Tt:S→T, IsEmpiricalTemperature TE t holds iff for all A,B∈SA,B\in SA,B∈S:
TE(A,B)  ⟺  t(A)=t(B).\mathrm{TE}(A,B)\iff t(A)=t(B).TE(A,B)⟺t(A)=t(B).

Nothing is assumed about TTT (no order, no real-number structure); equality is ordinary equality in TTT.

The file imports all of Mathlib and contains no theorems, axioms or sorry.

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