We have two well known definitions of the semidirect product $N \rtimes H$ of groups:

- (Internal semidirect product) We write $G = N \rtimes H$ if $N$ is a normal subgroup of $G$, $H$ is another subgroup of $G$, $N \cap H = \{1\}$, and $G = NH$.
- (External semidirect product) Given a homomorphism $\phi: H \to \mathrm{Aut}(N)$ from $H$ to the automorphism group of $N$, denoted $h \mapsto \phi_h$, we write $N \rtimes H = N \rtimes_\phi H$ to be the set of pairs $(n,h)$ with $n \in N, h \in H$ and group law $(n_1,h_1) (n_2,h_2) = (n_1 \phi_{h_1}(n_2), h_1 h_2)$.

The two are equivalent in the sense that every external semidirect product is an internal semidirect product (identifying $N$ with $\{ (n,1): n \in N\}$ and $H$ with $\{(1,h): h \in H\}$) and conversely every internal semidirect product is canonically isomorphic to an external semidirect product.

I recently had occasion to use the version of this concept when the two groups $N,H$ are allowed to intersect [EDIT: in a group normal in $H$], which then imposes two additional compatibility conditions on the homomorphism $\phi$, but I was unable to locate the standard name for the concept, which I will for the sake of this question call the "semidirect product $N \rtimes_K H$ of $N,H$ relative to $K$". It can be defined internally or externally:

- (Internal relative semidirect product) We write $G = N \rtimes_K H$ if $N$ is a normal subgroup of $G$, $H$ is another subgroup of $G$, $N \cap H = K$ is a normal subgroup of $H$, and $G = NH$.
- (External relative semidirect product). Given a commuting square $\require{AMScd}$ \begin{CD} K @>> \iota > N\\ @V \iota V V @VV V\\ H @>>\phi> \mathrm{Aut}(N) \end{CD} of homomorphisms using the conjugation action of $N$ on itself [EDIT: with $\iota$ denoting inclusion maps, and obeying the additional compatibility condition $$ \phi_h(k) = h k h^{-1}$$ for all $h \in H$ and $k \in K$, which among other things makes $K$ a normal subgroup of $H$] we write $N \rtimes_{K,\phi} H = N \rtimes_{K,\phi} H = N \rtimes_K H$ to be the quotient of $N \rtimes_\phi H$ by $\{ (k, k^{-1}): k \in K \}$ (which one can check to be a normal subgroup of $N \rtimes_\phi H$).

One can verify that every external relative semidirect product is an internal relative semidirect product, and conversely that every internal relative semidirect product is isomorphic to an external relative semidirect product.

This is such a basic operation that it must already be well known, so I ask

* Question 1:* What is the term for this operation in the literature?

Also,

* Question 2:* Does this operation have a category-theoretic interpretation (e.g., as the universal object for some diagram)?

EDIT: One can also think of $N \rtimes_{K,\phi} H$ as the amalgamated free product $N \ast_K H$ quotiented by the relations $h n h^{-1} = \phi_h(n)$ for $h \in H$, $n \in N$. So maybe "amalgamated semidirect product" could be a better name than "relative semidirect product".

Treesfor an explanation.) It’s certainly not true that every instance of the OP’s construction is a graph of groups: every non-trivial graph of groups has infinite fundamental group. $\endgroup$10more comments