Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Composition law f(T1,T3)=f(T1,T2)f(T2,T3)f(T_1,T_3)=f(T_1,T_2)f(T_2,T_3)f(T1​,T3​)=f(T1​,T2​)f(T2​,T3​) for the Carnot heat ratio

Proved
SecondLawThermo.carnot_ratio_mul

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

carnotmathematical-physicssecond-lawthermodynamics

Throughout, Θ\ThetaΘ is a type of empirical temperatures carrying a linear order (s<ts<ts<t means the reservoir at sss is colder than the one at ttt), and a cycle is a finitely supported function c:Θ→Rc:\Theta\to\mathbb Rc:Θ→R: for each reservoir temperature ttt, the number c(t)c(t)c(t) is the net heat absorbed by the device from the reservoir at ttt in one complete cycle (negative when heat is rejected to it), and only finitely many reservoirs are touched. The work delivered in the cycle is

W(c)=∑tc(t),W(c)=\sum_{t} c(t),W(c)=t∑​c(t),

which is the first law for a device returning to its initial state. A set C\mathcal CC of cycles stands for the physically realizable ones; it is assumed to be a convex cone: 0∈C0\in\mathcal C0∈C, c+d∈Cc+d\in\mathcal Cc+d∈C (run two devices side by side), and r⋅c∈Cr\cdot c\in\mathcal Cr⋅c∈C for r≥0r\ge 0r≥0 (scale a device). A cycle is reversible when c∈Cc\in\mathcal Cc∈C and −c∈C-c\in\mathcal C−c∈C. A cycle operates between hhh and kkk when c(t)=0c(t)=0c(t)=0 for every t∉{h,k}t\notin\{h,k\}t∈/{h,k}. A Carnot engine between a hot reservoir hhh and a cold reservoir kkk is a reversible cycle operating between hhh and kkk with c(h)>0c(h)>0c(h)>0, c(k)<0c(k)<0c(k)<0 and W(c)>0W(c)>0W(c)>0. The efficiency relative to the hot reservoir is η=W(c)/c(h)\eta=W(c)/c(h)η=W(c)/c(h).

Statement. Let C\mathcal CC be a convex cone of realizable cycles satisfying the Clausius statement and let T3<T2<T1T_3<T_2<T_1T3​<T2​<T1​ be three reservoir temperatures. Let e1e_1e1​ be a Carnot engine between T1T_1T1​ and T3T_3T3​, e2e_2e2​ one between T1T_1T1​ and T2T_2T2​, and e3e_3e3​ one between T2T_2T2​ and T3T_3T3​. Then the heat ratios compose:

∣e1(T3)∣∣e1(T1)∣=∣e2(T2)∣∣e2(T1)∣⋅∣e3(T3)∣∣e3(T2)∣.\frac{|e_1(T_3)|}{|e_1(T_1)|}=\frac{|e_2(T_2)|}{|e_2(T_1)|}\cdot\frac{|e_3(T_3)|}{|e_3(T_2)|}.∣e1​(T1​)∣∣e1​(T3​)∣​=∣e2​(T1​)∣∣e2​(T2​)∣​⋅∣e3​(T2​)∣∣e3​(T3​)∣​.

Writing f(TH,TC)=∣qC∣/∣qH∣f(T_{\mathrm H},T_{\mathrm C})=|q_{\mathrm C}|/|q_{\mathrm H}|f(TH​,TC​)=∣qC​∣/∣qH​∣ for the (substance-independent) ratio of a reversible engine, this is the article's identity f(T1,T3)=f(T1,T2) f(T2,T3)f(T_1,T_3)=f(T_1,T_2)\,f(T_2,T_3)f(T1​,T3​)=f(T1​,T2​)f(T2​,T3​): a reversible engine between T1T_1T1​ and T3T_3T3​ has the same efficiency as the two-cycle engine passing through an intermediate reservoir at T2T_2T2​, the heat q2q_2q2​ passing through the intermediate reservoir without loss.

