# Why $f(x) = \frac{d(x,A)}{d(x,A)+d(x,B)}$ is uniform continuous?

Let $X$ be a metric space, $A$ and $B$ are two subsets of $X$. $d(x, A) = \inf_{z \in A}d(x,z)$ and $\inf_{x \in A,y \in B}d(x,y) = \delta > 0$ We define $$f(x) = \frac{d(x,A)}{d(x,A)+d(x,B)}$$

How to show $f(x)$ is uniform continuous? I know that, since $|d(x,A)-d(y,A)| \leq d(x,y)$, $d(x,A)$ is uniform continuous. Is there some principle that guarentee that uniform continuity is preserved by composition of functions?

-
I assume here $A$ and $B$ are disjoint? Otherwise we get some $\frac{0}{0}$ things. – Euler....IS_ALIVE Mar 23 '13 at 19:09
@Euler....IS_ALIVE: It is mentionned that $d(A,B)= \delta >0$. – Seirios Mar 23 '13 at 19:11

You have $$|f(x)-f(y)|= \frac{ |d(x,A)d(y,B)-d(y,A)d(x,B)|}{(d(x,A)+d(x,B))(d(y,A)+d(y,B))}$$
Eventually, permute $x$ and $y$ so that: $$|f(x)-f(y)|= \frac{ d(x,A)d(y,B)-d(y,A)d(x,B)}{(d(x,A)+d(x,B))(d(y,A)+d(y,B))}$$
But $d(x,A) \leq d(x,y)+d(y,A)$ so $$\begin{array}{ll} d(x,A)d(y,B)-d(y,A)d(x,B) & \leq d(x,y)d(y,B)+d(y,A)(d(y,B)-d(x,B)) \\ & \leq d(x,y)(d(y,A)+d(y,B)) \end{array}$$
Finally, $$|f(x)-f(y)| \leq \frac{d(x,y)}{d(x,A)+d(x,B)} \leq \frac{d(x,y)}{d(A,B)} =\frac{1}{\delta}d(x,y)$$
Therefore, $f$ is $1/\delta$-lipschitz and a fortiori uniformly continuous.