We extend the theory of distance (Brownian) covariance from Euclidean spaces,
where it was introduced by Sz\'{e}kely, Rizzo and Bakirov, to general metric
spaces. We show that for testing independence, it is necessary and sufficient
that the metric space be of strong negative type. In particular, we show that
this holds for separable Hilbert spaces, which answers a question of Kosorok.
Instead of the manipulations of Fourier transforms used in the original work,
we use elementary inequalities for metric spaces and embeddings in Hilbert
spaces.Comment: Published in at http://dx.doi.org/10.1214/12-AOP803 the Annals of
Probability (http://www.imstat.org/aop/) by the Institute of Mathematical
Statistics (http://www.imstat.org