# Is there an L-system for aperiodic tilings of the plane with the "hat" monotile?

Most aperiodic tilings of the plane, except possibly for spiral tilings like the Voderberg tiling, exhibit a fractal pattern of self-similarity. This is no exception for the recently discovered "hat" monotile.

Now, in Figure 2.12 of that paper, reproduced here for convenience,

the union of all tiles which belong to a so-called fylfot (the ones colored in gray, or black for that matter) appears to be simply connected and shows a striking similarity to the well known Gosper curve (see for instance the first example here upon scrolling down 2-3 screens), as constructed e.g. by an L-system.

(In a precise sense, we are of course not talking about the fractals themselves, rather about the iterations approximating them. But for both the iterative construction of the hat covering via metatiles and the iterations towards the very Gosper fractal, the steps correspond nicely.)

Look at the following coloring of the two regions separated by the Gosper curve and compare the appearance.

If we imagine the blue part a third wider and the black part a third narrower, the resemblance is even more striking. (Note that up to boundary effects, in the hat tiling on the right, the union of all the dark blue, light blue and white tiles also appears to be a simply connected region with the same "fractal quality" as the black/grey one, topologically equivalent so to say, just twice as "thick".)

All this is to introduce my main question, as I am sure from this that tilings by the hat monotile can also be represented (at least locally) by an L-system, which might in turn provide more information about the nature of the hat tilings.

How to come up with L-system rules to formalize/generate the structure of this pattern?

Note that the two rules for the Gosper curve,

$$A=A-B--B+A++AA+B-$$
$$B=+A-BB--B-A++A+B$$

are obtained from each other by reversing and switching everything, which I would of course expect to be similar for the hat tiling pattern.

So, I misled myself staring at the H8 in Smith et al. The way to solve this is to look at the F-supertile. That tile has 5 edges, and 4 of them are F-tiles that make up the fractal (at the next expansion level). So if we just ignore other parts of the F-supertile, it will expand to form at least part of the fractal.

The F-tiles surrounding the F-supertile each belong to a fylfot (3 F-tiles). By carefully including those F-tiles as well during the expansion, you get a curve which never draws the same edge twice.

• $$A \to +A[+F]-BA[+F]-C+$$
• $$B \to -D+[--F]BA[-F]+B-$$
• $$C \to -D+[--F]BA$$
• $$D \to BA[+F]-C+$$
• $$F \to -D+[--F]BA[-F]+BA[-F]+F$$

Where at level 0 symbols $$C$$ and $$D$$ are lines 1 unit long, $$A$$, $$B$$, and $$F$$ are lines $$\dfrac{\phi}{\sqrt{2}}$$ long, $$-$$ and $$+$$ are left and right turns by $$\dfrac{\pi}{3}$$, $$[$$ is stack push, and $$]$$ is stack pop.

Running code: https://trinket.io/python/df6f9fa4db

import turtle
import math

# use the simpler 'Golden Key' f-tile from
# Socolar, 'Quasicrystalline structure of the Smith monotile tilings'
# https://arxiv.org/pdf/2305.01174.pdf
phi = (1 + math.sqrt(5))/2
root2 = math.sqrt(2)

def expand(order, a, stack, s0, s1):
for op in s0 if order <= 0 else s1:
mono_op_map[op](order - 1, a, stack)

def op_push(stack):

def op_pop(stack):
pos, hd = stack.pop()
turtle.up()
turtle.setpos(pos)
turtle.down()

# The F-supertile in Smith et al has 5 sides, 4 of which are F-tiles.
# to get an L-system for the F-tile fractal, we just expand those.
# Choosing rules carefully avoids repeating any edge.
mono_op_map = {
"a": lambda o, a, s: turtle.forward(a*phi/root2),
"b": lambda o, a, s: turtle.forward(a),
"A": lambda o, a, s: expand(o, a, s, "a", "+A[+F]-BA[+F]-C+"),
"B": lambda o, a, s: expand(o, a, s, "a", "-D+[--F]BA[-F]+B-"),
"C": lambda o, a, s: expand(o, a, s, "b", "-D+[--F]BA"),
"D": lambda o, a, s: expand(o, a, s, "b", "BA[+F]-C+"),
# A free edge from a fylfot, allowed to branch everywhere.
# Use 'B' instead of 'F' above to get a sponge.
"F": lambda o, a, s: expand(o, a, s, "a", "-D+[--F]BA[-F]+BA[-F]+F"),
"+": lambda o, a, s: turtle.right(60),
"-": lambda o, a, s: turtle.left(60),
"[": lambda o, a, s: op_push(s),
"]": lambda o, a, s: op_pop(s),
}
stack = []
start = "A"
order = 6
size = 70/(order*order)
turtle.speed("fastest")
# this system is super slow, disable animation entirely
#turtle.hideturtle()
turtle.tracer(0, 0)
expand(order, size, stack, start, start)
turtle.update()


