Tuesday, January 24, 2017

Defining and implementing spheres from sampled points

Let $p_1,\dots,p_{n+1}\in \R^n$ be points with coordinates $p_i = (p_{i,1},\dots,p_{i,n})$, and $\R^n$ with coordinates $x_1,\dots,x_n$. It is clear that if theses $n+1$ points are in general position, then they define a unique $(n-1)$-sphere in $\R^n$, on which they all lie.

Guess: Every point $(x_1,\dots,x_n)$ on the unique $(n-1)$-sphere in $\R^n$ defined by $p_1,\dots,p_{n+1}$ satisfies
\begin{equation}
\det\begin{bmatrix}
\sum_{i=1}^n x_i^2 & x_1 & x_2 & \cdots & x_n & 1 \\
\sum_{i=1}^n p_{1,i}^2 & p_{1,1} & p_{1,2} & \cdots & p_{1,n} & 1 \\
\sum_{i=1}^n p_{2,i}^2 & p_{2,1} & p_{2,2} & \cdots & p_{2,n} & 1 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
\sum_{i=1}^n p_{n+1,i}^2 & p_{n+1,1} & p_{n+1,2} & \cdots & p_{n+1,n} & 1 \\
\end{bmatrix} = 0.
\end{equation}
Call this equation (1).

This guess is made based on the 2-sphere version presented in Zwillinger. It is immediate that every point $p_i$ satisfies this equation, as then the matrix has two rows with identical entries. From this guess, we may conclude the following.

Proposition: The radius of the $(n-1)$-sphere defined by $p_1,\dots,p_{n+1}$ in $\R^n$ is
\[
\sqrt{\sum_{j=2}^{n+1}\frac{A_{1,j}^2}{4A_{1,1}^2} +(-1)^n\frac{A_{1,n+2}}{A_{1,1}}},
\]
for $A_{i,j}$ the $(i,j)$-minor of the matrix in equation (1). Call this expression (2).

Proof: This follows by comparing two equations. Assume that these points define a sphere of radius $r$ centered at $(a_1,\dots,a_n)$. Then points on it satisfy
\[
r^2 = (x_1-a_1)^2+\cdots+(x_n-a_n)^2 = x_1^2-2a_1x_1+a_1^2+\cdots + x_n^2-2a_nx_n + a_n^2.
\]
Equation (1) may be expanded out along the first row as
\[
\sum_{i=1}^n x_i^2 A_{1,1} - x_1A_{1,2}+\cdots + (-1)^nx_nA_{1,n+1} + (-1)^{n+1}A_{1,n+2} =0,
\]
where none of the $A_{i,j}$ are in any of the $x_i$. Dividing by the leading factor and comparing coefficients of these two equations, we find
\begin{align*}
A_{1,1} & = 1, \\
-A_{1,2}/A_{1,1} & = -2a_1, \\
& \ \ \vdots \\
(-1)^nA_{1,n+1}/A_{1,1} & = -2a_n, \\
(-1)^{n+1}A_{1,n+2}/A_{1,1} &  = a_1^2+\cdots + a_{n^2} - r^2.
\end{align*}
The given expression follows by solving for $r$. $\square$

Since any collection of $k+1$ points in general position in $\R^n$ define a $k$-plane, it is natural to ask what would be the radius of the $(k-1)$-sphere in that $k$-plane defined by those $k+1$ points. One approach to answer this is to define a new coordinate system on $\R^n$ with the first $k$ vectors spanning the given $k$-plane, restrict to the first $k$-coordinates, and apply the proposition above. More precisely, subtract the first vector from the other $k$ vectors to define a new "origin," preform the Gram--Schmidt orthogonalization process on these shifted vectors, then take the QR-decomposition of this matrix of vectors whose inverse is the map from the standard basis to the new basis. In Sage code, this may be implemented as below.

# Returns the (i,j)-minor (determinant when ith row, jth col removed) of input matrix mat
def minor(mat,i,j):
    return mat.delete_rows([i]).delete_columns([j]).det()
    
# Returns the radius of an (n-1)-sphere defined by n+1 points in R^n
def sphere_radius(L,field=CDF):
    n = len(L)-1
    M1 = [[0]*(n+2)]
    for pt in L:
        tempL = [pt*pt]
        for pos in range(n):
            tempL.append(pt[pos])
        tempL.append(1)
        M1.append(tempL)
    M2 = matrix(field,n+2,n+2,M1)
    return sqrt(reduce(lambda x,y: x+y, map(lambda z: minor(M2,0,z-1)**2/(4*minor(M2,0,0)**2),
        range(1,n+2)))+(-1)**n*minor(M2,0,n+1)/minor(M2,0,0))
    
# Returns the radius of a (k-1)-sphere defined by k+1 points in R^n
def sphere_radius_general(L,field=CDF):
    k = len(L)-1
    n = len(L[0])
    L1 = []
    for vec in L[1:]:
        L1.append(vec-L[0])    
    M = matrix(field,k,n,L1)
    Q,R = M.transpose().QR()
    L2 = [vector(field,[0]*k)]
    Qinv = Q.inverse()
    for vec in L1:
        L2.append((Qinv*vec)[:k-n])
    return sphere_radius(L2)

