AFTD Auto-Formalizing Theoretical Domains

latin_square_is_add

theoremverified

Sanity check: the addition table of Z/n is a Latin square.

Statement

theorem latin_square_is_add (n : ℕ) [NeZero n] : latin_square_is fun i j : Fin n => i + j
Source
Sanity lemma for Latin squares, arXiv:2610.20008 (Avoiding a partial Latin square with an isotope of a given Latin square).
Verified
17 Oct 2026
Axioms
Quot.soundpropext
Built on 1
  • latin_square_isA Latin square of order n: an n × n array with entries in {1, ..., n} whose rows and columns are permutations of {1, ..., n}.
Used by 1
  • is_reduced_latin_square_addFor every non-zero natural number $n$, the addition table on $\text{Fin } n$ is a reduced Latin square of order $n$.

The proof, explained

The theorem asserts that the addition table of Fin n defines a Latin square when n > 0. The definition of a Latin square requires each row and each column function to be injective. The proof provides a pair witnessing these two conditions: left cancellation in Fin n ensures row injectivity, and right cancellation ensures column injectivity.

  1. The addition operation on Fin n forms a Latin square: each row and each column has no duplicate entries.

    By definition, a Latin square requires that every row map j ↦ i + j and every column map i ↦ i + j is injective. The proof supplies a pair of proofs: left cancellation (add_left_cancel) proves that i + j₁ = i + j₂ implies j₁ = j₂, establishing row injectivity; and right cancellation (add_right_cancel) proves that i₁ + j = i₂ + j implies i₁ = i₂, establishing column injectivity.

    line 2

    uses add_left_cancel, add_right_cancel

      ⟨fun i _ _ h => add_left_cancel h, fun j _ _ h => add_right_cancel h⟩
add_left_cancel
In an additive structure with left cancellation, if a + b = a + c, then b = c.
add_right_cancel
In an additive structure with right cancellation, if a + b = c + b, then a = c.

Written by a model (gemini-3.8-flash) from the Lean source alone (no goal states were available). Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem latin_square_is_add (n : ℕ) [NeZero n] : latin_square_is fun i j : Fin n => i + j :=  ⟨fun i _ _ h => add_left_cancel h, fun j _ _ h => add_right_cancel h⟩
See it in the graphDiscuss this resultChallenge it