system
Given the following post, respond as if you're commenting on Reddit:
human
Can there be such a distance function?

I want to know about a special distance function. I know the properties of a normal distance function, in any space, but one has recently drawn my attention: the triangular inequality.
The triangular inequality can be explained the following manner (if I understand correctly):
given A,B and C 3 points in some space and D a distance function in this space, than the following statement is true:
D(A,B) <= D(A,C) + D(C,B).
My question is: can there be a distance function for which the following statement is true:
given A,B and C 3 **different** points then
D(A,B) **<** D(A,C) + D(C,B)?

If yes, which one, how?
If no, why?

**Edit:** Thanks everyone for the answer. I didn't realize so weird distances and metrics can be useful, I just thought it is a weird question to think about. Well, you learns something everyday!
gpt
Yes. But before we start, first the 4 properties that a function must have in order to be a distance function:

- D(x, y) = 0 if and only if x = y
- D(x, y) = D(y, x)
- D(x, y) >= 0
- D(x, z) <= D(x, y) + D(y, z)

the last one being the triangle inequality that you already mentioned. You're looking for a distance function where the triangle inequality is a strict inequality when the 3 points are distinct.

Let D(x, y) = 0 if x = y and 1 otherwise.

Verification that this function has the 4 required properties is straightforward, property 1, 2 and 3 follow directly from the definition. For property 4, we distinguish distinct cases:

- x = z, but x <> y and y <> z. We find: D(x, z) = 0, D(x, y) + D(y, z) = 2, OK.
- x <> z, x = y, y <> z. D(x, z) = 1, D(x, y) + D(y, z) = 1, OK.
- x <> z, x <> y, y = z. D(x, z) = 1, D(x, y) + D(y, z) = 1, OK.
- x <> z, x <> y, y <> z. D(x, z) = 1, D(x, y) + D(x, z) = 2, OK.

For your requirements, the 4th point of the above applies. We see that the strict inequality clearly holds.

The name of this distance function is the "discrete metric", with metric being the term commonly used instead of distance function.