Introduction to Differential Geometry
The last two articles were about topology and calculus. Bundles twist, forms integrate, and Stokes' theorem ties them together. But none of it could measure anything. The integral \( \oint d\theta = 2\pi \) counts how many times you went around the hole, and it has no idea how far you walked. You can't get a length or an angle out of those two pages, and you can't ask whether a surface is flat or curved.
This page adds the piece of equipment that does all of that, the metric, and then builds the tools that come with it: tensors, connections, covariant derivatives and curvature. At the end we point those tools at the Schwarzschild metric (the simplest black hole in General Relativity), work out how it bends light, and render what the stars look like from nearby. Every figure runs the calculation from the text next to it. The black hole at the bottom is drawn by integrating an equation you'll derive a few sections earlier, which I think is pretty rad.
Back in the bundles article, Gauss figured out that geometry can be done from the inside: a surveyor stuck on a surface can find its curvature with a tape measure and never leave. The metric is the tape measure.
The metric
A metric \( g \) on a manifold \( M \) gives each point \( p \) an inner product on the tangent space: a map \( g_p : T_pM \times T_pM \to \mathbb{R} \) that is bilinear, symmetric, and positive definite (\( g_p(v,v) > 0 \) for \( v \neq 0 \)). Compare this to the 2-form from last time. A 2-form also eats two vectors and is also bilinear, but it's antisymmetric: \( \omega(v,w) = -\omega(w,v) \), and it measures signed area. A metric is symmetric, \( g(v,w) = g(w,v) \), and it measures length and angle. One sign flip separates "how big is this parallelogram?" from "how long is this arrow?"
Length and angle come straight from the inner product, the same way they do in linear algebra: \[ |v| = \sqrt{g(v,v)}, \qquad \cos\alpha = \frac{g(v,w)}{|v|\,|w|} \] And the length of a curve \( \gamma : [a,b] \to M \) is the integral of the speed: \[ L(\gamma) = \int_a^b \sqrt{g\big(\gamma'(t), \gamma'(t)\big)}\, dt \]
In coordinates \( x^1, \dots, x^n \), a metric is written \[ g = g_{ij}\, dx^i\, dx^j \] with the summation convention: any index that appears once up and once down is summed over, so this is short for \( \sum_{i,j} g_{ij}\, dx^i dx^j \). The \( g_{ij} \) form a symmetric matrix of functions, and \( dx^i dx^j \) is the symmetric product of the 1-forms \( dx^i \) and \( dx^j \). This is different from the wedge: \( dx \wedge dx = 0 \), but \( dx\, dx = dx^2 \) squares the \( x \)-component of a vector. Physicists write the metric as a "line element" \( ds^2 \), same thing, different accent. A few examples:
- The flat plane: \( ds^2 = dx^2 + dy^2 \), the matrix is the identity, and \( g(v,w) = v_x w_x + v_y w_y \) is the dot product. Pythagoras.
- The flat plane again, in polar coordinates. Take \( x = r\cos\theta \), \( y = r\sin\theta \) and apply \( d \) from the forms article: \( dx = \cos\theta\, dr - r\sin\theta\, d\theta \), \( dy = \sin\theta\, dr + r\cos\theta\, d\theta \). Square each one (symmetric product, so the cross term counts twice): \[ \begin{aligned} dx^2 &= \cos^2\theta\, dr^2 - 2r\sin\theta\cos\theta\, dr\, d\theta + r^2\sin^2\theta\, d\theta^2 \\ dy^2 &= \sin^2\theta\, dr^2 + 2r\sin\theta\cos\theta\, dr\, d\theta + r^2\cos^2\theta\, d\theta^2 \end{aligned} \] Add them. The \( dr\, d\theta \) terms have opposite signs and cancel, and \( \cos^2\theta + \sin^2\theta = 1 \) collects the rest: \[ ds^2 = dx^2 + dy^2 = (\cos^2\theta + \sin^2\theta)\, dr^2 + r^2(\sin^2\theta + \cos^2\theta)\, d\theta^2 = dr^2 + r^2\, d\theta^2 \] Same geometry, different coefficients. The \( r^2 \) says a step in \( \theta \) covers more ground when you're far from the origin.
- The sphere of radius \( R \), in polar angle \( \theta \) and azimuth \( \phi \): \[ ds^2 = R^2\, d\theta^2 + R^2 \sin^2\theta\, d\phi^2 \] A step in longitude is cheap near the poles and expensive at the equator.
- The hyperbolic half-plane, the upper half of the plane with \[ ds^2 = \frac{dx^2 + dy^2}{y^2} \] Steps near the \( x \)-axis are enormously long, so long that the axis itself is infinitely far away.
Playing with metrics
The figure below draws a coordinate chart. A chart is a picture of the coordinates, and like any map it lies a little. The metric tells you how much. At each grid point, the small ellipse is the set of tangent vectors that all have the same length according to \( g \). In the flat metric they're circles. In polar coordinates they get squashed horizontally as \( r \) grows, because a step in \( \theta \) is worth more out there. In the hyperbolic half-plane they grow with \( y \), because everything near the axis is far apart.
Two paths join \( A \) to \( B \): the straight segment in the chart, and a circular arc. Drag the slider to walk them and watch the length add up. The readout also uses \( g \) to compute the angle between the path's velocity and the coordinate vector \( \partial_x \), and prints it next to the angle you see on screen. In the flat case they agree. In the other two they don't, and you should believe the metric, not your eyes.
Wait, the arc is shorter than the straight line? Yes! In the half-plane, the shortest paths are semicircles centered on the \( x \)-axis, so "straight in the chart" isn't straight in the geometry. Okay, so what does "straight" even mean once the metric isn't the identity? That's the real question of this page, and the answer is the connection, two sections from now.
Tensors
So far we've met three kinds of machine that eat tangent vectors and spit out numbers. A 1-form takes one vector. A 2-form takes two and is antisymmetric. A metric takes two and is symmetric. A tensor is the general version. A tensor of type \( (p, q) \) at a point is a multilinear map that takes \( q \) tangent vectors and \( p \) covectors (elements of the dual space \( T_p^*M \), the same space the 1-forms live in) and returns a number. A vector is a \( (1,0) \) tensor, a 1-form is \( (0,1) \), the metric is \( (0,2) \), a \( k \)-form is an antisymmetric \( (0,k) \) tensor. In coordinates a tensor is an array of numbers with \( p \) upper indices and \( q \) lower ones, \( T^{i_1 \cdots i_p}{}_{j_1 \cdots j_q} \), and you get the array by feeding the machine the coordinate basis vectors \( \partial_i \) and covectors \( dx^j \): \[ g_{ij} = g(\partial_i, \partial_j) \] That's the sense in which \( g_{ij} \) "is" the metric.
Why all the indices? Because of the transformation rule. Change coordinates from \( x \) to \( \tilde{x} \), and every upper index picks up a factor of the Jacobian \( \partial \tilde{x}^i / \partial x^k \), while every lower index picks up the inverse Jacobian. For the metric: \[ \tilde{g}_{ij} = \frac{\partial x^k}{\partial \tilde{x}^i} \frac{\partial x^l}{\partial \tilde{x}^j}\, g_{kl} \] The polar coordinate calculation above was this rule with \( g_{kl} = \delta_{kl} \). An array of numbers with indices that transforms this way is a tensor. An array that doesn't transform this way isn't a tensor, no matter how many indices you stick on it (the next section has the famous example).
The metric has one more job. Since \( g_p \) is nondegenerate, it identifies \( T_pM \) with its dual: a vector \( v \) becomes the 1-form \( g(v, \cdot) \). In indices this is lowering, \( v_i = g_{ij} v^j \), and the inverse matrix \( g^{ij} \) does raising, \( \omega^i = g^{ij} \omega_j \). This is the missing entry in the dictionary from the forms article. Back there, on \( \mathbb{R}^3 \), I quietly turned the 1-form \( df \) into the vector \( \nabla f \) without saying how. The metric did it, and when the metric is the identity matrix you can't see it working. On a curved space the gradient is \[ (\nabla f)^i = g^{ij}\, \partial_j f \] and the \( g^{ij} \) doesn't go away.
Connections and moving frames
A vector field \( W \) assigns a vector \( W_p \in T_pM \) to every point, and we'd like to differentiate it in the direction \( v \). The obvious formula \[ \frac{W_{p + \varepsilon v} - W_p}{\varepsilon} \] doesn't make sense. \( W_{p+\varepsilon v} \) lives in the tangent space at \( p + \varepsilon v \), and \( W_p \) lives in the tangent space at \( p \). Those are different fibers of the tangent bundle, and a bundle doesn't come with any rule for subtracting a vector in one fiber from a vector in another. Every fiber is a copy of the same space (that's what a bundle is), but having two copies doesn't tell you which point of one matches which point of the other. The fibers over \( p \) and \( q \) are both isomorphic to \( \mathbb{R}^n \), there are lots of isomorphisms between them, and the bundle doesn't pick a favorite. On \( \mathbb{R}^n \) you never noticed this, because there is a favorite: translation. Slide a vector from \( p \) to \( q \) and everyone agrees on the result. On a sphere there's no such thing as translation. A connection is the missing rule, a chosen way of matching up neighboring fibers so that vectors in them can be compared.
I'm going to come at this the way Cartan did, with the method of moving frames. The coordinate vectors \( \partial_i \) have no fixed length, so instead of using them, carry a ruler. An orthonormal frame on a surface is a pair of vector fields \( e_1, e_2 \) with \( g(e_a, e_b) = \delta_{ab} \): at every point, two perpendicular unit vectors. The dual 1-forms \( \theta^1, \theta^2 \), with \( \theta^a(e_b) = \delta^a_b \), are the coframe, and in terms of them the metric is just \[ g = (\theta^1)^2 + (\theta^2)^2 \] so you can read the coframe straight off the line element. Polar plane: \( \theta^1 = dr \), \( \theta^2 = r\, d\theta \). Sphere: \( \theta^1 = R\, d\theta \), \( \theta^2 = R\sin\theta\, d\phi \). Hyperbolic half-plane: \( \theta^1 = dx/y \), \( \theta^2 = dy/y \). The frame is "moving" because it turns as you go from point to point, and a connection keeps track of how it turns.
Here's how it keeps track. As you move in a direction \( v \), each frame vector changes by some combination of frame vectors, and the amount is linear in \( v \), as a derivative should be: \[ \nabla_v e_b = \omega^a{}_b(v)\, e_a \] The \( \omega^a{}_b \) are 1-forms, the connection 1-forms, and that matrix of 1-forms is all there is to the connection. Given it, the covariant derivative of any vector field \( W = W^a e_a \) follows from the product rule: \[ \nabla_v W = \big( dW^a(v) + \omega^a{}_b(v)\, W^b \big)\, e_a \] The first term is the directional derivative of the components, the \( df(v) \) from the forms article doing its job. The second corrects for the frame turning underneath you, like a rug being slowly rotated while you stand on it.
There are infinitely many connections, so which one do we want? Two conditions narrow it down to one. First, metric compatibility: moving vectors along with the connection shouldn't change their lengths or angles. Differentiating \( g(e_a, e_b) = \delta_{ab} \) gives \( \omega^a{}_b = -\omega^b{}_a \), so the matrix is antisymmetric, and on a surface that leaves a single 1-form: \[ \nabla e_1 = \omega \otimes e_2, \qquad \nabla e_2 = -\omega \otimes e_1 \] Moving in direction \( v \) rotates the frame by the angle \( \omega(v) \). Second, no torsion: the connection should agree with \( d \), so the frame's turning matches what the coframe already knows. That's Cartan's first structure equation, \( d\theta^a = -\omega^a{}_b \wedge \theta^b \), which on a surface reads \[ d\theta^1 = \omega \wedge \theta^2, \qquad d\theta^2 = -\omega \wedge \theta^1 \] Two equations, one unknown 1-form, and there's always exactly one solution. It's called the Levi-Civita connection (LEV-ee CHIV-ih-tah), and it's the connection the metric picks for you.
Okay, let's actually compute one. Polar plane first: \( \theta^1 = dr \), \( \theta^2 = r\, d\theta \). Then \( d\theta^1 = 0 = \omega \wedge r\, d\theta \), which forces \( \omega = f\, d\theta \) for some function \( f \). And \[ d\theta^2 = dr \wedge d\theta = -f\, d\theta \wedge dr = f\, dr \wedge d\theta \quad\Longrightarrow\quad f = 1, \qquad \omega = d\theta \] Read it as a sentence: move by an angle \( d\theta \) around the origin, and the frame \( (\partial_r, \partial_\theta / r) \) turns by \( d\theta \). This is the flat plane, and the connection form still isn't zero! It's recording the frame turning, and the space itself isn't curved at all. Now the sphere, with coframe \( \theta^1 = R\, d\theta \), \( \theta^2 = R\sin\theta\, d\phi \). Again \( d\theta^1 = 0 \) forces \( \omega \) to be a multiple of \( d\phi \), and \[ d\theta^2 = R\cos\theta\, d\theta \wedge d\phi = -\omega \wedge R\, d\theta \quad\Longrightarrow\quad \omega = \cos\theta\, d\phi \] Going east by \( d\phi \) at polar angle \( \theta \) turns the frame by \( \cos\theta\, d\phi \): a full turn per lap at the north pole, none at the equator.
The same thing in coordinates: Christoffel symbols
Most textbooks use the coordinate frame \( \partial_i \) instead of an orthonormal one. Then the connection 1-forms are written out in components, \( \omega^k{}_j = \Gamma^k_{ij}\, dx^i \), and the coefficients \( \Gamma^k_{ij} \) are the Christoffel symbols. Metric compatibility and no torsion turn into a formula: \[ \Gamma^k_{ij} = \tfrac{1}{2} g^{kl} \left( \partial_i g_{jl} + \partial_j g_{il} - \partial_l g_{ij} \right) \] and the covariant derivative is \( \nabla_v W = v^i (\partial_i W^k + \Gamma^k_{ij} W^j)\, \partial_k \), the same product rule as above. For the polar plane it gives \( \Gamma^r_{\theta\theta} = -r \) and \( \Gamma^\theta_{r\theta} = \Gamma^\theta_{\theta r} = 1/r \), which is \( \omega = d\theta \) wearing a fake mustache. It works in any dimension, but in \( n \) dimensions there are \( n^2(n+1)/2 \) symbols to compute versus \( n(n-1)/2 \) connection forms: for the Schwarzschild metric at the end of the page, 40 versus 6. I'll take the 6. One warning: \( \Gamma \) is an array with three indices that isn't a tensor. In Cartesian coordinates the flat plane has every \( \Gamma = 0 \), in polar coordinates it doesn't, and a tensor that is zero in one coordinate system is zero in all of them.
Parallel transport and geodesics
With a connection in hand, we can define two new things. A vector \( V \) carried along a curve \( \gamma \) is parallel if its covariant derivative along the curve vanishes, \( \nabla_{\gamma'} V = 0 \). On a surface, write the vector by its angle from the frame, \( V = \cos\alpha\, e_1 + \sin\alpha\, e_2 \), and differentiate: \[ \nabla_{\gamma'} V = \big( \alpha' + \omega(\gamma') \big) \left( -\sin\alpha\, e_1 + \cos\alpha\, e_2 \right) \] So parallel means \[ \alpha' = -\omega(\gamma') \] The frame turns one way, the vector's angle relative to the frame turns the other way at the same rate, and the vector itself stays put. This is a first-order ODE (ordinary differential equation), so given \( V \) at the start you can solve for it all along the curve. That's parallel transport, and it's what "connecting the fibers" means in practice: it carries a vector from one tangent space to another. And a curve that parallel transports its own velocity, \( \nabla_{\gamma'} \gamma' = 0 \), is a geodesic, the metric's notion of a straight line. It's the same equation with \( \alpha \) as the direction of travel: a geodesic only changes heading to cancel out the frame's turning. In the polar plane, \( \omega = d\theta \) says a straight line's heading relative to \( \partial_r \) drops by \( d\theta \) every time the polar angle ticks up by \( d\theta \). Draw a line past the origin and check, that's what it does. In the hyperbolic half-plane the solutions are the semicircles from the playground.
Transport around a loop
This is where curvature shows up. On the flat plane, carry a vector around any closed loop and it comes back pointing the same way. On a sphere it doesn't! The figure transports a vector around a circle of latitude on the unit sphere by integrating \( \alpha' = -\omega(\gamma') \) with the connection form we just found. Along the latitude \( \theta = \theta_0 \), \( \phi = t \), the velocity is \( \partial_\phi \) and \( \omega(\partial_\phi) = \cos\theta_0 \), so the vector's angle relative to the frame drifts at the constant rate \( -\cos\theta_0 \). Slide the latitude up and down, walk the loop, and compare how far the vector rotated with the area of the cap inside the loop.
The transported vector comes back rotated by the area of the cap, \( 2\pi(1 - \cos\theta_0) \). Near the north pole the loop is tiny and so is the rotation. At the equator the loop is a geodesic, the cap is a hemisphere of area \( 2\pi \), and the vector turns all the way around and comes back pointing where it started. This rotation is called the holonomy of the loop, and the fact that it equals an area is another way of saying the sphere has curvature \( K = 1 \) everywhere. The next section shows why.
Curvature is \( d \) of the connection
The connection is a 1-form, and if the forms article taught us anything, it's that when you have a 1-form, you take \( d \) of it. Cartan's second structure equation says that on a surface \[ d\omega = -K\, \theta^1 \wedge \theta^2 \] and the function \( K \) is the Gaussian curvature. Take \( d \) of the two connection forms we computed. Polar plane: \( d\omega = d(d\theta) = 0 \), so \( K = 0 \). Flat, as it should be, even though \( \omega \) wasn't zero. (Our old friend \( d\theta \), the closed-but-not-exact form from the forms article, shows up again as the connection form, and since it's closed its \( d \) vanishes.) Sphere: \[ d\omega = -\sin\theta\, d\theta \wedge d\phi = -\frac{1}{R^2}\, \theta^1 \wedge \theta^2 \quad\Longrightarrow\quad K = \frac{1}{R^2} \] Three lines from the line element to the curvature, using nothing but \( d \) and \( \wedge \). The coframe came from \( g \), \( \omega \) came from the coframe, and \( K \) came from \( \omega \), so you can compute \( K \) from distances measured inside the surface. That's Gauss's Theorema Egregium, and this is the shortest proof of it I know.
And the holonomy figure? That was Stokes' theorem. Parallel transport is \( \alpha' = -\omega(\gamma') \), so around a loop the angle relative to the frame changes by \( -\oint_\gamma \omega \). If the frame is smooth everywhere inside the loop, Stokes turns that into \( -\int\!\!\int d\omega = \int\!\!\int K\, dA \): the vector comes back rotated by the enclosed curvature. Our frame \( e_1 = \partial_\theta / R \) is not smooth at the north pole (which way is "south" when you're standing on the north pole? All of them), so the accounting has one extra term. Around the latitude circle, \( \oint \cos\theta_0\, d\phi = 2\pi\cos\theta_0 \), so relative to the frame the vector turns by \( -2\pi\cos\theta_0 \). Meanwhile the frame itself turns once around the pole, a full \( 2\pi \), the same way the polar frame \( \partial_r, \partial_\theta \) turns once around the origin of the flat plane. Net rotation: \( 2\pi - 2\pi\cos\theta_0 \), the area of the cap. That's the number the readout in the figure shows.
Curvature in general
On a surface, curvature is one number per point. In \( n \) dimensions the connection is an \( n \times n \) antisymmetric matrix of 1-forms \( \omega^a{}_b \), the first structure equation \( d\theta^a = -\omega^a{}_b \wedge \theta^b \) still determines it, and the second structure equation gives a matrix of 2-forms: \[ \Omega^a{}_b = d\omega^a{}_b + \omega^a{}_c \wedge \omega^c{}_b \] On a surface the \( \omega \wedge \omega \) term is \( \omega^1{}_1 \wedge \omega^1{}_2 + \omega^1{}_2 \wedge \omega^2{}_2 = 0 \), which is why we could write curvature as just \( d\omega \). In general it doesn't vanish. Expand each 2-form in the coframe, \( \Omega^a{}_b = \tfrac{1}{2} R^a{}_{bcd}\, \theta^c \wedge \theta^d \), and the coefficients are the Riemann curvature tensor. It's a \( (1,3) \) tensor, and it measures how much transporting \( w \) around the little parallelogram spanned by \( u \) and \( v \) changes it: \[ R(u,v)\, w = \nabla_u \nabla_v w - \nabla_v \nabla_u w - \nabla_{[u,v]} w \] You have to say which 2-dimensional direction you go around, and that's what the \( c, d \) slots are for. Riemann has \( n^2(n^2-1)/12 \) independent components: 1 in two dimensions (that's \( K \)), 6 in three, 20 in four. For physics, two contractions (sums over a pair of indices) matter. The Ricci tensor \( R_{bd} = R^a{}_{bad} \) and the scalar curvature \( R = g^{bd} R_{bd} \), which on a surface is \( 2K \).
Einstein's field equations say the matter in spacetime determines its Ricci curvature: \[ R_{\mu\nu} - \tfrac{1}{2} R\, g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu} \] where \( T_{\mu\nu} \) is the energy and momentum density. Outside a mass, in empty space, the right side is zero, and the equations reduce to \( R_{\mu\nu} = 0 \). The Schwarzschild metric below is the spherically symmetric solution. Checking it is the moving frames method one more time: read the four coframe forms off the line element, solve the first structure equation for the six connection forms, take \( d \) and wedge for the six curvature forms, contract, and get all zeros. That's an afternoon with the formulas on this page and no new ideas, so I'll take it as given and spend the afternoon on light instead.
Exercises
You can do all of these with the formulas above, no tricks.
Type answers as numbers or expressions like pi/3
or 1/9. Your progress is saved in your browser
().
Exercise 1. In the hyperbolic half-plane \( ds^2 = (dx^2 + dy^2)/y^2 \), compute the length of the vertical segment \( x = 0 \), from \( y = 1 \) to \( y = e \).
Hint
Parametrize by \( y \). Along the segment \( dx = 0 \), so the speed is \( \sqrt{g(\gamma',\gamma')} = 1/y \).Solution
\( \int_1^e \frac{dy}{y} = \ln e - \ln 1 = 1 \). The hyperbolic distance from \( y = 1 \) to \( y = e^n \) is \( n \), so going up is exponentially cheap, and getting all the way down to the axis would cost you an infinite amount.Exercise 2. In polar coordinates, \( ds^2 = dr^2 + r^2 d\theta^2 \), at the point \( r = \sqrt{3} \), find the angle in radians between \( v = \partial_r \) and \( w = \partial_r + \partial_\theta \).
Hint
\( \cos\alpha = g(v,w)/(|v||w|) \), and \( g(v,w) = g_{rr} v^r w^r + g_{\theta\theta} v^\theta w^\theta \).Solution
\( g(v,w) = 1 \), \( |v| = 1 \), \( |w| = \sqrt{1 + r^2} = \sqrt{1 + 3} = 2 \). So \( \cos\alpha = 1/2 \) and \( \alpha = \pi/3 \). In the chart, \( w \) is drawn at \( 45^\circ \) to \( v \), but the real angle is \( 60^\circ \), because \( \partial_\theta \) is \( \sqrt{3} \) times longer than it looks. The chart lied.Exercise 3. Solve the first structure equation for the connection form \( \omega \) of the hyperbolic half-plane, coframe \( \theta^1 = dx/y \), \( \theta^2 = dy/y \). Then evaluate it on the coordinate vector \( \partial_x \) at the point \( (x, y) = (0, 2) \).
Hint
\( d\theta^2 = d(dy/y) = 0 \), so \( \omega \wedge \theta^1 = 0 \) and \( \omega \) is a multiple of \( dx \). Then use \( d\theta^1 = d(1/y) \wedge dx \) to find the multiple.Solution
\( d\theta^1 = -\frac{1}{y^2}\, dy \wedge dx = \frac{1}{y^2}\, dx \wedge dy \), and it must equal \( \omega \wedge \theta^2 = f\, dx \wedge dy / y \), so \( f = 1/y \) and \( \omega = dx / y = \theta^1 \). At \( y = 2 \), \( \omega(\partial_x) = 1/2 \): moving one unit to the right turns the frame by half a radian.Exercise 4. Use the structure equations on the coframe \( \theta^1 = R\,d\theta \), \( \theta^2 = R \sin\theta\, d\phi \) with \( R = 3 \). What is the Gaussian curvature \( K \)?
Hint
I did this calculation in the text with a general \( R \). Check where \( R \) survives.Solution
\( \omega = \cos\theta\, d\phi \) regardless of \( R \), and \( d\omega = -\sin\theta\, d\theta\wedge d\phi \), while \( \theta^1 \wedge \theta^2 = R^2 \sin\theta\, d\theta \wedge d\phi \). So \( K = 1/R^2 = 1/9 \). Bigger spheres are flatter, which is why the Earth looks flat from the ground. It's not flat, it's just really big.Exercise 5. Take \( d \) of the connection form from Exercise 3 to find the Gaussian curvature of the hyperbolic half-plane.
Hint
\( d\omega = -K\, \theta^1 \wedge \theta^2 \), and \( \theta^1 \wedge \theta^2 = dx \wedge dy / y^2 \).Solution
\( d\omega = d(dx/y) = -\frac{1}{y^2}\, dy \wedge dx = \frac{1}{y^2}\, dx \wedge dy = \theta^1 \wedge \theta^2 \), so \( K = -1 \). Constant negative curvature everywhere. The half-plane is the sphere's evil twin, and its geodesic triangles have angle sums less than \( 180^\circ \).Exercise 6. On the unit sphere, a vector is parallel transported once around the circle of latitude at polar angle \( \theta_0 = 60^\circ \). By what angle (in radians) does it come back rotated?
Hint
The rotation is the area of the enclosed cap, \( \int\!\!\int K\, dA \) with \( K = 1 \).Solution
\( 2\pi(1 - \cos 60^\circ) = 2\pi \cdot \frac{1}{2} = \pi \). Set the slider in the transport figure to \( 60^\circ \) and watch the vector come back pointing the opposite way.Exercise 7. In the Schwarzschild metric (next section), a clock hovering at fixed \( r \) ticks at the rate \( \sqrt{1 - r_s/r} \) compared to a clock far away. What is that rate at \( r = 2 r_s \)?
Hint
Read the coefficient of \( dt^2 \) off the metric. For a hovering clock \( dr = d\theta = d\phi = 0 \), and the proper time is \( d\tau^2 = -ds^2/c^2 \).Solution
\( \sqrt{1 - 1/2} = 1/\sqrt{2} \approx 0.7071 \). A minute on the hovering clock is about 85 seconds far away. At \( r = r_s \) the rate hits zero. Interstellar was onto something.Exercise 8. A light ray grazing the Sun is deflected by \( \Delta\phi \approx 2 r_s / b \) (derived in the next section). With \( r_s = 2.95 \) km for the Sun and \( b = 696{,}000 \) km its radius, find the deflection in arcseconds. (One radian is \( 206{,}265 \) arcseconds.)
Hint
\( 2 \cdot 2.95 / 696{,}000 \) radians, then convert.Solution
\( 8.48 \times 10^{-6} \) radians \( \approx 1.75'' \). This is the number Eddington measured during the 1919 eclipse, and it made Einstein famous overnight. Newtonian gravity, treating light as particles, only predicts half of it.A black hole
In November 1915 Einstein published his field equations. A few weeks later, a letter reached him from the Russian front. Karl Schwarzschild (SHVARTS-shilt), an astronomer serving as an artillery lieutenant in the German army, had found the first exact solution. He died a few months later, in 1916, of an illness he caught at the front. His solution describes the empty space around a spherical mass \( M \): \[ ds^2 = -\left(1 - \frac{r_s}{r}\right) c^2\, dt^2 + \frac{dr^2}{1 - r_s/r} + r^2 \left( d\theta^2 + \sin^2\theta\, d\phi^2 \right), \qquad r_s = \frac{2GM}{c^2} \] This is a metric in the same sense as everything else on this page, on a four-dimensional manifold with coordinates \( (t, r, \theta, \phi) \), with one change: the coefficient of \( dt^2 \) is negative, so the metric isn't positive definite. It's a Lorentzian metric, and that minus sign is what makes time different from space. A tangent vector with \( ds^2 < 0 \) is timelike, the velocity of something slower than light, and \( \sqrt{-ds^2}/c \) is the proper time a clock moving that way records. A vector with \( ds^2 = 0 \) is lightlike, and light moves along geodesics made of those. Everything else (frames, connections, geodesics, curvature) carries over unchanged.
You can read physics right off the coefficients. A clock hovering at radius \( r \) has \( dr = d\theta = d\phi = 0 \), so \( d\tau = \sqrt{1 - r_s/r}\; dt \): it runs slow compared to a clock at infinity, and at \( r = r_s \) it stops. That's the event horizon, the Schwarzschild radius. For the Sun \( r_s \approx 3 \) km, for the Earth about 9 mm (squeeze the whole planet into a marble and you get a black hole). Nothing special happens to a falling observer at \( r_s \). The singularity there is the coordinates' fault, like the pole in polar coordinates. But once you're inside, every timelike path ends at \( r = 0 \). No exceptions.
How light bends
Now for the calculation the rendering is built on. Light follows null geodesics (geodesics with \( ds^2 = 0 \)). We could write out the geodesic equation and grind, but there's a shortcut: the metric doesn't depend on \( t \) or on \( \phi \), and for each coordinate a metric ignores, geodesics have a conserved quantity (this is Noether's theorem, and the vector fields \( \partial_t \), \( \partial_\phi \) are called Killing fields). With a dot for \( d/d\lambda \), \( c = 1 \), and the ray confined to the equatorial plane \( \theta = \pi/2 \) by symmetry: \[ E = \left(1 - \frac{r_s}{r}\right)\dot t, \qquad L = r^2 \dot\phi \] are constant along the ray. Put those into \( ds^2 = 0 \): \[ -\frac{E^2}{1 - r_s/r} + \frac{\dot r^2}{1 - r_s/r} + \frac{L^2}{r^2} = 0 \quad\Longrightarrow\quad \dot r^2 = E^2 - \frac{L^2}{r^2}\left(1 - \frac{r_s}{r}\right) \] The shape of the orbit is easier in \( u = 1/r \) as a function of \( \phi \). Using \( \dot r = (dr/d\phi)\dot\phi = -L\, du/d\phi \): \[ \left(\frac{du}{d\phi}\right)^2 = \frac{1}{b^2} - u^2 + r_s u^3, \qquad b = \frac{L}{E} \] where \( b \) is the impact parameter, the distance by which the ray would miss the center if it went straight. Differentiate once more with respect to \( \phi \) and divide by \( 2\, du/d\phi \): \[ \boxed{\; \frac{d^2 u}{d\phi^2} + u = \frac{3}{2} r_s u^2 \;} \] Without the right side, the solution is \( u = \sin\phi / b \), which is \( r\sin\phi = b \): a straight line at distance \( b \) from the origin. The right side is gravity. That one little term on the right gives us three things:
- The photon sphere. A circular orbit is \( u \) constant, so \( u = \frac{3}{2} r_s u^2 \), so \( r = \frac{3}{2} r_s \). Light can orbit a black hole, at one and a half Schwarzschild radii! The orbit is unstable, so a ray near it winds around a few times and then either falls in or flies off.
- The shadow. The circular orbit has impact parameter \( b_c = \frac{3\sqrt{3}}{2} r_s \approx 2.6\, r_s \). Rays aimed closer than that are captured, rays aimed further out escape. So the black disk you see isn't the horizon. It's the set of directions with \( b < b_c \), about \( 2.6 \) times bigger in radius than \( r_s \).
- Weak deflection. Far from the hole, treat the right side as a small perturbation of the straight line. First-order perturbation theory gives a total bend of \[ \Delta\phi \approx \frac{2 r_s}{b} = \frac{4GM}{c^2 b} \] which is Exercise 8.
The figure integrates the boxed equation numerically, using fourth-order Runge–Kutta (the workhorse ODE solver), for a fan of rays coming in from the left plus one ray whose impact parameter you pick. Units are \( r_s = 1 \). The black disk is the horizon, the dashed circle is the photon sphere.
Rendering the sky
To draw what an observer near the hole sees, run the same calculation backwards for every pixel on the screen. Each pixel is a direction. Follow a light ray out of the camera in that direction, bending it with the boxed equation, until it either crosses the horizon (that pixel is black) or gets far away (that pixel shows whatever star is in the direction the ray ended up going). By spherical symmetry the ray stays in the plane spanned by the camera position and the pixel's direction, so each pixel is its own copy of the 2D problem above. The one subtle part is the initial condition: the observer is hovering, not falling, and the direction they see is measured in their own orthonormal frame, so the radial component of the coordinate velocity gets a factor of \( \sqrt{1 - r_s/r} \), the same factor from Exercise 7.
The integration runs on your GPU in a fragment shader (a little program that runs once per pixel), one ray per pixel. To avoid the coordinate singularity of \( \phi \) for rays aimed straight at or away from the hole, the shader integrates the same equation written as a force law in the ray's plane: for a central acceleration and a conserved \( h = |\vec{x} \times \vec{v}| \), the equation \( u'' + u = \frac{3}{2} r_s u^2 \) is equivalent to \[ \ddot{\vec{x}} = -\frac{3}{2} r_s h^2\, \frac{\vec{x}}{r^5} \] which is the formula in the loop below. The star field is generated procedurally, so you get the same sky every time you load the page.
for (int i = 0; i < 400; i++) {
float r = length(x);
if (r < rs) { captured = true; break; } // fell in
if (r < 1.5*rs && dot(x, v) < 0.0) { captured = true; break; }
if (r > rEscape) break; // gone
float h = clamp(0.06*r, 0.02, 1.5); // step size
rk4Step(x, v, h); // acceleration = -1.5*rs*h2*x/r^5
}
color = captured ? black : sky(normalize(v));
Drag to look around. The hole starts in the center of the view. Turn the mass down to zero to see the undistorted sky, then crank it back up. The grid draws lines of constant latitude and longitude on the celestial sphere, and it's the easiest way to see what the lensing is doing.
A few things to look for. The shadow is the disk of directions with \( b < b_c \), and its angular radius as seen by a hovering observer at distance \( D \) is \( \sin\alpha = \frac{b_c}{D} \sqrt{1 - r_s/D} \), which the readout prints. Around the edge of the shadow the sky gets squeezed into a thin ring. That's the Einstein ring, made of light from directly behind the hole that bent around it on every side. Just inside that ring the entire sky shows up again, mirrored and compressed, from rays that went around once. Then again, thinner, from rays that went around twice, and so on forever, each copy from rays that spent longer near the photon sphere. Set the distance to \( 4 \) and \( r_s \) to \( 3 \) and you're inside the photon sphere, where more than half the sky is black. Now drag around to look directly away from the hole: the entire rest of the universe is crammed into a cone.
Where we are
We started with a tape measure. A metric is a symmetric \( (0,2) \) tensor, and that's enough to measure length and angle, to turn 1-forms into vectors and back, and to pick out one connection. The connection is the rule for comparing neighboring fibers of the tangent bundle (the thing the bundles article said was missing), and from it we got covariant derivatives, parallel transport and geodesics. On a surface the connection is a single 1-form \( \omega \), the curvature is \( d\omega \), and Stokes' theorem from the forms article turns curvature into holonomy: carry a vector around a loop and it comes back rotated by the curvature inside. In more dimensions the curvature is a tensor, Einstein set its contraction equal to matter, and Schwarzschild found the vacuum solution while serving on the Russian front. Two conserved quantities and one substitution turn its null geodesics into \( u'' + u = \frac{3}{2} r_s u^2 \), and if you ask your GPU to integrate that equation once per pixel, you get a picture of a black hole.
So here's how the three articles fit together. A bundle is a space that's locally a product and glued together globally. A connection is a rule for moving between its fibers, and it's a 1-form. Curvature is the exterior derivative of the connection, and it measures what happens when you go around a loop. Electromagnetism is this story on a U(1) bundle. Gravity is this story on the tangent bundle. The rest of the Standard Model is this story on bundles with bigger groups. It's bundles all the way down.