G-delta set Created 2026-10-06 Updated 2026-10-07
A G-delta set is a countable intersection of open subsets of a topological space. In a complete metric space these are precisely the topologically complete subspaces, by the G-delta criterion for topological completeness.
Hamming cube as an L1 and L2 metric Created 2026-09-28 Updated 2026-10-14
Use the convention for the Hamming cube . Its elements are length- binary strings, and their Hamming distance counts the differing coordinates:
Send each binary string to the vector with the same coordinates, by . Every differing coordinate contributes both to the sum of absolute differences and to the sum of squared differences. Therefore the L1 norm and L2 norm give, respectively,
This short coordinate calculation proves that the L1 norm gives an isometric embedding, while Euclidean distance grows like the square root of the number of changed binary digits. For example, and differ twice: their Hamming distance and Manhattan distance are , but their Euclidean distance is . Comparing binary strings in these two geometric representations answers different questions even though the points have the same coordinates.
For distinct pairs ranges over every integer from to . The metric embedding into the L2 norm thus has sharp ratios
Neighbors attain and opposite corners attain . This computes the bi-Lipschitz distortion of this coordinate map; it does not prove that every metric embedding into an L2 space has at least this bi-Lipschitz distortion. Uniformly multiplying the output coordinates changes and together and leaves unchanged.
Figure 1.
Hamming distances become k in L1 and square root of k in L2, with controls independent of dimension
. Details.
The important family distinction is that these coordinate maps have no dimension-independent bound on their bi-Lipschitz distortion into the L2 norm, yet they do give a uniform coarse embedding of a family of metric spaces. Pad each output vector with zero coordinates to view all maps in the single l2 sequence space, an L2 space for counting measure. Then the same functions
work for every , and . Similarly, padding into the l1 sequence space gives common controls and exact preservation of Hamming distance. These claims use unnormalized Hamming distance; replacing it by normalized Hamming distance changes the family of source metrics.
The geometry has a practical origin: Hamming's 1950 paper uses the number of differing positions between binary strings to study error-correcting codes. Changing one binary digit moves to a neighboring corner, so a question about corrupted messages becomes a question about separation in the Hamming cube. [ref]
Homeomorphism Created 2026-09-24 Updated 2026-10-14
A homeomorphism is a bijection between topological spaces such that both and are continuous maps. Equivalently, for every subset , is an open set if and only if is an open set in . A homeomorphism therefore transports the entire topology, including connectedness and compactness. It need not preserve numerical metric values, and a bounded set need not map to a bounded set.
For example, an explicit homeomorphism between an open interval and the real line is
The tangent function on is strictly increasing and takes every real value; the displayed arctangent inverse verifies the bijection. Both formulas define continuous maps on their stated domains. Computed values are , , and . Points approach infinity as approaches an excluded endpoint. Thus a bounded set can have the same topology as an unbounded one; neither of these topological spaces is compact.
A useful shortcut is the compact-to-Hausdorff continuous bijection theorem: a continuous bijection from a compact space to a Hausdorff space is a homeomorphism. Its images of closed sets are compact sets, hence closed sets in the target, which proves continuity of the inverse. The indiscrete topology example shows why the Hausdorff assumption matters. [ref]
The word "projection" does not mean ordinary perpendicular projection in the plotted Euclidean space. For the same reference and mean constraint, minimizing the squared Euclidean distance in the three probability coordinates instead gives
Thus the Euclidean minimizer is , whereas the information projection has . The squared Euclidean objective at its own minimum is ; its relative entropy is approximately nats, larger than the optimum nats. Both distributions satisfy the same constraint.
Figure 1.
Relative entropy and least squares select different laws under the same mean constraint
. Both plots use the feasible laws and the same uniform reference. The left plot minimizes relative entropy; the right plot minimizes squared Euclidean distance in the three probability coordinates. Their different marked minima explain why the choice of objective matters. Details.
The reference and objective encode what "least change" means. Relative entropy is asymmetric and is not a metric; its minimization answers a different question from linear least squares. The useful geometric analogy comes from a Pythagorean inequality for information projection, rather than from an assertion that the colored contours are circles.
Kernel of a seminorm 2026-10-14
The kernel of a seminorm is its zero set, a linear subspace by absolute homogeneity and the triangle inequality. The estimate shows that adding an element of does not change . Hence defines a norm on the quotient vector space .
On itself, is a pseudometric; it is a metric exactly when is a norm. In particular, zero distance in one pseudometric need not mean equality of vectors. A separating family of seminorms removes the common zero-distance ambiguity.
Kullback-Leibler divergence Created 2026-09-24 Updated 2026-10-14
The Kullback-Leibler divergence, also called relative entropy, compares two probability distributions in a specified order. In , observations follow and the comparison probability distribution is : the first argument supplies the averaging weights. For probability mass functions on a finite alphabet,
Here is a random variable with probability distribution . For probability density functions relative to the same measure , replace the sum by . These formulas use natural logarithms unless stated otherwise. The expected value is under , even though appears in the denominator. [ref]
Take and on two outcomes. Direct calculation gives
The second outcome contributes negatively to the first sum: assigning it more probability than does makes its individual contribution negative. Nevertheless, relative entropy nonnegativity guarantees a nonnegative total. Reversing the arguments changes both the likelihood ratio and the averaging probabilities; taking an absolute value inside the logarithm would define a different quantity.
Figure 1.
Direction changes the averaging weights; a missing outcome can make relative entropy infinite
. Details.
The units depend on the logarithm: natural logarithms give nats, whereas base-two logarithms give bits. Divide a value in nats by to obtain bits; the forward example is approximately bits. Changing the base rescales every Kullback-Leibler divergence by the same positive factor. Since the two calculated directions differ, Kullback-Leibler divergence is asymmetric and cannot be a metric. It also need not satisfy the triangle inequality. [ref]
The operational meaning is an expected penalty for using the wrong probability distribution. A prediction incurs log-loss when outcome occurs, the negative of the logarithmic scoring rule. Under , its expected value is the cross-entropy . Predicting with itself incurs information entropy , so
Thus Kullback-Leibler divergence is exactly excess expected log-loss, whenever these separate quantities are finite. [ref]
For lossless source coding, ideal codeword lengths similarly give excess expected length in bits per symbol. Actual prefix codes require integer codeword lengths; Shannon's source coding theorem explains how long blocks approach ideal per-symbol lengths. The interpretation concerns an average, not a fractional physical bit attached to every outcome. In our example, ideal coding with costs one bit per symbol, while bits; the difference is exactly the computed bits. [ref]
Zeros require explicit conventions. An outcome with contributes zero, including when ; the convention agrees with the relevant limit. If but , the Kullback-Leibler divergence is infinite: the predictor has declared impossible an outcome that can occur. On a finite alphabet, the probability support of must therefore be contained in the probability support of for a finite answer. For example, and give , but . For general probability measures, failure of absolute continuity of measures likewise gives infinity. Even does not guarantee a finite integral. [ref]
To see how confidently wrong predictions are punished, hold the true Bernoulli distribution parameter at and vary the predicted parameter . Its binary relative entropy is
It vanishes at , equals approximately nats at , and equals nats at . Both endpoints give infinity because both outcomes remain possible under . Predicting almost no successes is especially costly because successes actually occur three quarters of the time. The reversed binary relative entropy stays finite at the endpoints: its averaging probability distribution concentrates on just one outcome, and assigns positive probability to both.
Figure 2.
Bernoulli relative entropy with true success probability 0.75 and varying predicted probability
. Details.
For model selection, minimizing expected log-loss ranks candidate statistical models by , since is common to them. The true probability distribution is usually unknown, so one estimates predictive performance using fresh observations or cross-validation. Fitting and assessing on the same data can reward overfitting; a small fitted Kullback-Leibler divergence alone does not establish useful prediction.
In variational inference, a tractable trial probability distribution commonly minimizes against a target posterior distribution . Maximizing the evidence lower bound accomplishes this without evaluating the target's normalization constant. The averaging now follows : placing trial probability where the posterior distribution assigns almost none is strongly penalized. The chosen direction and trial family therefore matter. [ref]
These comparisons do not by themselves establish causal inference. Two statistical models can reproduce the same observed probability distribution while predicting different responses to an intervention. Choosing the smaller Kullback-Leibler divergence therefore needs additional assumptions or experimental evidence before supporting a causal claim. [ref]
The original reference is S. Kullback and R. A. Leibler's 1951 paper [ref], published in The Annals of Mathematical Statistics 22(1), pages 79–86. Its title connects this comparison with sufficient statistics: the historical setting was statistical information, before today's widespread applications in prediction and variational inference.
Let , and let be a normalized multiplicative arithmetic function supported on squarefree integers, with . Form the finite measure using Dirac measures. Under the transform convention , its Euler product is . Expanding its logarithmic modulus, and replacing the damped prime weights by up to with Mertens first theorem, gives the displayed absolute bound, uniformly in real . Hence forces . The distance expression still defines a nonnegative pretentious score for prime values bounded by one; its actual metric interpretation uses unit-modulus values.
Le Cam lower bound under absolute-error loss Created 2026-10-05 Updated 2026-10-06
For two observation laws at real parameters separated by , every estimator satisfies . With common densities, the sum of the two risks is at least , at least by the triangle inequality. Divide by two. The same proof works for any metric loss.
For continuous functions on a compact metric space satisfying , set . The triangle inequality makes -Lipschitz, while the constraint gives and evaluation at gives . Thus the feasible pair has at least as large an objective against any two probability measures. This explains why metric optimal transport duality reduces to a single -Lipschitz function.
Mahalanobis distance 2026-10-14
For a positive-definite covariance matrix, this is Euclidean distance after whitening. It accounts for both scales and correlations and is invariant under consistent nonsingular linear changes of coordinates. Estimating the covariance can be unstable with small samples, and a singular covariance requires restricting to a nonsingular subspace rather than claiming an ordinary metric on the full space.
Manhattan distance 2026-10-14
The metric induced by the L1 norm gives taxicab geometry. Each difference in Cartesian coordinates contributes its absolute value independently, so an axis-aligned route with no backtracking realizes the endpoint distance.
Maximal coupling Created 2026-09-24 Updated 2026-10-14
A maximal coupling of two probability distributions maximizes the agreement probability among all their couplings. Equivalently, it minimizes . The coupling characterization of total variation distance identifies the minimum mismatch with the total variation distance of the two marginal laws. The term maximal concerns agreement, rather than the size of a correlation coefficient or closeness in a geometric metric.
On a finite set, retain all common probability mass at equal pairs and match the excesses elsewhere. The explicit four-outcome example in coupling characterization of total variation distance realizes this construction and checks its marginal distributions. A maximal coupling need not be unique: different joint arrangements of the residual mass can have the same optimal mismatch.
For two nonempty planar circles with centers and radii , the greatest Euclidean distance between their points is the displayed expression. The triangle inequality gives the upper bound. When the centers differ, choose the two boundary points outward along the line of centers to attain it; when they coincide, choose opposite radial directions. For any third nonempty circle and a point on it, proves . This is not a metric, since for a positive-radius circle.
Metric Created 2026-09-24 Updated 2026-10-14
A metric on a set is a function satisfying, for every :
A metric equips its underlying set with a metric space structure; the distance function and the space carrying it are distinct concepts. The second requirement distinguishes a metric from a pseudometric, which may identify distinct elements at zero distance. The symmetry requirement also explains why directed travel times, such as uphill versus downhill times, need not define a metric.
A tempting alternative on the real numbers is . It is nonnegative, symmetric, and zero exactly on equal endpoints, but fails the triangle inequality: . Checking only the first three requirements would miss the failure.
Metric embedding Created 2026-09-28 Updated 2026-10-14
A metric embedding represents the points of one metric space inside another by an injective function . The geometric question is how faithfully the representation preserves pairwise distances. For example, binary strings can be treated as vectors so that tools from linear algebra become available, but the chosen norm determines what their separation means. A drawing of the points alone does not specify a metric embedding: both metrics matter.
An isometric embedding preserves every distance exactly. A metric embedding that is a bi-Lipschitz map allows multiplicative error while keeping its bi-Lipschitz distortion bounded over all pairs. A coarse embedding instead controls separation through possibly nonlinear functions of distance. These are different requirements: the Hamming cube as an L1 and L2 metric below preserves Hamming distance exactly in one representation and takes its square root in another.
The usefulness is that a complicated distance comparison becomes a calculation with familiar vectors and norms. This also helps assess a visualization: nearby points should not acquire arbitrarily large separations, and far-apart points should not collapse together. Matoušek's 2013 lecture notes describe how motivations from computer science, especially approximation algorithms, accelerated the study of metric embeddings from the 1990s onward. [ref]
Zero distance in a pseudometric defines an equivalence relation: the triangle inequality proves transitivity. If and have zero distance, as do and , the triangle inequality in both directions gives . Thus distance descends to the quotient and becomes a metric, since zero quotient distance means the classes coincide.
Metric space Created 2026-09-24 Updated 2026-10-14
A metric space is a set together with a metric measuring how far apart its elements are. The elements can be positions, functions, or other objects: what matters is that the metric obeys the same basic rules. This lets one discuss convergence in a metric space, continuous maps, and Cauchy sequences without first assigning Cartesian coordinates. The useful abstraction is that many arguments require only comparisons of distances, rather than the particular objects being compared.
Even the same set can support several informative metrics. On the plane with Cartesian coordinates, write and . Three standard choices are Manhattan distance, Euclidean distance, and Chebyshev distance:
They come from the L1 norm, Euclidean norm, and maximum norm, respectively, through . For and , Manhattan distance is , Euclidean distance is , and Chebyshev distance is . All three answers are correct for their respective metrics.
The choice encodes the question being asked. Manhattan distance models travel along a rectangular street grid. Euclidean distance measures unrestricted travel along a line segment. Chebyshev distance measures the time needed when two Cartesian coordinates can change simultaneously, each at speed at most one. Thus choosing a metric is part of modelling, rather than a consequence of knowing the endpoints. These examples have the same metric topology, but different metric path lengths and different collections of metric geodesics.
A historical reference for the general study of metric spaces is Maurice Fréchet's 1906 paper Sur quelques points du calcul fonctionnel, published in volume 22 of the Rendiconti del Circolo Matematico di Palermo. [ref]