(related to Corollary: The absolute value makes the set of rational numbers a metric space.)
We have to show that the absolute value defined for rational numbers defines a metric on the set of rational numbers \(\mathbb Q\), i.e. to show that it fulfills in \(\mathbb Q\) the general properties of any metric. Let \(\frac ab,~\frac cd,~\frac ef\in \mathbb Q\).
It follows from the definition of rational numbers that \(|\frac ab-\frac cd|=0\) if and only if both fractions represent the same equivalence relation \((a,b)\sim (c,d)\Leftrightarrow ad=bc\), in other words \(\frac ab=\frac cd\). Thus, this property of a metric is fulfilled.
Assume without loss of generality that \(\frac ab\ge \frac cd\). Then we have by definition of absolute value for rational numbers that \(\left|\frac ab-\frac cd\right| = \frac ab-\frac cd\). On the other side, we have \(\left|\frac cd-\frac ab\right| = - \frac cd - \left( - \frac ab \right) = - \frac cd + \frac ab \). Since the addition of rational numbers is commutative1, we have \(- \frac cd + \frac ab = \frac ab - \frac cd \), so both absolute values are equal.
We observe that \(\left(\frac ab-\frac cd\right)\le \left|\frac ab-\frac cd\right|\) and \(\left(\frac cd-\frac ef\right)\le \left|\frac cd-\frac ef\right|\). We have therefore \[\frac ab-\frac ef=\frac ab-\frac cd+\frac cd-\frac ef\le \left|\frac ab-\frac cd\right|+\left|\frac cd-\frac ef\right|.\]
Because also \(-\left(\frac ab-\frac cd\right)\le \left|\frac ab-\frac cd\right|\) and \(-\left(\frac cd-\frac ef\right)\le \left|\frac cd-\frac ef\right|\), it follows with the same argument that
\[-\left(\frac ab - \frac ef\right)=-\left(\frac ab-\frac cd\right)+\left(-\left(\frac cd-\frac ef\right)\right)\le \left|\frac ab-\frac cd\right|+\left|\frac cd-\frac ef\right|.\]
Together with the definition of absolute value for rational numbers, it follows
\[\left|\frac ab-\frac ef\right|\le \left|\frac ab-\frac cd\right|+\left|\frac cd-\frac ef\right|\]
Note that the \((\mathbb Q, + ,\cdot)\) is a field we have constructed from the integral domain \((\mathbb Z, +)\), in which the addition was proven to be commutative. ↩