Why is the Kendall tau distance a metric? So I am trying to see how the Kendall $\tau$ distance is considered a metric; i.e. that it satisfies the triangle inequality.
The Kendall $\tau$ distance is defined as follows:
$$K(\tau_1,\tau_2) = |(i,j): i < j, ( \tau_1(i) < \tau_1(j) \land \tau_2(i) > \tau_2(j) ) \lor ( \tau_1(i) > \tau_1(j) \land \tau_2(i) < \tau_2(j) )|$$
Thank you in advance. 

Given two rankings $r_1,r_2$, define $S(r_1,r_2)$ as the set of pairs $\{i,j\}$ that are ranked the same by $r_1$ and $r_2$. If a pair is ranked  the same by $r_1$ and $r_2$ and also by $r_2$ and $r_3$, then it is also ranked the same by $r_1$ and $r_3$. Therefore:
$$S(r_1,r_3)\supseteq S(r_1,r_2)\cap S(r_2,r_3).$$
Let's denote by $N$ the total number of pairs (it is ${n\choose 2}$, where $n$ is the number of items). Then:
$$|S(r_1,r_2)\cap S(r_2,r_3)| \geq |S(r_1,r_2)| + |S(r_2,r_3)| - N.$$
By definition, $K(r_1,r_2) = N-|S(r_1,r_2)|$. Hence:
$$K(r_1,r_3) = N-|S(r_1,r_3)| \leq N - |S(r_1,r_2)| - |S(r_2,r_3)| + N \leq K(r_1,r_2)+K(r_2,r_3).~~~ \square$$
