TITLE: Are there any "spaces" that violate symmetry of metric spaces?
QUESTION [6 upvotes]: While reading about metric spaces, the following question struck me. We know the following definition of pseudometric spaces and metric spaces:

Suppose $d: X \times X \rightarrow \mathbb{R}$ and that for all $x,y,z \in X$:
$1. d(x,y) \geq 0$
$2. d(x,x)=0$
$3. d(x,y)=d(y,x)\space\space\space\space\space$ (Symmetry)
$4. d(x,z) \leq d(x,y)+d(y,z)$ (Triangle Inequality)
Such a "distance function" $d$ is called a pseudometric on X. The
  pair $(X,d)$ is called a pseudometric space.
If $d$ satisfies:
$5.$ when $x \neq y,$ then $d(x,y)>0$,
then $d$ is called a metric on X and $(X,d)$ is called a metric
  space.

Now, $\ell_2^2$ with $d: \ell_2^2 \times \ell_2^2 \rightarrow \mathbb{R}$ violates the property of triangle inequality. Any pseudometric space $(X,d)$ would violate the non-negativity of metric spaces, since they have at least two points $x \neq y$ for which $d(x,y)=0$.
Similarly, are there any "spaces" that violate symmetry of metric spaces? If not, how do we justify mathematically?
Thank you in advance.

REPLY [3 votes]: Metric spaces where distances are in $[0,\infty]$ and which drop symmetry but still satisfy the triangle inequality and and $d(x,x)\ge 0$ are called generalised metric spaces in the influential paper by Lawvere http://www.tac.mta.ca/tac/reprints/articles/1/tr1abs.html
A nice example of a space where asymmetry is important is given by finite or infinite words over an alphabet, see Rutten http://www.cwi.nl/~janr/papers/files-of-papers/1996-tcs170.pdf . The idea is that $d(w,v)=0$ means that the word $w$ is a prefix of the word $v$ and that $d(w,v)=2^{-n}$ if the first letter where $w$ differs from $v$ is at position $n+1$. 
Ok, this is an ultrametric space. But as the question was about asymmetry, it is still a nice example. And I think that metric space examples can be constructed along the same lines.