Coordinates are a pain...

But they're a necessary evil (for computation)

If you're like me, you think about shapes and surfaces as just floating blobs in space. I don't really care about coordinates. I guess you could say that I'm more interested in the intrinsic properties of a shape...

Here's a cheap and easy example of one such property: the (surface) area of a shape. We're used to seeing that written as sq.ft., sq.m., hectres, acres, etc. But that those units are a consequence of the (arbitrary) ruler/scale we're using. The area exists independent of whether we measure it in metres or feet. (Hell, a shape has area, independent of the existence of any measuring stick.)

Another example of an intrinsic property of a shape is (the) curvature (at a point). It turns out, mathematicians and physicists are really interested in curvature, and while we've known for a while that curvature is intrinsic, we still end up needing a coordinate system to calculate it.

Buckle up, it's about to get bumpy whacky.

The Warm Up

On a flat surface, like the plane, we'd measure the curvature of some path via derivatives. In particular, the second derivative. And that feels pretty intuitive: if the tangent line, at a point on the path, isn't changing, the path isn't very curved. If it is change, we've got curvature!

Here are two canonical examples:

  1. the straight line: y=mx+by = mx+b, yβ€²=my'= m, and yβ€²β€²=0y'' = 0.
  2. the upper half of the unit circle: y=1βˆ’x2y = \sqrt{1-x^2}, yβ€²=βˆ’x/1βˆ’x2y'=-x/\sqrt{1-x^2}, and yβ€²β€²=βˆ’1/(1βˆ’x2)3/2y''=-1/(1-x^2)^{3/2}.

In the former example, we have a straight line and don't expect that to have any curvature, so the yβ€²β€²=0y''=0 result makes perfect sense. In the latter example, the derivatives are defined everywhere on (βˆ’1,1)(-1,1), and after plugging the first and second derivative into the formula

