Differential Geometry
ℹ️ Why It Matters
Differential geometry provides the mathematical framework for describing curved spaces. It is essential for general relativity (gravity as spacetime curvature), manifold learning (discovering low-dimensional structure in high-dimensional data), and geometric deep learning (extending neural networks to non-Euclidean domains like graphs and meshes). Understanding curvature, geodesics, and connections enables optimization on manifolds—rotational matrices, positive-definite matrices, and probability simplices—which appear throughout modern machine learning. The language of differential geometry unifies disparate geometric phenomena under a coherent mathematical framework.
Core Definitions
DfManifold
A topological space is a (topological) manifold of dimension if it is Hausdorff, second-countable, and locally homeomorphic to . That is, for every point , there exists an open neighborhood and a homeomorphism called a coordinate chart. A smooth manifold additionally requires that transition maps between overlapping charts are smooth (). Manifolds generalize curves, surfaces, and higher-dimensional spaces to abstract settings where calculus can be performed.
DfTangent Space
The tangent space at a point on a manifold is the vector space of all tangent vectors at . It can be defined as the space of derivations on smooth functions at , or equivalently as equivalence classes of curves through . The tangent bundle is the disjoint union of all tangent spaces and carries a natural smooth structure.
DfRiemannian Metric
A Riemannian metric on a smooth manifold is a smoothly varying inner product on each tangent space . In local coordinates, the metric is represented by a symmetric positive-definite matrix such that the infinitesimal distance is . The metric encodes all intrinsic geometric information: distances, angles, areas, and volumes.
DfGeodesic
A geodesic on a Riemannian manifold is a curve that is locally distance-minimizing. Formally, is a geodesic if its covariant derivative vanishes: . Geodesics generalize straight lines to curved spaces. On a sphere, geodesics are great circles; on a hyperbolic plane, geodesics are arcs of circles perpendicular to the boundary.
DfCurvature Tensor
The Riemann curvature tensor measures how parallel transport around an infinitesimal loop fails to return a vector to its original orientation. For a vector transported around a loop:
The Riemann tensor has symmetries: , and satisfies the first Bianchi identity . In dimension , there are independent components.
DfChristoffel Symbols
The Christoffel symbols of the second kind are defined in terms of the metric:
These are not tensors themselves but describe how basis vectors change from point to point. They appear in the geodesic equation and the covariant derivative. The Christoffel symbols encode the "connection" on the manifold—how to differentiate vector fields.
DfCovariant Derivative
The covariant derivative extends differentiation to tensor fields on a manifold. For a vector field :
The covariant derivative of a scalar is just the ordinary partial derivative. For tensors of higher rank, each index gets a Christoffel symbol correction. The covariant derivative is tensorial (produces a tensor from a tensor), unlike partial derivatives which are not coordinate-invariant.
DfLie Bracket
The Lie bracket of two vector fields and is defined as (as differential operators). In coordinates: . The Lie bracket measures the failure of partial derivatives to commute and is related to the Lie algebra of a Lie group.
Key Formulas
Geodesic Equation
Here,
- =Coordinates of the geodesic curve as a function of parameter t
- =Christoffel symbols encoding the connection (how coordinates curve)
- =Affine parameter along the geodesic
Arc Length on a Riemannian Manifold
Here,
- =Riemannian metric tensor components
- =Tangent vector components along the curve
- =Parameter interval
Riemann Curvature Tensor (Christoffel Form)
Here,
- =Christoffel symbols
- =Riemann curvature tensor component
Ricci Curvature Tensor
Here,
- =Ricci tensor (contraction of Riemann tensor)
- =Riemann tensor with first and third indices contracted
Scalar Curvature
Here,
- =Scalar curvature (single number at each point)
- =Inverse metric tensor
- =Ricci tensor
Sectional Curvature
Here,
- =Linearly independent tangent vectors spanning a 2-plane
- =Curvature of the 2-dimensional section spanned by u and v
Gaussian Curvature (Surface)
Here,
- =Single independent component of Riemann tensor for a 2D surface
- =Metric components on the surface
Geodesic Distance on a Sphere
Here,
- =Radius of the sphere
- =Position vectors of two points on the sphere
Einstein Field Equations
Here,
- =Ricci curvature tensor
- =Scalar curvature
- =Metric tensor
- =Stress-energy tensor (matter/energy content)
- =Cosmological constant
Important Theorems
ThTheorema Egregium (Gauss)
The Gaussian curvature of a surface is invariant under local isometries. That is, if two surfaces are locally isometric (distance-preserving map between them), they have the same Gaussian curvature at corresponding points. This means curvature is an intrinsic property of the surface, not dependent on how it is embedded in . A cylinder has zero Gaussian curvature (it can be unrolled flat), while a sphere has positive curvature.
ThGauss-Bonnet Theorem
For a compact 2-dimensional Riemannian manifold without boundary:
where is the Gaussian curvature, is the area element, and = \beta_0 - \beta_1 + \beta_2 is the Euler characteristic. This relates the total curvature (geometry) to a topological invariant. For surfaces with boundary, the geodesic curvature of the boundary also contributes.
ThParallel Transport on a Sphere
Parallel transport of a vector along a closed geodesic triangle on a sphere of radius rotates the vector by an angle , where is the area enclosed by the triangle. This demonstrates that curvature causes holonomy—parallel transport around a loop does not generally return the vector to its original orientation.
ThBonnet-Myers Theorem
If a complete Riemannian manifold of dimension has Ricci curvature bounded below by , then is compact and has diameter at most . This provides a geometric constraint: positive Ricci curvature implies the manifold is "small" and cannot extend indefinitely.
ThCartan-Hadamard Theorem
If is a complete, simply connected Riemannian manifold with non-positive sectional curvature everywhere (), then is diffeomorphic to via the exponential map at any point. Moreover, the exponential map is a diffeomorphism. This implies that simply connected spaces of non-positive curvature have no "holes" and behave like flat Euclidean space globally.
Worked Examples
📝Geodesic on a Sphere
Problem: Find the geodesic distance between New York City (40.7°N, 74°W) and London (51.5°N, 0.1°W) on Earth (radius km).
Solution:
Step 1: Convert to spherical coordinates in radians.
- NYC: rad, rad
- London: rad, rad
Step 2: Convert to Cartesian coordinates.
Step 3: Compute the dot product.
Step 4: Compute geodesic distance.
The actual great circle distance is approximately 5570 km (the slight difference comes from Earth's oblateness, which a sphere doesn't capture).
📝Parallel Transport on a Sphere
Problem: A vector pointing east is parallel transported along the equator from longitude 0° to longitude 90°E. What is the resulting vector?
Solution:
Step 1: Along the equator, the Christoffel symbols for spherical coordinates on a unit sphere are:
Step 2: On the equator, , so .
Step 3: The parallel transport equation along the equator (parameterized by ) is:
Step 4: Since the connection coefficient vanishes on the equator, the vector components remain constant in the coordinate basis. The vector remains tangent to the equator throughout transport.
Result: After transport to 90°E, the vector still points along the equator. In the local tangent space at the new point, it points in the direction of increasing (east), which is consistent with parallel transport along the equator.
Key insight: Transport along a geodesic (the equator is a geodesic) preserves the angle between the vector and the geodesic tangent. The vector maintains its orientation relative to the local coordinate system.
📝Computing Gaussian Curvature
Problem: Compute the Gaussian curvature of a sphere of radius .
Solution:
Step 1: The metric on a sphere in coordinates is:
So , , .
Step 2: Compute Christoffel symbols. The only non-zero ones are:
Step 3: Compute the Riemann tensor component :
Since and :
Step 4: Lower the first index:
Step 5: Gaussian curvature:
Result: The Gaussian curvature of a sphere of radius is , which is constant everywhere on the sphere. This confirms that spheres have constant positive curvature.
Practice Problems
📝Problem 1: Geodesic on a Cylinder
Problem: A cylinder has the metric . Find the geodesics.
Solution:
The Christoffel symbols for this metric are all zero because and are constants.
The geodesic equation becomes:
Solution: ,
In Cartesian coordinates on the unrolled cylinder (, ):
Eliminating :
Result: Geodesics on a cylinder are helices (straight lines when the cylinder is unrolled). This makes intuitive sense: the cylinder has zero Gaussian curvature and is locally isometric to the plane.
📝Problem 2: Curvature of a Torus
Problem: Compute the Gaussian curvature at the inner and outer points of a torus with major radius and minor radius .
Solution:
Step 1: Parametrize the torus:
Step 2: Compute the metric:
Step 3: Gaussian curvature (derived from the second fundamental form):
Step 4: At the outermost point ():
Step 5: At the innermost point ():
Result: The torus has positive curvature on the outside and negative curvature on the inside, with zero curvature at the top and bottom (). The total curvature is , consistent with the Euler characteristic of the torus being .
📝Problem 3: Christoffel Symbols for the Hyperbolic Plane
Problem: The hyperbolic plane in the Poincaré half-plane model has metric . Compute the Christoffel symbols.
Solution:
Step 1: Identify the metric components:
Step 2: Compute partial derivatives of the metric:
Step 3: Compute Christoffel symbols using :
Since , , :
Step 4: Verify: The Gaussian curvature is everywhere, confirming constant negative curvature.
Result: The non-zero Christoffel symbols are , , and . These encode the "push" of geodesics toward the boundary .
📝Problem 4: Geodesic Distance in Hyperbolic Space
Problem: Find the geodesic distance between two points in the Poincaré disk model of hyperbolic space.
Solution:
Step 1: In the Poincaré disk model , the metric is:
Step 2: The geodesic distance between points is:
Step 3: For points at the origin and (real):
Step 4: Using :
Result: The distance grows logarithmically as , reflecting the infinite extent of hyperbolic space within the unit disk. This exponential growth of volume with radius is what makes hyperbolic space suitable for embedding hierarchical data.
📝Problem 5: Ricci Curvature of a 2-Sphere
Problem: Compute the Ricci tensor and scalar curvature of a 2-sphere of radius .
Solution:
Step 1: From the previous calculation, the Riemann tensor components are:
Step 2: The Ricci tensor is :
Step 3: The Ricci tensor is (proportional to the metric).
Step 4: Scalar curvature:
Result: The scalar curvature is , and the Ricci tensor satisfies , confirming that the 2-sphere is an Einstein manifold (Ricci tensor proportional to metric).
📝Problem 6: Exponential Map on a Sphere
Problem: Compute the exponential map for a point on the north pole of a unit sphere.
Solution:
Step 1: At the north pole , the tangent space consists of vectors .
Step 2: The exponential map sends a tangent vector to the point on reached by following the geodesic starting at with initial velocity for unit time.
Step 3: The geodesic from the north pole in direction is a great circle. Parameterize:
Step 4: At :
Step 5: For :
This is the south pole, reached by traveling a geodesic of length from the north pole.
Result: The exponential map is a diffeomorphism from the open ball of radius in to . It fails to be injective at (antipodal point), which is the cut locus.
📝Problem 7: Length of a Curve on a Surface
Problem: Compute the length of the helix for on the cylinder .
Solution:
Step 1: The cylinder metric in coordinates is (since ).
Step 2: The helix in these coordinates is , .
Step 3: The tangent vector is .
Step 4: The speed is:
Step 5: The length is:
Result: The helix has length . This is longer than the straight line along the cylinder ( for one revolution), reflecting the extra distance traveled vertically.
📝Problem 8: Inverse Metric Tensor Computation
Problem: Compute the inverse metric tensor for the metric .
Solution:
Step 1: Identify the metric matrix:
Note: (symmetric).
Step 2: Compute the determinant:
Step 3: Compute the inverse:
Step 4: Verify:
✓
✓
Result: The inverse metric is . This is used to raise indices: .
📝Problem 9: Christoffel Symbols for Polar Coordinates
Problem: Compute the Christoffel symbols for the Euclidean plane in polar coordinates .
Solution:
Step 1: The metric in polar coordinates is .
So , , .
Step 2: Inverse metric: , , .
Step 3: Compute Christoffel symbols using :
All other Christoffel symbols are zero.
Step 4: Verify with the geodesic equation. For a straight line in polar coordinates, the geodesic equation gives:
These are the correct equations for straight-line motion in polar coordinates.
Result: The non-zero Christoffel symbols are and . These encode how the polar coordinate system "curves" relative to Cartesian coordinates.
📝Problem 10: Sectional Curvature of a Surface of Revolution
Problem: Compute the Gaussian curvature of the surface of revolution where .
Solution:
Step 1: Parametrize the surface: .
Step 2: Compute the metric:
Step 3: The Gaussian curvature for a surface of revolution is:
Step 4: For a sphere of radius : , , .
This confirms the constant curvature for the sphere.
Result: The Gaussian curvature of a surface of revolution depends only on and its derivatives. For a paraboloid : , which is negative everywhere.
📝Problem 11: Geodesics on the Hyperbolic Plane
Problem: Find the geodesics in the Poincaré half-plane model with metric .
Solution:
Step 1: The Christoffel symbols were computed earlier:
Step 2: The geodesic equations are:
Step 3: The geodesics are:
- Vertical lines: (half-lines perpendicular to the boundary )
- Semicircles: (arcs of circles centered on the boundary)
Step 4: For a vertical geodesic , parameterize as . The geodesic equation gives , with solution .
Step 5: For a semicircular geodesic , parameterize as . The arc length element is , so the geodesic parameter is .
Result: Geodesics in are vertical lines and semicircles perpendicular to the boundary. This is the foundation of hyperbolic geometry and is used in hyperbolic embeddings for hierarchical data.
Common Mistakes
| Mistake | Correct Approach |
|---|---|
| Assuming geodesics are always the shortest paths | Geodesics are locally distance-minimizing; global minima require additional analysis |
| Confusing the Christoffel symbols with tensor components | Christoffel symbols are NOT tensors; they transform inhomogeneously under coordinate changes |
| Using Euclidean geometry on curved surfaces | Always account for the metric: in general |
| Assuming parallel transport preserves vector orientation | On curved manifolds, parallel transport around a loop causes rotation (holonomy) |
| Forgetting that curvature is intrinsic | Gaussian curvature can be computed from the metric alone, without reference to the embedding space |
| Confusing extrinsic and intrinsic curvature | Extrinsic curvature depends on embedding; intrinsic curvature (Gaussian) does not |
| Assuming | The Riemann tensor has specific symmetries: |
Connections to Machine Learning
ℹ️ Connections to Machine Learning
Differential geometry underlies several ML paradigms: (1) Hyperbolic embeddings represent hierarchical data (taxonomies, knowledge graphs) in , where distance grows exponentially with depth, matching tree-like structure naturally. (2) Riemannian optimization generalizes gradient descent to manifolds of constrained structure (rotation matrices, positive-definite covariance matrices), using retractions and vector transport instead of Euclidean updates. (3) Geometric deep learning extends CNNs to non-Euclidean domains (graphs, meshes) by defining convolutions via the Laplace-Beltrami operator, which depends on the manifold's curvature. (4) Information geometry treats the space of probability distributions as a Riemannian manifold with the Fisher information metric, leading to natural gradient descent. (5) General relativity uses the Einstein field equations , relating spacetime curvature to matter-energy, which has inspired energy-based models in ML.
Exam/Interview Questions
Q1: What is the difference between intrinsic and extrinsic curvature?
Answer: Intrinsic curvature (Gaussian curvature) is determined entirely by the metric tensor and measurements made within the manifold. It is invariant under isometries (Theorema Egregium). Extrinsic curvature depends on how the manifold is embedded in a higher-dimensional space. For example, a cylinder has zero intrinsic curvature (it can be unrolled flat) but non-zero extrinsic curvature in .
Q2: Write the geodesic equation and explain each term.
Answer: . The first term is the acceleration. The second term involves Christoffel symbols that encode how the coordinate system curves; they act as "fictitious forces" in curved coordinates. On a flat manifold in Cartesian coordinates, all , and the equation reduces to (straight lines).
Q3: Why can't we do optimization directly on a manifold using standard gradient descent?
Answer: Standard gradient descent moves in the direction of steepest descent in the ambient Euclidean space, which may leave the manifold. For example, optimizing a rotation matrix by adding a Euclidean gradient step produces a matrix that is no longer orthogonal. Riemannian optimization uses retractions (maps from the tangent space back to the manifold) and vector transport (moving tangent vectors between tangent spaces) to stay on the manifold while descending.
Q4: What is the significance of the Gauss-Bonnet theorem?
Answer: The Gauss-Bonnet theorem connects geometry (curvature ) to topology (Euler characteristic ). It implies that the total curvature of a closed surface is a topological invariant—you cannot change it by smoothly deforming the surface. For example, a sphere always has total curvature regardless of its shape, and a torus always has total curvature .
Q5: How does hyperbolic geometry benefit representation learning?
Answer: Hyperbolic space has exponential volume growth: the number of points at distance grows as , matching the exponential growth of nodes in a tree. Hierarchical data (taxonomies, organizational charts, phylogenetic trees) can be embedded in hyperbolic space with arbitrarily low distortion using far fewer dimensions than Euclidean space requires. The Poincaré disk model allows gradient-based optimization of these embeddings.
Q6: What is the Laplace-Beltrami operator, and why is it important for graph neural networks?
Answer: The Laplace-Beltrami operator generalizes the Laplacian to manifolds. On a graph, the combinatorial Laplacian (degree matrix minus adjacency matrix) is the discrete analog. Its eigenvectors provide a Fourier basis on the graph, enabling spectral graph convolutions that are the foundation of spectral graph neural networks (ChebNet, GCN).
Quick Reference
| Concept | Formula | Key Insight |
|---|---|---|
| Metric Tensor | Defines distances and angles | |
| Christoffel Symbols | Encode connection | |
| Geodesic Equation | Generalizes straight lines | |
| Riemann Tensor | Measures curvature | |
| Ricci Tensor | Contraction of Riemann tensor | |
| Scalar Curvature | Single number summarizing curvature | |
| Gaussian Curvature | Intrinsic curvature of surfaces | |
| Sphere Distance | Great circle distance | |
| Hyperbolic Distance | Poincaré disk distance | |
| Gauss-Bonnet | Geometry equals topology | |
| Einstein Field Equations | Curvature = matter-energy |
Cross-References
- 096-advanced-tensor-calculus — Metric tensors are rank-2 covariant tensors; tensor calculus provides the computational framework
- 098-advanced-functional-analysis — Hilbert spaces generalize inner product structures; Sobolev spaces use Riemannian metrics
- 099-advanced-measure-theory — Integration of differential forms requires measure theory on manifolds
- 100-advanced-topological — Topology classifies manifolds; differential geometry adds geometric structure
- Linear Algebra — Eigenvalues of the curvature tensor determine the type of curvature (positive, negative, mixed)