What is differential geometry?

Joshua R. Davis, jdavis@carleton.edu, revised 2020 September 7

The goal of this tutorial is to give you a conceptual overview of what differential geometry is all about. It builds from the dot product to inner products to smoothly varying inner products. Don’t worry about mastering any of these concepts right now. We’ll learn everything rigorously later.

The dot product is Euclidean geometry

Here are two vectors v and w in (R^2) (two-dimensional real space). Run this code by clicking anywhere on the code cell and then pressing Shift-Return or Enter. A picture should appear. You are not expected to understand the code, but you might want to read the code and try to guess at what each part does anyway.

v = {3, 4};
w = {-1, 1};
Graphics[
{Arrow[{{0, 0}, v}], Arrow[{{0, 0}, w}]}, 
PlotRange->{{-2, 4}, {-1, 5}}, Axes->True, AspectRatio->1]

Here are some dot products.

v.v
v.w
w.w

Here are the lengths of the two vectors. Do the answers make sense?

vLength = Sqrt[v.v]
wLength = Sqrt[w.w]

Here is the angle between the two vectors. Because the exact answer is hard to understand, I also give you a numerical approximation. Remember that a right angle is pi / 2 radians or about 1.57 radians.

angle = ArcCos[(v / vLength).( w / wLength)]
N[angle]

What have we learned? Vector length can be computed as the square root of a dot product. The dot product of two unit vectors equals the cosine of the angle between them. So lengths and angles --- and in fact all of Euclidean geometry --- can be defined in terms of the dot product.

Distorting the dot product distorts Euclidean geometry

Here’s the dot product again, but computed in a slightly different way: We insert the 2x2 identity matrix I between the two vectors being dotted. In linear algebra notation, instead of computing v.v as (v^T)v, we’re computing it as (v^T)I v.

i = {{1, 0}, {0, 1}};
MatrixForm[i]
v.i.v
v.i.w
w.i.w

We get the same answers as we did earlier, because the matrix I has no effect. So why are we doing this? Because we don’t have to insert the identity matrix. We could insert some other matrix S. Here’s an example.

s = {{11 / 10, 0}, {0, 9 / 10}};
MatrixForm[s]
v.s.v
v.s.w
w.s.w

The effect of S is to “distort” or “skew” the dot products away from their usual values. And the lengths and angles arising from this distorted dot product are therefore distorted from their usual Euclidean values.

vLength = Sqrt[v.s.v]
wLength = Sqrt[w.s.w]
angle = ArcCos[(v / vLength).s.( w / wLength)]
N[angle]

Here’s a random example of a vector u that is a unit vector in the distorted geometry but not in the usual geometry.

u = RandomVariate[NormalDistribution[], 2];
u = u / Sqrt[u.s.u]
Sqrt[u.s.u]
Sqrt[u.u]

The unit circle is the set of unit vectors, right? Here’s the Euclidean unit circle in blue and the distorted-geometry unit circle in orange. (Your colors may vary.)

ContourPlot[
{{u1, u2}.{u1, u2} == 1, {u1, u2}.s.{u1, u2} == 1}, 
{u1, -3, 3}, {u2, -3, 3}]

It’s not just lengths that are distorted. Angles are distorted too. Here we randomly generate two vectors, in such a way that they are perpendicular under the distorted dot product. Probably they are not perpendicular in the usual sense.

u = RandomVariate[NormalDistribution[], 2];
u = u / Sqrt[u.s.u]
x = RandomVariate[NormalDistribution[], 2];
x = x - (u.s.x) u;
x = x / Sqrt[x.s.x]
u.s.x
u.x
Graphics[
{Arrow[{{0, 0}, u}], Arrow[{{0, 0}, x}]}, 
PlotRange->{{-1, 1}, {-1, 1}}, Axes->True, AspectRatio->1]

Let’s see some more distorted dot products

As long as S is symmetric (meaning that it equals its transpose) and positive-definite (meaning that its eigenvalues are all positive), then the distorted dot product defined by S is called an inner product. Every inner product (other than the dot product, where S = I) gives a distorted version of Euclidean geometry. Here’s a more interesting example.

