metric discrete metric semimetric ultrametric hemimatrix isometry distance function equidifference euclidean metric metric tensor