Let $w\_1$ be the 1st Sitefel-Whitney classes of the tangent bundle of a 4-manifold $M$ ($M$ is non orientable). My question is



> 
> Is $$\exp\left(\frac{i\pi}{2}\int\_{M\_4} \mathcal{P}(w\_1^2)\right)$$ well defined? Here $\mathcal{P}$ is the Pontryagin square. 
> 
> 
> 


It is known that for any $\mathbb{Z}\_2$ cocycle $u$, the following quantity  

$$\exp\left(\frac{i\pi}{2}\int\_{M\_4} \mathcal{P}(u)\right)$$
is well defined, in the sense that it does not depend on the lifting of $u$ from $\mathbb{Z}\_2$ cocycle to $\mathbb{Z}\_4$ cocycle. However, when we plug in $u=w\_1^2$, it seems to be not well defined and depends on the lift of $w\_1$, because $P(w\_1^2)= w\_1^2 \cup w\_1^2+ 4 w\_1^2 \cup\_1 w\_1^3 = w\_1^2 \cup w\_1^2\mod 4$. So there is a contradiction. How do we resolve this contradiction? 



Pontryagin square of first Stiefel-Whitney class
I think the problem is just that the epxression
$$
\operatorname{exp}\left(\frac{i\pi}{2} \int\_{M} \mathcal{P}(u)\right)
$$
is well-defined only when $M$ is oriented.


If $M$ is oriented, it has a fundamental class $[M]\in H\_4(M;\mathbb{Z})$. The since $\mathcal{P}(u)\in H^4(M;\mathbb{Z}/4)$ is a mod $4$ cohomology class, we can make sense of the integration as evaluation against the fundamental class,
$$
\int\_M\mathcal{P}(u):=\langle\mathcal{P}(u),[M]\rangle \in \mathbb{Z}/4.
$$
This gives an integer mod $4$, hence the complex exponential above gives a well-defined $4$-th root of unity.


If $M$ is non-orientable, however, it only has a mod $2$ fundamental class $[M]\_2\in H\_4(M;\mathbb{Z}/2)$, and so we can only define
$$
\int\_M\mathcal{P}(u):=\langle\mathcal{P}(u),[M]\_2\rangle \in \mathbb{Z}/2.
$$
as an integer mod $2$. 


