I put this question on Stackexchange :
https://math.stackexchange.com/questions/1659760/when-are-groups-subgroups-of-a-same-group
but it got no answer, so I post it here.
Let $\mathcal{G}$ be a nonempty set of groups. When is it true that there exists a group $B$ ($B$ as "big") such that every group in $\mathcal{G}$ is a subgroup of $B$ ? I mean "a subgroup" in the strict sense, not "isomorphic to a subgroup".
Clearly, the following conditions are necessary for the existence of such a group $B$ (where $x \ \underset{G}{\star} \ y$ denotes the product of $x$ by $y$ in $G$) :
1° the groups in $\mathcal{G}$ have all the same identity;
2° if $G$ and $H$ are groups in $\mathcal{G}$, if $x$ and $y$ are in $G \cap H$, then $x \ \underset{G}{\star} \ y = x \ \underset{H}{\star} \ y$;
3° if $G$ and $H$ are groups in $\mathcal{G}$, if $x$ is in $G \cap H$, then $x$ has the same inverse in $G$ and in $H$;
4° if $G, H, K, L$ are in $\mathcal{G}$, if both expressions $x \underset{G}{\star} (y \ \underset{H}{\star} \ z)$ and $(x \ \underset{K}{\star} \ y) \underset{L}{\star} \ z$ make sense, these expression are equal.
(In fact, 2° is implied by the conjunction of 1° and 4°.)
I wonder if the conjunction of these conditions is sufficient for the existence of a group $B$ such that every group member of $\mathcal{G}$ is a subgroup of $B$.
Generally, if $\mathcal{G}$ is a (let us say nonempty) set of groups, here is a necessary and sufficient condition for the existence of a group $B$ such that every group member of $\mathcal{G}$ is a subgroup of $B$.
Let $V$ denote the union (in the usual sense, not the "disjoint union") of the groups members of $\mathcal{G}$. Let $Mo(V)$ denote the free monoid on $V$. Let $R_{\mathcal{G}}$ denote the "smallest" equivalence relation in $Mo(V)$ compatible with the monoid law of $Mo(V)$ and such that
5° for every $G$ in $\mathcal{G}$, the unity of $G$ is congruent modulo $R_{\mathcal{G}}$ with the identity (empty word) of $Mo(V)$;
6° for every $G$ in $\mathcal{G}$, for all $x$ and $y$ in $G$, the element (of length two) $(x, y)$ of $Mo(V)$ is congruent modulo $R_{\mathcal{G}}$ with the element (of length 1) $(x \ \underset{G}{\star} \ y)$.
Let $\mathcal{S}(\mathcal{G})$ (as "sum") denote the quotient monoid $Mo(V)/R_{\mathcal{G}}$ and $\varphi$ denote the canonical monoïd morphism from $Mo(V)$ onto this quotient. Then $\mathcal{S}(\mathcal{G})$ is a group and, if I'm not wrong, the two following conditions are equivalent :
7° there exists a group $B$ such that every group in $\mathcal{G}$ is a subgroup of $B$;
8° for all $G,H$ in $\mathcal{G}$, for all $x$ in $G$, for all $y$ in $H$, the equality $\varphi(x') = \varphi(y')$, where $x'$ and $y'$ denote the images of $x$ and $y$ by the canonical injection from $V$ into $Mo(V)$, implies $x = y$ (in other words, the restriction of $\varphi$ to the set of the words of length 1 is injective.
Here is the proof that 7° implies 8°. Assume 7°. If $(x_{1}, \ldots , x_{r})$ and $(y_{1}, \ldots , y_{s})$ are elements of $Mo(V)$ congruent modulo $R_{\mathcal{G}}$, then $x_{1} \ldots x_{r} = y_{1} \ldots y_{s}$ in $B$. Taking $r = s = 1$, we obtain 8°. In order to prove that 8° implies 7°, one can construct $B$ isomorphic to $\mathcal{S}(\mathcal{G})$.
My question is : are the (equivalent) conditions 7° and 8° equivalent to the conjonction of 1°, 3° and 4° ? It is perhaps not difficult to solve, but a hint to the literature (if any) could help me to save time. Thanks in advance.