8

If $A$ and $B$ are languages, let $A\bowtie B$ denote the set of strings made by concatenating any word from $A$ and any word from $B$ of equal length.

$$A\bowtie B \equiv \{ ab : a\in A,\;b\in B, |a|=|b|\}.$$

You can prove using regular grammars that if $A$ and $B$ are regular, then $A\bowtie B$ is context free. I am wondering about the converse. Specifically, this conjecture:

Conjecture: If $A\bowtie B$ is context-free, and the strings in $A$ and $B$ have the same lengths $\{|a| : a\in A\}=\{|b| : b\in B\}$, then $A$ and $B$ are regular.

The intuition behind the conjecture is that the pushdown stack can be used to ensure that $A$ and $B$ are the same length, or to generate complex internal structure within $A$ and $B$ (such as palindromes or matching character counts) but not both simultaneously.

I haven't been able to prove this, even for the simple case where $B$ is the language of all strings. Unfortunately, I've also not been able to find a counterexample.

So far I have tried:

  1. Using Parikh's theorem, Odgen's lemma, and the pumping lemma for CFLs.
  2. Using generating functions—regular languages have rational gfs and unambiguous cfls have algebraic gfs, but not conversely.
  3. Using the Chomsky-Schutzenberger theorem and trying to catalogue parentheses based on whether their image is always in the left/right half of the derived string.
  4. Showing that the conjecture holds when the alphabets are distinct. This turns out to be easy to prove (using Chomsky normal form). But I don't have any indication that if $A\bowtie B$ is context free then it is also the homomorphic image of a context free language $A^\prime \bowtie B^\prime$, where $A$ and $B$ have distinct alphabets.

Any advice is appreciated.

user326210
  • 838
  • 5
  • 13

1 Answers1

12

No, this conjecture is not true.

Consider $A=\{0^n1^n \mid n\geqslant0 \}$ and $B=\{1^{2n}\mid n\geqslant0\}$.

We have $\{|a| : a\in A\}=\{|b| : b\in B\}=\{2n\mid n\geqslant0\}$ and $A\bowtie B = \{ 0^n1^{3n}\mid n\geqslant0\}$.

While $A\bowtie B$ is context-free, $A$ is not regular.

John L.
  • 39,205
  • 4
  • 34
  • 93