%%================================================================== \section{Constructing the design}\label{sec:design} %%================================================================== The routine needs one row $\PP_{f,v}(T)$ per incidence. This section constructs the rows and the matrices $C_{t,g}$, the partitions $S_{t,g}$ and the group sequences $\sigma_f$ of Definition~\ref{def:design} from the scopes alone, following \cite[Section 4]{OAI26}. The difficulty is to keep $\deg\PP_{f,v}\le R$ with $R$ much smaller than $Q$: the degree of $H$ grows linearly in $R$, and a small $R/Q$ reduces the number of Taylor coefficients needed at each point. Rows chosen independently at the $Q$ points and interpolated would in general have degree $Q$. The construction instead produces, on a complete array of auxiliary coordinates, rows whose values at all points are controlled together, and then places each incidence in a copy of that array. \subsection{Incidences and auxiliary coordinates} Write $\mathcal I=\{(f,v):f\in\F,\ v\in I_f\}$, so $M=|\mathcal I|$, and let $w$ and $b$ be as in \eqref{eq:M}. A factor with empty scope is a constant and is assigned to group one at every point. If necessary adjoin a constant-one factor with scope $\{v\}$ for every $v\in[n]$; this changes neither the product nor the sum, and raises $b$ by at most one. With $b$ the bound after this step we assume \begin{equation}\label{eq:nMb} n\ge1,\qquad b,w\ge1,\qquad n\le M\le bn . \end{equation} Throughout, $r\ge2$ and $1\le R0$ the condition \begin{equation}\label{eq:tail} \Pr\Bigl[\Bin\Bigl(Q,\tfrac{r-1}{2r}\Bigr)\notin\mathcal J\Bigr]\le\epsilon \end{equation} gives $c^{\B}\le\epsilon D$; we shall use $\epsilon=\tau/(rb)$. \begin{lemma}\label{lem:mismatch} If $M_0[u,y]\ne0$ then $\#\{s\in[Q]:a_y(s)\ne\delta_u(s)\}\le R-1$.\footnote{Lemma 4.2 of \cite{OAI26}.} \end{lemma} \begin{proof} Expand $f_{\mathcal J}(W_0)$ in the commuting matrices $\Pi_s$. Since $\deg f_{\mathcal J}\le R-1$ and $\Pi_s^2=I$, each monomial is a scalar multiple of $\prod_{s\in K}\Pi_s$ for some $K\subseteq[Q]$ with $|K|\le R-1$, and $V_0\prod_{s\in K}\Pi_s=\prod_{s\notin K}\Pi_s$. A nonzero $(u,y)$ entry of this permutation matrix requires $a_y(s)=\delta_u(s)$ for every $s\notin K$, leaving at most $R-1$ positions where they may differ. If more than $R-1$ positions disagree, every summand has zero $(u,y)$ entry. \end{proof} \subsection{The auxiliary rows} For $M_0[u,y]\ne0$ put \begin{equation}\label{eq:phi} E_{u,y}=\{s\in[Q]:a_y(s)\ne\delta_u(s)\},\qquad \varphi_{u,y}(T)=\prod_{s\in E_{u,y}}\Bigl(1-\frac Ts\Bigr), \end{equation} the empty product being one; then $\deg\varphi_{u,y}\le R-1$, $\varphi_{u,y}(0)=1$, and $\varphi_{u,y}(t)=0$ whenever $a_y(t)\ne\delta_u(t)$. Define \begin{equation}\label{eq:Pu} \PP_u(T)=\e_u^{\top}(I-M_0)+\sum_{\substack{y\in\B\\ M_0[u,y]\ne0}}M_0[u,y]\,\varphi_{u,y}(T)\,\e_y^{\top}. \end{equation} \begin{lemma}\label{lem:rows} The rows \eqref{eq:Pu} have degree at most $R-1$ and $\PP_u(0)=\e_u^{\top}$. For $t\in[Q]$ and $g\in[r]$ let $C^{\B}_{t,g}$ be the restriction of $C^{\B}$ to the columns $S^{\B}_{t,g}$. For every $u$, $t$ and $g\ne\delta_u(t)$, and every $\xi\in\Q^{S^{\B}_{t,g}}$, \[ C^{\B}_{t,g}\xi=0\ \Longrightarrow\ \ip{\PP_u(t)}{\tilde\xi}=0 . \] More generally, $\ip{\PP_u(t)}{\zeta}$ is determined by $\zeta|_{S^{\B}_{t,\delta_u(t)}}$ and $C^{\B}\zeta$.\footnote{Lemma 4.3 of \cite{OAI26}.} \end{lemma} \begin{proof} The degree bound is that of the $\varphi_{u,y}$, and $\PP_u(0)=\e_u^{\top}(I-M_0)+\e_u^{\top}M_0=\e_u^{\top}$. Applying \eqref{eq:Pu} to $\zeta$, \begin{equation}\label{eq:Puzeta} \ip{\PP_u(T)}{\zeta}=\bigl((I-M_0)\zeta\bigr)_u+\sum_{M_0[u,y]\ne0}M_0[u,y]\varphi_{u,y}(T)\zeta_y . \end{equation} At $T=t$ every summand with $a_y(t)\ne\delta_u(t)$ vanishes, so the remaining summands involve only $y\in S^{\B}_{t,\delta_u(t)}$; if $\tilde\xi$ is supported on $S^{\B}_{t,g}$ with $g\ne\delta_u(t)$ they are zero on $\tilde\xi$. The hypothesis $C^{\B}_{t,g}\xi=0$ gives $C^{\B}\tilde\xi=0$, so $(I-M_0)\tilde\xi=0$ by Lemma~\ref{lem:CB}. For the last assertion, two vectors with the same value of $C^{\B}\zeta$ differ by an element of $\ker C^{\B}$, so $(I-M_0)\zeta$ is determined by $C^{\B}\zeta$, and the other terms at $T=t$ use only $\zeta|_{S^{\B}_{t,\delta_u(t)}}$. \end{proof} Fixing $t$ and writing $\zeta_g=\zeta|_{S^{\B}_{t,g}}$ we have $C^{\B}\zeta=\sum_gC^{\B}_{t,g}\zeta_g$, so fixing each of the $r$ vectors $C^{\B}_{t,g}\zeta_g$ fixes $C^{\B}\zeta$ while imposing separate conditions on the $r$ auxiliary groups; then $\ip{\PP_u(t)}{\zeta}$ depends on $\zeta|_{S^{\B}_{t,\delta_u(t)}}$ alone. \subsection{Choosing the groups} We now choose $(a_v)_v$ and $(\delta_f)_f$ and set $u_{f,v}=(a_v,\delta_f)$ for $(f,v)\in\mathcal I$. A label $u$ occurring $c_u$ times needs $c_u$ positions in distinct copies of the auxiliary array, so the number of copies is \begin{equation}\label{eq:h} h=\max_{u\in\B}c_u,\qquad c_u=\#\{(f,v)\in\mathcal I:u_{f,v}=u\}, \end{equation} and the actual variable groups $\{v:a_v(t)=g\}$ must be small. \begin{lemma}\label{lem:labels} Assume \eqref{eq:nMb}, let $D=r^{2Q}$ and suppose \begin{equation}\label{eq:balance} 2(b+w)D^2\le M,\qquad 2Qr^2\le n . \end{equation} One can choose $a_v,\delta_f\in[r]^{Q}$ deterministically, with $\delta_f\equiv1$ for factors of empty scope, such that \[ \max_{u\in\B}\#\{(f,v)\in\mathcal I:(a_v,\delta_f)=u\}\le\frac{2M}D,\qquad \#\{v:a_v(t)=g\}\le\frac{2n}r\quad(t\in[Q],\ g\in[r]), \] in $\poly(n,M,|\F|,D,Q,r,b,w)$ bit operations.\footnote{Lemma 4.5 of \cite{OAI26}.} \end{lemma} \begin{proof} First let all $a_v$, and all $\delta_f$ with nonempty $I_f$, be independent and uniform on $[r]^{Q}$; then each label $u_{f,v}$ is uniform on $\B$. Put $n_{t,g}=\#\{v:a_v(t)=g\}$ and \[ \Phi=\sum_{u\in\B}\Bigl(c_u-\frac MD\Bigr)^2,\qquad \Xi=\sum_{t=1}^{Q}\sum_{g=1}^{r}\Bigl(n_{t,g}-\frac nr\Bigr)^2 . \] Expanding the squares, \[ \Phi=\sum_{(f,v),(f',v')\in\mathcal I}\mathbf 1\{(a_v,\delta_f)=(a_{v'},\delta_{f'})\}-\frac{M^2}D,\qquad \Xi=\sum_{t=1}^{Q}\sum_{v,v'\in[n]}\mathbf 1\{a_v(t)=a_{v'}(t)\}-\frac{Qn^2}r . \] Two labels are independent unless they share a factor or a variable, and each $(f,v)$ shares one with at most $b+w$ incidences including itself. Independent pairs are equal with probability $1/D$, the others with probability at most one, so $\mathbb E\Phi\le M(b+w)$. For $v\ne v'$ the values $a_v(t),a_{v'}(t)$ are independent and uniform, so $\mathbb E\Xi=Qn(1-1/r)\le Qn$. To fix the choices deterministically, fix the $a_v$ and the $\delta_f$ with nonempty scope one at a time, each time choosing a value that does not increase the conditional expectation of $\Phi/(M(b+w))+\Xi/(Qn)$; such a value exists because the current expectation is the average over the possible values of the next choice. The final value is at most two, and both summands are nonnegative, so \[ c_u\le\frac MD+\sqrt{2M(b+w)},\qquad n_{t,g}\le\frac nr+\sqrt{2Qn}. \] The inequalities \eqref{eq:balance} bound the square roots by $M/D$ and $n/r$. For the cost, put $K=r^{Q}$, so $D=K^2$. Each indicator in $\Phi$ depends on at most four of the choices $a_v,\delta_f,a_{v'},\delta_{f'}$, and each indicator in $\Xi$ on at most two. After any partial fixing, the conditional probability of an indicator is computed by enumerating at most $K^4=D^2$ values of the unfixed choices it involves, and has denominator dividing $K^4$. Summing the $M^2+Qn^2$ indicators gives both expectations, with all rationals of $O(\log(2D)+\log(2M)+\log(2n)+\log(2Q)+\log(2+b+w))$ bits. There are at most $n+|\F|$ choices to fix, each with $K$ candidates. \end{proof} \subsection{Placing copies of the variables} Assume \eqref{eq:balance} and apply Lemma~\ref{lem:labels}. Index $h$ copies of the auxiliary array by $[h]\times\B$, and assign to each $(f,v)\in\mathcal I$ a copy $c(f,v)\in[h]$ so that the positions $(c(f,v),u_{f,v})$ are distinct; this is possible since no label occurs more than $h$ times, and \begin{equation}\label{eq:hD} hD\le 2M\le 2bn . \end{equation} Define $\iota:\Q^n\to\Q^{[h]\times\B}$ by $(\iota x)_{c,u}=x_v$ if $(c,u)=(c(f,v),u_{f,v})$ for some $(f,v)\in\mathcal I$, and $0$ otherwise; the occupied positions are distinct, so this is well defined. Several positions may contain the same $x_v$, and unused positions are zero. Let $\pi_c:\Q^{[h]\times\B}\to\Q^{\B}$ be the projection onto the copy $c$. Put \begin{equation}\label{eq:Pfv} \PP_{f,v}(T)=\PP_{u_{f,v}}(T)\,\pi_{c(f,v)}\,\iota,\qquad S_{t,g}=\{v:a_v(t)=g\},\qquad \sigma_f(t)=\delta_f(t). \end{equation} At $T=0$ the row $\PP_{f,v}$ extracts the content of position $(c(f,v),u_{f,v})$, which is $x_v$; so $\PP_{f,v}(0)=\e_v^{\top}$, and its degree is at most $R-1$. Lemma~\ref{lem:labels} gives $|S_{t,g}|\le 2n/r$. Define \begin{equation}\label{eq:Ctg} \widetilde C=\diag(C^{\B},\dots,C^{\B})\ \ (h\text{ copies}),\qquad \widehat C=\widetilde C\iota,\qquad C_{t,g}=\widehat C|_{S_{t,g}}, \end{equation} the restriction keeping the columns in $S_{t,g}$ and all rows. Thus $\widehat Cx$ records the auxiliary measurements in every copy after the copies have been filled from $x$. Each row of $\widetilde C$ has at most $D$ nonzero entries, all $\pm1$; multiplication by $\iota$ adds entries lying in a common column and discards unused positions, so every row of $C_{t,g}$ has sum of absolute values at most $D$, and its value on a Boolean vector lies in $[-D,D]\cap\Z$. If \eqref{eq:tail} holds, each $C_{t,g}$ has $hc^{\B}$ rows, and \begin{equation}\label{eq:ctg} \sum_{g=1}^{r}c_{t,g}=rhc^{\B}\le rh\epsilon D\le 2r\epsilon M\le 2r\epsilon bn, \end{equation} which with $\epsilon=\tau/(rb)$ is at most $2\tau n$. For the kernel condition fix $t$, $g\ne\sigma_f(t)$ and $(f,v)$, and let $\xi\in\Q^{S_{t,g}}$ with $C_{t,g}\xi=0$. Then $\widetilde C\iota\tilde\xi=0$, so $C^{\B}\pi_c\iota\tilde\xi=0$ for every copy $c$. Every nonzero coordinate of $\pi_c\iota\tilde\xi$ contains a variable $v'$ with $a_{v'}(t)=g$, whose label has first sequence $a_{v'}$, so this vector is supported on $S^{\B}_{t,g}$. Lemma~\ref{lem:rows} in the copy $c(f,v)$, where $\delta_{u_{f,v}}(t)=\delta_f(t)=\sigma_f(t)\ne g$, gives $\ip{\PP_{f,v}(t)}{\tilde\xi}=\ip{\PP_{u_{f,v}}(t)}{\pi_{c(f,v)}\iota\tilde\xi}=0$, which is \eqref{eq:kernel}. All inputs of a factor use the group $\delta_f(t)$, and the sum still ranges over exactly the $n$ Boolean variables. \subsection{Coefficient bounds} \begin{lemma}\label{lem:coeff} Let $d_{\mathrm{den}}=(R-1)!\,Q!$. Then $d_{\mathrm{den}}\PP_u(T)\in\Z[T]^{1\times\B}$ for every $u$, and the sum of the absolute values of all coefficients of $d_{\mathrm{den}}\PP_u(T)$ is $2^{O(Q\log Q)}$. The same holds for $d_{\mathrm{den}}\PP_{f,v}(T)$. The matrices $M_0$, $C^{\B}$ and the rows can be constructed in $\poly(D,Q,r)$ bit operations.\footnote{Lemma 4.6 of \cite{OAI26}.} \end{lemma} \begin{proof} For $0\le j2^{\lambda-1}$. Put \[ \mu=\frac{Q(r-1)}{2r},\qquad A_0=\Bigl\lfloor\mu-\frac{R-1}2\Bigr\rfloor,\qquad \mathcal J=\{A_0,\dots,A_0+R-1\}. \] Then $Q/4\le\mu\le Q/2$, and since $R\le Q/6$ the interval lies in $\{0,\dots,Q\}$; its centre is within one of $\mu$, and $R\ge32$ makes it contain every integer within $R/4$ of $\mu$. For $\mathsf W\sim\Bin(Q,\frac{r-1}{2r})$, Hoeffding's inequality \eqref{eq:hoeffding} with $s=R/4$ gives \[ \Pr[\mathsf W\notin\mathcal J]\le2e^{-R^2/(8Q)}\le2e^{-16(\beta+3)^2\nu} \le2^{-(\beta+2)\nu}\le\lambda^{-(\beta+2)}\le\frac1{br^2\lambda}, \] using $R^2/(8Q)\ge(\beta+3)^2\lambda\cdot128\nu/(8\lambda)=16(\beta+3)^2\nu$, $b\le\lambda^\beta$ and $r^2\le\lambda$. This is \eqref{eq:tailreq} with $\epsilon=\tau/(rb)$, and $0<\tau\le1/2$ once $r\ge2$. Finally $R/Q=O_\beta(\nu/\sqrt\lambda)$, $\log(2Q/R)=O(\nu)$ and $\tau\log(2D+1)=O(1/r)$, while $1/r=O(\nu^2/\sqrt\lambda)$, which proves \eqref{eq:costs}. For the computation, $\lambda$ is the least integer with $n\le2^\lambda$ and $\nu$ the least with $\lambda\le2^\nu$; $r$ is the largest integer with $r^2\nu^4\le\lambda$, $Q$ is an integer division, and $\lceil\sqrt\lambda\rceil$ comes from an integer square root. The algorithm reports failure if $r<2$ or $Q\le R$; otherwise it forms $\tau,\epsilon,D$ and the endpoints of $\mathcal J$ in rational arithmetic and checks $\mathcal J\subseteq\{0,\dots,Q\}$, \eqref{eq:balance}, $R\ge32$, $6R\le Q$, and \eqref{eq:tailreq}, whose left side has denominator $(2r)^Q$ and is an exact rational computation. All of this takes $\poly_\beta(\log n)$ bit operations, and the estimates above show that every check passes for large $n$. \end{proof}