Let $K$ be a nonempty set and $X$ a collection of sequences which their elements are from $k$
Let $d:X\times X\to [0,\infty)$ be defined as follow:
$$ d(x,y)= \begin{cases} 0,& x=y\\ \dfrac{1}{\min\{i\in \mathbb{N}:x_i\neq y_i\}},& x\neq y\\ \end{cases} $$
Prove this is a metric.
It is easy to see that
a. it is nonnegative and equal to zero iff $x=y$
b. it is symmetric
for the triangle inequality, if we have $x,y,z$ and there are two which are equal, WLOG all will be equal.
how can I proceed in the case where $x\neq y \neq z$, if we take: $x=(0,1,x,...,y,x)$ , $y=(2,...,2,y,2)$, $z=(3,1,z,...,z,y,z)$
It seems that $d(x,z)\geq d(x,y)+d(y,z)$.
Another try:
Let assume that $d(x,z)=\frac{1}{i}$ then we have $4$ options:
$d(x,y)\leq \frac{1}{i}$ or $d(x,y)\geq \frac{1}{i}$ and $d(y,z)\leq \frac{1}{i}$ or $d(y,z)\geq \frac{1}{i}$
for all options the triangle inequality holds, as there is an element which is bigger then $\frac{1}{i}$ and for both $d(x,y)\leq \frac{1}{i}$ and $d(y,z)\leq \frac{1}{i}$ then $d(x,z)=\frac{1}{i}\leq d(x,y)+d(y,z)\leq \frac{2}{i}$
Hint for triangle inequality: Show that $$ d(x,z)\leq \max\{d(x,y), d(y,z)\} $$ and then prove the triangle inequality from there.