 # A Frameless 2-Coloring of the Plane Lattice

A picture frame in two dimensions is a rectangular array of symbols, with at least two rows and columns, where the first and last rows are identical, and the first and last columns are identical. If a coloring of the plane lattice has no picture frames, we call it frameless. In this note we show how to create a simple 2-coloring of the plane lattice that is frameless.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

A classic problem from combinatorics on words is the avoidance of overlaps. An overlap is a word of the form , where is a single symbol and is a (possibly empty) word. The English word alfalfa, for example, forms an overlap with and . The Norwegian mathematician Axel Thue (1863–1922) proved that there exists a (one-sided) infinite word over a binary alphabet that contains no overlaps. His classic paper, in German, was published in 1912 in an obscure Norwegian journal . Thankfully, an English translation is available .

Today the word that Thue produced is called the Thue-Morse word, and is often abbreviated . Its first few terms are

 t=t(0)t(1)t(2)⋯=0110100110010110⋯.

The Thue-Morse word has many equivalent definitions , but the following three are the most important:

• is the number of bits, taken modulo , in the binary representation of .

• is the limit of , where is the morphism defined by and , and the exponent on denotes -fold composition of morphisms. This limit is well-defined since starts with , implying that is a prefix of for all , and is written as .

• There is a finite automaton of two states, which given expressed in base as an input, computes . This means that is a -automatic sequence [2, 10].

Thue’s original proof was neither very difficult nor very simple. Today, however, however, theorem-proving software can easily prove his result in less than a second. The idea is as follows: we write a predicate in first-order logic that asserts that is overlap-free. We then type this predicate into Walnut, software written by Hamoon Mousavi that can prove or disprove any suitable predicate concerning automatic sequences , and read the result.

If has an overlap , then there exist integers and such that for . So the nonexistence of overlaps is specified by the predicate

 ∀i,n (i≥0 ∧ n≥1)⟹(∃j j≥0 ∧ j≤n ∧ t(i+j)≠t(i+n+j)).

A Walnut variable T encodes the Thue-Morse word. We can translate the predicate above into a Walnut query named tmpred as follows:

eval tmpred "A i,n (n >= 1) => (Ej j<=n & T[i+j] != T[i+n+j])":

Walnut evaluates this predicate as true, which we can take as proof that the Thue-Morse word is overlap-free! (We don’t have to include and in our Walnut predicate because the domain of variables in its predicates is assumed to be by default.)

Today, the field of pattern avoidance in words is extremely broad and dynamic, with many generalizations: avoidance in circular words , two-dimensional words , graphs , and so forth.

Thue himself proved a generalization of his result to “two-sided” infinite words. These are maps from to a finite alphabet . We can turn a “right-infinite” infinite word into a “left-infinite” word with the reversal operator, which is denoted by an exponent of . And we can concatenate a left-infinite word to a right-infinite word to produce a two-sided infinite word. Thue proved

###### Theorem 1.

The two-sided infinite word is overlap-free.

###### Proof.

Recall that a morphism is a map from words to words that obeys the rule for all words .

Let be the morphism defined by and . An easy induction shows that gives the last bits of . Similarly, another easy induction shows that . So the “central” bits of , that is, the word , equals . But

 ν2n+1(0)μ2n+1(0)=μ2n+1(1)μ2n+1(0)=μ2n+2(1),

which since , appears in and hence is overlap-free. ∎

Thue’s two-sided infinite word can alternatively be defined simply by extending the domain of as follows: if is negative, then set

 t(n):=t(−1−n). (1)

Then .

In this note we give a surprising example of pattern avoidance in the plane lattice . Although our result can be stated in the language of two-dimensional words, here it seems somehow more natural to use the language of colorings instead. A coloring of the plane lattice is a map into a finite alphabet , where the elements of are called colors. If the number of elements of is , we call a -coloring.

The particular kind of pattern we avoid is called a “picture frame”, or just “frame” for short. A picture frame is a finite rectangular array of points in the plane lattice, with at least two rows and columns, such that the first row equals the last row, and the first column equals the last column. The following diagram illustrates part of a plane coloring having a picture frame in it. In this case the alphabet consists of English letters, and the highlighted frame is bordered by the horizontal word ERMINE and the vertical word EWE.

Now the following natural question occurs: is there a -coloring of the plane lattice containing no picture frames at all? We might call such a coloring frameless.

