\section{The circuit partition polynomial and vertex removal}\label{sec:circuit} This section writes $L^e_n-L^o_n$ as a value of a graph polynomial (Proposition~\ref{prop:identity}) and proves the rule that removes one vertex of the graph at a time (Lemma~\ref{lem:quad-elim}). Propositions~\ref{prop:quad-ind} and~\ref{prop:identity} apply the rule $n-1$ times in all. Section~\ref{sec:quadratic} reads off the bounds. A \emph{multidigraph} $H$ has a finite vertex set and a finite set of labeled arcs. Each arc goes from its tail to its head. Loops and parallel arcs are allowed. Its matrix $M=M(H)$ has entry $M_{uv}$ equal to the number of arcs from $u$ to $v$. We call $H$ \emph{$d$-regular} if every vertex has $d$ arcs coming in and $d$ arcs going out. A \emph{transition system} $\pi$ of $H$ chooses at each vertex $v$ a bijection $\pi_v$ from the arcs into $v$ to the arcs out of $v$. The map $a\mapsto\pi_{\mathrm{head}(a)}(a)$, which follows each arc by the next, is a permutation of the arcs. Its cycles are closed trails (closed walks that use no arc twice), which together use every arc of $H$ exactly once. Let $\cyc(\pi)$ be the number of these closed trails. The \emph{circuit partition polynomial} of $H$ is \[ j(H;x)=\sum_\pi x^{\cyc(\pi)}, \] the sum over all transition systems. (It is closely related to the Martin polynomial, introduced by Martin and studied by Las Vergnas \cite{LV83}; see also \cite{Bol02}.) Let $K_n^\circ$ be the complete digraph with loops on $[n]$. It has one arc from every vertex to every vertex, including one loop at each vertex. Thus $M(K_n^\circ)=J_n$, where $J_N$ denotes the all-ones matrix of size $N$. We write $J$ when the size is clear. We write $I$ for the identity matrix, $X=(x_{uv})$ for a square matrix of independent indeterminates, and $[x^M]F$ for the coefficient of the monomial $x^M=\prod_{u,v}x_{uv}^{M_{uv}}$ in a polynomial $F$. The link with Latin squares goes through the value of $j$ at $x=-d$: the next lemma expresses it through a coefficient of $\det(X)^d$, and Lemma~\ref{lem:quad-latin} identifies that coefficient with $\pm\Delta_n$. \begin{lemma}\label{lem:quad-fact} If $H$ is $d$-regular on $N$ vertices and $M=M(H)$, then \[ j(H;-d)=(-1)^{Nd}\Bigl(\prod_{u,v}M_{uv}!\Bigr)[x^M]\det(X)^d . \] \end{lemma} \begin{proof} We give each arc $a$ its own variable $y_a$ and let $Y=\sum_ay_aE_{\mathrm{tail}(a),\mathrm{head}(a)}$, where $E_{uv}$ is the matrix unit. There are $Nd$ arcs. We compute the coefficient of $\prod_ay_a$ in $\det(Y)^d$ in two ways. First, in the ring of formal power series in $t$ over $\mathbb Q[y_a]$, \[ \det(I+tY)^d=\exp\Bigl(d\sum_{k\ge1}\frac{(-1)^{k-1}t^k}{k}\operatorname{tr}(Y^k)\Bigr). \] The polynomial $\det(I+tY)$ has degree at most $N$ in $t$, with leading coefficient $\det Y$. Therefore the coefficient of $t^{Nd}$ on the left is $\det(Y)^d$. On the right, $\operatorname{tr}(Y^k)$ is the sum of $\prod_iy_{a_i}$ over the rooted closed walks $(a_1,\dots,a_k)$ of length $k$. When we expand the exponential, the coefficient of $t^{Nd}\prod_ay_a$ becomes a sum over the partitions $\lambda$ of $Nd$. If $\lambda$ has $m_k$ parts equal to $k$, its term is \[ \prod_k\frac{1}{m_k!}\Bigl(\frac{d(-1)^{k-1}}{k}\Bigr)^{m_k}\cdot\Bigl[\prod_ay_a\Bigr]\prod_i\operatorname{tr}(Y^{\lambda_i}). \] The last factor counts the ordered tuples of rooted closed walks, of lengths $\lambda_1,\lambda_2,\dots$, that together use every arc exactly once. Each of these walks uses no arc twice and is therefore a closed trail. A closed trail of length $k$ has exactly $k$ rootings, because a rotation that fixed it would repeat an arc. Trails of equal length can fill their $m_k$ places in $m_k!$ orders. So the last factor is $z_\lambda W_\lambda$, where $z_\lambda=\prod_kk^{m_k}m_k!$ and $W_\lambda$ is the number of ways to split the arcs into closed trails of lengths given by $\lambda$. The term of $\lambda$ is therefore $(-1)^{Nd-c}d^{\,c}W_\lambda$ with $c=\sum_km_k$ the number of trails. A splitting of the arcs into closed trails is the same thing as a permutation $a\mapsto a'$ of the arcs with $\mathrm{tail}(a')=\mathrm{head}(a)$, that is, a transition system. Summing over $\lambda$, \[ \Bigl[\prod_ay_a\Bigr]\det(Y)^d=\sum_\pi(-1)^{Nd-\cyc(\pi)}d^{\,\cyc(\pi)}=(-1)^{Nd}j(H;-d). \] Second, $\det Y=\det X$ under the substitution $x_{uv}=\sum_{a:\,u\to v}y_a$. A monomial $x^{M'}$ becomes a polynomial in which $\prod_ay_a$ occurs only if $M'=M$. In that case its coefficient is $\prod_{u,v}M_{uv}!$. Comparing the two computations proves the lemma. \end{proof} Lemma~\ref{lem:quad-fact} may be compared with the known evaluations of the circuit partition polynomial and of the Martin polynomial at negative integers \cite{Bol02,LV83}. For $d=2$ compare Martin's theorem \cite[Theorem~26]{ABS04}, and see also \cite{MM13}. Since parallel arcs are interchangeable, $j(H;x)$ depends only on the matrix $M=M(H)$. When $H$ is $d$-regular we write $j(M)$ for $j(H;-d)$. \begin{lemma}\label{lem:quad-latin} For even $n$, $j(K_n^\circ;-n)=[x^J]\det(X)^n=(-1)^{n/2}\Delta_n$. \end{lemma} \begin{proof} The first equality is Lemma~\ref{lem:quad-fact} with $M=J$ and $N=d=n$ (the sign $(-1)^{n^2}$ is $1$ as $n$ is even). For the second, we expand $\det(X)^n=\prod_{k=1}^n\sum_{\sigma_k\in S_n}\sgn(\sigma_k)\prod_ix_{i\sigma_k(i)}$. A term contributes to the coefficient of $x^J$, in which every variable occurs exactly once, when the graphs of $\sigma_1,\dots,\sigma_n$ partition $[n]^2$, that is, when $L(i,\sigma_k(i))=k$ defines a Latin square $L$. Then $\sigma_k$ sends a row to the column that holds the symbol $k$. Thus $\sigma_k=\zeta_k$, and the term is $\sgn_{\mathrm{sym}}(L)$. By Janssen's identity \eqref{eq:janssen}, $\sgn_{\mathrm{sym}}(L)=(-1)^{n(n-1)/2}\eps(L)$. Finally, $n(n-1)/2\equiv n/2\pmod 2$ for even $n$. \end{proof} The second equality is the classical expression of $L^e_n-L^o_n$ as a coefficient of $\det(X)^n$ (see, for example, \cite{Alp17}). The divisibility results below use only $|j(K_n^\circ;-n)|=|\Delta_n|$. The next lemma removes one vertex $w$. A closed trail that passes through $w$ enters along an arc into $w$, perhaps runs around some loops at $w$, and leaves along an arc out of $w$. When we remove $w$, each such passage becomes one \emph{virtual} arc (Figure~\ref{fig:elim}). \begin{figure}[t] \input{fig/F4_elim.tex} \caption{Removing a vertex $w$ (Lemma~\ref{lem:quad-elim}). Black arcs are the arcs at $w$, gray arcs are not at $w$ and do not change, and blue dashed arcs are virtual arcs. Here $H$ is the graph of Proposition~\ref{prop:identity} for $n=4$, with $d=4$ and $k=2$. Left: the arcs at $w$, with two loops. Middle and right: the two bijections $\sigma_1,\sigma_2$ from the arcs into $w$ (other than loops) to the arcs out of $w$ join each incoming arc to an outgoing one. Each joined pair becomes one virtual arc of the smaller graph $H_\sigma$. The $k$ loops at $w$ contribute only the factor $(x+d-k)\cdots(x+d-1)$ in front of the sum over $\sigma$. In this example, (E) is $j(H;x)=(x+2)(x+3)\bigl(j(H_{\sigma_1};x)+j(H_{\sigma_2};x)\bigr)$.} \label{fig:elim} \end{figure} \begin{samepage} \begin{lemma}\label{lem:quad-elim} Let $H$ be $d$-regular on a vertex set $V$ with $|V|\ge2$, let $w\in V$, and let $k=M_{ww}$ be the number of loops at $w$. For each bijection $\sigma$ from the $d-k$ non-loop arcs into $w$ to the $d-k$ non-loop arcs out of $w$, let $H_\sigma$ be the multidigraph on $V\setminus\{w\}$ obtained by deleting $w$ and adding, for every non-loop arc $e=(u\to w)$, a virtual arc from $u$ to the head of $\sigma(e)$. Then every $H_\sigma$ is $d$-regular, \begin{equation*}\label{eq:elim} j(H;x)=(x+d-k)(x+d-k+1)\cdots(x+d-1)\sum_\sigma j(H_\sigma;x)\tag{E} \end{equation*} as polynomials, and \begin{equation*}\label{eq:elimd} j(M)=(-1)^kk!\sum_R\mathrm{count}(R)\,j(M'+R),\qquad \mathrm{count}(R)=\frac{\prod_{u\ne w}M_{uw}!\,\prod_{v\ne w}M_{wv}!}{\prod_{u,v\ne w}R_{uv}!},\tag{E$'$} \end{equation*} where $M'$ is the restriction of $M$ to $V\setminus\{w\}$ and $R$ runs over the matrices of nonnegative integers on $(V\setminus\{w\})^2$ with row sums $M_{uw}$ and column sums $M_{wv}$. \end{lemma} \end{samepage} \begin{proof} (i) \emph{Strands.} We fix transitions $\pi_v$ at all $v\ne w$ and $\pi_w$ at $w$. Start from a non-loop arc $e$ into $w$ and apply $\pi_w$ repeatedly: the walk runs through loops at $w$ (each loop is an arc out of $w$ and then an arc into $w$) until it reaches a non-loop arc out of $w$. It cannot repeat an arc. Indeed, $e$ is not an arc out of $w$, hence not a value of $\pi_w$, and $\pi_w$ is injective. As there are finitely many loops, the walk ends. The same argument for $\pi_w^{-1}$ gives, from each non-loop arc out of $w$, a walk that ends at a non-loop arc into $w$. Therefore distinct walks end at distinct arcs, and $\pi_w$ maps the set of loops that lie on no walk onto itself. Thus $\pi_w$ splits the arcs at $w$ into $d-k$ \emph{strands} (a non-loop arc in, some loops, a non-loop arc out) and $\cyc_w$ cycles made of loops only. The map $\sigma(\pi_w)$ that sends the first arc of each strand to its last arc is a bijection. (ii) \emph{The loops.} For fixed $\sigma$, $\sum_{\pi_w:\,\sigma(\pi_w)=\sigma}x^{\cyc_w}=\prod_{i=0}^{k-1}(x+d-k+i)$. To see this, we place the $k$ labeled loops one at a time. Loop $i+1$ goes directly after one of the $d-k$ strand starts or directly after one of the $i$ loops already placed ($d-k+i$ choices, no new cycle), or it opens a new cycle of loops (weight $x$). Each $\pi_w$ arises exactly once, as removing the loops in reverse order shows. (iii) \emph{The smaller graph.} At a vertex $v\ne w$, the arcs into $v$ in $H_\sigma$ are those in $H$, with each arc $w\to v$ replaced by the virtual arc that ends in it. The arcs out of $v$ change in the same way. So the transitions $\pi_v$, $v\ne w$, form a transition system of $H_\sigma$. The closed trails of $H$ are the $\cyc_w$ cycles of loops together with, bijectively, the closed trails of $H_\sigma$ (contract each strand to its virtual arc). Summing over the $\pi_v$ and over $\pi_w$ gives \eqref{eq:elim}. A vertex $v\ne w$ gains $M_{wv}$ virtual arcs in and loses its $M_{wv}$ arcs from $w$. The same holds for the outgoing arcs. So $H_\sigma$ is $d$-regular. (iv) \emph{At $x=-d$.} The factor in front becomes $(-k)(-k+1)\cdots(-1)=(-1)^kk!$. Let the profile $R$ of $\sigma$ be the matrix with $R_{uv}$ equal to the number of arcs $e$ from $u$ into $w$ for which $\sigma(e)$ goes to $v$. The number of $\sigma$ with profile $R$ is $\mathrm{count}(R)$. To build such a bijection, we split the $M_{uw}$ arcs from each $u$ by their targets ($M_{uw}!/\prod_vR_{uv}!$ ways) and the $M_{wv}$ arcs to each $v$ by their sources ($M_{wv}!/\prod_uR_{uv}!$ ways). Then we match the two parts of each block ($\prod_{u,v}R_{uv}!$ ways). Finally, $M(H_\sigma)=M'+R$. \end{proof} Identity \eqref{eq:elim} is a vertex recursion of the circuit partition polynomial of the kind in \cite{LV83}. \begin{corollary}\label{cor:quad-elim} In Lemma~\ref{lem:quad-elim}, for every prime $q$, \[ v_q(j(M))\ge v_q\Bigl(\prod_{u\in V}M_{uw}!\Bigr)+\min_Rv_q\bigl(j(M'+R)\bigr). \] \end{corollary} \begin{proof} We write $\mathrm{count}(R)=\prod_{u\ne w}M_{uw}!\cdot\prod_{v\ne w}\bigl[M_{wv}!/\prod_{u\ne w}R_{uv}!\bigr]$. Each bracket is a multinomial coefficient, because column $v$ of $R$ sums to $M_{wv}$. Together with $k!=M_{ww}!$, \eqref{eq:elimd} writes $j(M)$ as $\pm\prod_{u\in V}M_{uw}!$ times an integer combination of the integers $j(M'+R)$. \end{proof} So removing $w$ gains the factorials of the entries of column $w$. If all entries of $M$ are positive and its line sums are $n$, these are $N$ positive numbers with sum $n$. By its definition in the introduction, $f_q(n,N)$ is the least possible exponent of $q$ in the product of their factorials. \begin{proposition}\label{prop:quad-ind} Let $H$ be $n$-regular on $N\ge1$ vertices, with $M_{uv}\ge1$ for all $u,v$ (loops included). Then $v_q(j(M))\ge\sum_{N'=1}^Nf_q(n,N')$ for every prime $q$. \end{proposition} \begin{proof} Since the entries of a row are at least $1$ and sum to $n$, we have $N\le n$. We use induction on $N$. If $N=1$, $H$ is one vertex with $n$ loops. A transition system is then a permutation of the loops, and $j(H;x)=x(x+1)\cdots(x+n-1)$. Thus $j(M)=(-1)^nn!$ and $v_q(j(M))=v_q(n!)=f_q(n,1)$. If $N\ge2$, we pick any vertex $w$. Column $w$ of $M$ has $N$ entries, each at least $1$, with sum $n$. Therefore $v_q\bigl(\prod_uM_{uw}!\bigr)\ge f_q(n,N)$. Every $M'+R$ is $(N-1)\times(N-1)$, has all entries at least $M'_{uv}\ge1$, and has all line sums $n$ (row $u$: $(n-M_{uw})+M_{uw}$, column $v$: $(n-M_{wv})+M_{wv}$). Corollary~\ref{cor:quad-elim} and the induction hypothesis finish the proof. \end{proof} Removing one vertex of $K_n^\circ$ gives the exact identity behind Theorem~\ref{thm:C}. \begin{proposition}\label{prop:identity} For even $n$, $\Delta_n=(-1)^{n/2+1}(n-1)!\,j(J+I)$, where $J+I$ is of size $n-1$. That is, $L^e_n-L^o_n$ is, up to sign, $(n-1)!$ times the value at $x=-n$ of the circuit partition polynomial of the $n$-regular digraph on $n-1$ vertices with one arc from each vertex to each other vertex and two loops at each vertex. \end{proposition} \begin{proof} By Lemma~\ref{lem:quad-latin}, $\Delta_n=(-1)^{n/2}j(J_n)$, with $d=n$. We apply \eqref{eq:elimd} at any vertex $w$. There $k=1$. Every $R$ has all line sums $1$ and is therefore a permutation matrix $P$ of size $n-1$, with $\mathrm{count}(R)=1$. Thus $j(J_n)=-\sum_Pj(J_{n-1}+P)$. We show that the $(n-1)!$ terms are equal. By Lemma~\ref{lem:quad-fact}, $j(J_{n-1}+P)=2^{n-1}[x^{J_{n-1}+P}]\det(X)^n$, since $J_{n-1}+P$ has $n-1$ entries equal to $2$ and $(-1)^{(n-1)n}=1$. If $P_{u,p(u)}=1$ for a permutation $p$, the substitution $X\mapsto XP$, that is $x_{uv}\mapsto x_{u,p^{-1}(v)}$, multiplies $\det(X)^n$ by $\det(P)^n=1$ ($n$ is even) and carries the monomial $x^{J_{n-1}+P}$ to $x^{J_{n-1}+I}$. Hence $j(J_{n-1}+P)=j(J_{n-1}+I)$ for every $P$, so $j(J_n)=-(n-1)!\,j(J_{n-1}+I)$, and therefore $\Delta_n=(-1)^{n/2}j(J_n)=(-1)^{n/2+1}(n-1)!\,j(J_{n-1}+I)$. \end{proof}