Consider an original abstract data type whose values are rational numbers. Store an ordered pair of integers, interpreted as a numerator and a denominator. Use exact, unbounded integer arithmetic in this model. The storage space, representation invariant and abstraction function are
The representation invariant does not require a positive denominator or a reduced fraction. Consequently , and are three different concrete states with the same abstract rational number . Similarly, and both represent zero. The abstraction function is a surjection: every rational number has an integer numerator and a nonzero integer denominator, so every abstract value has a representation.
Figure 1.
Several valid integer pairs represent one rational value; zero denominators have no abstract value
. Details.
Both and violate the representation invariant; neither has a value under this abstraction function. By contrast, is completely valid. Simplifying it to the reduced fraction may be a useful implementation choice, but is not a requirement of this representation. Strengthening the representation invariant to require a positive denominator and a greatest common divisor of one would choose a unique stored representative for each rational number; every constructor and operation would then need to establish that stronger condition.
Equality of abstract values is therefore different from equality of stored ordered pairs. For valid and ,
This defines an equivalence relation on : each equivalence class contains all representations of one rational number. An API equality operation can compare these cross-products using exact integer arithmetic. Comparing the two fields individually would incorrectly declare and unequal as rational numbers. The general reason is that an abstraction function may map several concrete values to one abstract value.[ref]
Zeroth law of thermodynamics Created 2026-10-14 Updated 2026-10-20
If two thermodynamic systems are each in thermal equilibrium with the same third system in the same equilibrium state, they are in thermal equilibrium with each other. Write for this relation. The zeroth law of thermodynamics supplies transitivity:
Its symmetric relation property and self-equilibrium (reflexivity), together with transitivity, make thermal equilibrium an equivalence relation. Its equivalence classes can be labelled by a common empirical temperature; choosing an absolute numerical scale requires the further structure of thermodynamic temperature.[ref]
The comparison assumes internally equilibrated macroscopic bodies, unchanged composition and mechanical constraints, and contact permitting only heat exchange. Use rigid, impermeable diathermal walls so that neither matter transfer nor boundary work spoils the test. The same state of matters: letting warm while measuring , then cool while measuring , does not supply the premise. Ordinary nonrelativistic laboratory thermodynamics is assumed; the Tolman temperature law treats gravitational qualifications. Equal temperatures establish the thermal condition, without requiring mechanical equilibrium or chemical equilibrium.
Figure 1.
Thermal equilibrium is transitive; an adiabatic wall supplies no equality test
. The top row compares and separately with the same equilibrium state of reference . The lower left shows the predicted absence of net heat transfer when and are put in thermal contact. The lower right is a counterexample to inferring equality from insulation: a rigid adiabatic wall can separate bodies at different temperatures. All numerical labels are illustrative. Details.
This explains why a thermometer can compare unlike materials: it supplies a reusable third system. A temperature is a property of an equilibrium state, while heat is energy transferred because of a temperature difference. Two bodies at the same temperature can have different internal energies and heat capacities. A thermometer therefore does not measure a body's stored amount of heat; the finite-body disturbance and waiting-time calculations in thermometer describe how making the comparison can change the state being measured.[ref]
The name “zeroth” reflects logical order rather than the date of the first thermometer: this premise about thermal equilibrium precedes the already numbered first law of thermodynamics, Second law of thermodynamics and third law of thermodynamics. This is the naming explanation given in University Physics Volume 2 by Samuel J. Ling and others (§1.1, “Thermal Equilibrium”).[ref]
The corresponding Zeroth law of black-hole mechanics states constancy of surface gravity over an equilibrium horizon; Hawking radiation identifies that quantity with physical temperature up to its universal conversion factor.