Proposition (union grammar)
Let $G = (Σ, V, P, S)$ and $G' = (Σ, V', P', S')$ be grammars over the same alphabet $Σ$. Define the concatenation grammar of $G$ and $G'$ as $$ \begin{align*} H = (Σ, V\cup V'\cup \set{T}, P \cup P' \cup \set{T \to S, T\to S'}, T). \end{align*} $$
-
$\mathcal{L}(G)\cup \mathcal{L}(G')\subseteq \mathcal{L}(H)$.
-
If $V\cap V' = \emptyset$ and $G$ and $G'$ are variable-based, then $\mathcal{L}(G) \cup \mathcal{L}(G') = \mathcal{L}(H)$.
-
This shows that the classes of type 0, type 1 and type 2 languages are closed under concatenation: for languages $\mathcal{L}(G), \mathcal{L}(G')$ produced by $\mathsf{Q}$ grammars $G, G'$ ($\mathsf{Q}$ can be nothing, "context-sensitive" or "context-free"), $G, G'$ can be assumed WLOG to be variable-based and have disjoint sets of variables, and their union grammar remains property $\mathsf{Q}$.