In mathematics, a metric projection is a function that maps each element of a metric space to the set of points nearest to that element in some fixed sub-space.
Formally, let X be a metric space with distance metric d, and let M be a fixed subset of X. Then the metric projection associated with M, denoted p<sub>M</sub>, is the following set-valued function from X to M:<blockquote></blockquote>Equivalently:<blockquote></blockquote>The elements in the set are also called elements of best approximation. This term comes from constrained optimization: we want to find an element nearer to x, under the constraint that the solution must be a subset of M. The function p<sub>M</sub> is also called an operator of best approximation.
In general, p<sub>M</sub> is set-valued, as for every x, there may be many elements in M that have the same nearest distance to x. In the special case in which p<sub>M</sub> is single-valued, the set M is called a Chebyshev set. As an example, if (X,d) is a Euclidean space (R<sup>n</sup> with the Euclidean distance), then a set M is a Chebyshev set if and only if it is closed and convex.
If M is non-empty compact set, then the metric projection p<sub>M</sub> is upper semi-continuous, but might not be lower semi-continuous. But if X is a normed space and M is a finite-dimensional Chebyshev set, then p<sub>M</sub> is continuous.
Moreover, if X is a Hilbert space and M is closed and convex, then p<sub>M</sub> is Lipschitz continuous with Lipschitz constant 1.
Metric projections are used both to investigate theoretical questions in functional analysis and for practical approximation methods. They are also used in constrained optimization.