s = {{3, -1}, {-1, 2}};
MatrixForm[s]
N[Eigenvalues[s]]
ContourPlot[
{{u1, u2}.{u1, u2} == 1, {u1, u2}.s.{u1, u2} == 1}, 
{u1, -3, 3}, {u2, -3, 3}]

Here is a whole family of examples. They are controlled by three numbers: an angle theta and the logarithms of the two eigenvalues of S. Manipulate the sliders to see how these parameters affect the example. Three things are shown: the unit circle, a pair of randomly chosen unit vectors that are perpendicular, and the matrix S.

u = RandomVariate[NormalDistribution[], 2];
x = RandomVariate[NormalDistribution[], 2];
Manipulate[Module[{r, s, z, y}, 
r = {{Cos[theta], -Sin[theta]}, {Sin[theta], Cos[theta]}};
s = r.{{Exp[logEig1], 0}, {0, Exp[logEig2]}}.Transpose[r];
z = u / Sqrt[u.s.u];
y = x - (z.s.x) z;
y = y / Sqrt[y.s.y];
{Show[
ContourPlot[
{{u1, u2}.{u1, u2} == 1, {u1, u2}.s.{u1, u2} == 1}, 
{u1, -3, 3}, {u2, -3, 3}, PerformanceGoal->"Quality"], 
Graphics[{Arrow[{{0, 0}, z}], Arrow[{{0, 0}, y}]}]], 
DecimalForm[MatrixForm[s], {6, 5}, NumberSigns->{"-", " "}]}], {logEig1, -2, 2}, {logEig2, -2, 2}, 
{theta, 0, Pi}]

Question: Why do we require S to be positive-definite? What happens if S is symmetric but has a negative or zero eigenvalue?

Question: Why do we require S to be symmetric? What happens if we don’t?

Let the inner product vary over space

When you first learn about vectors, one of their key attributes is that you can translate them around without changing them. It doesn’t matter where the tail is; what matters is the difference between the tail and the head. For example, the two vectors in the following image are both equal to v.

Graphics[
{Arrow[{{0, 0}, v}], Arrow[{{-2, 1}, {-2, 1} + v}]}, 
PlotRange->{{-2, 4}, {-1, 5}}, Axes->True, AspectRatio->1]

In differential geometry, we throw this idea away. Instead, we care very much about where a vector is based, because the vectors based at one point might be subject to a different inner product than the vectors based at another point. For example, suppose that at the point (0, 0) we have the usual inner product given by the matrix I, but at the point (-2, 1) we have the inner product given by the following matrix S. Then the lengths of the two vectors above are as follows.

s = {{3, -1}, {-1, 2}};
MatrixForm[s]
Sqrt[v.v]
Sqrt[v.s.v]

This is the key idea of differential geometry: On your space, don’t use a single inner product on all vectors, no matter where they are based. Instead, use a family of inner products --- potentially a different inner product at every point of your space. This family of inner products is called a Riemannian metric or simply metric.

Example: Poincaré disk

Here is a famous example called the Poincaré disk. The metric is given by the following matrix S, which varies as x and y vary.

Clear[x, y];
s = (4 / (1 - {x, y}.{x, y})^2) * {{1, 0}, {0, 1}};
MatrixForm[s]

Notice that S is undefined at the standard unit circle, where (x^2) + (y^2) = 1. We restrict our attention to the open disk where (x^2) + (y^2) < 1. Notice that S = 4 I at (0, 0). As we move away from (0, 0) in any direction, S remains a scalar multiple of I, but the scalar gets larger and larger. Consequently, if we examine circles of radius 0.2 at various points, those circles appear smaller and smaller to our Euclidean eyes (although they all have radius 0.2 in this non-Euclidean geometry).

