Čech Cohomology for Physicists
Our motivation comes from wanting to put Spinors on Curved Spacetime (an upcoming blog)
Theorem: A spin structure on an orientable Riemannian manifold exists iff the second Stiefel-Whitney class $\check H^2 (M, \mathbb Z_2) $ vanishes.
Let’s unpack this theorem.
The Stiefel-Whitney class is the Čech cohomology class $\check H(M, G)$ with abelian group $G=\mathbb Z_2$.
Motivation
Here is an extremely brief intuition for Čech cohomology.
Suppose we want to define a function on $[0,1]$. Since this space can be covered by one chart, we can just define $f:[0,1] \rightarrow \mathbb R$.
However, suppose the domain of the function we want to define cannot be covered by one chart alone. For example it is $S^1$, which can only be covered by at least 3 charts. (Not 2 because we want a good covering meaning that intersections are contractible.)
Anyway, let’s start simple and say that $[0,1]$ is covered by $U=[0,0.6]$ and $V=[0.4, 1]$. If we have 2 functions $f_U:U\to\mathbb R$ and $f_V:V\to\mathbb R$, then our life would be really easy if the functions agreed pointwise on the intersection $U\cap V$
\[f_U\vert_{U\cap V} = f_V\vert_{U \cap V}\]In which case we can just define $f: U \cup V \to \mathbb R$ by $f(U\backslash U \cap V) = f_U$ and $f(V\backslash U\cap V) = f_V$ and pick either $f_U$ or $f_V$ on the intersection.
But sometimes life isn’t that easy and they disagree on their intersection. Well not all is lost. In the definition of manifolds, the coordinate atlas have transition maps $\phi_i \circ \phi_j^{-1}: \mathbb R^d \to \mathbb R^d$ between different coordinate charts. In the definition of sections (not global sections) of vector bundles, $\sigma_j(m) = \sigma_i(m) \bullet_R t_{ij}(m)$ where $t_{ij}(m) \in G$ is the transition map acting on vector fibers (source). We can still do calculations as long as there is a specified way to move calculations from one chart to another.
In our case of real-valued functions, the transition is just
\[(\delta f)_{U \cap V} := f_V\vert_{U\cap V} - f_U\vert_{U \cap V}\]The Čech differential is a symbol that we use to “generate” transition functions. This is a very specific case of the Čech differential $\delta$.
Breaking Down Definitions
The Čech Differential on Wikipedia seems a lot more than what we have just defined. And it is! But let’s try to break down the wiki definition.
Cochain
Math: The cochain complex $C^\bullet(\mathcal U, \mathcal F)$ is a sequence of $q$-cochain $C^q(\mathcal U, \mathcal F)$ with a coboundary operator $\delta_q:C^q(\mathcal U, \mathcal F) \to C^{q+1}(\mathcal U, \mathcal F)$.
English: There is a sequence of abelian groups (explained soon) with a linear operator going down the sequence in one direction. An example would be the
\[(\delta f)_{U \cap V} := f_V\vert_{U\cap V} - f_U\vert_{U \cap V}\]we just defined. Linearity would entail that \(\delta (f+_q g) = \delta(f) +_{(q+1)} \delta(g)\) where the addition $+_k$ is the addition in abelian group $C^k(\mathcal U, \mathcal F)$.
Presheaf and Restriction Morphism
Math: $\mathcal F$ is the presheaf of abelian groups on topological space $X$. For each inclusion of open sets $V \subset U$ of $X$, there is a restriction morphism \(\text{res}_{V,U}: F(U) \to F(V)\) where $F(U)$ is the set of sections of $F$ over $U$.
English: $X$ has a topology which means it has a collection $\mathcal O_X$ of open sets $U_\alpha$ that are closed under finite intersection. It is NOT enough that we assign a function $f:U \to \mathbb R$ on every $U \in \mathcal O_X$ because we mathematicians like to make things as abstract as possible. Instead, we first say that every open set $U \in \mathcal O_X$ has a possibly different codomain $F(U)$. This is akin to saying that $f_1:(0,1) \to \mathbb Z =: F((0,1))$ and $f_2:(0,0.5) \to \mathbb Z_2 =: F((0,0.5))$ for a space $X=\mathbb R$ with the standard topology. This raises concern because now we can’t naively restrict $f_1$ to a smaller domain $(0,0.5)$ by defining \(f_1 \vert_{(0,0.5)}\) pointwise $\mathbb Z \not \subset\mathbb Z_2$. This is why we need a restriction morphism \(\text{res}_{(0,1), (0,0.5)}: \mathbb Z \to \mathbb Z_2\).
This seems like alot of data to provide, and it is: that is the cost of generality. In our case of the spin structure, all codomains are just $\mathbb Z_2$ so we won’t need to worry about the restriction morphisms (which are just identity on $Z_2$). And indeed in our $\delta f$ example, we mean the trivial restriction with values in $F(U) = \mathbb R$.
An interesting example of a restriction morphism is in twisted Čech cohomology. In this example twisted cohomology over $S^1$ roughly corresponds to the Mobius strip.
Differential
Math:
\[\begin{aligned} \partial_j \sigma&:=\left(U_i\right)_{i \in\{0, \ldots, q\} \backslash\{j\}}\\ \partial \sigma&:=\sum_{j=0}^q(-1)^{j+1} \partial_j \sigma\\ \left(\delta_q f\right)(\sigma)&:=\sum_{j=0}^{q+1}(-1)^j \operatorname{res}_{\vert\sigma\vert}^{\left\vert\partial_j \sigma\right\vert} f\left(\partial_j \sigma\right) \end{aligned}\]English: $\sigma$ is a collection of open sets (NOT the intersection YET). $\vert\sigma\vert$ is the intersection of this collection. $\partial_j \sigma$ drops the $U_j$ from the collection. So $\partial_j \sigma$ is a (smaller) subcollection of $\sigma$.
The intersection of the collection \(\vert\partial_j \sigma\vert\) is hence a larger open set than \(\vert\sigma\vert\) because we have “dropped” one open set $U_j$ in the intersection. Hence restriction morphism goes from the set of functions on \(\vert\partial_j \sigma\vert\) to the set of functions on \(\vert\sigma\vert\).
In the definition above, what is the addition? It occurs in the set of sections/functions (I use them interchangeably) on an open set. Clearly, if we have a 2 functions on $U\cap V$, we can just add them pointwise.
This also means that a function on $f: U \to F(U)$ and $g:V \to F(V)$, then after applying the restriction morphism on them \(\text{res}_{U, U \cap V} : F(U) \to F(U \cap V)\) and $\text{res}_{V, U\cap V} : F(V) \to F(U \cap V)$, we can add
\[[\text{res}_{U, U \cap V} \circ f] + [\text{res}_{V, U\cap V} \circ g]\]Simplex / Simplices
Math: Let $\mathcal U$ be an open cover of $X$. A $q$-simplex is an ordered collection of $q+1$ open sets from $\mathcal U$ with non-empty intersection.
English: Suppose $U,V,W$ is an open cover of the topological space of interest. 1-simplices would be $U\cap V$, $U\cap W$, $V \cap W$. 2-simplices would be $U \cap V \cap W$.
Cochain
Math: A $q$-cochain of $\mathcal U$ with coefficients in $\mathcal F$ is a map which associates each $q$-simplex $\sigma$ an element of $\mathcal F(\vert\sigma\vert)$, and we denote the set of all $q$-cochains with coefficients in $\mathcal F$ by $C^q(\mathcal U, \mathcal F)$. $C^q(\mathcal U, \mathcal F)$ is an abelian group by pointwise addition.
English: Above we wrote $f,g$ as separate functions on open sets $U,V$ respectively. We can pack them together into a 0-cochain $\omega$ in $C^0(\mathcal U, \mathcal F)$ by a linear combination. Personally I like to think of 0-cochains as symbolic linear combination of functions that are defined on any 0-simplex $U, V$. So a 0-cochain might be $f+g$ while another is $2f - 4g$.
Cocycle
Math: A $q$-cochain is called a $q$-cocycle if it is the kernel of $\delta_{q}$. We denote this a $Z^q(\mathcal U, \mathcal F) := \ker (\delta_q) \subseteq C^q (\mathcal U, \mathcal F)$.
English: A good example would be the $f,g$ which we packaged into a 0-cochain $\omega = f+g$ above. Applying the differential on the 0-cochain gives us
\[\begin{aligned} (\delta_0 \omega)(U \cap V) = g\vert_{U \cap V}(U \cap V) - f\vert_{U \cap V}(U \cap V) \end{aligned}\]If $\omega \in \ker \delta_0$, then that would imply $f = g$ agree on the intersection. So $\omega$ is a “global” section.
If we had another 0-cochain $2f - 4g$ instead, then
\[\begin{aligned} (\delta_0 (2f - 4g))(U \cap V) = 4g\vert_{U \cap V}(U \cap V) - 2f\vert_{U \cap V}(U \cap V) \end{aligned}\]Another example that hits close to home is appears in (abelian) gauge theory. The transition functions between local trivializations of a principal bundle need to obey the cocycle condition to be well defined
\[g_{ab} g_{bc} = g_{ac}\]We can package all the transition functions on the intersections of 2 open sets into a single 1-cochain $g$, a collection of functions $g_{ij}$ on 1-simplicies, which are intersections of 2 open sets $U_i \cap U_j$. The gauge cocycle condition can be rephrased as the statement that the 1-cochain $g$ is a 1-cocycle
\[0 = (\delta_1g)(U_a \cap U_b \cap U_c) = g_{bc} - g_{ac} + g_{ab}\]where we have written it additively for an abelian gauge group.
Cohomology
The Čech differential squares to $0$, the identity element in the abelian group. i.e. $\delta_{q+1} \circ \delta_q = 0$
Any time an operator squares to $0$, homology can be defined. Of course whether the homology is actually nontrivial is something else one needs to investigate.
Example 1: $\check H^*(D_1, \mathbb{R})$
This example builds intuition for the differential.
Let’s work with abelian group $\mathbb R$ and trivial restriction morphisms. We consider the topological space to be open disk $D_1$.
Suppose we have 3 charts $U,V,W$ covering $D_1$ (Venn diagram style). Suppose we have a 0-cochain $f$ (a generalized notion of function on $D_1$) consisting of $f_U: U\to \mathbb R$, $f_V: V \to \mathbb R$, $f_W: W \to \mathbb R$. These 3 functions are different functions, NOT a single global function restricted to the 3 charts.
There are transition functions between $U,V$, i.e.
\[(\delta_0 f) (U \cap V) = f_V (U \cap V) - f_U (U \cap V) =: f_{VU}\]and likewise for $f_{UW}, f_{VW}$. These 3 transition functions could clearly be nonzero (nobody said $f$ is a 0-cocycle). We can package these 3 transition functions up into a 1-cochain. Then one observes that this 1-cochain is a 1-cocycle.
\[\begin{aligned} (\delta_1 (\delta_0 f))(U \cap V \cap W) &= f_{VW} - f_{UW} + f_{UV} \\ &= (f_V - f_W) - (f_U - f_W) + (f_U - f_V) \\ & = 0 \end{aligned}\]where the evaluation on $U \cap V \cap W$ is suppressed on the RHS.
However, the cochain is a very huge space if we choose the abelian group to be the set of real numbers. There are many many functions. So in the next example, we will restrict to constant functions.
Example 2: $\check H^*(D_1, \underline{\mathbb R})$
This example will recover de Rham cohomology.
We work with abelian group $\underline{\mathbb R}$ of constant functions and trivial restriction morphisms. Considering the space $X=D_1$, the 0-cochain is specified by 3 real numbers $f_U, f_V, f_W$ so $C^0 (\mathcal U, \underline {\mathbb R}) \cong \mathbb R^3$. Likewise, $C^1 (\mathcal U, \underline {\mathbb R}) \cong \mathbb R^3$ is spanned by $f_{UV}, f_{UW}, f_{VW}$.
Showing $\check H^0(D_1, \underline{\mathbb R}) \cong \mathbb R$
If we represent $\delta_0$ as a matrix we have
\[\begin{aligned} (\delta_0)_{ij} & = \left(\begin{array}{ccc} 1 & -1 & 0 \\ 1 & 0 & -1 \\ 0 & 1 & -1 \end{array}\right)_{ij}\\ \left(\begin{array}{c} (\delta_0 f)_{UV} \\ (\delta_0 f)_{UW} \\ (\delta_0 f)_{VW} \end{array}\right) & = \left(\begin{array}{ccc} 1 & -1 & 0 \\ 1 & 0 & -1 \\ 0 & 1 & -1 \end{array}\right)\left(\begin{array}{c} f_U \\ f_V \\ f_W \end{array}\right) \end{aligned}\]The null space $\ker \delta_0 \cong \text{span}(f_U + f_V + f_W)$ is 1-dimensional. So $Z^0(\mathcal U, \underline{\mathbb R}) \cong \mathbb R$.
The $B^0(\mathcal U, \underline{\mathbb R}) \cong \text{im } \delta_{-1}$ doesn’t exist, so $ \check H^0(\mathcal U, \underline{\mathbb R}) \cong Z^0(\mathcal U, \underline{\mathbb R}) \cong \mathbb R$.
Showing $\check H^1(D_1, \underline{\mathbb R}) \cong \mathbb 0$
To find $\check H^1 \cong Z^1 / B^1$, we need to calculate $\ker \delta_1$ and $\text{im } \delta_0$. By rank nullity theorem,
\[\begin{aligned} \dim \text{im } \delta_0 & = \dim C^0 - \dim \ker \delta_0 \\ & = 3 - 1 \\ & = 2 \end{aligned}\]Now to calculate $\ker \delta_1$ we again to the matrix form
\[\begin{aligned} (\delta_1)_{ij} & = \left(\begin{array}{ccc} 1 & -1 & 1 \end{array}\right)_{ij}\\ \left(\begin{array}{c} (\delta_1 f)_{UVW} \end{array}\right) & = \left(\begin{array}{ccc} 1 & -1 & 1 \end{array}\right)\left(\begin{array}{c} f_{UV} \\ f_{UW} \\ f_{VW} \end{array}\right) \end{aligned}\]The null space of this linear transformation is spanned by 2 vectors $\ker \delta_1 \cong \text{span}{(1,1,0), (-1,0,1)}$. So $\dim \ker \delta_1 = 2$.
So $\check H^1(\mathcal U, \underline{\mathbb R}) \cong 0$. There is a nuance I glossed over in which technically speaking cohomology of the topological space $\check H^1(D_1) = \lim_{\rightarrow \mathcal U} (\check H(\mathcal U))$ is the direct limit of the open covers $\mathcal U$ (see details). We did not prove that our choice of covering is in fact the limit.
Showing $\check H^2(D_1, \underline{\mathbb R}) \cong \mathbb 0$
Since $\delta_2: C^2(D_1, \underline{\mathbb R}) \to 0$, the kernel $\ker \delta_2 \cong C^2$ is just the entire space, which has dimension 1 spanned by $f_{UVW}$.
Then first isomorphism theorem (rank nullity if talking about dimension) tells us that $\text{im } \delta_1 \cong \mathbb R$ since $\ker \delta_1 \cong \mathbb R^2$ and $C^1 \cong \mathbb R^3$.
Hence $\check H^2(D_1, \underline{\mathbb R}) \cong \mathbb \ker \delta_2 / \text{im }\delta_1 \cong \mathbb R / \mathbb R \cong 0$.
Agreement with de Rham cohomology
A theorem says that de Rham cohomology agrees with constant sheaf Čech cohomology \(H^*_{dR}(M) \cong \check H^* (M, \underline{\mathbb R})\).
Example 3: $\check H^*(S^1, \underline{\mathbb R})$
Let’s calculate de Rham cohomology of $S^1$. The only difference between $S^1$ and the $D_1$ derived above is that $C^2(D_1,\underline{\mathbb R}) \cong \mathbb R$ is spanned by $f_{UVW}$ but $C^2(S^1, \underline{\mathbb R}) \cong \mathbb 0$ because the intersection $U\cap V \cap W = 0$ vanishes on $S^1$. This means we only need to recalculate $\check H^1(S^1, \underline{\mathbb R})$.
Showing $\check H^1(S^1, \underline{\mathbb R}) \cong \mathbb R$
Since $B^1 = \text{im } \delta_0$ remains 2 dimensional, we just need to recalculate $Z^1 = \ker \delta_1$. However, $\delta_1 : \mathbb C^1 \to 0$, so the kernel is just the entire $C^1 \cong \mathbb R^3$. Hence $\check H^1 \cong Z^1 / B^1 \cong \mathbb R$.
$\check H^0, \check H^2$ are the same as that of $D_1$
The rest stay the same i.e. $\check H^0(S^1, \underline{\mathbb R}) \cong \mathbb R$ and $\check H^2(S^1, \underline{\mathbb R}) \cong 0$
Agreement with de Rham
It coincides with \(H^0_{dR}(S^1) \cong \mathbb R\) and \(H^1_{dR}(S^1) \cong \mathbb R\) and \(H^2_{dR}(S^1) \cong \mathbb 0\) (source).
Example 4: \(\check H^*(S^1, \mathbb Z_2)\)
In our effort to build towards orientability of manifolds, we will run through a simple calculation of $S^1$ first.
The calculations with \(\check H^*(S^1, \mathbb Z_2)\) are virtually identical to that of $\check H^*(S^1, \underline{\mathbb R})$, just that the kernel $\ker \delta_0$ looks like vectors of the form $f_U = f_V = f_W\ (\text{mod } 2)$ instead of equality. This means that the vector space $Z^0 = \ker \delta_0 \cong \mathbb Z_2$, instead of $\mathbb R$.
After minimal effort we get $\check H^0(S^1, \mathbb Z_2) \cong \check H^1(S^1, \mathbb Z_2) \cong \mathbb Z_2$. It will turn out that $\check H^1(S^1, \mathbb Z_2)$ is related to orientability and the fact that there are 2 line bundles over $S^1$: the trivial line bundle (cylinder) and the Mobius strip.
We also see that $\check H^2(S^1, \mathbb Z_2) \cong 0$, and this will turn out to be related to the statement that you can put a spin structure on $S^1$.
Stiefel Whitney Class
Explanation
A small digression on what it is.
Math: For a real vector bundle $E \to X$, the Stiefel-Whitney class of $E$ is denoted by $w(E)$. It is an element of the cohomology ring
\[H^{\ast }(X;\mathbb {Z} /2\mathbb {Z} )=\bigoplus _{i\geq 0}H^{i}(X;\mathbb {Z} /2\mathbb {Z} )\]so an element of the class is the a sum
\[w(E)=w_0(E)+w_1(E)+w_2(E)+\cdots\]where each $w_i(E) \in H^i (X; \mathbb Z/2\mathbb Z)$.
English: Remember that the sum we see in $w(E)$ is a formal sum, meaning that $w_0(E)$ and $w_1(E)$ don’t live in the same vector space but rather in the direct sum $H_0 \oplus H_1$. So it is more like a “tuple” of elements than a sum.
The cohomology ring (video) $H^{\ast }(X;\mathbb {Z} /2\mathbb {Z} )$ is basically just this direct sum $\oplus$ of the sequence of cohomology groups $H^{i}(X;\mathbb {Z} /2\mathbb {Z} )$. The sum has some additional structure like cup product that gives this ring a grading, but that isn’t our immediate concern now.
Each cohomology group (video) $H^i(X; \mathbb Z / 2 \mathbb Z)$ is a set of $\mathbb Z_2$-valued “functions” on $X$ (satisfying some conditions, cocycle but not coexact to be precise). The “functions” is in quotes because strictly speaking it is the (dual) group of homomorphisms $C^*_i := \text{Hom}(C_i, A)$ where $C_i$ is the singular chain complex. Read more about it in cohomology.
Pedantic Note
that the Stiefel-Whitney class is calculated on the vector bundle, but it produces values in the cohomology ring of the base manifold. This means that when people say “first Stiefel-Whitney class vanishes” they mean that the class’ value in the cohomology ring is $0$. Nobody needs the cohomology ring itself to be the $0$ vector space. Analogy: we mean to say the vector is the zero vector, not that the entire vector space has dimension 0. Vanishing characteristic class is a property of the vector bundle, NOT the manifold. When people say the characteristic class vanishes for the manifold, they usually mean the tangent bundle of the manifold.
Example
First Stiefel-Whitney class of the Möbius strip has just one element other than 0, while that of the trivial line bundle over $S^1$ is $0$. So the Möbius strip is a nontrivial line bundle over $S^1$.
Significance in Physics
First Stiefel-Whitney class tells us whether a manifold is orientable.
Second Stiefel-Whitney class tells us whether a manifold has a spin structure.
Both are required to vanish to put spinors on a manifold, which is what we need if we were to describe fermions in curved spacetime.
First Stiefel Whitney Class $w_1(TM) \in \check H^1(M, \mathbb Z_2)$
These paper, notes, best notes are good resources on this.
There are multiple equivalent definitions of orientability of a manifold, we mention the following two.
Definition 1.4 of ncatlab: An orientation of $M$ is an orientation of the tangent bundle $TM$.
Definition using $GL^+(n)$: If the tangent bundle $TM$ has a structure group $GL(n, \mathbb R)$ that can be reduced to $GL^+(n, \mathbb R)$ of positive determinant matrices, then the manifold is said to be orientable.
Theorem: A manifold is orientable iff the first Stiefel Whitney class $w_1(TM) \in H^1(M; \mathbb Z_2)$ of the tangent bundle $TM$ vanishes.
A proof can be found in Corollary 2.16 of this with $E=TM$
Intuition
For better intuition about this, one can actually prove that a trivial cohomology $H^1(M; \mathbb Z_2) \cong 0$ (which is more stringent than $w_1(TM) = 0$) would imply that the manifold has a $GL^+$-structure, using Cech cohomology as follows:
A differentiable manifold naturally allows for the definition of a principal $GL(n;\mathbb R)$-bundle via the tangent frame bundle construction. This means there exists transition maps $t_{ij}: \mathcal U_i \cap \mathcal U_j \to GL(n; \mathbb R)$. One can also construct the associated bundle $\mathbb R^n$. Sections $\sigma_i: \mathcal U_i \to \mathbb R^n$ of this associated bundle are acted on from the right by transition maps over overlapping charts $\sigma_j = \sigma_i \bullet_R t_{ij}$ (see my blog for details). From the existing sections $\sigma$ and transition maps $t$, we would like to construct a new pair of sections $\tilde \sigma$ and $\tilde t$ such that $\tilde t \in GL^+(n; \mathbb R)$. We first construct $\mathbb Z_2$-valued transition functions $c_{ij} := \text{sign}(\det t_{ij}) \in \mathbb Z_2$. This collection of $c_{ij}$ functions define a Cech 1-cochain $c$. The principal $GL$-bundle cocycle condition $t_{ij} t_{jk} t_{ki} = 1$ translates to the fact that $c$ is a 1-cocycle. Since $H^1(M;\mathbb Z_2) \cong 0$, all cocycles are coexact, which implies that there exists a 0-cochain $\phi$ such that \(c_{ij} = (\delta \phi)_{ij} = \phi_j \phi_i^{-1}\). In other words, there is an assignment of $+,-$ to each chart such that the transition functions are given by the change in signs when moving between overlapping charts. What remains to do is “flip” all the $-$ charts so that the transition functions are all positive. To do this formally, we define the new sections to be $\tilde \sigma_i := \phi_i \sigma_i$. The new sections would have new transition maps $\tilde t_{ij}$, which we will show have positive determinant.
\[\begin{aligned} \sigma_j &= \sigma_i t_{ij} \\ \tilde \sigma_j &= \tilde \sigma_i \tilde t_{ij} \\ \Rightarrow \phi_j \sigma_j &= \phi_i \sigma_i \tilde t_{ij} \\ \Rightarrow \sigma_j &= \sigma_i \phi_j^{-1} \phi_i \tilde t_{ij} \\ \Rightarrow t_{ij} &= \phi_j^{-1} \phi_i \tilde t_{ij} \\ \Rightarrow \tilde t_{ij} &= t_{ij} \phi_j \phi_i^{-1} \\ \Rightarrow \det \tilde t_{ij} &= \det t_{ij} \text{ sign} (\det t_{ij})\\ &= \vert\det t_{ij}\vert > 0 \end{aligned}\]Hence we have performed reduction of the $GL$-bundle to a $GL^+$-bundle using the fact that $\check H^1(M; \mathbb Z_2) \cong 0$.
Another useful way to think about this is that trivial first cohomology allows us to reduce $O$-structure to $SO$-structure. This will sit well when we talk about trivial second cohomology allowing us to reduce $SO$-structure to $\text{Spin}$-structure (yes we still call it a reduction, which is a bad phrasing for this procedure, as said in wiki).
Second Stiefel Whitney Class $w_2(TM) \in \check H^2(M, \mathbb Z_2)$
This notes is good.
Definition: A spin structure on an orientable Riemannian manifold $M$ with an oriented vector bundle $TM$ is an equivariant lift of the orthonormal tangent frame bundle $F_{SO}(TM)\to M$ with respect to the double covering $\rho: \text{Spin}(n) \to SO(n)$.
The “equivariant lift” means that the principal $\text{Spin}$-bundle \(P_{\text{Spin}}\) must have its right action of $\text{Spin}(n)$ on the fibers of \(P_{\text{Spin}}\) be consistent with the right action of $SO(n)$ on $P_{SO}$. Let $\phi: P_\text{Spin} \to P_{SO}$ be the 2-fold covering map. Then $\phi$ being equivariant means that for $p\in P_\text{Spin}, q \in \text{Spin}(n)$
\[\phi(p \bullet_{R,P_\text{Spin}} q) = \phi(p) \bullet_{R,P_{SO}} \rho(q)\]Any principal bundle will have transition maps, so the transition maps $\tilde g_{ij}$ of $P_\text{Spin}$ must obey
\[\tilde g_{ij} \tilde g_{jk} \tilde g_{ki} = \text{id}_{\text{Spin}(n)}\]Theorem: A spin structure exists if and only if the second Stiefel-Whitney class $w_2(TM) \in \check H^2(M; \mathbb Z_2)$ vanishes.
Intuition
To build intuition for what $w_2(TM)$ is, we follow a similar procedure as we did for $w_1(TM)$ and orientability. We will show that if $\check H^2(M; \mathbb Z_2) \cong 0$ vanishes (stricter than $w_2(TM) = 0$), then we can construct this equivariant lift from $SO(n) \to \text{Spin}(n)$ of principal bundles.
We start from the $SO(n)$ bundle, so the transition maps $g_{ij}$ satisfy the cocycle condition \(g_{ij} g_{jk} g_{ki} = \text{id}_{SO(n)}\). We want to lift this to $\tilde g_{ij}$. But we are worried that \(\tilde g_{ij} \tilde g_{jk} \tilde g_{ki} = \text{id}_{\text{Spin}(n)}\) fails to hold. Namely, we are only certain that \(\tilde g_{ij} \tilde g_{jk} \tilde g_{ki} \in \{-1, 1\}\) since
\[\begin{aligned} \rho(\tilde g_{ij} \tilde g_{jk} \tilde g_{ki}) &= \rho(\tilde g_{ij}) \rho(\tilde g_{jk}) \rho(\tilde g_{ki})\\ &= g_{ij} g_{jk} g_{ki}\\ &= \text{id}_{SO(n)} \end{aligned}\]We aim to construct new transition maps \(\tilde g_{ij}'\) that satisfy the cocycle condition \(\tilde g'_{ij} \tilde g'_{jk} \tilde g'_{ki} = \text{id}\). And we can make use of the cohomology to do this. Observe that for every 3 coordinate patches $\mathcal U_i \cap \mathcal U_j \cap \mathcal U_k$ we can define a 2-cochain $w_{ijk} := \tilde g_{ij} \tilde g_{jk} \tilde g_{ki}$ with values in $\mathbb Z_2$. One can check that this 2-cochain is a 2-cocycle.
\[\begin{aligned} (\delta w)_{ijkl} &= w_{jkl} w^{-1}_{ikl} w_{ijl} w^{-1}_{ijk}\\ &=( \tilde g_{jk} \tilde g_{kl} \tilde g_{lj} ) (\tilde g_{ik} \tilde g_{kl} \tilde g_{li})^{-1} (\tilde g_{ij} \tilde g_{jl} \tilde g_{li} ) (\tilde g_{ij} \tilde g_{jk} \tilde g_{kl})^{-1}\\ &= 1 \end{aligned}\]Since $\check H^2(M; \mathbb Z_2) \cong 0$, this implies that \(w_{ijk} = (\delta h)_{ijk}\) for some 1-cochain $h$ spanned by $h_{ij} \in \mathbb Z_2$. Expanding both sides of $w = \delta h$ shows that
\[\begin{aligned} w_{ijk} & = \tilde g_{ij} \tilde g_{jk} \tilde g_{ki}\\ (\delta h)_{ijk} &= h_{ij} h_{jk} h_{ki} \end{aligned}\]This relates the $\text{Spin}$-valued 1-cochain $\tilde g$ to the $\mathbb Z_2$-valued 1-cochain $h$. Whatever value \((\delta \tilde g)_{ijk} = \tilde g_{ij} \tilde g_{jk} \tilde g_{ki} \in \mathbb Z_2\) is, is the same as \((\delta h)_{ijk} = h_{ij} h_{jk} h_{ki}\). All that is left to do is define new transition maps \(\tilde g'_{ab} := \tilde g_{ab} h_{ab}\), which satisfies the cocycle condition since $\tilde g_{ij} \tilde g_{jk} \tilde g_{ki} = h_{ij} h_{jk} h_{ki}$ and $x^2 = 1\ \forall\ x \in \mathbb Z_2$.
To summarise, the argument goes like: if the transition maps for $\text{Spin}(n)$ didn’t satisfy cocycle, we know the cocycle at least is in $\mathbb Z_2$ since the transition maps for $\text{SO}(n)$ satisfy cocycle, and kernel of $\rho : \text{Spin}(n) \to SO(n)$ is $\mathbb Z_2$. Then by trivial cohomology $\check H^2(M; \mathbb Z_2)\cong 0$, we know that all 2-cocycles are coexact, which allow us to construct a 1-cochain valued in $\mathbb Z_2$ to multiply with the 1-cochain valued in $\text{Spin}(n)$, and this new 1-cochain $\tilde g’$ is a 1-cocycle (satisfies the cocycle condition).
Uniqueness of Spin Structure
There is a bijection between spin structures on a manifold and $\check H^1(M;\mathbb Z_2)$. This drives home the point that $\check H^1(M;\mathbb Z_2)$ need not be trivial for the manifold to be orientable. A good example would be $S^1$. The Mobius line bundle over $S^1$ is not orientable, while the trivial bundle and the tangent bundle is orientable. $S^1$ has trivial second cohomology $\check H^2(S_1;\mathbb Z_2) \cong 0$ so we can put a spin structure on $S^1$. Is this spin structure unique? No. Because there are 2 elements in $\check H^1(S^1;\mathbb Z_2) \cong {[-1], [1]}$. So there are 2 distinct spin structures on $S^1$.