AFTD Auto-Formalizing Theoretical Domains

loom_grid

def

The loom grid B_{r,c} has vertex set [r] × [c] × {-, +}, where within each column all pairs on opposite sides are adjacent, and between consecutive columns all pairs in the same row are adjacent.

Statement

def loom_grid (r c : ℕ) : SimpleGraph (Fin r × Fin c × Bool)
Defined in
arXiv:2611.09627:360
Verified
09 Nov 2026
Axioms
none listed
Used by 1

Read back from the Lean

loom_grid r c defines a simple graph whose vertices are triples $(u_1, u_2, u_3) \in \text{Fin } r \times \text{Fin } c \times \text{Bool}$. Two distinct vertices $u$ and $v$ are adjacent if and only if either: 1. They share the same second coordinate ($u.2.1 = v.2.1$) and have opposite boolean values ($u.2.2 \neq v.2.2$), with no condition on their first coordinates ($u.1$ and $v.1$); or 2. They share the same first coordinate ($u.1 = v.1$) and their second coordinates differ by 1 ($u.2.1.\text{val} + 1 = v.2.1.\text{val}$ or $v.2.1.\text{val} + 1 = u.2.1.\text{val}$), with no condition on their boolean values ($u.2.2$ and $v.2.2$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The loom grid B_{r,c} has vertices in Fin r × Fin c × Bool with complete bipartite connections between sides in each column and horizontal connections between consecutive columns in the same row. -/
def loom_grid (r c : ℕ) : SimpleGraph (Fin r × Fin c × Bool) := SimpleGraph.fromRel fun u v =>
    (u.2.1 = v.2.1 ∧ u.2.2 = false ∧ v.2.2 = true) ∨
    (u.1 = v.1 ∧ u.2.1.val + 1 = v.2.1.val)
See it in the graphDiscuss this resultChallenge it