Now in Mathematica.

(*Returns the (i,j)-minor of a an input matrix mat*)
minor[mat_,i_,j_] := Map[Reverse,Minors[mat],{0,1}][[i]][[j]]

(*Returns the radius of an (n-1)-sphere defined by n+1 points in R^n*)
SphereRadius[L_] := Module[{n, M},
    n = Length[L]-1;
    M = Join[{Array[0#&,n+2]},Table[Join[{Sum[L[[j]][[l]]^2,{l,1,n}]},L[[j]],{1}],{j,1,n+1}]];
    Sqrt[Sum[minor[M,1,j]^2/(4*minor[M,1,1]^2),{j,2,n+1}]+(-1)^n*minor[M,1,n+2]/minor[M,1,1]]]
    
(*Returns the radius of a (k-1)-sphere defined by k+1 points in R^n*)
SphereRadiusGeneral[L_] := Module[{n,k,Lv,L1,q,qq,qinv},
   n = Length[L[[1]]];
   k = Length[L]-1;
   Lv = Table[Unique["q"],{n}];
   L1 = L[[2;;]]-Table[L[[1]],{l,1,k}];
   q = QRDecomposition[Transpose[L1]][[1]];
   qq = Join[q,{Lv}]/.Solve[{q.Lv==0,Total[#^2&/@Lv]==1},Lv][[1]];
   qinv = Inverse[Transpose[qq]];
   SphereRadius[Join[{Array[0#&,k]},#[[;;-(n-k)-1]]&/@(qinv.#&/@L1)]]]
The variable L is a list of $(n+1)$-dimensional vectors of appropriate length. Both methods skip creating the first line of the matrix in (1), since it does not appear in the expression (2). The method in Sage is probably faster in practice, but less accurate. For example:
Note that the exact square root result is approximately $10.9682$, off by around $0.01$ from the Sage result.

References: Zwillinger (CRC Standard Mathematical Tables and Formulae, Section 4.8.1)

Thursday, December 22, 2016

Sampling points uniformly on parametrized manifolds

Here I'll describe how to sample points uniformly on a (parametrized) manifold, along with an actual implementation in Python. Let $M$ be a $m$-dimensional manifold embedded in $\R^n$ via $f:\R^m\to \R^n$. Moreover, assume that $f$ is Lipschitz (true if $M$ is compact), injective (true if $M$ is embedded), and is a parameterization, in the sense that there is an $m$-rectangle $A = [a_1,b_1]\times \cdots \times [a_m,b_m]$ such that $f(A) = M$ (the intervals need not be closed). Set $(\widetilde Jf)^2 = \det(Df\cdot Df^T)$ to be the $m$-dimensional Jacobian, and calculate\[c = \int_{a_m}^{b_m}\cdots \int_{a_1}^{b_1} \widetilde J f\ dx_1\cdots dx_m.\]Recall the brief statistical background presented in a previous blog post ("Reconstructing a manifold from sample data, with noise," 2016-05-26). A uniform or constant probability density function is valued the same at every point on its domain.

Proposition: In the setting above:
  • (completely separable) Let $g_1,\dots,g_m$ be probability density functions on $[a_1,b_1],\dots,[a_m,b_m]$, respectively. If $g_1\cdots g_m = \widetilde J f / c$, then the joint probability density function of $g_1,\dots,g_m$ is uniform on $M$ with respect to the metric induced from $\R^n$.
  • (non-separable) Let $g$ be a probability density function on $[a_1,b_1]\times\cdots\times[a_m,b_m]$. If $g=\widetilde J f/c$, then $g$ is uniform on $M$ with respect to the metric induced from $\R^n$.

A much more abstract statement and proof are given in [2], Section 3.2.5, but assuming $f$ is injective and $M$ is in $\R^n$, we evade the worst notation. Section 2.2 of [1] gives a brief explanation of how the given statement follows, while Section 2 of [3] goes into more detail of why the above is true.

Example:
Let $M = S^2$, the sphere of radius $r$, and $f:[0,2\pi)\times [0,\pi) \to \R^3$ the natural embedding given by
\[
(\theta,\varphi) \mapsto (r\cos(\theta)\sin(\varphi),r\sin(\theta)\sin(\varphi), r\cos(\varphi)),
\]with\begin{align*}
Df & = \begin{bmatrix}
-r \sin(\varphi) \sin(\theta) & r \cos(\theta)\sin(\varphi) &  0 \\
r \cos(\varphi) \cos(\theta) & r \cos(\varphi) \sin(\theta) & -r \sin(\varphi)
\end{bmatrix}, & \widetilde Jf & = r^2\sin(\varphi), \\
Df\cdot Df^T & = \begin{bmatrix}
r^2 \sin^2(\varphi) & 0 \\ 0 & r^2
\end{bmatrix}, & c & = 4\pi r^2.
\end{align*}
Let $g_1(\theta) = 1/2\pi$ be the uniform distribution over $[0,2\pi)$, meaning that $g_2(\varphi) = \sin(\varphi)/2$ over $[0,\pi)$. Sampling points randomly from these two distributions and applying $f$ will give uniformly sampled points on $S^2$.

Example: Let $M = T^2$, the torus of major radius $R$ and minor radius $r$, and $f:[0,2\pi)\times [0,2\pi) \to \R^3$ the natural embedding given by
\[
(\theta,\varphi) \mapsto ((R+r\cos(\theta))\cos(\varphi),(R+r\cos(\theta))\sin(\varphi), r\sin(\theta)),
\]with\begin{align*}
Df & = \begin{bmatrix}
-r \cos(\varphi)\sin(\theta) & -r \sin(\varphi) \sin(\theta) & r \cos(\theta) \\
-(R + r \cos(\theta)) \sin(\varphi) & \cos(\varphi) (R + r \cos(\theta)) & 0
\end{bmatrix}, & \widetilde Jf & = r(R+r\cos(\theta)), \\
Df\cdot Df^T & = \begin{bmatrix}
r^2 & 0 \\ 0 & (R + r \cos(\theta))^2
\end{bmatrix}, & c & = 4\pi^2rR.
\end{align*}
Let $g_2(\varphi) = 1/2\pi$ be the uniform distribution over $[0,2\pi)$, meaning that $g_1(\theta) = (1+r\cos(\theta)/R)/(2\pi)$ over $[0,2\pi)$. Sampling points randomly from these two distributions and applying $f$ will give uniformly sampled points on $T^2$.

Below I give a simple implementation of how to actually sample points, in Python using the SciPy package. The functions $f,g_1,\dots,g_m$ are all assumed to be given.

import scipy.stats as st

class var_g1(st.rv_continuous):
    'Uniform variable 1'
    def _pdf(self, x):
        return g1(x)
...
class var_gm(st.rv_continuous):
    'Uniform variable m'
    def _pdf(self, x):
        return gm(x)

dist_g1 = var_g1(a=a1, b=b1, name='Uniform distribution 1')
...
dist_gm = var_gm(a=am, b=bm, name='Uniform distribution m')

def mfld_sample():
    return f(dist_g1.rvs(),...,dist_gm.rvs())
A further application for this would be to understand how to sample points uniformly on projective manifolds, with a leading example the Grassmannian, embedded via Plucker coordinates.

References:
[1] Diaconis, Holmes, and Shahshahani (Sampling from a manifold, Section 2.2)
[2] Federer (Geometric measure theory, Section 3.2.5)
[3] Rhee, Zhou, and Qiu (An iterative algorithm for sampling from manifolds, Section 2)

Thursday, December 8, 2016

The conditioning number of a helix, part 2

Recall the previous attempt to find the conditioning number of a helix (see post "The conditioning number of a helix, part 1," 2016-10-31). Here we complete the approach and although exact solutions are hard to find, we give close approximations.

The setting was a helix $C$ of radius $r$ and stretch $c$, so given as the zero locus of $x-r\cos(z/c)$ and $y-r\sin(z/c)$, and we wanted to find where the normal plane at a point $p\in C$ intersects $C$ again. It may intersect $C$ several times, but we are only interested in the shortest distances. Without loss of generality, assume that $p=(r,0,0)$. The normal plane at $p$ is then given by
\[
0 =
\det\begin{bmatrix}
x-r\cos(p_z/c) & y-r\sin(p_z/c) & z-p_z \\
1 & 0 & r\sin(p_z/c)/c \\
0 & 1 & -r\cos(p_z/c)/c
\end{bmatrix}
=
\det\begin{bmatrix}
x-r & y & z \\
1 & 0 & 0 \\
0 & 1 & -r/c
\end{bmatrix}
=
\frac rc y + z.\]Since the cylinder on which the helix $C$ lies is $x^2+y^2=r^2$, the curve $C'$ representing the intersection of the plane with the cylinder is given by the zero locus of $\pm r\sqrt{x^2-r^2} + cz$. This allows us to find the intersection with the helix. However, since $C$ is parametrized with $z$ the free variable and $C'$ with $x$ free, its is easier to switch to cylindrical coordinates
\[
\left(r = \sqrt{x^2+y^2},\theta = \arctan(y/x), z = z\right).\]Doing so gives a nice description of $C$ and $C'$ as below.\[
\begin{array}{r l c l}
C : &  (r\cos(z/c),r\sin(z/c),z) & = & (r,\theta,\theta c) \\
C' : &  (x,-\sqrt{r^2-x^2},r\sqrt{r^2-x^2}/c) & = & (r.\theta,r^2\sin(\theta)/c)
\end{array}\]The switch in coordinates is represented by the diagram below, where we have only used the top half of $C'$.
Finding $C\cap C'$ is equivalent to solving $\frac{c^2}{r^2} = \frac{\sin(\theta)}\theta$ for $\theta$, a task that can not be solved exactly. Instead we take the tangent lines to $C'$ on the unrolled cylinder at its base, and see where those intersect the line $\theta c$. Inspecting the areas of the tangent lines closer and calculating the euclidean distances in $\R^3$ from $p$ to $a$ and $b$, which is, I can't believe I'm saying this, a great exercise for the reader, we get the distances to be
\[
d(p,a) = \sqrt{2r^2\left(1+\cos\left(\frac{\pi c^2}{r^2-c^2}\right)\right) + \left(\frac{\pi cr^2}{r^2-c^2}\right)^2},
\hspace{.2cm}
d(p,b) = \sqrt{2r^2\left(1-\cos\left(\frac{2\pi c^2}{r^2+c^2}\right)\right) + \left(\frac{2\pi c r^2}{r^2+c^2}\right)^2}.\]Truthfully, the diagrams are tricky to draw in TikZ and I don't want to simply have a scan of some rough work. More importantly, $d(p,a) = d(p,b)$ implies $c = r/\sqrt 3$, meaning that when the stretch $c$ is larger than $r/\sqrt 3$, the normal planes certainly do not intersect the helix again.

Friday, November 18, 2016

Loose ends of smooth manifolds

 Preliminary exam prep

Here we round up some theorems that have escaped previous roundings-up. Let $X,Y$ be smooth manifolds and $f:X\to Y$ a smooth map.

Theorem: (Inverse function theorem) If $df_p$ is invertible for some $p\in M$, then there exist $U\owns p$ and $V\owns f(p)$ connected such that $f|_U:U\to V$ is a diffeomorphism.

Corollary: (Stack of records theorem) If $\dim(X)=\dim(Y)$, then every regular value $y\in Y$ has a neighborhood $V\owns y$ such that $f^{-1}(Y)=U_1\sqcup \cdots \sqcup U_k$, where $f|_{U_i}:U_i\to V$ is a diffeomorphism.

Proof: Since $y\in Y$ is a regular value, $df_x$ is surjective for all $x\in f^{-1}(y)$. Since $\dim(X)=\dim(Y)$ and $df_x$ is linear, $df_x$ is an isomorphism, hence invertible. By the inverse function theorem, there exist $U\owns x$ and $V\owns y$ connected such that $f|_U:U\to V$ is a diffeomorphism. Before we actually apply this, we need to show that $f^{-1}(y)$ is a finite set.

First we note that by the preimage theorem, since $y$ is a regular value, $f^{-1}(y)$ is a submanifold of $X$ of dimension $\dim(X)-\dim(Y)=0$. Next, if $f^{-1}(y) = \{x_i\}$ were infinite, since $X$ is compact, there would be some limit point $p\in X$ of $\{x_i\}$. But then by continuity,
\[
y = \lim_{i\to \infty}\left[f(x_i)\right] = f\left(\lim_{i\to\infty}\left[x_i\right]\right) = f(p),\]so $p\in f^{-1}(y)$. But then either $p$ cannot be separated from other elements of $f^{-1}(y)$, meaning $f^{-1}(y)$ is not a manifold, or the sequence $\{x_i\}$ is finite in length. Hence $f^{-1}(y) = \{x_1,\dots,x_k\}$. Let $U_i\owns x_i$ and $V_i\owns y$ be the sets asserted to exist by the inverse function theorem (the $U_i$ may be assumed to be disjoint without loss of generality). Let $V = \bigcap_{i=1}^k V_i$ and $U_i' = f^{-1}(V)\cap U_i$, for which we still have $f|_{U_i'}:U_i'\to V$ a diffeomorphism. $\square$

Theorem: (Classification of manifolds) Up to diffeomorphism,
  • the only 0-dimensional manifolds are collections of points,
  • the only 1-dimensional manifolds are $S^1$ and $\R$, and
  • the only 2-dimensional compact manifolds are $S^2\# (T^2)^{\#n}$ or $S^2\#(\R\P^2)^{\#n}$, for any $n\geqslant 0$.
Compact 2-manifolds are homeomorphic iff they are both (non)-orientable and have the same Euler characteristic. Note that
\[
\chi\left(S^2\# (T^2)^{\#n}\right) = 2-2n,
\hspace{1cm}
\chi\left(S^2\#(\R\P^2)^{\#n}\right) = 2-n.
\]
These surfaces are called orientable (on the left) and non-orientable (on the right) surfaces of genus $n$.

Theorem: (Stokes' theorem) For $X$ oriented and $\omega\in \Omega^{n-1}_X$, $\int_X d\omega = \int_{\dy X} \omega$.

Proposition: The tangent bundle $TX$ is always orientable.

Proof: Let $U,V\subset X$ with $\vp:U\to \R^n$ and $\psi:V\to \R^n$ trivializing maps, and $\psi\circ \vp^{-1}:\R^n\to \R^n$ the transition function. To show that $TX$ is always orientable, we need to show the Jacobian of the induced transition function (determinant of the derivative) on $TX$ is always non-negative. On $TU$ and $TV$, we have trivializing maps $(\varphi,d\varphi)$ and $(\psi,d\psi)$, giving a transition function
\[
(\psi\circ \varphi^{-1}, d\psi \circ d\varphi^{-1}) = (\psi\circ \varphi^{-1}, d(\psi \circ \varphi^{-1})). 
\]
The Jacobian of this is
\[
\det(d(\psi\circ \varphi^{-1}, d(\psi \circ \varphi^{-1}))) = \det(d(\psi\circ \varphi^{-1}), d(\psi \circ \varphi^{-1}))) = \det(d(\psi\circ \varphi^{-1}))\cdot \det(d(\psi \circ \varphi^{-1})) \>0,
\]
and since $d(\psi\circ \varphi^{-1})\neq 0$ (as $\psi \circ \varphi^{-1}$ is a diffeomorphism, its derivative is an isomorphism), the result is always positive. $\square$

References: Lee (Introduction to smooth manifolds, Chapter 4), Guillemin and Pollack (Differential topology, Chapter 1

Sunday, November 13, 2016

Covering spaces

 Preliminary exam prep

Let $X,Y$ be topological spaces.

Definition: A space $\widetilde X$ and a map $p:\widetilde X\to X$ are called a covering space of $X$ if either of two equivalent conditions hold:
  • There is a cover $\{U_\alpha\}_{\alpha\in A}$ of $X$ such that $p^{-1}(U_\alpha)\cong \bigsqcup_{\beta\in B_\alpha} U_\beta$.
  • Every point $x\in X$ has a neighborhood $U\subset X$ such that $p^{-1}(U) \cong \bigsqcup_{\beta\in B}U_\beta$.
We also demand that every $U_\beta$ is carried homeomorphically onto $U_\alpha$ (or $U$) by $p$, and the $U_\alpha$ (or $U$) are called evenly covered.

Some definitions require that $p$ be surjective. A universal cover of $X$ is a covering space that is universal with respect to this property, in that it covers all other covering spaces. Moreover, a cover that is simply connected is immediately a universal cover.

Remark:
Every path connected (pc), locally path connected (lpc), and semi locally simply connected (slsc) space has a universal cover.

Theorem: (Lifting criterion) Let $Y$ be pc and lpc, and $\widetilde X$ a covering space for $X$. A map $f:Y\to X$ lifts to a map $\widetilde f:Y\to \widetilde X$ iff $f_*(\pi_1(Y))\subset p_*(\pi_1(\widetilde X))$.

Further, if the initial map $f_0$ in a homotopy $f_t:Y\to X$ lifts to $\widetilde f_0:Y\to \widetilde X$, then $f_t$ lifts uniquely to $\widetilde X$. This is called the homotopy lifting property. Next, we will see that path connected covers of $X$ may be classified via a correspondence through the fundamental group.

Theorem:
Let $X$ be pc, lpc, and slsc. There is a bijection (up to isomorphism) between pc covers $p:\widetilde X\to X$ and subgroups of $\pi_1(X)$, described by $p_*(\pi_1(\widetilde X))$.

Example:
Let $X=T^2$, the torus, with fundamental group $\Z\oplus \Z$. Below are some covering spaces of $p:\widetilde X\to X$ with the corresponding subgroups $p_*(\pi_1(\Z\oplus\Z))$.
Definition: Given a covering space $p:\widetilde X\to X$, an isomorphism $g$ of $\widetilde X$ for which $\id_X\circ p = p\circ g$, is called a deck transformation, the collection of which form a group $G(\widetilde X)$ under composition. Further, $\widetilde X$ is called normal (or regular) if for every $x\in X$ and every $\widetilde x_1,\widetilde x_2\in p^{-1}(x)$, there exists $g\in G(\widetilde X)$ such that $g(\widetilde x_1)=\widetilde x_2$.

For path connected covering spaces over path connected and locally path connected bases, being normal is equivalent to $p_*(\pi_1(\widetilde X))\leqslant  \pi_1(X)$ being normal. In this case, $G(\widetilde X)\cong \pi_1(X)/p_*(\pi_1(\widetilde X))$. This simplifies even more for $\widetilde X$ a universal cover, as $\pi_1(\widetilde X)=0$ then.

Theorem: Let $G$ be a group, and suppose that every $x\in X$ has a neighborhood $U\owns x$ such that $g(U)\cap h(U) = \emptyset$ whenever $g\neq h\in G$. Then:
  • The quotient map $q:X\to X/G$ describes a normal cover of $X/G$.
  • If $X$ is pc, then $G = G(X)$.
A group action satisfying the hypothesis of the previous theorem is called a covering space action.

Proposition: For any $n$-sheeted covering space $\widetilde X\to X$ of a finite CW complex, $\chi(\widetilde X) = n\chi(X)$.

References: Hatcher (Algebraic Topology, Chapter 1)

Thursday, November 10, 2016

Differential 1-forms are closed if and only if they are exact

 Preliminary exam prep

The title refers to 1-forms in Euclidean $n$-space $\R^n$, for $n\geqslant 2$. This theorem is instructive to do in the case $n=2$, but we present it in general. We will use several facts, most importantly that the integral of a function $f:X\to Y$ over a curve $\gamma:[a,b]\to X$ is given by
\[
\int_\gamma f\ dx_1\wedge \cdots \wedge dx_k = \int_a^b (f\circ \gamma)\ d(x_1\circ \gamma)\wedge \cdots \wedge d(x_n\circ \gamma),
\]
where $x_1,\dots,x_n$ is some local frame on $X$. We will also use the fundamental theorem of calculus and one of its consequences, namely
\[
\int_a^b \frac{\dy f}{\dy t}(t)\ dt = f(b)-f(a).
\]

Theorem:
A 1-form on $\R^n$ is closed if and only if it is exact, for $n\geqslant 2$.

Proof: Let $\omega = a_1dx_1+\cdots a_ndx_n\in \Omega^1_{\R^n}$ be a 1-form on $\R^n$. If there exists $\eta\in \Omega^0_{\R^n}$ such that $d\eta = \omega$, then $d\omega = d^2\eta = 0$, so the reverse direction is clear. For the forward direction, since $\omega$ is closed, we have
\[
0 = d\omega = \sum_{i=1}^n \frac{\dy a_1}{\dy x_i}dx_i \wedge dx_1 + \cdots + \sum_{i=1}^n \frac{\dy a_n}{\dy x_n} dx_i\wedge dx_n
\ \ \ \implies\ \ \
\frac{\dy a_i}{\dy x_j} = \frac{\dy a_j}{\dy x_i}\ \forall\ i\neq j.
\]
Now fix some $(\textbf{x}_1,\dots,\textbf{x}_n)\in \R^n$, and define $f\in \Omega^0_{\R^n}$ by
\[
f(\textbf x_1,\dots,\textbf x_n) = \int_{\gamma(\textbf x_1,\dots,\textbf x_n)}\omega,
\]
for $\gamma$ the composition of the paths
\[
\begin{array}{r c l}
\gamma_1\ :\ [0,\textbf x_1] & \to & \R^n, \\
t & \mapsto & (t,0,\dots,0),
\end{array}
\hspace{5pt}
\begin{array}{r c l}
\gamma_2\ :\ [0,\textbf x_2] & \to & \R^n, \\
t & \mapsto & (\textbf x_1,t,0,\dots,0),
\end{array}
\hspace{5pt}\cdots\hspace{5pt}
\begin{array}{r c l}
\gamma_n\ :\ [0,\textbf x_n] & \to & \R^n, \\
t & \mapsto & (\textbf x_1,\dots,\textbf x_{n-1},t).
\end{array}
\]
By applying the definition of a pullback and the change of variables formula (use $s=\gamma_i(t)$ for every $i$),
\begin{align*}
\int_{\gamma(\textbf x_1,\dots,\textbf x_n)}\omega  & = \sum_{i=1}^n \int_{\gamma_i} a_1 dx_1 + \cdots + \sum_{i=1}^n \int_{\gamma_i}a_n dx_n \\
& = \sum_{i=1}^n \int_{\gamma_i} a_1(x_1,\dots,x_n)\ dx_1 + \cdots + \sum_{i=1}^n \int_{\gamma_i}a_n(x_1,\dots,x_n)\ dx_n \\
& = \sum_{i=1}^n \int_0^{\textbf x_i} a_1(\gamma_i(t))\ d(x_1\circ \gamma_i)(t) + \cdots + \sum_{i=1}^n \int_0^{\textbf x_i}a_n(\gamma_i(t))\ d(x_n\circ \gamma_i)(t) \\
& = \int_0^{\textbf x_1} a_1(\gamma_1(t))\gamma'_1(t)\ dt + \cdots + \int_0^{\textbf x_n}a_n(\gamma_n(t))\gamma_n'(t)\ dt \\
& = \int_{(0,\dots,0)}^{(\textbf x_1,0,\dots,0)} a_1(s)\ ds + \cdots + \int_{(\textbf x_1,\dots,\textbf x_{n-1},0)}^{(\textbf x_1,\dots,\textbf x_n)}a_n(s)\ ds \\
& = \int_0^{\textbf x_1} a_1(s,0,\dots,0)\ ds + \cdots + \int_0^{\textbf x_n}a_n(\textbf x_1,\dots,\textbf x_{n-1}, s)\ ds.
\end{align*}
To take the derivative of this, we consider the partial derivatives first. In the last variable, we have
\[
\frac{\dy f}{\dy \textbf x_n} = \frac\dy{\dy \textbf x_n}\int_0^{\textbf x_n}a_n(\textbf x_1,\dots,\textbf x_{n-1}, s)\ ds = a_n(\textbf x_1,\dots,\textbf x_n) = a_n.
\]
In the second-last variable, applying one of the identities from $\omega$ being closed, we have
\begin{align*}
\frac{\dy f}{\dy \textbf x_{n-1}}  & = \frac\dy{\dy \textbf x_{n-1}}\int_0^{\textbf x_{n-1}}a_{n-1}(\textbf x_1,\dots,\textbf x_{n-2}, s,0)\ ds  +  \frac\dy{\dy \textbf  x_{n-1}}\int_0^{\textbf x_n}a_n(\textbf x_1,\dots,\textbf x_{n-1}, s)\ ds \\
& = a_{n-1}(\textbf x_1,\dots,\textbf x_{n-1},0) + \int_0^{\textbf x_n}\frac{\dy a_n}{\dy \textbf x_{n-1}}(\textbf x_1,\dots,\textbf x_{n-1}, s)\ ds \\
& = a_{n-1}(\textbf x_1,\dots,\textbf x_{n-1},0) + \int_0^{\textbf x_n}\frac{\dy a_{n-1}}{\dy s}(\textbf x_1,\dots,\textbf x_{n-1}, s)\ ds \\
& = a_{n-1}(\textbf x_1,\dots,\textbf x_{n-1},0) + a_{n-1}(\textbf x_1,\dots,\textbf x_n) - a_{n-1}(\textbf x_1,\dots,\textbf x_{n-1}, 0) \\
& = a_{n-1}(\textbf x_1,\dots, \textbf x_n) \\
& = a_{n-1}.
\end{align*}
This pattern continues. For the other variables we have telescoping sums, and we compute the partial derivative in the first variable as an example:
\begin{align*}
\frac{\dy f}{\dy \textbf x_1}  & = \frac{\dy}{\dy \textbf x_1}\int_0^{\textbf x_1}a_1(s,0,\dots,0)\ ds + \sum_{i=2}^n\frac\dy{\dy \textbf x_1}\int_0^{\textbf x_i}a_i(\textbf x_1,\dots,\textbf x_{i-1}, s,0,\dots,0)\ ds \\
& = a_1(\textbf x_1,0,\dots,0) + \sum_{i=2}^n \int_0^{\textbf x_i} \frac {\dy a_i}{\dy \textbf x_1} (\textbf x_1,\dots,\textbf x_{i-1}, s,0,\dots,0)\ ds \\
& = a_1(\textbf x_1,0,\dots,0) + \sum_{i=2}^n \int_0^{\textbf x_i} \frac {\dy a_1}{\dy s} (\textbf x_1,\dots,\textbf x_{i-1}, s,0,\dots,0)\ ds \\
& = a_1(\textbf x_1,0,\dots,0) + \sum_{i=2}^n \left(a_1(\textbf x_1,\dots,\textbf x_i, 0,\dots,0) - a_1(\textbf x_1,\dots,\textbf x_{i-1},0,\dots,0)\right) \\
& = a_1(\textbf x_1,\dots,\textbf x_n) \\
& = a_1.
\end{align*}
Hence we get that
\[
df = \frac{\dy f}{\dy x_1} dx_1 + \cdots + \frac{\dy f}{\dy x_n}dx_n = a_1dx_1 + \cdots + a_ndx_n = \omega,
\]
so $\omega$ is exact. $\square$

References: Lee (Introduction to smooth manifolds, Chapter 11)

Tuesday, November 8, 2016

More (co)homological constructions

 Preliminary exam prep

Recall a previous post (2016-09-16, "Complexes and their homology") that focused on constructing topological spaces in different ways and recovering the homology. Here we complete that task, introducing cellular homology. Recall a cell complex (or CW complex) $X$ was a sequence of skeleta $X_k$ for $k=0,\dots,\dim(X)$ consisting of $k$-cells $e^k_i$ and their attaching maps to the $(k-1)$-skeleton.

Cellular homology


Definition: The long exact sequence in relative homology for the pair $X_k,X_{k-1}$ shares terms with the long exact sequence for the pair $X_{k+1},X_k$, as well as $X_{k-1},X_{k-2}$. By letting $d_k$ be the composition of maps in different long exact sequences, for $k>1$, that make the diagram
commute, we get a complex of equivalence classes of chains
\[
\cdots \to H_{k+1}(X_{k+1},X_k) \tov{d_{k+1}} H_k(X_k,X_{k-1})\tov{d_k} H_{k-1}(X_{k-1},X_{k-2})\to \cdots \to H_1(X_1,X_0)\tov{d_1} H_0(X_0) \tov{d_0} 0,
\]
whose homology $H_k^{CW}(X) = \ker(d_k)/\text{im}(d_{k-1})$ is called the cellular homology of $X$. The map $d_1$ is the connecting map in the long exact sequence of the pair $X_1,X_0$, and $d_0=0$.

This seems quite a roundabout way of defining homology groups, but it turns out to be very useful. Note that for $k=1$, the map $d_1$ is the same as for a simplicial complex, hence

Theorem:
In the context above,
  1. for $k\>0$, $H^{CW}_k(X)\cong H_k(X)$;
  2. for $k\>1$, $H_k(X_k,X_{k-1})=\Z^\ell$, where $\ell$ is the number of $k$-cells in $X$; and
  3. for $k\>2$, $d_k(e^k_i) = \displaystyle\sum_j\deg(\underbrace{\dy e^k_i}_{S^{k-1}}\tov{f_{k,i}} X_{k-1}\tov{\pi} \underbrace{X_{k-1}/X_{k-1}-e^{k-1}_j}_{S^{k-1}})e^{k-1}_j$.
Example: Real projective space $\R\P^n$ has a cell decomposition with one cell in each dimension, and 2-to-1 attaching maps $\dy(e_k) =2X_{k-1}$ for $k>1$. This gives us a construction
\[
X_0 = e_0,
\hspace{1cm}
X_1 = e_1 \bigsqcup_{\dy(e_1)=e_0} X_0,
\hspace{1cm}
X_2 = e_2 \bigsqcup_{\dy(e_2)=2e_1} X_1,
\hspace{1cm}
X_3 = e_3 \bigsqcup_{\dy(e_3)=2e_2} X_2, \dots
\]It is immediate that $d_0=d_1=0$, and for higher degrees, we have
\[
d_k(e^k) = \deg(S^{k-1}\to \R\P^{k-1}\to S^{k-1})e^{k-1}.\]
Since this is a map between spheres, we may apply local degree calculations. The first part is the 2-to-1 cover, where every point in $\R\P^{k-1}$ is covered by two points from $S^{k-1}$, one in each hemisphere. One covers it via the identity, the other via the antipodal map. As long as we choose a point not in $\R\P^{k-2}\subset \R\P^{k-1}$, the second step doesn't affect these degree calculations. The antipodal map $S^{k-1}\to S^{k-1}$ has degree $(-1)^k$, hence for $a$ the antipodal map, the composition has degree
\[
\deg(S^{k-1}\to \R\P^{k-1}\to S^{k-1}) = \deg(\id_{S^{k-1}}) + \deg(a_{S^{k-1}}) = 1+(-1)^k = \begin{cases} 2 & k\text{ even}, \\ 0 & k \text{ odd.}\end{cases}
\]

Products in (co)homology


Recall that an $n$-chain on $X$ is a map $\sigma:\Delta^n\to X$, where $\Delta^n=[v_0,\dots,v_n]$ is an $n$-simplex. These form the group $C_n$ of $n$-chains. An $n$-cochain is an element of $C^n = \Hom(C_n,\Z)$, though the coefficient group does not need to be $\Z$ necessarily.

Definition: The diagonal map $X\to X\times X$ induces a map on cohomology $H^*(X\times X)\to H^*(X)$, and by Kunneth, this gives a map $H^*(X)\otimes H^*(X)\to H^*(X)$, and is called the cup product.

For $a\in H^p(X)$ and $b\in H^q(X)$, representatives of the class $a$ are in $\Hom(C_p,\Z)$ and representatives of the class $b$ are in $\Hom(C_q,\Z)$, though we will conflate the notation for the class with that of a representative. Hence for a $(p+q)$-chain $\sigma$ the cup product of $a$ and $b$ acts as
\[
(a\smile b)\sigma = a\left(\sigma|_{[v_0,\dots,v_p]}\right)\cdot b\left(\sigma|_{[v_p,\dots,v_{p+q}]}\right).
\]
Definition: The cap product combines $p$-cochains with $q$-chains to give $(q-p)$-chains, by
\[
\begin{array}{r c l}
\frown\ :\ H^p(X) \times H_q(X) & \to & H_{q-p}(X), \\\
(a, \sigma) & \mapsto & a\left(\sigma|_{[v_0,\dots,v_p]}\right)\cdot \sigma|_{[v_p,\dots,v_q]}.
\end{array}\]
The cap product with the orientation form of an orientable manifold $X$ gives the isomorphism of Poincare duality.

Remark: Given a map $f:X\to Y$, the cup and cap products satisfy certain identities via the induced map on cohomology groups. Let $a,b\in H^*(Y)$ and $c\in H_*(X)$ be cochain and chain classes, for which
\[f^*(a\smile b) = f^*(a)\smile f^*(b),
\hspace{1cm}
a\frown f_*c = f_*(f^*a\frown c).\]
The first identity asserts that $f^*$ is a ring homomorphism and the second describes the commutativity of an appropriate diagram. The cup and cap products are related by the equation
\[a(b\frown \sigma) = (a\smile b)\sigma,\]for $a\in H^p$, $b\in H^q$ and $\sigma\in C_{p+q}$.

References: Hatcher (Algebraic topology, Chapter 2.2), Prasolov (Elements of homology theory, Chapter 2)