Write S=S1∪S2 with S1∩S2=γ a closed curve, oriented as the boundary of
S1, so that ∂S2=−γ. Let ∣u1⟩ on S1 and ∣u2⟩ on S2 be smooth
single-valued gauges, with connections A(j)=i⟨uj∣duj⟩. The curvature is gauge
invariant, Ω=dA(j) on Sj. By Stokes' theorem,
∫SΩ=∫S1dA(1)+∫S2dA(2)=∮γA(1)−∮γA(2).
On γ both gauges describe the same ray, so ∣u2⟩=eiχ∣u1⟩ with a smooth
function eiχ:γ→U(1), and A(2)=A(1)−dχ along γ. Therefore
∫SΩ=∮γdχ=2πw,
where w is the winding number of eiχ around the circle γ, an integer. Hence
C=w∈Z. If a smooth gauge exists on all of S, take ∣u2⟩=∣u1⟩, so w=0.
For the spin-21 family of the solid-angle formula,
take S1 the northern and S2 the southern hemisphere with gauges
∣u1⟩=(cos2θ,eiφsin2θ) and
∣u2⟩=e−iφ∣u1⟩, smooth near the south pole. Along the equator
χ=−φ, which winds once negatively: C=−1, as found by direct integration.