Is the Jaccard distance a distance? Wikipedia defines the Jaccard distance between sets A and B as $$J_\delta(A,B)=1-\frac{|A\cap B|}{|A\cup B|}.$$ There's also a book claiming that this is a metric. However, I couldn't find any explanation of why $J_\delta$ obeys the triangle inequality. The naive approach of writing the inequality with seven variables (e.g., $x_{001}$ thru $x_{111}$, where $x_{101}$ is the number of elements in $(A\cap C) \backslash B$) and trying to reduce it seems hopeless for pen and paper. In fact it also seems hopeless for Mathematica, which is trying to find a counterexample for 20 minutes and is still running. (It's supposed to say if there isn't any.)
Is there a simple argument showing that this is a distance? Somehow, it feels like the problem shouldn't be difficult and I'm missing something.
 A: The trick is to use a transform called the Steinhaus Transform. Given a metric $(X, d)$ and a fixed point $a \in X$, you can define a new distance $D'$ as
$$D'(x,y) = \frac{2D(x,y)}{D(x,a) + D(y,a) + D(x,y)}.$$
It's known that this transformation produces a metric from a metric. Now if you take as the base metric $D$ the symmetric difference between two sets and empty set as $a$, what you end up with is the Jaccard distance (which actually is known by many other names as well).
For more information and references, check out Ken Clarkson's survey Nearest-neighbor searching and metric space dimensions (Section 2.3).
A: It is possible to prove this directly too, without invoking the Steinhaus Transform. But that would probably make the proof longer. However, I did once prove it directly, and I think it went a bit like this: 
Assume there exist A, B ,C such that d(A,B) + d(B,C) < d(A,C). For such a counterexample, note that A, C and $A\cap C$ have to be nonempty. Now since the right hand side remains unchanged on changing B, we can remove all elements in B which are not in A or C, since that would only further decrease the left hand side. Thus B is contained in $A\cup C$. The final step involves arguing that we can also remove all those elements in B which are only in A or C, as this operation will also only decrease the left hand side. Finally, we will have a B that is supposedly a counterexample to the metric distance claim, but it lies completely in $A \cap C$. This can also be shown to be not possible.
I hope I remember it right, I haven't worked this out recently.
A: Here is an elementary proof of the Steinhaus transform (from which said metricity follows as a special case, as noted in Suresh's answer).

Lemma. Let $p,q > 0$ and $r\geq 0$ such that $p \le q$. Then, $\frac{p}{q} \le \frac{p+r}{q+r}.$


Corollary. Let $d(x,y)$ be a metric. Then, for arbitrary (but fixed) $a$, the map $\delta$ defined by
\begin{equation*}
 \delta(x,y) := \frac{2d(x,y)}{d(x,a)+d(y,a)+d(x,y)}
\end{equation*}
(and $\delta(a,a)=0$)
is a metric.

Proof. Only the triangle inequality for $\delta$ is nontrivial. Let $p=d(x,y)$, $q=d(x,y)+d(x,a)+d(y,a)$, and $r=d(x,z)+d(y,z)-d(x,y)$. Applying the lemma, we obtain
\begin{eqnarray*}
 \delta(x,y) &=& \frac{2d(x,y)}{d(x,a)+d(y,a)+d(x,y)} \le \frac{2d(x,z)+2d(y,z)}{d(x,a)+d(y,a)+d(x,z)+d(y,z)}\\
 &=& \frac{2d(x,z)}{d(x,a)+d(z,a)+d(x,z)+d(y,z)+d(y,a)-d(z,a)} + \frac{2d(y,z)}{d(y,a)+d(z,a)+d(y,z)+d(x,z)+d(x,a)-d(z,a)}\\
&\le& \delta(x,z)+\delta(y,z),
\end{eqnarray*}
where the last inequality again uses triangle inequality for $d$.
A: I found a very brief and easy-understanding proof in the paper by Sven Kosub, "A note on the triangle inequality for the Jaccard distance".
A: Possibly the simplest proof of the triangle inequality for the jaccard distance comes from the fact that it is the collision probability of the MinHash algorithm, and that's all we need. Let $H(X) = \text{argmin}_{i\in X} \pi(i)$ where $\pi(i)$ is a uniformly random permutation.
\begin{align*}
J(X,Y) &= \Pr\left[H(X) = H(Y)\right] \\
 1 - J(X,Y) &= \Pr\left[H(X) \neq H(Y)\right].\\
\end{align*}
So for any $Z$,
\begin{align*}
\Pr\left[H(X) = H(Y)\right] &\ge \Pr\left[H(X) = H(Z) \land H(Y) = H(Z)\right] \\
\Pr\left[H(X) \neq H(Y)\right] &\le \Pr\left[H(X) \neq H(Z) \lor H(Y) \neq H(Z)\right]
\end{align*}
But by the union bound,
\begin{align*}
\begin{split}
\Pr\big[H(X) \neq H(Z) \lor H(Y) \neq H(Z)\big] 
&\le \Pr\big[H(X) \neq H(Z)\big] + \Pr\big[H(Y) \neq H(Z)\big]
\end{split}
\end{align*}
My co-author used this to prove that a particular jaccard generalization is a metric after I'd been struggling to prove it for a month, and I couldn't believe it.
A: We permute all the elements of $A \cup B \cup C$ and denote by $p_{A,B}$ the probability that the first element of the permutation that is in $A$ or $B$ is not in both.
This probability is equal to $1-\frac{A \cap B}{A \cup B}$, which is the Jaccard distance, because we look at the first element which is in $A \cup B$ and the probability that it is in both sets is $\frac{A \cap B}{A \cup B}$. 
Now we are only left to prove that $p_{A,B}+p_{B,C} \geq p_{A,C}$. That's true  because if the first element of the permutation that is in $A$ is in index $i(A) \neq i(C)$, then it means that $i(A) \neq i(B)$ or $i(B) \neq i(C)$.
