---
tag: M4HM6A3J54
kind: definition
name: Ultrametric space
msc: ["54E35", 12J25]
defines: A6DPR620B5
uses: [0VKD1TP7F3, 03HDF50VN4]
sources:
  - url: https://en.wikipedia.org/wiki/Ultrametric_space
---

## Definition

Let $X$ be a set.
An *ultrametric* on $X$ is a [[metric|0VKD1TP7F3]] $d \colon X \times X \to [0, \infty)$ that satisfies the strong triangle inequality
$$d(x, z) \le \max(d(x, y), d(y, z)) \quad \text{for all } x, y, z \in X.$$
An *ultrametric space* is a set with an ultrametric.

## Remarks

The strong triangle inequality implies the usual one, since $\max(a, b) \le a + b$ for $a, b \ge 0$.

Example: fix a prime $p$ and let $v_p$ be the [[p-adic valuation|03HDF50VN4]] on $\Q$.
Put $d(x, y) = p^{-v_p(x - y)}$ for $x \ne y$ and $d(x, x) = 0$.
Since $v_p(a + b) \ge \min(v_p(a), v_p(b))$, applying it to $a = x - y$ and $b = y - z$ gives the strong triangle inequality.

Non-example: the usual metric $d(x, y) = \abs{x - y}$ on $\R$.
Here $d(0, 2) = 2$, while $\max(d(0, 1), d(1, 2)) = 1$.

In an ultrametric space, if $d(x, y) \ne d(y, z)$, then $d(x, z) = \max(d(x, y), d(y, z))$.
Every open ball $B(a, r)$ equals $B(b, r)$ for each $b \in B(a, r)$.
