AFTD Auto-Formalizing Theoretical Domains

is_opls2

def

A pair of mutually orthogonal partial Latin squares of order n (2-OPLS(n)) is an n × n array of pairs such that both coordinate projections are partial Latin squares of order n and each ordered pair of symbols appears at most once in the array.

Statement

def is_opls2 {n : ℕ} (M : Fin n → Fin n → Option (Fin n × Fin n)) : Prop
Defined in
arXiv:2611.13961, Section 1
Verified
13 Nov 2026
Axioms
none listed
Built on 1
  • is_plsA 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…
Used by 1
  • is_mopls2A maximal pair of mutually orthogonal partial Latin squares of order n (2-MOPLS(n)) is a 2-OPLS(n) that cannot be extended to another…

Read back from the Lean

A matrix M : Fin n → Fin n → Option (Fin n × Fin n) satisfies is_opls2 if and only if the following three conditions hold: 1. The matrix formed by the first component of each entry (i.e. fun r c => (M r c).map Prod.fst) is a partial Latin square according to is_pls. 2. The matrix formed by the second component of each entry (i.e. fun r c => (M r c).map Prod.snd) is a partial Latin square according to is_pls. 3. For all rows r₁, r₂ : Fin n, columns c₁, c₂ : Fin n, and pairs p : Fin n × Fin n, if M r₁ c₁ = some p and M r₂ c₂ = some p, then r₁ = r₂ and c₁ = c₂ (i.e., every ordered pair occurs in at most one cell of M).

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 pair of mutually orthogonal partial Latin squares of order n. -/
def is_opls2 {n : ℕ} (M : Fin n → Fin n → Option (Fin n × Fin n)) : Prop :=
  is_pls (fun r c => (M r c).map Prod.fst) ∧
  is_pls (fun r c => (M r c).map Prod.snd) ∧
  (∀ (r₁ c₁ r₂ c₂ : Fin n) (p : Fin n × Fin n), M r₁ c₁ = some p → M r₂ c₂ = some p → r₁ = r₂ ∧ c₁ = c₂)
See it in the graphDiscuss this resultChallenge it