Suppose $Y$ is a 3-manifold and the boundary $\Sigma:=\partial Y$ is non-empty. Let $G$ be a Lie group with trivial center. Let $\overline {\mathcal A}_{flat}(\Sigma)$ and $\overline {\mathcal A}_{flat}(Y)$ denote the gauge equivalence classes of flat connections on the trivial bundles $\Sigma \times G$ and $Y \times G$ respectively. The space $\overline {\mathcal A}_{flat}(\Sigma)$ is a finite dimensional symplectic manifold with singularitites. I am trying to understand why the image of the restriction map $\overline {\mathcal A}_{flat}(Y) \to \overline {\mathcal A}_{flat}(\Sigma)$ is a Lagrangian submanifold. I know why the image is an isotropic subspace, but I am having a problem with the dimensions. In particular, the space $$\overline {\mathcal A}_{flat}(\Sigma)\simeq \operatorname{Hom}(\pi_1(\Sigma),G)/G$$ has dimension $(2\operatorname{genus}(\Sigma)-2)\dim(G)$, but I can not see why the space $\operatorname{Hom}(\pi_1(Y),G)/G$ has half that dimension.
For completeness, I include a proof of why the image of $\overline {\mathcal A}_{flat}(Y)$ in $\overline {\mathcal A}_{flat}(\Sigma)$ under the restriction map is isotropic. Let $\mathcal A(Y)$ be the space of connections on $Y \times G$. There is a one-form $\mathcal F$ on $\mathcal A(Y)$ defined as $${\mathcal F}_A(\alpha):=\int_Y \langle \alpha \wedge F_A\rangle,$$ where $A \in \mathcal A(Y)$ is a connection, $F_A \in \Omega^2(Y,\mathfrak g)$ is its curvature and $\alpha \in T_A\mathcal A(Y)$. We can see by some calculations that $$d\mathcal F_A(\alpha,\beta)=\int_\Sigma \langle \alpha \wedge \beta \rangle,$$ where $\alpha, \beta \in T_A\mathcal A(Y)$, which coincides with the symplectic form on $\mathcal A(\Sigma)$ the space of connections on $\Sigma \times G$. When restricted to $\mathcal A_{flat}(Y)$, $\mathcal F$ vansihes, and so does $d\mathcal F$. Therefore the restriction map takes $\mathcal A_{flat}(Y)$ to an isotropic submanifold of $\mathcal A_{flat}(\Sigma)$. By gauge invariance, the restriction map takes $\overline {\mathcal A}_{flat}(Y)$ to an isotropic submanifold of $\overline {\mathcal A}_{flat}(\Sigma)$.