At first, one might suspect the answer is no, since that is the case for the one-dimensional analogue of picture frames. The one-dimensional analogue is a word of the form , where is a single letter, over a -letter alphabet. By the pigeonhole principle, every word of length at least contains a repeated letter, and hence a word of the form . So there are no infinite words without -dimensional picture frames. Furthermore, the four corners of a two-dimensional picture frame must all contain the same symbol, and we know that for any finite alphabet, rectangles (in fact, squares) of identical symbols must occur in any sufficiently large region of the plane .

In this note we prove the following result:

###### Theorem 2.

There exists a frameless -coloring of the infinite plane lattice.

## 2 The coloring and the proof

We start by proving the result for the quarter plane .

###### Theorem 3.

For define the coloring by , where is the Thue-Morse sequence. Then is a frameless -coloring of .

Here are the first few rows and columns of this coloring, where is denoted by a white square and by a black square. The coloring is easily seen to consist of shifted copies of the one-dimensional Thue-Morse word.

There are at least two ways to prove the result. One uses the theorem-proving software Walnut again:

###### Proof.

Let us write a first-order statement for the nonexistence of a picture frame in :

 ¬(∃m,n,p,q(p≥1) ∧ (q≥1) ∧(∀i (i≤q)⟹f(m,n+i)=f(m+p,n+i)) ∧(∀j (j≤p)⟹f(m+j,n)=f(m+j,n+q)).

Using the fact that , this can be translated into Walnut as follows:
eval frameless "~( E m,n,p,q (p>=1) & (q>=1) &

(Ai (i<=q) => T[m+n+i]=T[m+p+n+i]) & (Aj (j<=p) => T[m+j+n]=T[m+j+n+q]))":

Evaluating this statement in Walnut gives the response true, and requires less than a second of CPU time on a laptop. ∎

Alternatively, we can prove Theorem 3 directly. We use the abbreviation to denote the rectangular block with rows from to and columns from to .

###### Proof.

Suppose there exist such that and and . Then, since , we have

 t(x+i) =t(x+p+i), 0≤i≤q; t(x+j) =t(x+q+j), 0≤j≤p,

where . Without loss of generality, assume . But then is an overlap, a contradiction. ∎

There’s another way to view this result, using the notion of two-dimensional morphisms. These are morphisms that replace each letter by a rectangular block of letters . If is a matrix, and is an matrix, then is a matrix.

Now consider the two-dimensional morphism defined as follows:

 γ(0) = γ(1)=γ(2) = γ(3) =

and the coding defined by .

is given by .

###### Proof.

(Sketch) The basic idea is that if we have the values of and , for , then the values of for can be computed as follows:

 f(2m,2n) =t(x) f(2m+1,2n)=f(2m,2n+1) =¯¯¯¯¯¯¯¯¯t(x) f(2m+1,2n+1) =t(x+1),

where the bar indicates binary complement ( and ). ∎

Let’s look at the first few iterates, and their images under :

 ,,⎡⎢ ⎢ ⎢⎣0130130330320320⎤⎥ ⎥ ⎥⎦,…
 ,,⎡⎢ ⎢ ⎢⎣0110110110100100⎤⎥ ⎥ ⎥⎦

The arrays in the second line form larger and larger portions of the upper left corner of the array in Figure 1.

## 3 Extending our coloring to the whole plane

Now that we have a coloring of , we can extend it to as follows, and prove this explicit version of Theorem 2.

Theorem . Using the extended definition of given in Eq. (1), define for . Then is frameless.

###### Proof.

Exactly the same as the proof of Theorem 3, using the fact that the two-sided infinite word is overlap-free. ∎

A slightly different example can be given using the matrix-valued morphism and the coding defined in Section 2. To do so, we start with the array and consider the center of the array to be a point from which all four quarter-planes extend outward, as in the figure:

We then want to iterate on each block. In order for this procedure to work, we would need the image of each letter to match the letter in the corresponding corner:

• should appear in the lower right of its image;

• should appear in the upper right and lower left of its image; and

• should appear in the upper left of its image.

These properties do not hold for . But they do hold for  !:

 γ2(0) =⎡⎢ ⎢ ⎢⎣0130130330320320⎤⎥ ⎥ ⎥⎦ γ2(1) =⎡⎢ ⎢ ⎢⎣3201201301321320⎤⎥ ⎥ ⎥⎦ γ2(3) =⎡⎢ ⎢ ⎢⎣3203203003013013⎤⎥ ⎥ ⎥⎦ .