ΞΊ=∣yβ€²β€²βˆ£(1+yβ€²2)3/2 \kappa = \frac{\vert y'' \vert}{(1+y'^2)^{3/2}}
you find that the semi-circle does, indeed, have a (constant) curvature of ΞΊ=1\kappa = 1.

None of this should be new, surprising, or (particularly) painful. What this should be, however, is a reminder that we are only able to perform these calculations because we've chosen the standard basis in R2\R^2, so we've (implicitly) setup a coordinate system.

To be painfully explicit, we could've taken the parametrized approach and defined our semi-circle via the mapping Ξ³:[βˆ’1,1]β†’R2\gamma: [-1,1] \to \R^2:

Ξ³(t)=(t,1βˆ’t2)Ξ³β€²(t)=(1,βˆ’t1βˆ’t2),βˆ₯Ξ³β€²(t)βˆ₯2=11βˆ’t2Ξ³β€²β€²(t)=(0,βˆ’1(1βˆ’t2)3/2),βˆ₯Ξ³β€²β€²(t)βˆ₯2=1(1βˆ’t2)3T(t)=Ξ³β€²(t)βˆ₯Ξ³β€²(t)βˆ₯=(1βˆ’t2,βˆ’t)c(t)=Ξ³β€²β€²(t)βˆ₯Ξ³β€²(t)βˆ₯2=(0,βˆ’11βˆ’t2) \begin{align*} \gamma(t) &= \left(t, \sqrt{1-t^2}\right) \\ \gamma'(t) &= \left(1, \frac{-t}{\sqrt{1-t^2}}\right), \lVert\gamma'(t)\rVert^2 = \frac{1}{1-t^2} \\ \gamma''(t) &= \left(0, -\frac{1}{(1-t^2)^{3/2}}\right), \lVert\gamma''(t)\rVert^2 = \frac{1}{(1-t^2)^3} \\ \mathbf{T}(t) &= \frac{\gamma'(t)}{\lVert\gamma'(t)\rVert} = \left(\sqrt{1-t^2}, -t\right) \\ \mathbf{c}(t) &= \frac{\gamma''(t)}{\lVert\gamma'(t)\rVert^2} = \left(0, -\frac{1}{\sqrt{1-t^2}}\right) \end{align*}

and using the definition of the curvature vector as the perpendicular component of Ξ³β€²β€²/βˆ₯Ξ³β€²βˆ₯2\gamma'' / \lVert \gamma' \rVert^2 relative to the (unit) tangent vector T\mathbf{T}:

K(t)=c(t)βˆ’<T,c>T=c(t)βˆ’(t1βˆ’t2)T(t)=(βˆ’t,βˆ’1βˆ’t2) \begin{align*} \mathbf{K}(t) &= \mathbf{c}(t) - \left<\mathbf{T}, \mathbf{c}\right>\mathbf{T} \\ &= \mathbf{c}(t) - \left(\frac{t}{\sqrt{1-t^2}}\right)\mathbf{T}(t) \\ &= \left(-t,-\sqrt{1-t^2}\right) \end{align*}
hence,
βˆ₯K(t)βˆ₯2=t2+(1βˆ’t2)=1 \lVert\mathbf{K}(t)\rVert^2 = t^2 + (1-t^2) = 1
which confirms what we already knew: the unit circle has constant curvature equal to 1.

Game Time

Now, suppose we have some random surface. If it makes it easier, let's say the surface is 2D, and in your mind's eye it's floating in a 3D space. If we were just doing geometry for the sake of geometry, we'd be done. The shape is what it is, we see it in our minds and who cares? But what if we need to actually talk about this shape analytically. I.e., describe it with measurements. For instance, how "peaky" it might be in a certain region. Boom! We're back in coordinate territory because we first need to describe, precisely, where we want to measure, and from there we need rulers for measurement. ...sigh...

In the case where our surface is actually interesting, it might have some real mountains and valleys. Moreover, we might actually care about how steep those features were. Like, if we wanted to do any optimization on this surface. In this case, we not only need coordinates, we need somewhere/something to do our calculus in.

In the warm up, we were doing calculus in R2\R^2 and that's a pretty reasonable place to take derivatives/accumulate geometric intuition. So what the boffins in their ivory towers decided that they'll let us keep our coordinate-free image of a floating surface, and permit us to continue doing the calculus we know and love, provided that every point on our surface is sufficiently approximated by Rn\R^n. In that case, we attach a minicopy of Rn\R^n to each point, and instead of using the standard unit vectors, we use the tangent vectors as the basis. We call this the tangent space and if the point is in a completely flat neighborhood, you may assume that the standard basis is the basis of our tangent space.

But what if the point is in a curved region? How could/should we measure this? The reason we were doing calculus in these tangent spaces is because this surface is just a blob in space. But that means that vectors in one point's tangent space don't obviously connect to vectors in a different point's tangent space. So while you might be tempted to measure curvature by seeing how a tangent plane at a point wiggles, that doesn't work in our abstract set up.

Why not? Because that tangent plane trick assumes that your coordinate system (read: your basis vectors) don't change inside a neighborhood of the point you want to measure. We can't make that assumption here.

What we can do is lean in to the idea that the basis vectors are going to rotate when we wiggle around a curved patch, and ask:

how much will basis vector bi\mathbf{b}_i change in the direction of bj\mathbf{b}_j if we head in the direction of bk\mathbf{b}_k?

To have this question make sense, let's assume that our 2D surface has R3\R^3 as its points' tangent spaces. To make this concrete, we can talk about the hemisphere parametrized by

S(u,v)=(u,v,1βˆ’u2βˆ’v2):Bβ†’R3 S(u,v) = \left(u, v, \sqrt{1-u^2-v^2}\right) : B \to \R^3
let B={(u,v):u2+v2≀1}B = \{ (u,v) : u^2 + v^2 \leq 1 \} denote the unit-ball in R2\R^2.

By parametrizing the hemisphere, we've actually set ourselves up to do all the calculus we could care about, but let's ignore that and noodle around, instead.

Let's take a random point on the hemisphere, S(u,v)=pS(u,v) = \mathbf{p} and try and get a feel for the tangent space. The tangent space is meant to be all vectors tangent to p\mathbf{p}, so what does that look like exactly? Well, it probably includes first derivatives. So, let's calculate the the Jacobian. Let's rewrite (u,v)=u(u,v) = \mathbf{u}, and our surface as S(u)=(S1(u),S2(u),S3(u))S(\mathbf{u})=(S_1(\mathbf{u}), S_2(\mathbf{u}), S_3(\mathbf{u})), so

J=[βˆ‚S1βˆ‚u1βˆ‚S2βˆ‚u1βˆ‚S3βˆ‚u1βˆ‚S1βˆ‚u2βˆ‚S2βˆ‚u2βˆ‚S3βˆ‚u2]=[10βˆ’u11βˆ’u12βˆ’u2201βˆ’u21βˆ’u12βˆ’u22] \begin{align*} J &= \begin{bmatrix} \frac{\partial S_1}{\partial u_1} & \frac{\partial S_2}{\partial u_1} & \frac{\partial S_3}{\partial u_1} \\ \frac{\partial S_1}{\partial u_2} & \frac{\partial S_2}{\partial u_2} & \frac{\partial S_3}{\partial u_2} \end{bmatrix} \\ &=\begin{bmatrix} 1 & 0 & \frac{-u_1}{\sqrt{1-u_1^2 - u_2^2}} \\ 0 & 1 & \frac{-u_2}{\sqrt{1-u_1^2 - u_2^2}} \end{bmatrix} \end{align*}

Thus, our Jacobian has two (linearly) independent row vectors. Pausing for a moment and thinking about it, the tangent space to our space feels like it should be a (hyper)plane, and the fact that we have these two tangent vectors means that their span makes a plane. So, this definitely passes the smell test.

I'm gonna use some more notation to make things a bit smoother:

βˆ‚i=(βˆ‚S1βˆ‚ui,βˆ‚S2βˆ‚ui,βˆ‚S3βˆ‚ui)∈R3 \partial_i = \left( \frac{\partial S_1}{\partial u_i}, \frac{\partial S_2}{\partial u_i}, \frac{\partial S_3}{\partial u_i} \right) \in \R^3

hence our tangent space is the collection of vectors v=aβˆ‚1+bβˆ‚2\mathbf{v} = a\partial_1 + b \partial_2, and this space is "anchored" at a given point, p\mathbf{p}.

So, if p=(0.5,0.5)\mathbf{p} = (0.5, 0.5), q=(0.55,0.55)\mathbf{q} = (0.55, 0.55), we see that

J(p)=[10βˆ’0.7071101βˆ’0.70711]β‰ [10βˆ’0.8751101βˆ’0.87511]=J(q) J(\mathbf{p}) = \begin{bmatrix} 1 & 0 & -0.70711 \\ 0 & 1 & -0.70711 \end{bmatrix} \neq \begin{bmatrix} 1 & 0 & -0.87511 \\ 0 & 1 & -0.87511 \end{bmatrix} = J(\mathbf{q})

which means that the two tangent planes are not the same (the latter is more tilted).

Great. So what? Well, now that we have tangent vectors, we can ask how they change as we move away from a given point. Consider naively taking derivatives of our basis vectors:

Hi=[βˆ‚2Siβˆ‚u12βˆ‚2Siβˆ‚u2βˆ‚u1βˆ‚2Siβˆ‚u1βˆ‚u2βˆ‚2Siβˆ‚u22] H^{i} = \begin{bmatrix} \frac{\partial^2 S_i}{\partial u_1^2} & \frac{\partial^2 S_i}{\partial u_2 \partial u_1} \\ \frac{\partial^2 S_i}{\partial u_1 \partial u_2} & \frac{\partial^2 S_i}{\partial u_2^2} \end{bmatrix}

hence, Hijk=βˆ‚2Skβˆ‚uiβˆ‚uj=βˆ‚βˆ‚ujβˆ‚ikH^{k}_{ij} = \dfrac{\partial^2 S_k}{\partial u_i \partial u_j} = \dfrac{\partial}{\partial u_j} \partial_i^k which is a 2Γ—2Γ—32\times 2\times 3 matrix, telling us how our tangent vectors rotate as we step in certain directions. But now consider running along kk:

Hij=(Hij1,Hij2,Hij3)∈R3 H_{ij} = \left(H^1_{ij}, H^2_{ij}, H^3_{ij} \right) \in \R^3
there's no guarantee that this vector is still inside our tangent plane. In fact, it almost never is: part of HijH_{ij} is the surface bulging away from its own tangent plane (that's the surface curving in the ambient R3\R^3 β€” an extrinsic accident of how we drew it), and only the leftover part lies back in the plane where the surface can actually "feel" it. We want that leftover part, so let's project HijH_{ij} down into the plane.

Some wrist exercise

The tangential part of HijH_{ij} lives in the plane, so by definition it's some combination of our basis vectors:

H^ij=cij1βˆ‚1+cij2βˆ‚2=βˆ‘k=12cijkβˆ‚k=cijJ \hat{H}_{ij} = c_{ij}^1 \partial_1 + c_{ij}^2 \partial_2 = \sum_{k=1}^{2}c_{ij}^{k} \partial_k = \mathbf{c}_{ij} J
The defining property of a projection: whatever we throw away, Hijβˆ’H^ijH_{ij} - \hat{H}_{ij}, must point straight out of the plane β€” i.e. it's orthogonal to every tangent vector. Hence, for a∈{1,2}a \in \{1,2\}:
<Hijβˆ’H^ij,βˆ‚a>=0⇔<Hij,Β βˆ‚a>=βˆ‘k=12cijk<βˆ‚k,βˆ‚a> \left< H_{ij} - \hat{H}_{ij}, \partial_a \right> =0\Leftrightarrow \left< H_{ij},\ \partial_a \right> = \sum_{k=1}^{2} c_{ij}^k \left< \partial_k, \partial_a \right>
which can be rewritten as
HijJT=(cij1,cij2)[<βˆ‚1,βˆ‚1><βˆ‚1,βˆ‚2><βˆ‚2,βˆ‚1><βˆ‚2,βˆ‚2>]=cijg \begin{align*} H_{ij} J^{T} &= (c_{ij}^1, c_{ij}^2) \begin{bmatrix} \left<\partial_1, \partial_1\right> & \left<\partial_1, \partial_2\right> \\ \left<\partial_2, \partial_1\right> & \left<\partial_2, \partial_2\right>\\ \end{bmatrix} \\ &= \mathbf{c}_{ij} g \end{align*}

The matrix, gg, is referred to as the metric tensor and is a record of how long our basis vectors are and how skewed they are from each other. Moreover, multiplying both sides by the inverse of gg, solves our linear system:

cij=HijJTgβˆ’1 \mathbf{c}_{ij} = H_{ij}J^{T}g^{-1}
specifically, if gmng^{mn} denotes the (m,n)-th entry of gβˆ’1g^{-1}, then
cijk=g1k<Hij,βˆ‚1>+g2k<Hij,βˆ‚2> c_{ij}^{k} = g^{1k} \left< H_{ij}, \partial_1 \right> + g^{2k}\left< H_{ij}, \partial_2\right>
and
H^ij=HijJTgβˆ’1J⏟proj \hat{H}_{ij} = H_{ij} \underbrace{J^T g^{-1} J}_{proj}
If we rewrite g=JTJg = J^T J, we see that
JTgβˆ’1J=JT(JTJ)βˆ’1J J^{T} g^{-1} J = J^T (J^{T} J)^{-1} J
which is precisely the formula for orthogonal projection into the row-span of JJ. (The thing we wanted all along!) Like in first-year linear algebra, where the formula looks like AT(ATA)βˆ’1AA^T (A^TA)^{-1} A, we're told that (ATA)βˆ’1(A^T A)^{-1} is a corrective factor that "un-skews" the spanning set. That's precisely what gβˆ’1g^{-1} is doing for us.

N.B. While it may be tempting to wave the wand and say "βˆ‚1\partial_1 and βˆ‚2\partial_2 are perpendicular, so g12=g21=0g_{12}=g_{21}=0...", there's no reason a wiggly surface hands us a perpendicular grid! On our own hemisphere at p=(0.5,0.5)\mathbf{p}=(0.5,0.5),

<βˆ‚1,βˆ‚2>=(βˆ’0.5)2=0.5β‰ 0, \left<\partial_1, \partial_2\right> = (-\sqrt{0.5})^2 = 0.5 \neq 0,
so the basis is genuinely skewed, and we need to calculate gβˆ’1g^{-1}.

One more point about gg:

βˆ‚gijβˆ‚uk=βˆ‚βˆ‚uk<βˆ‚i,βˆ‚j>=βˆ‘l=13βˆ‚βˆ‚ukβˆ‚ilβˆ‚jl=βˆ‘l=13Hiklβˆ‚jl+βˆ‚ilHjkl=<Hjk,βˆ‚i>+<Hik,βˆ‚j> \begin{align*} \frac{\partial g_{ij}}{\partial u_k} &= \frac{\partial}{\partial u_k}\left<\partial_i, \partial_j \right> \\ &= \sum_{l=1}^{3} \frac{\partial}{\partial u_k}\partial_{i}^{l}\partial_{j}^{l} \\ &= \sum_{l=1}^{3} H_{ik}^{l}\partial_{j}^{l} + \partial_{i}^{l} H_{jk}^{l} \\ &= \left<H_{jk}, \partial_i \right> + \left<H_{ik}, \partial_j \right> \end{align*}
The temptation now is to solve for <Hij,βˆ‚s>\left<H_{ij}, \partial_s\right> by rearranging this single equation. But that's a trap: any one such identity always pairs <Hij,βˆ‚s>\left<H_{ij}, \partial_s\right> with a leftover <Hβˆ™βˆ™,βˆ‚βˆ™>\left<H_{\bullet\bullet}, \partial_\bullet\right> term, and trying to eliminate that leftover with the same identity just runs you in a circle (you'll find yourself "proving" cijk=βˆ’cijkc_{ij}^k = -c_{ij}^k).

The fix is the Levi-Civita trick: write the identity for three cyclic permutations of the indices and combine them so the unwanted terms cancel pairwise. Using the symmetric form above (and Hab=HbaH_{ab}=H_{ba}, since mixed partials commute):

βˆ‚gjsβˆ‚ui=<Hij,βˆ‚s>+<His,βˆ‚j>βˆ‚gisβˆ‚uj=<Hij,βˆ‚s>+<Hjs,βˆ‚i>βˆ‚gijβˆ‚us=<His,βˆ‚j>+<Hjs,βˆ‚i> \begin{align*} \frac{\partial g_{js}}{\partial u_i} &= \left<H_{ij}, \partial_s\right> + \left<H_{is}, \partial_j\right> \\ \frac{\partial g_{is}}{\partial u_j} &= \left<H_{ij}, \partial_s\right> + \left<H_{js}, \partial_i\right> \\ \frac{\partial g_{ij}}{\partial u_s} &= \left<H_{is}, \partial_j\right> + \left<H_{js}, \partial_i\right> \end{align*}
Take (first) + (second) βˆ’ (third). The <His,βˆ‚j>\left<H_{is}, \partial_j\right> and <Hjs,βˆ‚i>\left<H_{js}, \partial_i\right> terms each appear once with a ++ and once with a βˆ’-, so they vanish, leaving
<Hij,βˆ‚s>=12(βˆ‚gjsβˆ‚ui+βˆ‚gisβˆ‚ujβˆ’βˆ‚gijβˆ‚us) \left<H_{ij}, \partial_s\right> = \frac{1}{2}\left(\frac{\partial g_{js}}{\partial u_i} + \frac{\partial g_{is}}{\partial u_j} - \frac{\partial g_{ij}}{\partial u_s}\right)
Hence, looking back at our coefficients:
cijk=βˆ‘s=12gsk<Hij,βˆ‚s>=12βˆ‘s=12gks(βˆ‚gjsβˆ‚ui+βˆ‚gisβˆ‚ujβˆ’βˆ‚gijβˆ‚us)=Ξ“ijk \begin{align*} c_{ij}^{k} &= \sum_{s=1}^{2} g^{sk} \left< H_{ij}, \partial_s \right> \\ &= \frac{1}{2}\sum_{s=1}^{2} g^{ks} \left(\frac{\partial g_{js}}{\partial u_i} + \frac{\partial g_{is}}{\partial u_j} - \frac{\partial g_{ij}}{\partial u_s}\right) \\ &= \Gamma^{k}_{ij} \end{align*}
which is exactly the textbook Christoffel symbol of the second kind. Note that the factor of 12\tfrac{1}{2} wasn't something we inserted by hand β€” it falls out of the symmetrization, which is precisely the step the naive single-substitution skips.

Wrapping it up

Let's take stock of what just happened. We set out to answer a very physical-sounding question β€” "if I nudge along βˆ‚j\partial_j, how does the basis vector βˆ‚i\partial_i rotate within the tangent plane?" β€” and we answered it the honest way: we wrote down the second derivative Hij=βˆ‚2S/βˆ‚uiβˆ‚ujH_{ij} = \partial^2 S / \partial u_i \partial u_j, projected it onto the tangent plane, and read off the coefficients cijkc_{ij}^k. Then the algebra forced our hand and revealed that those coefficients are nothing other than the Christoffel symbols of the second kind,

Ξ“ijk=12βˆ‘lgkl(βˆ‚gjlβˆ‚ui+βˆ‚gilβˆ‚ujβˆ’βˆ‚gijβˆ‚ul), \Gamma^k_{ij} = \frac{1}{2}\sum_{l} g^{kl}\left(\frac{\partial g_{jl}}{\partial u_i} + \frac{\partial g_{il}}{\partial u_j} - \frac{\partial g_{ij}}{\partial u_l}\right),
the single most-thumbed object in all of Riemannian geometry. We didn't memorize it; we backed into it.

So we have two faces of the same coin:

cijk=βˆ‘sgsk<Hij,βˆ‚s>⏟projectionΒ ofΒ aΒ secondΒ derivative=12βˆ‘lgkl(βˆ‚igjl+βˆ‚jgilβˆ’βˆ‚lgij)⏟derivativesΒ ofΒ theΒ metric. \underbrace{c_{ij}^{k} = \sum_s g^{sk}\left<H_{ij}, \partial_s\right>}_{\text{projection of a second derivative}} \quad=\quad \underbrace{\frac{1}{2}\sum_{l} g^{kl}\left(\partial_i g_{jl} + \partial_j g_{il} - \partial_l g_{ij}\right)}_{\text{derivatives of the metric}}.

Why everyone uses the right-hand side

The left-hand side is the version we understand β€” it's a literal projection, it told us the geometric story. But the right-hand side is the version we compute with, and the reason is the whole point of this post.

The left-hand side leans on HijH_{ij}, the second derivative of the embedding SS. That requires an embedding to exist: a concrete formula for how our surface sits inside the ambient R3\R^3. For our hemisphere that's fine, we wrote S(u,v)S(u,v) down. But the entire premise was that we wanted to study a surface intrinsically β€” as a blob that doesn't know or care about any surrounding space. The right-hand side delivers exactly that: it mentions only gg and its derivatives. Feed it a metric β€” any metric, including ones for spaces that can't be drawn inside any Rn\R^n, like spacetime β€” and it spits out the connection coefficients with no embedding in sight. The HijH_{ij} scaffolding we climbed up on gets kicked away.

There's a practical bonus, too: gg is symmetric, so in nn dimensions you only ever store and differentiate its n(n+1)2\tfrac{n(n+1)}{2} independent entries, rather than carting around the full ambient second-derivative tensor HH and projecting it every time.

The geometric punchline

Stripped of notation, here's what a Christoffel symbol is: a bookkeeping device for the fact that on a curved surface, your coordinate grid won't hold still. Step a little in the βˆ‚j\partial_j direction and the basis vector βˆ‚i\partial_i tips and stretches; Ξ“ijk\Gamma^k_{ij} records how much of that tipping points back along βˆ‚k\partial_k. Crucially, it only keeps the part of the motion that lives in the surface β€” the symmetrization in the formula is precisely what discards the bulge sticking out into the ambient space, the part the surface can't feel.

That's why these symbols are the gateway to everything that follows. Once you can quantify how the grid drifts, you can subtract that drift off and finally take an honest derivative of a vector field β€” the covariant derivative β€” and from there measure curvature itself, all without ever leaving the surface. But that's a post for another day.

Appendix A: a concrete number

At our point p=(0.5,0.5)\mathbf{p} = (0.5, 0.5), plugging into the formula gives:

Ξ“111=u1(u22βˆ’1)u12+u22βˆ’1∣p=0.5(βˆ’0.75)βˆ’0.5=0.75 \Gamma^1_{11} = \frac{u_1(u_2^2 - 1)}{u_1^2 + u_2^2 - 1}\bigg|_{\mathbf{p}} = \frac{0.5(-0.75)}{-0.5} = 0.75

This tells you: if you're standing at p\mathbf{p} and you step in the βˆ‚1\partial_1 direction, the βˆ‚1\partial_1 basis vector picks up 0.750.75 units of itself as a correction. It's not zero because the coordinate grid is bunching up as we approach the rim of the hemisphere.