AFTD Auto-Formalizing Theoretical Domains

is_mopls2

def

A 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 2-OPLS(n) by inserting any ordered pair into any empty cell.

Statement

def is_mopls2 {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_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

For a natural number n and an n × n matrix M with entries in Option (Fin n × Fin n), is_mopls2 M asserts that M is a maximal orthogonal pair of partial Latin squares (MOPLS) of order n. Specifically, it asserts the conjunction of two conditions: 1. is_opls2 M: M is an orthogonal pair of partial Latin squares of order n, meaning: (a) The matrix formed by the first components of entries in M is a partial Latin square (no row contains duplicate first components, and no column contains duplicate first components). (b) The matrix formed by the second components of entries in M is a partial Latin square (no row contains duplicate second components, and no column contains duplicate second components). (c) Orthogonality: no pair p : Fin n × Fin n appears in more than one cell of M (if M r₁ c₁ = some p and M r₂ c₂ = some p, then r₁ = r₂ and c₁ = c₂). 2. Maximality: For every row r : Fin n and column c : Fin n such that M r c = none, and for every pair p : Fin n × Fin n, setting cell (r, c) to some p (while keeping all other cells identical to M) does not result in a valid orthogonal pair of partial Latin squares (i.e., ¬ is_opls2).

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 maximal pair of mutually orthogonal partial Latin squares of order n. -/
def is_mopls2 {n : ℕ} (M : Fin n → Fin n → Option (Fin n × Fin n)) : Prop :=
  is_opls2 M ∧ ∀ (r c : Fin n), M r c = none → ∀ (p : Fin n × Fin n),
    ¬ is_opls2 (fun i j => if i = r ∧ j = c then some p else M i j)
See it in the graphDiscuss this resultChallenge it