PeriodicTileContactRouting #
Adapted from Wesley Pegden’s Apache-2.0 Trellis formalization of Levine–Pegden–Smart. Changes: pool module paths, public exports, project namespace and current Mathlib compatibility.
For a periodic tile complex $P$, a periodic contact routing is a proper, compactly locally finite, periodic plane drawing of the prescribed graph, made from genuine common-edge ports and tile-interior half-stars. It chooses a point $v_a$ in the interior of each closed-square tile realization. For each prescribed edge $ab$ it chooses, symmetrically, an actual two-element lattice edge $$ e_{ab}\in E(T_a)\cap E(T_b) $$ and an optional port whose value is the Euclidean midpoint $p_{ab}$ of that edge. The optional port is none exactly for nonedges; a nonedge also has empty chosen-edge, half-arc, and full-arc data.
For a prescribed edge $ab$, the half-arc $H_{ab}$ is an arc from $v_a$ to $p_{ab}$ contained in the interior of $T_a$ except at the port. Distinct ports at $a$ are distinct, and distinct incident half-arcs meet exactly at $v_a$. The full arc $A_{ab}=H_{ab}\cup H_{ba}$ is an arc from $v_a$ to $v_b$, is symmetric in $a,b$, and two distinct full arcs meet exactly in the positions of their common graph endpoints. The vertex positions are injective. Compact local finiteness means that every compact subset of the plane meets only finitely many full arcs.
Translation by the period lattice translates vertex positions, selected lattice edges, optional ports, half-arcs, and full arcs. Thus this object contains precisely a periodic proper drawing of the prescribed adjacency relation. It has no second face type, no routed face regions, and no plane-cover datum. In particular, an isolated raw corner contact with no common footprint edge produces neither a port nor a drawn edge.
The tile-interior point representing each graph vertex.
- portEdge : ι → ι → Finset GaussianInt
The selected common unit footprint edge of each prescribed adjacency.
The midpoint port of a prescribed edge, absent on nonedges.
The half arc inside the first tile, ending at the selected edge port.
The symmetric full arc joining the two incident tile positions.
- portEdge_common (a b : ι) : P.plane.adjacent a b → self.portEdge a b ∈ FootprintEdges (P.tile a) ∩ FootprintEdges (P.tile b)
- position_injective : Function.Injective self.position
- portEdge_periodic (u : ↥P.lattice) (a b : ι) : self.portEdge (P.shift u a) (P.shift u b) = Finset.image (fun (z : GaussianInt) => z + ↑u) (self.portEdge a b)