# The Unapologetic Mathematician

## Products of Metric Spaces

Shortly we’re going to need a construction that’s sort of interesting in its own right.

We know about products of topological spaces. We can take products of metric spaces, too, and one method comes down to us all the way from Pythagoras.

The famous Pythagorean theorem tells us that in a right triangle the length $c$ of the side opposite the right angle stands in a certain relation to the lengths $a$ and $b$ of the other two sides: $c^2=a^2+b^2$. So let’s say we’ve got metric spaces $(M_1,d_1)$ and $(M_2,d_2)$. For the moment we’ll think of them as being perpendicular and define a distance function $d$ on $M_1\times M_2$ by

$d((x_1,x_2),(y_1,y_2)=\sqrt{d_1(x_1,y_1)^2+d_2(x_2,y_2)^2}$

The quantity inside the radical here must be nonnegative, since it’s the sum of two nonnegative numbers. Since the result needs to be nonnegative, we take the unique nonnegative square root.

Oops, I don’t think I mentioned this before. Since the function $f(x)=x^2$ has $f'(x)=2x$ as its derivative, it’s always increasing where $x$ is positive. And since we can eventually a square above any real number we choose, its values run from zero all the way up to infinity. Now the same sort of argument as we used to construct the exponential function gives us an inverse sending any nonnegative number to a unique nonnegative square root.

Okay, that taken care of, we’ve got a distance function. It’s clearly nonnegative and symmetric. The only way for it to be zero is for the quantity in the radical to be zero, and this only happens if each of the terms $d_1(x_1,y_1)$ and $d_2(x_2,y_2)$ are zero. But since these are distance functions, that means $x_1=y_1$ and $x_2=y_2$, so $(x_1,x_2)=(y_1,y_2)$.

The last property we need is the triangle inequality. That is, for any three pairs $(x_1,x_2)$, $(y_1,y_2)$, $(z_1,z_2)$ we have the inequality

$d((x_1,x_2),(z_1,z_2))\leq d((x_1,x_2),(y_1,y_2))+d((y_1,y_2),(z_1,z_2))$

Substituting from the definition of $d$ we get the statement

$\sqrt{d_1(x_1,z_1)^2+d_2(x_2,z_2)^2}\leq\sqrt{d_1(x_1,y_1)^2+d_2(x_2,y_2)^2}+\sqrt{d_1(y_1,z_1)^2+d_2(y_2,z_2)^2}$

The triangle inequalities for $d_1$ and $d_2$ tell us that $d_1(x_1,z_1)\leq d_1(x_1,y_1)+d_1(y_1,z_1)$ and $d_2(x_2,z_2)\leq d_2(x_2,y_2)+d_1(y_2,z_2)$. So if we make these substitutions on the left, it increases the left side of the inequality we want. Thus if we can prove the stronger inequality

\begin{aligned}\sqrt{d_1(x_1,y_1)^2+2d_1(x_1,y_1)d_1(y_1,z_1)+d_1(y_1,z_1)^2+d_2(x_2,y_2)^2+2d_2(x_2,y_2)d_2(y_2,z_2)+d_2(y_2,z_2)^2}\\\leq\sqrt{d_1(x_1,y_1)^2+d_2(x_2,y_2)^2}+\sqrt{d_1(y_1,z_1)^2+d_2(y_2,z_2)^2}\end{aligned}

we’ll get the one we really want. Now since squaring preserves the order on the nonnegative reals, we can find this equivalent to

\begin{aligned}d_1(x_1,y_1)^2+2d_1(x_1,y_1)d_1(y_1,z_1)+d_1(y_1,z_1)^2+d_2(x_2,y_2)^2+2d_2(x_2,y_2)d_2(y_2,z_2)+d_2(y_2,z_2)^2\\\leq d_1(x_1,y_1)^2+d_2(x_2,y_2)^2+2\sqrt{d_1(x_1,y_1)^2+d_2(x_2,y_2)^2}\sqrt{d_1(y_1,z_1)^2+d_2(y_2,z_2)^2}+d_1(y_1,z_1)^2+d_2(y_2,z_2)^2\end{aligned}

Some cancellations later:

\begin{aligned}d_1(x_1,y_1)d_1(y_1,z_1)+d_2(x_2,y_2)d_2(y_2,z_2)\\\leq \sqrt{d_1(x_1,y_1)^2d_1(y_1,z_1)^2+d_1(x_1,y_1)^2d_2(y_2,z_2)^2+d_2(x_2,y_2)^2d_1(y_1,z_1)^2+d_2(x_2,y_2)^2d_2(y_2,z_2)^2}\end{aligned}

We square and cancel some more:

$2d_1(x_1,y_1)d_1(y_1,z_1)d_2(x_2,y_2)d_2(y_2,z_2)\leq d_1(x_1,y_1)^2d_2(y_2,z_2)^2+d_2(x_2,y_2)^2d_1(y_1,z_1)^2$

Moving these terms around we find

\begin{aligned}0\leq\left(d_1(x_1,y_1)d_2(y_2,z_2)\right)^2-2\left(d_1(x_1,y_1)d_2(y_2,z_2)\right)\left(d_2(x_2,y_2)d_1(y_1,z_1)\right)+\left(d_2(x_2,y_2)d_1(y_1,z_1)\right)^2\\=\left(d_1(x_1,y_1)d_2(y_2,z_2)-d_2(x_2,y_2)d_1(y_1,z_1)\right)^2\end{aligned}

So at the end of the day, our triangle inequality is equivalent to asking if a certain quantity squared is nonnegative, which it clearly is!

Now here’s the important thing at the end of all that calculation: this is just one way to get a metric on the product of two metric spaces. There are many other ones which give rise to different distance functions, but the same topology and the same uniform structure. And often it’s the topology that we’ll be most interested in.

In particular, this will give us a topology on any finite-dimensional vector space over the real numbers, but we don’t want to automatically equip that vector space with this norm unless we say so very explicitly. In fact, we don’t even want to make that same assumption about the two spaces being perpendicular to each other. The details of exactly why this is so I’ll leave until we get back to linear algebra, but I want to be clear right now that topology comes for free, but we may have good reason to use different “distances”.

August 19, 2008 - Posted by | Point-Set Topology, Topology

1. I’d like to add a geometric point of view:

Let’s call this metric on the product the “square norm metric”. Putting $u_i = d_i(x_i, y_i)$, $i = 1, 2$, and forming the vector $u = (u_1, u_2)$, we have by definition

$d((x_1, x_2), (y_1, y_2)) = |u|$

where $|u|$ is the standard norm in the plane (based on the Pythagorean theorem). The “stronger inequality” in the post is then just the norm triangle inequality in the plane,

$|u + v| \leq |u| + |v|,$

where here we take the vector $v$ to have components $v_i = d_i(y_i, z_i)$.

This norm triangle inequality can be proved in a variety of ways, of course; a nice geometric observation is that it’s equivalent to convexity of the unit disk, i.e., to the fact that if you take two unit vectors $x, y$ on the boundary of the disk, then an arbitrary point on the line segment between $x$ and $y$, having the form $tx + (1-t)y$ for some $0 \leq t \leq 1$, lies inside the unit disk:

$|tx + (1-t)y| \leq 1.$

To see this condition implies the norm triangle inequality above, assume $u, v$ are nonzero, and let $x = u/|u|, y = v/|v|$, and $t = |u|/(|u| + |v|)$. Then a quick calculation yields

$|tx + (1-t)y| = |u + v|/(|u| + |v|) \leq 1$

which is the triangle inequality.

Nothing particularly earth-shattering, but the point is that the same argument applies to the p-norm (for $p \in (1, \infty)$): defining $|u|_p = (|u_1|^p + |u_2|^p)^{1/p}$, the triangle inequality for this norm is equivalent to convexity of the unit disk

$\{x \in \mathbb{R}^2: |x|_p \leq 1\},$

which is easy enough to see directly (sketch the boundary curve $|x_{1}|^p + |x_{2}|^p = 1$ using calculus); more rigorously, one can prove convexity by showing that the matrix of second partial derivatives of $f(x_1, x_2) = x_{1}^p + x_{2}^p$ induces a positive definite bilinear form on each tangent line to a point on the curve (in the 1st quadrant; extend to the others using symmetry): a very easy calculation.

One can also prove the triangle inequality by following the classical route of passing through a baby form of Hölder’s inequality and then proving the Minkowski inequality, but I prefer the approach here because I think it gives more geometric insight.

Comment by Todd Trimble | August 20, 2008 | Reply

2. Sure. The $p$-norms are (some of) the ones I referred to at the end. For now, I just want to have this metric (and its topology) handy so I can make $\mathbb{C}$ into a topological field. The others will come later.

Comment by John Armstrong | August 20, 2008 | Reply

3. […] the reals, which means that as a vector space we have the isomorphism . So let’s just use the product metric, along with the topology it gives on the complex […]

Pingback by Some Topological Fields « The Unapologetic Mathematician | August 26, 2008 | Reply

4. […] is the exact same formula we’d get if we started with the metric space and built up as the product of […]

Pingback by The Topology of Higher-Dimensional Real Spaces « The Unapologetic Mathematician | September 15, 2009 | Reply