Zeroth law of thermodynamics
The zeroth law of thermodynamics states that if two systems are each in thermal equilibrium with a third system, they are also in thermal equilibrium with each other.
Two systems are said to be in the relation of thermal equilibrium if they are linked by a wall permeable only to heat, and do not change over time. (As a convenience of language, systems are sometimes also said to be in a relation of thermal equilibrium if they are not linked so as to be able to transfer heat to each other, but would not do so if they were connected by a wall permeable only to heat.)
The law is important for the mathematical formulation of thermodynamics, which needs the assertion that the relation of thermal equilibrium is an equivalence relation. This information is needed for the mathematical definition of temperature that will agree with the physical existence of valid thermometers.
Zeroth law as equivalence relation 
A system is said to be in thermal equilibrium when it experiences no net change of its observable state over time. The most precise statement of the zeroth law is that thermal equilibrium constitutes an equivalence relation on pairs of thermodynamic systems. In other words, the set of all equilibrated thermodynamic systems may be divided into subsets in which every system belongs to one and only one subset, and is in thermal equilibrium with every other member of that subset, and is not in thermal equilibrium with a member of any other subset. This means that a unique "tag" can be assigned to every system, and if the "tags" of two systems are the same, they are in thermal equilibrium with each other, and if they are not, they are not. Ultimately, this property is used to justify the use of thermodynamic temperature as a tagging system. Thermodynamic temperature provides further properties of thermally equilibrated systems, such as order and continuity with regard to "hotness" or "coldness", but these properties are not implied by the standard statement of the zeroth law.
If it is specified that a system is in thermal equilibrium with itself (i.e., thermal equilibrium is reflexive), then the zeroth law may be stated as follows: If A, B, and C are distinct thermodynamic systems:
If A and C are each in thermal equilibrium with B, A is also in equilibrium with C.
This statement asserts that thermal equilibrium is a Euclidean relation between thermodynamic systems. If we also grant that all thermodynamic systems are in thermal equilibrium with themselves, then thermal equilibrium is also a reflexive relation. Relations that are both reflexive and Euclidean are equivalence relations. One consequence of this reasoning is that thermal equilibrium is a transitive relationship: If A is in thermal equilibrium with B and B is in thermal equilibrium with C, then A is in thermal equilibrium with C. Another consequence is that the equilibrium relationship is symmetric: If A is in thermal equilibrium with B, then B is in thermal equilibrium with A. Thus we may say that two systems are in thermal equilibrium with each other, or that they are in mutual equilibrium. Implicitly assuming both reflexivity and symmetry, the zeroth law is therefore often expressed as:
If two systems are in thermal equilibrium with a third system, then they are in thermal equilibrium with each other.
If A is in thermal equilibrium with B and if B is in thermal equilibrium with C, then A is in thermal equilibrium with C.
Foundation of temperature 
The zeroth law establishes thermal equilibrium as an equivalence relationship. An equivalence relationship on a set (such as the set of thermally equilibrated systems) divides that set into a collection of distinct subsets ("disjoint subsets") where any member of the set is a member of one and only one such subset. In the case of the zeroth law, these subsets consist of systems which are in mutual equilibrium. This partitioning allows any member of the subset to be uniquely "tagged" with a label identifying the subset to which it belongs. Although the labeling may be quite arbitrary, temperature is just such a labeling process which uses the real number system for tagging. The zeroth law justifies the use of suitable thermodynamic systems as thermometers to provide such a labeling, which yield any number of possible empirical temperature scales, and justifies the use of the second law of thermodynamics to provide an absolute, or thermodynamic temperature scale. Such temperature scales bring additional continuity and ordering (i.e., "hot" and "cold") properties to the concept of temperature.
In the space of thermodynamic parameters, zones of constant temperature form a surface, that provides a natural order of nearby surfaces. One may therefore construct a global temperature function that provides a continuous ordering of states. The dimensionality of a surface of constant temperature is one less than the number of thermodynamic parameters, thus, for an ideal gas described with three thermodynamic parameters P, V and n, it is a two-dimensional surface.
For example, if two systems of ideal gases are in equilibrium, then P1V1/N1 = P2V2/N2 where Pi is the pressure in the ith system, Vi is the volume, and Ni is the amount (in moles, or simply the number of atoms) of gas.
The surface PV/N = const defines surfaces of equal thermodynamic temperature, and one may label defining T so that PV/N = RT, where R is some constant. These systems can now be used as a thermometer to calibrate other systems. Such systems are known as "ideal gas thermometers".
According to Arnold Sommerfeld, Ralph H. Fowler invented the title 'the zeroth law of thermodynamics' when he was discussing the 1935 text of Saha and Srivastava. They write on page 1 that "every physical quantity must be measurable in numerical terms". They presume that temperature is a physical quantity and then deduce the statement "If a body A is in temperature equilibrium with two bodies B and C, then B and C themselves will be in temperature equilibrium with each other." They then in a self-standing paragraph italicize as if to state their basic postulate: "Any of the physical properties of A which change with the application of heat may be observed and utilised for the measurement of temperature." They do not themselves here use the term 'zeroth law of thermodynamics'. There are very many statements of these physical ideas in the physics literature long before this text, in very similar language. What was new here was just the label 'zeroth law of thermodynamics'. Fowler, with co-author Edward A. Guggenheim, wrote of the zeroth law as follows:
- ...we introduce the postulate: If two assemblies are each in thermal equilibrium with a third assembly, they are in thermal equilibrium with each other.
They then proposed that "it may be shown to follow that the condition for thermal equilibrium between several assemblies is the equality of a certain single-valued function of the thermodynamic states of the assemblies, which may be called the temperature t, any one of the assemblies being used as a "thermometer" reading the temperature t on a suitable scale. This postulate of the "Existence of temperature" could with advantage be known as the zeroth law of thermodynamics." The first sentence of this present article is a version of this statement.
- C. Carathéodory (1909). "Untersuchungen über die Grundlagen der Thermodynamik". Mathematische Annalen (in German) 67: 355–386. doi:10.1007/BF01450409. A partly reliable translation is to be found at Kestin, J. (1976). The Second Law of Thermodynamics, Dowden, Hutchinson & Ross, Stroudsburg PA.
- Maxwell, J.C. (1871). Theory of Heat, Longmans, Green, and Co., London, p. 57.
- Bailyn, M. (1994). A Survey of Thermodynamics, American Institute of Physics Press, New York, ISBN 978-0-88318-797-5, page 24.
- Lieb, E.H., Yngvason, J. (1999). The physics and mathematics of the second law of thermodynamics, Physics Reports, 314: 1–96, p. 56.
- Chris Vuille; Serway, Raymond A.; Faughn, Jerry S. (2009). College physics. Belmont, CA: Brooks/Cole, Cengage Learning. pp. 355. ISBN 978-0-495-38693-3.
- H.A. Buchdahl (1966). The Concepts of Classical Thermodynamics. Cambridge University Press. p. 73.
- D. Kondepudi (2008). Introduction to Modern Thermodynamics. Wiley. p. 7.
- J. S. Dugdale (1996, 1998). Entropy and its Physical Interpretation. Tayler & Francis.
- Buchdahl, H.A. (1966). The Concepts of Classical Thermodynamics, Cambridge University Press, London, p. 73.
- Sommerfeld, A. (1951/1955). Thermodynamics and Statistical Mechanics, vol. 5 of Lectures on Theoretical Physics, edited by F. Bopp, J. Meixner, translated by J. Kestin, Academic Press, New York, page 1.
- Saha, M.N., Srivastava, B.N. (1935). A Treatise on Heat. (Including Kinetic Theory of Gases, Thermodynamics and Recent Advances in Statistical Thermodynamics), the second and revised edition of A Text Book of Heat, The Indian Press, Allahabad and Calcutta, p. 1.
- Fowler, R., Guggenheim, E.A. (1939/1965). Statistical Thermodynamics. A version of Statistical Mechanics for Students of Physics and Chemistry, first printing 1939, reprinted with corrections 1965, Cambridge University Press, Cambridge UK, p. 56.