I'm trying to understand how Lagrange multipliers are applied in order to impose constraints in PDEs. Consider $B \subset \Omega$. For instance, a square inside another square domain $\Omega$. Let's say we want the solution to the Poisson problem $$-\Delta u = f \text{ in } \Omega$$ subject to the constraint $$u = g \text{ on } \partial B$$
with homogeneous Dirichlet BC on the boundary of the exterior square. The weak formulation corresponding to this is obtained by using a Lagrange multiplier $\lambda$. In particular, the weak form is the saddle point of the following Lagrangian $$L(u ,\lambda)= \frac{1}{2} |\nabla u|^2 -(f,u)- \langle\lambda, u-g \rangle_{\partial B}$$ and its weak form is to find $(u ,\lambda)$ s.t. $$(\nabla u, \nabla v) + \langle \lambda,v \rangle = (f,v) \qquad \forall v \in V \\ \langle u,q \rangle = \langle g,q \rangle \ \qquad \forall q \in Q$$
and I've found that deal.ii step-60 is implementing exactly this, with $V=H^1(\Omega)$ and $Q = L^2(\partial B)$.
I was trying to derive the above weak form without using directly that Lagrangian. My idea was to decompose the domain as $\Omega = \Omega_1 \cup \Omega_2$ where $\Omega_1 = \Omega \setminus B$ and $\Omega_2=B$. Then an equivalent reformulation of the problem is the union of the following two subproblems:
\begin{cases} - \Delta u_1 = f \text{ in } \Omega_1 \\ u_1 = g \text{ on } \partial B \\ u_1 = 0 \text{ on } \Gamma^D \end{cases} (where $\Gamma^D$ is the boundary of the exterior square)
\begin{cases} - \Delta u_2 = f \text{ in } \Omega_2 \\ u_2 = u_1 \text{ on } \partial B \end{cases}
Now I write the weak forms on both domains.
In $\Omega_1$:
$$(\nabla u_1, \nabla v_1)_{\Omega_1} + \langle \lambda, v_1 \rangle = (f,v_1)_{\Omega_1} \qquad \forall v_1 \in H^1(\Omega_1) \\ \langle u_1, q \rangle = \langle g,q \rangle $$
In $\Omega_2$:
$$(\nabla u_2, \nabla v_2)_{\Omega_2} = (f,v_2)_{\Omega_2} \qquad \forall v_2 \in H^1(\Omega_2) $$
Now I'd like to sum those two formulations and recover the original one, but I have a crucial problem in the sum $(\nabla u_1, \nabla v_1)_{\Omega_1} + (\nabla u_2, \nabla v_2)_{\Omega_2}$ which I don't know how to handle. What am I missing?