\section{Sides congruent to two modulo three} \label{sec:residue-two} For \(n=3k+2\) and \(k\geq 6\), put \[ T(k)=3k^2+7k,\qquad U(k)=T(k)-\left\lfloor\frac{k-5}{7}\right\rfloor . \] The residue-two formula is \begin{equation} P(3k+2)=U(k)-\mathbf{1}_{k\equiv 11\pmod {14}}. \label{eq:residue-two-value} \end{equation} The six smaller sides \(2,5,8,11,14,17\) have values \(2,11,27,49,77,110\), respectively. We give the lower construction and the unrestricted upper inequality first, then explain how equality in the integer upper bound is excluded on the exceptional progression. The finite checks used below are identified by their Lean interfaces. \subsection{Lower constructions and the period} The correction in \(U(k)\) has seven rounding phases. The construction also distinguishes the parity of \(k\): the advancing rows stop differently on sides \(6a+2\) and \(6a+5\). The pair \((k\bmod 7,k\bmod 2)\) repeats after \(14\) steps in \(k\), or \(42\) in the side length. Table~\ref{tab:residue-two-period} gives a sufficient construction period. \begin{table}[htbp] \centering \begin{tabular}{@{}cll@{}} \toprule \(k\bmod 7\) & \(k\) even & \(k\) odd\\ \midrule 0 & \(44\), delayed right front & \(23\), ordinary zipper\\ 1 & \(68\), delayed right front & \(47\), upper-left repair\\ 2 & \(50\), delayed right front & \(71\), upper-left repair\\ 3 & \(74\), delayed right front & \(53\), upper-left repair\\ 4 & \(56\), alternating bands & \(35\), rail (\(U(k)-1\))\\ 5 & \(38\), delayed right front & \(59\), ordinary zipper\\ 6 & \(62\), delayed right front & \(41\), ordinary zipper\\ \bottomrule \end{tabular} \caption{Starting sides \(b\) for the constructions on \(n=b+42t\), \(t\geq0\). The marked set has size \(U(k)\) except in the indicated odd cell.} \label{tab:residue-two-period} \end{table} The ordinary zipper uses rows of marks spaced three columns apart. The two outer arrays of vertical lines advance towards the middle; after the advancing rows, seven-row bands move the junction by one pitch of three columns at a time. The five bottom rows close the construction, with the last band possibly cut short. On adding \(42\) to the side, the ordinary construction has seven more advancing rows and five more seven-row bands. The upper-left repair shifts the marks along a segment of the advancing front and inserts a mark at its end. The delayed-right schedules omit the final right-front advance and use the even-width version of the repair, with an additional waiting row in the phase starting at \(38\). The alternating version moves the tip back and forth in successive bands and uses its own bottom closure. The exceptional rail is an ordinary layout with the ending prescribed for its phase. These are physical marking rules; their row predicates and end corrections are specified in \texttt{LowerZipper}. Figure~\ref{fig:zipper-rail} shows the ordinary zipper and the exceptional rail at their first widths. \begin{figure}[htbp] \centering \begin{tikzpicture}[x=2.45mm,y=-2.45mm,baseline=(example.base)] \drawmarkgrid{23}{ 11111111111111111111001, 00000000000000000000001, 00100100100100100100101, 10000100100100100100001, 10010000100100100001001, 10010010000100001001001, 10010010010001001001001, 10010010010001001001001, 10010010010101001001001, 10010010010001001001001, 10010010010001001001001, 10010010000101001001001, 10010010100001001001001, 10010010001001001001001, 10010010001001001001001, 10010010101001001001001, 10010010001001001001001, 10010010001001001001001, 10000000101001001001001, 10111100001001001001001, 10000001001001001001001, 00000000000000000000000, 11111111111111111111111 } \node (example) at (11,24) {\small Ordinary zipper, \(n=23\)}; \end{tikzpicture} \qquad \begin{tikzpicture}[x=1.61mm,y=-1.61mm,baseline=(example.base)] \drawmarkgrid{35}{ 11111111111111111111111111111111001, 00000000000000000000000000000000001, 00100100100100100100100100100100101, 10000100100100100100100100100100001, 10010000100100100100100100100001001, 10010010000100100100100100001001001, 10010010010000100100100001001001001, 10010010010010000100001001001001001, 10010010010010010001001001001001001, 10010010010010010001001001001001001, 10010010010010010101001001001001001, 10010010010010010001001001001001001, 10010010010010010001001001001001001, 10010010010010000101001001001001001, 10010010010010100001001001001001001, 10010010010010001001001001001001001, 10010010010010001001001001001001001, 10010010010010101001001001001001001, 10010010010010001001001001001001001, 10010010010010001001001001001001001, 10010010010000101001001001001001001, 10010010010100001001001001001001001, 10010010010001001001001001001001001, 10010010010001001001001001001001001, 10010010010101001001001001001001001, 10010010010001001001001001001001001, 10010010010001001001001001001001001, 10010010000101001001001001001001001, 10010010100001001001001001001001001, 10010010001001001001001001001001001, 10000000101001001001001001001001001, 10111100001001001001001001001001001, 10000001001001001001001001001001001, 00000000000000000000000000000000000, 11111111111111111111111111111111111 } \node (example) at (17,36.9) {\small Exceptional rail, \(n=35\)}; \end{tikzpicture} \caption{Optimal marked sets of sizes \(196\) and \(439\).} \label{fig:zipper-rail} \end{figure} \begin{proposition}[Construction certificate] \label{prop:residue-two-lower} For every \(k\geq6\) there is a marked set \(F\) with \(E(F)\) acyclic and \[ |F|=U(k)-\mathbf{1}_{k\equiv11\pmod{14}} . \] \end{proposition} \begin{proof} At \(k=6\) the separate side-\(20\) witness has \(150\) marks. For \(7\leq k\leq38\), the finite construction replay in \texttt{ResidueTwoLower} covers the stated scores, including the separate initial masks at \(26,29,32\), before the corresponding periodic layouts. For \(k\geq39\), each side is in exactly one chart of Table~\ref{tab:residue-two-period}. Direct counts of the row pieces, including the truncated band and the bottom closure, give the asserted size (\texttt{marks\_card\_eq\_squareScore}). For acyclicity, the uniform certificate uses layers of directed forced edges, where each forced edge is admitted in both directions at the initial layer. The terminal layer is empty. At each successive layer, a straight continuation in that layer implies membership of the preceding edge in the same layer, whereas a perpendicular continuation in the previous layer implies membership of the preceding edge in the successive one. Let \(r(e)\) be the number of intermediate layers containing the directed edge \(e\). For consecutive edges \(e,e'\) on a directed traversal, \[ r(e')\leq r(e)\quad\text{on a straight step},\qquad r(e')q\)}; \end{tikzpicture} \caption{The long-fan check. (a) The three runs repeat tiles with marks in the right, middle and left columns, respectively. The two breaks are fixed three-tile transition words, drawn in compressed form. (b) Schematic forced paths in the eastern suffix at the cut, with tile column \(t\). A path ending inside can be dropped above the cut only after checking that its upper component has no other crossing.} \label{fig:one-gap-fan} \end{figure} \begin{proof} The forced perimeter is now one path. An interior component can attach to it at most once, since two attachment edges together with the interior path and the intervening perimeter subpath would form a cycle. All perimeter stars are uncharged. The seven-layer certificate in \texttt{L7Exclusion} tests the two arms of the gap corner with their common junction; it excludes a charged patch even if the patch lies outside the tested arms. The full defect is therefore a star at an isolated, unmarked site. In the view furnished by \texttt{ShortSeed}, its zero-based coordinates are \((2,2+3q)\), where \(q\) is odd and \(1\leq q\leq k-2\). In these coordinates the northern tile of index \(j\), \(0\le jq\), with row-major bit indices starting at zero. The seed also retains the orientation with one owner for each forced edge. Here an owner is the endpoint whose arrow traverses that edge. For \(u=0,1,2\), the physical scans assembled in \texttt{ShortEarly} exclude all seed indices. For \(u\geq3\), the reduction is from a hypothetical equality board to an index \((u,q)\) in a finite list. The seed locates \(q\) on the north side, and the \emph{fan} is the pattern of marks forced below it in the normalized view. The geometric exclusions determine which indices can survive; the final finite check tests whether there are any such indices. \begin{itemize} \item For a long fan (\(q\geq57\)), a row of tiles has three runs separated by fixed transition words, as in Figure~\ref{fig:one-gap-fan}(a). Two consecutive rows of tiles determine the next row by a checked transition. As the tile-row index increases by one, the run lengths change by \((3,-6,3)\). Iteration up to \(Y=\lfloor(q-15)/6\rfloor\) exposes the eastern suffix of parallel forced paths. At the cut, these paths have two histories (Figure~\ref{fig:one-gap-fan}(b)): its columns through \(q\) have separate paths that end inside the board; its columns east of \(q\) lead to their own north attachments. The transfer to the next strip keeps track of this difference. A dangling path may be omitted above the cut only after checking it has no other crossing; a rooted path keeps its perimeter connection. \item Checked windows advance these fronts using the actual mark masks, edge owners and attachments where required. The admissible transfers are scheduled only with the appropriate margins. When a suffix reaches the checked south caps, its retained north connection is incompatible with the forced continuations at the cap. The width and height tests, together with the alternate collision and boundary cuts, restrict any remaining long failure to a finite list of index pairs \((u,q)\). \item For \(q<57\), short north scans, buffered rooted suffixes, and boundary and birth cuts supply the corresponding coverage. The last north-strip cuts are at \((u,q)=(3,49),(3,51)\). They retain the actual east and west boundary prices and read the dangling seals and the north connections at the row-nine cut in tile coordinates. At \(q=49\) the transfer starts at column \(26\); at \(q=51\) the plain suffix starts at \(27\) and a restart supplies the input for the longer transfer. Both lead to checked southern obstructions. \end{itemize} In \texttt{ScoredFanFailure}, the theorem \nolinkurl{failure_from_score} supplies the seed and a surviving obstruction on the same board. The theorem \nolinkurl{fanFailure_index} then puts its index in the list \texttt{pendingFanIndices}. The check \nolinkurl{pendingFanIndices_empty} verifies that this finite list is empty, which rules out the seed for every \(u\geq3\), including side \(161\). \end{proof} Propositions~\ref{prop:residue-two-two-gap} and~\ref{prop:residue-two-one-gap}, applied to Lemma~\ref{lem:residue-two-frame}, exclude the single candidate score \(U(k)\) on \(k\equiv11\pmod{14}\). At every other \(k\geq6\) Lemma~\ref{lem:residue-two-stencil} already gives the upper in \eqref{eq:residue-two-value}; Proposition~\ref{prop:residue-two-lower} supplies the matching lower in all phases, by Lemma~\ref{lem:forced}. For the small sides the proofs through side \(5\), the separate finite checks on sides \(8\) and \(11\), and direct stencil replays at \(14\) and \(17\) give the values stated above. The residue-two assembly is the branch of \texttt{GridGraphs.Results.SquareFormula} using these bounds and the empty fan index list.