Metric¶
Core Idea¶
A metric is a rule assigning a non-negative Distance to every pair of objects in a set, subject to three axioms: the distance is zero exactly when the objects coincide, it is symmetric, and it obeys the triangle inequality. These three constraints turn a vague sense of "closeness" into a structure with stable, exploitable properties.
How would you explain it like I'm…
The Distance Rule
Distance With Three Rules
Axioms Of Distance
Tensions in Practice¶
Broad Use¶
- Geography: Euclidean distance on a map, great-circle distance on a sphere, road-network distance through a graph.
- Information theory: Hamming distance between binary strings, edit distance between texts.
- Machine learning: Euclidean, Mahalanobis, and cosine distance between feature vectors, where the metric determines what "similar" means for clustering and retrieval.
- Semantics: distances in an embedding space encode meaning proximity for words and images.
- Political science: ideological distance between voters, preference distance between consumers.
- Biology: phylogenetic and genetic distance between organisms.
Clarity¶
The three axioms make explicit what "close" means, revealing that the choice of distance is a substantive modeling decision — and that two analysts disputing whether things are "similar" are usually disputing which metric to apply.
Manages Complexity¶
The triangle inequality lets whole regions of a search space be pruned without examination, making nearest-neighbour search, hierarchical clustering, and metric indexing tractable at scale.
Abstract Reasoning¶
Once distance is axiomatized, an enormous library of theorems — convergence, completeness, contraction, fixed points — becomes available substrate-free, holding in every concrete metric space.
Knowledge Transfer¶
- Clustering: change the metric (cosine, Mahalanobis, edit distance) and the clustering behaviour changes predictably.
- Search: exploit the triangle inequality to prune, identically whether objects are map points or embeddings.
- Asymmetric resemblance: when similarity is genuinely directional, drop symmetry and move to a divergence — recognizing the metric machinery no longer applies.
Example¶
A music-recommendation system represents each song as a feature vector: under Euclidean distance two songs are close when their absolute loudness matches, but under cosine distance two are close when their feature profiles align — so a quiet cover and a loud band version land close under cosine and far apart under Euclidean. The team's disagreement about recommendations is structurally a disagreement about the metric.
Relationships to Other Abstractions¶
Current abstraction Metric Prime
Parents (1) — outgoing typed relations
-
Metric is a kind of Function (Mapping) Prime
Every Metric is a Function Mapping from ordered pairs of objects to non-negative real distances, with metric axioms added.
Children (24) — abstractions linked here by typed relations
-
Banach–Mazur compactum Domain-specific is a kind of Metric
What makes it its own entry: the domain-specific identity determined by dimension is fixed, points are linear-isometry classes, and distance is the infimum distortion under invertible linear maps using the stated logarithmic or multiplicative convention.
-
Bandwidth-delay product Domain-specific is a kind of Metric
BDP is a derived quantitative path metric.
-
BK-tree Domain-specific is a kind of Metric
The triangle inequality of a genuine metric is constitutive both to the stored edge labels and to safe query pruning; What makes it its own entry: the equal-pivot-distance recursive partition and its annular triangle-inequality query test, not a generic search tree or any approximate-neighbor implementation.
-
Contact order Domain-specific is a kind of Metric
It remains its own entry because its identity is fixed by the protein chain and length, native structure and ensemble, residue-index convention, contact-distance and sequence-separation thresholds, included contact pairs, normalization formula, uncertainty and any folding-rate comparison.
-
Diamond norm Domain-specific is a kind of Metric
The induced diamond distance quantitatively separates quantum operations.
- Distance (graph theory) Domain-specific is a kind of Metric
It remains its own entry because its identity is fixed by the graph and vertex pair, directed or undirected convention, edge weights and path length, admissible path set, shortest-path minimum, disconnected convention, loops and negative weights if allowed and metric or quasi-metric properties.
- Fréchet distance Domain-specific is a kind of Metric
Fréchet distance is a domain-specific kind of metric under its frozen identity and differentia. Complete-catalog comparison found the corresponding live broader identity.
- Haversine Formula Domain-specific is a kind of Metric
The formula **specializes Metric**: its output is the geodesic distance on a sphere expressed through one coordinate relation.
- Hedgehog Space Domain-specific is a kind of Metric
**Metric** is the broader abstraction this entry instantiates.
- Hellinger Distance Domain-specific is a kind of Metric
The scaled L2 distance of root probability densities is a metric on probability laws.
- Karlsruhe Metric Domain-specific is a kind of Metric
The Karlsruhe Metric strictly instantiates **Metric** (`prime:metric`).
- Lévy–Prokhorov metric Domain-specific is a kind of Metric
The construction is a distance function on probability laws.
- P-adic number Domain-specific is a kind of Metric
It remains its own entry because its identity is fixed by the prime p, p-adic valuation and absolute value, metric and Cauchy completion, digit expansion and uniqueness convention, arithmetic and carries, ultrametric inequality, embedding of rationals and convergence examples.
- Ultrametric space Domain-specific is a kind of Metric
What makes it its own entry: the domain-specific identity determined by the set and real-valued distance satisfy nonnegativity, identity, symmetry and the strong max triangle inequality for every triple.
- Wiener index Domain-specific is a kind of Metric
It remains its own entry because its identity is fixed by the graph and connectivity, vertex and edge representation, distance metric, unordered-pair convention, weighting and treatment of disconnected pairs.
- Angular Diameter Distance Domain-specific includes Metric
**`metric`:** (D_A) is an operational cosmological distance measure.
- Correlation Dimension Domain-specific presupposes Metric
**Dimension** is instantiated as the sought scaling exponent.
- Diffeomorphometry Domain-specific includes Metric
Diffeomorphometry instantiates **Metric** most directly: it constructs a distance on anatomical forms from geodesic lengths or energies on a diffeomorphism group.
- Equilateral Dimension Domain-specific presupposes Metric
Equilateral Dimension **instantiates `prime:cardinality` by strict subsumption**.
- Euclidean Space Domain-specific includes Metric
Euclidean Space **presupposes `prime:vector_space`**.
- Hamming Scheme Domain-specific presupposes Metric
The accepted reference-grade review places Hamming Scheme under Metric because the child instantiates or depends on the parent's broader structure while retaining its own constitutive identity.
- Hyper-Wiener Index Domain-specific presupposes Metric
Hyper-Wiener Index **instantiates `prime:aggregation` by strict subsumption**.
- Laakso Space Domain-specific presupposes Metric
**Measure** is presupposed by Ahlfors regularity and the Poincaré inequality.
- Reach (Mathematics) Domain-specific presupposes Metric
**Metric — the broader abstraction (composition / presupposes).** Reach literally requires ambient Euclidean distance, distance-to-set, and metric balls.
Hierarchy path (1) — routes to 1 parentless root
- Metric → is a kind of Function (Mapping)
Not to Be Confused With¶
- Metric is not Measure because a metric attaches Distance to pairs and obeys the triangle inequality, whereas a measure attaches additive size to subsets and obeys additivity over disjoint parts; closeness is not bigness.
- Metric is not a Divergence because a metric requires symmetry, whereas a divergence (KL, asymmetric error cost) is genuinely directional and the triangle-inequality theorems no longer apply.
- Metric is not Commensurability because a metric presupposes its objects already share a common scale, whereas commensurability is the prior question of whether they can be placed on one scale at all.