Michelle Mendoza

2022-07-07

If A and B are finite sequences and $A,B=B,A$ (where the comma denotes the concatenation of sequences), then both A and B are repetitions of some sequence C.

Rafael Dillon

Expert

Step 1
If A,B are strings of length $|A|,|B|\le 1$ and $AB=BA$ then there is some string D such that $A={D}^{k},B={D}^{l}$ with $k,l\in \left\{0,1,..\right\}$
Suppose that when A,B are strings of length $|A|,|B|\le n$ and $AB=BA$ then there is some string D such that $A={D}^{k},B={D}^{l}$ with $k,l\in \left\{0,1,..\right\}$.
Step 2
Now suppose $|A|\le n+1,|B|=n+1$ and $AB=BA$. If $|A|=|B|$ then $A=B$ and we can take $D=A$, so suppose $|A|\le n$. Then we must have $B=AC$ for some $|C|\ge 1$. Then $AAC=ACA$ and so $AC=CA$ and hence there is some D such that $A={D}^{k},C={D}^{l}$. Then $A={D}^{k},B={D}^{k+l}$.

Do you have a similar question?