Mathwords logoMathwords

Ultrametric Space — Definition, Formula & Example

An ultrametric space is a set with a distance function in which the distance between two points is never more than the larger of their distances to any third point. In other words, the direct distance between two points is never longer than the longer leg of any detour through a third point.

A metric space (X,d)(X, d) is ultrametric if dd satisfies the strong triangle inequality d(x,z)≤max⁡{d(x,y), d(y,z)}d(x, z) \le \max\{d(x, y),\, d(y, z)\} for all x,y,z∈Xx, y, z \in X. Since max⁡{a,b}≤a+b\max\{a, b\} \le a + b for a,b≥0a, b \ge 0, every ultrametric is a metric. Three consequences follow. Every triangle is isosceles, with its two longest sides equal. Every point of an open ball is a center of that ball. Every open ball is also a closed set.

Key Formula

d(x,z)≤max⁡{d(x,y),  d(y,z)}d(x, z) \le \max\{d(x, y),\; d(y, z)\}
Where:
  • x,y,zx, y, z = Any three points of the space, not necessarily distinct
  • dd = The distance function (metric) on the space
  • max⁡{a,b}\max\{a, b\} = The larger of the two numbers aa and bb

Worked Example

Problem: On the integers, the 2-adic distance is d(a,b)=2−kd(a, b) = 2^{-k}, where 2k2^k is the highest power of 22 dividing a−ba - b, and d(a,a)=0d(a, a) = 0. This distance is an ultrametric. For the points 00, 44, and 66, compute all three distances, check the strong triangle inequality, and show that the triangle is isosceles.
Step 1: Find each difference and the highest power of 2 dividing it. Since 4=224 = 2^2, the distance from 0 to 4 is 2−22^{-2}. Since 2=212 = 2^1 and 6=21⋅36 = 2^1 \cdot 3, the other two distances are both 2−12^{-1}.
d(0,4)=14,d(4,6)=12,d(0,6)=12d(0,4) = \tfrac{1}{4}, \qquad d(4,6) = \tfrac{1}{2}, \qquad d(0,6) = \tfrac{1}{2}
Step 2: Check the strong triangle inequality with the shortest side on the left. The inequality also holds for the other two sides, since 12≤max⁡{14,12}=12\tfrac{1}{2} \le \max\{\tfrac{1}{4}, \tfrac{1}{2}\} = \tfrac{1}{2} in each case.
d(0,4)=14≤max⁡{12,12}=12d(0,4) = \tfrac{1}{4} \le \max\{\tfrac{1}{2}, \tfrac{1}{2}\} = \tfrac{1}{2}
Step 3: Compare the side lengths. The two longest sides are equal, and the third side is shorter. This is the isosceles property that every ultrametric triangle has.
d(4,6)=d(0,6)=12>14=d(0,4)d(4,6) = d(0,6) = \tfrac{1}{2} > \tfrac{1}{4} = d(0,4)
Answer: The distances are 14\tfrac{1}{4}, 12\tfrac{1}{2}, and 12\tfrac{1}{2}. The strong triangle inequality holds for every side. The triangle is isosceles, with its two longest sides both equal to 12\tfrac{1}{2}.

Why It Matters

The pp-adic numbers form an ultrametric space. They are a central tool in number theory courses and in proofs about which equations have integer solutions. Hierarchical clustering in data science and phylogenetic trees in biology also produce ultrametrics. There, the distance between two items is the height at which their branches merge.

Common Mistakes

Mistake: Assuming that points close in the 2-adic metric are also close on the number line.
Correction: 2-adic distance measures divisibility by 2, not size. The points 00 and 10241024 are 2−10=110242^{-10} = \tfrac{1}{1024} apart because 1024=2101024 = 2^{10}. The points 00 and 11 are at distance 11, the largest possible 2-adic distance between two different integers.

Related Terms

  • Metric Space — The general setting an ultrametric strengthens with one axiom
  • Topology — Studies the open sets an ultrametric's balls generate
  • Closed Set — Every open ultrametric ball is also a closed set
  • Connected Set — Ultrametric spaces are totally disconnected: only single points are connected
  • T1 Space — Separation property every ultrametric space automatically satisfies
  • Triangle Inequality — Strengthened into the ultrametric inequality using maximum
  • Open Ball — Balls behave unusually, every point is a center