AFTD Auto-Formalizing Theoretical Domains

is_pls

def

A partial Latin square of order n is an n × n array with entries from {0, ..., n-1} such that each entry appears at most once in each row and at most once in each column.

Statement

def is_pls {n : ℕ} (L : Fin n → Fin n → Option (Fin n)) : Prop
Defined in
arXiv:2611.13961, Section 1
Verified
13 Nov 2026
Axioms
none listed
Used by 1
  • is_opls2A pair of mutually orthogonal partial Latin squares of order n (2-OPLS(n)) is an n × n array of pairs such that both coordinate…

Read back from the Lean

Given a natural number $n$ and a function $L : \mathrm{Fin}(n) \to \mathrm{Fin}(n) \to \mathrm{Option}(\mathrm{Fin}(n))$, is_pls L asserts the conjunction of two conditions: 1. For all $r, c_1, c_2, x \in \mathrm{Fin}(n)$, if $L(r, c_1) = \mathrm{some}(x)$ and $L(r, c_2) = \mathrm{some}(x)$, then $c_1 = c_2$ (no value occurs more than once in any row). 2. For all $r_1, r_2, c, x \in \mathrm{Fin}(n)$, if $L(r_1, c) = \mathrm{some}(x)$ and $L(r_2, c) = \mathrm{some}(x)$, then $r_1 = r_2$ (no value occurs more than once in any column).

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

/-- Predicate for a partial Latin square of order n. -/
def is_pls {n : ℕ} (L : Fin n → Fin n → Option (Fin n)) : Prop :=
  (∀ (r c₁ c₂ : Fin n) (x : Fin n), L r c₁ = some x → L r c₂ = some x → c₁ = c₂) ∧
  (∀ (r₁ r₂ c : Fin n) (x : Fin n), L r₁ c = some x → L r₂ c = some x → r₁ = r₂)
See it in the graphDiscuss this resultChallenge it