# Electrodynamics in general spacetime

Let $M\cong\mathbb{R}^4_1$ be the usual Minkowski spacetime. Then we can formulate electrodynamics in a Lorentz invariant way by giving the EM-field $2$-form $\mathcal{F}\in\Omega^2(M)$ and reformuling the homogeneous Maxwell equations as $$d\mathcal{F} = 0$$ Then the Poincaré lemma tells us that the first of the two equations (i.e. $\mathcal{F}$ is closed) implies that $\mathcal{F} = d\mathcal{A}$ for some $\mathcal{A}\in\Omega^1(M)$ (i.e. $\mathcal{F}$ is exact). $\mathcal{A}$ is the usual potential for ED. This automatically gives us the Gauge symmetry $\mathcal{A}'=\mathcal{A}+d\chi$, for any $\chi\in C^\infty(M)$.

My question is: say we want to treat ED on ageneral spacetime, i.e. any $4$-semi-Rimannian manifold $(M,g)$ using the same Maxwell equations. Then if $H^2(M)\neq 0$ (the $2$nd cohomology group) we don't have anymore that $\mathcal{F} = d\mathcal{A}$, and we also lose the Gauge symmetry, which would make things harder. How is the problem approached? How do you treat ED in general spacetime?

The key is Weyl's famous observation that electrodynamics is really (classical) $U(1)$-gauge theory. Concretely:
1. You generalise the global $1$-form $\mathcal{A}$ on $M$ to a connection $\nabla$ on a Hermitian line bundle $\mathcal{L} \to M$, which can locally be written as $d + \mathcal{A}$ for $\mathcal{A}$ the so-called connection $1$-form.
2. The differential $\mathcal{F} := d\mathcal{A}$ of the global $1$-form $\mathcal{A}$ is replaced by the curvature $$\mathcal{F} := d\mathcal{A} + \mathcal{A} \wedge \mathcal{A} = d\mathcal{A}$$ of the connection $\nabla$, which is still a global $2$-form and still satisfies $d\mathcal{F} = 0$ by the Bianchi identity as applied to a connection on a line bundle.
3. Gauge symmetry in this context now still holds, for the curvature $2$-form $\mathcal{F}$ is unchanged if you replace $\nabla$ by $\nabla + df$ for $f \in C^\infty(M)$.
This all, of course, fits extremely nicely with your observation about $H^2(M)$, for the assignment $$(\text{line bundle \mathcal{L} \to M}) \mapsto (\text{curvature 2-form \mathcal{F} of a connection \nabla on \mathcal{L}})$$ induces an isomorphism $$\operatorname{Pic}(M) \cong H^2(M),$$ where the Picard group $\operatorname{Pic}(M)$ is the abelian group of isomorphism classes of line bundles on $M$, with $$[\mathcal{L}] + [\mathcal{L}^\prime] := [\mathcal{L} \otimes \mathcal{L}^\prime], \quad -[\mathcal{L}] := [\mathcal{L}^\ast];$$ then $H^2(M) = 0$ if and only if every closed $2$-form on $M$ is exact (i.e., $\mathcal{F} = d\mathcal{A}$ for some global $1$-form $\mathcal{A}$), if and only if every line bundle is trivial (so that, necessarily, $\nabla = d + \mathcal{A}$ for a global $1$-form $\mathcal{A}$). The moment that $H^2(M) \neq 0$, however, you do have non-trivial line bundles and non-exact closed $2$-forms, so that you really do need to consider your spacetime $M$ together with a potentially non-trivial line bundle $\mathcal{L} \to M$.