Let \(L(k,n)\) be the number of \(k\times n\) Latin rectangles. Erdős Problem 725 asks for an asymptotic formula for \(L(k,n)\).
Theorem. As \(n\to\infty\), uniformly for \(0\le k\le n-1\),
\[L(k,n)\sim(n!)^k\left(\frac{n!}{(n-k)!}\right)^{2n}\frac{((n-k)n)!}{(n^2)!}\,e^{-\frac k2+\frac k{3n}}.\]Corollary. The number of Latin squares of order \(n\) satisfies
\[L(n,n)=L(n-1,n)\sim e^{5/6-n/2}\,\frac{(n!)^{3n}}{(n^2)!}.\]The theorem is formally verified in Lean 4, without hypotheses, for the definition of \(L(k,n)\) in the Formal Conjectures library; the Lean proof is in the GitHub repository. The proof, its Lean formalisation and the paper were all produced by AI agents (Devin, Cognition AI), directed by the first author.
*Devin is an AI software agent made by Cognition AI. The proof, its Lean formalisation and the text of the paper were produced by Devin agents, directed and reviewed by the first author, who takes responsibility for the contents.
The paper follows. If it does not display, open the PDF.