Maria Nicolae's Website

RSS Feed (What is RSS?)


Back to Blog.

An Introduction to Differential Geometry

What is a metric tensor, anyway?

Maria Nicolae,

I plan to publish a few posts soon that substantially involve differential geometry (including one that I've almost finished writing), so I figured I might as well make a separate post purely dedicated to this subject.

At its core, differential geometry is the study of manifolds, which are defined as n-dimensional metric spaces that locally resemble flat (Euclidean) space. Let's break this down:

In this post, I'll start by describing Euclidean space, in the usual Cartesian coordinates, in what we will see is the language of differential geometry. Then, by considering what happens when one performs a coordinate transformation, I'll show how the idea of a metric tensor emerges, and that this turns out to be applicable to curved manifolds too, because of their locally Euclidean nature. After a tour of various concepts in differential geometry (topology, constant-curvature manifolds, and geodesics), I'll finish by giving an overview of how differential geometry applies to the curved spacetimes of Einsteinian relativity.

Euclidean Space in Cartesian Coordinates

To figure out how locally-Euclidean spaces work, let's start with plain Euclidean space. In the two-dimensional Euclidean plane with Cartesian coordinates (x,y), the distance along a straight line path between points (x,y) and (x+Δx,y+Δy) is found using Pythagoras' theorem

s2=Δx2+Δy2.
(1)

What about a curved path (x(t),y(t))? We can find the length of such a path by integrating what is essentially a bunch of little Pythagoras' theorems:

st=ab=abdsdtdt
(2)

where

(dsdt)2=(dxdt)2+(dydt)2.
(3)

More simply, we can write this in differential form with the line element ds:

s=dsds2=dx2+dy2.
(4)

For a general n-dimensional Euclidean space, we can express this as a summation

ds2=i=1ndxi2.
(5)

Coordinate Transformations and the Metric Tensor

Now, let's find out what happens to the line element when we perform a coordinate transformation. I'll first derive this in the abstract, for a transformation from Cartesian coordinates (y1,,yn) to some other general coordinates (x1,,xn), and then give a worked example of the specific case of transforming from Cartesian coordinates (x,y) to polar coordinates (r,θ) in the Euclidean plane.

Using the multivariate chain rule

dyi=j=1nyixjdxj,
(6)

the line element in Cartesian coordinates from Equation 5 becomes

ds2=i=1nj=1nk=1nykxiykxjdxidxj.
(7)

This has the form

ds2=i=1nj=1ngijdxidxj,
(8)

where the metric tensor is

gij=k=1nykxiykxj.
(9)

The metric tensor can be represented in matrix form as

g=JTJ,
(10)

where J is the Jacobian matrix of the coordinate transformation, whose elements are

Jij=yixj.
(11)

We can see from this that the metric, as a matrix, is symmetric and positive-definite, and that it is a function of the coordinates. In terms of this matrix form, the line element is

ds2=dx·gdx.
(12)

For Cartesian coordinates, the Jacobian, and therefore the metric, is the identity matrix

gCartesian=I.
(13)

Now, let's work through the example of transforming from Cartesian coordinates to polar coordinates. The coordinate transformation for this is

x=rcosθy=rsinθ,
(14)

and therefore

dx=cos(θ)drrsin(θ)dθdy=sin(θ)dr+rcos(θ)dθ.
(15)

Substituting these into Equation 4, we get

ds2=dx2+dy2=(cos(θ)drrsin(θ)dθ)2+(sin(θ)dr+rcos(θ)dθ)2=cos2(θ)dr2+r2sin2(θ)dθ2rsin(θ)cos(θ)drdθ+sin2(θ)dr+r2cos2(θ)dθ+rsin(θ)cos(θ)drdθds2=dr2+r2dθ2,
(16)

and so the metric tensor of the Euclidean plane in polar coordinates is

g=[100r2].
(17)

Curved Spaces

Equation 8, which I derived earlier for arbitrary coordinates in Euclidean space, turns out to be fully general, applicable also to curved manifolds. After all, what defines manifolds is that they are locally Euclidean, so for any given point inside the manifold, you can choose normal coordinates (y1,,yn) for which the metric at that point is the identity matrix. Then, a coordinate transformation back to whatever coordinates you started with (x1,,xn) creates a general metric gij. For example, the line element for the surface of a sphere with radius R, in terms of latitude θ and longitude ϕ, is

ds2=R2dθ2+R2cos2(θ)dϕ2.
(18)

An example of normal coordinates (x,y) centred on a point (θ0,ϕ0) on the sphere is

θ=θ0+yRϕ=ϕ0+xRcosθ0.
(19)

Here, x represents movement to the east and y represents movement to the north. The line element is then

ds2=cosθcosθ0dx2+dy2,
(20)

for which g=I at θ=θ0, though it differs at other locations. Essentially, this is like drawing a flat map of the sphere which is accurate in a small region near (θ0,ϕ0), but which gets more distorted as you get further away from that point.

Geometry vs Topology

Given what I've gone over up until now, you might have the impression that the metric tensor completely defines a given manifold. That's almost true, but not quite. The metric tensor completely defines the geometry of a manifold, i.e. how it curves at any given point, but a manifold also has a topology, which is, loosely speaking, a notion of which points are neighbours. To see what I mean, let's consider the surface of an infinitely long cylinder. If we define a coordinate system where the distance around the cylinder is x, and the distance along the cylinder's length is y, the metric is

ds2=dx2+dy2.
(21)

This is the same metric as that of the Euclidean plane! Thus, we say that the surface of a cylinder has Euclidean geometry. The difference between the cylinder and the Euclidean plane is that, on the cylinder, the x coordinate repeats every 2πR, where R is the radius of the cylinder, whereas on the Euclidean plane it never repeats. x=0 and x=(2π0.001)R are very close together on the cylinder, but not on the Euclidean plane. This is the difference in topology between the two manifolds, how the points are connected to each other.

If you've ever played one of the Portal video games, what you were doing, as you were shooting the portal gun, is changing the topology of the game environment, while its geometry stayed Euclidean. Separately, there's a tendency in the gaming world to use the term "non-Euclidean"1 to describe manifolds with Euclidean geometry but weird topologies, but this is erroneous.

Constant-Curvature Manifolds

A particularly important set of manifolds is those that have uniform curvature throughout, and which have the same topology as typical Euclidean space (extending infinitely without repeating). These are characterised by one parameter, the value of that uniform curvature, and therefore fall into three types:

Letting the uniform curvature be ρ, all three are represented in the two-dimensional case in "azimuthal equidistant coordinates" (r,θ) as

ds2=dr2+1ρsin2(rρ)dθ2.
(22)

For ρ>0, this is the metric for a sphere of radius 1/ρ, where r is the distance from the north pole and θ is the longitude. In the limit of ρ0, this becomes the metric for the Euclidean plane in polar coordinates

ds2=dr2+r2dθ2.
(23)

Finally, for ρ<0, we're taking the sine of an imaginary number, so this becomes

ds2=dr2+1|ρ|sinh2(r|ρ|)dθ2.
(24)

From this, we see that the relationship between a circle's radius and its circumference is linear (C=2πr) in Eulidean geometry, sinusoidal (C<2πr) in spherical geometry, and exponential (C>2πr) in hyperbolic geometry. In a sense, hyperbolic geometry has "more space" than your Euclidean intuition might expect, while the surface of a sphere has less space, ultimately being finite.

Intermission: Notation and The Einstein Summation Convention

Many of the equations I've shown you so far have summations, particularly multiple nested summations. Differential geometry tends to involve a lot of summations; indeed, there are many more to come. For the sake of conciseness, then, it is common to use the Einstein summation convention, in which Equation 8 is written more concisely as

ds2=gijdxidxj.
(25)

Two changes are apparent here: first, some of the indices are superscripts (not to be confused with exponents) rather than subscripts, and second, the summation symbols have been removed.

In the Einstein summation convention, any indices which occur in pairs of upper and lower on one side of an equation but not the other (dummy indices) are summed over. Whether an index is upper or lower indicates, respectively, whether it is contravariant or covariant. A contravariant quantity is one which scales inversely to the metric; if the metric gets bigger, the coordinate differentials dxi must get smaller to represent the same size of step. A covariant quantity is one which scales proportionally to the metric; the metric itself is, of course, such a quantity. Some quantities have mixed upper and lower indices, meaning that their transformation rules are more complicated. Finally, taking a reciprocal inverts the covariance/contravariance of a quantity, meaning that an upper index in a denominator is treated as a lower index, and vice versa.

Lowering and Raising Indices

The line element can alternatively be expressed as

ds2=dxidxi,
(26)

where the index on dxi has been lowered by doing

dxi=gijdxj.
(27)

In general, we can use the metric to lower an index, and it has the interpretation of creating a "dual vector" which multiplies with vectors to compute "square lengths". Formally, dxi is the adjoint of dxi with respect to the inner product generated by the metric.

Reversing Equation 27, we also see that we can raise an index by doing

dxi=gijdxj,
(28)

where

gij=(g1)ij
(29)

are the components of the matrix inverse of g.

The Geodesic Equation

We know that we can use the metric to compute the length of a path as

s=titfgijdxidtdxjdtdt;
(30)

that's the exact context in which I first presented the notion of the metric, after all. Similarly, we can compute areas by integrating lengths and compute volumes by integrating areas. Another thing we might want to do in a manifold, however, is to find the shortest path between two points. Such paths are known as geodesics. Here, I'll derive the geodesic equation, a differential equation whose solutions are geodesics.

Finding shortest paths is, of course, an optimisation problem. The typical approach to optimisation problems is to find critical points. For a single-variable problem, this is a point at which the derivative is zero, and for multivariate problems, this is a point at which all directional derivatives are zero. In our case, we similarly look for a function for which all of its "directional derivatives" are zero, but here the directions are themselves functions. Namely, for a path xi(t) to be optimal, a directional perturbation of that path

xpi(t)=xi(t)+ϵηi(t)
(31)

must have a vanishing effect on its length:

ddϵs[xpi,x˙pi]|ϵ=0=0
(32)

where s[xpi,x˙pi] is the length of the perturbed path and x˙pi=dxpi/dt is its derivative. Note also that this perturbed path must have the same endpoints as the original path, and so

ηi(ti)=0=ηi(tf).
(33)

Denoting

[xi,x˙i]=gjkx˙jx˙k
(34)

so that

s[xi,x˙i]=titf[xi,x˙i]dt,
(35)

the expression for the geodesic path becomes

ddϵtitf[xpi,x˙pi]dt|ϵ=0=0titfddϵ[xpi,x˙pi]dt|ϵ=0=0titf(dxpidϵxpi+dx˙pidϵx˙pi)dt|ϵ=0=0ititf(ηixpi+η˙ix˙pi)dt|ϵ=0=0ititf(ηixi+η˙ix˙i)dt=0ititfηixidt+titfη˙ix˙idt=0i.
(36)

Applying integration by parts to the right term, we obtain

titfηixidt+[ηix˙i]titftitfηiddt(x˙i)dt=0i;
(37)

because of the boundary conditions in Equation 33, the middle term vanishes, leaving

titfηi(xiddtx˙i)dt=0i.
(38)

Using the fact that this equation must be true for any ηi, we can extract the expression in the brackets to finally obtain a differential equation for xi:

xiddtx˙i=0.
(39)

For a general , this is known as the Euler-Lagrange equation, and itself is known as the Lagrangian; the geodesic equation is just one of many functional optimisation problems of this form.

Setting

T=gjkx˙jx˙k
(40)

such that =T, Equation 39 becomes

TxiddtTx˙i=012TTxiddt(12TTx˙i)=0.
(41)

Because T is a function of ds/dt, we can choose a parameter t of the path that keeps T constant. This is called an affine parameter, and it means that the length varies linearly with t. Using such a parameter, we can factor out 1/2T to obtain the effective Euler-Lagrange equation

TxiddtTx˙i=0.
(42)

Now let's evaluate this. First,

Txi=gjkxix˙jx˙k.
(43)

Next,

Tx˙i=gjix˙j+gikx˙k.
(44)

Differentiating this,

ddtTx˙i=dgjidtx˙j+gjix¨j+dgikdtx˙k+gikx¨k=(gjixk+gikxj)x˙jx˙k+2gijx¨j.
(45)

Substituting Equations 43 and 45 into Equation 42,

gjkxix˙jx˙k(gjixk+gikxj)x˙jx˙k2gijx¨j=0gijx¨j+12(gjixk+gikxjgjkxi)x˙jx˙k=0.
(46)

Multiplying this by the matrix inverse of g to extract the second derivatives x¨i, we finally obtain the geodesic equation

d2xidt2+Γjkidxjdtdxkdt=0,
(47)

where the Christoffel symbols of the metric are

Γjki=12gi(gjxk+gkxjgjkx).
(48)

Spacetime as a Manifold

One of the main applications of differential geometry in modern times is in describing the geometry of spacetime in Einsteinian relativity. Spacetime is a manifold, but not quite like what we've seen so far. Recall that a manifold is a metric space that locally resembles flat (Euclidean) space; curved spacetime does locally resemble flat spacetime, but flat spacetime is not Euclidean. So to understand curved spacetime, let's first understand flat spacetime.

Flat Spacetime

Three-dimensional Euclidean space has Cartesian coordinates

x1=xx2=yx3=z,
(49)

for which the line element is the Pythagorean sum

ds2=dx2+dy2+dz2.
(50)

Four-dimensional flat spacetime, on the other hand, has Minkowski coordinates

x0=ctx1=xx2=yx3=z,
(51)

where we've added time2 as a "zeroth" coordinate. The line element of spacetime, however, is not simply the Pythagorean sum of the coordinate differentials, as it would be if spacetime were Euclidean. Rather, we need to consider three cases. First, paths for which c2dt2<dx2+dy2+dz2, which are called spacelike paths because they include purely spatial paths dt=0, have a distance line element

ds2=c2dt2+dx2+dy2+dz2.
(52)

Second, paths for which c2dt2>dx2+dy2+dz2, which are called timelike paths because they include purely temporal paths dx=dy=dz=0, have a line element for proper time

dτ2=1c2ds2=dt21c2(dx2+dy2+dz2).
(53)

These are slower-than-light paths that a massive object can traverse, and the proper time τ is the time measured by that object, which accounts for time dilation. Finally, paths for which c2dt2=dx2+dy2+dz2 are called lightlike paths, because they are the paths that light can take. For a lightlike path, ds2=0=dτ2; a light ray experiences no time and no distance.

Thus, the metric for flat spacetime is not the identity matrix, as it is for Euclidean space, but instead it is the Minkowski metric

ηαβ={1α=0=β1α=β00αβ,
(54)

in terms of which

ds2=ηαβdxαdxβ,
(55)

where we are now using Greek letters for indices; it is a convention in Einsteinian relativity that Latin-alphabet indices span the spacelike coordinates {1,2,3}, while Greek-alphabet indices span all coordinates {0,1,2,3}. Just as this metric is called the Minkowski metric, this geometry of flat spacetime is called Minkowski geometry, in contrast with Euclidean geometry.

Curved Spacetime

Just as the manifolds of space that we've seen so far (so-called Riemannian manifolds) are locally Euclidean, manifolds of spacetime are locally Minkowski (Lorentzian manifolds, a special case of pseudo-Riemannian manifolds). Thus, their line elements look like

ds2=gαβdxαdxβ,
(56)

where the metric has the form

g=JTηJgαβ=ημνJαμJβν
(57)

for some matrix J. As before, this has the interpretation of J being the Jacobian matrix of the transformation from normal coordinates yα to our coordinate system of choice xα:

Jβα=yαxβ.
(58)

This means that, while gαβ is symmetric, it is not positive-definite.

The motion of a massive (slower-than-light) body through spacetime, as a path xα(τ) parameterised by the proper time τ, is governed by the geodesic equation

d2xαdτ2+Γβγαdxβdτdxγdτ=aα,
(59)

where aα is the four-dimensional acceleration applied to the body, whose magnitude

||a||2=gαβaαaβ
(60)

is the magnitude of the acceleration that the body experiences. The Christoffel symbols have the same form as before:

Γβγα=12gαδ(gβδxγ+gδγxβgβγxδ).
(61)

This variant of the geodesic equation not only lets us find spacetime geodesics, which are the freefall (aα=0) paths of massive bodies, but also tells us how massive bodies move under acceleration, and lets us determine the acceleration needed to follow some given path. Because the path parameter here is simply the proper time, the four-dimensional velocity dxα/dτ has a fixed magnitude:

(dsdτ)2=c2=gαβdxαdτdxβdτ.
(62)

An interpretation of this is that bodies are always moving at the speed of light through spacetime; a body that's "standing still" is moving purely through time at this speed, whereas a body that's moving through space is moving at the speed of light in a direction that has both a spatial and temporal component. Changing your velocity, then, is like "rotating" your four-dimensional velocity vector.

It's worth noting that these spacetime geodesics are the paths of maximum proper time, in contrast to geodesics of Riemannian manifolds, which minimise distance. Indeed, the proper time of a spacetime path is not bounded from below, since lightlike paths have zero proper time, so the only extremal paths are maximisers.

The motion of light rays through spacetime is also determined by the geodesic equation

d2xαdλ2+Γβγαdxβdλdxγdλ=0.
(63)

Because lightlike paths have no proper time, we use a different parameter λ for them, which is an affine parameter in the most abstract sense of being a parameter for which the geodesic equation is true.