20
0
The context-free languages are not closed under complement, we know that.
As far as I understand, context-free languages that are a subset of $a^*b^*$ for some letters $a,b$ are closed under complement(!?)
Here is my argument. Each CF language $L$ has a semi-linear Parikh image $\pi(L) = \{ (m,n) \mid a^mb^n \in L \}$. Semilinear sets are closed under complement. The set of vectors that represent the semi-linear set can easily be transformed into a linear grammar.
Question. Is there an easily accessible reference to this fact?
Technically these languages are called bounded, i.e., a subset of $w_1^* \dots w_k^*$ for some words $w_1,\dots,w_k$.
My motivation for this question is from a recent question on the context-freeness of $\{ a^nb^m \mid n^2 \neq m \}$. Its complement within $a^*b^*$ seems easier to handle.
Have you checked Ginsburg's "The Mathematical Theory of Context-Free Languages"? Apparently, Theorem 5.4.2 gives the characterization of bounded context-free languages you're referring to, and I bet Ginsburg would mention the implication for complementing bounded context-free languages (in the two-dimensional case). – Yuval Filmus – 2013-04-08T01:32:23.143