On possible values of the signature of flat unitary bundles over compact surfaces
We determine all possible signatures of flat Hermitian bundles over compact, connected, oriented surfaces of positive genus with nonempty boundary. If $Σ_{g,n}$ has genus $g\geq 1$ and $n\geq 1$ boundary components, then the signatures arising from representations $π_1(Σ_{g,n})\to\mathrm{U}(p,q)$ are exactly the integers $m$ satisfying \[ |m| \leq (p+q)(2g+n-2) -(2g-2)|p-q| -\min\{2,n|p-q|\}. \] Every such integer, including the two extremal values, is realized by a block-diagonal representation whose image is contained, after possibly interchanging $p$ and $q$, in $\mathrm{U}(1,1)^{\times\min\{p,q\}}\times\mathrm{U}(|p-q|)$.