\section{The circuit partition polynomial}\label{sec:2} Throughout, $V = [n]$ and arcs are ordered pairs $(u,v)$ of vertices. Let $K_n^*$ be the complete directed graph on $V$ with the $n(n-1)$ arcs $(u,v)$, $u \ne v$, and $K_n^\circ$ the complete directed graph with all $n^2$ arcs, loops included. A directed graph is \emph{Eulerian} if every vertex has equal in-degree and out-degree. A \emph{transition system} $T$ of a directed graph $G$ chooses at every vertex $v$ a bijection from the arcs entering $v$ to the arcs leaving $v$; it exists only if $G$ is Eulerian. Following the chosen transitions decomposes the arcs of $G$ into closed trails; let $c(T)$ be their number. The \emph{circuit partition polynomial} of $G$ is \[ j(G;t) = \sum_T t^{c(T)} . \] (so $j(G;t) = 0$ if $G$ is not Eulerian). It counts decompositions of the arc set into closed trails, weighted by $t$ per trail; it is a directed relative of the Martin polynomial. I write $j_n(t) = j(K_n^*;t)$ and $J_n(t) = j(K_n^\circ;t)$. Since $K_n^*$ has $\prod_v (n-1)!$ transition systems, \begin{equation}\label{eq:2.1} j_n(1) = ((n-1)!)^n . \end{equation} Figure~\ref{fig:transition} shows a transition system of $K_3^*$ and its closed trails. \begin{figure}[ht] \centering \input{figures/transition} \caption{A transition system $T$ of $K_3^*$. At each vertex the two entering arcs are paired with the two leaving arcs (curves inside the grey discs), and following these transitions gives the closed trails $1 \to 2 \to 1$ and $1 \to 3 \to 2 \to 3 \to 1$, so $c(T) = 2$. By \eqref{eq:2.1}, $K_3^*$ has $(2!)^3 = 8$ transition systems.} \label{fig:transition} \end{figure} The loops of $K_n^\circ$ only contribute a linear factor each. \begin{lemma}\label{lem:2.1} Let $G$ be a directed graph, and let the vertex $v$ of in-degree $d$ carry a loop $\ell$. Then $j(G;t) = (t+d-1)\, j(G - \ell; t)$. In particular $J_n(t) = (t+n-1)^n j_n(t)$. \end{lemma} \begin{proof} Fix a transition system of $G$. Either it maps $\ell$ to itself, and then $\ell$ is a closed trail of its own and the rest is a transition system of $G - \ell$; this gives $t\,j(G-\ell;t)$. Or it maps some arc $e \ne \ell$ entering $v$ to $\ell$ and $\ell$ to some arc $f$ leaving $v$. Replacing the passage $e \to \ell \to f$ by the transition $e \to f$ gives a transition system of $G - \ell$ with the same number of closed trails. Conversely, each transition system of $G - \ell$ arises in this way from exactly $d-1$ systems of $G$, one for each choice of the arc $e$ among the $d-1$ arcs entering $v$ in $G - \ell$. (If $G$ is not Eulerian, neither is $G - \ell$, and both sides vanish.) The vertices of $K_n^\circ$ have in-degree $n$, which gives the second statement. \end{proof} The polynomial has a determinant formula, which is a form of MacMahon's master theorem for the $\alpha$-permanent of Vere-Jones \cite[(3)]{VereJones}. I give the short proof, since its ingredients are used later. Let $X = (x_{uv})$ be the $n \times n$ matrix with $x_{uu} = 0$ and independent indeterminates $x_{uv}$ for $u \ne v$, one for each arc of $K_n^*$. For a set $F$ of arcs write $x^F = \prod_{e \in F} x_e$, and let $E$ be the set of all arcs of $K_n^*$. It is convenient to work in the ring $R = \Q[x_e : e \in E]/(x_e^2 : e \in E)$, in which a monomial survives only if it uses each arc at most once. A \emph{partial derangement} is a permutation $\sigma$ of a subset $S_\sigma \subseteq V$ without fixed points; it is the set of arcs $(v, \sigma(v))$, $v \in S_\sigma$, and $c(\sigma)$ denotes its number of cycles. Since $\sgn\sigma = (-1)^{|S_\sigma| - c(\sigma)}$, the expansion of $\det(I - X)$ into principal minors reads \begin{equation}\label{eq:2.2} \det(I - X) = \sum_{\sigma} (-1)^{c(\sigma)} x^\sigma , \end{equation} the sum over all partial derangements. Each monomial on the right uses at most one arc leaving each vertex. \begin{lemma}\label{lem:2.2} In $R$ one has $\log \det(I-X) = -\sum_H \mathrm{ec}(H)\, x^H$, where $H$ runs over the nonempty sets of arcs that form a connected Eulerian graph and $\mathrm{ec}(H)$ is the number of Eulerian circuits of $H$, counted as cyclic sequences of arcs. Consequently, for every integer $a \ge 0$ and every set $F \subseteq E$ of arcs, \[ [x^F] \det(I - X)^a = j(F;-a), \qquad\text{in particular}\quad [x^E] \det(I - X)^a = j_n(-a), \] where $j(F;t)$ is the circuit partition polynomial of the graph $(V, F)$. \end{lemma} \begin{proof} As formal power series, $\log \det(I-X) = \operatorname{tr} \log(I-X) = -\sum_{k \ge 1} \operatorname{tr}(X^k)/k$. The trace $\operatorname{tr}(X^k)$ is the sum of $x$ over the closed walks of length $k$ with a marked starting arc. In $R$ only walks with $k$ distinct arcs survive. Such a walk is an Eulerian circuit of its arc set $H$, with $|H| = k$ and a marked start, and each Eulerian circuit has exactly $k$ starting arcs. This proves the first statement. Hence $\det(I-X)^a = \exp(a \log \det(I-X)) = \exp\bigl(-a\sum_H \mathrm{ec}(H) x^H\bigr)$ in $R[a]$, a polynomial identity in $a$ because the exponent is nilpotent. The coefficient of $x^F$ on the right is the sum, over all partitions of $F$ into blocks $H_1, \dots, H_k$ that are connected Eulerian graphs, of $(-a)^k \prod_i \mathrm{ec}(H_i)$. Choosing an Eulerian circuit in each block is the same as choosing a transition system with $k$ closed trails, so the coefficient is $\sum_T (-a)^{c(T)} = j(F;-a)$. For integers $a \ge 0$ the left side is an honest polynomial, and its image in $R$ has the same coefficient of $x^F$. \end{proof} The formula shows at once that $j_n$ has many integer roots, and it identifies the value at $t = 1-n$. For an $n \times n$ $(0,1)$-matrix $M$ and $k \ge 1$ let $c_k(M) = [x^M] \det(X')^k$, where $X'$ is a matrix of $n^2$ independent indeterminates and $x^M$ is the product of the entries in the support of $M$. Expanding each of the $k$ factors by the Leibniz formula, $c_k(M)$ is the sum of $\prod_{i=1}^k \sgn\sigma_i$ over the ordered decompositions of $M$ into $k$ permutation matrices $P_{\sigma_1}, \dots, P_{\sigma_k}$. Let $J$ be the all-ones matrix. \begin{lemma}\label{lem:2.3} For $0 \le a \le n-2$ one has $j_n(-a) = 0$, and $j_n(1-n) = c_{n-1}(J - I)$. Consequently \[ j_n(t) = t(t+1)\cdots(t+n-2)\, g_n(t) \] with $g_n \in \Z[t]$ of degree $\binom{n-1}{2}$, and $c_{n-1}(J-I) = (-1)^{n-1}(n-1)!\, g_n(1-n)$. \end{lemma} \begin{proof} By \eqref{eq:2.2}, every monomial of $\det(I-X)^a$ uses at most $a$ arcs leaving each vertex. Every vertex has $n-1$ arcs leaving it, so $[x^E]\det(I-X)^a = 0$ for $a \le n-2$, and Lemma~\ref{lem:2.2} gives the roots. For $a = n-1$ each of the $n-1$ factors must contribute exactly one arc leaving every vertex, that is, a derangement $\sigma_i$ of all of $V$, and the $n-1$ derangements must partition $E$. The coefficient of such a term is $\prod_i (-1)^{c(\sigma_i)} = \prod_i (-1)^n \sgn \sigma_i = \prod_i \sgn\sigma_i$, since $n(n-1)$ is even. Summing over all ordered decompositions of $J - I$ into $n-1$ permutation matrices gives $c_{n-1}(J - I)$. The polynomial $j_n$ has integer coefficients and the distinct roots $0, -1, \dots, -(n-2)$, so the monic polynomial $t(t+1)\cdots(t+n-2)$ divides it in $\Z[t]$ and $g_n \in \Z[t]$. Its degree is $\binom{n-1}{2}$, since a transition system has at most $\binom n2$ closed trails (each has length at least $2$) and the decomposition into $2$-cycles attains this. Finally, $(1-n)(2-n)\cdots(-1) = (-1)^{n-1}(n-1)!$. \end{proof} The next lemma connects these quantities with Latin squares. An ordered decomposition $(P_1, \dots, P_n)$ of $J$ into permutation matrices is the same thing as a Latin square, with symbol $s$ in the cells of $P_s$; $P_s$ is the matrix of the \emph{symbol permutation} of $s$, which maps each row to the column where $s$ occurs. Thus $D_n = c_n(J)$ is the sum over all Latin squares of order $n$ of the product of the signs of their symbol permutations. Figure~\ref{fig:latinsquare} shows a Latin square of order $4$ and its symbol permutations. \begin{figure}[ht] \centering \input{figures/latinsquare} \caption{A Latin square $L$ of order $4$ and the matrices $P_s$ of its symbol permutations: $P_s$ has its entries $1$ in the cells of the symbol $s$, and $P_1 + P_2 + P_3 + P_4 = J$.} \label{fig:latinsquare} \end{figure} \begin{lemma}\label{lem:2.4} \begin{enumerate} \item $D_n = L_n^{re} - L_n^{ro}$. \item $c_{n-1}(J-I) = (n-1)!\,U_n$, with $U_n$ as in Section~\ref{sec:1}, and hence $U_n = (-1)^{n-1} g_n(1-n)$. \item If $n$ is even, then $D_n = n!\, c_{n-1}(J - I) = n!\,(n-1)!\,U_n$. \end{enumerate} \end{lemma} \begin{proof} (1) Exchanging the roles of rows and symbols, $(r,c,s) \mapsto (s,c,r)$, is a bijection on Latin squares. It turns the symbol permutation of $s$ into the inverse of the permutation of row $s$ (as a map from columns to symbols), which has the same sign. (2) The decompositions of $J - I$ into $n-1$ permutation matrices $P_2, \dots, P_n$ are the unipotent Latin squares with diagonal symbol $1$, where $P_1 = I$ has sign $+1$. Relabelling the symbols $2, \dots, n$ permutes the $P_s$ and does not change the product of their signs. Each orbit has $(n-1)!$ elements and contains exactly one square with first row $(1, 2, \dots, n)$. The second statement follows from Lemma~\ref{lem:2.3}. (3) Let $(P_1, \dots, P_n)$ be a decomposition of $J$ and $P_1 = P_\pi$. Multiplying every $P_s$ on the right by $P_\pi^{-1}$ gives a decomposition with first matrix $I$, and it changes the product of the signs by $(\sgn \pi)^n = 1$. This is a bijection between the decompositions with $P_1 = P_\pi$ and those with $P_1 = I$, for each of the $n!$ permutations $\pi$. The decompositions with $P_1 = I$ are counted by $c_{n-1}(J-I)$. \end{proof} Part (3) is Zappa's reduction to unipotent squares; for odd $n \ge 3$ the same map multiplies the sign by $\sgn\pi$, and since $\sum_\pi \sgn\pi = 0$ this gives $D_n = 0$. In the remaining sections I work with $g_n$. By Lemma~\ref{lem:2.4}, the Alon--Tarsi conjecture for even $n$ and Zappa's extended conjecture for all $n$ both say that $g_n(1-n) \ne 0$. \begin{remark}\label{ex:2.5} For $n = 4$ one finds $j_4(t) = t(t+1)(t+2)\,(t^3 + 13t^2 + 74t + 128)$, so $g_4(-3) = -4$ and $U_4 = 4$, $D_4 = 4!\,3!\cdot 4 = 576$. For $n = 5$ the polynomial $g_5(t) = t^6 + 34t^5 + 570t^4 + 6032t^3 + 38069t^2 + 125070t + 162000$ gives $U_5 = g_5(-4) = -24$. \end{remark}