Example (language of odd-length words)

Let $Σ = \set{a}$, $V = \set{S}$, $P_0 = \set{S\to aaS, S\to a}$, $G_0 = (Σ, V, P_0, S).$ We claim that $$ \begin{align*} \mathcal{L}(G_0) = \sb{a^{2n+1}}{n\in \N}. \end{align*} $$

For the $\supseteq$ direction, apply $S\to aaS$ to the start symbol $n$ times to obtain $a^{2n} S$, and then apply $S\to a$ to obtain $a^{2n+1}$: $$ \begin{align*} S \xrightarrow{R}_1 aaS \xrightarrow{R}_1 aaaaS \xrightarrow{R}_1 \ldots \xrightarrow{R}_1 a^{2n} S \xrightarrow{R}_1 a^{2n} a. \end{align*} $$

For the $\subseteq$ direction, notice each rewrite step either keeps the number of symbols the same or increase it by two. Proceed by induction on the length of derivation, that every string produced by $G$ from $S$ has odd length: the unique string with a derivation of length zero is $S$, which has odd length. For a string $w$ with derivation of length $n+1$, since the string produced by the first $n$ steps in the derivation has odd length, $w$ has odd length as well.

The same argument applies to show that the following grammars are equivalent: $$ \begin{align*} P_1 ={}& \set{S\to aSa, S\to a}, \\ P_2 ={}& \set{S\to Saa, S\to a}, \\ P_3 ={}& \set{S\to aaS, S \to aaSaa, S\to a}, \\ P_4 ={}& \set{S\to aaS, S \to aSa, S\to Saa, S\to a}, \\ P_5 ={}& \set{S\to aaS, aSa \to aaa, S\to a}, \\ P_6 ={}& \set{S\to aaS, aaS \to aSa, S\to a}, \\ P_7 ={}& \set{S\to aaS, aaS \to a, S\to a}, \\ \end{align*} $$