Ultrametric space (source code)

= Ultrametric space
{title2=$(X,d),\quad d(x,z)\leq\max\{d(x,y),d(y,z)\}$}
{wiki}

An ultrametric space is a <metric space> whose <metric> satisfies the <ultrametric inequality>. The <rational numbers> with $d_p(x,y)=|x-y|_p$, and their <P-adic number> completion, are examples. Their geometry organizes points into nested clusters rather than measuring separation along a <number line>.

For <integers> $a,b$ and $k\geq0$, the definition of the <P-adic valuation> gives
$$
d_p(a,b)\leq p^{-k}\quad\Longleftrightarrow\quad a\equiv b\pmod{p^k}.
$$
Thus a <closed ball> of radius $p^{-k}$ in the <integers> is a <congruence class> modulo $p^k$. In the <p-adic integers> the same <closed ball> is $a+p^k\mathbb Z_p$. More shared low-order digits mean a smaller <p-adic absolute value> of the difference.

\Image[/two-adic-congruence-clusters.png]
{title=The <integers> from zero to fifteen form nested <congruence classes> modulo powers of two in the <2-adic absolute value>}

The <binary tree> first splits the sixteen <integers> into even and odd <congruence classes>, then refines modulo $4$, $8$, and $16$. Each node fixes one more low-order digit. The leaves $5$ and $13$ share the class $5$ modulo $8$, then separate modulo $16$, so their distance is exactly $1/8$. The leaves are deliberately ordered by their low-order digits; horizontal spacing and edge lengths are layout choices, not the <metric>. The singleton leaves describe this finite sample; a <congruence class> modulo $16$ in all <p-adic integers> remains infinite.

The <ultrametric inequality> also explains the unusual behavior of <balls>. Every point of an <open ball> can serve as its center: if $d(a,b)<r$, then $d(a,x)<r$ if and only if $d(b,x)<r$. Two <open balls> that intersect are nested, since a point of their <intersection> serves as a common center and their radii can be compared. The same nesting rule holds for <closed balls> and for a pair consisting of one <open ball> and one <closed ball>.

Every <open ball> is a <clopen set>. For a point $y$ outside $B(a,r)$, the <open ball> $B(y,d(a,y))$ stays outside $B(a,r)$: if $d(y,z)<d(a,y)$, the <ultrametric inequality> forces $d(a,z)=d(a,y)\geq r$. Hence the complement is an <open set>. Also every <closed ball> of positive radius is an <open set>, because $B(b,r)$ lies in the <closed ball> of radius $r$ around $a$ whenever $d(a,b)\leq r$. A radius-zero <closed ball> is a singleton and need not be an <open set>. Distinct points can therefore be separated by a <clopen set>, proving that an <ultrametric space> is <totally disconnected>. These ball properties turn distance thresholds into a hierarchy of compatible clusters. https://math.mit.edu/classes/18.785/2021fa/LectureNotes8.pdf[Andrew V. Sutherland, Number Theory I, Lecture 8, section 8.1.1]{ref}