An $n \times n$ array $L : \text{Fin}\ n \to \text{Fin}\ n \to \text{Fin}\ n$ is a Latin square if every row and every column is a permutation of $\{0,1,\dots,n-1\}$, equivalently if every row map and every column map is injective.
- row_injective (i : Fin n) : Function.Injective (L i)
- col_injective (j : Fin n) : Function.Injective fun (i : Fin n) => L i j
Instances For
Ryser's conjecture: every $n \times n$ Latin square with $n$ odd has a Latin transversal.
The set of symbols appearing on the diagonal selected by the permutation $\sigma$, i.e. $\{L_{i,\sigma(i)} : i \in \text{Fin}\ n\}$.
Instances For
Ryser–Brualdi–Stein conjecture: every $n \times n$ Latin square with $n$ even admits a permutation $\sigma$ such that the diagonal $\{L_{i,\sigma(i)}\}$ contains at least $n-1$ distinct symbols (a near-transversal).
The number of cells of the array $L$ whose entry equals the symbol $c$, i.e. $|\{(i,j) : L_{i,j} = c\}|$.
Instances For
Generalised notion of a Latin transversal for an array with entries in an arbitrary type $\alpha$: a permutation $\sigma$ such that the selected diagonal entries $L_{i,\sigma(i)}$ are all distinct.
Instances For
The finite set of permutations $\sigma$ that yield a Latin transversal of $L$: distinct rows pick distinct symbols.
Instances For
Membership in goodPerms L is equivalent to the diagonal map $i \mapsto L_{i,\sigma(i)}$ being injective.
Lopsided LLL application underlying Erdős–Spencer: for $n \ge 2$, if every symbol of the $n \times n$ array $L$ appears at most $n/(4e)$ times, then the set of permutations producing a Latin transversal is nonempty.
Erdős–Spencer 1991 (Theorem 6.5.11): if $L$ is an $n \times n$ array (with $n \ge 1$) in which every symbol appears at most $n/(4e)$ times, then $L$ has a Latin transversal.