Let $X$ be a set endowed with two metrics $d_1$ and $d_2$ and for all $x$, $y \in X$ define the function $d(x,y) = \max\{d_1(x,y),d_2(x,y)\}$. Show that $d$ is a metric on $X$.

(Note I put up this question and its answer because there was a similar question about the minimum of two metrics but none on the maximum.)


2 Answers 2


To be a metric, $d$ must satisfy the following three conditions:

  1. $d(x,y) \geq 0$ for all $x$, $y \in X$.
  2. $d(x,y) = 0$ if and only if $x=y$.
  3. $d(x,y) = d(y,x)$ for all $x$, $y\in X$.
  4. $d(x,z) \leq d(x,y) + d(y,z)$ for all $x$, $y$, $z \in X$ (the triangle inequality)

Take these conditions in turn. Beforehand, note that for any $x$, $y \in X$ we have $d(x,y) \geq d_1(x,y)$ and $d(x,y) \geq d_2(x,y)$.

  1. $d(x,y) \geq d_1(x,y) \geq 0$ for any $x, y \in X$.

  2. If $x \neq y$ then $d_1(x,y) >0$ so $d(x,y) \geq d_1(x,y) >0$. If $x=y$ then $d_1(x,y) = d_2(x,y) =0$ so therefore their maximum $d(x,y)$ is also zero.

  3. $d(x,y) = \max\{d_1(x,y),d_2(x,y)\} = \max\{d_1(y,x),d_2(y,x)\} = d(y,x)$.

  4. Given $x, y, z \in X$, $d(x,z)$ is either equal to $d_1(x,z)$ or $d_2(x,z)$. Suppose first that $d(x,z) = d_1(x,z)$. By the triangle inequality for $d_1$ we have $d(x,z) = d_1(x,z) \leq d_1(x,y) + d_1(y,z) \leq d(x,z) + d(y,z)$. Similarly the triangle inequality holds for this triple $x, y, z$ if $d(x,y) = d_2(x,y)$.

Therefore $d$ is a metric on $X$.

  • $\begingroup$ No. My d in the proof is based on two existing metrics d1 and d2. $\endgroup$ Jan 20, 2021 at 10:18

Another proof for the triangle inequality:

  1. Given $x, y, z \in X$, $d_1(x,z) \leq d_1(x,y) + d_1(y,z) \leq d(x,z) + d(y,z)$. (Second inequality holds since $d = \max\{d_1,d_2\}$)
  2. Similarily, $x, y, z \in X$, $d_2(x,z) \leq d_2(x,y) + d_2(y,z) \leq d(x,z) + d(y,z)$.
  3. Combine two inequality, we get $d(x,z) = \max\{d_1,d_2\}(x,z) \leq d(x,z) + d(y,z)$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .