Proving $\frac1 {2^n}$ is a metric Let $X = \{(x_1,x_2,x_3,\ldots) : x_i \in (0,1)\}$. For $x,y \in X$, let $n$ be the least natural number such that $x_n \neq y_n$ (if it exists). Define $d(x,y)$ by 
$$d(x,y) = 1/2^n$$
if such an $n$ exists, or $0$ otherwise. I need to prove that $d$ is a metric.
I am completely lost as to how to approach this question, where do I start with the definition and how do I prove this is a metric?
 A: Non-negativity: Obvious. Suppose $d(x,y)=0$ then consider $x_i$ and $y_i$ for each $i$. If for some $i\in\mathbb N$, $x_i\neq y_i$ then $d(x,y)\geq \dfrac{1}{2^i}>0$, a contradiction. Thus $d(x,y)=0$ iff $x=y$.
Symmetry: Obvious again, since if $x$ and $y$ differ and $i$ is the least positive integer where $x_i\neq y_i$ then $i$ is the least positive integer where $y_i\neq x_i$ so $d(y,x)=d(x,y)$.
Triangle inequality: Take two sequences $x,y$ and take a third sequence $z$. If any two are equal, say WLOG $x=y$ then $d(x,y)=0$ and thus $d(x,y)\leq d(x,z)+d(z,y)$ trivially. If $y=z$ then $d(x,y)=d(x,z)+d(z,y)$, again trivially. So suppose $x,y,z$ are all distinct. Let $i_1$ be the least positive integer where $(x_i,y_i)$ vary. $d(x,y)=\dfrac{1}{2^{i_1}}$.
Note that if $x$ and $y$ are different at coordinate $i$ then they cannot share common coordinate $i$ with $z$: at least $x$ or $y$ should vary with $z$ at coordinate $i$. At coordinate $i_1$ $x$ and $y$ vary for the first time. Thus, one of $x$ or $y$ should vary with $z$ at that coordinate $i_1$. So $d(x,z)\geq \dfrac{1}{2^{i_1}}$ or $d(z,y)\geq \dfrac{1}{2^{i_1}}$. This clearly shows that $d(x,z)+d(z,y)\geq \dfrac{1}{2^{i_1}}=d(x,y)$.