radius = 0.2;
xys = Flatten[Table[{x, y}, {x, -0.9, 0.9, 0.1}, {y, -0.9, 0.9, 0.1}], 1];
xys = Select[xys, Function[xy, xy.xy < 1]];
Graphics[
Join[{Circle[]}, Map[Function[xy, Circle[xy, radius / (4 / (1 - xy.xy)^2)]],xys]], 
PlotRange->{{-1, 1}, {-1, 1}}, Axes->True, AspectRatio->1]

Letting the inner product vary over space affects more than just the apparent sizes of circles. It potentially affects all of geometry. For example, the shortest path between two points is a line, right? Well, here are the shortest paths among a few pairs of points near the edge of the Poincaré disk.

Graphics[
{Circle[], Line[{{0.6, 0.8}, {-0.6, -0.8}}], Circle[{Sqrt[2], 0}, 1, {Pi 3 / 4, Pi 5 / 4}], Circle[{3.022,-6.019},6.660, {1.888, 2.185}], 
Circle[{-0.832,0.563},0.100, {-2.082, 0.803}], 
Circle[{1.230,-1.091},1.305, {1.769, 3.070}]}, 
PlotRange->{{-1, 1}, {-1, 1}}, Axes->True, AspectRatio->1]

These shortest-paths-between-points are what we call geodesic curves, roughly speaking. (The actual definition, which we’ll see later, is more subtle than that.) Geodesic curves are an essential tool in understanding weird spaces.

Example: Sphere

Here’s another basic example. Notice how similar this S is to the Poincaré disk’s S.

Clear[x, y];
s = (4 / (1 + {x, y}.{x, y})^2) * {{1, 0}, {0, 1}};
MatrixForm[s]

This S is defined over the whole x-y-plane. As in the Poincaré disk example, S = 4 I at (0, 0), and as we move away from (0, 0) in any direction S remains a scalar multiple of I. The difference is that this S gets smaller as we move away from (0, 0). Consequently, if we examine circles of radius 0.2 at various points, those circles appear larger and larger to our Euclidean eyes (although they all have radius 0.2 in this non-Euclidean geometry).

radius = 0.2;
xys = Flatten[Table[{x, y}, {x, -0.9, 0.9, 0.45}, {y, -0.9, 0.9, 0.45}], 1];
Graphics[
Map[Function[xy, Circle[xy, radius / (4 / (1 + xy.xy)^2)]],xys], 
PlotRange->{{-1, 1}, {-1, 1}}, Axes->True, AspectRatio->1]

Here are some random geodesic curves.

proj = Function[xyz, {xyz[[1]], xyz[[2]]} / (1 - xyz[[3]])];
curve = Function[n, 
Module[{w, r, t1, t2, points}, 
w = Table[RandomVariate[UniformDistribution[{-Pi, Pi}], 3], {3}];
w = (w - Transpose[w]) / 2;
r = MatrixExp[w];
t1 = RandomVariate[UniformDistribution[{0, 2 Pi}]];
t2 = t1 + RandomVariate[UniformDistribution[{Pi / 12, Pi}]];
points = Table[proj[r.{Cos[t], Sin[t], 0}], {t, t1, t2, (t2 - t1) / n}];
points]];
Graphics[
{Line[curve[128]], Line[curve[128]], Line[curve[128]], Line[curve[128]]}, 
PlotRange->{{-10, 10}, {-10, 10}}, Axes->True, AspectRatio->1]

There’s no reason why you should be able to figure this out, but: It turns out that this space is a sphere. More precisely, this space is geometrically identical to the unit sphere in Euclidean (R^3) with a single point removed.

Conclusion

Inner products give a convenient way to talk about distorting geometry. If we let an inner product vary over a space, then that space can end up “curved” in ways that Euclidean geometry is not. To keep the curviness manageable, we require our inner product to vary smoothly over the space. Then we can use calculus in analyzing it. (The S examples above are smooth, although we haven’t discussed that fact, because I’ve been hiding the calculus.) In summary, differential geometry is the study of curved spaces using calculus and linear algebra.

Differential geometry is a beautiful subject of “pure” mathematics, that relates to other beautiful subjects such as topology, complex analysis, and differential equations. Differential geometry also finds application in diverse scientific fields such as DNA folding, robotics, and astrophysics.