Unfolding Manifolds: A Beginner’s Exploration

Discover the Hidden Geometry of Spaces with Intuitive Concepts and Python Examples

Thomas Konstantinovsky
8 min readAug 12, 2024
Photo by Niloy Tesla on Unsplash

Hey there! Today, I’m diving into one fascinating concept in mathematics called manifolds. If you’ve ever found yourself thinking about how to make sense of high-dimensional spaces or how surfaces in different dimensions behave, then manifolds are the key. In this post, I’ll guide you through the essential concepts, adding a few Python examples and a few formal definitions to hopefully give you a solid footing in the world of manifolds.

What is a Manifold?

Imagine a surface like a sphere, cube, or even a donut! Locally, these surfaces look flat (imagine zooming in up until something is so close to you it looks flat), like pieces of paper, but globally, they have a more complex structure. A manifold is a mathematical space that, on a small enough scale, resembles Euclidean space (like our familiar 2D plane or 3D space) but can have a more intricate structure when viewed as a whole.

To get a feel for this, let’s think about the Earth. Locally, the ground beneath your feet seems flat, but if you zoom out far enough, you see it’s a sphere. That local flatness is what makes the Earth’s surface a 2-dimensional manifold.

Mathematically, a manifold M of dimension n is a topological space that is locally homomorphic to R^n. This means that around every point on M, there’s a neighborhood that looks like a piece of R^n.

Understanding Charts and Atlases

When working with manifolds, we often use a collection of local coordinates called charts. A chart is a map that takes a piece of the manifold and assigns coordinates from R^n to it. A collection of charts that covers the entire manifold is known as an atlas.

Think of a globe: the various flat maps you use to cover the surface of the globe are the charts, and together, they form an atlas of the Earth!

Example: The Circle as a 1D Manifold

Let’s look at a simple example to get things going: the unit circle in .

Mathematically, is defined as:

Definition of

Even though the circle lives in 2D space, it’s a 1-dimensional manifold because you only need one coordinate (like the angle θ) to describe any point on the circle.

import numpy as np
import matplotlib.pyplot as plt

# set of points on our s1 example
theta = np.linspace(0, 2 * np.pi, 100)
x = np.cos(theta)
y = np.sin(theta)

plt.figure(figsize=(6, 6))
plt.plot(x, y)
plt.title('Unit Circle as a 1D Manifold')
plt.xlabel('x')
plt.ylabel('y')
plt.gca().set_aspect('equal')
plt.show()
Notice that the angle theta is our is the parameter to our chart in this example

In this plot, the red lines represent local coordinate systems or charts at different points on the circle. Each chart gives us a way to describe the local neighborhood around a point.

Imagine walking around a round track. No matter where you are, it feels like you’re moving along a straight line, but when you zoom out, you’re actually going in a circle. The circle is a 1D manifold because, at any point, you can describe your position with just one number (how far you’ve walked).

Homeomorphisms: The Key to Understanding Local Flatness

A homeomorphism is like a magic trick that lets you stretch and bend shapes without tearing or gluing them. When I say a manifold is locally homeomorphic to R^n, it means that, up close, the manifold looks just like a flat space.

Think of a coffee cup and a donut (torus). You can deform one into the other without cutting or gluing — that’s a homeomorphism!

The equation of a general tours (Source: Wikipedia)
from mpl_toolkits.mplot3d import Axes3D

# define a torus as an embedding of a circle
theta = np.linspace(0, 2 * np.pi, 100)
phi = np.linspace(0, 2 * np.pi, 100)
theta, phi = np.meshgrid(theta, phi)

r = 1 # the minor radius (see defenition of tours)
R = 2 # the major radius (see defenition of tours)

x = (R + r * np.cos(theta)) * np.cos(phi)
y = (R + r * np.cos(theta)) * np.sin(phi)
z = r * np.sin(theta)

fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, color='lightblue')
plt.title('Torus as an Embedding of a Circle')
plt.show()
In this 3D plot, you can see a torus, which is essentially a circle embedded in a higher-dimensional space.

Imagine you’re holding a donut (torus). If you zoom in close enough to the surface, it just looks like a flat piece of dough. The fact that this locally flat surface wraps around into a donut shape is what makes it a manifold.

Embeddings: Placing Manifolds in Higher Dimensions

An embedding is like placing one shape inside another, usually in a higher-dimensional space. It’s like putting a flat sheet of paper (a 2D surface) inside a book (a 3D space).

For example, the unit circle can be embedded in , as we saw earlier. Similarly, the surface of a sphere can be embedded in .

Let’s look at a Möbius strip, a 2D surface with a twist, embedded in 3D space:

equations for the Cartesian coordinates of the Mobius strip (Source: Wikipedia)
theta = np.linspace(0, 2 * np.pi, 100)
w = np.linspace(-0.5, 0.5, 20)
theta, w = np.meshgrid(theta, w)

x = (1 + w * np.cos(theta / 2)) * np.cos(theta)
y = (1 + w * np.cos(theta / 2)) * np.sin(theta)
z = w * np.sin(theta / 2)

fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, color='lightcoral')
plt.title('Möbius Strip: A Non-Orientable 2D Manifold')
plt.show()

Imagine you’re cutting a strip of paper and giving it a half-twist before taping the ends together. Now you’ve got a Möbius strip! This twisted surface is embedded in 3D space, and it’s a manifold because, locally, it still looks flat.

Coordinate Transformations: Changing Perspectives

