d(x,y)={ 1 if x does not equal y

0 if x=y

Prove that d satisfies the axioms of a metric.

clearly it satisfies d(x,y) existing in the reals, and d(x,y)>=0 and d(x,y)=0 iff x=y. why I don't know is triangle inequality and d(x,y)=d(y,x).

To prove that the function d(x, y) satisfies the axioms of a metric, we need to show that it satisfies the following properties:

1. Non-negativity: d(x, y) ≥ 0 for all x, y.
2. Identity of indiscernibles: d(x, y) = 0 if and only if x = y.
3. Symmetry: d(x, y) = d(y, x) for all x, y.
4. Triangle inequality: d(x, y) ≤ d(x, z) + d(z, y) for all x, y, z.

Let's go through each property step-by-step to see how d(x, y) satisfies them:

1. Non-negativity:
We know that d(x, y) = 1 if x ≠ y, and d(x, y) = 0 if x = y. Since both 1 and 0 are non-negative numbers, it is clear that d(x, y) ≥ 0 for all x, y.

2. Identity of indiscernibles:
If x = y, then according to the given definition, d(x, y) = 0. On the other hand, if d(x, y) = 0, it means that x = y because d(x, y) = 0 if and only if x = y.

3. Symmetry:
According to the definition of the function d(x, y), we can see that it doesn't depend on the order of the variables x and y. If d(x, y) = 1, it means that x ≠ y, and if d(y, x) = 1, it means that y ≠ x. Therefore, d(x, y) = d(y, x).

4. Triangle inequality:
To prove the triangle inequality property, we need to show that d(x, y) ≤ d(x, z) + d(z, y) for all x, y, z.

Case 1: x = y:
Since x = y, we have d(x, y) = d(x, x) = 0. On the right-hand side, we have d(x, z) + d(z, y) = d(x, z) + d(y, z). Since d(x, z) and d(y, z) are both greater than or equal to 0, their sum cannot be less than 0. Therefore, the inequality d(x, y) ≤ d(x, z) + d(z, y) holds.

Case 2: x ≠ y:
In this case, we have d(x, y) = 1. Similarly, the right-hand side of the inequality is d(x, z) + d(z, y) = 1 + 1 = 2. Since 1 is less than 2, the inequality d(x, y) ≤ d(x, z) + d(z, y) holds.

By satisfying all four properties, we have shown that the function d(x, y) satisfies the axioms of a metric.