The purpose of these notes is to build up the formalism of Riemannian geometry from an extrinsic perspective, with an emphasis on manifolds defined by constraints, particularly useful for the formulation optimization problems. Remarkably, we manage to calculate the Riemann curvature tensor without a Christoffel symbol in sight! There is absolutely no claim to novelty here: I’ve just organized standard results in a way that makes sense to me.
1. Flat space
First order
Let \(f(x): \mathbb{R}^{n} \rightarrow \mathbb{R}\) be a scalar function, that is, a scalar field, and let \(\langle \cdot, \cdot\rangle\) be the usual inner product on \(\mathbb{R}^n\). The directional derivative of \(f\) at \(x\) in the \(y\) direction is \[\tag{1.1}\begin{aligned}D_x f[y] &= \langle \nabla f(x), y\rangle = \sum_i \frac{\partial f(x)}{\partial x_i} y_i = \frac{d}{dr}f(x+ry)\Big|_{r=0},\end{aligned}\]
where recall the gradient is the vector of partial derivatives, \[\tag{1.2}\begin{aligned}\nabla f(x) = \begin{pmatrix} \frac{\partial f(x)}{\partial x_1} \\ \vdots \\ \frac{\partial f(x)}{\partial x_n}\end{pmatrix}.\end{aligned}\]
The meaning: if at \(x\) I move a wee bit in direction \(y\), how fast does \(f\) increase or decrease? In particular, at a critical point \(x\) (e.g., a local maximum, minimum, or saddle point), the gradient vanishes: \(\nabla f(x) = 0\).
There are many often confusing notations for directional derivatives. We’ll mainly stick to Fréchet notation \(D_x f[y]\), supplemented with \(\nabla\) for the gradient (and Jacobian) and \(\nabla^2\) for the Hessian, which we will come to shortly. Sometimes, however, it is helpful to emphasize the operator character of the derivatives, in which case we’ll use the concise notation \[\tag{1.3}\begin{aligned}D_y f(x) = D_x f[y],\end{aligned}\]
where the subscript on \(D\) here represents the direction in which we are differentiating, and the argument to the function tells us the point at which we are evaluating.
Example: Let \(f(x) = x_1^2 + x_2^2 = x \cdot x = \lVert x \rVert^2\). On the one hand, \[\tag{1.4}\begin{aligned}\nabla f(x) = \begin{pmatrix}2 x_1 \\ 2 x_2 \end{pmatrix} = 2x.\end{aligned}\]
so that \(D_x f [y] = \langle 2x, y\rangle\). On the other hand, \[\tag{1.5}\begin{aligned}\frac{d}{dt}f(x+ry)\Big|_{r=0} &= \frac{d}{dr} (x + ry) \cdot (x + ry)\Big|_{r=0}\end{aligned}\] \[\tag{1.6}\begin{aligned}&= \frac{d}{dr}(x\cdot x + 2 r x\cdot y + r^2 y \cdot y)\Big|_{r=0}\end{aligned}\] \[\tag{1.7}\begin{aligned}&= (2 x \cdot y + r y \cdot y)\Big|_{r=0}\end{aligned}\] \[\tag{1.8}\begin{aligned}&= 2 x\cdot y\end{aligned}\] \[\tag{1.9}\begin{aligned}&= \langle 2x, y\rangle,\end{aligned}\]
from which indeed we conclude that \(\nabla f(x) = 2x\). Which formula is easier to use depends on the circumstance: sometimes, e.g., when \(f\) is a function of matrices, it is inconvenient to consider all the componentwise derivatives in which case the second formula is often much easier to use.
Finally, let \(V: \mathbb{R}^n \rightarrow \mathbb{R}^n\) be a vector valued function, or vector field. The directional derivative can be defined similarly as \[\tag{1.10}\begin{aligned}D_x V[y] &= \nabla V(x) y = \sum_i \frac{\partial V(x)}{\partial x_i} y_i = \frac{d}{dt}V(x+ry)\Big|_{r=0},\end{aligned}\]
where \(\nabla V(s)\) is to be understood as the Jacobian matrix of first derivatives, \[\tag{1.11}\begin{aligned}\nabla V(x) = \begin{pmatrix} \frac{\partial V_1}{\partial x_1} & \cdots & \frac{\partial V_1}{\partial x_n} \\ \vdots & & \vdots \\ \frac{\partial V_n}{\partial x_1} & \cdots & \frac{\partial V_n}{\partial x_n} \end{pmatrix}.\end{aligned}\]
Indeed, \[\tag{1.12}\begin{aligned}\frac{\partial V(x)}{\partial x_i} = \begin{pmatrix} \frac{\partial V_1}{\partial x_i} \\ \vdots \\ \frac{\partial V_n}{\partial x_i} \end{pmatrix}.\end{aligned}\]
Second order
Moving right along, we can consider the second order directional derivative, \[\tag{1.13}\begin{aligned}D_x^2 f [y,z] &= \langle D_x(\nabla f)[y], z\rangle =\langle y, \nabla^2 f(x) z\rangle\end{aligned}\] \[\tag{1.14}\begin{aligned}&= \sum_{ij} \frac{\partial^2 f(x)}{\partial x_i \partial x_j}y_i z_j = \frac{\partial^2}{\partial r \partial s} f(x + ry + sz)\Big|_{r=s=0},\end{aligned}\]
where the Hessian \(H(x)=\nabla^2 f(x)\) is the matrix of second order partial derivatives, \[\tag{1.15}\begin{aligned}H(x) = \begin{pmatrix} \frac{\partial^2 f(x)}{\partial x_1^2} & \cdots & \frac{\partial^2 f(x)}{\partial x_1 \partial x_n} \\ \vdots & & \vdots \\ \frac{\partial^2 f(x)}{\partial x_n \partial x_1} & \cdots & \frac{\partial^2 f(x)}{\partial x_n^2} \end{pmatrix}.\end{aligned}\]
The meaning: if at \(x\) I move a wee bit in direction \(y\), how does the slope of \(f\) in direction \(z\) change? In particular, \(D_x^2f[y,y]=y^T H(x) y\) tells us how the function is bending upwards or downwards at \(x\) in the \(y\) direction. At a critical point, where the first derivative is 0, if this quantity is positive, the function increases in both directions along \(y\); if it is negative, the function decreases in both directions along \(y\). Thus if \(H\) is positive definite, \(x\) is a local minimum since the function bends upwards in all tangent directions \(y\). Similarly, if \(H\) negative definite, \(x\) is a local maximum; if \(H\) is indefinite, you have a saddle point; and if \(H\) is singular, the test is inconclusive.
It is worth spending a moment unpacking \(\langle D_x(\nabla f)[y], z\rangle =\langle y, \nabla^2 f(x) z\rangle\). Now \(D_x(\nabla f)[y]\) is the directional derivative of the vector field \(\nabla f\), so \[\tag{1.16}\begin{aligned}D_x(\nabla f)[y] = \nabla(\nabla f(x))y.\end{aligned}\]
As a vector \(\nabla f(x)\) has components \(\partial f(x)/\partial x_i\). So \(\nabla(\nabla f(x)) = \nabla^2 f(x)\) has components \(\partial^2 f(x)/\partial x_i \partial x_j\): indeed, it is just the Hessian which is symmetric since partial derivatives commute. This shows the identity with \(\langle y, \nabla^2 f(x) z\rangle\). Now here comes a fine point. We might have been tempted to define the second order derivative as \(D_x(D_x f[y])[z]\). Indeed, this is \[\tag{1.17}\begin{aligned}D_x(D_x f[y])[z] &= D_x \langle \nabla f, y\rangle[z] = \langle \nabla \langle \nabla f(x), y\rangle, z\rangle\end{aligned}\] \[\tag{1.18}\begin{aligned}&=\left\langle \nabla \sum_i \frac{\partial f(x)}{\partial x_i} y_i, z\right\rangle = \sum_j \frac{\partial}{\partial x_j} \left(\sum_i \frac{\partial f(x)}{\partial x_i} y_i\right) z_j\end{aligned}\] \[\tag{1.19}\begin{aligned}&= \sum_{ij} \frac{\partial^2 f(x)}{\partial x_i \partial x_j} y_i z_j = \langle y, \nabla^2 f(x) z\rangle,\end{aligned}\]
so we get the right answer! In particular, in flat space, \(\nabla D_x f[y] =D_x(\nabla f)[y]\): the gradient of the directional derivative is the directional derivative of the gradient since \[\tag{1.20}\begin{aligned}\nabla D_x f[y] = \nabla \langle \nabla f(x), y\rangle = \nabla^2 f(x)y,\end{aligned}\]
where the last follows from the above calcuation.
Example: Again let \(f(x) = x \cdot x = \sum_i x_i^2\). We have \[\tag{1.21}\begin{aligned}H(x) = \begin{pmatrix}2 & 0 \\ 0 & 2 \end{pmatrix}.\end{aligned}\]
Alternatively, \[\tag{1.22}\begin{aligned}&\frac{\partial^2}{\partial r \partial s} f(x + ry + sz)\Big|_{r=s=0}\end{aligned}\] \[\tag{1.23}\begin{aligned}&= \frac{\partial^2}{\partial r \partial s} (x + ry + sz)\cdot (x + ry + sz)\Big|_{r=s=0}\end{aligned}\] \[\tag{1.24}\begin{aligned}&= \frac{\partial^2}{\partial r \partial s}(x \cdot x + r x \cdot y + s x \cdot z + ry \cdot x + r^2 y \cdot y + rs y \cdot z + sz \cdot x + rs z \cdot y + s^2 z \cdot z)\Big|_{r=s=0}\end{aligned}\] \[\tag{1.25}\begin{aligned}&= \frac{\partial^2}{\partial r \partial s}( x \cdot x + 2r x \cdot y + 2rs y \cdot z + 2s x \cdot z + r^2 y \cdot y + s^2 z \cdot z)\Big|_{r=s=0}\end{aligned}\] \[\tag{1.26}\begin{aligned}&= (2y \cdot z)\Big|_{r=s=0}\end{aligned}\] \[\tag{1.27}\begin{aligned}&= 2 y \cdot z\end{aligned}\] \[\tag{1.28}\begin{aligned}&= \langle y, (2I)z\rangle,\end{aligned}\]
from which we can read off \(H(x) = 2I\).
Finally, let \(V: \mathbb{R}^n \rightarrow \mathbb{R}^n\) be a vector field. The Jacobian \(\nabla V(x)\) is a matrix with components \((\nabla V(x))_{ij} = \partial V_i(x) / \partial x_j\). Taking the Jacobian of the Jacobian gives a three-index tensor \((\nabla (\nabla V(x)))_{ijk} = \partial^2 V_i(x)/\partial x_j \partial x_k\). From this we see that the second order directional derivative is itself a vector with components \[\tag{1.29}\begin{aligned}(D_x^2 V[y, z])_i = \sum_{jk} \frac{\partial^2 V_i(x)}{\partial x_j \partial x_k } y_j z_k.\end{aligned}\]
We had earlier \(D_x^2 f[y,z] = \langle D_x(\nabla f)[y], z\rangle\). For vector functions, similarly we have \[\tag{1.30}\begin{aligned}D_x^2 V[Y(x), Z(x)] = D_x(\nabla V)[Z(x)] Y(x).\end{aligned}\]
A flat space identity
Suppose we have three vector fields \(Y(x)\), \(Z(x)\), and \(W(x)\), and we consider differentiating \(W(x)\) in first the \(Y(x)\) direction and then the \(Z(x)\) direction. What is the result? To begin, recall our more concise notation for derivatives, and remember that we can evaluate the first derivative in two different ways, \[\tag{1.31}\begin{aligned}D_Y W(x) = D_x W[Y(x)] = (\nabla W(x))Y(x) = \frac{d}{dt} W(x + tY(x))\Big|_{t=0}.\end{aligned}\]
Thus \[\tag{1.32}\begin{aligned}D_Z D_Y W(x) &= D_x(D_Y W)[Z(x)]\end{aligned}\] \[\tag{1.33}\begin{aligned}&= \frac{d}{dt}(D_Y W)(x + t Z(x))\Big|_{t=0}\end{aligned}\] \[\tag{1.34}\begin{aligned}&= \frac{d}{dt}\Big( \nabla W(x+tZ(x))\Big)(Y(x+t Z(x))\Big|_{t=0}.\end{aligned}\]
Be careful here and really think about this until it makes sense! Now let \[\tag{1.35}\begin{aligned}A(t) = \nabla W(x + t Z(x)) && b(t) = Y(x+tZ(x)),\end{aligned}\]
where \(A(t)\) is a matrix and \(b(t)\) is a vector, so our double derivative becomes by the product rule, \[\tag{1.36}\begin{aligned}D_Z D_Y W(x) &= \frac{d}{dt} \Big(A(t)b(t)\Big)\Big|_{t=0}\end{aligned}\] \[\tag{1.37}\begin{aligned}&= A^\prime(0) b(0) + A(t)b^{\prime}(0).\end{aligned}\]
Now on the one hand, \[\tag{1.38}\begin{aligned}A^\prime(0) &= \frac{d}{dt}\Big(\nabla W(x + t Z(x))\Big)\Big|_{t=0}= D_x(\nabla W)[Z(x)],\end{aligned}\]
and on the other hand, \[\tag{1.39}\begin{aligned}b^\prime(0) = \frac{d}{dt}\Big( Y(x+tZ(x))\Big)\Big|_{t=0} = D_x Y[Z(x)].\end{aligned}\]
We conclude that \[\tag{1.40}\begin{aligned}D_Z D_Y W(x) = D_x(\nabla W)[Z(x)] Y(x) + (\nabla W(x)) D_x Y[Z(x)].\end{aligned}\]
But the derivative of the gradient gives a second order derivative, \[\tag{1.41}\begin{aligned}D_x(\nabla W)[Z(x)] Y(x) &= D_x^2 W[Y(x), Z(x)]\end{aligned}\]
while acting with the Jacobian on a vector gives the first order derivative in the direction of that vector, \[\tag{1.42}\begin{aligned}(\nabla W) D_x Y[Z(x)] &= D_x W[D_x Y[Z(x)]].\end{aligned}\]
So putting it all together, we have \[\tag{1.43}\begin{aligned}D_Z D_Y W = D_x (D_x W[Y])[Z(x)] = D_x^2 W[Y(x), Z(x)] + D_x W[D_x Y[Z(x)]].\end{aligned}\]
Whew! What’s interesting here is that there is an asymmetry in \(Y\) and \(Z\) due to the second term. So what’s the difference between the two orderings? It’s \[\tag{1.44}\begin{aligned}D_Y D_Z W - D_Z D_Y W &= D_x W[D_x Z[Y(x)]] - D_x W[D_x Y[Z(x)]]\end{aligned}\] \[\tag{1.45}\begin{aligned}&=D_x W \Big[D_x Z[Y(x)] - D_x Y[Z(x) ]\Big].\end{aligned}\]
We define the Lie bracket between two vector fields to be precisely \[\tag{1.46}\begin{aligned}[Y,Z](x) = D_x Z[Y(x)]- D_x Y[Z(x)],\end{aligned}\]
the difference between differentiating \(Y\) in the \(Z\) direction and \(Z\) in the \(Y\) direction. We have therefore established that in flat space \[\tag{1.47}\begin{aligned}D_Y D_Z W - D_Z D_Y W = D_{[Y,Z]}W.\end{aligned}\]
What’s the meaning? The idea is: in flat space, at a point \(x\), if we look at the change along \(Y\) of the change along \(Z\) of \(W\), it’s the same as the change along \(Z\) of the change along \(Y\) of \(W\)—up to the fact that the change of \(Y\) along \(Z\) and the change of \(Z\) along \(Y\) might not be the same. In other words, after accounting for the fact that if we flow along \(Y\) and then \(Z\), it’s different from if we flow along \(Z\) than \(Y\), the second order changes are the same.
Higher order
In the same way, we can consider directional derivatives to arbitrarily high order. The ones we have just considered give us the first few terms of the multivariate Tayor series of \(f(x)\) around \(a\), \[\tag{1.48}\begin{aligned}f(x) = f(a) + \nabla f(a)^T(x-a) + \frac{1}{2}(x-a)^T \nabla^2 f(a) (x-a) + \dots,\end{aligned}\]
so that more generally, \[\tag{1.49}\begin{aligned}f(x) = \sum_{n} \frac{1}{n!} D_a^n f [x-a, \dots, x-a].\end{aligned}\]
Smooth curves
Let \(x(t): \mathbb{R} \rightarrow \mathbb{R}^n\) be a smooth curve. We want to consider a function \(f(x): \mathbb{R}^n \rightarrow \mathbb{R}\) along this curve. And so we must contemplate \(g(t) = f(x(t))\). We wish to evaluate its derivatives, so we’ll have to use the chain rule. \[\tag{1.50}\begin{aligned}\frac{d}{dt} f(x(t)) = \sum_i \frac{\partial f(x(t))}{\partial x_i(t)} \frac{d x_i(t)}{dt} = D_{x(t)}f[x^\prime(t)].\end{aligned}\]
In other words, we have to consider the directional derivative in the direction of the curve’s instantaneous velocity. Here’s a nice application. Let \(A(x)\) be a matrix valued field, and \(b(x)\) be a vector valued field. We want to calculate \(D_x Ab [y]\). Let \(x(t)\) be a smooth curve such that \(x(0)=x\) and \(x^\prime(0)=y\). Then \[\tag{1.51}\begin{aligned}D_x Ab [y] &= \frac{d}{dt} A(x(t))b(x(t))\Big|_{t=0}\end{aligned}\] \[\tag{1.52}\begin{aligned}&= \left( \frac{d}{dt} A(x(t)) \right) b(x(t)) + A(x(t))\frac{d}{dt}b(x(t)) \Big|_{t=0}\end{aligned}\] \[\tag{1.53}\begin{aligned}&=\left( D_{x(t)} A[x^\prime(t)] b(x(t)) + A(x(t))D_{x(t)}b[x^{\prime}(t)]\right)_{t=0}\end{aligned}\] \[\tag{1.54}\begin{aligned}&= D_{x} A[y] b(x) + A(x)D_{x}b[y],\end{aligned}\]
which reminds us how the chain rule respects the direction we are evaluating the derivative in.
What about the second derivative? It gets a little complicated: we have to use the chain rule and the product rule. \[\tag{1.55}\begin{aligned}\frac{d^2}{dt^2} f(x(t)) &= \frac{d}{dt} D_{x(t)}f[x^\prime(t)]\end{aligned}\] \[\tag{1.56}\begin{aligned}&=\frac{d}{dt}\sum_i \frac{\partial f(x(t))}{\partial x_i(t)} \frac{d x_i(t)}{dt}\end{aligned}\] \[\tag{1.57}\begin{aligned}&= \sum_i \left\{\frac{d}{dt}\Big[\frac{\partial f(x(t))}{\partial x_i(t)}\Big] \frac{d x_i(t)}{dt} + \frac{\partial f(x(t))}{\partial x_i(t)} \frac{d^2 x_i(t)}{dt^2}\right\}\end{aligned}\] \[\tag{1.58}\begin{aligned}&= \sum_{ij} \frac{\partial^2 f(x(t))}{\partial x_i(t)\partial x_j(t)} \frac{dx_j(t)}{dt} \frac{d x_i(t)}{dt} + \sum_i \frac{\partial f(x(t))}{\partial x_i(t)} \frac{d^2 x_i(t)}{dt^2}\end{aligned}\] \[\tag{1.59}\begin{aligned}&= D^2_{x(t)}f[x^\prime(t), x^\prime(t)] + D_{x(t)}f[x^{\prime \prime}(t)],\end{aligned}\]
where we note that at a critical point of \(f\), the second term vanishes.
2. Manifolds
We now wish to consider functions on a manifold \(\mathcal{M}\) defined by a set of constraints. Let \[\tag{2.1}\begin{aligned}\mathcal{M} = \{x \in \mathbb{R}^n: c_1(x) = \dots = c_m(x) = 0\}:\end{aligned}\]
in other words, the manifold consists of all the points at which the constraint functions \(\{c_i(x)\}_{i=1}^m\) vanish. We assume without loss of generality that the gradients of the constraints are linearly independent at each point on the manifold. This will become important: and in any case, we do not lose any generality since we can always reformulate the constraints until this condition is satisfied. The tangent space at \(x\) on \(\mathcal{M}\) is \[\tag{2.2}\begin{aligned}T_x \mathcal{M} = \{v: D_x c_i[v] = 0, i= 1,\dots, m\}.\end{aligned}\]
In other words, it consists of all directions at \(x\) such that the constraint functions don’t change if we take a little step. This makes sense: if the manifold is defined as the set of points for which all the constraint functions vanish, then moving a little bit in any direction on the manifold from \(x\) shouldn’t change any of the values of the constraint functions. .
First order
Let \(f: \mathcal{M}\rightarrow \mathbb{R}\) be a function defined on the manifold. We want to take its directional derivatives on the manifold itself. For any tangent vector \(v \in T_x \mathcal{M}\), the directional derivative is just \[\tag{2.3}\begin{aligned}\mathcal{D}_x f[y] = \langle \nabla f(x), y\rangle \text{ where } y \in T_x \mathcal{M}.\end{aligned}\]
Here we use \(\mathcal{D}\) to denote manifold derivatives. In other words, the manifold is just the usual directional derivative, but we restrict ourselves to vectors in the tangent space at \(x\). Equivalently, we can project the gradient onto the tangent space, \(\nabla_{\mathcal{M}} f(x) = \Pi_x \nabla f(x)\) where \(\Pi_x\) is the orthogonal projector onto \(T_x \mathcal{M}\). Then for all \(y\), the covariant derivative is \[\tag{2.4}\begin{aligned}\mathcal{D}_x f [y] = \langle \Pi_x \nabla f(x), y\rangle = \langle \nabla_{\mathcal{M}} f(x), y\rangle.\end{aligned}\]
How do we get this projector? Let \(J(x)\) be the \(m \times n\) Jacobian matrix of the constraint functions, \[\tag{2.5}\begin{aligned}J(x) = \begin{pmatrix} \nabla c_1(x)^T \\ \vdots \\ \nabla c_m(x)^T \end{pmatrix}.\end{aligned}\]
Then \[\tag{2.6}\begin{aligned}\Pi_x = I - J(x)^T(J(x) J(x)^T)^{-1} J(x).\end{aligned}\]
Why? Since the gradients of the constraints are assumed linearly independent, the rows of \(J(x)\) are linearly independent, and so \(J(x)\) has full row rank. And indeed, \(G(x)=J(x)J(x)^T\), the Gram matrix of the constraint gradients, will be \(m \times m\) and invertible. In this case, the Moore-Penrose pseudoinverse can therefore be expressed \(J(x)^+ = J(x)^T G(x)^{-1}\). In general, \(J^+ J\) is an orthogonal projector onto the row space of \(J\), and so \(I- J^+ J\) is a projector onto the nullspace of \(J\). This is exactly what we want \(\Pi_x\) to do: any \(v\) in the nullspace of \(J(x)\) will satisfy \(\forall c_i: D_x c_i[v]=0\). Moreover, \(I-\Pi_x\) projects on the subspace normal to the manifold at \(x\). Indeed, any vector normal to the manifold can be expressed as a linear combination of the constraint gradients: this will be very useful later.
Example: Consider the sphere \(\mathcal{S}= \{x \in \mathbb{R}^n: \langle x,x\rangle = 1\}\). There is a single constraint function \(c(x) = \langle x, x\rangle -1\). As we have seen, its gradient is \(\nabla c(x) = 2x\). Thus the tangent space is \(T_x \mathcal{S} = \{ v: \langle x, v\rangle = 0 \}\), and \(J(x) = 2x^T\) so that \[\tag{2.7}\begin{aligned}\Pi_x = I - (2x)(2x^T 2x)^{-1} 2x^T = I - xx^T/x^Tx = I -xx^T,\end{aligned}\]
since \(x^T x = 1\) on the sphere. Thus \[\tag{2.8}\begin{aligned}\nabla_\mathcal{S} f(x) = (I-xx^T)\nabla f(x) = \nabla f(x) - \langle \nabla f(x), x\rangle x:\end{aligned}\]
the second term removes the component of the gradient pointing normal to the sphere, and \[\tag{2.9}\begin{aligned}\mathcal{D}_x f[y] &= \langle \nabla f(x), y\rangle - \langle \nabla f(x), x\rangle \langle x, y\rangle\end{aligned}\] \[\tag{2.10}\begin{aligned}&= D_x f[y] - D_x f[x] \langle x, y\rangle.\end{aligned}\]
When we consider constraining ourselves to a manifold, there is some potential difficulty with our previous relation \[\tag{2.11}\begin{aligned}D_x f[y] &= \frac{d}{dt}f(x+ry)\Big|_{r=0},\end{aligned}\]
since \(x+ry\) need not lie in \(\mathcal{M}\). More generally, it is better to think of a smooth curve \(x(t)\) lying entirely in \(\mathcal{M}\) such that \(x(0) = x\) and \(x^\prime(0) = y\). Then the directional derivative along the manifold is \[\tag{2.12}\begin{aligned}D^{\mathcal{M}}_x f[y] &= \frac{d}{dt}f(x(t))\Big|_{t=0}\end{aligned}\] \[\tag{2.13}\begin{aligned}&= \left\{\sum_i \frac{\partial f(x(t))}{\partial x_i(t)} \frac{\partial x_i(t)}{dt} \right\}_{t=0}\end{aligned}\] \[\tag{2.14}\begin{aligned}&= \langle \nabla f(x(0)), x^\prime(0)\rangle\end{aligned}\] \[\tag{2.15}\begin{aligned}&= \langle \nabla f(x), y\rangle.\end{aligned}\]
We can always decompose the gradient into its tangent and normal components, \[\tag{2.16}\begin{aligned}\nabla f(x) = \Pi_x \nabla f(x) + (I-\Pi_x) \nabla f(x).\end{aligned}\]
By assumption \(y\) is tangent to the manifold and so orthogonal to the normal component, and so \[\tag{2.17}\begin{aligned}\mathcal{D}_x f[y] = \langle \Pi_x \nabla f(x), v\rangle = \langle \nabla_{\mathcal{M}} f(x), y\rangle,\end{aligned}\]
which reassures us that our original formula is fine: in fact, the problems come when we hit the second derivative. Finally, the same definition works for a vector valued funtion \(V(x)\), \[\tag{2.18}\begin{aligned}\mathcal{D}_x V[y] = \nabla_{\mathcal{M}} V(x) y = \Pi_x \nabla V(x) y,\end{aligned}\]
where \(\nabla V(x)\) is the Jacobian.
Second order
For a scalar function, the second order covariant directional derivative on the manifold is \[\tag{2.19}\begin{aligned}\mathcal{D}^2_x f[y,z] &= \langle \mathcal{D}_x(\nabla_{\mathcal{M}} f)[y], z\rangle\end{aligned}\] \[\tag{2.20}\begin{aligned}&= \langle \Pi_x D_x(\nabla_\mathcal{M} f)[y], z\rangle\end{aligned}\] \[\tag{2.21}\begin{aligned}&= \langle D_x(\Pi_x \nabla f)[y], z\rangle,\end{aligned}\]
where we note that \(D_x(\nabla_{\mathcal{M}}f)[y]\) is the directional derivative of the vector field \(\nabla_{\mathcal{M}}f\) and so is itself a vector, and in the last we drop the leftmost projector since by assumption \(z\in T_x \mathcal{M}\). We can massage our expression a little more, however. Using the product rule, \[\tag{2.22}\begin{aligned}D_x(\Pi_x \nabla f)[y] = \Pi_x D_x(\nabla f)[y] + D_x \Pi_x[y]\nabla f(x),\end{aligned}\]
and since \(D^2_x f[y,z] =\langle D_x (\nabla f)[y], z\rangle\), we have \[\tag{2.23}\begin{aligned}\mathcal{D}^2_x f[y,z] &= D_x^2 f[y,z] + \langle D_x \Pi_x[y] \nabla f(x) ,z\rangle,\end{aligned}\]
which shows that the covariant second directional derivative is just the flat space derivative, plus a manifold-related correction. Don’t let the derivative of the matrix scare you: just treat it componentwise. And in any case, we’ll have more to say about such things momentarily: even nicer ways to express \(\mathcal{D}_x^2\) are on the way.
Now we can now appreciate a fact we mentioned before. In flat space \(\nabla D_x f[y] = D_x \nabla f[y]\). But on a manifold, on the one hand, \[\tag{2.24}\begin{aligned}\mathcal{D}_x \nabla_{\mathcal{M}} f[y] = \Pi_x \nabla(\Pi_x \nabla f(x))y,\end{aligned}\]
where clearly we need to use the chain rule since both the projector and the gradient depend on \(x\). Whereas \[\tag{2.25}\begin{aligned}\nabla_{\mathcal{M}} \mathcal{D}_x f[y] = \Pi_x \nabla\langle \Pi_x \nabla f(x), y\rangle = \Pi_x \nabla \langle \nabla f(x), y\rangle = \Pi_x \nabla^2 f(x)y = \Pi_x D^2_x f[y],\end{aligned}\]
is just the flat space second order derivative projected onto the tangent space.
Smooth curves, again
We can relate this to our smooth curve construction. Earlier we showed that \[\tag{2.26}\begin{aligned}\frac{d^2}{dt^2} f(x(t)) &= D^2_{x(t)}f[x^\prime(t), x^\prime(t)] + D_{x(t)}f[x^{\prime \prime}(t)].\end{aligned}\]
Let us now assume that \(x(t)\) lies entirely in \(\mathcal{M}\) with \(x(0)=x\) and \(x^\prime(0)=y\) so \[\tag{2.27}\begin{aligned}\frac{d^2}{dt^2} f(x(t))\Big|_{t=0} &= D^2_{x}f[y,y] + D_{x}f[x^{\prime \prime}(0)].\end{aligned}\]
We haven’t taken advantage of the fact that \(x(t)\) is on the manifold yet. But let’s play with the second term. Decomposing the acceration into tangential and normal coordinates, \[\tag{2.28}\begin{aligned}x^{\prime \prime}(0) = \Pi_x x^{\prime \prime}(0) + (I - \Pi_x)x^{\prime \prime}(0),\end{aligned}\]
we have \[\tag{2.29}\begin{aligned}D_{x}f[x^{\prime \prime}(0)] = \langle \nabla f(x), \Pi_x x^{\prime \prime}(0)\rangle + \langle \nabla f(x), (I-\Pi_x)x^{\prime \prime}(0)\rangle.\end{aligned}\]
The first term here is just \(\langle \nabla f(x), \Pi_x x^{\prime \prime}(0)\rangle = \langle \nabla_{\mathcal{M}} f(x), x^{\prime \prime}(0)\rangle\). We can understand the second term by noting that since \(x^{\prime}(t)\) is tangent by definition, \(\Pi_{x(t)} x^\prime(t) = x^{\prime}(t)\). Differentiating gives \[\tag{2.30}\begin{aligned}\left(\frac{d}{dt} \Pi_{x(t)}\right) x^{\prime}(t) + \Pi_{x(t)} x^{\prime \prime}(t) = x^{\prime \prime}(t),\end{aligned}\]
or \[\tag{2.31}\begin{aligned}(I-\Pi_{x(t)})x^{\prime \prime}(t) = \left(\frac{d}{dt} \Pi_{x(t)}\right) x^{\prime}(t).\end{aligned}\]
Now for the derivative of a matrix, denoting the components \(\{\Pi_{x(t)}\}_{jk}\), \[\tag{2.32}\begin{aligned}\frac{d}{dt} \Pi_{x(t)} &= \sum_i \frac{\partial \Pi_{x(t)}}{\partial x_i(t)} \frac{dx_i(t)}{dt}\end{aligned}\] \[\tag{2.33}\begin{aligned}&= \sum_i \frac{\partial}{\partial x_i}\left\{ \sum_{jk} \langle j|\Pi_{x(t)}|k\rangle \ |j\rangle\langle k| \right\} x_i^\prime(t)\end{aligned}\] \[\tag{2.34}\begin{aligned}&= \sum_{jk} \langle \nabla \{\Pi_{x(t)}\}_{jk}, x^{\prime}(t)\rangle \ |j\rangle\langle k|\end{aligned}\] \[\tag{2.35}\begin{aligned}&= \sum_{jk} D_{x(t)} \{\Pi_{x(t)}\}_{jk} [x^{\prime}(t)] \ |j\rangle\langle k|\end{aligned}\] \[\tag{2.36}\begin{aligned}&= D_{x(t)}\Pi_{x(t)}[x^\prime (t)],\end{aligned}\]
which is itself a matrix. So \[\tag{2.37}\begin{aligned}(I - \Pi_{x(t)})x^{\prime\prime}(t) = D_{x(t)}\Pi_{x(t)}[x^\prime (t)] x^\prime(t),\end{aligned}\]
which at \(t=0\) yields \[\tag{2.38}\begin{aligned}(I - \Pi_{x})x^{\prime\prime}(0) = D_{x}\Pi_{x}[y] y.\end{aligned}\]
Now we can simplify Eq. (2.29) to \[\tag{2.39}\begin{aligned}D_{x}f[x^{\prime \prime}(0)] &= \langle \nabla_{\mathcal{M}} f(x), x^{\prime \prime}(0)\rangle + \langle \nabla f(x), D_{x}\Pi_{x}[y] y\rangle\end{aligned}\] \[\tag{2.40}\begin{aligned}&= \langle \nabla_{\mathcal{M}} f(x), x^{\prime \prime}(0)\rangle + \langle D_{x}\Pi_{x}[y] \nabla f(x), y\rangle,\end{aligned}\]
where we’ve used the fact that since \(\Pi_x\) is symmetric, so will be \(D_x \Pi_{x}[y]\). Finally getting back to our original expression, \[\tag{2.41}\begin{aligned}\frac{d^2}{dt^2} f(x(t))\Big|_{t=0} &= D^2_{x}f[y,y] + D_{x}f[x^{\prime \prime}(0)]\end{aligned}\] \[\tag{2.42}\begin{aligned}&=D^2_{x}f[y,y] + \langle \nabla_{\mathcal{M}} f(x), x^{\prime \prime}(0)\rangle + \langle (D_{x}\Pi_{x}[y]) \nabla f(x), y\rangle.\end{aligned}\]
But we had for the covariant second order directional derivative, \[\tag{2.43}\begin{aligned}\mathcal{D}^2_x f[y,z] &= D_x^2 f[y,z] + \langle (D_x \Pi_x[y] ) \nabla f(x) ,z\rangle,\end{aligned}\]
from whcih we conclude \[\tag{2.44}\begin{aligned}\frac{d^2}{dt^2} f(x(t))\Big|_{t=0} &= \mathcal{D}_x^2 f[y,y] + \langle \nabla_{\mathcal{M}} f(x), x^{\prime \prime}(0)\rangle.\end{aligned}\]
We recover the covariant second derivative plus a correction due to the acceleration of the curve. By definition, a geodesic is a curve whose acceleration has no tangent component \(\Pi_{x(t)}x^{\prime \prime}(t) = 0\), so the second term vanishes. From this we learn that the covariant second order directional derivative (with equal arguments) tells us the second-order rate of change of \(f\) along any geodesic. Moreover, if \(x\) is a critical point of \(f\) on \(\mathcal{M}\), then \(\nabla_{\mathcal{M}} f(x) = 0\) and so the second term vanishes again. The interpretation: any smooth curve with initial velocity \(y\) gives the correct second order covariant directional derivative at a critical point. Finally, to recover the full derivative (without repeated arguments), we can use the polarization identity, \[\tag{2.45}\begin{aligned}\mathcal{D}^2_x f[y,z] = \frac{1}{2}\Big\{ \mathcal{D}^2_x f[y+z,y+z] - \mathcal{D}^2_x f[y,y] - \mathcal{D}^2_x f[z,z]\Big\}.\end{aligned}\]
The constraint formulation
We suppose our manifold is defined by constraint functions with linearly independent gradients, \[\tag{2.46}\begin{aligned}\mathcal{M} = \{x \in \mathbb{R}^n: c_1(x) = \dots = c_m(x) = 0\}.\end{aligned}\]
The tangent space at \(x\) on \(\mathcal{M}\) is \[\tag{2.47}\begin{aligned}T_x \mathcal{M} = \{v: D_x c_i[v] = 0, i= 1,\dots, m\}.\end{aligned}\]
By construction, the gradients \(\nabla c_i\) are normal to the manifold, and any vector in the normal space can be written as a linear combination of them. Now obviously \(\nabla_{\mathcal{M}} f(x) = \Pi_x \nabla f(x)\) is entirely tangent to the manifold. Thus we can always write for the flat space gradient, \[\tag{2.48}\begin{aligned}\nabla f(x) = \nabla_{\mathcal{M}} f(x) + \sum_{i=1}^m \lambda_i (x) \nabla c_i(x),\end{aligned}\]
for some set of functions \(\{\lambda_i(x)\}\). In fact, we can calculate them directly. Again, let \(J(x)\) be the Jacobian matrix of the constraint functions. Since the rows of \(J(x)\) are \(\nabla c_i(x)^T\), it follows that \(J(x) \nabla_{\mathcal{M}} f(x) = 0\), and so \[\tag{2.49}\begin{aligned}J(x) \nabla f(x) = J(x)J(x)^T \lambda(x).\end{aligned}\]
As we’ve noted \(G(x) =J(x)J(x)^T\) will be invertible by the linear independence of the gradients, and so \[\tag{2.50}\begin{aligned}\lambda(x) = G(x)^{-1} J(x)\nabla f(x).\end{aligned}\]
In fact, we can use this to get a nice expression for the covariant second order directional derivative, \[\tag{2.51}\begin{aligned}\mathcal{D}^2_x f[y,z] &= D_x^2 f[y,z] + \langle D_x \Pi_x[y] \nabla f(x) ,z\rangle.\end{aligned}\]
Using \(\nabla f(x) = \nabla_{\mathcal{M}} f(x) + \sum_{i=1}^m \lambda_i (x) \nabla c_i(x)\), this becomes \[\tag{2.52}\begin{aligned}\mathcal{D}^2_x f[y,z] &= D_x^2 f[y,z] + \langle D_x \Pi_x[y] \nabla_{\mathcal{M}} f(x), z\rangle + \sum_{i=1}^m \lambda_i (x) \langle D_x \Pi_x[y] \nabla c_i(x), z\rangle.\end{aligned}\]
Consider the second term. Writing it as \(\langle \Pi_x (D_x \Pi_x[y]) \Pi_x \nabla f(x), z\rangle\) (which we can do since \(z\) is in the tangent space), and noticing that differentiating \(\Pi_x^2 = \Pi_x\) gives \[\tag{2.53}\begin{aligned}&D_x \Pi_x [y] \Pi_x + \Pi_x D_x \Pi_x [y] = D_x \Pi_x [y]\end{aligned}\] \[\tag{2.54}\begin{aligned}\Longrightarrow &\Pi_x D_x \Pi_x [y] \Pi_x + \Pi_x D_x \Pi_x [y] \Pi_x = \Pi_x D_x \Pi_x [y] \Pi_x\end{aligned}\] \[\tag{2.55}\begin{aligned}\Longrightarrow &\Pi_x D_x \Pi_x [y]\Pi_x = 0,\end{aligned}\]
which shows that the term is zero. Meanwhile, for the last term, we note that since the constraint gradients are normal to the tangent space \(\Pi_x \nabla c_i(x) = 0\). Taking the derivative of this latter expression, \[\tag{2.56}\begin{aligned}D_x(\Pi_x \nabla c_i(x))[y] = D_x \Pi_x [y] \nabla c_i(x) + \Pi_x D_x(\nabla c_i(x)) = 0,\end{aligned}\]
so that for \(z \in T_x \mathcal{M}\), \[\tag{2.57}\begin{aligned}\langle D_x \Pi_x [y] \nabla c_i(x), z \rangle = - \langle \Pi_x D_x(\nabla c_i(x)), z \rangle = - D^2_x c_i [y,z].\end{aligned}\]
Putting it all together, \[\tag{2.58}\begin{aligned}\mathcal{D}^2_x f[y,z] &= D_x^2 f[y,z] - \sum_{i=1}^m \lambda_i (x) D_x^2 c_i[y,z],\end{aligned}\]
which allows us to calculate the Riemannian Hessian directly in terms of the constraint functions!
Finally, we note that at a critical point of \(f\) on \(\mathcal{M}\), \(\nabla_{\mathcal{M}} f(x) = 0\), and so \[\tag{2.59}\begin{aligned}\nabla f = \sum_{i=1}^m \lambda_i(x) \nabla c_i(x),\end{aligned}\]
which is the usual Lagrange multiplier condition for constrained optimization: the gradient of \(f\) must be normal to the manifold, since if it were not, one could move along the manifold to find a more optimal point. Since the term involving \(\nabla_{\mathcal{M}}\) drops out anyway, the formula for the covariant second order derivative remains unchanged.
Example: Let \(u=(1,1\dots,1)\). We want to extremize \(f(x)= u^Tx\) subject to the constraint \(c(x) = x^Tx - 1\). In other words, we want to maximize the sum of the components of \(x\) on a manifold: a sphere of radius 1. We have \(\nabla f(x) = u\) and \(\nabla c(x) = 2x\). Thus a critical point must satisfy \(\nabla f(x) = \sum_{i=1}^m \lambda_i(x) \nabla c_i(x)\), or \[\tag{2.60}\begin{aligned}u = 2\lambda x \Longrightarrow x = u/(2\lambda).\end{aligned}\]
Since \(x^T x = 1\) on the sphere, we have \(u^Tu/(4\lambda^2) = n/(4\lambda^2) = 1\), so that \(\lambda = \pm \sqrt{n}/2\) and \(x = u/\sqrt{n}\). Nice! More generally, we can find \(\lambda(x)\) at any point. Since in this case \(J(x) = \nabla c_i(x)^T = 2x^T\), we have \[\tag{2.61}\begin{aligned}\lambda(x) = ((J(x)J(x))^T)^{-1} J(x) \nabla f(x) = (2x^T 2x)^{-1} 2x^T u = \frac{x^T u}{2x^Tx} = \frac{1}{2}x^T u.\end{aligned}\]
Now on the one hand, we have \[\tag{2.62}\begin{aligned}D_x f[y] &= \langle \nabla f(x), y\rangle = u^T y && D^2_x f[y,z] = 0,\end{aligned}\]
where the last follows from the fact that \(\nabla f(x) = u\) is a constant, and so \(\nabla^2 f(x) = 0\). Thus from looking at the flat space second order derivative we can’t tell whether we have a maximum, a minimum, etc. But let’s look at the covariant version. We need \[\tag{2.63}\begin{aligned}D_x c[y] &= 2x^T y && D^2_x c[y,z] = 2 y^T z,\end{aligned}\]
where we used our result from earlier that in this case \(\nabla^2 c(x) =2I\). The Riemannian Hessian at our critical point can then be read off from the second order directional derivative on the manifold, \[\tag{2.64}\begin{aligned}\mathcal{D}_x^2 f[y,z] = D_x^2 f[y,z] - \lambda(x)D_x^2 c[y,z] = - (\pm \sqrt{n}/2)2 y^T z,\end{aligned}\]
so that the Riemannian Hessian \(\nabla^2_{\mathcal{S}} f(x_{\text{extrema}}) = \mp \sqrt{n} I\). At \(x=u/\sqrt{n}\), this is negative definite, and so we have a maximum; at \(x = -u/\sqrt{n}\), this is positive definite, and so we have a minimum.
3. The Riemannian curvature tensor
Let’s consider again a manifold as a subset of \(\mathbb{R}^n\) defined by a set of constraints. For such a manifold embedded in Euclidean space we can consider its induced metric, the metric inherited from flat space, and calculate the entire Riemannian curvature tensor from just the first and second derivatives of the constraints. Lest you wonder about the generality of this, by the Nash embedding theorem, every Riemannian manifold can be realized as a submanifold of \(\mathbb{R}^n\) in such a way that its Riemannian metric is exactly the induced metric.
Since we are using the metric inherited from \(\mathbb{R}^n\), the metric is technically just \(g_x =I\). But the metric takes as inputs tangent vectors: to impose that explicitly, we will define the metric, or the first fundamental form, as \[\tag{3.1}\begin{aligned}\mathscr{F}^1_x(y,z) = \langle y, \Pi_x z\rangle.\end{aligned}\]
We’ve already developed the idea that for a tangent vector field \(V(x) \in T_x \mathcal{M}\), the covariant derivative is \(\mathcal{D}_x V[y] = \Pi_x D_x V[g]\). Moreover, we can decompose the ordinary directional derviative into tangent and normal components, \[\tag{3.2}\begin{aligned}D_x V[y] = \Pi_x D_x V[g] + (I-\Pi_x)D_x V[y] = \mathcal{D}_x V[y] + (I-\Pi)D_x V[y] .\end{aligned}\]
The second fundamental form is the normal component of the derivative of a tangent vector field, \[\tag{3.3}\begin{aligned}\mathscr{F}^{2}_x(y,z) = (I- \Pi_x)D_x V[y] && V(x)=z,\end{aligned}\]
where \(V(x)\) is any smooth tangent field agreeing with \(z\) at \(x\). We can massage this a bit. Since \(V(x)\) is a tangent vector field \(J(x) V(x) = 0\) as the rows of \(J(x)\) span the normal space. Differentiating this relationship gives \[\tag{3.4}\begin{aligned}D_x J V [y] = D_x J[y] V(x) + J(x) D_x V [y] = 0.\end{aligned}\]
Now let \[\tag{3.5}\begin{aligned}C^2_x[y,z] = \begin{pmatrix} D_x^2 c_1[y,z] \\ \vdots \\ D_x^2 c_m[y,z]\end{pmatrix} = D_x J[y] z = D_x J[y] V(x) = -J(x) D_x V [y],\end{aligned}\]
where we’ve used the fact that \(V(x)=z\) and the previous relation. Since the tangent projector is \(\Pi_x = I - J(x)^T G(x)^{-1}J(x)\) where \(G(x) = J(x) J(x)^T\), the projector onto the normal space can be expressed \(I - \Pi_x = J(x)^T G(x)^{-1} J(x)\). We conclude \[\tag{3.6}\begin{aligned}\mathscr{F}^{2}_x(y,z) = J(x)^T G(x)^{-1} J(x) D_x V[g] = -J(x)^T G(x)^{-1} C^2_x[y,z].\end{aligned}\]
The second fundamental form measures the extrinsic curvature of the manifold: it tells us how much a tangent vector turns out of the tangent space as we move along the manifold. For example, take a smooth curve on \(\mathcal{M}\) and let \(x(0)=x\), \(x^\prime(0)=y\), and \(x^{\prime \prime}(0)=a\). Moreover, let \(V\) be any smooth tangent field \(V\) such that \(V(x(t)) = x^\prime(t)\). On the one hand, \[\tag{3.7}\begin{aligned}\frac{d}{dt} V(x(t)) = \sum_i \frac{\partial V(x(t))}{\partial x_i(t)} \frac{d x_i(t)}{dt} = \nabla V(x(t)) x^\prime(t) = D_{x(t)}V[x^\prime(t)].\end{aligned}\]
On the other hand, by assumption \(V(x(t)) = x^\prime(t)\) so \(\frac{d}{dt} V(x(t)) = x^{\prime \prime}(t)\). Thus \(D_{x(t)}V[x^\prime(t)] = x^{\prime \prime}(t)\), and so at \(t=0\), \[\tag{3.8}\begin{aligned}\mathscr{F}^{2}_x(y,y) = (I- \Pi_x)a:\end{aligned}\]
the second fundamental form tells us the normal acceleration required at \(x\) to follow the manifold, given an initial velocity \(y\).
Meanwhile, the Riemann curvature tensor measures the intrinsic curvature of the manifold—and we can calculate it! Recall the relation we derived for flat space, \[\tag{3.9}\begin{aligned}D_Y D_Z W - D_Y D_Z W - D_{[Y,Z]}W = 0,\end{aligned}\]
where \(Y(x), Z(x), W(x)\) are smooth vector fields \([Y,Z](x)\) denotes the Lie bracket. The Riemann curvature tensor encodes precisely the degree to which this flat space identity is violated, \[\tag{3.10}\begin{aligned}R(Y,Z)W = \mathcal{D}_Y \mathcal{D}_Z W - \mathcal{D}_Z \mathcal{D}_Y W - \mathcal{D}_{[Y,Z]} W.\end{aligned}\]
We’ll see how by relating covariant derivatives to the usual derivatives, we can substitute into the flat space identity to obtain the curvature tensor. The failure of covariant derivatives to commute, after taking account their Lie backet, signifies the curvature of the manifold on which these vector fields are defined.
To begin, we’ve seen how the ordinary derivative of a tangent vector field separates into tangent and normal components, and that we can write this using the second fundamental form, \[\tag{3.11}\begin{aligned}D_Z W = \mathcal{D}_Z W+ \mathscr{F}^{2}(Z,W).\end{aligned}\]
First, let’s differentiate this along \(Y\), \[\tag{3.12}\begin{aligned}D_Y D_Z W = D_Y \mathcal{D}_Z W + D_Y \mathscr{F}^{2}(Z,W).\end{aligned}\]
Now if we take an inner product with another smooth tangent vector field \(V(x)\), we have \[\tag{3.13}\begin{aligned}\langle D_Y D_Z W, V\rangle =\langle D_Y \mathcal{D}_Z W, V\rangle + \langle D_Y \mathscr{F}^{2}(Z,W), V\rangle.\end{aligned}\]
Consider the first term: since \(V\) is in the tangent space, we can pop in a projector, turning the flat space derivative into a covariant derivative, \(\langle \mathcal{D}_Y \mathcal{D}_Z W, V\rangle\). Now consider the second term. We have a useful identity. Let \(N(x)\) be any normal vector field and let \(V(x)\) be any tangent vector field. By construction, \(\langle N(x), V(x)\rangle = 0\), and if we differentiate this in the \(Y\) direction, we get \[\tag{3.14}\begin{aligned}\langle D_Y N, V\rangle + \langle N, D_Y V \rangle = 0\end{aligned}\]
But since \(N\) is normal, we can pop in the projector onto the normal component in the second term: but \((I-\Pi_x)D_Y V = \mathscr{F}^{2}(Y, V)\) from which we conclude \[\tag{3.15}\begin{aligned}\langle D_Y N, V\rangle = - \langle N, \mathscr{F}^{2}(Y, V)\rangle.\end{aligned}\]
In particular, \(\mathscr{F}^{2}(Z,W)\) itself is a normal vector field, and so \[\tag{3.16}\begin{aligned}\langle D_Y \mathscr{F}^{2}(Z,W), V\rangle = - \langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle.\end{aligned}\]
We can thus rewrite Eq. (3.13) as \[\tag{3.17}\begin{aligned}\langle D_Y D_Z W, V\rangle =\langle \mathcal{D}_Y \mathcal{D}_Z W, V\rangle - \langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle,\end{aligned}\]
and similarly, interchanging \(Y\) and \(Z\), \[\tag{3.18}\begin{aligned}\langle D_Z D_Y W, V\rangle =\langle \mathcal{D}_Z \mathcal{D}_Y W, V\rangle - \langle \mathscr{F}^{2}(Y,W), \mathscr{F}^{2}(Z, V)\rangle,\end{aligned}\]
Finally, notice that if we separate \([Y,Z](x)\) into tangential and normal components, we get \[\tag{3.19}\begin{aligned}D_{[Y,Z]} W = \mathcal{D}_{[Y,Z]}W + \mathscr{F}^{2}([Y,Z], W),\end{aligned}\]
so that taking an inner product with a tangent field \(V\), \[\tag{3.20}\begin{aligned}\langle D_{[Y,Z]} W, V \rangle = \langle \mathcal{D}_{[Y,Z]}W, V\rangle + \langle \mathscr{F}^{2}([Y,Z], W), V\rangle.\end{aligned}\]
But remember that \(\mathscr{F}^{2}([Y,Z], W)\) is normal to the manifold! So we get simply \[\tag{3.21}\begin{aligned}\langle D_{[Y,Z]} W, V \rangle = \langle \mathcal{D}_{[Y,Z]}W, V\rangle.\end{aligned}\]
With all this in hand, we’re ready to subtitute into the flat space identity, \[\tag{3.22}\begin{aligned}\langle D_Y D_Z W, V\rangle - \langle D_Z D_Y W, V\rangle - \langle D_{[Y,Z]}W, V\rangle = 0,\end{aligned}\]
which gives \[\tag{3.23}\begin{aligned}\langle \mathcal{D}_Y \mathcal{D}_Z W, V\rangle - \langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle - \langle \mathcal{D}_Z \mathcal{D}_Y W, V\rangle + \langle \mathscr{F}^{2}(Y,W), \mathscr{F}^{2}(Z, V)\rangle - \langle \mathcal{D}_{[Y,Z]}W, V\rangle = 0.\end{aligned}\]
Rearranging this as \[\tag{3.24}\begin{aligned}\langle \mathcal{D}_Y \mathcal{D}_Z W - \mathcal{D}_Z \mathcal{D}_Y W - \mathcal{D}_{[Y,Z]}W, V\rangle = \langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle - \langle \mathscr{F}^{2}(Y,W), \mathscr{F}^{2}(Z, V)\rangle,\end{aligned}\]
we conclude that the Riemann curvature tensor is \[\tag{3.25}\begin{aligned}\langle R(Y,Z)W, V\rangle = \langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle - \langle \mathscr{F}^{2}(Y,W), \mathscr{F}^{2}(Z, V)\rangle.\end{aligned}\]
But earlier we derived that \[\tag{3.26}\begin{aligned}\mathscr{F}^{2}_x(y,z) = -J(x)^T G(x)^{-1} C^2_x[y,z],\end{aligned}\]
so that for example, \[\tag{3.27}\begin{aligned}\langle \mathscr{F}^{2}(Z,W), \mathscr{F}^{2}(Y, V)\rangle & = \Big\{- C^2_x[z,w] G(x)^{-1} J(x) \Big\}\Big\{-J(x)^T G(x)^{-1} C^2_x[y,v]\Big\}\end{aligned}\] \[\tag{3.28}\begin{aligned}&= C^2_x[z,w] G(x)^{-1} C^2_x[y,v].\end{aligned}\]
We conclude \[\tag{3.29}\begin{aligned}\langle R_x(y,z)w, v\rangle = C^2_x[z,w] G(x)^{-1} C^2_x[y,v] - C^2_x[y,w] G(x)^{-1} C^2_x[z,v]:\end{aligned}\]
the Riemann curvature tensor can be written as a quadratic expression in second derivatives of the constraints, weighted by the inverse Gram matrix of their gradients. And this gives us everything!
Indeed, once we have the Riemann tensor, we can calculate the sectional curvature. Given two linearly independent tangent vectors \(y,z\), the sectional curvature of the plane they span is \[\tag{3.30}\begin{aligned}K_x(y,z) = \frac{\langle R_x(y,z)z, y}{\langle y, y\rangle\langle z,z\rangle - \langle y,z\rangle^2},\end{aligned}\]
where the denominator is 1 for orthonormal tangent vectors. This is a measure of how curved the manifold is in the plane defined by \(y,z\) at \(x\). If \(K>0\), we have positive curvature, meaning initially parallel geodesics tend to converge. If \(K=0\), there’s no curvature: the manifold is flat around that point. If \(K<0\), we have negative curvature, and geodesics diverge. Next, let \(\{e_i\}\) be an orthnonormal basis for the tangent space. The Ricci tensor is \[\tag{3.31}\begin{aligned}\text{Ric}_x(y,z) = \sum_i \langle R_x(e_i, y)z, e_i\rangle,\end{aligned}\]
is essentially the sum of the sectional curvatures in the \(y-z\) plane at \(x\), and the scalar curvature is \[\tag{3.32}\begin{aligned}\text{Scal}(x) = \sum_i \text{Ric}_x(e_i, e_i),\end{aligned}\]
which you can relate to the leading correction to the volume of a ball at \(x\). Finally, we can consider geodesics. The defining property of a geodesic \(x(t)\) is that it has vanishing covariant acceleration, \[\tag{3.33}\begin{aligned}\mathcal{D}_{x(t)} x^\prime [x^\prime(t)] = \Pi_{x(t)} x^{\prime \prime}(t) = 0,\end{aligned}\]
where we recall \(x^{\prime\prime}(t) = D_{x(t)}x^\prime[x^\prime(t)]\). So \[\tag{3.34}\begin{aligned}x^{\prime \prime}(t) &= (I - \Pi_{x(t)}) x^{\prime \prime}(t)\end{aligned}\] \[\tag{3.35}\begin{aligned}&= J(x)^T G(x)^{-1} J(x)D_{x(t)}x^\prime[x^\prime(t)]\end{aligned}\] \[\tag{3.36}\begin{aligned}&= -J(x)^T G(x)^{-1} C^2_x[x^\prime (t),x^\prime(t)],\end{aligned}\]
where we’ve used \(I - \Pi_x = J(x)^T G(x)^{-1} J(x)\) and \(C^2_x[y,z] = - J(x)D_xV [y]\) for a smooth tangent field \(V(x)\) such that \(V(x)=z\) from Eq. (3.5). This gives us a system of ordinary differential equations for geodesics on the manifold, and in fact from the definition of the second fundamental form, they can be written \[\tag{3.37}\begin{aligned}x^{\prime \prime}(t) = \mathscr{F}^{2}_{x(t)}(x^\prime(t), x^\prime(t)).\end{aligned}\]
Example: Again consider the sphere \(\mathcal{S}\) defined by the single constraint \(c(x)=x^Tx - r^2\). We have \(\nabla c(x) = 2x\) and so \(J(x)=2x^T\) and \(G(x) = 4x^T x=4r^2\). Thus \[\tag{3.38}\begin{aligned}\Pi_x = I - (2x)(1/(4r^2))2x^T = I - xx^T/r^2,\end{aligned}\]
and \[\tag{3.39}\begin{aligned}g_x(y,z) = \langle y, \Pi_x z\rangle = \frac{\langle y, z\rangle -\langle y, x\rangle\langle x, z\rangle}{r^2}.\end{aligned}\]
Moreover, \(\nabla^2 c(x) = 2I\) so that \(C^2_x[y,z] = D_x^2 c[y,z] = \langle y, \nabla^2 c(x) z\rangle = 2\langle y, z\rangle\). Putting this together, we have \[\tag{3.40}\begin{aligned}\langle R_x(y,z)w, v\rangle &= \frac{\langle z,w\rangle\langle y, v\rangle - \langle y, w\rangle\langle z, v\rangle}{r^2}.\end{aligned}\]
The sectional curvature with \(y,z\) orthonormal is therefore \[\tag{3.41}\begin{aligned}K_x(y,z) = \frac{\langle z,z\rangle\langle y, y\rangle - \langle y, z\rangle\langle z, y\rangle}{r^2}= \frac{1}{r^2},\end{aligned}\]
which agrees with the sectional curvature of the sphere. \[\tag{3.42}\begin{aligned}\text{Ric}_x(y,z) &= \sum_i \langle R_x(e_i, y)z, e_i\rangle\end{aligned}\] \[\tag{3.43}\begin{aligned}&= \sum_i \frac{\langle y,z\rangle\langle e_i, e_i\rangle - \langle e_i, z\rangle\langle y, e_i\rangle}{r^2}\end{aligned}\] \[\tag{3.44}\begin{aligned}&= n\langle y,z\rangle/r^2 - \langle y,z\rangle/r^2\end{aligned}\] \[\tag{3.45}\begin{aligned}&= \frac{n-1}{r^2}\langle y, z\rangle,\end{aligned}\]
and \[\tag{3.46}\begin{aligned}\text{Scal}(x) = \sum_i \text{Ric}_x(e_i, e_i) = \sum_i \frac{n-1}{r^2}\langle e_i, e_i\rangle = \frac{n(n-1)}{r^2}.\end{aligned}\]
This is consistent with the results for a \(n\)-sphere of radius \(r\) with the standard spherical metric: there are \(n\) tangent directions to an \(n\)-sphere in \(n+1\) dimensional space. Finally, the geodesic equation is \[\tag{3.47}\begin{aligned}x^{\prime\prime}(t) &= - J(x(t))^T G(x(t))^{-1} C_{x(t)}[x^\prime(t), x^\prime(t)]\end{aligned}\] \[\tag{3.48}\begin{aligned}&= -(2x(t)) (1/4r^2)(2\langle x^\prime(t), x^\prime(t)\end{aligned}\] \[\tag{3.49}\begin{aligned}&= - \frac{\lVert x^\prime(t)\rVert^2}{r^2} x(t) ,\end{aligned}\]
which agrees with the standard result. Indeed, since \(x(t) \cdot x(t) = r^2\), we have by differentiating \[\tag{3.50}\begin{aligned}2x(t) \cdot x^\prime(t) = 0:\end{aligned}\]
the velocity is orthogonal to the position. But then \[\tag{3.51}\begin{aligned}x^{\prime\prime}(t) \cdot x^\prime(t) = - \frac{\lVert x^\prime(t)\rVert^2}{r^2} x(t) \cdot x^\prime(t) = 0,\end{aligned}\]
so that the velocity is orthogonal to the acceleration. But \[\tag{3.52}\begin{aligned}\frac{d}{dt} \lVert x^\prime(t)\rVert^2 = 2 x^{\prime \prime}(t) \cdot x^\prime(t) = 0,\end{aligned}\]
which shows that the speed \(v = \lVert x^\prime(t)\rVert\) is constant for all \(t\). Suppose we define a new parameter \(s= vt\) so that \(y(s)= x(s/v)\). Then \(y^\prime(s) = x^\prime(t)/v\) by the chain rule and \(\lVert y^\prime(s)\rVert = v/v=1\). Similarly, \(y^{\prime \prime}(t) = x^{\prime \prime}(t)/v^2\), and substituting this into the geodesic equation gives \[\tag{3.53}\begin{aligned}y^{\prime \prime}(s) = - y(s)/r^2,\end{aligned}\]
or \[\tag{3.54}\begin{aligned}\frac{d^2}{dt^2} y(s) = - (1/r^2)y(s),\end{aligned}\]
which is the differential equation for simple harmonic motion. Its general solution is \[\tag{3.55}\begin{aligned}y(s) = a \cos(s/r) + b \sin (s/r),\end{aligned}\]
for vectors \(a, b\). Let \(x_0\) be the initial point of the geodesic, and let \(v_0\) be its initial unit tangent vector. One works out that \[\tag{3.56}\begin{aligned}y(s) = x_0 \cos(s/r) + r v_0 \sin (s/r),\end{aligned}\]
which shows that geodesics correspond to great circle on the sphere.
4. Epilogue: The usual picture
We have developed Riemannian geometry from an extrinsic perspective. The way it is usually introduced is intrinsically, however, so it is worth making contact with the more common picture.
Let \(x = x(u^1, \dots, u^p)\) where \(\{u^i\}\) are an intrinsic parameterization of points on the manifold, e.g., for a circle instead using \((x,y)\) such that \(x^2+y^2=r^2\), we might parameterize points using just a single angle \(\theta\). We define the coordinate tangent vectors \(\{e_i(x)\}\) to be \[\tag{4.1}\begin{aligned}e_i(x) = \frac{\partial x(u)}{\partial u^i},\end{aligned}\]
which form a basis for \(T_x \mathcal{M}\). Now in the extrinsic point of view the metric is just \(g_x(y,z) = \langle y,z\rangle\) for \(y,z \in T_x \mathcal{M}\), which is inherited from the ambient Euclidean space, or more generally \(g_x(y,z) = \langle y, \Pi_x z\rangle\). From the intrinsic point of view, the components of the metric, as a matrix, are \(\tilde{g}_{ij} = \langle e_i, e_j\rangle\). In fact, let \(L\) be the Jacobian of the intrinsic coordinate system, that is, the matrix of derivatives \(\partial x_i / \partial u_j\). Then \(\tilde{g} = L^T g L\) is the “pullback” of the ambient metric to the intrinsic metric.
Example: Consider again the \(n\)-sphere, and let \(n=3\). We have \[\tag{4.2}\begin{aligned}(x,y,z) = (r\sin \theta \cos \phi, r \sin \theta \sin \phi, r \cos \theta).\end{aligned}\]
Thus \(L\) consists of the derivatives \(\frac{\partial x(\theta, \phi)}{\partial (\theta, \phi)}\), namely \[\tag{4.3}\begin{aligned}L = \begin{pmatrix} r \cos \theta \cos \phi & -r \sin \theta \sin \phi\\ r \cos \theta \sin \phi & r \sin \theta \cos \phi\\ -r\sin \theta & 0 \end{pmatrix}.\end{aligned}\]
Substituting the expression for \(x\) in terms of \(\theta\) and \(\phi\) into \(g = I - xx^T/r^2\), which we derived earlier, we find \[\tag{4.4}\begin{aligned}\tilde{g} = L^T g L = \begin{pmatrix}r^2 & 0 \\ 0 & r^2 \sin^2 \theta \end{pmatrix},\end{aligned}\]
which is exactly the standard intrinsic metric on the 2-sphere.
As a final parting note, since \(\mathcal{D}_x e_j [e_i(x)] = \Pi_x D_x e_j [e_i(x)]\) is in the tangent space, we can express it as some linear combination of \(\{e_i(x)\}\), that is, \[\tag{4.5}\begin{aligned}\mathcal{D}_x e_j [e_i(x)] = \sum_j \Gamma^k_{ij}(x) e_k(x),\end{aligned}\]
where \(\Gamma^k_{ij}\) are the famous Christoffel symbols. We leave it to the reader to connect up the extrinsic formalism we have developed here, emphasizing directional derivatives, projectors, and constraint functions to the intrinsic picture which begins with the metric tensor and its derivatives.