Preamble
import Definitions.Def_SecondLawThermo_Defs
import Mathlib

Formal statement
namespace SecondLawThermo

theorem carnot_ratio_mul {Θ : Type*} [LinearOrder Θ] (𝒞 : Set (Cycle Θ))
    (h𝒞 : IsCycleCone 𝒞) (hCl : ClausiusStatement 𝒞) (T₁ T₂ T₃ : Θ)
    (h₃₂ : T₃ < T₂) (h₂₁ : T₂ < T₁) (e₁ e₂ e₃ : Cycle Θ)
    (he₁ : IsCarnotEngine 𝒞 e₁ T₁ T₃) (he₂ : IsCarnotEngine 𝒞 e₂ T₁ T₂)
    (he₃ : IsCarnotEngine 𝒞 e₃ T₂ T₃) :
    |e₁ T₃| / |e₁ T₁| = (|e₂ T₂| / |e₂ T₁|) * (|e₃ T₃| / |e₃ T₂|) := by sorry

end SecondLawThermo
Source
Wikipedia, "Second law of thermodynamics", revision oldid=1378607758, https://en.wikipedia.org/w/index.php?title=Second_law_of_thermodynamics&oldid=1378607758; section "Thermodynamic temperature": the derivation of f(T1,T3)=f(T1,T2)f(T2,T3)f(T_1,T_3)=f(T_1,T_2)f(T_2,T_3)f(T1​,T3​)=f(T1​,T2​)f(T2​,T3​)
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic), the drafting agent itself; non-blind read-back

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.

Let Θ\ThetaΘ be linearly ordered and C\mathcal CC a set of finitely supported functions Θ→R\Theta\to\mathbb RΘ→R, with W(c):=∑tc(t)W(c):=\sum_t c(t)W(c):=∑t​c(t); assume 0∈C0\in\mathcal C0∈C and closure under addition and under scaling by nonnegative reals, and that for all k<hk<hk<h every d∈Cd\in\mathcal Cd∈C vanishing outside {h,k}\{h,k\}{h,k} with W(d)=0W(d)=0W(d)=0 has d(k)≤0d(k)\le0d(k)≤0. Let T3<T2<T1T_3<T_2<T_1T3​<T2​<T1​ in Θ\ThetaΘ, and let e1,e2,e3e_1,e_2,e_3e1​,e2​,e3​ each satisfy, for the indicated pair of temperatures (h,k)(h,k)(h,k) — namely (T1,T3)(T_1,T_3)(T1​,T3​), (T1,T2)(T_1,T_2)(T1​,T2​) and (T2,T3)(T_2,T_3)(T2​,T3​) respectively — that it and its negation lie in C\mathcal CC, it vanishes outside {h,k}\{h,k\}{h,k}, its value at hhh is positive, its value at kkk is negative, and its total sum is positive. Then

∣e1(T3)∣∣e1(T1)∣=(∣e2(T2)∣∣e2(T1)∣)(∣e3(T3)∣∣e3(T2)∣).\frac{|e_1(T_3)|}{|e_1(T_1)|}=\left(\frac{|e_2(T_2)|}{|e_2(T_1)|}\right)\left(\frac{|e_3(T_3)|}{|e_3(T_2)|}\right).∣e1​(T1​)∣∣e1​(T3​)∣​=(∣e2​(T1​)∣∣e2​(T2​)∣​)(∣e3​(T2​)∣∣e3​(T3​)∣​).

All six quantities inside the absolute values are nonzero by the sign hypotheses, so no division by zero occurs. The three engines are arbitrary subject to those hypotheses: no relation between the sizes of e1e_1e1​, e2e_2e2​ and e3e_3e3​ is assumed, in particular not that the heat rejected by e2e_2e2​ at T2T_2T2​ equals the heat absorbed by e3e_3e3​ at T2T_2T2​.

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