Let $X$ be a metric space with metric $d$. Let $K$ denote a collection of open sets in a metric super space of $X$ which also has the same metric $d$. Define a function $u: X \rightarrow \mathbb R^+ \cup \{0\}$ such that $u(x)= \sup \{dist(x,U^c)~|~ U \in K\}. $
Prove that $u(x)-u(y) \le d(x,y) \le u(x)+u(y)$
Note: The distance function $dist(x, A) = \inf \{ d(x,a)~|~a \in A\}$ where $A$ is a set in $X$.
Attempt: case 1 Proving that $u(x)-u(y) \le d(x,y)$
By the definition of $u~:\forall r >0$, we can find a set $ U_{x_r}^c \in K^c$ satisfying :
$u(x) \le dist(x, U_{x_r}^c) + r $
Let $y \in X~,~U \in K$. Then:
$u(x) \le dist(x, U_{x_r}^c) + dist(y, U_{x_r}^c)+ dist(y, U^c)+r $
$\implies u(x) \le d(x,z) + d(y,z)+ dist(y, K^c)+r $
where $z$ is any random element in $U_{x_r}^c.$
$\implies u(x) \le d(x,y)+ \sup \{ dist(y, K^c) ~|~\}+r $
$\implies u(x) \le d(x,y)+ u(y) $
$\implies u(x)-u(y) \le d(x,y)$.
Case 2: Proving that $d(x,y) \le u(x)+u(y)$
$d(x,y) \le d(x,z) + d(z,y)$
where for a particular $U \in K, d(x,z) \le dist(x,U^c) + \dfrac {r}{2} $. Such a $z$ always exists because of the definition of dist function.
$\therefore~~d(x,y) \le dist(x,U^c) + + d(z,y) + \dfrac {r}{2} $
Now, I am stuck here because the same $z$ might not hold the same property of $d(x,y) \le dist(y,U^c) + \dfrac {r}{2} $
Please give me some hints on how to move forward from here onwards. Thank you very much for reading through.!
$d(x,y) \le d(x,z) + d(z,y)$ where $z \in U^c$ is such a point that $d(x,z) \le dist(x,U^c) + \dfrac {r}{2} $
$\therefore d(x,y) \le dist(x,U^c) + \dfrac {r}{2} + d(z,y) \le dist(x,U^c) + \dfrac {r}{2} + d(z,y) + d(z,z')$ where $z' \in U^c$ satisfies : $d(y,z') \le dist(y,U^c) + \dfrac {r}{2}$
$\therefore d(x,y) \le dist(x,U^c) + dist(y,U^c) +r \implies d(x,y) \le \sup \{dist(x,U^c)~|~U \in K\} + \sup \{ dist(y,U^c)~|~U \in K\} = u(x)+u(y) $