Wang tiles and finite patches #
A Wang tile is an oriented unit square with natural-number edge colours. A finite palette is
a list; repetitions do not affect tiling. We distinguish tilings of the integer plane, tilings
of the natural-number quadrant with a prescribed southwest tile, and plane tilings with a
prescribed tile at the origin. These definitions alone do not establish undecidability;
the unseeded plane theorem is proved in the separate WangTile.Undecidable module.
Main definitions #
Cslib.WangTile: the four edge colours, coded in order(top, bottom, left, right).Cslib.WangTile.TilesPlane: a matching tiling of the integer plane.Cslib.WangTile.SeededInstance: a palette and a distinguished tile, coded in that order.Cslib.WangTile.TilesQuadrant,Cslib.WangTile.TilesAtOrigin: the two seeded problems.Cslib.WangTile.Rectangle,Cslib.WangTile.SeededSquare: matching finite patches.
References #
The prior formalization is lean-wang, revision 64268a3, Basic.
The tiles of τ tile the plane: some map ℤ × ℤ → τ matches colours on every pair of
horizontally and vertically adjacent cells.
A seeded instance is coded as (tiles, seed).
A matching tiling of the quadrant ℕ × ℕ whose southwest tile is the seed.
A matching tiling of the integer plane with the seed at the origin.
A matching rectangular patch of width w and height h, with no boundary conditions.
The tile at each position, indexed from the southwest corner.
Every tile belongs to the palette.
- horizontal (i : Fin w) (j : Fin h) (hi : ↑i + 1 < w) : (self.tile i j).right = (self.tile ⟨↑i + 1, hi⟩ j).left
Horizontally adjacent edges match.
- vertical (i : Fin w) (j : Fin h) (hj : ↑j + 1 < h) : (self.tile i j).top = (self.tile i ⟨↑j + 1, hj⟩).bottom
Vertically adjacent edges match.
A square of side n + 1 with prescribed southwest tile. The side is always positive.
The southwest tile is the seed.
A tile assembled from four primitive-recursive colour functions is primitive recursive.
Reading a tile's top colour is primitive recursive.
Reading a tile's bottom colour is primitive recursive.
Reading a tile's left colour is primitive recursive.
Reading a tile's right colour is primitive recursive.
Reading the palette of a seeded instance is primitive recursive.
Reading the seed of a seeded instance is primitive recursive.
Building a seeded instance from a palette and a seed is primitive recursive.