# What are manifolds?

You walk into an empty Nebraska field. Everywhere you look, it looks flat. However, when you go into a rocket ship and orbit the earth, you can see it’s a sphere. This means locally, the Earth’s crust looks like a plane.

Likewise, think of an ant walking on a super-thin hula hoop. Locally, it thinks it’s walking a straight line, but we know it’s walking on a curve.

# Mathematical Definition

A manifold is a space that locally resembles a **Euclidean space **at each point.

MathJax TeX Test Page
In broad terms, if we want to show that something in $\mathbb{R}^n$ is a k-dimensional manifold, we want to find a 1-to-1 mapping between points in $\mathbb{R}^k$ and points on the surface (in $\mathbb{R}^n$). That way, we can say that locally, this can be represented by the $\mathbb{R}^k$ coordinate system.

A subset M of $\mathbb{R}^n$ is a k-dimensional manifold in $\mathbb{R}^n$ provided for every p $\in$ M, there exist open subsets $U \subseteq \mathbb{R}^k$ and $W \subseteq \mathbb{R}^n$ and a function g: $U \to \mathbb{R}^n$ such that
$$\text{1. } p \in W$$
$$\text{2. } g(U) = M \cap W$$
This line may seem counterintuitive. If W is $\mathbb{R}^n$, why do we need the intersection? M is obviously entirely contained W. However, this doesn't have to be case. W can be a subset that overlaps with the manifold.
$$\text{3. g is smooth}$$
$$\text{4. g is injective}$$
Why do we care that it's injective? If multiple points in $U$ correspond to one point in $M$, then we might think that maybe $U$ is too big and it may not be a k-dimensional manifold.
$$\text{5. }g^{-1}: W \cap M \to U \text{ exists and is unique}$$
$$\text{6. }\forall x \in U, \text{ the rank of }Jg(x) = k $$
This last point means that at each point, the manifold is locally a hyperplane, which is the result we want.
# What does this even mean?

A good way to illustrate this is to think of an example.

Imagine a cylinder in R^3. It is a curved plane pretty much. It is a 2D manifold.

MathJax TeX Test Page
The equation of a cylinder, written normally is $$x^2 + y^2 = 1$$. This is a circle that is moved up and down the z-axis infinitely. We know that this is essentially a plane rolled into a cylinder. Therefore, we expect it to be a 2D manifold.
What we have to do is turn this equation into one that goes from $(x,y)$ into our manifold. Luckily, if we know some parametrization, we know $x^2 + y^2 = 1$ is equivalent to $$g(s,t) = \begin{bmatrix}\cos(s)\\\sin(s)\\t\end{bmatrix}$$
We can verify this by plugging in our function into $x^2 + y^2 = 1$. $\cos(s)^2 + \sin(s)^2 = 1$. This works. So, let's start, letting $W$ = $\mathbb{R}^3$.
$$\text{Let p} \in M$$
$$\text{Condition 1: } p \in M \to p \in M \cup W$$
$$\text{Condition 2: } g(U) = W \cap M$$
As we showed, our g is equivalent to $x^2 + y^2 = 1$.
$$\text{Condition 3: g is smooth}$$
We know that sin, cos are smooth and polynomials are smooth, so g is smooth.
$$\text{Condition 4: g is injective}$$
We verify this by setting two results of g(s,t) equal
$$\begin{bmatrix}cos(s_1)\\sin(s_1)\\t_1\end{bmatrix} = \begin{bmatrix}cos(s_2)\\sin(s_2)\\t_2\end{bmatrix}$$
$$\text{From this, we can automatically say } t_1 = t_2$$
By combining the results of cos and sin, we can see that $s_1 = s_2$. I will not go into a lot of detail.
$$\text{Condition 5: } g^{-1}(x,y,z) = (arccos(x),z)$$
Note here that arccos is not unique $(arccos(\frac{\sqrt{2}}{2})$ = $\frac{\pi}{4}$, but $\frac{7\pi}{4}$ works too. However, since we know what sin(arccos(x)) = y, we can figure out which arccos(x) we want.
$$\text{Condition 6: Rank of }Jg(x) = k$$
$$Jg = \begin{bmatrix}-\sin(s) & 0 \\ \cos(s) & 0\\0 & 1\end{bmatrix}$$
We can determine the rank using two cases. First, when $\sin(s) = 0$. This means that $|cos(s)|$ = 1, so $Jg = \begin{bmatrix}0 & 0 \\ \pm 1 & 0\\0 & 1\end{bmatrix}$, which as rank 2. The second case is when $\sin(s) \neq 0$, so we can divided by $-\sin(s)$ and say $Jg = \begin{bmatrix}1 & 0 \\ \pm \cos(s) & 0\\0 & 1\end{bmatrix}$. We row reduce to turn the second row into a row of zeroes and get rank = 2.
# Defining Manifolds Implicitly

MathJax TeX Test Page
There is actually a much simpler way of defining a manifold. Before, we were defining manifold explicitly. So, given points (x,y,z), the manifold satisfies f(x,y,z). If you need three variables to represent the manifold, it's a 3 dimensional manifold.

What if we have a function in three variables, and we take use a slice of it? Then it moves down to two dimensions. What if we make another slice of it? Then it moves down to one dimension.

For example, let's say we have $F(x,y,z) = x^2 + y^2 + z^2 - 1$. $F^{-1}(0)$ is the set of all points $(x,y,z)$ such that $F$ equals 0. This is a sphere of radius 1, which is a 2 dimensional manifold. We know this is the case, because we reduced the number of dimensions in the equation by 1.

MathJax TeX Test Page
$\forall p \in M, \exists $ set $W \in \mathbb{R}^n$ such that $F: W \to \mathbb{R}^{n-k}$ and
$$\text{1. } p \in W$$
$$\text{2. }F^{-1}(0) = W \cap M$$
$$\text{3. }F \text{ smooth}$$
$$\text{4. }\forall x \in M \cap W, rank(DF(x)) = n-k$$
Then M is a k-dimensional manifold.

MathJax TeX Test Page
To demonstrate how much simpler this way is, let's redo the problem from above. $F(x,y) = x^2 + y^2 - 1. F^{-1}(0) = x^2 + y^2 = 1$
$$DF(x) = \begin{bmatrix}2x & 2y\end{bmatrix}$$
Because $(x,y) = (0,0)$ does not satisfy $F(x,y) = 0$, we know that DF(x) has rank = 1 = 3-2. F is also smooth because it is a polynomial. By the theorem above, F is a 2D manifold in $ \mathbb{R}^3$.