# What is the difference between metric spaces and vector spaces?

Does a metric space have an origin? That is, does it have $(0,0)$.

Does a vector space have an origin?

It seems whatever you can do in a metric space can also be done in a vector space. Is this true?

• They are entirely different concepts. As to an origin, a general metric space does not have anything that behaves like the ordinary number zero does. A vector space does have a unique "zero-like" object, that is, a vector, that we often call $0$, such that $0+v=v+0=v$ for any vector $v$ in the space. Although the concepts of vector space and metric space are entirely different, some familiar spaces, uch as $\mathbb{R^3}$, are simultaneously vector spaces and metric spaces, and there is interaction between the vector structure and the metric structure. – André Nicolas Feb 29 '12 at 19:58
• The answers below tell the tale, but I am interested to know what you mean by the penultimate sentence in your question. What sort of things have you seen done in metric spaces that can (apparently) also be done in vector spaces? – user642796 Feb 29 '12 at 20:17

No, a metric space does not have any particular distinguished point called "the origin". A vector space does: it is defined by the property $0 + x = x$ for every $x$.

In general, in a metric space you don't have the operations of addition and scalar multiplication that you have in a vector space. On the other hand, in general a vector space does not have a notion of "distance".

• Normed linear vector spaces may have distance functions. For example $d(\vec x, \vec y)=||\vec x - \vec y||$. – user137035 Aug 25 '15 at 12:21

Vector spaces necessarily have a vector called the "zero vector"; in the special case of the vector space $k^n$ (where $k$ is a field), this vector is often called "the origin", since $k^n$ also can be seen as a geometric object (the $n$-dimensional affine space). But vector spaces don't necessarily have something we call "the origin": the collection of all polynomials with real coefficients is a real vector space, but we don't normally refer to the zero polynomial as "the origin", even though it is the zero vector of this vector space.

Metric spaces are sets with a metric defined on them. For example, the collection of all complex numbers with complex norm $1$, and with metric given by the usual distance between them as complex numbers, is a metric space. Any nonempty subset of the real numbers, with the usual distance function, is a metric space; and any nonempty set $X$, with distance defined by $d(x,y) = 0$ if $x=y$ and $d(x,y)=1$ if $x\neq y$, is a metric space. There need not be anything that we can reasonably call "the origin."

A metric space is a set with a distance. That's all you know. That means the set may not have an algebraic structure. for example, {chair, apple} is a set. define d(apple, apple) = d(chair, chair) = 0 and d(chair, apple) = d(apple, chair) = 1. That's a metric space, and it doesnt look like a vectorial space at all.

I think the OP is confusing a vector space with a normed vector space,which indeed shares many properties of general metric spaces.And for a very simple reason: A norm induces a metric on the underlying set on which the map is defined.This is fairly simple to prove from the definitions and the questioner should try and do it. A general vector space does NOT necessarily have these properties,of course.It is not even necessary that a general vector space admits any notion of distance whatsoever.

• Every vector space (over a subfield of $\mathbb{C}$) admits many different norms, and thus can be made into a metric space in multiple ways. – Adam Smith Mar 1 '12 at 18:45
• You're kidding,right? Yes,there are many different norms that can be constructed on a vector space,leading to many possible metrics and their respective topologies.How does that make what I just posted incorrect and deserving of a -1? It does NOT follow from the definition of a vector space in and of itself that that's true. My point was the definition of a vector space in and of itself-without a norm-does NOT admit any natural notion of distance and this was the point of confusion for the questioner.The notion of a norm is independent and needs to be considered separately. – Mathemagician1234 Mar 1 '12 at 19:43
• You made the following false statement : "It is not even necessary that a general vector space admits any notion of distance whatsoever." The word natural does not appear there. – Adam Smith Mar 1 '12 at 20:49

A metric space is a set with a notion of distance defined between points of that set. This notion of distance is a function known as the metric (which must satisfy a set of axioms pertaining to distance). This metric takes in any two points and maps them onto a real number which characterises the distance between those two points.

A vector space is a set containing objects called vectors which interact in some pre-defined way determined by the axioms. Vectors are measured relative to some reference frame and thus have a notion of magnitude and direction from some origin.

This is an ancient question; it also has been correctly answered. But maybe I can provide a perspective from Applied Mathematics.

A vector space with a finite number of dimensions $$n$$ must have a global coordinate structure (actually, many such structures) specified by $$n$$ vectors. For example, $$\mathbb R^3$$ has a global coordinate structure whose basis vectors are

$$X = (1, 0, 0)$$ $$Y = (0, 1, 0)$$ $$Z = (0, 0, 1)$$

What I mean by "coordinate structure" is that points of $$\mathbb R^3$$ can be specified as a linear combination of these three vectors:

$$v = (a X + b Y + c Z, d X + e Y + f Z, g X + h Y + i Z)$$

For the canonical basis above this is easy to see; there are more complicated choices of basis, but at any rate, this works for every element of $$\mathbb R^3$$.

Now take something as planet Earth. Obviously Earth isn't a mathematical object, and admits multiple mathematical models -- cosmologists see it as three-dimensional and who knows what contemporary physicists are up to. But we don't see Earth in three dimensions -- it's the literal 2D ground on which we walk. Still, it's notorious that a proper two-dimensional coordinate system for the Earth cannot be found.

One way to put this is that this model of the Earth is a two-dimensional manifold embedded in $$\mathbb R^3$$. But technically manifolds don't need to be embedded in anything; they just need to have some local structure that's out of scope for us. But the point is that we can easily define distances on Earth: two possible choices are geodesic (shortest flyover) and shortest-possible walking distance. We don't care how high the Everest is in a putative third dimension, we care how far it is on foot.

So that's a metric space (please check the axioms to convince yourself this is true); but not a vector space.

My current research has to do with Nearest Neighbors methods for data science. A conceptual point that I stress is that NN methods are useful when the data can be given a distance structure, but not a (credible) vector space structure. Take something like underwear: we can clearly say that U1 is closer to U2 than to U3, but it's much harder to imagine that there are basis vectors such that all underwear is just combinations of it. I.e. often the domain problems that arrive at the data scientist's desk have definite similarity structure but not a clear global coordinate structure.

(Of course, the Nearest Neighbor algorithm ultimately does calculations with computer arrays representing vectors; the entire challenge is to find "metric learning" algorithms that figure out the appropriate distance function near each point and map the data onto something on which the standard vector distances represent the abstract, ground-truth distances between objects. But this too is besides the point.)