Wang tiles and finite tile sets
DefinitionDominoProblem_WangTilesdomino-problemtilingwang-tiles
A Wang tile is an oriented square with a color on each of its west, north, south, and east edges. All four colors are natural numbers from the same palette. A tile set is a finite set of these ordered quadruples: tiles with the same four colors are identical, and rotating a tile does not automatically add the rotated tile to the set.
Retired pending a review of the public Lean names. No replacement has been published.
Definition code
import Mathlib.Data.Finset.Basic namespace DominoProblem /-- An oriented Wang tile, with a natural-number color on each edge. -/ structure Tile where W : ℕ N : ℕ S : ℕ E : ℕ deriving DecidableEq /-- A finite set of allowed Wang tiles. -/ abbrev TileSet := Finset Tile end DominoProblem
Source
Mathematical definition: Hao Wang, “Proving Theorems by Pattern Recognition — II,” Bell System Technical Journal 40 (1961), §4.1, “A Generalized Game of Dominoes,” p. 22. https://doi.org/10.1002/j.1538-7305.1961.tb03975.x
Lean formalization: Adapted from Alex P. Klinkhamer, PeriodicDomino/Basic.lean, lines 10–31 (0BSD). https://github.com/ProtocolConvergence/periodic-domino-lean/blob/af6699cbf84ea7e57a0eddcead118c59f0e3dbe9/PeriodicDomino/Basic.lean#L10-L31