• You nailed it! If you still managed to "eradicate/non-draw" the inner lines, including those where 3 fylfots meet, this would be the perfect equivalent of the Gosper curve - a new kind of space-filling curve, but obtained in a somewhat pedestrian way. (No critique here - great job!) My initial idea was of course about an L-system which does not need those "auxiliary" inner lines but where some substitution rules are directly applied to segments of the coastline to obtain only that coastline, the same way it happens for the Gosper curve. But I guess that'd be too tricky... Commented May 9, 2023 at 9:11
• I've updated the rules to simplify them - what I was doing wrong was trying to avoid drawing the F-tiles at each level and only draw the tiles in at the bottom level (because the missing edge makes everything awkward). This meant I'd missed 2 sides in every expansion, which is how the rules got complicated. Happier with the code now. I think this is pretty much what you were after? Commented May 9, 2023 at 13:52
• I updated again, I found an even simpler set of rules. I wasn't happy with the way the previous rules had redundancy in them, and would redraw parts of the figure over and over. Also, the rules included an interior angle ('alpha') which just cancels out later. While there's still 2 lengths in this version, the fractal works with any ratio, even 1:1; so the 5 rules work in most online L-system generators which only have one edge length. Commented May 14, 2023 at 11:58
• Finally, your intuition in the question was correct: rule A is the reverse of B, C is the reverse of D (C and D are just partial versions of A and B). F is just an extension of B by a fylfot when B points to free space instead of connecting to another tile. Replacing 'F' with B in the rules and dropping the F rule gives an interesting sponge/gasket like fractal. I have to wonder if you can work the other way, and get from fractals to tilings? Commented May 14, 2023 at 12:51
• Great! Talking about reverse rules, I see the funny thing that the exact reverse of rule A would be $$B \to -D+[--F]BA+[-F]B-$$ and not $$B \to -D+[--F]BA[-F]+B-.$$ For C and D there is no such 'switching'. Now the fractal would have an even stronger correspondence with the Gosper curve if you have the turtle going 'around' the whole of your fractal, i.e. give the line segments a certain width and have the turtle build a continuous curve without push and pop. Re your idea to get from fractals to tilings: I'd think that there are little chances to obtain tilings with only a few different kinds. Commented May 14, 2023 at 19:38

I don't know the answer to the second part of your question (yet), about the self-avoiding fylfot fractal, but here's an L-system generating outlines of patches of monotiles, implied by the H7/H8 recursion in the original paper.

Running code here: https://trinket.io/library/trinkets/274cc18bd5

The rules I came up with were:

• $$U \to V++R++U++V++W++V++R--U++V++W++V++R++U--V$$
• $$V \to W++V++R++U++V++W++V++R--W$$
• $$W \to V++R++U++V++W++V++R--W++V++R++U++V++W--V$$
• $$R \to V++R++U++V++W++V++R--W$$

with a starting pattern of $$U++V++W++V++R$$, where $$+$$ is rotate right 30 degrees, $$-$$ is rotate left 30 degrees, and the basic symbols $$UWVR$$ are defined in terms of the angle operators above and 2 straight lines of length $$a$$ and $$b$$ like so:

• $$U \to a+++b--b+++a--a+++b$$
• $$V \to b---a$$
• $$W \to a+++b$$
• $$R \to aa$$

In the production rules, there are various cycles of the starting position; those cycles are adding a monotile at the next level down in the pattern.

For the fractal: in every H8, 2 of the 7 (unflipped) tiles are part of a fylfot - and it's always the 2 at the top left of the H8 diagram... so it seems likely to me that further consideration of H8 will lead to the solution.

(Edited to remove the use of a stack; this was being used to return the turtle to the position a tile branches off the outline, but if I just complete the loop round the tile the turtle is there anyway. So now this draws a single continuous line. Also, refactored $$R$$ to remove an instance of $$V$$)

• That is great and would have been my next question anyway - I was also trying to attempt to generate the tiling "itself", based on the L-system rules for kites&darts tilings. Note that yours yields a tiling of $Tile(\sqrt{3},1)$ not the hat$=Tile(1,\sqrt{3})$, but never mind, as they are equivalent. Now, I don't know Python, my main curiosity is that I don't see any $\sqrt{3}$ or $\sqrt{3}/2$ in the formula, as it would be the case e.g. with FRACTINT. Commented May 2, 2023 at 14:11
• I don't think I posted the version with the $\sqrt{3}$ in it. (it's just the multiplier in the "b" symbol). I've updated the trinket with a slightly simpler set of rules, I didn't need that stack - will update the answer with those Commented May 2, 2023 at 20:58
• FWIW, my motivation was to produce a more compact algorithm for the tiling, so I could display it with a single toots worth of code on the BBC Micro emulator bot hachyderm.io/@[email protected]/110295593396844730 . That code's a bit illegible since I needed the ascii codes of the symbols to drive the drawing, the python was intended to be the explicable version, but they work the same way. Commented May 2, 2023 at 21:13
• Re your edit: For the fractal, I'd think that needs a completely different approach anyway. Comparing with the Gosper curve, the four first iteration steps for 1, 2, 3 ... iterations might correspond to the patches in Figure 2.7 of the paper, such that the L-system presumably should formalize roughly the boundary between the union(s) of the gray tiles and the rest. I think it has a 3-fold symmetry, which might help. But I have a hard time to see how, say, the 3rd step can be obtained by an iteration from the 2nd step... Commented May 4, 2023 at 19:14