While we specify that the input should be a Euclidean Distance Matrix (as this results in a Gram Matrix)
the domain of edm2gram is the set of all real symmetric matrices. This function is particularly useful
as it has the following property:
$$edm2gram(D_{n}^{-}) = B_{n}^{+}$$
where \(D_{n}^{-}\) is the space of symmetric, hollow matrices, negative definite on the space spanned by \(x'e = 0\)
and \(B_{n}^{+}\) is the space of centered positive definite matrices.
We can combine these two properties with a well known result: If D is a real symmetric matrix with 0 diagonal (call this matrix pre-EDM),
then D is a Euclidean Distance Matrix iff D is negative semi-definite on \(D_{n}^{-}\).
Using this result, combined with the properties of edm2gram we therefore have that
D is an EDM iff D is pre-EDM and \(edm2gram{D}\) is positive semi-definite.