The most popular technique for reducing the dimensionality in comparing two multidimensional samples of $\mathbf{X} \sim F$ and $\mathbf{Y}\sim G$ is to analyze distributions of interpoint comparisons based on a univariate function h (e.g. the interpoint distances). We provide a theoretical foundation for this technique, by showing that having both i) the equality of the distributions of within sample comparisons $(h(\mathbf{X}_1, \mathbf{X}_2) =_L h(\mathbf{Y}_1, \mathbf{Y}_2))$ and ii) the equality of these with the distribution of between sample comparisons $((h(\mathbf{X}_1, \mathbf{X}_2) =_L h(\mathbf{X}_3, \mathbf{Y}_3))$ is equivalent to the equality of the multivariate distributions $(F = G)$.