Distance of a point to a subset. 
Let $(M,d)$ be a metric space. For a subset $A\subseteq M$ we define the distance of a point $x$ to $A$ as
$$\alpha_A(x):=\operatorname{dist}(x,A):=\inf_{y\in A}d(x,y)$$
Prove that:
a) $|\alpha_A(x_1)-\alpha_A(x_2)|\leq d(x_1,x_2)\text{ for all }x_1,x_2\in M$.
b) $\alpha_A:M\to\mathbb{R}$ is continuous.
c) $\alpha_A(x):=0\leftrightarrow x\in\bar{A}$.
d) If $A$ is closed and $K\subseteq M$ compact with $A\cap K=\emptyset$, then $A$ and $K$ have a positive distance, meaning
$$\operatorname{dist}(K,A):=\inf d(x,y)>0\text{ for }x\in K,y\in A.$$

My ideas so far:
a) I can imagine that this is true because I imagine $A$ being a ball and individual distance on $\alpha$ is the closest distance to that ball. But I don't know how to write down the proof mathematically.
b) Now I'm lost here. Don't know how to approach this.
c) Again, I can easily imagine that since $x$ is in $A$, meaning the closest distance to the subset is $0$, but I can't prove that mathematically.
d) Similar to before, I have no idea how to write down the mathematical proof. But I imagine this one as a situation with two separate balls, since the intersection is the empty set. Meaning that the "gap" between them is the positive distance.
Can someone show me how to write down mathematical proofs on this type of questions?
 A: a) First, thinking of $A$ as a ball is a little simplistic because $A$ can be any set, not just a simple one. Now I will prvoe your desired result.  Without loss of generality, assume that $d(x_1,A)<d(x_2,A)$. Let $\{y_n\}\subseteq A$ be a sequence such that $d(x_1,y_n)\to d(x_1,A)$ as $n\to\infty$. Suppose, to the contrary, that $d(x_1,x_2)<|\alpha_A(x_1)-\alpha_A(x_2)|$. Then $$|\alpha_A(x_1)-\alpha_A(x_2)|>d(x_2,x_1)\geq|d(x_1,y_n)-d(y_n,x_2)|,$$ for all $n$. Thus,
$$|\alpha_A(x_1)-\alpha_A(x_2)|>|\alpha_A(x_1)-d(y_n,x_2)|.$$ By our original assumption, $\alpha_A(x_1)-d(y_n,x_2)<0$, and $\alpha_A(x_2)<d(y_n,x_2)$, so 
$$|\alpha_A(x_1)-\alpha_A(x_2)|>|\alpha_A(x_1)-\alpha_A(x_2)|.$$
This is a contradiction.
b) We will use part (a). Let $\varepsilon>0$. Pick $x_1\in M$. Let $\delta<\varepsilon.$ Then if $d(x_1,x_2)<\delta,$
$$|\alpha_A(x_1)-\alpha_A(x_2)|\leq d(x_1,x_2)<\delta<\varepsilon.$$
c) ($\Rightarrow$) Assume that $\alpha_A(x)=0$. Then for all $\varepsilon>0$, there exists $y\in A$ such that $d(x_1,y)<\varepsilon$. Thus, there exists $y\in B_\varepsilon (x)$ for all $\varepsilon$ and $x\in\overline A$.
($\Leftarrow$) Assume that $x\in \overline A$. Then for all $\varepsilon>0$, $B_\varepsilon(x)$ contains a point in $A$ other than $x$. Thus, for each $\varepsilon>0$, there exists $y\in A$ such that $d(x,y)<\varepsilon$ do $\alpha_A(x)=0$.
d) Let $f:K\to A$ be defined by $f(x)=\alpha_A(x)$. We already know that $f$ is continuous and defined on a compact set, so it achieves its minimum. We show that its minimum is greater than 0. Suppose, to the contrary, that there exists $x\in K$ such that $\alpha_A(x)=0$. Then $a\in \overline A$. But $A$ is closed, so it contains all of its limit points. Thus, $x\in A$. Then $x\in A\cap K$. This is a contradiction, so we conclude that $f(x)>0$ for all $x\in K$. Then $$d(K,A)=\inf_{x\in K,y\in A}d(x,y)=\min_{x\in K} f(x)\geq 0.$$ 
