# Metric from a positive definite matrix

I'm trying to prove that the Mahalanobis distance is an actual distance, more in general

Given B symmetric and positive definite matrix set
d(x,y)=(x-y)'B(x-y)


( the ' means Transpose)

Of course the only difficoult thing to prove is the triangoular inequality

Any insights?

EDIT: this is what I've tried so far... given B, using the spectral thm, B=QBQ', thus $d(x,y)=(Q'(x-y))' \Lambda (Q'(x-y))$

then $Q'(x-y)=(x^*-y^*)$ and it's sufficient to prove the inequality for $z^*=Qz$.

Anyways, when i write $(x^*-y^*)=(x^*-z^*)+(z^*-y^*)$ and put it into the distance formula, I cannot decide the sign of $(x^*-z^*)\Lambda(y^*-z^*)$

• Please add the [self-study] tag & read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. Mar 13, 2016 at 21:12
• If you start with the description of Mahalanobis distance I gave at stats.stackexchange.com/questions/62092/…, then this result follows immediately from the fact that Euclidean distance (in the plane) satisfies the triangle inequality.
– whuber
Mar 13, 2016 at 21:27