Adding Coordinate Differences
In \(\mathbb{R}^n\), two points can differ in several coordinates at once. The taxicab distance measures their total coordinate difference by adding the absolute differences in each coordinate. The absolute values matter: a distance should not become negative because one coordinate decreases, and reversing the two points should not change the result.
Fix a positive integer \(n\). We use the standard coordinates on \(\mathbb{R}^n\), and write \(x=(x_1,\ldots,x_n)\) and \(y=(y_1,\ldots,y_n)\). The distance below gives \(\mathbb{R}^n\) a metric; its topology is the metric topology associated with that metric.
Each summand records the size of the difference in one coordinate, without regard to its sign. The definition applies to every pair of points in \(\mathbb{R}^n\); no assumption that their coordinates are positive or distinct is required. If corresponding coordinates agree, their summand is zero.
To prove the triangle inequality, the key fact is the triangle inequality for absolute values of real numbers. We record it and its short justification so that the coordinatewise step is explicit.
Proof. The definition of absolute value gives \(-|u|\leq u\leq |u|\) and \(-|v|\leq v\leq |v|\). Adding the lower bounds and the upper bounds gives \(-(|u|+|v|)\leq u+v\leq |u|+|v|\). A real number between \(-c\) and \(c\), where \(c\geq0\), has absolute value at most \(c\). Taking \(c=|u|+|v|\) proves the inequality. \(\square\)
The Triangle Inequality, One Coordinate at a Time
Proof. Fix any coordinate index \(i\) with \(1\leq i\leq n\). The real-number identity \(x_i-y_i=(x_i-z_i)+(z_i-y_i)\) holds because the terms involving \(z_i\) cancel. Apply the lemma with \(u=x_i-z_i\) and \(v=z_i-y_i\). This gives \(|x_i-y_i|\leq |x_i-z_i|+|z_i-y_i|\). Since the argument holds for each index from \(1\) through \(n\), add all \(n\) inequalities. The left sides sum to \(d_1(x,y)\); the right sides sum to \(d_1(x,z)+d_1(z,y)\). Thus \(d_1(x,y)\leq d_1(x,z)+d_1(z,y)\). \(\square\)
The summation step is important. It uses the fact that each coordinate contributes a nonnegative quantity and that there are finitely many coordinates. The inequality does not assert that every coordinate contributes equally, or that the coordinatewise inequalities must be strict.
Proof. Each term \(|x_i-y_i|\) is nonnegative, so their sum \(d_1(x,y)\) is nonnegative. If \(x=y\), then \(x_i=y_i\) for every \(i\), and all summands are zero, so \(d_1(x,y)=0\). Conversely, suppose \(d_1(x,y)=0\). Each summand is nonnegative, so a finite sum of these summands can be zero only if every summand is zero. Hence \(|x_i-y_i|=0\) and therefore \(x_i=y_i\) for every \(i\); this means \(x=y\). For symmetry, \(|x_i-y_i|=|-(y_i-x_i)|=|y_i-x_i|\) for each \(i\), so adding gives \(d_1(x,y)=d_1(y,x)\). The triangle inequality is the proposition just proved. These are all four metric axioms, so \(d_1\) is a metric. \(\square\)
The positivity argument also covers the case \(x=y\); no separate exception is needed when some, or all, coordinates agree. The assumption \(n\geq1\) makes the coordinate list nonempty, and the proof works for every such finite dimension.
Worked Distance Calculations
Worked Example: Two Points in \(\mathbb{R}^2\)
Find the taxicab distance between \(x=(1,-2)\) and \(y=(-3,4)\), then check the result by reversing the points.
There are two coordinate differences. In the first coordinate, \(1-(-3)=4\), so the absolute difference is \(|4|=4\). In the second coordinate, \(-2-4=-6\), so the absolute difference is \(|-6|=6\). Adding these contributions gives $$ d_1(x,y)=|1-(-3)|+|-2-4|=4+6=10. $$
Check: Reversing the points gives \((-3)-1=-4\) and \(4-(-2)=6\). Thus \(d_1(y,x)=|-4|+|6|=4+6=10\), agreeing with symmetry and with the calculated distance.
Worked Example: Three Coordinates
Calculate \(d_1(x,y)\) for \(x=(2,-1,3)\) and \(y=(0,4,-2)\) in \(\mathbb{R}^3\).
Calculate each coordinate difference separately. The first is \(2-0=2\), whose absolute value is \(2\). The second is \(-1-4=-5\), whose absolute value is \(5\). The third is \(3-(-2)=5\), whose absolute value is \(5\). Therefore $$ d_1(x,y)=|2-0|+|-1-4|+|3-(-2)|=2+5+5=12. $$
Check: In the reverse order the differences are \(0-2=-2\), \(4-(-1)=5\), and \(-2-3=-5\). Their absolute values sum to \(2+5+5=12\), giving \(d_1(y,x)=12\) as required.
Worked Example: Checking a Triangle Inequality
Let \(p=(0,0)\), \(q=(2,1)\), and \(r=(5,-1)\) in \(\mathbb{R}^2\). Compute the three distances and compare \(d_1(p,r)\) with \(d_1(p,q)+d_1(q,r)\).
First, the coordinate differences from \(p\) to \(r\) are \(0-5=-5\) and \(0-(-1)=1\), so \(d_1(p,r)=|-5|+|1|=5+1=6\). From \(p\) to \(q\), the differences are \(0-2=-2\) and \(0-1=-1\), so \(d_1(p,q)=|-2|+|-1|=2+1=3\). From \(q\) to \(r\), the differences are \(2-5=-3\) and \(1-(-1)=2\), so \(d_1(q,r)=|-3|+|2|=3+2=5\). Consequently, $$ d_1(p,r)=6\leq 3+5=d_1(p,q)+d_1(q,r). $$
Check coordinate by coordinate: In the first coordinate, \(|0-5|=5\), while \(|0-2|+|2-5|=2+3=5\). In the second, \(|0-(-1)|=1\), while \(|0-1|+|1-(-1)|=1+2=3\). The coordinate inequalities are \(5\leq5\) and \(1\leq3\); adding them gives \(6\leq8\), the same triangle inequality as the distance calculation.
A Common Error and Why the Metric Matters
Common pitfall: dropping the absolute values. For the points \(x=(1,-2)\) and \(y=(-3,4)\), one might incorrectly add the signed coordinate differences in the order \(x-y\), obtaining \((1-(-3))+(-2-4)=4+(-6)=-2\), and call \(-2\) the distance. This is wrong: a metric cannot take a negative value, and the formula defining \(d_1\) uses the absolute value of each coordinate difference. The correction is \(|4|+|-6|=4+6=10\). Reversing the points also makes the error visible: the signed sum becomes \((-4)+6=2\), even though reversing a pair must not change its distance. Applying absolute values coordinate by coordinate gives \(10\) in either order.
The coordinatewise proof is useful whenever a distance is defined by combining differences from several coordinates: to establish a triangle inequality, first compare the contribution in each coordinate, then combine those inequalities according to the distance formula. For the taxicab distance, the contributions are absolute coordinate differences and are added. This also shows exactly what is being justified: the inequality follows from the real absolute-value inequality in each coordinate, not from a drawing or an assumption about how points are arranged.
Once \(d_1\) is known to be a metric, it determines a topology on \(\mathbb{R}^n\) by the metric-space construction. The metric axioms established above are what make that construction applicable. Here the main task has been to verify those axioms for this specific coordinate-sum formula; descriptions of its open balls are a separate question.
Check Your Understanding
For each question, use the coordinate-sum definition and show the coordinate contributions explicitly.
- Compute the taxicab distance between \((3,0)\) and \((-1,5)\) in \(\mathbb{R}^2\), and check it in the reverse order.
- For \(x=(1,2,-1)\), \(y=(0,-2,3)\), and \(z=(4,1,0)\), calculate \(d_1(x,y)\), \(d_1(x,z)\), and \(d_1(z,y)\), then check the triangle inequality.
- Explain why a sum of absolute coordinate differences can equal zero only when the two points are equal.
- For real numbers \(a,b,c\), write the absolute-value inequality that gives the triangle inequality in one coordinate.
- Give a pair of points for which at least one coordinate difference is negative, and explain why the absolute value is still needed in the distance formula.