\documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage{microtype} \usepackage{booktabs} \usepackage{xurl} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} \hypersetup{pdftitle={Set Cover by Cyclic Rotations Is NP-Complete},pdfauthor={Yuran Xiu}} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newcommand{\Z}{\mathbb Z} \newcommand{\N}{\mathbb N} \newcommand{\NP}{\mathsf{NP}} \newcommand{\FP}{\mathsf{FP}} \newcommand{\CC}{\mathsf{CyclicCover}} \newcommand{\bits}{\operatorname{bits}} \newcommand{\pair}{\operatorname{pair}} \newcommand{\wt}{\operatorname{wt}} \newcommand{\cl}{\operatorname{cl}} \newcommand{\res}[1]{\overline{#1}} \title{Set Cover by Cyclic Rotations Is NP-Complete} \author{Yuran Xiu\\ Institute for Interdisciplinary Information Sciences, Tsinghua University\\ \texttt{xiuyr23@mails.tsinghua.edu.cn}} \date{October 15, 2026} \begin{document} \maketitle \begin{abstract} Given an explicitly listed binary pattern of positive length $n$ and a nonnegative integer $b$ in binary, can at most $b$ cyclic rotations of the pattern cover all $n$ positions? We prove that this decision problem is NP-complete. The reduction constructs a pattern in a cyclic group of polynomial order and outputs its entire indicator word. Its principal ingredient is a replicated-marker construction: a cover within the budget must choose one translate in every layer, and each failed difference constraint leaves a block of more holes than the remaining translates can cover. Combining this construction with the known embedding of graph cliques into circulant graphs using distinct three-term sums gives a polynomial-time reduction from $3$SAT. The theorem allows every subset, including the empty pattern, and every binary budget. A Lean formalization checks the mathematical reduction, the full-word polynomial-time programs, NP membership, and the unconditional NP-hardness foundation. \end{abstract} \section{Introduction} \label{sec:introduction} Let $S$ be a subset of the cyclic group $\Z_n=\Z/n\Z$, where $n\geq 1$. Its translates are $S+t=\{s+t:s\in S\}$, for $t\in\Z_n$. The covering number is \[ \tau(S,\Z_n)=\min\{|T|:T\subseteq\Z_n,\ S+T=\Z_n\}, \] with value $+\infty$ if there is no cover. Thus the only pattern without a cover is $S=\varnothing$. All of the sets available to the covering algorithm are rotations of a single input pattern. This restriction is substantial: deleting a chosen set and the positions it covers generally does not leave an instance of the same form. Wirth introduced this problem as \emph{pattern rotation} in Section~2.7 of his dissertation~\cite{wirth}. He asked about its computational complexity and distinguished finding a minimum covering family from deciding a covering-number bound. The problem appeared again as Open Problem~4, \emph{Set-Cover by Rotations}, attributed to Anthony Wirth in the WADS 2023 open-problems collection~\cite{wads}. Covering numbers of this kind also form part of the broader study of covering groups by translates of a set; see Bollob\'as, Janson, and Riordan~\cite{bjr}. We settle the decision classification for an explicitly given pattern. \begin{theorem}\label{thm:main} The following language is NP-complete under polynomial-time many-one reductions: an instance consists of an explicitly listed word $s\in\{0,1\}^n$, with $n\geq1$, and a nonnegative integer $b$ encoded in binary; it is accepted precisely when, for $S=\{i\in\Z_n:s_i=1\}$, there exists $T\subseteq\Z_n$ such that \[ |T|\leq b \qquad\text{and}\qquad S+T=\Z_n. \] NP-hardness already holds for nonempty patterns and budgets $b\leq n$. \end{theorem} The pattern in this statement is the complete $n$-bit word. Its length is part of the input size; the theorem does not concern a succinct description of an exponentially long pattern. Neither nonemptiness of $S$ nor an upper bound on $b$ is a promise in the unrestricted language. The central construction is a reduction from cyclic difference constraints to translate covering. In $\Z_m\times\Z_L$, the template has one dense slice and $m-1$ sparse slices. The dense slice has blocks of $m$ holes. Each block represents a constraint between two chosen phases. A sufficiently large $L$ forces a cover of size at most $m$ to select exactly one translate in every layer. The markers are spaced so that a sparse slice covers either its entire intended block or at most one marker of a block. Consequently, $m-1$ unintended contributions cannot cover a failed block of $m$ holes. We choose $L\equiv1\pmod m$, so the product group is an ordinary cyclic group of order $mL$. To supply the difference constraints, we use the established three-sum-distinct clique embedding. Codenotti, Gerace, and Vigna used this method for circulant graphs~\cite{cgv}; Godsil and Rooney state and prove the corresponding finite abelian-group lemma~\cite[Lemma~6.1]{gr}. We give the required proof, including an explicit polynomial-size family of labels. The replicated-marker covering construction is the contribution of this paper; the clique embedding and the $3$SAT occurrence-graph reduction are credited ingredients. Sections~\ref{sec:language}--\ref{sec:reduction} give a mathematical proof and an explicit polynomial-time algorithm. Section~\ref{sec:formal} describes the checked language, its correspondence with the set formulation, and the formal reproduction evidence. \section{The encoded problem and NP membership} \label{sec:language} We fix a binary encoding to include malformed inputs and arbitrarily large budgets in the statement. For words $s$ and $\beta$, define $\pair(s,\beta)$ by doubling every bit of $s$ ($0\mapsto00$ and $1\mapsto11$), appending the separator $01$, and then appending $\beta$ verbatim. Its length is $2|s|+2+|\beta|$. Reading consecutive pairs from the start identifies the first field and separator uniquely. A word without this form is rejected. The second field is a little-endian binary numeral: \[ b(\beta)=\sum_{j=0}^{|\beta|-1}\beta_j2^j. \] The empty numeral represents zero, and redundant high zero bits are allowed. Reversing the numeral or using a conventional nonempty encoding of zero gives polynomial-time equivalent ordinary binary encodings. \begin{definition}\label{def:language} The language $\CC$ consists of the words $\pair(s,\beta)$ for which $n=|s|>0$ and there is a word $t\in\{0,1\}^n$ satisfying \begin{gather} \wt(t)\leq b(\beta),\label{eq:budget}\\ \forall x\in\{0,\ldots,n-1\}\ \exists i\in\{0,\ldots,n-1\}: \quad t_i=s_{(x+n-i)\bmod n}=1. \label{eq:bitcoverage} \end{gather} Here $\wt(t)$ denotes the number of ones in $t$. \end{definition} The word $t$ is the indicator of a set $T\subseteq\Z_n$. Its weight is $|T|$, and $(x+n-i)\bmod n$ represents $x-i$ in $\Z_n$. Therefore \eqref{eq:bitcoverage} is exactly $S+T=\Z_n$. A list of shifts with repetitions gives no stronger notion: deleting repetitions preserves its union and can only decrease its size. \begin{lemma}\label{lem:cap} For every $n\geq1$, $S\subseteq\Z_n$, and $b\in\N$, a cover with at most $b$ shifts exists if and only if one with at most $\min(b,n)$ shifts exists. The empty pattern is rejected at every budget, budget zero is rejected for every pattern, and every nonempty pattern is accepted when $b\geq n$. \end{lemma} \begin{proof} Every subset of $\Z_n$ has at most $n$ elements, which proves the first claim. If $S=\varnothing$ or $T=\varnothing$, then $S+T=\varnothing$, whereas $\Z_n\ne\varnothing$. If $s_0\in S$, every $x\in\Z_n$ belongs to $S+(x-s_0)$. Thus taking all $n$ shifts covers $\Z_n$. \end{proof} \begin{proposition}\label{prop:np} $\CC\in\NP$. \end{proposition} \begin{proof} Use the $n$-bit word $t$ as the certificate. Parse the two fields, reject malformed inputs and $n=0$, count $\wt(t)$, and test \eqref{eq:bitcoverage} for all $n^2$ pairs $(x,i)$. These operations have polynomial running time in the input length on a multitape Turing machine: indices have $O(\log(n+1))$ bits, and even sequential scans to access the specified bits incur only a polynomial overhead. The binary budget causes no large-integer expansion. Read its bits from most significant to least significant, starting with $q=0$, and update \[ q\longleftarrow\min(n,2q+c) \] when the next bit is $c$. Inductively $q$ is the decoded prefix capped at $n$, since $\min(n,2\min(n,u)+c)=\min(n,2u+c)$ for every $u\in\N$ and $c\in\{0,1\}$. All intermediate states have $O(\log(n+1))$ bits. The final comparison with $\wt(t)$ is correct by Lemma~\ref{lem:cap}. The certificate length is at most the input length, and all verification steps are polynomial in $n+|\beta|$. \end{proof} \section{Replicated markers realize difference constraints} \label{sec:markers} Fix integers $m\geq2$ and $D\geq0$. For each nonzero $d\in\Z_m$, let $A_d\subseteq[-D,D]\cap\Z$ be a given finite set. We will construct a single cyclic pattern whose covers of size at most $m$ are equivalent to assignments of phases $x_r$ satisfying \begin{equation}\label{eq:constraints} x_r-x_{r-d}\in\res{A_d}\quad (r\in\Z_m,\ d\in\Z_m\setminus\{0\}). \end{equation} Here and below a bar denotes reduction of an integer or integer set modulo the chosen positive integer $L$. \subsection{Construction and marker spacing} Set \begin{equation}\label{eq:markers} h=m(m-1),\qquad u_j=j+2hj^2\quad(0\leq j2H_{\max}+2D,\qquad L>m^2(2D+1),\qquad L>3D, \qquad L\equiv1\pmod m. \end{equation} Indeed, writing $Q=ma+r$ with $0\leq r0$. The markers are distinct in $\Z_L$: the $u_j$ increase strictly and all $Mu_j$ lie in $[0,H_{\max}]\subset[0,L)$. Thus the blocks in \eqref{eq:blocks} are disjoint and each has exactly $m$ elements. Define the template $S^*$ in $G=\Z_m\times\Z_L$ by its slices: \begin{equation}\label{eq:template} S_0=\Z_L\setminus H,\qquad S_d=H_d+\res{A_d}\quad(d\ne0),\qquad S^*=\{(d,y):y\in S_d\}. \end{equation} The slice $S_0$ is dense and the other slices are sparse. In particular, \begin{equation}\label{eq:sparsebound} |S_d|\leq m|A_d|\leq m(2D+1)\qquad(d\ne0). \end{equation} The template is nonempty, since $|H|=h3D$, and write the labels also for their residues when the group is clear. \begin{lemma}[Distinct three-term sums]\label{lem:b3} If $a,b,c,d,e,f\in\{1,\ldots,v\}$ and \[ g_a+g_b+g_c=g_d+g_e+g_f\quad\text{in }\Z_L, \] then the multisets $\{a,b,c\}$ and $\{d,e,f\}$ are equal. Repeated indices are allowed. \end{lemma} \begin{proof} All integer sums in question lie in $[0,3D]$, whose diameter is less than $L$. Their congruence is therefore an equality of integers. For each $r\in\{1,2,3\}$, a sum of three $r$th powers of indices is at most $3v^r\leq3v^3v$ output NO. Use Theorem~\ref{thm:graphreduction} in all remaining cases. These branches cover the empty graph and every natural $k$. An edgeless graph with $2\leq k\leq v$ has $A=\varnothing$ and is handled by the same construction: its difference constraints are impossible. Malformed graph encodings can be sent to the fixed NO instance after an explicit validity check. All outputs in this graph reduction have a positive-length, nonempty pattern and a budget no larger than their length. \subsection{Polynomial output and an explicit emitter} \begin{lemma}\label{lem:size} In the nontrivial branch $2\leq k\leq v$, the output length satisfies $N\leq422v^{16}$. \end{lemma} \begin{proof} Since $v\geq1$, \[ B\leq4v^3,\qquad D=v+Bv^2+B^2v^3\leq v+4v^5+16v^9\leq21v^9. \] Also $h=k(k-1)\leq v^2$ and $u_{h-1}<3h^3$. Since $D\geq1$, $M=2D+1\leq3D$ and \[ H_{\max}\leq9Dh^3\leq189v^{15}. \] The three terms in \eqref{eq:Q} are bounded respectively by $420v^{15}$, $63v^{11}$, and $63v^9$. Consequently \[ Q\leq420v^{15},\qquad L\leq Q+k+1\leq422v^{15},\qquad N=kL\leq422v^{16}. \] \end{proof} This length bound is accompanied by an actual algorithm for writing the full indicator. Use an explicit graph representation, for example a $v\times v$ adjacency matrix with its vertex count, so that $v$ is polynomially bounded by the source length. First check symmetry and the zero diagonal and handle the branches above. In the nontrivial branch, compute $B,D,h,M,Q,L,N$. For each integer $z=0,\ldots,N-1$, compute $r=z\bmod k$ and $y=z\bmod L$ and write the following bit: \begin{equation}\label{eq:emitter} \begin{cases} 1\ \Longleftrightarrow\ y\not\equiv Mu_j\pmod L \text{ for all }0\leq j