# Show the metric function is continuous

Let X be a metric space with metric d. Show that d: X x X -> R is continuous.

I know the properties of the metric:
d(x,y) > 0 if x != y, d(x,x) = 0
d(x,y) = d(y,x)
d(x,y) + d(y,z) >= d(x,z)

Now take any open set (a,b) in R (im assuming the standard topology on R). d^-1((a,b)) = {(x,y) e X x X : d(x,y) e (a,b)} (e stands for element)

Now i have to show d^-1((a,b)) is open. I tried playing around with the properties in different cases, but i dont have a clear indication of how to move on from here. I will keep trying but if anyone can guide me that would be good.

## Answers and Replies

StatusX
Homework Helper
The open balls form a basis for the metric space, so to show a set is open, for each point in the set you need to find an open ball about that point that is contained in the set. In this case, use the triangle inequality.

I tried the open balls method, but i cant find one that is a subset of (a,b). Only that its a subset of (0,b). I tried many different inequalities but im going nowhere...any more hints?

StatusX
Homework Helper
So say a point (x,y) is in the preimage of (a,b). Then the distance between x and y is between a and b. Now you want to find an open ball U around x and V around y such that the distance from any point in U to any point in V is between a and b, because then UxV is a neighborhood of (x,y) contained in the preimage of (a,b). Try drawing this out in R^2 and see where the triangle inequality needs to be applied.