Sometimes, we need different maps (charts) to describe the entire manifold. Coordinate transformations are like changing your point of view.

Consider moving from polar coordinates (r, θ) to Cartesian coordinates (x, y) on the plane. It’s like switching from using a map with latitude and longitude to a flat street map.

The transformation is:

# define the polar coordinates
r = np.linspace(0, 1, 100)
theta = np.linspace(0, 2 * np.pi, 100)
r, theta = np.meshgrid(r, theta)

# convert to Cartesian coordinates
x = r * np.cos(theta)
y = r * np.sin(theta)

# Plot the grid in Cartesian coordinates
plt.figure(figsize=(6, 6))
plt.plot(x, y, 'k.', markersize=1)
plt.title('Coordinate Transformation: Polar to Cartesian')
plt.xlabel('x')
plt.ylabel('y')
plt.gca().set_aspect('equal')
plt.show()

You can think of it as if you’re using Google Maps and you switch from satellite view to map view. You’re still looking at the same place, but the way you describe it (coordinates) has changed. The transformation preserves the structure, just like switching between different charts on a manifold.

Tangent Spaces and Differentiability: Linearizing the Manifold

A tangent space is the space of all possible directions in which you can move from a point on the manifold. It’s like thinking about all the ways you could walk if you were standing on a hill.

Imagine a curve like our circle. At any point on the curve, the tangent space is just the line that touches the curve at that point — it’s the best linear approximation to the curve at that point.

# choose a point on the circle
theta0 = np.pi / 4
x0, y0 = np.cos(theta0), np.sin(theta0)

# tangent vector at (x0, y0)
tangent_vector = np.array([-y0, x0])

plt.plot(x, y)
plt.quiver(x0, y0, tangent_vector[0], tangent_vector[1], angles='xy', scale_units='xy', scale=1, color='r', label='Tangent Vector')
plt.scatter(x0, y0, color='g', label='Point on Circle')
plt.title('Tangent Space at a Point on S^1')
plt.xlabel('x')
plt.ylabel('y')
plt.gca().set_aspect('equal')
plt.legend(loc='lower left')
plt.show()

Think of it as standing on the side of a hill. The direction you would roll down is the tangent to the hill at that point. The tangent space is like all the possible directions you could roll.

Curvature: Understanding the “Bending” of Manifolds

Curvature tells us how a manifold bends in space. For example, a flat sheet of paper has zero curvature, while a sphere has positive curvature. On a sphere, the curvature is the same everywhere, but on a surface like a saddle, the curvature changes from point to point.

# define the surfaces
u = np.linspace(-2, 2, 100)
v = np.linspace(-2, 2, 100)
u, v = np.meshgrid(u, v)

# gaussian curvature for different surfaces
def gaussian_curvature_sphere(r, u, v):
x = r * np.cos(u) * np.cos(v)
y = r * np.cos(u) * np.sin(v)
z = r * np.sin(u)
return x, y, z

def gaussian_curvature_paraboloid(u, v):
x = u
y = v
z = u**2 + v**2
return x, y, z

x, y, z = gaussian_curvature_sphere(1, u, v)
fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(121, projection='3d')
ax.plot_surface(x, y, z, color='lightgreen')
ax.set_title('Sphere with Positive Curvature')

x, y, z = gaussian_curvature_paraboloid(u, v)
ax = fig.add_subplot(122, projection='3d')
ax.plot_surface(x, y, z, color='lightblue')
ax.set_title('Paraboloid with Varying Curvature')

plt.show()

Intuitively, this is like rolling a ball on a flat table versus a curved bowl. On the flat table, the ball rolls straight — there’s no curvature. In the bowl, the ball curves as it rolls — this is because of the curvature of the bowl’s surface.

Geodesics: The Shortest Paths on Manifolds

A geodesic is the shortest path between two points on a manifold. On flat surfaces, this is just a straight line. On curved surfaces, like a sphere, geodesics are more like arcs of great circles.

from mpl_toolkits.mplot3d import Axes3D

# define points on a sphere
phi = np.linspace(0, np.pi, 100)
theta = np.linspace(0, 2 * np.pi, 100)
phi, theta = np.meshgrid(phi, theta)
x = np.sin(phi) * np.cos(theta)
y = np.sin(phi) * np.sin(theta)
z = np.cos(phi)

fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, color='lightblue', alpha=0.6)

# derive the geodesic (a great circle)
theta_geod = np.linspace(0, 2 * np.pi, 100)
x_geod = np.cos(theta_geod)
y_geod = np.sin(theta_geod)
z_geod = np.zeros_like(theta_geod)

ax.plot(x_geod, y_geod, z_geod, color='r', lw=2, label='Geodesic')
ax.legend()
plt.show()

It's like flying from one city to another on Earth. The shortest flight path (the great circle route) is a geodesic. Even though it looks curved on a flat map, it’s the shortest path on the curved surface of the Earth.

Wrapping Up

Manifolds are a gateway to understanding complex geometrical structures and their properties in higher dimensions. By exploring these fundamental concepts — charts, atlases, tangent spaces, embeddings, coordinate transformations, curvature, and geodesics — you can begin to see how manifolds serve as the backbone for much of modern geometry and physics.

We only looked at the concepts without diving too much into the formal definitions and regours proofs, if you would like to see those don't hesitate to ask in the comments section and I will happily dive deeper into the mathematics!

Stay tuned for more deep dives into the mathematical wonders of our universe!

--

--

Thomas Konstantinovsky

A Data Scientist fascinated with uncovering the mysterious of the world