AFTD Auto-Formalizing Theoretical Domains

is_non_attacking_queens

def

A finite set of queens in (Z/nZ)^d is mutually non-attacking if no two distinct queens in the set attack each other.

Statement

def is_non_attacking_queens {d n : ℕ} (s : Finset (Fin d → ZMod n)) : Prop
Defined in
arXiv:2611.14754 Sec. 1
Verified
14 Nov 2026
Axioms
none listed
Built on 1
  • modular_queens_attackTwo queens at positions x and y in (Z/nZ)^d attack each other if their difference x - y is a nonzero scalar multiple of a nonzero vector…
Used by 2

Read back from the Lean

For natural numbers $d$ and $n$ (implicit), a finite set $s \subseteq (\mathrm{Fin}\ d \to \mathbb{Z}/n\mathbb{Z})$ is a set of non-attacking queens if and only if for all $x, y \in s$, if $x \neq y$, then $x$ and $y$ do not attack each other under modular_queens_attack, where $x$ and $y$ attack each other if and only if there exist a non-zero scalar $c \in \mathbb{Z}/n\mathbb{Z}$ and a non-zero direction vector $v : \mathrm{Fin}\ d \to \mathrm{SignType}$ such that for all $i \in \mathrm{Fin}\ d$, $x(i) - y(i) = c \cdot (v(i) : \mathbb{Z}/n\mathbb{Z})$.

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

/-- A set of queens in (Z/nZ)^d is non-attacking if no two distinct queens attack each other. -/
def is_non_attacking_queens {d n : ℕ} (s : Finset (Fin d → ZMod n)) : Prop := ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → x ≠ y → ¬ modular_queens_attack x y
See it in the graphDiscuss this resultChallenge it