How to prove every context-free language over a unary alphabet is regular?
The following proof follows Pighizzini, Shallit and Wang, Unary Context-Free Grammars and Pushdown
Automata, Descriptional Complexity and Auxiliary
Space Lower Bounds.

Let $L$ be a unary context-free language. Assume for simplicity that $\epsilon \notin L$, and consider a grammar $G = \langle V,\{a\},P,S \rangle$ for $L$ in Chomsky normal form. Denote $h = |V|$.

In the sequel, whenever we say parse tree, we mean parse tree in $G$.

Let $\Pi$ be the collection of all triples $(U,i,j)$ such that $U$ is a parse tree rooted at some nonterminal $A$ which represents a derivation of the sentential form $a^i A a^j$, where $0 &lt; i+j &lt; 2^h$.

Let $(U,i,j) \in \Pi$, and let $A$ be the label of the root of $U$. Given a parse tree $S$ containing a node $v$ labeled $A$, we can "pump" $S$ by $U$ by replacing $v$ with a copy of $U$, attaching the children of $v$ to the leaf of $U$ labeled $A$.

Lemma. If $\ell &gt; 2^{h-1}$ and $a^\ell \in L$ and $T$ is a parse tree for $a^\ell$, then there exists a triple $(U,i,j) \in \Pi$ and a parse tree $S$ for $a^{\ell-i-j}$ such that $T$ is obtained from $S$ by pumping by $U$.

Proof. Since $\ell &gt; 2^{h-1}$, $T$ must have depth at least $h+1$ (recall that the last level corresponds to productions of the form $A \to a$), and so a path of length $h+1$ edges. This path contains $h+1$ nonterminals, one of which must repeat. Consider such a repetition within the last $h+1$ nonterminals of the path. The repetition corresponds to a triple $(U,i,j) \in \Pi$ (note $i+j &lt; 2^h$ since we chose a repetition within the last $h+1$ nonterminals, and $i+j &gt; 0$ since the grammar is in Chomsky normal form). By "pumping out" this derivation, we obtain the parse tree $S$ for $a^{\ell-i-j}$. $\quad\square$

Corollary. Every parse tree in $L$ can be obtained in the following way:


Start with a parse tree for some $a^\ell$, where $\ell \leq 2^{h-1}$.
Repeatedly pump by $U$ for some $(U,i,j) \in \Pi$.


Using this, we can construct an NFA for $L$:


Guess a parse tree for some $a^\ell$, where $\ell \leq 2^{h-1}$, and read the word $a^\ell$.
Set $X$ to be the set of nonterminals appearing in the parse tree.
Perform the following operation an arbitrary number of times:


Guess $(U,i,j) \in \Pi$ such that the label of the root of $U$ appears in $X$.
Read $a^{i+j}$.
Add all nonterminals in $U$ to $X$.



This shows that $L$ is regular.

Parikh's theorem can be proved in the same way.