Will Jagy's comment deserves to be an answer:
Look up Minkowski space and Lorentz manifolds in general.
Minkowski space in $n+1$ dimensions is $\mathbb R^{n+1}$ with the "distance function" $ d(\langle x_1,\ldots,x_n, t\rangle, \langle y_1,\ldots,y_n,u\rangle) = \sqrt{(t-u)^2-(x_1-y_1)^2-(x_2-y_2)^2\cdots-(x_n-y_n)^2}$
Here $d(x,y)=d(y,x)$ and distances cannot be negative, but they can be null or purely imaginary! (For mathematical sanity, one usually considers the square of this distance function, such as not to be troubled with the multi-valuedness of the square root, though).
Minkowski space is the basic fabric of relativity. Indeed the fundamental postulate of the Special Theory of Relativity could be phrased as:
The stage on which physics plays out can be given the structure of $3+1$-dimensional Minkowski space, such that all fundamental laws of nature are preserved by every Minkowski isometry. (Or at least by every Minkowski isometry that can be "smoothly" turned into the identity).
(And, by the way, light rays connect points whose mutual Minkowski distance is 0).
Beware, however, that the Minkowski distance is not used to define the topology of Minkowski space. One uses the ordinary Euclidean topology on $\mathbb R^{n+1}$.
Minkowski isometries are better known as Lorentz transformations, though often that name is only used for isometries that fix the point $\langle 0,\ldots,0,0\rangle$.
Lorentzian manifolds generalize Minkowski space to curved spacetimes for General Relativity.