This is a question from Gemignani's Elementary Topology. Here is the question:
Let $X,D$ be a metric space. For each $x,y \in X$, define $H_1(x,y)$ to be $\{ w\in X \, | \, D(x,w) >D(y,w)\}$ and $H_2(x,y)$ to be $\{ w\in X \, | \, D(x,w) <D(y,w)\}$. Prove that $H_1(x,y)$ and $H_2(x,y)$ are open with respect to $D$.
I tried proving it but could not succeed. I noticed that when $X=\mathbb{R}^2$ and $D$ is the Euclidean metric then $H_1(x,y)$ and $H_2(x,y)$ are half planes. In order to show that $H_1(x,y)$ is open, I took an arbitrary $w \in H_1(x,y)$ tried to show that it is an interior point. I conjectured that $N(w,r) \subset H_1(x,y)$ where $r=\frac{(D(x,w))^2-(D(y,w))^2}{2D(x,y)}$ but couldn't prove it.
Hints will appreciated.