Applying to gives

 0130130330320320 3201201301321320 3201201301321320 3203203003013013

Hence, by iterating infinitely, and then applying , we get a -coloring of the entire plane with the desired property.

## 4 Connection to aperiodic tilings

A periodic tiling is a tiling of the plane that has two linearly independent translation symmetries. That is, there are two directions in which you can slide the tiling and have the tiles line up perfectly with translated copies. A set of shapes is called aperiodic when they admit tilings of the plane, but none that are periodic. Non-periodic tilings are not necessarily interesting of their own accord, because they might be constructed from shapes that can trivially be rearranged into periodic tilings. The interesting case is when the shapes themselves force long-range aperiodicity, which is why aperiodicity is a property ascribed to the shapes, known as prototiles. The most famous aperiodic tile sets are those discovered independently by Penrose and Ammann .

Consider a tiling whose prototiles are polyominoes (unit squares glued together along their edges). Every member of the set appears in one of (at most) eight rotated and reflected orientations in the tiling. Assign the integers to the squares that make up all prototiles; then every cell in a tiling from those prototiles can be given a label from , describing the identity and orientation of the prototile square covering that cell. In other words, a tiling by polyominoes is also a coloring of the plane lattice. The figure shows two annotated prototiles on the left, and a portion of a tiling/coloring on the right.

We know that there exist aperiodic sets of polyominoes—Winslow offers one example adapted from an earlier tiling by Ammann . The existence of such prototiles suggests an indirect proof that frameless colorings of the plane lattice must exist. Consider a coloring constructed by applying the labelling method above to a tiling by an aperiodic set of polyominoes. If a frame existed in such a coloring, we would be able to repeat it in a rectangular arrangement, with adjacent horizontal and vertical copies overlapping by one column and one row, respectively. The periodic coloring thus obtained would imply a periodic tiling by the original polyominoes, contradicting the assumption that they were aperiodic.

## References

•  J.-P. Allouche and J. O. Shallit, The ubiquitous Prouhet-Thue-Morse sequence. In C. Ding, T. Helleseth, and H. Niederreiter, editors, Sequences and Their Applications, Proceedings of SETA ’98, pp. 1–16. Springer-Verlag, 1999.
•  J.-P. Allouche and J. O. Shallit, Automatic Sequences, Cambridge University Press, 2003.
•  D. A. Bean, A. Ehrenfeucht, and G. McNulty, Avoidable patterns in strings of symbols, Pacific J. Math. 85 (1979), 261–294.
•  J. Berstel, Axel Thue’s Papers on Repetitions in Words: a Translation, number 20 in Publications du Laboratoire de Combinatoire et d’Informatique Mathématique, Université du Québec à Montréal, February 1995.
•  J. D. Currie, Pattern avoidance: themes and variations, Theoret. Comput. Sci. 339 (2005), 7–18.
•  Ronald L. Graham, Bruce L. Rothschild, and Joel H. Spencer, Ramsey Theory, Wiley, second edition, 1990.
•  Branko Grünbaum and G. C. Shephard, Tilings and Patterns, Dover, second edition, 2016.
•  J. Grytczuk, Pattern avoidance on graphs, Discrete Math. 307 (2007), 1341–1346.
•  H. Mousavi, Automatic theorem proving in Walnut. Available at http://arxiv.org/abs/1603.06017, 2016.
•  E. Rowland, What is an automatic sequence?, Notices Amer. Math. Soc. 62(3) (2015), 274–276.
•  J. O. Shallit and J. Stolfi, Two methods for generating fractals, Computers and Graphics 13 (1989), 185–191.
•  A. Thue, Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske vid. Selsk. Skr. Mat. Nat. Kl. 1 (1912), 1–67. Reprinted in Selected Mathematical Papers of Axel Thue, T. Nagell, editor, Universitetsforlaget, Oslo, 1977, pp. 413–478.
•  Andrew Winslow, Some open problems in polyomino tilings. In Mizuho Hoshi and Shinnosuke Seki, editors, Developments in Language Theory, DLT 2018, pp. 74–82. Springer International Publishing, Cham, 2018.