\documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern,amsmath,amssymb,amsthm,booktabs} \usepackage[margin=2.55cm]{geometry} \usepackage[hidelinks]{hyperref} \hypersetup{pdftitle={Division by Two Cycles in Binary and Explicit Representations},pdfauthor={Nuutti Kuosa}} \setlength{\emergencystretch}{1.4em} \raggedbottom \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{headline}{Theorem} \renewcommand{\theheadline}{\Alph{headline}} \theoremstyle{definition} \newtheorem{remark}[theorem]{Remark} \newtheorem{example}[theorem]{Example} \newcommand{\lcm}{\operatorname{lcm}} \newcommand{\Len}{\operatorname{Len}} \newcommand{\N}{\mathbb Z_{\ge0}} \newcommand{\NP}{\mathsf{NP}} \newcommand{\QP}{\mathsf{QP}} \newcommand{\DivTwo}{\mathcal D_2} \title{Division by Two Cycles in Binary and Explicit Representations} \author{Nuutti Kuosa} \date{25 November 2026} \begin{document} \maketitle \begin{abstract} Let \(A\) be a permutation with two cycles and \(B\) a target permutation. We ask whether \(B\) is isomorphic to the synchronous product \(AX\) for some quotient \(X\), how to construct one, and how many quotients there are up to isomorphism. Suppose the cycle lengths in \(A\) are \(2\) and an odd \(b>1\). If the input lists cycle lengths and multiplicities in binary, deciding existence is NP-complete and counting quotient classes is \(\#\mathsf P\)-complete under parsimonious polynomial-time reductions. Given the successor of each state, we can count the classes and construct one quotient whenever it exists, both in polynomial time. For arbitrary cycle lengths \(a,b\) of \(A\), put \(g=\gcd(a,b)\). In either representation we construct, in deterministic polynomial time, a new target and a divisor with cycle lengths \(gd,g(d+1)\), \(d\ge2\). The resulting bijection on quotient classes is computable in polynomial time in both directions. For each fixed \(g\), varying \(d\) gives the same two completeness results for binary lists. With \(d=2\) fixed and \(g\) varying, one binary quotient can be found in polynomial time whenever it exists. Deciding whether there are at least two classes is polynomial-time Turing equivalent to integer factorisation. For two arbitrary divisor lengths, division from successor tables is decidable in polynomial time if and only if Boolean satisfiability on \(m\)-bit formulas is decidable in deterministic time \(m^{O(\log\log m)}\). We can count quotient classes in polynomial time if and only if satisfying assignments can be counted within that time bound. Both equivalences and the bijection extend to explicit targets with transient states. \end{abstract} \section{Can two consecutive cycles divide a permutation?} Write \(C_t\) for a directed cycle of length \(t\). We add permutations by taking their disjoint union and multiply them by advancing both coordinates one step at a time. We identify isomorphic permutations. In the product \(C_a C_t\), each pair returns to its starting point after \(\lcm(a,t)\) steps. Dividing the \(at\) states by this orbit length gives the product rule \[ C_a C_t=\gcd(a,t)\,C_{\lcm(a,t)} . \] The smallest consecutive lengths greater than one are two and three. Consider the division problem \[ (C_2+C_3)X=C_3+2C_6 . \] The right side has fifteen states, so \(X\) must have three. Its product with \(C_2\) uses six states and has only even cycle lengths. It must therefore account for one \(C_6\). On three states only \(X=C_3\) can produce that length. Now look at what remains for \(C_3X\). The required \(C_3+C_6\) can be obtained from \(X=C_1+C_2\), whereas the choice already forced gives \(C_3 C_3=3C_3\). The two parts of the product, which we call the \emph{projections}, are individually possible. No single quotient realises both. The input gives only their union \(B\). If both projections contain cycles of the same length, their multiplicities add in \(B\). Doré et al.\ give a polynomial-time division algorithm for connected quotients~\cite[Theorem~3.13]{dore}. Their \emph{unroll} starts at each periodic state and follows its predecessors to form a rooted tree. For a disconnected quotient they ask which periods to choose when rolling these trees back into cycles. They can also construct the two extreme rolls, which group the copies of each recurring tree pattern into as few or as many components as possible~\cite[Algorithm~5.10 and Section~6, p.~14]{dore}. For permutations this question takes a simple form. Each state has exactly one predecessor, so every permutation on \(n\) states unrolls to \(n\) identical one-way infinite paths~\cite[Remark~2.3]{dore}. Grouping those paths into cycles amounts to choosing a partition of \(n\). In the example above, \(3\), \(2+1\) and \(1+1+1\) all give the required unroll. The prescribed product rules out all three. Changing the target to \(3C_2+C_3+C_6\) gives a useful comparison. Of the same three partitions, only \(2+1\) works, so the quotient is \(C_1+C_2\)~\cite[Section~2]{kuosa-support}. How much does it help to know that the two lengths are consecutive? For coprime lengths, every instance can be put in this form. The same holds for the reduced lengths of any pair. The new divisor retains the original greatest common divisor. In the \emph{binary model} we give each distinct cycle length together with its positive multiplicity, using self-delimiting binary fields of size linear in their bit lengths. In the \emph{explicit model} we give the successor of every state. A single cycle of length \(2^k\) takes \(O(k)\) bits in a binary list and \(2^k\) entries in a successor table. The total number of states in the divisor and target is \(N=|A|+|B|\), so the tables take \(O(N\log(2N))\) bits. Until Corollary~\ref{cor:transient}, \(A,B\) are nonempty permutations, and we ask whether \(AX=B\) for some \(X\) with any number of cycles. Allowing arbitrary finite self-maps \(X\) gives the same question. A transient state of \(X\) would give a transient state in the product, and every state of \(B\) is periodic. Corollary~\ref{cor:transient} returns to the case where the target itself has transient states. \begin{headline}[Consecutive lengths after removing the gcd]\label{thm:normal} Let \(A=C_a+C_b\) and \(g=\gcd(a,b)\). In either input representation one can construct, in deterministic polynomial time, a divisor \(A'=C_{gd}+C_{g(d+1)}\) with \(d\ge2\) and a target \(B'\). The quotient classes of \(AX=B\) and \(A'Y=B'\) are in bijection. Both directions of the bijection are computable in time polynomial in the input and the supplied quotient. The integer \(g\) may vary with the input. In the explicit model the two output tables have \(O(N^4)\) states in total. \end{headline} The first step in the proof recovers a piece of information hidden by the product. Whenever both projections can contribute at the same length, their individual contributions there are forced by their numbers of states. We recover this split both before and after changing the divisor lengths. It determines which part of the target to use in each direction. Section~\ref{sec:normal-proof} gives the map. Write \(\DivTwo\) for the explicit decision problem with \(A=C_a+C_b,\ a,b>1,\ \gcd(a,b)=1\). The lengths are part of the input. Write SAT for Boolean satisfiability and \(\QP\) for deterministic quasipolynomial time, meaning time \(\exp(O((\log(m+2))^c))\) for some constant \(c\ge1\) on \(m\)-bit inputs. \begin{theorem}[Two representations]\label{thm:main} For divisors \(C_2+C_b\) with \(b>1\) odd and part of the input, binary division is NP-complete, and counting quotient isomorphism classes is \(\#\mathsf P\)-complete under parsimonious polynomial-time reductions. On the same family, explicit division admits a deterministic polynomial-time algorithm that gives the exact count and constructs one quotient whenever one exists. For the full explicit problem \(\DivTwo\), the following statements hold. \begin{enumerate}\renewcommand{\labelenumi}{\textup{(\roman{enumi})}}\setlength{\itemsep}{1pt} \item If SAT has a deterministic polynomial-time Turing reduction to \(\DivTwo\), then \(\mathsf P=\NP\). \item \(\DivTwo\in\QP\) if and only if \(\NP\subseteq\QP\). \item \(\DivTwo\in\mathsf P\) if and only if SAT on \(m\)-bit formulas is decidable in deterministic time \(m^{O(\log\log m)}\). A polynomial-time decision algorithm for \(\DivTwo\) also suffices to construct one quotient as a successor table whenever one exists. \end{enumerate} Consequently, \(\DivTwo\) is NP-intermediate under polynomial-time many-one reductions exactly when SAT has no deterministic \(m^{O(\log\log m)}\)-time algorithm. If \(\NP\not\subseteq\QP\), then \(\DivTwo\) also lies outside \(\QP\). \end{theorem} For \(C_2+C_b\), group quotient lengths \(t\) by \(R=\lcm(2,b,t)\). The \(C_b\) projection gives length \(v=\lcm(b,t)\). Since \(R=\lcm(2,v)\), only \(R\) and \(R/2\) are possible. A dynamic program tracks their totals. The \(2:b\) ratio of projection sizes gives the other totals it needs (Section~\ref{sec:blocks}). The running time is polynomial in the number \(N=|A|+|B|\) of states. A short binary list can describe exponentially many states. Section~\ref{sec:counting} encodes each triple in the digits of a cycle length and gives a bijection between exact covers and quotient classes. Such a reduction is called \emph{parsimonious}. To understand the threshold in part (iii), start with a division input on \(N\) states. Each block becomes a SAT question of bit length \(\ell\) with \((\log\ell)(\log\log\ell)=O(\log N)\). The proposed SAT running time is therefore polynomial in \(N\). For the reverse implication we turn a formula into a cubic graph, encode a proper edge-colouring by a weighted table and realise its cells as quotient cycles. The costliest step is writing the two successor tables. Appendix~\ref{app:sharp} bounds this cost by \(m^{O(\log\log m)}\) on every formula. Part (i) concerns reductions that themselves run in polynomial time. A many-one reduction produces one instance. A Turing reduction can adapt its next query to the answers already received. Even in this latter model a reduction from SAT would allow us to decide SAT recursively on shorter formulas. The short-query principle of Allender and Koucký then gives polynomial time~\cite[Theorem~5.1(3)]{allender-koucky}. Thus if SAT misses the threshold in (iii), explicit division is NP-intermediate: it belongs to NP, lies outside P and is not NP-complete. For the representation contrast alone, Sections~\ref{sec:blocks} and \ref{sec:counting} give the algorithm and the reduction. For binary lists in the normal form, varying \(d\) already gives NP-completeness at \(g=1\). Holding \(d=2\) fixed and varying \(g\) makes one quotient easy to construct. Proposition~\ref{prop:factor-second} explains why finding out whether there is a second is equivalent to factoring integers. For successor tables, Corollary~\ref{cor:two-cycle-threshold} gives the SAT and counting thresholds for arbitrary pairs of lengths. The earlier NP-completeness proof allows the number of divisor cycles to grow~\cite[p.~14]{kuosa-np}. Readers interested in the period-selection question can follow the proof of the normal form in Section~\ref{sec:normal-proof} directly to the extension to rooted trees in Corollary~\ref{cor:transient}. \paragraph{Relation to known algorithms.} For permutations given by cycle lists, Porreca and Rolland's binary algorithm applies when the shortest divisor length divides every other one. They ask about extending this condition to several seeds~\cite[Theorem 42 and Section 7]{pr}. Theorem~\ref{thm:main} gives the complexity of the binary problem when two incomparable lengths are allowed. Crespelle, Phan and Richard describe quotients recursively and work out a division with divisor \(C_2+C_3\)~\cite[Theorem~3.8 and Example~3.14]{cpr-tensor}. Here the two lengths vary with the input and we track the time needed to write their successor tables. In the explicit model, Bridoux et al.\ split an instance into independent smaller ones and rescale their quotient lengths. Their decomposition generally gives a list of instances~\cite[Lemmas~2 and 8]{bridoux}. Theorem~\ref{thm:normal} gives a single instance with consecutive reduced lengths and the original divisor gcd. Their counting theorem gives polynomial time whenever the number of divisors of \(\lcm(a,b)\) stays bounded~\cite[Theorem~1]{bridoux}. Two distinct primes, or the squares of two distinct primes, satisfy that condition. To see the difference when the bound grows, take \(a=2\) and let \(b\) be the product of \(k\ge2\) distinct odd primes. Then \(2b\) has \(2^{k+1}\) divisors, so the exponent in their bound grows with \(k\). The dynamic program below keeps just two running totals for every such \(b\). For two cycles of lengths \(a,b\), divide both lengths by \(g=\gcd(a,b)\). Theorem~\ref{thm:one-axis} gives polynomial-time explicit counting when one of these two reduced lengths has a bounded number of divisors. If both divisor counts are bounded, Proposition~\ref{prop:bounded-binary} constructs one binary quotient in polynomial time. Thus for every divisor \(C_{2g}+C_{3g}\) we can find a quotient efficiently from binary lists, although the exact count can itself take superpolynomially many bits (Proposition~\ref{prop:answer-length}). Gadouleau and Johnson solve the cycle division equation with multiplicities taken modulo two~\cite[Theorem~3.9]{gadouleau-johnson}. Our binary lists retain every digit of each multiplicity. For example, \(C_2+C_3\) divides itself. Adding two fixed points to the target preserves its parity data but makes division impossible, since every cycle of the product has length divisible by two or three. Ascone, Porreca and Rolland prove hardness for a linear equation in three unknowns and a constant right-hand side~\cite[p.~2]{ascone}. Here only \(X\) is unknown. Given \(B\) alone, one may instead seek two connected factors~\cite{kuosa-fac}. A unique quotient can itself use many different cycle lengths when the number of divisor lengths grows~\cite{kuosa-support}. With two coprime divisor cycles we can list all candidate lengths in polynomial time. It is the choice of multiplicities that encodes a colouring. \section{Solving the blocks of an explicit input}\label{sec:blocks} Read the cycle lengths of \(B\) from its successor table. Write \(\beta_\ell\) for the number of cycles of length \(\ell\), taking zero for an absent length. A quotient must have \(n=|B|/(a+b)\) states, so a nonintegral \(n\) gives a negative answer. Its unknowns are the integers \(x_t\) counting cycles of length \(t\), with \(1\le t\le n\) and \(0\le x_t\le n\). To account for every copy of \(C_\ell\), the product rule requires \begin{equation}\label{eq:block-row} \sum_{\lcm(a,t)=\ell}\gcd(a,t)x_t+ \sum_{\lcm(b,t)=\ell}\gcd(b,t)x_t=\beta_\ell . \end{equation} Write this equation for every length that can occur in either sum, including a zero right side wherever \(B\) forbids that length. Reject if some prescribed length has no possible contribution. When the two projections produce the same length, their coefficients add and the sum is at most \(a+b\). These equations also account for the size of \(X\). Multiplying the equation at \(\ell\) by \(\ell\) and summing gives \((a+b)\sum_t t x_t=|B|\). Rolland describes the admissible component types and their multiplicity equations for general finite systems~\cite[Propositions~4.40--4.41]{rolland-thesis}. His witness algorithm is fixed-parameter tractable in the number of distinct target component types and the shortest divisor period \cite[Theorem~4.43]{rolland-thesis}. For \(C_2+C_b\), the count below allows arbitrarily many distinct target lengths and any odd \(b>1\). The cycle product rule supplies the two contributions of each unknown. Which equations can influence one another? Take \(a=2,b=3\) again and now allow \(n\ge5\). A \(C_3\) contributes to lengths \(6\) and \(3\). A \(C_5\) contributes to lengths \(10\) and \(15\). Taking the lcm with \(6\) gives the common value \(6\) for the first pair and \(30\) for the second. This value stays fixed along every chain of variables and the equations in which they occur. In particular, no such chain can connect the two pairs. \begin{lemma}[Short queries]\label{lem:short} For any two divisor cycles, explicit division reduces in polynomial time to the conjunction of at most \(N\) SAT queries. For sufficiently large \(N\), each query has bit length \(\exp(O(\log N/\log\log N))\). \end{lemma} \begin{proof} Let \(D=\lcm(a,b)\). Give variable \(x_t\) the label \(R=\lcm(D,t)\). Whenever it occurs in the equation at length \(\ell\), that equation satisfies \(\lcm(D,\ell)=R\). Taking the lcm of \(t\) first with \(a\) or \(b\) and then with \(D\) is the same as taking it directly with \(D\). Thus equations with different labels use disjoint sets of variables. There are at most \(n\) nonempty blocks. We build them in polynomial time by running through \(t=1,\ldots,n\) and recording its two contributions. To bound a single block, notice that every length \(t\) or \(\ell\) in it divides its label \(R\), and \(R\le abn\le N^3\). Write \(\tau(R)\) for the number of positive divisors of \(R\). The block has at most \(\tau(R)\) variables and at most \(\tau(R)\) equations. Its coefficients, right sides and bounds take \(O(\log(2N))\) bits apiece. Even a dense matrix, with rows and columns numbered locally, needs only \(O((1+\tau(R))^2\log(2N))\) bits. The elementary divisor estimate needed here is \(\log\tau(R)=O(\log N/\log\log N)\). Set \(z=\log(N^3)\). In the factorisation \(R=\prod p^{e_p}\), each exponent is at most \(z/\log 2\). Primes up to \(\sqrt z\) therefore contribute at most \(\sqrt z\log(1+z/\log 2)\) to \(\log\tau(R)\). The other primes have exponent sum at most \(2z/\log z\), and \(e+1\le2^e\). The two estimates give the stated bound. Feasibility of the resulting bounded integer system belongs to NP, since one can guess its multiplicities and check the equations. A fixed polynomial reduction to SAT raises the bit length of a block to at most a constant power, which preserves the claimed bound. Every block must be feasible, and solutions to separate blocks can be joined by taking all their multiplicities. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:main}\textup{(i)}] Let an oracle algorithm decide SAT using \(\DivTwo\) in polynomial time. On an \(m\)-bit formula it asks at most \(m^{O(1)}\) questions, each of polynomial length. Simulate it in order. Answer a malformed table or a divisor outside the specified class negatively. For each valid question we have \(N\le m^{O(1)}\). Lemma~\ref{lem:short} gives a conjunction of at most \(N\) SAT queries, each of length at most \(\lfloor\sqrt m\rfloor\) for sufficiently large \(m\). Evaluate the conjunction recursively and return its truth value before the simulation continues. Below a fixed input size solve SAT by exhaustive search. Both the number of recursive calls along the simulated computation and the work to produce them are polynomial in \(m\). If \(T(m)\) is the worst running time on inputs of at most \(m\) bits, some constant \(c\) gives \(T(m)\le m^c(1+T(\lfloor\sqrt m\rfloor))\) for large \(m\). For any \(K>2c\), substituting the inductive bound \(T(k)=O(k^K)\) on shorter inputs gives \(O(m^{c+K/2})=O(m^K)\). Thus SAT would belong to P. This includes a many-one reduction as the one-query case. \end{proof} \paragraph{When the divisor has more cycles.} The short-query argument uses only a bound on \(D=\lcm\{a_i\}\). For a divisor \(\sum_i\alpha_iC_{a_i}\), give \(x_t\) the same label \(R=\lcm(D,t)\). Each possible output \(\lcm(a_i,t)\) has that label, and each matrix coefficient is at most \(\sum_i\alpha_i a_i=|A|\). If \(D\le N^c\) for a fixed \(c\), then \(R\le N^{c+1}\), so the same divisor estimate gives the same short-query bound, with constants depending on \(c\). This includes any fixed bound on the number of distinct divisor lengths, with arbitrary multiplicities. The block split is also implicit in the general decomposition of Bridoux et al.~\cite[Lemma~2]{bridoux}. \subsection*{Counting a block from the reduced ratio of the two lengths} Consider \(A=C_2+C_b\). In a block labelled \(R\), a length \(r\) coming from the \(C_b\) projection satisfies \(\lcm(r,2)=R\). Thus \(r=R\) or \(r=R/2\). We can remember the totals for these lengths even if the other projection produces many different lengths. For general \(a,b\), a common factor actually reduces the number of possible row lengths. This is why the reduced ratio \(a:b\) enters the running time. Write a \emph{row} for the output of \(C_a\) and a \emph{column} for the output of \(C_b\). We can determine how many target cycles each must supply before choosing any quotient cycles. Write \(D=\lcm(a,b)\), and group the target cycles of length \(\ell\) by \(R=\lcm(D,\ell)\). Both projections of a quotient cycle of length \(t\) belong to the group with \(R=\lcm(D,t)\). Reject a target length divisible by neither \(a\) nor \(b\). In the group \(B_R\), only the length \(R\) can occur in both projections: any such length is divisible by \(D\) and hence equals its label. The support of a block is the set of lengths occurring in it. Let \(\beta_\ell\) denote the target multiplicity, taking \(\beta_R=0\) if \(R\) is absent. The number of quotient states in the group must be \(n_R=|B_R|/(a+b)\). Reject if it is nonintegral. The projection from \(C_a\) has \(a n_R\) states, so its contribution at the only shared length is forced to be \begin{equation}\label{eq:forced-split} m_R=\frac{a n_R-\sum_{\ell\in\operatorname{supp} B_R,\, \ell\ne R,\, a\mid\ell}\ell\beta_\ell}{R}. \end{equation} Reject unless \(m_R\) is an integer between zero and \(\beta_R\). Assign \(m_R\) copies at \(R\) to the row projection from \(C_a\) and \(\beta_R-m_R\) to the column projection from \(C_b\). Every other multiplicity goes to its unique projection. We now have separate nonnegative margins, including when \(a=b\). These are necessary margins. We still have to realise both of them by one quotient. Their uniqueness also follows from classical fixed-point counts. If \(F_j(Z)\) counts the fixed points of the \(j\)th iterate, then \(F_j(AX)=F_j(A)F_j(X)\). For \(a\mid j\), the row projection has \(aF_j(B)/F_j(A)\) fixed points; for \(a\nmid j\) it has none. These counts determine its cycles by divisor inversion \cite[\S2, (2-7-1)--(2-7-2)]{dress}. The local formula \eqref{eq:forced-split} needs only the lengths in one block. \begin{theorem}[Counting from the reduced ratio]\label{thm:one-axis} Let \(A=C_a+C_b\) and \(B\) be given by successor tables. Put \(g=\gcd(a,b)\) and \(K=\min\{\tau(a/g),\tau(b/g)\}\), where \(\tau(d)\) counts the positive divisors of \(d\). There is a deterministic algorithm that counts all quotient isomorphism classes and, when the count is positive, constructs the successor table of one quotient. Each layer of its dynamic program for a block has at most \((N+1)^K\) states, indexed by at most \(K\) row totals. The full algorithm takes \((N+1)^{K+O(1)}\) bit operations. The lengths \(a,b\) may have common factors. \end{theorem} \begin{proof} Read the cycles of both permutations. Form the equations and the independent blocks of Lemma~\ref{lem:short}, including zero targets and rejecting a nonintegral quotient size or an unreachable target length. Interchange \(a,b\) if necessary so that \(\tau(b/g)=K\). Both divisor counts can be computed by trial division up to \(N\). For \(1\le t\le n\), call \(r=\lcm(a,t)\) its row and \(c=\lcm(b,t)\) its column in the block \(R=\lcm(a,b,t)\). Since \(\lcm(r,b)=R\), \[ R/r=b/\gcd(r,b). \] Since \(a\mid r\), the denominator is a multiple of \(g\), and \(R/r\) divides \(b/g\). For fixed \(R\) this divisor determines \(r\). Thus there are at most \(\tau(b/g)=K\) row lengths. Interchanging the two axes likewise bounds the number of column lengths by \(\tau(a/g)\). Use \eqref{eq:forced-split} after ordering the two axes. Write \(\rho_r\) for the number of cycles required from row \(r\) and \(\gamma_c\) for the number required from column \(c\). A row and a column of the same numerical length have separate quotas. A positive quota with no candidate variable on its side makes the block infeasible. Let \(P\) be the set of candidate rows. Process one column at a time in any fixed order, fixing an order of variables within each column. Keep the number \(s_r\) already supplied by each row. During column \(c\), let \(z\) be its current count and let \(J\) be the completed columns. If the processed quotient cycles use \(u\) states, the two projections have used \(au\) and \(bu\) states. Therefore \[ b\sum_{r\in P} r s_r=abu =a\left(\sum_{d\in J} d\gamma_d+c z\right). \] The sum over completed columns is fixed at this step, so the row counters determine \(z\). For a candidate period \(t\) try each multiplicity \(x_t=0,\ldots,\lfloor n/t\rfloor\). Add \(\gcd(a,t)x_t\) to its row and \(\gcd(b,t)x_t\) to its current column. Discard a transition if it exceeds either quota. At the end of the column require \(z=\gamma_c\), and after the last column require \(s_r=\rho_r\) for every row. This rule also applies when \(r=c\). Two prefixes at the same step with the same row counters have identical possible completions. Starting the zero state with count one, add the counts of all transitions reaching the same state. Each full vector \((x_t)\) follows one path through the prescribed variable order and specifies one isomorphism class. Multiply the final counts of the independent blocks. The identity following \eqref{eq:block-row} then gives the required size \(n\) without a separate counter for states. For reconstruction, keep one predecessor and its chosen \(x_t\) for each reached state at each step. Reading back from the accepted state in each block supplies all multiplicities. Writing that many disjoint cycles gives a successor table on exactly \(n\) states. The number of distinct row vectors per layer is at most \(\prod_{r\in P}(\rho_r+1)\le (N+1)^K\). There are at most \(n+1\) choices per variable and \(n\) variables altogether. All partial counts and products over completed blocks are bounded by \((n+1)^n\), the number of unrestricted choices in \(\{0,\ldots,n\}^n\). Integer arithmetic and comparing states thus cost polynomially many bit operations per transition. Sorting transitions by destination merges them deterministically within the claimed bound, including predecessor storage and reconstruction. \end{proof} For example, take \((C_2+C_3)X=6C_2+6C_3+5C_6\). Every quotient length divides six. Take the \(C_2\) projection as the rows, of lengths two and six. While the algorithm fills its first column, of length three, the balance of states gives \(s_3=s_2+3s_6\). The two row counters thus determine all three totals. To see the resulting count, observe that the targets at two and three require \(x_1+2x_2=x_1+3x_3=6\), so \(x_1\) is either six or zero. At the shared length six, the equation is \(x_2+x_3+5x_6=5\). Formula~\eqref{eq:forced-split} assigns two of the five cycles of length six to the row and three to the column. If \(x_1=6\), one quotient cycle \(C_6\) supplies all five copies through the two projections. If \(x_1=0\), the three copies of \(C_2\) and two copies of \(C_3\) together supply those same five cycles. The count is two. In neither case is there a further choice of how to assign the five target cycles to the projections. There is also a route to the decision bound through integer programming. In the matrix with separate row and column quotas, cut the ordered list of variables between two positions. The prefix and suffix column spans can overlap on the rows \(P\) and at most the column \(c\) currently being filled. Every vector \(y\) in their intersection satisfies the same linear balance as the product columns, \(b\sum_{r\in P}r y_r=ac\,y_c\) when \(c\) is present. Thus the intersection has dimension at most \(|P|\le K\). This supplies a path decomposition of width at most \(K+1\) in the convention of Fomin et al. Their Theorem~6 gives a feasibility algorithm for this order, building on Cunningham and Geelen's approach to integer programming~\cite{cunningham,fomin}. The direct recurrence also counts classes and records a witness. \section{Reading a table from a product of cycles}\label{sec:table} Suppose \(\gcd(a,b)=1\). If a quotient contains a \(t\)-cycle, its two contributions to \(B\) have lengths \(\ell=\lcm(a,t)\) and \(\ell'=\lcm(b,t)\). These two lengths determine \(t\) through the identity \[ \gcd(\ell,\ell')=t . \] Indeed, at each prime at least one of \(a,b\) has exponent zero, so the smaller of the two output exponents is the exponent in \(t\). With \(k\) distinct lengths in \(B\), at most \(k^2\) gcds have to be tried, allowing a length to be paired with itself. What remains is to choose how often each candidate occurs. Here is a product in which those multiplicities can be read as a table. Take \(A=C_6+C_{35}\). Use rows indexed by the divisors \(5,7\) of \(35\) and columns indexed by the divisors \(2,3\) of \(6\). In the cell with indices \(u,v\), put the candidate quotient cycle \(C_{uv}\). \[ \begin{array}{c|cc|l} &v=2&v=3&\text{length contributed by }C_6\\ \hline u=5&C_{10}&C_{15}&30\\ u=7&C_{14}&C_{21}&42\\ \hline \text{length contributed by }C_{35}&70&105& \end{array} \] Take one copy in each diagonal cell. The \(10\)-cycle contributes \(2C_{30}\) to its row and \(5C_{70}\) to its column. The \(21\)-cycle contributes \(3C_{42}\) and \(7C_{105}\). Thus \[ (C_6+C_{35})(C_{10}+C_{21})=2C_{30}+3C_{42}+5C_{70}+7C_{105}. \] Reading from the right, the required multiplicity of \(C_{30}\) is a row sum. A copy in its first cell counts twice and a copy in its second cell counts three times. Down a column it is the row index that supplies the weight. \begin{lemma}[Two families of target lengths]\label{lem:tables} Let \(a,b>1\) be coprime. Choose distinct proper divisors \(u_i\) of \(b\) and distinct proper divisors \(v_j\) of \(a\). For nonnegative integers \(R_i,S_j\), put \[ A=C_a+C_b,\qquad B=\sum_i R_i C_{a u_i}+\sum_j S_j C_{b v_j}. \] Quotient classes correspond bijectively to nonnegative integer tables \(x=(x_{ij})\) satisfying \begin{equation}\label{eq:table} \sum_j v_j x_{ij}=R_i\quad\text{for each row }i,\qquad \sum_i u_i x_{ij}=S_j\quad\text{for each column }j. \end{equation} The corresponding quotient is \(X=\sum_{i,j}x_{ij}C_{u_i v_j}\). \end{lemma} \begin{proof} Consider any cycle \(C_t\) in a quotient. Its contribution from \(C_a\) has length divisible by \(a\). This rules out every \(bv_j\), since \(\gcd(a,b)=1\) and \(v_j\) is a proper divisor of \(a\). Thus this length is \(a u_i\). Similarly the contribution from \(C_b\) has length \(b v_j\). Taking the gcd recovers \(t=u_i v_j\). The factors \(u_i,v_j\) are recovered from \(t\) by taking its gcd with \(b,a\), respectively. Every cycle of every quotient therefore belongs to exactly one cell. Conversely \(C_a C_{u_i v_j}=v_j C_{a u_i}\) and \(C_b C_{u_i v_j}=u_i C_{b v_j}\). The row and column lengths are all distinct, so adding the contributions gives exactly~\eqref{eq:table}. \end{proof} \subsection{Separating the two projections}\label{sec:normal-proof} In the last example a useful change of lengths is already visible: \(6\cdot6-35=1\). Replacing \(6,35\) by \(36,35\) carries the same diagonal quotient \(C_{10}+C_{21}\) to the target \(2C_{180}+3C_{252}+5C_{70}+7C_{105}\). The two row lengths were multiplied by six. The column lengths and the four required multiplicities stayed the same. For an arbitrary input the first difficulty is to identify the rows. For instance, \((C_2+C_3)(C_1+C_3)=C_2+4C_3+C_6\). The \(C_6\) comes from \(C_2C_3\). If we called it a column because its length is divisible by three, changing \(2,3\) to \(4,3\) would give \(C_4+4C_3+C_6\). Its 22 states cannot be a product with a seven-state divisor. The total number of states in each projection tells us which assignment is possible. \begin{proof}[Proof of Theorem~\ref{thm:normal}] Put \(D=\lcm(a,b)\). Group the observed lengths \(\ell\) by their common label \(R=\lcm(D,\ell)\). Both images of a quotient cycle of length \(t\) belong to the block \(B_R\) with \(R=\lcm(D,t)\). The split in \eqref{eq:forced-split} either detects an impossible target or gives its required row and column multiplicities in every block. Write \(n_R=|B_R|/(a+b)\) for the required quotient size there. \emph{Choosing the new divisor.} Write \(U=a/g,\ V=b/g\). We need positive \(P,Q\) with \(UP-VQ=1\) and \(VQ\ge2\). The \((6,35)\) example used \(P=6,Q=1\). For a uniform construction take \(1\le P_0\le V\) with \(UP_0\equiv1\pmod V\), taking \(P_0=1\) if \(V=1\), and put \(Q_0=(UP_0-1)/V\). Set \(P=P_0+2V,\ Q=Q_0+2U\) and \[ a'=Pa,\qquad b'=Qb,\qquad D'=\lcm(a',b')=PQD . \] Then \(a'/g=b'/g+1\), \(b'/g\ge2\), and \(\gcd(P,Q)=\gcd(P,V)=\gcd(Q,U)=1\). Writing \(\nu_p(t)\) for the exponent of \(p\) in \(t\), for every prime \(p\mid P\) we have \(\nu_p(a)\ge\nu_p(b)\), and symmetrically for \(Q\). \emph{Transforming a block.} If a change of divisor length introduces a prime power already forced by the block label, the quotient length must change with it. The factors below record precisely those forced changes. Let \(F_R\) be the set of primes dividing \(R/D\). Let \(P_R\) and \(Q_R\) be the products of the full prime powers of \(P\) and \(Q\), respectively, supported on \(F_R\). Empty products are one. The mapping on quotient lengths in this block is \(t\mapsto y=P_RQ_Rt\). Form \(B'\) by the following rules: \[ \begin{array}{c|c|c} &\text{new length}&\text{new multiplicity}\\ \hline \text{row of length }r\text{ and multiplicity }k &P Q_R r &P_R k\\ \text{column of length }c\text{ and multiplicity }k &Q P_R c &Q_R k . \end{array} \] Add multiplicities when the new lengths coincide. For example, take \(A=2C_1\) and \(B=2C_6\). Each projection must supply one \(C_6\). Here \(P=3,Q=2,R=6\), so the quotient \(C_6\) becomes \(C_{36}\). Its two contributions are \(3C_{36}\) and \(2C_{36}\), giving the single observed length in the new target \(5C_{36}\). For \(\lcm(D,t)=R\), the transformation follows from the identities \[ \begin{aligned} \lcm(a',y)&=P Q_R\lcm(a,t),& \gcd(a',y)&=P_R\gcd(a,t),\\ \lcm(b',y)&=Q P_R\lcm(b,t),& \gcd(b',y)&=Q_R\gcd(b,t). \end{aligned} \] Indeed at \(p\in F_R\) the exponent in \(t\) is its exponent in \(R\), strictly greater than that in either original axis. Raising it by \(\nu_p(PQ)\) keeps it above both new axes. At \(p\notin F_R\) the exponent in \(t\) is at most that in \(D\). If \(p\mid P\) then \(\nu_p(D)=\nu_p(a)\), so increasing the exponent in \(a\) multiplies the row length by the \(p\)-part of \(P\) and leaves its multiplicity and the whole column contribution unchanged. The case \(p\mid Q\) is symmetric; elsewhere the exponents are unchanged. Thus every original solution has the stated image. \emph{Recovering every quotient.} Every target length transformed in block \(R\) has new label \(S=PQR\). At primes in \(F_R\) its original exponent is the one in \(R\), and the rules add \(\nu_p(PQ)\). At all other primes its new exponent is at most the one in \(D'=PQD\). Thus the new label identifies the original block. Which row and column can meet? A common image length is divisible by both new axes, so it equals its own label \(S\). If row \(r\) and column \(c\) meet, then \(P Q_Rr=Q P_Rc=PQR\), giving \[ r=(Q/Q_R)R,\qquad c=(P/P_R)R . \] Both \(r\) and \(c\) divide \(R\). Hence \(r=c=R\), \(P_R=P\) and \(Q_R=Q\). Conversely, under these conditions positive quotas on both sides at \(R\) do meet at \(S\). Put \(E=P_RQ_R\) in any block. The prescribed image rows have \(a'E n_R\) states and the columns have \(b'E n_R\) states. Thus any quotient has \(E n_R\) states in this block. Formula~\eqref{eq:forced-split} applied to the new axes forces the prescribed share at \(S\), even if one side contributes zero. Now take a cycle of length \(y\) in any quotient of \(B'\). Its label \(\lcm(D',y)=S\) determines \(R\). By the forced split its two projection lengths are \(P Q_Rr\) and \(Q P_Rc\) for some \(r,c\mid R\). Since \(y\) divides both lengths, \[ y\mid R\gcd(P Q_R,Q P_R)=ER , \] where the equality uses \(\gcd(P/P_R,Q/Q_R)=1\). For each \(p\in F_R\), the exponent in \(S\) exceeds that in \(D'\), so \(\nu_p(y)=\nu_p(R)+\nu_p(E)\). Hence \(E\mid y\), and \(t=y/E\) divides \(R\) with the full exponent of \(R\) at every \(p\in F_R\). At all other primes \(D\) and \(R\) have the same exponent. Thus \(\lcm(D,t)=R\). In a block where the two sides meet, this inverse simply divides every quotient length by \(PQ\). The four identities above now recover the contributions of \(C_t\). Within a block each side scales its lengths by a fixed factor, so dividing its image multiplicities by \(P_R\) on the row side and by \(Q_R\) on the column side recovers all the old margins. The decoded cycles therefore give \(AX=B\). Each keeps its multiplicity, and mapping \(t\) forward gives back \(y\). The maps are inverse on quotient classes. \emph{Bit complexity.} Let \(L\) be the length of the binary cycle lists. Extended Euclid computes \(P_0\), and \(P\le3V,\ Q\le3U\). No factoring of a binary axis or target period is needed. For example, \[ P_R=\gcd\bigl(P,(R/D)^{\lceil\log_2(2P)\rceil}\bigr) \] is computed by modular powering, and similarly for \(Q_R\). There are only polynomially many periods and blocks. The displayed formulas use polynomial-bit integers throughout. A quotient can be mapped or decoded in time polynomial in the input and its own list. On a rejected input output \(B'=C_1\) with the new divisor, which admits no quotient. On explicit inputs let \(N=|A|+|B|\). Reading their cycles gives \(L=O(N\log(2N))\). A new row's number of states is its old number times \(P P_RQ_R\), and a column's number is its old number times \(Q P_RQ_R\). Equivalently, if the margin split passed, \[ |B'|=(Pa+Qb)\sum_R P_RQ_R\,n_R . \] Thus the two output permutations have at most \(PQ\max(P,Q)N=O(N^4)\) states, independently of feasibility. Writing their successor tables and, when requested, expanding the cycles of a witness take polynomial bit time. \end{proof} With just one divisor length, each candidate contributes to a single target length. One can solve the resulting equations separately in polynomial time, even in binary~\cite[Theorems 3 and 4]{dennunzio}. Appendix~\ref{app:binary} gives the criterion and a short certificate for general binary division. With two lengths the same entry \(x_{ij}\) must help meet both a row sum and a column sum. We now use that requirement to make several occurrences of an edge colour agree. \section{How a table records an edge-colouring}\label{sec:gadget} Take a nonempty simple cubic graph \(G'\). To colour its edges with three colours, we must give the two ends of each edge the same colour, and use each colour once at each vertex. We will make a row choose a colour and let the columns check who else has chosen it. We want each element to occur in exactly three triples. Starting with one triple \((v,w,e)\) per edge \(e=vw\) nearly works. Each vertex occurs three times and each edge just once. Give every vertex \(v\) three copies \(v_0,v_1,v_2\), one per layer. Within layer \(\ell\) all three incident edges use the same \(v_\ell\). Keep a single element \(e\) for the edge across all layers. The triples are now \[ h=(v_\ell,w_\ell,e),\qquad \ell=0,1,2 . \] Each element \(t\), whether it is a vertex copy or an edge, belongs to exactly three triples. Require the triples through \(t\) to have all three colours. In layer \(0\) this gives an edge-colouring of \(G'\). Conversely, any proper edge-colouring \(\kappa\) gives each triple \((v_\ell,w_\ell,e)\) the colour \(\kappa(e)+\ell\bmod 3\). Thus the extra layers cost nothing for existence. They will matter when we count the tables in Section~\ref{sec:counting}. \paragraph{A row chooses a colour.} In \eqref{eq:table} a row sum uses the \emph{column} weights. We want the row for \(h=(v_\ell,w_\ell,e)\) to select one column for each of its elements, all of the same colour. Give each element \(t\) a symbol \(B_t\) for its base weight, and give each vertex \(v\) a symbol \(D_v\). Initially treat different symbols as independent. Define \[ \Delta_{v_\ell}=D_v,\qquad \Delta_e=-D_v-D_w\quad(e=vw),\qquad X_{t,c}=B_t+\sigma_c\Delta_t,\qquad (\sigma_0,\sigma_1,\sigma_2)=(0,1,3). \] Suppose the row selects its three \(X\)-columns at colours \(i,j,c\), respectively. After subtracting its target \(\sum_{t\in h}B_t\), the excess weight is \begin{equation}\label{eq:colour-difference} (\sigma_i-\sigma_c)D_v+(\sigma_j-\sigma_c)D_w . \end{equation} For example, choosing colour \(2\) at both ends and colour \(1\) at the edge leaves \(2D_v+2D_w\). Equality with the target requires both coefficients to vanish, so all three choices must agree. \paragraph{One triple fills a pair of columns.} Give column \(X_{t,c}\) a partner of weight \(Y_{t,c}=H_t-X_{t,c}\), where \(H_t\) is a new symbol for element \(t\). A row that visits both columns once receives exactly \(H_t\). \begin{samepage} A triple \(h\) has seven rows. Four visit all three elements of \(h\) at its chosen colour \(c\). The other three are indexed by the elements of \(h\). At a given element \(t\), only its own incidence row \(F_{ht}\) joins the four shared rows. The five rows split as follows. \[ \begin{array}{l|cc} & X_{t,c} & Y_{t,c}\\ \hline \text{rows for the whole triple }h & P_h,\ G_h & R_h,\ K_h\\ \text{row for this incidence }(h,t) & F_{ht} & F_{ht} \end{array} \] \end{samepage} Each named row contributes one copy to its column. If each column accepts exactly one such filling, the three triples at \(t\) must choose different colours. To realise these sums, give the pair \(P_h,G_h\) weights \(p_h,g_h\) with sum \(L_h=p_h+g_h\). Give \(R_h,K_h\) the same total weight in a different way, using a fresh symbol \(r_h\). Finally, give both columns at \((t,c)\) target \(T_t\). The incidence row \(F_{ht}\) must supply the missing weight \(T_t-L_h\). The resulting row data are \begin{center} \begin{tabular}{lll}\toprule Rows & Respective weights & Target of each row\\ \midrule \(P_h,\ G_h\) & \(p_h,\ g_h\) & \(\sum_{t\in h}B_t\)\\ \(R_h,\ K_h\) & \(r_h,\ L_h-r_h\) & \(\sum_{t\in h}(H_t-B_t)\)\\ \(F_{ht}\) for \(t\in h\) & \(T_t-L_h\) & \(H_t\)\\ \bottomrule \end{tabular} \end{center} \paragraph{Passing from symbols to integers.} Two conditions will make every numerical filling visible in this description. First we place the row weights close to \(W\) and the column weights close to \(V\), for positive scales \(W,V\). We use the bounds \begin{align*} |p_h-W|,\ |g_h-W|,\ |r_h-W|&\le 10^{-4}W, &|T_t-3W|&\le 3\cdot10^{-4}W,\\ |B_t-V|,\ |H_t-2V|&\le10^{-4}V, &01\). In the resulting table each margin equation allows at most three copies. \end{theorem} \begin{proof} Membership in NP is Lemma~\ref{lem:cert}. For hardness take \(G'=G\) in Lemma~\ref{lem:gadget}, where \(G\) is a nonempty instance of Holyer's NP-complete problem of three-edge-colourability of simple cubic graphs~\cite{holyer}. To turn its table into a division instance, we take \(b\) to be the lcm of the row weights and \(a\) the lcm of the column weights, as in Lemma~\ref{lem:tables}. We choose the rows first. Once \(b\) is known, making each column weight \(1\) modulo \(b\) ensures that \(a\) and \(b\) are coprime. \emph{The row weights determine \(b\).} Let \(s=|V(G)|+|E(G)|\). Choose a base \(Q=1024\), and reserve a different low digit \(j\) for each of the \(J_r=O(s)\) row symbols. For \(0\le j1\) and \(\gcd(a,b)=1\), such that \(AX\cong B\) is solvable exactly when \(G\) has a proper three-edge-colouring. Each individual margin equation in the construction still allows at most three copies. \end{theorem} This bound already proves the quasipolynomial comparison in Theorem~\ref{thm:main}\textup{(ii)}. For part~\textup{(iii)}, Appendix~\ref{app:sharp} keeps the same graph and changes the integers assigned to its addresses. \subsection*{Putting the endpoints of an edge close together} Consider the weight \(T_t-p_h-g_h\) of the auxiliary row for \(t\in h\). The name \(T_t\) belongs to an element and \(p_h,g_h\) belong to a triple. Suppose we could put these names at the same binary address or at two addresses differing in one bit. If the multiplier for address \(x\) were a product of one factor per bit, flipping one bit would leave all the other factors common to the two terms. This is our reason for first modifying the graph. Number the vertices and give each edge its own nonzero index. Store a vertex index and an edge index in two registers of \(d=O(\log(s+2))\) bits in total. Represent vertex \(v\) by \((v,0)\). Orient an edge \(e=vw\) by vertex order and route it through the addresses \[ (v,0)\ \longrightarrow\ (v,e)\ \longrightarrow\ (w,e)\ \longrightarrow\ (w,0). \] Each arrow flips the differing bits of one register in increasing order. At each internal address on the route insert a private copy of \(K_4\) with one edge deleted. Use its two degree-two vertices to join it to the previous and next parts. Copies on different routes stay separate even when they occupy the same address. Such a copy transmits the colour of the original edge. Indeed, each colour occurs at four vertex incidences. Internal edges account for an even number, so the two external edges must have the same colour. Every choice of this common colour extends across the copy by colouring the three perfect matchings of \(K_4\) and deleting the designated edge. This is the diamond used in~\cite[proof of Theorem~3.1]{caigovorov}. Thus the new graph \(G'\) is simple, cubic and three-edge-colourable exactly when \(G\) is. It has \(O(sd)\) vertices. Each address has bounded occupancy. An address \((i,0)\) contains at most the original vertex \(i\). At \((i,j)\) with \(j\ne0\), at most three incident edges of \(i\) contribute an outer segment, and only edge \(j\) can contribute a middle segment. Each such segment visits the address at most once, giving at most four copies or sixteen vertices. Give all four vertices of a diamond the address where it was inserted. An edge of \(G'\) now joins vertices at equal addresses or at addresses one bit apart. Number the new vertices and choose the lower-numbered endpoint of each edge as its owner. Put the names attached to \(v_\ell\) and \(D_v\) at \(v\), and those attached to an edge and its triples at its owner. Only a bounded number of names share an address. Every weight in Lemma~\ref{lem:gadget} uses one address or two neighbouring addresses. The targets need only have short binary descriptions, since only the weights enter the lcms. \subsection*{Multipliers for the addresses} A binary address \(x\) will also denote the set of bits equal to one. Its multiplier \(U(x)\) should keep short relations among different addresses distinguishable and should keep all the names in their prescribed size ranges. We also prescribe a modulus \(M\). Having \(U(x)\equiv1\pmod M\) will let us choose the two axis lcms to be coprime. A symbol at \(x\) will have value \(\mu U(x)\) with \(|\mu|\le C\). Collecting at most \(H\) signed occurrences therefore gives address coefficients whose absolute values sum to at most \(HC\). \begin{lemma}[Address multipliers]\label{lem:address} Fix \(H=30\). For positive integers \(d,M,C\) one can choose positive integers \(q,z_0,\ldots,z_{d-1}\), with \(q\le z_i<2q\) and \(\log q=O(d+\log(2M)+\log(2C))\), such that \[ U(x)=q^{d-|x|}\prod_{i\in x}z_i,\qquad U(x)\equiv1\pmod M,\qquad 1\le U(x)/q^d<1+10^{-7}. \] If integers \(b_x\) have at most \(H\) nonzero entries and \(\sum_x|b_x|\le HC\), then \(\sum_x b_xU(x)=0\) forces every \(b_x=0\). The integers \(q,z_i\) are computable in time polynomial in \(d\), \(\log(2M)\) and \(\log(2C)\). \end{lemma} Appendix~\ref{app:address} constructs these multipliers. We first use the product formula for \(U(x)\) to see how much it saves. \paragraph{Why the weights have a small common multiple.} With two bits, for instance, the addresses \(\{0\}\) and \(\{0,1\}\) have multipliers \(qz_0\) and \(z_0z_1\). A linear combination factors as \(z_0(c_1q+c_2z_1)\). Only the term in parentheses depends on the bit that changed. In general every \(U(x)\) divides \(D_0=q^d\prod_{i1\) odd, and let \(u\) be a proper divisor of \(b\). The first cycle of \(A\) gives the same product with \(2C_u\) as with \(C_{2u}\), namely \(2C_{2u}\). The interval construction for explicit division uses the same identity with a prime-length cycle~\cite[Section~2, p.~4]{kuosa-np}. Here the second cycle tells which choice we made. It gives \(2uC_b\) in the first case and \(uC_{2b}\) in the second. Thus a target can offer a separate choice for each of several weights \(u\), then prescribe the sum of the weights selected. \begin{theorem}\label{thm:count} Fix \(h\ge1\) and a prime \(q\nmid h\). For binary cycle lists, counting quotient isomorphism classes is \(\#\mathsf P\)-complete under parsimonious polynomial-time reductions, even for divisors \(C_{hq}+C_{hb}\) with \(b>1\) and \(\gcd(q,b)=1\). The corresponding decision problem is \(\NP\)-complete. In particular, \(h=1\) and \(q=2\) suffice. \end{theorem} We first identify every quotient of a target whose weights are given, then choose weights that encode exact covers. \begin{proof} \emph{Reading a subset from a quotient.} Let \(u_1,\ldots,u_s\) be distinct positive proper divisors of \(b\), where \(q\nmid b\). Write \(U=\sum_i u_i\), fix \(0\le S\le U\), and set \[ A=C_q+C_b,\qquad B=\sum_{i=1}^s qC_{qu_i}+qS C_b+(U-S)C_{qb}. \] Assume each prime dividing \(h\) divides every \(u_i\). Write \(S_h\) for multiplication of cycle lengths by \(h\), preserving their multiplicities. Our output is \(A'=S_h(A)\) and \(B'=hS_h(B)\). The outer \(h\) multiplies the target multiplicities. For the \(C_2+C_b\) case, read the row calculation below with \(h=1\) and \(q=2\). For larger \(h\), the issue is whether scaling introduces any additional quotient lengths. Suppose \(A'Y=B'\). Call the \(hq\) target cycles of length \(hqu_i\) row \(i\). All come from \(C_{hq}\), since \(hb\mid hqu_i\) would imply \(b\mid u_i\). A quotient length \(y\) contributing to row \(i\) therefore satisfies \(\lcm(hq,y)=hqu_i\). For each prime \(p\mid h\), the exponent of \(p\) in \(hqu_i\) exceeds its exponent in \(hq\). Thus \(y\) supplies the full exponent, and \(h\mid y\). Writing \(y=ht\) leaves \(\lcm(q,t)=qu_i\). Since \(q\) is prime and \(q\nmid u_i\), only \(t=u_i,qu_i\) work. Their contributions to the row are \(h\) and \(hq\) cycles per copy. Writing \(z_d\) for the multiplicity of \(C_d\) in \(Y\), the row equation becomes \(z_{hu_i}+qz_{hqu_i}=q\). Its two nonnegative integer solutions give the alternatives \[ qC_{hu_i}\quad\text{(select \(i\))},\qquad C_{hqu_i}\quad\text{(omit \(i\))}. \] The two choices use the same \(hqu_i\) states. A quotient cycle can supply only one row because its product with \(C_{hq}\) has a single length. Together the rows use \(hqU\) states. Since \(|B|=q(q+b)U\), \(|B'|=h^2|B|\), and \(|A'|=h(q+b)\), the rows exhaust \(|B'|/|A'|\). This excludes even a quotient cycle whose two products would both miss the rows. The length \(hqb\) is divisible by both divisor lengths, so Lemma~\ref{lem:tables} alone would not separate it. The exhaustion of the quotient states is what settles this shared length. The second divisor cycle \(C_{hb}\) receives the choices from all rows. Each selected row contributes \(hqu_i\) copies of \(C_{hb}\) and each omitted row contributes \(hu_i\) copies of \(C_{hqb}\). Thus the selected indices \(I\) give the prescribed target exactly when \(\sum_{i\in I}u_i=S\). The bijection and its inverse are \[ Y_I=\sum_{i\in I}q C_{hu_i}+\sum_{i\notin I}C_{hqu_i}, \qquad I(Y)=\{i:z_{hu_i}=q\}. \] Indeed, the \(u_i\) are distinct and none is divisible by \(q\), so the \(2s\) lengths \(hu_i,hqu_i\) are pairwise distinct. The formula specifies a cycle type, hence a single isomorphism class even when it uses \(q\) copies of one cycle. It works for every fixed \(h\). \emph{Making the selected weights form an exact cover.} Our input consists of \(s\) distinct triples \(E_i\) drawn from \(\{0,\ldots,3k-1\}\). The triples may overlap. Counting exact covers by triples is \(\#\mathsf P\)-complete under parsimonious reductions \cite[Theorem~3.8 and Corollary~3.11]{hunt}. For an empty ground set return \(A_0=B_0=C_{hq}+C_{h(q+1)}\), with unique quotient \(C_1\). If \(sU\), return the same zero-solution instance as above. Otherwise the row construction gives exactly one quotient per exact cover. Each weight uses \(O(1+\log(hq)+k\log(s+2))\) bits, and the bit length of the product defining \(b\) is at most the sum of the bit lengths of its factors. Hence all lengths and multiplicities are produced in polynomial bit time. The same construction reduces the decision version of exact cover to division. Lemma~\ref{lem:cert} gives membership in NP. \emph{Counting every quotient once.} For any two divisor lengths \(a_1,a_2\) of gcd \(h\), a quotient length \(d\) produces two observed target lengths \(r,c\). Comparing prime exponents gives \[ g=\gcd(r,c)=\gcd(\lcm(a_1,d),\lcm(a_2,d))=\lcm(h,d), \qquad g/d=h/\gcd(h,d). \] Thus for each pair of target lengths, allowing repetition, we need only test \(g/e\) for divisors \(e\) of both \(h\) and \(g\). With \(m\) distinct target lengths this gives at most \(m^2\tau(h)\) candidates. Sort the list and remove duplicates. If \(\beta\) is the largest target multiplicity, a quotient length can occur at most \(\beta\) times, as each copy contributes at least one cycle at a given output length. Guess exactly \(\lceil\log_2(1+\beta)\rceil\) bits for each multiplicity, reject values above \(\beta\), and check the whole product by the cycle rule. Since \(h\) is fixed, these steps take polynomial bit time. There is one accepting path for each quotient class, proving membership in \(\#\mathsf P\). \end{proof} The divisibility condition on the weights prevents extra quotients under scaling. For example, \((C_3+C_4)X=3(C_3+C_4)\) has just the quotient \(3C_1\). With \(h=2\) and \(u_1=1\), the scaled equation is \((C_6+C_8)Y=6(C_6+C_8)\). Any partition of six states into cycles of lengths one and two works, giving four quotient classes. The colouring construction of Section~\ref{sec:gadget} also gives an exact count. A proper labelled edge-colouring in layer zero has two extensions on each connected component. In layer one the three colours at each vertex must undergo a fixed-point-free permutation, a shift by \(+1\) or \(-1\) modulo three. Neighbours must choose the same sign, and layer two then takes the remaining colour on each edge. Thus a graph \(G\) gives \(2^{\operatorname{cc}(G)}\mathrm{Col}_3(G)\) quotient classes, where \(\mathrm{Col}_3(G)\) counts its proper labelled three-edge-colourings. For \(K_4\) the six colourings give twelve classes. Appendix~\ref{app:count} preserves these classes for other fixed gcds using \(S_h(B)\) as target and leaving the quotient itself unchanged. Its proof uses the special multiplicities of that construction. The restriction on the gcd matters even for writing the answer. If it can grow with binary input length \(L\), the number of bits in the quotient count can reach \(2^{\Theta(L/\log L)}\). Proposition~\ref{prop:answer-length} gives a family attaining this bound and a matching upper bound for all binary cycle lists. \section{When is explicit division polynomial?}\label{sec:threshold} When one of the two lengths after division by their gcd has a bounded number of divisors, Theorem~\ref{thm:one-axis} already gives a polynomial algorithm for counting all quotient classes. Now allow both reduced divisor counts to grow and ask only for one quotient. Two size estimates determine exactly how fast SAT would have to be for this task to take polynomial time, as claimed in Theorem~\ref{thm:main}\textup{(iii)}. \begin{proof} \emph{From a SAT algorithm to a division decision.} Suppose SAT on \(m\)-bit inputs takes time \(m^{O(\log\log m)}\). Let \(N=|A|+|B|\) be the number of states in a division input. Lemma~\ref{lem:short} gives each block a SAT encoding whose bit length \(\ell\) satisfies, for sufficiently large \(N\) and \(\ell\), \[ \log\ell=O(\log N/\log\log N),\qquad \log\log\ell=O(\log\log N). \] Multiplying these estimates shows that the time per block is \(\exp(O(\log N))=N^{O(1)}\). There are at most \(N\) blocks, and division is possible exactly when every block is feasible. \emph{From a division decision to a SAT algorithm.} Suppose we can decide \(\DivTwo\) in polynomial time. Convert an \(m\)-bit SAT instance in polynomial time to a simple cubic graph of size \(s=m^{O(1)}\) whose three-edge-colourability gives the answer~\cite{holyer}. Theorem~\ref{thm:sharp-encoding} writes the two successor tables in \(s^{O(\log\log s)}\) bit operations, so their total bit length is bounded by the same expression. Running the division algorithm takes at most a fixed power of this time. The resulting SAT algorithm runs in \(m^{O(\log\log m)}\) time. \emph{Recovering the cycles of one quotient.} First ask whether \(A\) divides \(B\). On a positive answer, try quotient cycles \(C_t\) in order of length, up to \(n=|B|/|A|\). To try one copy, form \(P=AC_t\). If the current target contains all cycles of \(P\) with their multiplicities, subtract them and ask whether the remainder is divisible by the same \(A\). An empty remainder succeeds immediately. On success, record \(C_t\), keep the remainder and try the same length again. On failure, keep the current target and advance to the next length. The test succeeds exactly when some quotient of the current target contains \(C_t\), since \(A(C_t+Y)=P+AY\). Once a length fails, it cannot become possible later. Restoring the cycles already removed would produce a quotient containing it at the earlier stage. A feasible nonempty target always has some quotient cycle, so the process ends with a complete quotient. In fact \(n\) decision calls suffice on a positive instance. If the output has \(r\) cycles and its last cycle has length \(t\), at most \(t-1\) lengths incur a failed oracle call. Only \(r-1\) successful removals use the oracle, since the last leaves an empty target. Including the initial test gives at most \(t+r-1\le n\) calls. Each query keeps the same divisor and has at most the original number of states. This argument applies to any explicit permutation divisor \(A\). \end{proof} Whether SAT meets the bound in part~\textup{(iii)} is open. Two October 2026 preprints report deterministic algorithms for 3-SAT with subexponential running time in the number of variables~\cite{claude-sat,openai-sat}. Even on 3-SAT, the stated bounds do not yield \(m^{O(\log\log m)}\) time in the input bit length \(m\). Parts~\textup{(i)} and~\textup{(iii)} both consider reductions from SAT to division. The construction used here has \(m^{O(\log\log m)}\) time to write its tables. If a polynomial-time SAT algorithm could use a division oracle, part~\textup{(i)} would already give \(\mathsf P=\NP\). In particular, if SAT misses the stated time bound, then \(\mathsf P\ne\NP\), part~\textup{(i)} rules out NP-hardness, and part~\textup{(iii)} rules out membership in P. If SAT meets the bound, \(\DivTwo\) belongs to P. This proves the claimed characterisation of when \(\DivTwo\) is NP-intermediate. For each fixed pair \(a,b\), Theorem~\ref{thm:one-axis} already gives a polynomial-time algorithm. What would it take for one polynomial time bound to work as both lengths vary? \begin{corollary}[Division by cycles of consecutive lengths]\label{cor:two-cycle-threshold} Fix \(h\ge1\) and let \(d\ge2\) vary. Suppose the divisor is \(C_{hd}+C_{h(d+1)}\) and the target is a nonempty permutation. \begin{enumerate}\renewcommand{\labelenumi}{\textup{(\roman{enumi})}}\setlength{\itemsep}{1pt} \item With successor tables, a deterministic polynomial-time division test exists if and only if SAT on \(m\)-bit formulas can be decided in deterministic time \(m^{O(\log\log m)}\). Such a division test suffices to construct one quotient in polynomial time. \item With successor tables, the exact quotient count is computable in deterministic polynomial time if and only if the satisfying assignments of an \(m\)-bit formula can be counted in deterministic time \(m^{O(\log\log m)}\). \item With binary cycle lists, counting quotient isomorphism classes is \(\#\mathsf P\)-complete under parsimonious polynomial-time reductions, and deciding division is \(\NP\)-complete. \end{enumerate} The two explicit equivalences also hold for arbitrary pairs of lengths and for the family in which neither length divides the other, with either a prescribed or an unrestricted greatest common divisor. \end{corollary} \begin{proof} \emph{Changing the gcd on the instances of the graph construction.} Theorem~\ref{thm:normal} handles any input at its own gcd. For the hard direction here the starting graph gives coprime lengths, while the output gcd \(h\) may be prescribed in advance. The separated table of Lemma~\ref{lem:tables} permits a direct construction with a smaller explicit size bound. Its row weights \(u_i\) divide \(b\) properly, its column weights \(v_j\) divide \(a\) properly, and its required multiplicities are \(R_i,S_j\). To prescribe the gcd, write \(h=\alpha\beta\), placing in \(\beta\) the full powers of the primes of \(h\) that divide \(b\). Then \(U=\alpha a\) and \(V=\beta b\) are coprime and exceed one. Take \(P\) to be the inverse of \(U\) modulo \(V\) in \(\{1,\ldots,V-1\}\) and put \(Q=(UP-1)/V\). We have \(1\le Q1$ and $\gcd(a,b)=1$. In the reduction the quotient classes are in bijection with the tables of Lemma~\ref{lem:gadget}. \end{theorem} \begin{proof} The case \(h=1\) is Theorem~\ref{thm:compact}. For \(h>1\) we will multiply each divisor and target length by \(h\). Two properties of the original instance will preserve its quotients. Coprimality of each quotient length with \(h\) lets us carry a quotient forward. Multiplicity one will let us reverse the construction. A cycle whose length shares a factor with \(h\) splits into repeated cycles under the \(h\)th iterate. Replace each row identifier $cW_0+Q^j$ of \eqref{eq:row-identifiers} by $c(hW_0+1)+hQ^j$. The resulting identifiers have residues $1,1,1,3$ modulo $h$ for the four kinds of names $p,g,r,T$. All row weights, including $p+g-r$ and $T-p-g$, are therefore $1$ modulo $h$. Their least common multiple $b$ is coprime to $h$. In \eqref{eq:column-identifiers} use the multiplier $hb$ in place of $b$, keeping the respective offsets $1,2,0$ on $B,H,D$. Every column weight is then $1$ modulo $hb$, so its axis lcm $a$ is coprime to both $b$ and $h$. The digit proof still works. On rows the low part of any tested relation has absolute value less than $hW_0+1$. On columns the sum of the offsets in a tested relation has absolute value at most $600\) gives the lower bound for every sufficiently large input budget \(L\). In particular, when the gcd is unrestricted, the counting function has superpolynomial output length and lies outside $\#\mathsf P$. \end{proof} \begin{proposition}[Finding a second quotient]\label{prop:factor-second} Let \(A=C_{2g}+C_{3g}\), with \(g\ge1\) and \(A,B\) given by binary cycle lists. Deciding whether \(AX=B\) has at least two isomorphism classes of quotients and factoring a positive integer given in binary are equivalent under deterministic polynomial-time Turing reductions. The same equivalence holds for deciding whether there is exactly one quotient class. One can factor \(g\) with \(O(\log(2g))\) queries to either decision oracle. In the other direction, one factorisation of \(g\) suffices to construct two distinct quotients whenever they exist, with polynomial bit complexity apart from that call. \end{proposition} \begin{proof} Consider first \(B=kA\), the disjoint union of \(k\) copies of \(A\). For any nonempty permutation \(A\), the quotients of \(AX=kA\) are the partitions of \(k\) into divisors of the gcd of all cycle lengths of \(A\). Indeed \(|X|=k\). For any cycle length \(a\) of \(A\), its \(a\)th iterate has \(F_a(A)>0\) fixed points. Since \(F_a(A)F_a(X)=F_a(kA)=kF_a(A)\), we have \(F_a(X)=k\), so every quotient length divides \(a\). The cycle product rule proves the converse. The single-cycle version is the restricted-partition example of Bridoux et al. when \(A=C_g\) and \(k=g\) \cite[Appendix~B, Lemma~13]{bridoux}. For \(A=C_{2g}+C_{3g}\) with \(g>1\), the all-ones partition is always available. The first \(k\) admitting a second partition is the least prime divisor of \(g\). Every nonunit part is at least that prime, and a part of that size can be completed with ones. For example, when \(g=15\) the first change occurs at \(k=3\), with quotients \(3C_1\) and \(C_3\). For a remaining factor \(h>1\), use the divisor \(A_h=C_{2h}+C_{3h}\). Query the targets \(kA_h\) at \(k=2,4,8,\ldots\), capping the last probe at \(h\). The target at \(k=1\) has a unique quotient. The first probe admitting a second quotient brackets the least prime divisor \(p\) of \(h\) between the preceding value and the current one. The interval has length at most \(p\), so binary search in it finds \(p\) in a total of \(O(\log p)\) queries, including the probes. Either oracle detects the change since \(kC_1\) is always a quotient. Divide \(h\) by \(p\) and repeat until \(h=1\). The primes found, with multiplicity, have product \(g\). Summing their logarithms gives \(O(\log(2g))\) queries in all, each of \(O(\log(2g))\) bits. The same first-change test with \(A=C_g\) already recovers the prime factors from one-cycle division. We now go in the other direction. Given \(B\), replace each cycle in a putative quotient by copies of the shortest cycle with the same ordered pair of image lengths, as in Proposition~\ref{prop:bounded-binary}. The resulting multiplicities form its \emph{representative vector}. Two quotients may give different vectors, or they may give the same vector. We test each possibility. \emph{Can the vector of representative multiplicities change?} Split each block's row and column multiplicities by~\eqref{eq:forced-split}, rejecting a failed split. For a row length \(u\) in block \(R\), we have \(2g\mid u\) and \(R=\lcm(u,3g)\). Hence \(R/u=3g/\gcd(u,3g)\) divides \(3\). Likewise \(R/v\) divides \(2\) for every column length \(v\). There are therefore at most two rows and two columns, as in the proof of Theorem~\ref{thm:one-axis}. Measure each cell in \emph{quotient states}. A quotient cycle \(C_t\) supplies \(\gcd(2g,t)\) cycles of length \(\lcm(2g,t)\) to its row, or \(2gt\) image states for its \(t\) quotient states. Row \(i\) needs \(u_i\rho_i\) image states for its \(\rho_i\) cycles of length \(u_i\), so its sum in quotient states is \(r_i=u_i\rho_i/(2g)\). In column \(j\), the requirement of \(\gamma_j\) cycles of length \(v_j\) gives the sum \(c_j=v_j\gamma_j/(3g)\). Use the quotas of this block, keeping the two shares at \(R\) separate. Pad a missing row or column with zeros. Reject nonintegral margins or unequal total sums. For each attainable pair \((u_i,v_j)\), let \(s_{ij}\) be its least representative, computed as in Proposition~\ref{prop:bounded-binary}. Its cell must contain a nonnegative multiple of \(s_{ij}\): each copy of \(C_{s_{ij}}\) supplies that many quotient states to both margins. An unattainable or padded cell must be zero. Conversely, dividing the occupied cells by their representatives recovers a feasible multiplicity vector. Once the upper left cell \(x\) is chosen, the table is forced: \[ \begin{pmatrix}x&r_1-x\\ c_1-x&r_2-c_1+x\end{pmatrix}, \qquad \max(0,c_1-r_2)\le x\le\min(r_1,c_1). \] Every attainable cell gives one congruence for \(x\). For example, the upper right cell requires \(r_1-x\) to be divisible by \(s_{12}\) when that pair is attainable, so \(x\equiv r_1\pmod {s_{12}}\). The generalised Chinese remainder theorem either detects a conflict or combines these congruences into a single residue class. Intersect it with the displayed interval and with the equalities from the zero cells. The first admissible value and, if present, the next one can be found by integer division. The combined modulus divides \(R\), since each \(s_{ij}\) divides both of its image lengths. All these integers have \(O(L)\) bits for input bit length \(L\). There are at most as many blocks as observed lengths. An empty block solution set rules out a quotient. Otherwise take the first value in each block. A second value in any block gives a second representative vector in polynomial bit time. \emph{Can the same vector lift to two quotients?} Suppose the representative vector \(z\) is unique. For instance, with \(A=C_{10}+C_{15}\) and \(B=25C_{30}\), both \(5C_6\) and \(C_{30}\) give \(B\). Each \(C_6\) supplies five target cycles and \(C_{30}\) supplies all twenty-five, so both choices give \(z_6=5\). When can shorter cycles be grouped in this way? For an ordered pair of output lengths \(u,v\), write \(s\) for its least representative and \(m=\gcd(u,v)\). The periods giving this pair are precisely the multiples of \(s\) dividing \(m\): necessity was shown in Proposition~\ref{prop:bounded-binary}. For sufficiency, the lcm with the first divisor length lies between \(\lcm(2g,s)=u\) and \(u\) in the divisibility order. The same argument applies to \(v\). Set \(H=m/s\). A cycle of length \(se\), \(e\mid H\), contributes exactly as much as \(e\) copies of \(C_s\). Thus the lifts of \(z_s\) copies are exactly the partitions of \(z_s\) into divisors of \(H\). Different ordered pairs have disjoint sets of periods, so a second lift exists precisely when, for at least one pair, \(H>1\) and the least prime divisor \(p\) of \(H\) satisfies \(p\le z_s\). Replacing \(p\) copies of \(C_s\) by \(C_{ps}\) constructs it. Here \(m=\gcd(\lcm(2g,s),\lcm(3g,s))=\lcm(g,s)\), so \(H=g/\gcd(g,s)\). One factorisation of \(g\) provides the primes to test for every pair. Each constructed list uses at most four representatives per block and one extra length \(ps\mid m\). Its multiplicities have \(O(L)\) bits, since each representative copy contributes at least one target cycle. This completes the bit bound for distinguishing zero, one and at least two classes and returning the witnesses. \end{proof} The same factoring equivalence holds for every fixed coprime pair of reduced lengths \(U,V\), with \(A=C_{Ug}+C_{Vg}\) and variable \(g\). The targets \(kA\) give exactly the same divisor partitions. In the upper bound Proposition~\ref{prop:bounded-binary} gives an integer program with at most \(\tau(U)\tau(V)\) variables per block. Given one solution \(z\), test each coordinate \(j\) in turn with the added bound \(z'_j\le z_j-1\) or \(z'_j\ge z_j+1\), allowing all other coordinates of that block to vary. These fixed-dimensional tests find any alternative representative vector. For every representative \(s\) the identity \(\gcd(\lcm(Ug,s),\lcm(Vg,s))=\lcm(g,s)\) still holds. \section{A sharper bound for writing the successor tables}\label{app:sharp} \begin{theorem}\label{thm:sharp-encoding} For the same routed graph as in Theorem~\ref{thm:explicit}, one can choose the numerical weights so that both successor tables can be written in deterministic bit time \(\exp(O(\log(s+2)\log\log(s+3)))\), with the same bound on the number of states written. All conclusions about the divisor, the colouring and the three-copy margins continue to hold. \end{theorem} Recall that each graph address uses \(d=O(\log(s+2))\) bits. The two-bit calculation in Section~\ref{sec:explicit} reduces the desired bound to a choice of small integers. If the factors \(q,z_i\) assigned to the bits are polynomial in \(d\), the logarithm of each axis lcm is \(O(d\log d)\). Two requirements constrain the choice. Short signed sums of address weights must distinguish the graph's local conditions, and the weights on the second axis must avoid every prime dividing the first lcm \(a\). The next lemma meets the first requirement whenever each bit has enough candidates. The sieve later supplies candidates that satisfy the second requirement as well. \begin{lemma}\label{lem:sharp-pools} Fix positive integers \(H,K\) and an integer \(J>3\cdot2^H\). For each of \(d\) bits take a disjoint pool of \(d^J\) integers greater than one, all pairwise coprime across the union of the pools. For all sufficiently large \(d\) and any integer \(q>0\), one can choose a \(z_i\) in each pool so that no relation \(\sum_x b_x U(x)=0\) has between one and \(H\) nonzero coefficients, all with \(|b_x|\le K\). Here \(U(x)=q^{d-|x|}\prod_{i\in x}z_i\). If the candidates and \(q\) are \(d^{O(1)}\), deterministic search finds such a choice in \(\exp(O(d\log d))\) bit operations. \end{lemma} \begin{proof} Choose independently and uniformly from the pools. In any relation take an inclusion-minimal vanishing subsum, keeping its original nonzero coefficients. It has \(\ell\) distinct addresses with \(2\le\ell\le H\). For example, for addresses \(110,111,001\) written in bit order \(1,2,3\), a relation with coefficients \(u,v,w\) reads \[ z_1z_2(uq+vz_3)+wq^2z_3=0. \] Once \(z_3\) is fixed this relation prescribes \(z_1z_2\). As no prime factor occurs in two pool entries, it even prescribes both choices separately. Bits 1 and 2 occur in exactly the same terms, the first two. In general we group bits by the set of terms in which they occur. Cancel the common factor from each bit on which all these addresses agree. There remain \(k\ge1\) bits. Each bit selects the nonempty proper subset of the \(\ell\) terms in which it is one. Some subset occurs on a set \(F\) of at least \(k/2^H\) bits. With all other choices fixed, the equation becomes \[ A_1\prod_{i\in F}z_i+A_2q^{|F|}=0 . \] If \(A_1=0\), the terms of that proper subset already sum to zero, contrary to minimality. Otherwise the equation prescribes the product uniquely. Each candidate has a prime factor shared by no other candidate, so this product prescribes every choice on \(F\). The probability of this minimal relation is at most \(d^{-Jk/2^H}\). There are at most \((2K+1)^\ell\binom dk 2^{\ell k}\) possible lists of coefficients, surviving bit positions and bit patterns. Bits removed in the cancellation do not affect the event. Summing the probability bound over these lists and \(2\le\ell\le H\) gives at most \[ O_{H,K}\!\left(\sum_{k=1}^d (2^H d^{\,1-J/2^H})^k\right)=o(1). \] For deterministic construction, try all \(d^{Jd}\) choices. For each, there are \(O_{H,K}(2^{Hd})\) possible relations, and each can be tested using integers of \(O(d\log d)\) bits. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:sharp-encoding}] Use the routed graph, slots, coefficients \(\rho,\nu\) and preliminary row lcm \(R\) of Section~\ref{sec:explicit}. Their slot counts, coefficient bounds and the possible values of \(R\) are bounded by absolute constants. Fix \(H=30\), choose a constant \(K\) at least \(H\) times the largest slot coefficient on either axis, and fix \(J\) as in the lemma. Already \(H=30\) requires \(J>3\cdot2^{30}\) in the search through \(d^{Jd}\) choices. The time bound is asymptotic. On each axis we will put \(qJ+3\). The prime number theorem in the progression \(1\bmod R\) supplies \(\gg_R d^{E_0}/\log d\) primes in \([d^{E_0},2d^{E_0}]\)~\cite[Theorem~1.3]{bennett}. Only finitely many \(R\) occur, so a common lower bound suffices. Partition the interval into \(O_\eta(d)\) pieces of length at most \(\eta d^{E_0}/d\). Some piece contains at least \(1+d^{J+1}\) of the primes for large \(d\). Use its smallest prime as \(q\), divide \(d^{J+1}\) of the others into pools and apply Lemma~\ref{lem:sharp-pools}. Since \(q\) and every \(z_i\) equal one modulo \(R\), all column weights again equal one modulo \(R\). Their lcm \(a\) is coprime to \(R\). Every column weight divides \(q^d\prod_i z_i\) times the product of the distinct positive residual factors \(c\) and \(c_1q+c_2z_i\) from Section~\ref{sec:explicit}. There are \(O(d)\) such factors and each is \(d^{O(1)}\). In particular \(\log a=O(d\log d)\), and every prime dividing \(a\) is at most \(d^{C_1}\) for an absolute constant \(C_1\). \emph{Row weights.} Fix \(b_0>\max(C_1,J+3)\) and put \(Z=d^{b_0}\). Choose a prime \(q\in[d^E,2d^E]\) for a sufficiently large fixed integer \(E>b_0+1\) specified below, so \(q>Z\). We seek \(d^{J+1}\) pairwise coprime integers in \(I=(q,q(1+\eta/d)]\) from which to form the row pools. Let \(L=|I\cap\mathbb Z|\), so \(L\asymp d^{E-1}\). We sieve out all small prime factors so that choosing one survivor will discard few others. At primes dividing \(a\) we must also protect the row weights. These are two separate steps. The sieve gives many admissible integers in the interval. A greedy selection among the survivors then ensures that no two chosen integers share a prime. For each prime \(p\le Z\) forbid the residue zero. When \(p\mid a\), also forbid the zeros modulo \(p\) of each affine form \(c_1q+c_2z\) that can occur in a row weight at two neighbouring addresses. Use all coefficient pairs that actually occur, in their order at the zero and one ends of the flipped bit. At \(z=q\) this form has value \((c_1+c_2)q=\bar u_i q\), where \(\bar u_i\mid R\) is that row's preliminary weight. Thus \(q\bmod p\) avoids every forbidden residue, and none of the forms is identically zero modulo \(p\). A one-address weight has residual factor \(c=\bar u_i\), already coprime to \(a\). The number \(\rho(p)\) of forbidden residues therefore satisfies \(\rho(p)\le\min(\kappa,p-1)\) for an absolute \(\kappa\), independent of \(d\) and \(E\). Let \(E_p\) be the integers in \(I\) hitting a forbidden residue modulo \(p\), put \(g(p)=\rho(p)/p\), and write \(V=\prod_{p\le Z}(1-g(p))\). Mertens' estimate for the prime reciprocal sum gives \(V\gg_\kappa(\log Z)^{-\kappa}\) and, on any subinterval of primes from \(w\) to \(z\), the inverse product is \(\ll_\kappa(\log z/\log w)^\kappa\). Indeed for \(p>2\kappa\) each logarithm is at most \(\kappa/p+O_\kappa(p^{-2})\), while the remaining primes contribute a bounded factor. Set \(z=\lfloor Z\rfloor+\tfrac12\) and \(P(z)=\prod_{p2+b_0u(1+\log_2\kappa)\). We obtain \(\gg_\kappa L/(\log Z)^\kappa\) survivors. Every survivor has only \(O_{E,b_0}(1)\) prime divisors, all greater than \(Z\). Choosing one survivor and removing all those sharing a prime with it costs \(O_{E,b_0}(1+L/Z)\) candidates. Greedy selection therefore yields \(\gg Z/(\log Z)^\kappa>d^{J+1}\) pairwise coprime integers for large \(d\). Split this common supply into the \(d\) pools and use Lemma~\ref{lem:sharp-pools}. Every row weight is coprime to \(a\), since its bit factors and residual factor avoid all \(p\mid a\). The same common-multiple calculation gives \(\log b=O(d\log d)\) for the row lcm \(b\). All primes required here can be found by trial division up to polynomial bounds in \(d\), including the prime divisors of \(a\). Bertrand's postulate supplies the row prime \(q\). Scanning the intervals, testing forbidden classes and selecting the pools likewise take \(d^{O(1)}\) bit operations apart from reading the routed graph. For small \(d\), append unused address bits and repeat if a pool or a relation test leaves no admissible choice. The estimates above give a uniform threshold \(d_0\) that works for every permitted choice of slots. Starting at \(d_{\rm in}\) bits, the first successful trial uses at most \(\max(d_{\rm in},d_0)\) bits. The search need not know \(d_0\). Both exhaustive pool searches fit in \(\exp(O(d\log(d+2)))\) time. \emph{How many successors must we write?} All the cycle lengths and multiplicities of the target are fixed by the routed graph. To count its states, take one triple \(h\) in Section~\ref{sec:gadget}. The weights of its first pair of main rows sum to \(L_h=p_h+g_h\), as do the weights of its second pair. Including the incidence rows \(F_{ht}\), the contribution of this triple to the weighted sum of row targets is \[ L_h\sum_{t\in h}B_t+L_h\sum_{t\in h}(H_t-B_t) +\sum_{t\in h}(T_t-L_h)H_t =\sum_{t\in h}T_tH_t . \] Each element \(t\) occurs in three triples. On the column side the two weights \(X_{t,c}\) and \(Y_{t,c}\) add to \(H_t\), both columns have target \(T_t\), and there are three colours \(c\). Thus \(\sum_i u_iR_i=\sum_j v_jS_j=3\sum_t T_tH_t\). Substituting these two sums into the state count of Section~\ref{sec:explicit} gives \begin{equation}\label{eq:sharp-output-size} N=|A|+|B|=a+b+a\sum_i u_iR_i+b\sum_j v_jS_j =(a+b)\Bigl(1+3\sum_t T_tH_t\Bigr). \end{equation} This calculation uses only the prescribed margins, so it applies even when the graph has no proper three-edge-colouring. There are \(O(sd)\) elements \(t\), and each of \(a,b,T_t,H_t\) has \(O(d\log(d+2))\) bits. Hence \(\log N=O(\log(s+2)+d\log(d+2))\). Writing a successor index for each state in both tables takes \(O(N\log(2N))\) bit operations. Since \(d=O(\log(s+2))\), this fits in the claimed \(\exp(O(\log(s+2)\log\log(s+3)))\) time. Lemmas~\ref{lem:gadget} and~\ref{lem:tables} give the colouring equivalence and the three-copy condition. \end{proof} \paragraph{The number of states required by this encoding.} There is a matching lower bound on the sizes of these successor tables. On each axis the construction assigns a distinct weight to each edge of \(G'\), as observed in Section~\ref{sec:explicit}. Each row weight divides \(b\), and each column weight divides \(a\). Thus for \(m=a\) and for \(m=b\) we have \(\tau(m)\ge |E(G')|\ge |E(G)|=3s/5\). In particular \(m\ge3s/5\). Using the divisor estimate of Lemma~\ref{lem:short} in the form \(\log\tau(m)=O(\log m/\log\log m)\), we obtain \(\log m=\Omega(\log s\,\log\log s)\) as \(s\) grows. The explicit divisor alone therefore has \(\exp(\Omega(\log s\,\log\log s))\) states. Combined with the upper bound, the total size is \(\exp(\Theta(\log s\,\log\log s))\). This lower bound applies to encodings that retain a distinct divisor weight per edge on an axis. \begin{thebibliography}{99}\small\raggedright \setlength{\itemsep}{.20\baselineskip} \bibitem{allender-koucky} E. Allender and M. Koucký. Amplifying lower bounds by means of self-reducibility. \emph{Journal of the ACM} 57(3), article 14, 2010. \href{https://doi.org/10.1145/1706591.1706594}{Publisher}. \href{https://people.cs.rutgers.edu/~allender/papers/amplifying.pdf#page=24}{Author's copy, Theorem~5.1(3)}. \bibitem{ascone} R. Ascone, A. E. Porreca, and M. Rolland. Polynomial equations over bijective dynamical systems and their semiring extensions. Extended abstract, Workshop on Cellular Automata and Boolean Automata Networks, UCNC 2026. \href{https://doi.org/10.5281/zenodo.20431158}{Extended abstract}. \bibitem{bennett} M. A. Bennett, G. Martin, K. O'Bryant, and A. Rechnitzer. Explicit bounds for primes in arithmetic progressions. \emph{Illinois Journal of Mathematics} 62, 427--532, 2018. \href{https://personal.math.ubc.ca/~bennett/BeMaObRe-IJM-2018.pdf}{Published article}. \bibitem{bowman} D. Bowman (problem), P. Erd\H{o}s and A. M. Odlyzko (solution). Problem 6640 and solution. \emph{American Mathematical Monthly} 99 (1992), 276--277. \href{https://doi.org/10.2307/2325075}{Published solution}. \bibitem{bridoux} F. Bridoux, C. Crespelle, T. H. D. Phan, and A. Richard. Dividing sum of cycles in the semiring of functional digraphs. \emph{Natural Computing} 25, article 11, 2026. \href{https://doi.org/10.1007/s11047-026-10065-w}{Publisher}. \href{https://arxiv.org/abs/2504.11943v2}{arXiv:2504.11943v2}. The decomposition lemma also appears as Lemma~2 in their \href{https://webusers.i3s.unice.fr/~richard/PUBLICATIONS/CONFERENCES/2024_dividing_permutations.pdf}{AUTOMATA 2024 conference paper}, \emph{Dividing permutations in the semiring of functional digraphs}, LNCS 14782, 95--107. \bibitem{caigovorov} J.-Y. Cai and A. Govorov. The complexity of counting edge colorings for simple graphs. \emph{Theoretical Computer Science} 889, 14--24, 2021. \href{https://doi.org/10.1016/j.tcs.2021.07.033}{Publisher}. \bibitem{claude-sat} Claude (Anthropic). A \(2^{o(n)}\) time algorithm for 3-SAT. Hexagon preprint, 27 October 2026. \href{https://hexagonmath.org/2610.00577v1}{\texttt{hexagon:2610.00577v1}}. \bibitem{cpr-tensor} C. Crespelle, T. H. D. Phan, and A. Richard. Tensor product of functional graphs: algorithms for factorization and polynomial root-finding restricted to the cycle part. Preprint, 2025. \href{https://hal.science/hal-05392325v1}{HAL version 1}. \bibitem{cunningham} W. H. Cunningham and J. Geelen. On integer programming and the branch-width of the constraint matrix. \emph{IPCO 2007}, LNCS 4513, 158--166. \href{https://www.math.uwaterloo.ca/~whcunnin/bw.pdf}{Authors' copy}. \bibitem{dennunzio} A. Dennunzio, E. Formenti, L. Margara, and S. Riva. On solving basic equations over the semiring of functional digraphs. \emph{Discrete Mathematics \& Theoretical Computer Science} 27(3), article 6, 2025. \href{https://doi.org/10.46298/dmtcs.14590}{Publisher}. \bibitem{dore} F. Doré, K. Perrot, A. E. Porreca, S. Riva, and M. Rolland. Infinite trees for division and roots over finite discrete-time dynamical systems. \emph{Natural Computing} 25, article 16, 2026. \href{https://doi.org/10.1007/s11047-026-10068-7}{Publisher}. \bibitem{dress} A. W. M. Dress and C. Siebeneicher. The Burnside ring of the infinite cyclic group and its relations to the necklace algebra, \(\lambda\)-rings, and the universal ring of Witt vectors. \emph{Advances in Mathematics} 78 (1989), 1--41. \href{https://doi.org/10.1016/0001-8708(89)90027-3}{Publisher}. \bibitem{es} F. Eisenbrand and G. Shmonin. Carathéodory bounds for integer cones. \emph{Operations Research Letters} 34, 564--568, 2006. \href{https://doi.org/10.1016/j.orl.2005.09.008}{Publisher}. \bibitem{fomin} F. V. Fomin, F. Panolan, M. S. Ramanujan, and S. Saurabh. On the optimality of pseudo-polynomial algorithms for integer programming. \emph{Mathematical Programming} 198, 561--593, 2023. \href{https://doi.org/10.1007/s10107-022-01783-x}{Publisher}. \bibitem{gadouleau-johnson} M. Gadouleau and M. Johnson. Semirings of formal sums and injective partial transformations. Preprint, 2026. \href{https://arxiv.org/abs/2603.26508v1}{arXiv:2603.26508v1}. \bibitem{holyer} I. Holyer. The NP-completeness of edge-coloring. \emph{SIAM Journal on Computing} 10, 718--720, 1981. \href{https://doi.org/10.1137/0210055}{Publisher}. \bibitem{hunt} H. B. Hunt III, M. V. Marathe, V. Radhakrishnan, and R. E. Stearns. The complexity of planar counting problems. \emph{SIAM Journal on Computing} 27, 1142--1167, 1998. \href{https://doi.org/10.1137/S0097539793304601}{Publisher}. \bibitem{kannan} R. Kannan. Minkowski's convex body theorem and integer programming. \emph{Mathematics of Operations Research} 12(3), 415--440, 1987. \href{https://doi.org/10.1287/moor.12.3.415}{Publisher}. \bibitem{karp} R. M. Karp. Reducibility among combinatorial problems. In R. E. Miller and J. W. Thatcher (eds.), \emph{Complexity of Computer Computations}, 85--103, 1972. \href{https://doi.org/10.1007/978-1-4684-2001-2_9}{Publisher}. \bibitem{kuosa-np} N. Kuosa. Division of Explicit Finite Dynamical Systems Is NP-Complete. Hexagon preprint, 2026. \href{https://hexagonmath.org/2611.00886v1}{\texttt{hexagon:2611.00886v1}}. \bibitem{kuosa-fac} N. Kuosa. Finding Two Connected Factors of a Finite Dynamical System in Quasipolynomial Time. Hexagon preprint, 2026. \href{https://hexagonmath.org/2611.00849v1}{\texttt{hexagon:2611.00849v1}}. \bibitem{kuosa-support} N. Kuosa. How Many Cycle Lengths Can a Unique Quotient Require? Hexagon preprint, 2026. \href{https://hexagonmath.org/2611.00945v1}{\texttt{hexagon:2611.00945v1}}. \bibitem{lenstra} H. W. Lenstra, Jr. Integer programming with a fixed number of variables. \emph{Mathematics of Operations Research} 8 (1983), 538--548. \href{https://doi.org/10.1287/moor.8.4.538}{Publisher}. \bibitem{naquin} É. Naquin and M. Gadouleau. Factorisation in the semiring of finite dynamical systems. \emph{Theoretical Computer Science} 998 (2024), 114509. \href{https://doi.org/10.1016/j.tcs.2024.114509}{Publisher}. \bibitem{openai-sat} OpenAI. The exponential time hypothesis is false. Preprint, revised 25 October 2026. \href{https://github.com/openai/math/tree/main/preprints/The-Exponential-Time-Hypothesis-is-False-October-25-2026}{Manuscript and accompanying materials}. \bibitem{pr} A. E. Porreca and M. Rolland. Injective and pseudo-injective polynomial equations: from permutations to dynamical systems. 2026. \href{https://arxiv.org/abs/2604.04065v2}{arXiv:2604.04065v2}. \bibitem{rolland-thesis} M. Rolland. \emph{Des unrolls aux systèmes dynamiques totaux et partiels: algorithmes de résolution et énumérations des (in)équations polynomiales}. Doctoral thesis, Aix-Marseille Université, 2026, NNT 2026AIXM0179. \href{https://rollandmarius1.github.io/these.pdf}{Thesis}. \bibitem{tao-notes} T. Tao. 254A, Notes 4: Some sieve theory. 21 January 2015. \href{https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/}{Corollary 19}. \bibitem{taoteravainen} T. Tao and J. Teräväinen. Quantitative bounds for Gowers uniformity of the Möbius and von Mangoldt functions. \emph{Journal of the European Mathematical Society} 27, 1321--1384, 2025. \href{https://doi.org/10.4171/JEMS/1404}{Publisher}. \href{https://ems.press/content/serial-article-files/50199#page=18}{Lemma~5.1, p.~1338}. \end{thebibliography} \end{document}