Geodesic Spheres and Gram Matrices
Posted by Tom Leinster
This is a short weekend diversion, containing nothing profound.
Any sphere in can be given the geodesic metric, where the distance between two points is defined to be the length of the arc of a great circle between them. It’s not a big surprise that the same is true in any real inner product space : for instance, the unit sphere centred at the origin can be given a geodesic metric in a natural way. This defines a functor
from inner product spaces to metric spaces, where in both cases the maps are not-necessarily-surjective isometries.
What’s more interesting is that it’s not quite as straightforward to prove as you might imagine. One way to do it leads into the topic of Gram matrices, as I’ll explain.
In , we define the geodesic metric on the unit sphere by
The Cauchy–Schwarz inequality tells us that
(since and are unit vectors), so the inverse cosine makes sense.
So in an arbitrary inner product space , we’re obviously going to define the geodesic metric on the unit sphere by
Again, the Cauchy–Schwarz inequality guarantees that the inverse cosine makes sense, and again we interpret as taking values in .
Great! We’ve defined . The next step is to check that it really is a metric — and here’s where it gets interesting. All the axioms are easy to check, except the triangle inequality:
for all unit vectors , and .
How can we prove this?
In short, the first step is to follow your nose and do all the obvious moves in order to get rid of the trig functions. Here’s how it goes (and you may now wish to skip to the next paragraph): we’re treating as a function , and it’s strictly decreasing there, so we might as well take the cosine of each side and reverse the inequality. That gives something of the form on the left-hand side, but we can apply the usual trigonometric formula. That gives something involving sines of inverse cosines, but we can use the fact that to get it back in terms of cosines. But now we’ve got some undesired square roots, so we rearrange and square both sides (taking care of the dangers inherent in such a move).
After working through this (and it’s actually less work than I’ve made it sound), we end up concluding that the triangle inequality for , and holds if and only if or
The first inequality in this either-or statement only sometimes holds, but the second inequality always holds, as we’ll show. How? Well, that’s where Gram matrices come in.
We’ll now change direction and forget about geodesic metrics for a while.
Given a finite list of vectors in a real inner product space, there arises an matrix, the so-called Gram matrix
A famous type of Gram matrix is the covariance matrix of a family of random variables. Technicalities aside, random variables form an inner product space with covariance as the inner product, and the covariance matrix of is by definition their Gram matrix.
The crucial point now is that the determinant of a Gram matrix is nonnegative. There are a couple of ways to prove this, but probably the best is to prove the superficially stronger statement that every Gram matrix is positive semidefinite. (“Positive semidefinite” is only usually defined for symmetric matrices, which Gram matrices obviously are.) And this is easy: for all ,
The same argument shows that the Gram matrix of linearly independent vectors is positive definite, and in particular has strictly positive determinant. But we won’t need this extra precision.
So: for any finite list of vectors in any inner product space, their Gram matrix has nonnegative determinant. This gives a whole sequence of inequalities (“Gram inequalities”),
one for each . Let’s go through them for the first few values of .
: the Gram matrix of a list of length is the unique matrix, which has determinant , so Gram’s inequality for says . Undoubtedly.
: the Gram matrix of a single vector is , which has determinant , so Gram’s inequality for says .
: take vectors and in a real inner product space. Their Gram matrix is Gram’s inequality for therefore says that This is exactly the Cauchy–Schwarz inequality! Why’s that exciting? First, because it suggests that the Gram inequalities for higher can be regarded as higher Cauchy–Schwarz inequalities. And second, because given the all-pervasive nature of Cauchy–Schwarz, it’s a strong hint that the higher Gram inequalities are going to be useful too. So we have a machine for generating useful inequalities.
: take vectors , and in a real inner product space. Their Gram matrix is and Gram’s inequality for says that . I won’t bother writing that out explicitly for general , but look what it says when : That’s exactly the inequality we wanted to prove earlier — the one that proves the triangle inequality for the geodesic metric!
So: we’ve now proved that on the unit sphere of any inner product space, the “geodesic metric”
satisfies the triangle inequality, and is, therefore, genuinely a metric.
Re: Geodesic Spheres and Gram Matrices
My initial instinct is that phrasing this on is a bit of a red herring, since if one can solve the problem for the unit sphere in a -dimensional real inner product space one gets it for the unit sphere in all higher dimensions.
That said, at present I don’t see a “nice” way to exploit the reduction to this special case – my analyst’s training is to then WLOG place my vectors , and with and in the plane, and have somewhere on the “upper hemisphere”, and then start hacking. So certainly the approach via Gram matrices, which I’ve not seen before, is more appealing!