Introduction and results

A princess moves through a building every night. Each morning a searcher may open several doors. The princess knows the search plan, may start anywhere, and must move to an adjacent room after each unsuccessful day. The problem is to guarantee capture as quickly as possible. Even on a single corridor the answer has a parity correction: dividing the amount of uncertainty by the apparent daily progress is not always enough.

This is a minimum-time version of the Hunters and Rabbit game. A path PnP_n has nn vertices, and Pn1PndP_{n_1}\mathbin{\square}\cdots\mathbin{\square}P_{n_d} denotes the Cartesian box with those side lengths. Write Tm(G)T_m(G) for the optimal guaranteed number of inspection days, with value \infty when no finite guarantee exists. Section 2 specifies the order of inspection and compulsory movement precisely.

How the results fit together

The general two-dimensional results precede their narrow-grid specializations. Odd rectangles have exact compatible neighborhood profiles and an exact two-count search recurrence. At every feasible budget, Theorem 6.1 reduces their optimal time to 2τ12\tau-1 or 2τ2\tau, using one explicit solo recurrence; Theorem 7.1 decides between those values with state and arithmetic-stage bounds depending only on width and budget. The simpler scalar rule is now proved for all sufficiently long odd rectangles at every feasible budget (Theorem 7.5). At the minimum budget, Theorem 21.1 gives Tb+1(P2b+1Pn)=2(2b+1)nC2b+1T_{b+1}(P_{2b+1}\mathbin{\square}P_n)=2(2b+1)n-C_{2b+1} for every odd n2b+1n\ge2b+1, with a width-only constant evaluated in O(b)O(b) stages. The remaining scalar-rule question is confined to shorter rectangles at intermediate budgets. For every even-area rectangle, Theorem 9.1 gives its exact neighborhood profile without assuming dynamic nesting. Theorems 8.1, 11.3, and 13.1 give closed optimal-time formulas for all side parities above their stated quadratic budget thresholds. For every even-area rectangle, the physical interface theorem 25.1 supplies an exact finite local description at every feasible budget. Its more general statement covers even-area cylinders with bipartite Hamiltonian cross-sections. Theorem 12.3 and its balanced height construction evaluate the interior connections explicitly; the finite boundary graph retains the remaining shared-budget choices.

The corner analysis has a common capacity formula: Ch(s)=max{s(s1)/2,s(sh)}C_h(s)=\max\{s(s-1)/2,s(s-h)\} is the largest quadrant support of surplus at most ss after its first permitted diagonal is fixed at height hh. Theorem 10.1 applies it to prescribed corner omissions in even-width half-strips. Efficient small survivors are forced into specific triangles, yielding lower bounds on the time before the opposite corner can become possible again.

The narrower complete classifications below retain the low-budget cases not covered by those uniform theorems. Their overlapping proofs are replaced by specializations wherever possible. The later box and cylinder sections preserve the higher-dimensional results, while the formalization section states precisely which ordinary proofs have complete Lean counterparts. None of these results is presented as a complete explicit solution for all rectangles at all budgets. In particular, the finite interface theorem can require large preprocessing as width and budget grow. Its contribution is an exact geometric normal form and strategy reconstruction; it is not a claim of a practical implementation for every input or an asymptotic improvement over the previous effective eventual-period theorem.

The exact narrow-grid formulas

On a path, Tm(Pn)=1T_m(P_n)=1 if nmn\le m. With one inspection per day, T1(P2)=2T_1(P_2)=2 and T1(Pn)=2n4T_1(P_n)=2n-4 for n3n\ge3. For n>m2n>m\ge2, Tm(Pn)=2n42m1+ε, T_m(P_n)=\left\lceil\frac{2n-4}{2m-1}\right\rceil+\varepsilon, (1) where ε=1\varepsilon=1 exactly when nm+1(mod2m1)n\equiv m+1\pmod{2m-1} and n,mn,m are not both even. This theorem is the domain-corrected result of the author’s original 2019–2020 work. We give a shorter construction and a matching-based lower proof, and formalize the complete statement in Lean.

For two rows and n2n\ge2, one daily inspection is insufficient, and m2nm\ge2n gives one day. In the remaining range put N=n1N=n-1, M=m1M=m-1. Then Tm(P2Pn)=2NM+1{M even and NM/2(modM)}. T_m(P_2\mathbin{\square}P_n)=\left\lceil\frac{2N}{M}\right\rceil+\mathbf{1}_{\{M\text{ even and }N\equiv M/2\pmod M\}}. (2)

For three rows and n2n\ge2, the one-day threshold is 3n3n, the two-day threshold is 3n/2\left\lfloor 3n/2\right\rfloor, and one inspection is insufficient. For 2m<3n/22\le m<\left\lfloor 3n/2\right\rfloor, write 3n4=q(2m3)+r3n-4=q(2m-3)+r, 0r<2m30\le r<2m-3. The answer is {2q,r=0,2q+1,r>0 and mr+41{n even, q odd},2q+2,otherwise. \begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }m\ge r+4-\mathbf{1}_{\{n\text{ even},\ q\text{ odd}\}},\\ 2q+2,&\text{otherwise}. \end{cases} (3)

For four rows and n4n\ge4, the one-day threshold is 4n4n, the two-day threshold is 2n2n, and budgets at most two are insufficient. For 3m<2n3\le m<2n, write 2n2=q(m2)+r2n-2=q(m-2)+r, 0r<m20\le r<m-2. The answer is {2q,r=0,2q+1,r=1 or (r2 and m2r+4),2q+2,otherwise. \begin{cases} 2q,&r=0,\\ 2q+1,&r=1\text{ or }(r\ge2\text{ and }m\ge2r+4),\\ 2q+2,&\text{otherwise}. \end{cases} (4) Rotating a shorter four-row board reduces it to a preceding family. In particular the minimum feasible budgets give T2(P3Pn)=6n8T_2(P_3\mathbin{\square}P_n)=6n-8 and T3(P4Pn)=4n4T_3(P_4\mathbin{\square}P_n)=4n-4 in their stated nondegenerate ranges. For five rows and n5n\ge5, the minimum feasible budget is three, and T3(P5Pn)=10n20. T_3(P_5\mathbin{\square}P_n)=10n-20. (5) The even-length proof uses a finite symbolic boundary certificate valid for every length, together with a history-dependent potential. The odd-length proof follows from the explicit neighborhood profiles. For every even n6n\ge6, putting h=5n/2h=5n/2 also gives T4(P5Pn)=22h83.T_4(P_5\mathbin{\square}P_n)=2\left\lceil\frac{2h-8}{3}\right\rceil. Theorem 19.5 gives a closed quotient-and-remainder formula for every larger budget on these even-length boards. Theorem 19.7 supplies the closed answer for every odd length as well. In particular, four inspections per day take 2(5n9)/3+21{3n}2\left\lceil(5n-9)/3\right\rceil+2\mathbf{1}_{\{3\mid n\}} days when n5n\ge5 is odd. Together with rotation of shorter boards, these give explicit formulas and attaining strategies for every five-row board and every budget. The wider odd-rectangle theorem extends the closed analysis to every width 2b+12b+1 when mb2+1m\ge b^2+1.

Optimal time at the smallest feasible daily budget for four narrow families and the five-row three-probe theorem. Each line is a proved formula, not a fit to search data.

The structural results

The common difficulty is temporal. A small possible-position set may have a particularly favorable next neighborhood, but that neighborhood need not contain an equally favorable set for the following day. We retain a history bit where necessary, and also prove a more general comparison theorem. A monotone, cardinality-preserving set map CC with N(C(A))C(N(A))N(C(A))\subseteq C(N(A)) compresses a whole strategy without increasing any day’s inspection budget. Idempotent maps supply an exact optimal-strategy normal form. This assertion is stronger than a one-step isoperimetric inequality.

We construct such operators from odd paths and square diagonal shifts. They give exact recurrences on smaller families of states in arbitrary dimension. More strongly, on every box whose side lengths are all odd, we prove that the restricted simplicial orders minimize open neighborhoods and that neighborhoods of prefixes are prefixes. An induction using fiber compressions and a weighted exchange lemma reduces the unrestricted game to two cardinalities. The resulting exact algorithm is polynomial in the number of rooms and returns an optimal schedule. A recurrence remains distinct from a closed expression: the general box problem is not declared solved by the existence of an exponential search over all possible-position sets.

The three-dimensional example has a particularly concise answer: m0 ⁣: ⁣4567 ⁣: ⁣89 ⁣: ⁣111213 ⁣: ⁣2627 or moreTm(P33)181064321.\begin{array}{c|rrrrrrrr} m&0\!:\!4&5&6&7\!:\!8&9\!:\!11&12&13\!:\!26&27\text{ or more}\\\hline T_m(P_3^3)&\infty&18&10&6&4&3&2&1. \end{array} Its complete lower and upper proofs are checked in Lean. A separate height construction proves h(P3P3Pn)=5h(P_3\mathbin{\square}P_3\mathbin{\square}P_n)=5 for n3n\ge3, where h(G)h(G) is the minimum feasible daily budget. Moreover, Theorem 23.5 gives the exact time 18n3618n-36 at that budget for every n3n\ge3, of either parity.

The even cube P43P_4^3 is also completely classified, with physical Lean proofs at every budget. Eight inspections per day require exactly forty days; nine require twenty. Its eight-probe lower bound retains the shape of the possible-position set: using only its cardinality would falsely suggest thirty-two days. The complete tables for P43P_4^3 and P3P4P4P_3\mathbin{\square}P_4\mathbin{\square}P_4 appear in Theorem 23.4.

For a fixed bipartite Hamiltonian cross-section HH of order AA, every sufficiently long cylinder has hunting number A/2+1\left\lfloor A/2\right\rfloor+1. For each fixed m>A/2m>A/2, its optimal time is 2An/(2mA)+OA,m(1)2An/(2m-A)+O_{A,m}(1), with no restriction on side parity. For every transverse Cartesian box we prove more: the exact time has an effective eventual affine period for both longitudinal parities. Efficient searches must have one of finitely many translated frontiers; controlling the remaining days permits insertion and deletion of a physical interval in any optimal strategy. A separate fixed-deadline theorem applies to every finite cross-section: the smallest budget for capture within tt days is An/tAn/t plus an eventually periodic correction. These are distinct parameter regimes, and neither substitutes for a uniform closed formula for all boxes, budgets, and deadlines.

Prior work and provenance

Britnell and Wildon (Britnell and Wildon 2013) studied the princess puzzle with one daily inspection, including the path value 2n42n-4. Haslegrave studied the associated evasion game (Haslegrave 2014); related moving- target search appears in Beluhov and Kolev (Beluhov and Kolev 2017). Abramovskaya, Fomin, Golovach, and Pilipczuk (Abramovskaya et al. 2016) developed Hunters and Rabbit results, including the rectangular-grid feasibility threshold min(a,b)/2+1\left\lfloor\min(a,b)/2\right\rfloor+1. Bolkema and Groothuis proved isoperimetric nesting and the hunting number for hypercubes (Bolkema and Groothuis 2019). We use precise versions of these results; minimum-time claims do not follow from feasibility alone. Parity-restricted boundary minimization on the binary cube goes back to Körner and Wei (Körner and Wei 1984). Compression proofs and local-to-global principles have a substantial earlier literature, including Bezrukov and Serra (Bezrukov and Serra 2002); their closed-neighborhood theorem is distinct from the open-neighborhood argument given here.

Dmitry Kamenetsky recorded conjectural two- and three-inspection path formulas in March 2018 (Kamenetsky 2018a, 2018b). Equation (1) proves those special cases and extends them to arbitrary budgets. The author’s independent path work took place between October 2019 and March 2020 and was written in two Bulgarian conference manuscripts (Raychev and Rusev 2020; Raychev 2020). The one-probe restriction omitted from a printed general formula is made explicit here. The original conference documents are preserved.

The time-budget inverse parameter is also considered in recent work (Ben-Ameur et al. 2026); we do not claim the general optimization question as new. Recontamination can matter substantially on general graphs (Dissaux et al. 2025), so a presumed monotone search is never used as an unproved lower-bound assumption. Classical closed-neighborhood isoperimetry for Cartesian grids (Otachi and Suda 2011) supplies one of our higher-dimensional applications. Our use of that theorem is distinguished from the open-neighborhood argument for odd rectangles.

Remark 1.1 (Status of this manuscript). This is a research manuscript in preparation, not an arXiv submission. The ordinary theorems have internal independent proof reviews; exact Lean coverage is stated in Section 27. Attribution of the 2026 extensions is still undergoing a focused literature review. The manuscript makes no blanket claim that every derived ingredient is new to the literature.

The game and its possible positions

Let G=(V,E)G=(V,E) be a finite simple graph without isolated vertices, and let m1m\geq1 be the daily inspection budget. Every connected board with at least two rooms satisfies this graph assumption; a one-room board takes one inspection and is treated separately. The target chooses an unknown initial vertex. On day t=1,2,t=1,2,\ldots, the searcher inspects a set StVS_t\subseteq V with Stm|S_t|\leq m. If the target occupies a vertex of StS_t, it is caught. Otherwise it must move along exactly one edge before the next day. Inspections within a day are simultaneous. The searcher receives no information about an unsuccessful inspection other than the miss.

Write Tm(G)T_m(G) for the minimum number of days in which capture can be guaranteed, and put Tm(G)=T_m(G)=\infty if there is no finite guarantee. The associated feasibility threshold is h(G)=min{m1:Tm(G)<}.h(G)=\min\{m\geq1:T_m(G)<\infty\}. We consider deterministic guarantees. Before capture, every observation is a miss. Thus an adaptive strategy has only one continuing observation history and is represented by a sequence (St)t1(S_t)_{t\geq1}. This sequence formulation does not restrict the searcher’s guaranteed performance.

For AVA\subseteq V, its open neighborhood is N(A)={vV:some uA satisfies uvE}.N(A)=\{v\in V:\text{some }u\in A\text{ satisfies }uv\in E\}. Define the possible-position sets immediately before inspection by B1=V,Bt+1=N(BtSt).B_1=V,\qquad B_{t+1}=N(B_t\setminus S_t). The following elementary interpretation is used in every subsequent argument.

Lemma 2.1. For each t1t\geq1, a vertex vv belongs to BtB_t if and only if there is a walk v1,,vt=vv_1,\ldots,v_t=v in GG such that viSiv_i\notin S_i for every 1i<t1\leq i<t. Consequently capture is guaranteed by day tt exactly when BtStB_t\subseteq S_t.

Proof. The assertion about walks follows by induction. At t=1t=1 every vertex is an admissible initial position. For the inductive step, vBt+1v\in B_{t+1} means that some neighbor uBtu\in B_t avoids StS_t. Append vv to a walk ending at uu supplied by the induction hypothesis. Conversely, the penultimate vertex of any such walk belongs to BtStB_t\setminus S_t, so its final vertex belongs to Bt+1B_{t+1}.

A walk ending outside StS_t avoids all inspections through day tt, whereas every surviving walk is caught that day if its endpoint lies in StS_t. This is exactly the stated inclusion. ◻

Since GG has no isolated vertices, a nonempty set has a nonempty open neighborhood. Hence the capture condition is also equivalent to Bt+1=B_{t+1}=\varnothing. We use this equivalent form only under that hypothesis. A board with a single room is handled directly: one inspection on the first day suffices. Thus an inability to make a move is never silently treated as capture.

Two monotonicity observations will be useful. Starting from fewer possible positions cannot make a fixed inspection sequence less successful, and adding inspected vertices cannot make it less successful. Both follow by induction from monotonicity of NN and set difference in their respective arguments. In particular, probes outside the current possible-position set may be wasted, but they cause no problem for the model or the lower bounds.

Two initial parity classes

Suppose GG is bipartite, with vertex classes V0,V1V_0,V_1. Keep track of the two possible initial colors separately: R1s=Vs,Rt+1s=N(RtsSt),s{0,1}.R^s_1=V_s,\qquad R^s_{t+1}=N(R^s_t\setminus S_t),\qquad s\in\{0,1\}. Then Bt=Rt0˙Rt1,RtsVs+t1(mod2).B_t=R^0_t\mathbin{\dot\cup}R^1_t, \qquad R^s_t\subseteq V_{s+t-1\pmod2}. Indeed, neighborhood and deletion distribute over unions, and every edge reverses color. The two sets therefore stay disjoint while exchanging their current colors each night. Allocations to the two initial classes sum to at most the day’s inspection budget. We will state explicitly whether a pair of counts is indexed by initial color or by current color; the latter convention swaps the two counts after every move.

This separates the bookkeeping common to the path, ladder, and grid arguments. The work specific to a graph is to determine how small a neighborhood can be after a given number of inspections, and when a sequence of such bounds can actually be attained.

Compressing entire strategies

An isoperimetric inequality bounds one neighborhood. To preserve an optimal search, the replacement sets must also respect containment and remain compatible after successive moves. The following criterion provides that stronger conclusion.

Definition 3.1. A strategy compression on GG is a map C:2V2VC:2^V\to2^V satisfying AB    C(A)C(B),C(A)=A,N(C(A))C(N(A)).\begin{aligned} A\subseteq B&\implies C(A)\subseteq C(B), \\ |C(A)|&=|A|, \\ N(C(A))&\subseteq C(N(A)). \end{aligned}(6, 7, 8) Idempotence is an additional property, not part of this definition.

Theorem 3.2 (Strategy comparison and a fixed-state normal form). Let CC be a strategy compression. Every successful strategy from AA with prescribed daily budgets m1,,mTm_1,\ldots,m_T has a successful strategy from C(A)C(A) with the same budgets. If CC is idempotent, every starting set fixed by CC has an optimal strategy whose possible-position sets and post-inspection survivor sets are all fixed by CC.

Proof. Let AtA_t be the original possible-position set before day tt, and RtR_t its survivors, so At+1=N(Rt)A_{t+1}=N(R_t) and AtRtmt|A_t|-|R_t|\leq m_t. Maintain a new actual possible-position set BtC(At)B_t\subseteq C(A_t), initially B1=C(A1)B_1=C(A_1). Inspect Qt=BtC(Rt).Q_t=B_t\setminus C(R_t). Monotonicity and equal cardinalities give QtC(At)C(Rt)=AtRtmt.|Q_t|\leq |C(A_t)\setminus C(R_t)|=|A_t|-|R_t|\leq m_t. The new survivors are BtC(Rt)B_t\cap C(R_t), and Bt+1=N(BtC(Rt))N(C(Rt))C(N(Rt))=C(At+1).B_{t+1}=N(B_t\cap C(R_t)) \subseteq N(C(R_t))\subseteq C(N(R_t))=C(A_{t+1}). When the original survivors are empty, C(Rt)=C(R_t)=\varnothing, so the new strategy also captures every remaining possibility.

Fixed sets are closed under intersections: if X,YX,Y are fixed, monotonicity gives C(XY)XYC(X\cap Y)\subseteq X\cap Y, and cardinality forces equality. They are closed under neighborhoods for the same reason: N(X)C(N(X))N(X)\subseteq C(N(X)) when XX is fixed. If CC is idempotent, C(Rt)C(R_t) is fixed. Starting the preceding construction from a fixed B1B_1, every actual survivor BtC(Rt)B_t\cap C(R_t) and every next possible-position set is therefore fixed. Restricted strategies are actual strategies, so their optimum equals the unrestricted optimum. ◻

Products and simultaneous compression

Lemma 3.3 (Product lift). A strategy compression on a graph AA lifts to AHA\mathbin{\square}H by applying it separately in every HH-indexed AA-fiber. Idempotence is preserved.

Proof. Write ShS_h for the fiber at hh. Its neighborhood is N(S)h=NA(Sh)uhSu.N(S)_h=N_A(S_h)\cup\bigcup_{u\sim h}S_u. For the lifted operator C^\widehat C, the corresponding neighborhood is N(C^(S))h=NA(C(Sh))uhC(Su)C(NA(Sh))uhC(Su)C(NA(Sh)uhSu).\begin{aligned} N(\widehat C(S))_h &=N_A(C(S_h))\cup\bigcup_{u\sim h}C(S_u)\\ &\subseteq C(N_A(S_h))\cup\bigcup_{u\sim h}C(S_u)\\ &\subseteq C\left(N_A(S_h)\cup\bigcup_{u\sim h}S_u\right). \end{aligned} The last inclusion uses monotonicity separately on each input subset of the union. Cardinality, monotonicity and idempotence hold fiber by fiber. ◻

Compositions of strategy compressions are strategy compressions, since N(C(D(S)))C(N(D(S)))C(D(N(S))).N(C(D(S)))\subseteq C(N(D(S)))\subseteq C(D(N(S))). Suppose finitely many such operators strictly decrease a common nonnegative integer potential whenever they change a set. If that potential has a uniform upper bound BB, cycling through all operators B+1B+1 times reaches a common fixed point for every input. A cycle with a change decreases the potential, and a cycle without a change fixes every operator. The resulting map is a composition with a uniform number of factors, hence is monotone and cardinality preserving; it is also idempotent. This avoids assuming that an input-dependent stopping rule preserves monotonicity.

Odd path fibers

Lemma 3.4 (Odd-path compression). On P2q+1P_{2q+1}, q1q\geq1, number vertices 0,,2q0,\ldots,2q. Replace the selected vertices of each parity by the same number of vertices at the beginning of 0,2,,2qor1,3,,2q1.0,2,\ldots,2q\qquad\text{or}\qquad1,3,\ldots,2q-1. This is an idempotent, parity-preserving strategy compression.

Proof. Monotonicity, cardinality and idempotence follow from the definition. An even-parity kk-set has at least min(k,q)\min(k,q) odd neighbors. If kqk\leq q, omit an unselected even vertex 2j2j and match 2i2i to 2i+12i+1 for i<ji<j, and to 2i12i-1 for i>ji>j. These matches are distinct and include every selected even vertex. If k=q+1k=q+1, all qq odd vertices are neighbors. A nonempty odd-parity kk-set has at least k+1k+1 even neighbors: its consecutive blocks in the spacing-two order each have one more neighbor than their size, and different blocks have disjoint neighbor intervals. The two prefixes attain these bounds, and their neighborhoods are prefixes of the opposite parity. Consequently each part of N(C(S))N(C(S)) is contained in the corresponding same-cardinality prefix of N(S)N(S), proving (8) even when SS contains both colors. ◻

For several odd coordinates, combine their lifted operators. Every changing operation decreases the sum of coordinates, so simultaneous compression has the normal form of Theorem 3.2. Its fixed sets satisfy vS    v2eiSv\in S\implies v-2e_i\in S whenever the latter vertex belongs to the box. These are lower ideals separately in each coordinate-parity pattern. They need not be lower ideals in the whole checkerboard color: for example, {(1,1)}\{(1,1)\} in a 3×33\times3 square is fixed by the two path operators but does not contain (0,0)(0,0).

Exact recurrences on odd cylinders

Let G=HP2q+1G=H\mathbin{\square}P_{2q+1}, where HH is any finite graph and q1q\geq1. The product lift and Theorem 3.2 give an exact normal form from the full board. It uses two vectors indexed by V(H)V(H): av0a_v^0 counts even path coordinates in fiber vv, and av1a_v^1 counts odd path coordinates. Their ranges are 0av0q+1,0av1q.0\leq a_v^0\leq q+1,\qquad0\leq a_v^1\leq q. Thus they refer to the parity of the path coordinate, and do not require HH to be bipartite. Define ϕ0(k)=min(k,q),ϕ1(k)={0,k=0,k+1,k>0.\phi_0(k)=\min(k,q),\qquad \phi_1(k)=\begin{cases}0,&k=0,\\k+1,&k>0.\end{cases} For survivor vectors b0a0b^0\leq a^0, b1a1b^1\leq a^1, the exact next state F(b)F(b) is F(b)v0=max(ϕ1(bv1),maxuvbu0),F(b)v1=max(ϕ0(bv0),maxuvbu1),\begin{aligned} F(b)^0_v&=\max\left(\phi_1(b_v^1),\max_{u\sim v}b_u^0\right),\\ F(b)^1_v&=\max\left(\phi_0(b_v^0),\max_{u\sim v}b_u^1\right), \end{aligned}(9, 10) with an empty maximum interpreted as zero. Path edges supply the first term, and HH-edges the second. All contributions in a fiber are prefixes of the same parity, so their union has exactly the maximum length. The required number of inspections is d(a,b)=vV(H)(av0bv0+av1bv1).d(a,b)=\sum_{v\in V(H)}(a_v^0-b_v^0+a_v^1-b_v^1). They are realized by inspecting the removed suffix of each prefix.

For a fixed budget mm, form an edge aF(b)a\to F(b) whenever bab\leq a and d(a,b)md(a,b)\leq m. Then Tm(a)T_m(a) is exactly the shortest-path distance to zero in this state graph, or infinity if zero is unreachable. Equivalently, Tm(a)=1+minbad(a,b)mTm(F(b)),Tm(0)=0, T_m(a)=1+\min_{\substack{b\leq a\\d(a,b)\leq m}}T_m(F(b)), \qquad T_m(0)=0, (11) where the shortest-path interpretation specifies the solution of the possibly cyclic equations. For all budgets simultaneously, let Wt(a)W_t(a) be the least constant budget that wins within tt days. Then Wt+1(a)=minbamax{d(a,b),Wt(F(b))}, W_{t+1}(a)=\min_{b\leq a}\max\{d(a,b),W_t(F(b))\}, (12) with W0(0)=0W_0(0)=0, W0(a)=W_0(a)=\infty for a0a\ne0. Backpointers in either recurrence give actual inspection sets.

If A=V(H)A=|V(H)|, the number of states is exactly K=((q+1)(q+2))A(2q+2)2A.K=((q+1)(q+2))^A\leq(2q+2)^{2A}. There are at most K2K^2 state–survivor pairs. Explicit construction of their transitions takes O((A+E(H))K2)O((A+|E(H)|)K^2) elementary operations, apart from integer bit costs. For fixed HH, this is polynomial in the odd longitudinal length. Any successful path can have cycles removed, so a finite optimum is at most K1K-1. This proves an exact algorithm, not a uniform polynomial bound in dimension or a closed time formula.

When HH is bipartite, one may instead index vectors by global color. For a coloring χ\chi, put εp(v)=pχ(v)(mod2)\varepsilon_p(v)=p-\chi(v)\pmod2. A single current color has transition [Φp(b)]v=max(ϕεp(v)(bv),maxuvbu).[\Phi_p(b)]_v=\max\left(\phi_{\varepsilon_p(v)}(b_v), \max_{u\sim v}b_u\right). The two current-color vectors then become (Φ1(b1),Φ0(b0))(\Phi_1(b^1),\Phi_0(b^0)). This convention is useful when comparing the cylinder recurrence with the two-color grid arguments below.

Square fibers and equal-sided boxes

Abramovskaya, Fomin, Golovach and Pilipczuk (Abramovskaya et al. 2016, sec. 3.1, Lemma 2) prove that diagonal shifts do not increase the neighborhood size of a one-color set in a square. The following fiber calculation strengthens the scalar comparison to (8) and applies it to both colors. That stronger statement is what allows whole strategies to be compressed.

Lemma 3.5 (Square diagonal compression). On {0,,n1}2\{0,\ldots,n-1\}^2, compress each line x+y=kx+y=k toward increasing priority for smaller yy, keeping its selected cardinality. This is an idempotent, parity-preserving strategy compression. The same is true on lines xy=kx-y=k, again toward smaller yy.

Proof. Only the neighborhood inclusion needs proof. Consecutive square diagonals have lengths differing by one. Index both from the common increasing-yy end. From a diagonal of length LL to one of length L+1L+1, a selected index jj has neighbors j,j+1j,j+1. A nonempty aa-set therefore has at least a+1a+1 neighbors; a prefix attains this bound with a prefix. From length LL to length L1L-1, the indices are j1,jj-1,j, clipped to the valid range. A proper nonempty aa-set has at least aa neighbors, and the full set has L1L-1. Indeed, if it has cc consecutive blocks and occupies ee endpoints, its neighbor count is a+cea+c-e; for a proper set cec\geq e. Prefixes again attain the bounds with prefixes.

Fix an output diagonal. Its two input diagonals, after compression, contribute prefixes from the same end. Their union is the longer prefix. Each contributing length is no larger than its original contribution, hence no larger than the original union’s size. The compressed union is therefore contained in the prefix selected by compressing that original neighborhood. This argument works on either parity and on their union. Reflecting xx proves the other diagonal direction. ◻

Theorem 3.6 (Normal form on equal-sided boxes). On PndP_n^d, n2n\geq2, an optimal strategy from the full board can be chosen so that its possible-position sets and survivors are lower ideals for the legal moves vv+eiej,vveiej,i<j.v\longmapsto v+e_i-e_j,\qquad v\longmapsto v-e_i-e_j, \qquad i<j. (3.6) The conclusion respects arbitrary prescribed daily budgets. The same operators are available within every group of equal-length coordinates in an arbitrary Cartesian box. Odd-coordinate path compressions can be included simultaneously.

Proof. Lift both square operators to every pair i<ji<j of equal coordinates. They compress toward smaller xjx_j on lines xi+xj=kx_i+x_j=k and xixj=kx_i-x_j=k. Use the potential E(S)=vSi=1divi.\mathcal E(S)=\sum_{v\in S}\sum_{i=1}^d i v_i. A nontrivial plus-diagonal transfer by δ>0\delta>0 decreases it by (ji)δ(j-i)\delta, and a minus-diagonal transfer by (i+j)δ(i+j)\delta. An odd-coordinate prefix transfer also strictly decreases it. The potential is uniformly bounded; on PndP_n^d the bound nd(n1)d(d+1)/2n^d(n-1)d(d+1)/2 suffices. Uniform cycling therefore gives an idempotent strategy compression. Its fixed sets are precisely the ideals for the displayed local moves, with the additional 2ei-2e_i conditions when odd-coordinate operators are included. Apply Theorem 3.2. ◻

In dimension two the two-diagonal fixed sets are the downward pyramidal sets of the square isoperimetric argument. They differ from ordinary checkerboard corner ideals. In any dimension they give an exact finite recurrence over their fixed family, since both neighborhoods and intersections remain fixed. The theorem does not bound the number of these ideals by a polynomial in dd or in nn.

Remark 3.7 (Why even path factors require another idea). Every parity-preserving strategy compression on an even path is the identity. Each endpoint is the unique degree-one vertex in its color. Applying (8) to its singleton forces that singleton to be fixed. Fixed sets are closed under neighborhoods, so every NtN^t of either endpoint is fixed. These are the spacing-two prefixes from the two ends. Intersections of suitable prefixes isolate every singleton; fixed intersections follow from monotonicity and cardinality, without idempotence. Thus all singletons, and consequently all sets, are fixed. This rules out a nontrivial even-path factor reduction within this specific comparison framework. It does not rule out richer state labels or different comparison theorems.

One quadrant profile for every forbidden initial triangle

The square-root and pronic-root bounds have a common extension that retains prescribed omissions near a corner. Neighborhoods below are always taken in the whole nonnegative quadrant. Forbidden rooms constrain the support; they are not deleted from the graph.

Theorem 4.1 (Punctured-quadrant profile). Fix a checkerboard color p{0,1}p\in\{0,1\} and an integer r0r\ge0. Require a finite color-pp support to omit the diagonals x+y=p,p+2,,p+2(r1)x+y=p,p+2,\ldots,p+2(r-1), and put h=2r+ph=2r+p. For every integer s0s\ge0, the largest possible support with neighborhood surplus at most ss has cardinality Ch(s)=max{s(s1)2, s(sh)}. C_h(s)=\max\left\{\frac{s(s-1)}2,\ s(s-h)\right\}. (13) Every cardinality up to this maximum is attainable with surplus at most ss. Consequently the exact minimum neighborhood size of a kk-room support, k>0k>0, is k+min{s0:kCh(s)}.k+\min\{s\ge0:k\le C_h(s)\}. Thus its surplus is the smaller of two integer quadratic roots.

For h=0h=0 and h=1h=1 the formula gives respectively k\left\lceil\sqrt{k}\right\rceil and the least ss with ks(s1)k\le s(s-1). The case h=2h=2 forbids the even origin; h=3h=3 forbids both odd neighbors of the origin. These exact static profiles do not assert that their minimizers can be chained inside arbitrary earlier beliefs.

Proof. Use Lemma 3.5 inside a square large enough that neither the original nor compressed support or neighborhood reaches its far edges. It compresses each diagonal toward smaller yy, preserving cardinality and all the forbidden diagonals, without increasing the neighborhood. Let aja_j be the resulting count on x+y=2j+px+y=2j+p, whose length is j=2j+p+1\ell_j=2j+p+1, and put ϵj=1{aj=j}\epsilon_j=\mathbf{1}_{\{a_j=\ell_j\}}. Counts with j<rj<r vanish. The exact output count on x+y=2j+p+1x+y=2j+p+1 is nj=max{aj+1{aj>0}, aj+1ϵj+1}.n_j=\max\{a_j+\mathbf{1}_{\{a_j>0\}},\ a_{j+1}-\epsilon_{j+1}\}. The two contributions are prefixes of the same diagonal. The upper input contracts by one only when full. There is also an initial output count n1=a0ϵ0n_{-1}=a_0-\epsilon_0; for p=0p=0 this is identically zero, correctly representing the nonexistent lower diagonal.

Put δj=njaj\delta_j=n_j-a_j for j0j\ge0, and δ1=n1\delta_{-1}=n_{-1}. These numbers are nonnegative and sum to the compressed surplus δ\delta. Moreover δj1{aj>0},δjaj+1ajϵj+1.\delta_j\ge\mathbf{1}_{\{a_j>0\}},\qquad \delta_j\ge a_{j+1}-a_j-\epsilon_{j+1}. List the occupied diagonals as j1<<jLj_1<\cdots<j_L and let ftf_t count the full ones through jtj_t. Telescoping below jtj_t gives surplus at least ajtfta_{j_t}-f_t; the remaining output has surplus at least Lt+1L-t+1. Hence ajtδL+t1+ft. a_{j_t}\le\delta-L+t-1+f_t. (14)

If no occupied diagonal is full, the initial contribution is positive, so Lδ1L\le\delta-1. Summing (14) with ft=0f_t=0 gives SLδL(L+1)2δ(δ1)2.|S|\le L\delta-\frac{L(L+1)}2 \le\frac{\delta(\delta-1)}2. If the first full diagonal has occupied rank uu, then fu=1f_u=1 and jur+u1j_u\ge r+u-1, so its size is at least h+2u1h+2u-1. Equation (14) gives Lδhu+1δhL\le\delta-h-u+1\le\delta-h. Summing the same equation with fttf_t\le t now gives SLδδ(δh)|S|\le L\delta\le\delta(\delta-h). The empty set is separate. Since ChC_h is nondecreasing on nonnegative integers, compression proves the upper bound for every original set of surplus at most ss.

Two nested constructions prove sharpness. For h1h\ge1, use the proper diagonal counts ar+i=i+1(0is2).a_{r+i}=i+1\qquad(0\le i\le s-2). Their initial surplus is one, and each occupied diagonal contributes one more. Their size is s(s1)/2s(s-1)/2 and their surplus is ss. For sh+1s\ge h+1, instead use the shs-h full consecutive diagonals ar+i=h+1+2i(0i<sh).a_{r+i}=h+1+2i\qquad(0\le i<s-h). Their initial surplus is hh, and each full diagonal contributes one. Their size is s(sh)s(s-h) and surplus is again ss.

A partial last diagonal interpolates between consecutive capacities in either family. After a nonempty completed ramp or full block, its downward contribution fits in the existing neighborhood, and a positive partial fill increases surplus by exactly one. For the first full block, a partial first diagonal of v<h+1v<h+1 rooms has surplus v+1h+1v+1\le h+1; the full first diagonal has surplus h+1h+1. The full-block branch dominates when s2h1s\ge2h-1. For h2h\ge2 its first dominant positive level is within its valid range sh+1s\ge h+1; for h=1h=1 it starts at s=2s=2. Thus whichever family supplies the new maximum also fills every gap above the preceding maximum. For h=0h=0, the full blocks alone give s2s^2, starting with the origin, and partial final diagonals fill every intermediate size. This proves all asserted attainments. ◻

Lemma 4.2 (Two candidates for convex capacities). Let A,B:NNA,B:\mathbb{N}\to\mathbb{N} be nondecreasing, unbounded and discretely convex, with A(0)=B(0)=0A(0)=B(0)=0. Define α(k)=min{s:kA(s)}\alpha(k)=\min\{s:k\le A(s)\} and β(k)=min{s:kB(s)}\beta(k)=\min\{s:k\le B(s)\}. For integers 0luS0\le l\le u\le S, the minimum of α(y)+β(Sy)\alpha(y)+\beta(S-y) over lyul\le y\le u is attained at one of y1=min{u,A(α(l))},y2=max{l,SB(β(Su))}.y_1=\min\{u,A(\alpha(l))\},\qquad y_2=\max\{l,S-B(\beta(S-u))\}.

Proof. Take any feasible yy of cost tt, and put a=α(y)a=\alpha(y), b=β(Sy)b=\beta(S-y). Then a+b=ta+b=t, aα(l)a\ge\alpha(l), bβ(Su)b\ge\beta(S-u) and A(a)+B(b)SA(a)+B(b)\ge S. Discrete convexity puts the maximum of A(z)+B(tz)A(z)+B(t-z) on the integer interval α(l)ztβ(Su)\alpha(l)\le z\le t-\beta(S-u) at an endpoint. At the first endpoint, A(α(l))+B(tα(l))SA(\alpha(l))+B(t-\alpha(l))\ge S. The point y1y_1 has first cost at most α(l)\alpha(l) and second count at most B(tα(l))B(t-\alpha(l)): if clipped to uu, use β(Su)tα(l)\beta(S-u)\le t-\alpha(l) and monotonicity of BB. It therefore has total cost at most tt. The other endpoint gives y2y_2 symmetrically; if clipped to ll, use α(l)tβ(Su)\alpha(l)\le t-\beta(S-u). Both candidates lie in [l,u][l,u]. Applying this to a minimizing yy proves the assertion, including flat capacities, zero roots and singleton intervals. ◻

Each ChC_h in (13) is the maximum of two convex quadratics and is nondecreasing on N\mathbb{N}. The lemma therefore optimizes sums of any two punctured-quadrant root costs without searching their allocation interval. It also applies to the capacities s(s+1)s(s+1) and s2s^2 used in the inverse-profile calculation below.

Exact neighborhood profiles on odd rectangles

Let G=P2a+1P2b+1G=P_{2a+1}\mathbin{\square}P_{2b+1}, where ab1a\geq b\geq1, with coordinates (x,y)(x,y); thus xx is the long coordinate. Write V0,V1V_0,V_1 for its even and odd checkerboard classes, and E=V0=G+12,M=V1=E1.E=|V_0|=\frac{|G|+1}{2},\qquad M=|V_1|=E-1. Define the two open-neighborhood profiles by gp(k)=min{N(S):SVp, S=k}.g_p(k)=\min\{|N(S)|:S\subseteq V_p,\ |S|=k\}. It is convenient to use the integer functions R(k)=k,Q(k)=min{r1:kr(r1)}.R(k)=\left\lceil\sqrt{k}\right\rceil,\qquad Q(k)=\min\{r\geq1:k\leq r(r-1)\}. In particular R(0)=0R(0)=0 and Q(0)=1Q(0)=1.

Theorem 5.1 (Odd-rectangle profiles and compatible orders). Both profiles have gp(0)=0g_p(0)=0. For nonempty sets, g0(k)=k+min{R(k),b,R(Ek)1},1kE,g1(k)=k+min{Q(k),b+1,Q(Mk)},1kM.\begin{aligned} g_0(k)&=k+\min\{R(k),b,R(E-k)-1\}, &&1\leq k\leq E, \\ g_1(k)&=k+\min\{Q(k),b+1,Q(M-k)\}, &&1\leq k\leq M. \end{aligned}(15, 16) Order each parity by increasing (x+y,x)(x+y,x), and let Ip(k)I_p(k) be its prefix of size kk. Every prefix attains the corresponding minimum, and N(Ip(k))=I1p(gp(k)).N(I_p(k))=I_{1-p}(g_p(k)). (5.1)

The order fills the short direction first within a diagonal. Its direction is significant on an unequal rectangle. For example, the opposite tie order on 7×57\times5 gives the five-element even prefix {(0,0),(0,2),(1,1),(2,0),(4,0)}\{(0,0),(0,2),(1,1),(2,0),(4,0)\}, with eight neighbors; the set {(0,0),(0,2),(0,4),(1,1),(1,3)}\{(0,0),(0,2),(0,4),(1,1),(1,3)\} has seven.

Minimizing even prefixes on a 9×79\times7 rectangle. The three regimes are controlled by a corner, the short width, and the complement.

Quadrant bounds

Apply the odd-coordinate compressions of Lemma 3.4 in both directions. Their common fixed sets are lower closed under decreasing either coordinate by two, and compression does not increase the neighborhood size. We may therefore assume that each coordinate-parity pattern of SS is a lower Ferrers diagram. Let eie_i and oio_i be the selected counts in rows y=2iy=2i and y=2i+1y=2i+1, respectively. These are separately nonincreasing sequences. For source color 00 they count even-xx and odd-xx vertices, whereas for source color 11 they count odd-xx and even-xx vertices.

Lemma 5.2 (Quadrant area and row bounds). Regard a finite set with this Ferrers property as a subset of the infinite nonnegative quadrant. Put δ=N(S)S\delta=|N(S)|-|S|. If SS has color 00, then ei>0    ei+iδ,oi>0    oi+i+1δ,Sδ2.e_i>0\implies e_i+i\leq\delta,\qquad o_i>0\implies o_i+i+1\leq\delta, \qquad |S|\leq\delta^2. (5.2) If SS has color 11, then ei>0    ei+i+1δ,oi>0    oi+i+1δ,Sδ(δ1).e_i>0\implies e_i+i+1\leq\delta,\qquad o_i>0\implies o_i+i+1\leq\delta, \qquad |S|\leq\delta(\delta-1). (5.2) A nonempty set has surplus at least one in color 00 and at least two in color 11.

Proof. The sequences eventually vanish. A nonempty odd-xx prefix of length tt has t+1t+1 even-xx neighbors in the quadrant; an even-xx prefix has tt odd-xx neighbors. Contributions from neighboring rows are also prefixes, so their unions are given by maxima. Subtracting the source row sizes therefore yields, in color 00, δ=(o0e0)++i0[max{eioi,1{oi>0}}+(oiei+1)+]. \delta=\left(o_0-e_0\right)_+ +\sum_{i\geq0}\left[ \max\{e_i-o_i,\mathbf{1}_{\{o_i>0\}}\}+\left(o_i-e_{i+1}\right)_+ \right]. (17) For color 11 the identity is δ=max{1{e0>0},o0e0}+i0[(eioi)++max{oiei+1,1{ei+1>0}}]. \delta=\max\{\mathbf{1}_{\{e_0>0\}},o_0-e_0\} +\sum_{i\geq0}\left[ \left(e_i-o_i\right)_++\max\{o_i-e_{i+1},\mathbf{1}_{\{e_{i+1}>0\}}\} \right]. (18) All terms displayed are nonnegative.

Suppose first that SS has color 00 and ei>0e_i>0. In (17), each of the first ii paired summands is at least one. If its odd count is positive, the first term is at least one; otherwise its even count is positive. The tail from ii onward is at least the telescoping sum ji((ejoj)+(ojej+1))=ei.\sum_{j\geq i}\bigl((e_j-o_j)+(o_j-e_{j+1})\bigr)=e_i. Thus δi+ei\delta\geq i+e_i. If oi>0o_i>0, every preceding pair contributes at least one, as does the first term of pair ii. The second term of pair ii and the subsequent pairs have sum at least oio_i, by the same telescoping argument. This gives δi+1+oi\delta\geq i+1+o_i.

For color 11 and ei>0e_i>0, the initial term of (18) is at least one, and the first ii pairs each contribute at least one because ej+1>0e_{j+1}>0 for j<ij<i. The remaining tail is at least eie_i. If oi>0o_i>0, the initial term is again at least one. Every preceding pair contributes at least one: either ej+1>0e_{j+1}>0, or the positive ojo_j appears in its second term. The tail after the first term of pair ii is at least oio_i. These are the two claimed bounds for color 11.

Finally sum the row bounds. In color 00 the maximum possible total is i0max(δi,0)+i0max(δi1,0)=δ2.\sum_{i\geq0}\max(\delta-i,0) +\sum_{i\geq0}\max(\delta-i-1,0)=\delta^2. In color 11 both sums have the second form, giving δ(δ1)\delta(\delta-1). The row inequalities also give the stated positive surplus bounds for nonempty sets. ◻

The two far edges

Lemma 5.3 (Corner, strip, or complement). Let SVpS\subseteq V_p have the Ferrers property. Put δ=NG(S)S\delta=|N_G(S)|-|S|, and let FF and ZZ count its vertices on the far edges x=2ax=2a and y=2by=2b, respectively. If exactly one of F,ZF,Z is positive, then δb+p\delta\geq b+p. If neither is positive, the quadrant bounds apply to SS without change. If both are positive, NG(S)N_G(S) covers both near edges in color 1p1-p, and the set V1pNG(S),V_{1-p}\setminus N_G(S), reflected in both coordinate midlines, has the Ferrers property and no far-edge vertices.

Proof. Viewing the same SS in the quadrant adds exactly one neighbor beyond the rectangle for every selected far-edge vertex. These F+ZF+Z vertices are distinct, even when the far corner is selected. Hence δquadrant=δ+F+Z. \delta_{\mathrm{quadrant}}=\delta+F+Z. (19) If F=0F=0 and Z>0Z>0, the last even row has eb=Ze_b=Z. The row bound in Lemma 5.2 gives δ+ZZ+b+p\delta+Z\geq Z+b+p. If F>0F>0 and Z=0Z=0, swap the axes to get the stronger bound δa+p\delta\geq a+p. If F=Z=0F=Z=0, there is no clipping.

Suppose now that both are positive. In color 00, the Ferrers property forces every even-xx vertex of row y=0y=0 and every even-yy vertex of column x=0x=0 into SS. They cover both opposite-color near edges. In color 11, far-xx occupancy forces the full even-xx row y=1y=1, covering the even-xx near edge y=0y=0. Far-yy occupancy forces (1,2i)S(1,2i)\in S for every 0ib0\leq i\leq b, covering the even-yy near edge x=0x=0.

The neighborhood of a fixed set is fixed under the two path operators, so its complement is upper closed within each coordinate-parity pattern. The two reflections convert it to a lower Ferrers set. They preserve checkerboard color because both side lengths are odd. The near-edge coverage just proved means the reflected complement has no far-edge vertices, as required. ◻

Lower bounds in Theorem 5.1

Let SV0S\subseteq V_0, S=k>0|S|=k>0, and put δ=N(S)k\delta=|N(S)|-k. If δb\delta\geq b the desired lower bound is immediate. Otherwise Lemma 5.3 leaves two possibilities. With no clipping, kδ2k\leq\delta^2. With both far edges occupied, let TT be the reflected opposite-color complement of N(S)N(S). It has size t=Mkδt=M-k-\delta. Before reflection, its neighborhood is contained in V0SV_0\setminus S, so its quadrant surplus is at most δ+1\delta+1. For δ1\delta\geq1, Lemma 5.2 gives Mkδ=tδ(δ+1),kE(δ+1)2.M-k-\delta=t\leq\delta(\delta+1),\qquad k\geq E-(\delta+1)^2. (5.3) If δ=1\delta=-1 or 00, TT must be empty, since a nonempty quadrant color-11 set has surplus at least two. This yields respectively k=Ek=E or k=Mk=M, the same conclusion. No smaller δ\delta is possible: pairing along each row, then vertically in the unpaired last column, gives a matching covering all vertices except the far even corner, and hence N(S)k1|N(S)|\geq k-1. In all cases, δmin{R(k),b,R(Ek)1}.\delta\geq\min\{R(k),b,R(E-k)-1\}.

For SV1S\subseteq V_1, the same matching gives δ0\delta\geq0. Below b+1b+1, the unclipped case gives kδ(δ1)k\leq\delta(\delta-1). In the complement case, TT has size EkδE-k-\delta and quadrant color-00 surplus at most δ1\delta-1. The case δ=0\delta=0 is impossible: TT is nonempty because kM<Ek\leq M<E, but would have negative surplus. For δ1\delta\geq1, Ekδ(δ1)2,kMδ(δ1).E-k-\delta\leq(\delta-1)^2,\qquad k\geq M-\delta(\delta-1). The unclipped nonempty case also has δ1\delta\geq1. Thus δmin{Q(k),b+1,Q(Mk)}.\delta\geq\min\{Q(k),b+1,Q(M-k)\}. These prove the lower bounds in both formulas.

For comparison, the two exact profiles of any bipartite graph obey the complement-inverse identity g1(y)=Emax{x:g0(x)My}. g_1(y)=E-\max\{x:g_0(x)\leq M-y\}. (20) Indeed, the existence of nonadjacent sets of sizes xx and yy in the two colors is equivalent to g0(x)Myg_0(x)\leq M-y, and also to g1(y)Exg_1(y)\leq E-x. Thus the second formula can alternatively be checked from the first by exact inversion.

Attainment and neighborhood nesting

The vertices on diagonal x+y=dx+y=d have xx in the interval Ld=max(0,d2b)xmin(2a,d),L_d=\max(0,d-2b)\leq x\leq\min(2a,d), whose length is (d)=min(2a,d)max(0,d2b)+1,0d2a+2b.\ell(d)=\min(2a,d)-\max(0,d-2b)+1, \qquad0\leq d\leq2a+2b. A nonempty prefix ends after jj vertices of diagonal dd, for some 1j(d)1\leq j\leq\ell(d), and has size k=s<dsd(mod2)(s)+j. k=\sum_{\substack{s<d\\s\equiv d\pmod2}}\ell(s)+j. (21) All earlier opposite-color diagonals belong to its neighborhood. On diagonal d+1d+1, each selected xx contributes xx or x+1x+1 when the corresponding step stays inside the board. Their union is the initial interval there, of length f(d,j)=j+11{d2b}1{Ld+j1=2a}. f(d,j)=j+1-\mathbf{1}_{\{d\geq 2b\}}-\mathbf{1}_{\{L_d+j-1=2a\}}. (22) The first indicator removes the unavailable step past the short-direction boundary, and the second removes the step past the long-direction boundary. At the far corner both are present and f=0f=0. The initial minority diagonal d=1d=1 additionally covers the corner on diagonal zero, already included among the earlier opposite diagonals. Consequently N(Ip(k))=s<ds≢d(mod2)(s)+f(d,j),|N(I_p(k))|=\sum_{\substack{s<d\\s\not\equiv d\pmod2}}\ell(s)+f(d,j), and this neighborhood is exactly a prefix of the other color.

To evaluate its surplus, let Δ(d)\Delta(d) be the earlier opposite-color sum minus the earlier same-color sum. The recurrence Δ(0)=0\Delta(0)=0, Δ(d+1)=(d)Δ(d)\Delta(d+1)=\ell(d)-\Delta(d) gives Δ(d)={d/2,d2b,b+(dmod2),2bd2a,a+bd/2+(dmod2),d2a.\Delta(d)= \begin{cases} \left\lceil d/2\right\rceil,&d\leq2b,\\ b+(d\bmod2),&2b\leq d\leq2a,\\ a+b-\left\lfloor d/2\right\rfloor+(d\bmod2),&d\geq2a. \end{cases} The formulas agree at their shared endpoints. The exact surplus is Δ(d)+1\Delta(d)+1 minus the two indicators in (22). Complete even diagonals through sum 2r22r-2 contain r2r^2 vertices, and complete odd diagonals through sum 2r12r-1 contain r(r+1)r(r+1). Substitution into (21) yields

Color Size range Prefix surplus
00 1kb21\leq k\leq b^2 R(k)R(k)
00 b2<k<Eb2b^2<k<E-b^2 bb
00 Eb2kEE-b^2\leq k\leq E R(Ek)1R(E-k)-1
11 1kb(b+1)1\leq k\leq b(b+1) Q(k)Q(k)
11 b(b+1)<k<Mb(b+1)b(b+1)<k<M-b(b+1) b+1b+1
11 Mb(b+1)kMM-b(b+1)\leq k\leq M Q(Mk)Q(M-k)

For a square, the shared minority endpoint has surplus b+1b+1 in both rows; empty ranges are omitted. The table equals the two lower bounds. It proves attainment and the compatible-neighborhood assertion, completing the proof of Theorem 5.1.

An exact two-count game

Corollary 5.4. For every daily budget on every odd-by-odd rectangle, the unrestricted minimum capture time is exactly the shortest-path distance from (E,M)(E,M) to (0,0)(0,0) in the following two-count state graph: (u,v)(g1(j),g0(i)),0iu,0jv,u+vijm.(u,v)\longrightarrow (g_1(j),g_0(i)),\qquad 0\leq i\leq u,\quad0\leq j\leq v,\quad u+v-i-j\leq m. A shortest path gives an optimal physical strategy by deleting suffixes of the two current-color prefix orders. The reduction also respects arbitrary prescribed daily budgets.

Proof. Define C(S)=I0(SV0)I1(SV1).C(S)=I_0(|S\cap V_0|)\cup I_1(|S\cap V_1|). It is monotone, cardinality preserving and idempotent. By the exact profiles and nesting, N(C(S))V1p=I1p(gp(SVp))I1p(N(SVp)).N(C(S))\cap V_{1-p} =I_{1-p}(g_p(|S\cap V_p|)) \subseteq I_{1-p}(|N(S\cap V_p)|). The last set is the corresponding part of C(N(S))C(N(S)). Apply Theorem 3.2. Every displayed transition is also the exact neighborhood of the indicated survivors, so it has a physical realization. Shortest paths, with infinity for an unreachable zero state, settle both feasibility and minimum time. ◻

The corollary is an exact recurrence for every parameter, rather than a closed expression for its shortest-path distance. It avoids imposing an unproved sequential allocation to the two initial colors: both may receive inspections on any day.

Every budget on odd rectangles: a one-day determination

Retain E=M+1E=M+1 and the exact profiles of Theorem 5.1. The following reduction has no restriction on width, length, or feasible budget. It reduces the answer to one binary choice. Section 7 resolves that choice by an exact bounded-state calculation. The same section proves a scalar criterion after an explicit onset at every budget; only its remaining short-board range is open.

Write ιp(z)=max{k:gp(k)z}\iota_p(z)=\max\{k:g_p(k)\le z\} for the inverse profiles. Define D0(0)=D1(0)=0D_0(0)=D_1(0)=0 and D0(t+1)=ι0(min{M,D1(t)+m}),D1(t+1)=ι1(min{E,D0(t)+m}). D_0(t+1)=\iota_0(\min\{M,D_1(t)+m\}),\qquad D_1(t+1)=\iota_1(\min\{E,D_0(t)+m\}). (23) Here Dp(t)D_p(t) is the largest possible deficit in current color pp after tt inspection-and-movement steps devoted entirely to that cohort. Compatible prefixes attain these values. Let τ\tau be the first tt for which D0(t)=ED_0(t)=E or D1(t)=MD_1(t)=M.

Theorem 6.1 (Uniform one-day determination). For every feasible budget on every odd rectangle, 2τ1Tm2τ.2\tau-1\le T_m\le2\tau. Moreover Tm=2τ1T_m=2\tau-1 whenever E+MD0(τ1)D1(τ1)m. E+M-D_0(\tau-1)-D_1(\tau-1)\le m. (24) Necessity follows after the explicit onset in Theorem 7.5, as well as in the all-length minimum-budget and high-budget ranges proved later. It remains open outside those ranges. The exact two-count algorithm determines the answer in all cases. The solo calculation itself uses at most 4b+24b+2 arithmetic stages, as shown below.

Concentrating the deficit before the first possible capture

Put q(z)=Q(z)1q(z)=Q(z)-1. Complement duality gives ι0(z)=zA(z),A(z)=min{q(z),b,q(Mz)},0z<M,ι0(M)=E,ι1(z)=zB(z),B(z)=min{R(z),b+1,1+R(Ez)},0zE.\begin{aligned} \iota_0(z)&=z-A(z),& A(z)&=\min\{q(z),b,q(M-z)\},&&0\le z<M,\\ \iota_0(M)&=E,\\ \iota_1(z)&=z-B(z),& B(z)&=\min\{R(z),b+1,1+R(E-z)\},&&0\le z\le E. \end{aligned} In particular ι0(0)=ι1(0)=ι1(1)=0\iota_0(0)=\iota_1(0)=\iota_1(1)=0.

Lemma 6.2 (Inverse concentration). For x,y0x,y\ge0 with x+yMx+y\le M, ι0(x)+ι1(y)ι0(x+y).\iota_0(x)+\iota_1(y)\le\iota_0(x+y). If x2x\ge2, also ι1(x)+ι0(y)ι1(x+y)\iota_1(x)+\iota_0(y)\le\iota_1(x+y).

Proof. The function qq is subadditive: ur(r+1)u\le r(r+1) and vs(s+1)v\le s(s+1) imply u+v(r+s)(r+s+1)u+v\le(r+s)(r+s+1). The minimum AA remains subadditive below MM. Indeed, if either minimizing branch is its cap or its decreasing reflected branch, that branch alone bounds A(x+y)A(x+y); otherwise use subadditivity of qq. Each branch of B(y)B(y) dominates the corresponding branch of A(y)A(y). Hence A(x)+B(y)A(x+y)A(x)+B(y)\ge A(x+y), proving the first inequality below MM. At x+y=Mx+y=M, each proper inverse is at most its argument, whereas ι0(M)=M+1\iota_0(M)=M+1; the endpoint x=M,y=0x=M,y=0 is equality.

For the second inequality, x2x\ge2 and y<My<M. If the cap or reflected branch minimizes B(x)B(x), then B(x+y)B(x)B(x+y)\le B(x). Otherwise B(x)=R(x)2B(x)=R(x)\ge2. If A(y)=q(y)A(y)=q(y), writing r=R(x)r=R(x) and s=q(y)s=q(y) gives x+yr2+s(s+1)(r+s)2x+y\le r^2+s(s+1)\le(r+s)^2. If A(y)=bA(y)=b, use R(x)+bb+1B(x+y)R(x)+b\ge b+1\ge B(x+y). Finally, if A(y)=q(My)A(y)=q(M-y), put z=Myxz=M-y\ge x. Since R(z)Q(z)R(z)\le Q(z), B(x+y)1+R(z+1x)1+Q(z)R(x)+Q(z)1.B(x+y)\le1+R(z+1-x)\le1+Q(z) \le R(x)+Q(z)-1. These are exactly the required cost inequalities. ◻

Lemma 6.3 (Exact total deficit before τ\tau). Let dp(t)d_p(t) be the deficit in current color pp for an arbitrary physical strategy after tt inspections and moves. For t<τt<\tau, d0(t)+d1(t)max{D0(t),D1(t)}.d_0(t)+d_1(t)\le\max\{D_0(t),D_1(t)\}. Equality is attainable by devoting the budget to one cohort.

Proof. Always dp(t)Dp(t)d_p(t)\le D_p(t) by the neighborhood lower bounds and monotonicity. Induct on tt. When t+1<τt+1<\tau, the endpoint values of the inverses imply max{D0(t),D1(t)}+mM. \max\{D_0(t),D_1(t)\}+m\le M. (25) For useful quotas p,qp,q with p+qmp+q\le m, put X=d0(t)+pX=d_0(t)+p, Y=d1(t)+qY=d_1(t)+q. Complement duality bounds the new deficits by ι0(Y),ι1(X)\iota_0(Y),\iota_1(X), and X+YmaxDp(t)+mMX+Y\le\max D_p(t)+m\le M. If D1(t)D0(t)D_1(t)\ge D_0(t), the first inverse inequality bounds their sum by ι0(D1(t)+m)=D0(t+1)\iota_0(D_1(t)+m)=D_0(t+1). Otherwise, when X2X\ge2, the second bounds it by ι1(D0(t)+m)=D1(t+1)\iota_1(D_0(t)+m)=D_1(t+1). When X1X\le1, the latter inverse vanishes and the individual bound on d1(t)d_1(t) suffices. The induction begins with zero deficits. ◻

The midpoint argument and attaining searches

Proof of Theorem 6.1. For τ=1\tau=1 the lower bound is immediate. Otherwise put L=τ1L=\tau-1 and suppose a schedule wins in 2L2L days, padding a shorter schedule by empty inspections if necessary. Its first LL inspections, each followed by movement, leave a belief FF on day L+1L+1. The preceding lemma gives FE|F|\ge E.

Read the last LL inspections backward along the undirected edges. Use L1L-1 inspection-and-movement steps and then one inspection without movement. The resulting set RR is also on day L+1L+1. Its deficit is at most maxDp(L1)+mM\max D_p(L-1)+m\le M, by (25) with the noncapturing time LL. Thus RE|R|\ge E. Since G=2E1|G|=2E-1, the sets intersect. Concatenating their forward and backward avoiding walks contradicts success. Hence Tm2τ1T_m\ge2\tau-1.

If A1,,AτA_1,\ldots,A_\tau captures one initial parity, use A1,,Aτ,Aτ,,A1.A_1,\ldots,A_\tau,A_\tau,\ldots,A_1. The first half captures that parity. Reversing an avoiding walk in the second half gives a walk of that initial parity avoiding the first half, so the opposite cohort is captured as well. This proves the upper bound with an explicit legal schedule.

Finally prepare one physical color optimally for LL steps before a central inspection, and the other physical color for LL reversed steps after it. Each half leaves the other cohort full. Their intersection therefore consists of the two solo residual sets, of total size E+MD0(L)D1(L)E+M-D_0(L)-D_1(L). Inspect that intersection centrally. Condition (24) makes this a legal (2τ1)(2\tau-1)-day search. ◻

Evaluating the solo recurrence without iterating over days

Put C0=E,C1=MC_0=E,C_1=M, fp(k)=gp((km)+)f_p(k)=g_p(\left(k-m\right)_+), and Pp=f1pfpP_p=f_{1-p}\circ f_p. The two-day map returns a cohort to its original physical color. Extend ιp(z)=Cp\iota_p(z)=C_p for zC1pz\ge C_{1-p}.

Proposition 6.4 (A bounded number of arithmetic stages). For any canonical one-cohort prefix, its exact solo capture time and its remaining count at any prescribed day can be evaluated using at most 4b+24b+2 translation intervals and integer floor divisions. The number of stages is independent of the longer side and the number of search days. This evaluates the solo part of Theorem 6.1; it does not decide the unresolved scalar midpoint condition.

Proof. Every change in the surplus gp(k)kg_p(k)-k at a positive argument belongs to B0={r2+1:0r<b}{Er2:0rb},B1={r(r1)+1:1rb}{Mr(r1):1rb}.\begin{aligned} \mathcal B_0&=\{r^2+1:0\le r<b\}\cup\{E-r^2:0\le r\le b\},\\ \mathcal B_1&=\{r(r-1)+1:1\le r\le b\} \cup\{M-r(r-1):1\le r\le b\}. \end{aligned} Include 11 and discard points outside the appropriate profile domain. These are the change points of the two capped root terms; their minimum cannot change elsewhere. Set cp=min{Cp,m+ιp(m)}c_p=\min\{C_p,m+\iota_p(m)\}. Exactly the counts kcpk\le c_p disappear in at most two days. Above cpc_p, the change points of PpP_p are contained in {m+s:sBp}{m+ιp(m+s1)+1:sB1p}.\{m+s:s\in\mathcal B_p\}\cup \{m+\iota_p(m+s-1)+1:s\in\mathcal B_{1-p}\}. The second set is the inverse image of the first argument at which the second surplus changes. Add cp+1,Cp+1c_p+1,C_p+1 and clip to this interval. Between consecutive endpoints l,u+1l,u+1, the map is kkdk\mapsto k-d, where d2m2b11d\ge2m-2b-1\ge1 and every output is positive. There are at most 4b+24b+2 such intervals.

Process them from top to bottom. If the current count klk\ge l, exactly 1+(kl)/d1+\left\lfloor(k-l)/d\right\rfloor consecutive pairs have their source in [l,u][l,u]. Subtract this multiple of dd and add twice that many days. The next count is below ll, so no interval is revisited. On reaching kcpk\le c_p, add zero, one, or two final days according as k=0k=0, 0<km0<k\le m, or k>mk>m. For a prescribed day, truncate the appropriate number of pairs and use one application of fpf_p if needed. All operations are exact integer arithmetic. Sorting the endpoints uses O(blogb)O(b\log b) comparisons; the number of division stages is O(b)O(b). ◻

Lemma 6.5 (Two candidates for opposed roots). Write q(y)=Q(y)1q(y)=Q(y)-1, with q(0)=0q(0)=0. For integers 0luS0\le l\le u\le S, the minimum of q(y)+R(Sy)q(y)+R(S-y) over lyul\le y\le u is attained at one of min{u,q(l)(q(l)+1)},max{l,SR(Su)2}.\min\{u,q(l)(q(l)+1)\},\qquad \max\{l,S-R(S-u)^2\}.

Proof. Apply Lemma 4.2 to A(s)=s(s+1)A(s)=s(s+1) and B(s)=s2B(s)=s^2, whose inverse capacities are qq and RR. It includes zero roots and singleton intervals; the two candidates need not be the original endpoints l,ul,u. The module RootConvolution verifies the exact attaining minimum with internally defined integer roots. ◻

Exact transfer through the affine middle

This second reduction preserves joint states and does not assume that optimal searches finish one cohort before starting the other. Set K=b2+1K=b^2+1, L=K+mL=K+m, U=EKU=E-K. Both profiles have constant surplus on every residual obtained by allocating at most mm inspections to a count in [L,U][L,U]. Track the initial cohorts, the first currently in color z{0,1}z\in\{0,1\}, and put Bz(t)=bt+(t+z)/2B_z(t)=bt+\left\lfloor(t+z)/2\right\rfloor.

Theorem 6.6 (Exact middle transfer). Assume mb+1m\ge b+1 and (a,d),(a,d)[L,U]2(a,d),(a',d')\in[L,U]^2. A tt-day full-budget trajectory remaining in this band joins the two states if and only if a+d=a+d+(2b+1m)t,0a+Bz(t)amt.a'+d'=a+d+(2b+1-m)t,\qquad 0\le a+B_z(t)-a'\le mt. The statement includes a construction of all daily allocations.

Proof. Write Sj=a+d+(2b+1m)jS_j=a+d+(2b+1-m)j. The attainable first counts at time jj form exactly the integer interval [max{L,SjU,a+Bz(j)mj},min{U,SjL,a+Bz(j)}].[\max\{L,S_j-U,a+B_z(j)-mj\}, \min\{U,S_j-L,a+B_z(j)\}]. For one step the first count changes by b+(z+jmod2)pb+(z+j\bmod2)-p, 0pm0\le p\le m. Taking the union over this integer interval and intersecting the two band constraints gives the displayed interval at j+1j+1: both alternating surpluses lie between zero and mm. The intervals are nonempty whenever 2LSj2U2L\le S_j\le2U; pairwise comparison of their three lower and upper bounds proves this directly. Since SjS_j is affine, the initial and final band conditions ensure these inequalities at every intermediate time. For a prescribed next count xx', choose the preceding count to be the larger of the current lower endpoint and xb(z+jmod2)x'-b-(z+j\bmod2). It lies in the current interval and gives an allocation between zero and mm. Backtracking constructs the trajectory. Necessity follows by summing its allocations. ◻

The Lean module MiddleIntervalTransfer verifies this interval statement, including constructive sufficiency. The identification of the band with physical rectangle profiles remains an ordinary proof. Replacing maximal interior excursions by these transfers gives an exact boundary graph with O((b2+m)E)O((b^2+m)E) retained states: retain states outside [L,U]2[L,U]^2 and a collar of width m+1m+1 inside its boundary. Every one-day entry or exit crosses that collar, and the theorem expands each added transfer back into legal moves. This reduction does not itself evaluate the remaining boundary optimization in closed form.

A bounded joint-state calculation for every odd rectangle

The one-day ambiguity in Theorem 6.1 can be resolved without exploring a state space that grows with the longer side. The reduction below retains the exceptional mixed histories. We then prove that, after an explicit width- and budget-dependent length threshold, the two solo endpoints alone decide the answer. Scalar necessity for all shorter rectangles at intermediate budgets remains open.

Fix odd nw=2b+13n\ge w=2b+1\ge3 and a feasible budget mb+1m\ge b+1. Retain E=M+1E=M+1, the inverse profiles ιp\iota_p, and the solo deficits Dp(t)D_p(t). Define the following constants, depending only on w,mw,m: d=2mw1,H=b2+1,Γ=m1,K=H1+2m(Γ/w+1),W=Γ+K+1,J=2K+Γ+2m+H+2.\begin{gather} d=2m-w\ge1,\qquad H=b^2+1,\qquad \Gamma=m-1,\notag\\ K=H-1+2m\left(\left\lfloor\Gamma/w\right\rfloor+1\right),\qquad W=\Gamma+K+1,\notag\\ J=2K+\Gamma+2m+H+2. \end{gather}(26)

Theorem 7.1 (Exact evaluation with a length-independent state bound). The minimum capture time on PwPnP_w\mathbin{\square}P_n can be evaluated using at most F=2+2Γ(K+1)F=2+2\Gamma(K+1) retained joint states and at most 4J/d+W+84\left\lceil J/d\right\rceil+W+8 ordinary state updates, together with integer floor divisions and a final optimization over pairs of retained states. Each update considers at most m+1m+1 quota splits per state. All bounds are independent of nn. The calculation determines the exact choice between 2τ12\tau-1 and 2τ2\tau and gives a winning strategy through the compatible prefixes. The bit lengths of the arithmetic inputs still depend on logn\log n.

The endpoint cases are immediate: one day suffices exactly when mE+Mm\ge E+M, and Mm<E+MM\le m<E+M gives two days by inspecting one entire color and then the surviving other cohort. We therefore discuss m<Mm<M.

The exact central optimization

Write A(t)=maxDp(t)A(t)=\max D_p(t) and B(t)=minDp(t)B(t)=\min D_p(t). A deficit pair is exceptional at time t<τt<\tau if its total exceeds B(t)B(t). At each layer retain the two pure solo pairs (D0(t),0),(0,D1(t))(D_0(t),0),(0,D_1(t)) and the attainable exceptional mixed pairs, optionally discarding pairs dominated componentwise. Their exact transition, for quota pp in current color zero, is (x,y)(ι0(y+mp),ι1(x+p)),0pm. (x,y)\longmapsto \bigl(\iota_0(y+m-p),\iota_1(x+p)\bigr),\qquad0\le p\le m. (27) The noncapture bound (25) ensures the inputs are proper whenever the successor time is below τ\tau.

Lemma 7.2 (Discarding low-total mixed states). Iterating (27), retaining only the types just described, gives the exact minimum central inspection requirement CL=min(x,y),(u,v)RL((Exu)++(Myv)+),L=τ1. C_L=\min_{(x,y),(u,v)\in\mathcal R_L} \bigl(\left(E-x-u\right)_++\left(M-y-v\right)_+\bigr),\qquad L=\tau-1. (28) Here RL\mathcal R_L is the retained frontier. The answer is 2τ12\tau-1 exactly when CLmC_L\le m, and is 2τ2\tau otherwise.

Proof. First, a mixed exceptional successor cannot come from a pair whose total is at most B(t)B(t). Apply both inequalities of Lemma 6.2 to the common total input, at most B(t)+mB(t)+m. The second applies because a positive new minority deficit requires its inverse argument to be at least two. The resulting total is at most both next solo capacities. This is the persistence property used below.

By induction every attainable exceptional pair is dominated by a retained attainable pair: mixed exceptional successors have exceptional predecessors, and pure successors are dominated by the corresponding solo endpoint. The transition is monotone. Conversely every retained pair is attained by the exact prefix recurrence of Corollary 5.4. A discarded pair has total at most BB, while every other pair has total at most AA, by Lemma 6.3. Its capped union with any other pair is therefore at most A+B=D0+D1A+B=D_0+D_1, already attained by the two opposite solo endpoints. It cannot improve the central cut.

For completeness, cut a putative (2L+1)(2L+1)-day winning schedule at its central inspection. The first LL inspections and moves give a forward belief; the last LL, read backward along the undirected edges, give a reverse belief on that same day. Their intersection must be inspected. In color pp its size is at least the positive part of the color size minus the two deficits. Canonical domination and the preceding retention argument give the lower bound (28). Conversely realize one retained pair by prefixes and the other by reflecting both coordinates of its prefix construction. On an odd rectangle the reflection preserves colors and reverses their orders. The two beliefs therefore intersect in exactly the displayed positive parts. Inspect that intersection centrally and reverse the second half-schedule. This attains the bound whenever it is at most mm. The uniform one-day theorem gives the alternative 2τ2\tau. ◻

Lemma 7.3 (The ancestry of an exceptional state). Every retained exceptional mixed pair has a realization whose most recent pure ancestor belongs to the currently faster initial cohort. All such pairs at a fixed time therefore have the same primary ancestry. The secondary deficit means the coordinate of the other initial cohort; it need not a priori be the numerically smaller coordinate.

Proof. Replace every pure successor by its solo endpoint, and discard low-total mixed successors by Lemma 7.2. Label a mixed history by its most recent pure ancestor. A slower pure endpoint has total at most BB and cannot produce an exceptional mixed successor.

Suppose an exceptional source has primary physical color zero. Its total ss is at most D0(t)D_0(t). The second inverse concentration inequality bounds a mixed successor’s total by ι1(s+m)ι1(D0(t)+m)=D1(t+1)\iota_1(s+m)\le\iota_1(D_0(t)+m)=D_1(t+1). If the successor is exceptional, color one must consequently be strictly faster. With primary color one, the first concentration inequality instead bounds its total by D0(t+1)D_0(t+1), forcing color zero to be faster. The primary color flips in both cases, exactly as its initial cohort does under movement. Proper inputs hold before τ\tau; positive minority output supplies the extra hypothesis of the second concentration inequality. Persistence excludes low-total mixed predecessors. This proves the assertion inductively, including rebirth from a pure endpoint. At a solo tie no exceptional pair exists. ◻

Only bounded endpoint collars can be exceptional

Lemma 7.4 (Uniform collar bound). For t<τt<\tau, D0(t)D1(t)Γ|D_0(t)-D_1(t)|\le\Gamma. Every attainable exceptional mixed pair satisfies min(x,y)K\min(x,y)\le K.

Proof. The solo recurrence is monotone from its zero initial pair. Write its proper step as (a,c)=(ι0(c+m),ι1(a+m))(a',c')=(\iota_0(c+m),\iota_1(a+m)). Every input is at least m2m\ge2. The three deficit branches of ι0\iota_0 are all at least one, and those of ι1\iota_1 are all at least two. Thus ac+m1a'\le c+m-1 and ca+m2c'\le a+m-2. Since aaa'\ge a and ccc'\ge c, acm1,cam2.a'-c'\le m-1,\qquad c'-a'\le m-2. The initial tie satisfies the symmetric bound as well. This argument includes the final precapture layer; no full inverse endpoint is used.

Put s=x+ys=x+y. If x,yHx,y\ge H at a source layer with a precapture successor, the inverse inputs X,YX,Y satisfy X,YHX,Y\ge H and X+Y=s+mMX+Y=s+m\le M. These inequalities put every lower and reflected root argument beyond its corner: q(Y),q(MY)bq(Y),q(M-Y)\ge b, R(X)b+1R(X)\ge b+1, and 1+R(EX)b+11+R(E-X)\ge b+1. Thus ι0(Y)=Yb,ι1(X)=X(b+1),s=s+mw.\iota_0(Y)=Y-b,\qquad\iota_1(X)=X-(b+1),\qquad s'=s+m-w. Each solo capacity gains at least d=2mwd=2m-w over two proper steps, since its inverse deficit is at most bb or b+1b+1. Consequently two successive bulk source states give (As)(t+2)(As)(t)+w.(A-s)(t+2)\ge(A-s)(t)+w. An exceptional state has 0As<ABΓ0\le A-s<A-B\le\Gamma. A consecutive run of bulk exceptional states therefore has at most 2Γ/w+12\left\lfloor\Gamma/w\right\rfloor+1 transitions.

For a target exceptional mixed state, trace backward to the most recent state with smaller coordinate below HH; such a state exists at time zero. Every intervening bulk state is mixed and exceptional by the persistence property in Lemma 7.2. At entry its smaller coordinate is at most H1+mH-1+m. Each subsequent step increases the smaller coordinate by at most mm, because each proper inverse is at most its argument. The run-length bound gives precisely H1+2m(Γ/w+1)=KH-1+2m(\left\lfloor\Gamma/w\right\rfloor+1)=K. ◻

There are at most Γ\Gamma integer totals strictly between BB and AA including the upper endpoint. For each, at most 2(K+1)2(K+1) pairs have a coordinate at most KK. Adding the two pure endpoints proves the state bound FF in Theorem 7.1.

The long middle forgets its initial mixed histories

Call a layer safe when JD0,D1MJJ\le D_0,D_1\le M-J. These layers form an interval. At a safe layer encode a retained mixed pair by (j,k,)(j,k,\ell): jj is its larger coordinate’s color, kk its smaller deficit, and =Djdj\ell=D_j-d_j its loss relative to the solo capacity in that color. Then 0kK,0Γ+K.0\le k\le K,\qquad0\le\ell\le\Gamma+K. The primary coordinate is greater than KK, so its color is unambiguous. Define the bottom inverses h0(z)=zmin{q(z),b},h1(z)=zmin{R(z),b+1}.h_0(z)=z-\min\{q(z),b\},\qquad h_1(z)=z-\min\{R(z),b+1\}. If rr of the inspections are devoted to the smaller-deficit cohort, the exact normalized transition is (j,k,)(1j,hj(k+r),+r),0rm. (j,k,\ell)\longmapsto (1-j,h_j(k+r),\ell+r),\qquad0\le r\le m. (29) The primary input and the corresponding solo input lie in the same affine profile band; their difference therefore increases by rr. The smaller input is at most K+mK+m and uses only the bottom inverse. To check all margins explicitly, the primary input is between HH and MHM-H, its output remains greater than KK, and safety implies M2JM\ge2J, excluding the reflected branch for an input at most K+mK+m. The definition of JJ ensures these inequalities even on the last safe source step. If its successor remains mixed and exceptional, the collar lemma forces its smaller output to be at most KK.

The solo transition in this region is (D0,D1)=(D1+mb,D0+mb1),Dp(t+2)=Dp(t)+d.(D_0',D_1')=(D_1+m-b,D_0+m-b-1),\qquad D_p(t+2)=D_p(t)+d. Thus its color difference and the exceptional-state filter k<DjminDp\ell-k<D_j-\min D_p are periodic with period two. Moreover, whenever the smaller output is positive, hj(z)z1h_j(z)\le z-1, and (29) gives kk+1.\ell'-k'\ge\ell-k+1. At entry kK\ell-k\ge-K, whereas exceptionality requires k<Γ\ell-k<\Gamma. An initial mixed history cannot persist for Γ+K\Gamma+K safe transitions. Becoming pure resets its relevant history to the dominating solo endpoint; becoming low-total erases its future relevance until a pure state is reached. A new mixed history born from a solo endpoint starts from k==0k=\ell=0 and has bounded age by the same inequality. After W=Γ+K+1W=\Gamma+K+1 safe transitions, every relevant mixed history comes from a recent pure endpoint. Its rules, births and filters depend only on the two-day phase. Therefore the normalized retained frontier is exactly periodic with period two. Pareto pruning preserves this statement: dominance within a primary color depends only on (k,)(k,\ell), and opposite primary colors are incomparable.

Completion of Theorem 7.1. Iterate the retained recurrence until capture or until both solo capacities reach JJ. This takes at most 2J/d+12\left\lceil J/d\right\rceil+1 updates, because every proper pair of steps raises both capacities by at least dd. If a safe interval is entered at t0t_0, its last layer is explicit. For p=0,1p=0,1, let Ap=maxDj(t0+p)A_p=\max D_j(t_0+p); omit a parity with Ap>MJA_p>M-J. Its final safe layer is t0+p+2(MJAp)/d.t_0+p+2\left\lfloor(M-J-A_p)/d\right\rfloor. The larger of these is the last safe layer. Perform at most W+2W+2 updates in the safe interval. If it is longer, stabilization permits an even jump to its last matching parity: for each skipped pair, add dd to both solo capacities and to every retained primary coordinate, leaving smaller coordinates unchanged. Complete the at most one remaining safe transition normally.

After leaving the safe interval, some solo capacity exceeds MJM-J; that cohort has at most JJ rooms remaining, including the majority’s extra room. At most 2J/d+22\left\lceil J/d\right\rceil+2 further steps give capture. If the safe interval was empty when the lower threshold was reached, the same upper-collar bound applies. Stop one layer before the first solo capture and use (28). The generous displayed update bound covers the two collars, warm-up, and parity endpoints.

Every retained history is attainable. At an accelerated layer recover its bounded recent history from a pure solo endpoint, realize that endpoint by the solo prefix construction, and then follow the recorded quota suffix. The central-cut construction in Lemma 7.2, or the solo palindrome when the cut is too expensive, supplies the winning strategy. This proves both exact evaluation and construction without expanding the long affine middle one day at a time. ◻

This is an ordinary geometric and arithmetic proof. It uses the proved prefix reduction but has not been formalized as a complete Lean theorem.

An explicit onset for the scalar formula

Theorem 7.5 (Eventually only the solo endpoints matter). With the constants in (26), put M=2J+Γ+m(W+3).M_*=2J+\Gamma+m(W+3). For every odd nwn\ge w with M=(wn1)/2MM=(wn-1)/2\ge M_*, Tm(PwPn)={2τ1,E+MD0(τ1)D1(τ1)m,2τ,E+MD0(τ1)D1(τ1)>m. T_m(P_w\mathbin{\square}P_n)= \begin{cases} 2\tau-1,&E+M-D_0(\tau-1)-D_1(\tau-1)\le m,\\ 2\tau,&E+M-D_0(\tau-1)-D_1(\tau-1)>m. \end{cases} (30) Thus Proposition 6.4 evaluates the exact answer using O(b)O(b) scalar arithmetic stages; no joint-state optimization is needed.

Proof. The maximum solo deficit increases by at most mm per proper step, because each inverse is at most its argument. This concerns the maximum, not each fixed physical coordinate. At the first layer t0t_0 with both capacities at least JJ, their maximum is at most J+Γ+m1J+\Gamma+m-1. This layer precedes capture: a predecessor with smaller capacity below JJ has maximum at most J+Γ1J+\Gamma-1, and adding mm still leaves both inverse inputs below the full endpoint. Monotonicity and eventual capture ensure that t0t_0 exists. For 0sW+10\le s\le W+1 the maximum is at most J+Γ+m1+msMJJ+\Gamma+m-1+ms\le M-J, while the minimum remains at least JJ. Induction using the same proper-input bound excludes capture during these layers. There are therefore WW consecutive safe transitions.

The age argument above erases every mixed history present at safe entry. After WW transitions every retained mixed state has a pure ancestor within the safe interval. Its ancestry-primary is then the larger coordinate, greater than KK, and its ancestry-secondary is at most KK. This alignment is essential: Lemma 7.4 alone bounds only the numerical minimum.

The alignment persists through the final collar. Following an initial cohort across movement, a secondary deficit at most KK becomes at most K+mK+m, since this input is proper. If the new primary were at most KK, the total would be at most 2K+m<JB2K+m<J\le B, so the successor could not be exceptional. Thus an exceptional successor still has primary greater than KK; the numerical collar bound forces secondary at most KK again. A fresh mixed birth from a pure endpoint obeys the same argument, with secondary output at most mm. Pure states reset to solo endpoints, and persistence excludes revival of a discarded mixed history.

At the midpoint all exceptional states consequently share a primary ancestry by Lemma 7.3, and each has secondary at most KK. A pair of exceptional states leaves at least M2K>mM-2K>m rooms in the other color and cannot win centrally. If at least one state is nonexceptional, the two totals sum to at most A+B=D0+D1A+B=D_0+D_1; their central cost is at least E+MD0D1E+M-D_0-D_1. The two opposite solo endpoints attain precisely this latter cost. Lemma 7.2 now gives (30). ◻

The threshold is deliberately generous. Theorem 7.1 still gives an exact bounded calculation below it. Neither this theorem nor the ancestry lemma asserts serial optimality from arbitrary partial states. The all-length results at minimum budget and at mb2+1m\ge b^2+1 (Theorems 21.1 and 8.1) leave only intermediate budgets b+2mb2b+2\le m\le b^2 for the unrestricted scalar conjecture. The constants are nondecreasing in mm, and M(b,b2)=O(b5)M_*(b,b^2)=O(b^5). Hence any counterexample at a fixed width must have n=O(b4)n=O(b^4); this is a finite obstruction bound, not a claim that those remaining cases satisfy the scalar criterion.

Minimum total probes in the unbounded corner model

The next lemma isolates a second scalar reduction valid at every feasible budget. Its conclusion concerns the number of probes, not a fixed horizon in the full finite rectangle. For k>0k>0 define L0(k)=k+min{R(k),b},L1(k)=k+min{Q(k),b+1},Lp(0)=0.L_0(k)=k+\min\{R(k),b\},\qquad L_1(k)=k+\min\{Q(k),b+1\},\qquad L_p(0)=0. Their inverses are the bottom maps h0,h1h_0,h_1 above. Each is nondecreasing and 11-Lipschitz on the nonnegative integers, vanishes at zero, and has image all nonnegative integers.

Proposition 7.6 (Exact corner ammunition recurrence). Let μp(k)\mu_p(k) be the least total quota in an alternating growth sequence v=hp(v+r)v'=h_p(v+r), 0rm0\le r\le m, starting from zero in either phase and ending at least kk in color pp. The horizon is unrestricted. Then μp(0)=0\mu_p(0)=0, μp(k)k\mu_p(k)-k is nondecreasing, exact targets are attainable, and μp(k)=min{m,Lp(k)}+μ1p((Lp(k)m)+). \mu_p(k)=\min\{m,L_p(k)\} +\mu_{1-p}\bigl(\left(L_p(k)-m\right)_+\bigr). (31) Every two positive recursive calls strictly decrease their argument. The minimum growth time is μp(k)/m\left\lceil\mu_p(k)/m\right\rceil. At any prescribed horizon tt, the target is feasible exactly when μp(k)mt\mu_p(k)\le mt; its minimum ammunition then remains μp(k)\mu_p(k). The initial zero phase is free here. With a fixed initial phase, the horizon and final phase must have the corresponding cyclic compatibility. For inspection-before-movement clearing with profiles LpL_p, the minimum total quota is Fp(k)={k,km,m+μp(km),k>m,Fp(k)=m+F1p(Lp(km))(k>m).F_p(k)= \begin{cases}k,&k\le m,\\m+\mu_p(k-m),&k>m,\end{cases} \qquad F_p(k)=m+F_{1-p}(L_p(k-m))\quad(k>m). Thus greedy full quotas minimize total probes in this unbounded model.

Proof. Feasibility follows since h0(z+m)z+1h_0(z+m)\ge z+1 and h1(z+m)zh_1(z+m)\ge z. In a fixed growth schedule, deleting one probe changes the final output by at most one, by monotonicity and the Lipschitz bound. Deleting probes from an optimal schedule until its output first hits <k\ell<k removes at least kk-\ell probes. The remaining cost is at least μp()\mu_p(\ell), proving monotone excess; the same deletion argument gives optimal schedules with exact output.

Put z=Lp(k)z=L_p(k), the least input with hp(z)kh_p(z)\ge k. A last-step predecessor must be at least v0=(zm)+v_0=\left(z-m\right)_+. For v0vzv_0\le v\le z, monotone excess gives μ1p(v)+zvμ1p(v0)+min{m,z}.\mu_{1-p}(v)+z-v\ge\mu_{1-p}(v_0)+\min\{m,z\}. For vzv\ge z the same bound follows from monotonicity of the excess. Attain v0v_0 optimally and use quota min(m,z)\min(m,z); since hp(z)=kh_p(z)=k, equality is attained. This proves (31). Its predecessor is strictly smaller than kk in color zero and at most kk in color one, so two calls strictly descend.

Every nonterminal positive call contributes mm and the terminal one contributes an integer from one to mm. Reading backward gives one possibly partial first quota followed by full quotas, in exactly μp(k)/m\left\lceil\mu_p(k)/m\right\rceil steps. A tt-step schedule spends at most mtmt, proving the horizon lower bound. When tt is larger, prepend zero steps: all maps fix zero, and choosing the initial phase to end in pp aligns the optimal block correctly. For a fixed initial phase this requires the stated compatibility. Padding at the end of a positive block is not used. In particular, Dpbottom(t)=max{k:μp(k)mt}.D_p^{\mathrm{bottom}}(t)=\max\{k:\mu_p(k)\le mt\}.

Finally the inverse threshold identity, applied backward through the nonterminal moves of a clearing schedule, gives Fp(k)=min0rmin(m,k)(r+μp(kr)).F_p(k)=\min_{0\le r\le\min(m,k)} \bigl(r+\mu_p(k-r)\bigr). Monotone excess makes the largest allowed first quota optimal, giving the displayed formula. A full first quota followed by the optimal continuation gives the equivalent clearing recurrence. ◻

Remark 7.7 (Cyclic growth controls). The proof requires no special root identities. Let the phases form any nonempty finite cycle, let m1m\ge1, and let each hp:NNh_p:\mathbb{N}\to\mathbb{N} be nondecreasing and onto. These assumptions imply hp(0)=0h_p(0)=0 and increments in {0,1}\{0,1\}. With least-input inverse LpL_p, a target (p,k)(p,k) is feasible exactly when the reverse threshold orbit (p,k)(p1,(Lp(k)m)+)(p,k)\longmapsto(p-1,\left(L_p(k)-m\right)_+) reaches zero. Necessity follows by propagating required predecessors backward through any actual schedule; sufficiency assigns the least predecessor and quota min(m,Lp(k))\min(m,L_p(k)) at each reverse step. For feasible targets the same deletion and last-step proof gives (31), with phase subtraction taken cyclically, and the same exact cost and horizon conclusions. Intermediate reverse targets may increase; termination, rather than per-step decrease, is the essential condition. The bottom root maps supply a simple terminating instance. With a fixed initial phase aa, the prescribed-horizon assertion requires a+t=pa+t=p in the phase cycle.

This proposition omits the reflected end branches by definition. It does not by itself justify allocating full quotas serially in the two-cohort rectangle problem. The following conditional exchange states precisely where it does apply to the finite board.

Lemma 7.8 (Suffix exchange beyond the primary lower corner). Consider a legal history up to t<τt<\tau, with a pure solo endpoint for an initial cohort AA at time iti\le t. Suppose that every subsequent inverse input of AA is at least H=b2+1H=b^2+1. Its final deficit pair is componentwise dominated by a history of the same length consisting of full quotas on AA, one possibly shared quota, then full quotas on the opposite initial cohort BB. Empty and pure-block degenerations are allowed.

Proof. On proper inputs zHz\ge H, the lower root in IpI_p has reached its cap and the reflected root is nonincreasing. Hence Ip(z)zI_p(z)-z is nondecreasing, so Ip(v)Ip(u)vu(vuH).I_p(v)-I_p(u)\ge v-u\qquad(v\ge u\ge H). Before τ\tau, the two input deficits sum to at most MM. Thus every old BB input is at most MHM-H, where the finite inverse agrees with the bottom map. Let r=tir=t-i, let kk be the final BB deficit, and let pp be its final physical color. The cases r=0r=0 and k=0k=0 are immediate. Otherwise write μ=μp(k)\mu=\mu_p(k) and let QμQ\ge\mu be the old total quota on BB. Pack the exact minimum-ammunition block as late as possible in the same rr steps: zeros, one partial quota, then full quotas. Its cumulative quota at step ss is (μm(rs))+\left(\mu-m(r-s)\right)_+. The old cumulative quota is at least (Qm(rs))+\left(Q-m(r-s)\right)_+, and hence at least the new one.

Assign the complementary quota to AA. If Δs0\Delta_s\ge0 is its cumulative new-minus-old quota, induction gives new-minus-old primary deficit at least Δs\Delta_s: the next input difference is at least Δs+1\Delta_{s+1}, and the displayed expansion preserves this inequality. Both histories are legal from the full board, so coordinatewise solo domination and t<τt<\tau keep every new input proper independently of the induction.

The packed BB block has nondecreasing inputs, because after its first partial quota it uses mb+1m\ge b+1 at every step. Its final input is Lp(k)L_p(k), no greater than the old final input and hence at most MHM-H. Every new BB input therefore remains in the bottom range, and the finite-board output is exactly kk. Beginning padding preserves the initial cohort: total length and final physical color are fixed. Thus AA improves and BB is unchanged. Before the packed block the new history simply extends the original pure solo trajectory, giving the asserted two-block form. ◻

The lower-corner hypothesis is essential to this proof. No analogous exchange, or unrestricted scalar midpoint criterion, is asserted for histories entering that corner. The generic concentration, ancestry and midpoint implications have a Lean development with their inverse and secondary-bound hypotheses explicit; the physical corner-clock and safe-interval instantiations here and the conditional exchange remain ordinary proofs.

Explicit formulas at large budgets on every odd rectangle

The exact recurrence of Corollary 5.4 admits a closed solution in a uniform budget range, with no restriction on the length. Let w=2b+13,nw odd,N=wn=2h+1,B=b2.w=2b+1\ge3,\qquad n\ge w\text{ odd},\qquad N=wn=2h+1,\qquad B=b^2. The majority and minority classes have sizes K0=h+1K_0=h+1 and K1=hK_1=h. All neighborhood profiles and prefixes below are those of Theorem 5.1.

Define L0(0)=L1(0)=0L_0(0)=L_1(0)=0 and, for k>0k>0, L0(k)=k+min{R(k),b},L1(k)=k+min{Q(k),b+1}. L_0(k)=k+\min\{R(k),b\},\qquad L_1(k)=k+\min\{Q(k),b+1\}. (32) These are the corner profiles before the far boundary clips a neighborhood. In particular gz(k)Lz(k)g_z(k)\le L_z(k). For r>0r>0 put J(r)={L1(r/2),r even,L0((r+1)/2),r odd,δ(r)={L0(r/2+1)L1(r/2),r even,L1((r+1)/2)L0((r+1)/2),r odd.\begin{aligned} J(r)&= \begin{cases} L_1(r/2),&r\text{ even},\\ L_0((r+1)/2),&r\text{ odd}, \end{cases}\\ \delta(r)&= \begin{cases} L_0(r/2+1)-L_1(r/2),&r\text{ even},\\ L_1((r+1)/2)-L_0((r+1)/2),&r\text{ odd}. \end{cases} \end{aligned}(33, 34) Set J(0)=δ(0)=0J(0)=\delta(0)=0. The two corner profiles interlace, so δ(r){0,1}\delta(r)\in\{0,1\}. These explicit square-root functions describe the small set left by the first sweep and the inspection cost for starting the second sweep on the same day.

Theorem 8.1 (All odd rectangles above a quadratic budget). Suppose mb2+1m\ge b^2+1. If mNm\ge N, then Tm(PwPn)=1T_m(P_w\mathbin{\square}P_n)=1; if hm<Nh\le m<N, then Tm(PwPn)=2T_m(P_w\mathbin{\square}P_n)=2. For m<hm<h, write D=2mw,Nw1=qD+r,0r<D.D=2m-w,\qquad N-w-1=qD+r,\qquad 0\le r<D. Then Tm(PwPn)={2q,r=0,2q+1,r>0 and 2J(r)+δ(r)m,2q+2,r>0 and 2J(r)+δ(r)>m. T_m(P_w\mathbin{\square}P_n)= \begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }2J(r)+\delta(r)\le m,\\ 2q+2,&r>0\text{ and }2J(r)+\delta(r)>m. \end{cases} (35) The constructions use two prefix sweeps, with at most one shared day. The lower bound applies to arbitrary inspection schedules.

Corollary 8.2 (A formula using only integer division). For m2b2+1m\ge2b^2+1 and m<hm<h, put cm=mw1+1{m=2b2+1}c_m=m-w-1+\mathbf{1}_{\{m=2b^2+1\}}. With the same q,rq,r, Tm(PwPn)={2q,r=0,2q+1,1rcm,2q+2,r>cm.T_m(P_w\mathbin{\square}P_n)= \begin{cases} 2q,&r=0,\\ 2q+1,&1\le r\le c_m,\\ 2q+2,&r>c_m. \end{cases}

An inspection potential and a solved partial-state recurrence

Write ρz(k)=Lz(k)k\rho_z(k)=L_z(k)-k, with ρz(0)=0\rho_z(0)=0. For k>0k>0, 0L0(k+1)L1(k)1,0L1(k)L0(k)1.0\le L_0(k+1)-L_1(k)\le1,\qquad 0\le L_1(k)-L_0(k)\le1. Both LzL_z and their surpluses ρz\rho_z are nondecreasing. Thus JJ is nondecreasing, J(r+2)J(r)+1J(r+2)\ge J(r)+1, and J(1)=2J(1)=2. Throughout the proof we assume mB+1m\ge B+1. Then D>0D>0 and J(D)=mJ(D)=m.

Assign a nonempty parity-zz count kk the rank u=2k+zu=2k+z. Define F(u)={u/2,u/2m,am+J(s),uw1=aD+s,0s<D,u/2>m. F(u)= \begin{cases} \left\lfloor u/2\right\rfloor,&\left\lfloor u/2\right\rfloor\le m,\\ am+J(s),&u-w-1=aD+s,\quad0\le s<D, \quad\left\lfloor u/2\right\rfloor>m. \end{cases} (36) In particular F(0)=F(1)=0F(0)=F(1)=0. Empty supports always have potential zero. The function measures a lower bound on the total number of inspections still required against one cohort.

Lemma 8.3 (Interior inequality and its equality cases). The function FF is nondecreasing, F(u)u/2F(u)\ge\left\lfloor u/2\right\rfloor, and F(u+2)F(u)+1F(u+2)\ge F(u)+1. For 0pm0\le p\le m, F(2k+z)p+F(2Lz((kp)+)+1z). F(2k+z)\le p+F\bigl(2L_z(\left(k-p\right)_+)+1-z\bigr). (37) Put j(u)=(uw2)+/Dj(u)=\left\lfloor\left(u-w-2\right)_+/D\right\rfloor. Every noncapture equality in (37) lowers jj by exactly one. A capture has source quotient zero.

Proof. For j1j\ge1, use the positive-remainder convention u=w+1+jD+su=w+1+jD+s, 1sD1\le s\le D. Then F(u)=jm+J(s)=u+jw2ϵ(s),0ϵ(s)=s+w+12J(s)b1.F(u)=jm+J(s)=\left\lfloor\frac{u+jw}{2}\right\rfloor-\epsilon(s),\qquad 0\le\epsilon(s)=\left\lfloor\frac{s+w+1}{2}\right\rfloor-J(s)\le b-1. At j=0j=0, F(u)=u/2F(u)=\left\lfloor u/2\right\rfloor, without a correction. These formulas prove the stated monotonicity properties, including the period boundaries. A capturable source has potential kk. Every nonempty survivor has Lz(kp)>kpL_z(k-p)>k-p, so a noncapture transition from kmk\le m is strict.

Suppose k>mk>m and put s=kp>0s=k-p>0. On the plateau of LzL_z, the next rank is v=u2p+wv=u-2p+w. If pbp\le b, then vu+1v\ge u+1: monotonicity makes the inequality strict for p>0p>0, while p=0p=0 is strict because vu+2v\ge u+2. If p>bp>b, the quotient cannot increase and decreases by at most one. When it stays unchanged, the floor term, after including the pp inspections, increases by at least bb; the correction can save at most b1b-1. When the quotient falls once, its positive remainders obey t=s+2(mp)t=s+2(m-p), with s,ts,t now denoting those remainders. Hence J(t)J(s)mpJ(t)-J(s)\ge m-p, as required. A target of quotient zero has its actual cardinality as potential, at least the corresponding J(t)J(t).

Off the plateau, the survivor size is at most b(b1)b(b-1) in phase one or (b1)2(b-1)^2 in phase zero. Its next count is at most B<mB<m. Since m>Bm>B, the noncapturable source has quotient exactly one. Write a=km>0a=k-m>0 and e=mpe=m-p, so the survivor size is a+ea+e. Substitution gives F(2k+z)=m+Lz(a)F(2k+z)=m+L_z(a), and Lz(a+e)Lz(a)eL_z(a+e)-L_z(a)\ge e proves the inequality. This step goes from quotient one to zero. Finally a capture source has kpmk\le p\le m, hence quotient zero. ◻

Lemma 8.4 (Full-budget capacity). Using the unbounded profiles LzL_z, the largest starting count in phase zz that clears in t1t\ge1 consecutive mm-inspection days is Az(t)=tD+w+1z2.A_z(t)=\left\lfloor\frac{tD+w+1-z}{2}\right\rfloor. In particular an actual finite-board prefix of rank at most tD+w+1tD+w+1 clears in tt such days.

Proof. All queried capacities are at least mB+1m\ge B+1, beyond the last nonplateau output. The inverse of LzL_z there is subtraction by b+zb+z. Thus Az(1)=mA_z(1)=m and Az(t+1)=m+A1z(t)(b+z)A_z(t+1)=m+A_{1-z}(t)-(b+z). The displayed formula solves these two affine recurrences. Finite-board neighborhoods are no larger, and compatible prefixes realize every step. ◻

A finite correction for the far corner

For a count kk in phase zz, let d=Kzkd=K_z-k be its deficit from a full cohort. For a noncapture step with pp useful inspections, write d=K1zgz(kp)d'=K_{1-z}-g_z(k-p). The profiles imply dd+p. d'\le d+p. (38) For majority survivors this uses g0(s)s1g_0(s)\ge s-1; for nonempty minority survivors it uses the strict Hall bound g1(s)s+1g_1(s)\ge s+1. The inequality need not hold at capture, which will be treated separately. If gz(s)Lz(s)g_z(s)\ne L_z(s), the survivor deficit x=Kzs=d+px=K_z-s=d+p is at most BB. Define the finite constant C=minz{0,1}0xB[x+F(2gz(Kzx)+1z)] C=\min_{\substack{z\in\{0,1\}\\0\le x\le B}} \left[x+F\bigl(2g_z(K_z-x)+1-z\bigr)\right] (39) and the monotone potential Φz(k)=min{F(2k+z),(CKz+k)+},Φz(0)=0. \Phi_z(k)=\min\{F(2k+z),\left(C-K_z+k\right)_+\},\qquad \Phi_z(0)=0. (40) All sets in (39) are nonempty because nwn\ge w. The x=0x=0 cases give CF(N),F(N+1)C\le F(N),F(N+1).

Lemma 8.5 (Boundary envelope). For every exact-profile transition, Φz(k)p+Φ1z(gz((kp)+)).\Phi_z(k)\le p+\Phi_{1-z}(g_z(\left(k-p\right)_+)). Consequently Tm(PwPn)2C/mT_m(P_w\mathbin{\square}P_n)\ge\left\lceil 2C/m\right\rceil.

Proof. For a noncapture step, (38) gives the inequality against the target’s linear branch. If the far corner does not clip, Lemma 8.3 gives the inequality against its FF branch. Otherwise x=d+pBx=d+p\le B, and the defining minimum gives Cdp+F(next rank)C-d\le p+F(\text{next rank}). Thus the source is at most pp plus each target branch. At capture, kpmk\le p\le m and Φz(k)F(2k+z)=kp\Phi_z(k)\le F(2k+z)=k\le p. Both initial potentials equal CC and both terminal potentials are zero. Summing over the two cohorts gives the bound. Monotonicity of Φ\Phi and the isoperimetric lower bounds give the same comparison for arbitrary physical supports; no special shape of an uncompressed belief is assumed. ◻

Lemma 8.6 (Corner correction). For mB+1m\ge B+1 and m<hm<h, F(N)1CF(N).F(N)-1\le C\le F(N). For mB+bm\ge B+b, the stronger equality C=F(N)C=F(N) holds.

Proof. For x>0x>0, the two full-cohort departures in (39) have next ranks NdE(x),dE(x)=2(xR(x));NdO(x),dO(x)=2(xQ(x))+1.N-d_E(x),\quad d_E(x)=2(x-R(x));\qquad N-d_O(x),\quad d_O(x)=2(x-Q(x))+1. For xBx\le B, the high-end term in the finite profile indeed gives these expressions. A negative gain, possible at x=1x=1 in the minority case, is harmless by monotonicity. Every nonnegative gain is at most 2B2b<D2B-2b<D, so at most one quotient boundary is crossed.

Without a quotient crossing, the potential drop is at most xx. One can use the strict inequalities proved below in (43) when the target remainder is positive. If that remainder is zero, direct substitution gives J(dE(x))xJ(d_E(x))\le x and J(dO(x))xJ(d_O(x))\le x instead.

It remains to bound a crossing. Put a=R(x)a=R(x) for an EE departure, a=Q(x)a=Q(x) for an OO departure, and d=bad=b-a. Let Δ\Delta be F(N)F(N) minus the departure cost. The following table writes its periodic endpoint expression; using the actual cardinality branch of FF can only decrease Δ\Delta. Here the source remainder is 2k2k or 2k+12k+1.

Case Target argument \ell cc Δ\Delta
EE, even mbx+a+km-b-x+a+k ρ1(k)\rho_1(k) d+cρ0()d+c-\rho_0(\ell)
EE, odd mbx+a+km-b-x+a+k ρ0(k+1)\rho_0(k+1) d+1+cρ1()d+1+c-\rho_1(\ell)
OO, even mbx+a+k1m-b-x+a+k-1 ρ1(k)\rho_1(k) d+1+cρ1()d+1+c-\rho_1(\ell)
OO, odd mbx+a+km-b-x+a+k ρ0(k+1)\rho_0(k+1) d+1+cρ0()d+1+c-\rho_0(\ell)

All target arguments are positive. Suppose first that c>0c>0. If Δ2\Delta\ge2, its bound on the target surplus is below that surplus’s plateau, so the defining square or consecutive-product inequality applies without clipping. Substitute xa2x\le a^2 for EE and xa(a1)x\le a(a-1) for OO, together with k(c1)(c2)+1k\ge(c-1)(c-2)+1 in an even-source row and k(c1)2k\ge(c-1)^2 in an odd-source row. Write v=2d(ca)v=2d(c-a) and I=1{a=b+1}I=\mathbf{1}_{\{a=b+1\}}. Rearrangement gives the bounds in the middle column below. Assuming only Δ1\Delta\ge1 increases the allowed target root by one and gives the last column.

Case Upper bound on mBm-B if Δ2\Delta\ge2 Upper bound if Δ1\Delta\ge1
EE, even v3dc+1v-3d-c+1 vd+c2v-d+c-2
EE, odd v2dc+1v-2d-c+1 v+c1v+c-1
OO, even vdbbIv-d-b-bI v+d+2cb2bIv+d+2c-b-2-bI
OO, odd vbbIv-b-bI v+2d+2cb1bIv+2d+2c-b-1-bI

The indicator comes from xBx\le B, which improves xa(a1)x\le a(a-1) by bb when a=b+1a=b+1.

For EE we have d0d\ge0 and cabc\le a\le b, with c2c\ge2 in the even row. The middle-column bounds are nonpositive; the last-column bounds are at most b2b-2 and b1b-1. For OO with aba\le b, the same conclusions hold, with last-column bounds at most b2b-2 and b3b-3; the odd row has ca1c\le a-1. For a=b+1a=b+1, the middle-column bounds become 32c3-2c and 22c2-2c, and the last-column bounds both become 1-1. Thus Δ2\Delta\ge2 contradicts mB+1m\ge B+1, while Δ1\Delta\ge1 contradicts mB+bm\ge B+b.

If c=0c=0, only even-source rows occur, with k=0k=0. The assumption Δ2\Delta\ge2 forces d3d\ge3 and gives, respectively, mB2ad3d+4m-B\le-2ad-3d+4 and mB2addb+3m-B\le-2ad-d-b+3, both nonpositive. The assumption Δ1\Delta\ge1 forces d2d\ge2 and gives mB2add+1m-B\le-2ad-d+1 and mB2ad+db+1m-B\le-2ad+d-b+1, both below bb. This completes both lower bounds on CC. The x=0x=0 majority departure always supplies the upper bound CF(N)C\le F(N). ◻

The attaining sweeps

The upper construction works throughout mB+1m\ge B+1. Suppose m<hm<h. Start with the minority cohort. Every noncapture full-budget shot decreases its rank by at least DD. If r=0r=0, its rank is qD+w+1qD+w+1, so Lemma 8.4 clears it in qq days. Here qq is odd, since Nw1N-w-1 and DD are odd. The other untouched cohort is therefore also minority when its qq-day sweep starts.

If r>0r>0, after q1q-1 full shots the first rank is at most 2m+r+12m+r+1. Its next shot leaves at most J(r)J(r) rooms: the last survivor has phase one and size at most r/2r/2 for even rr, or phase zero and size at most (r+1)/2(r+1)/2 for odd rr. Clear those rooms on day q+1q+1.

On the same day, the other cohort is minority for even rr and majority for odd rr. To put its next rank at most qD+w+1qD+w+1, create a deficit of r/2+1r/2+1 majority rooms in the even case, or (r+1)/2(r+1)/2 minority rooms in the odd case. Inspecting the neighbors of a terminal corner prefix achieves this at costs, respectively, L0(r/2+1)=J(r)+δ(r),L1((r+1)/2)=J(r)+δ(r).L_0(r/2+1)=J(r)+\delta(r),\qquad L_1((r+1)/2)=J(r)+\delta(r). These neighborhoods are terminal prefixes too; the remaining initial prefix is a compatible next belief. The next qq full shots suffice by Lemma 8.4. Thus a shared day works precisely at the stated sufficient budget 2J(r)+δ(r)m2J(r)+\delta(r)\le m. Otherwise either full phase has rank at most (q+1)D+w+1(q+1)D+w+1, because r+1Dr+1\le D, and two (q+1)(q+1)-day sweeps give the other upper bound. Early capture during a sweep only reduces its actual inspection costs.

For mNm\ge N one inspection of the entire board suffices. For hm<Nh\le m<N, inspect the minority class on day one; after movement the other cohort occupies at most the hh minority rooms and clears on day two. One day is impossible when m<Nm<N.

The equality case and the missing shared-day inspection

For mB+bm\ge B+b, Lemmas 8.5 and 8.6 give the lower bound 2F(N)/m\left\lceil 2F(N)/m\right\rceil. It matches the construction except when 2J(r)=m,δ(r)=1. 2J(r)=m,\qquad\delta(r)=1. (41) We now rule out 2q+12q+1 days in this case. Assume first b2b\ge2. Then m>Bm>B, r2r\ge2, r<Dr<D, and C=qm+m/2C=qm+m/2. Moreover F(N+1)=C+1,Ch=(q1)w+mr22. F(N+1)=C+1,\qquad C-h=\frac{(q-1)w+m-r}{2}\ge2. (42) For the latter inequality, mr4m-r\ge4 for even rr and mr3m-r\ge3 for odd rr. Every linear branch of Φ\Phi is consequently positive on nonempty supports; its zero cutoff cannot introduce a false equality.

We first record the strict inequalities used when a full-cohort corner departure leaves the same positive quotient. For x>0x>0, put a=R(x)a=R(x) in the first two rows and a=Q(x)a=Q(x) in the last two. For positive displayed arguments and xBx\le B, x+L1(kx+a)>L1(k),E, r=2k,x+L0(kx+a)>L0(k),E, r=2k1,x+L0(kx+a)>L1(k),O, r=2k,x+L1(kx+a1)>L0(k),O, r=2k1.\begin{aligned} x+L_1(k-x+a)&>L_1(k),& &E,\ r=2k,\nonumber\\ x+L_0(k-x+a)&>L_0(k),& &E,\ r=2k-1,\nonumber\\ x+L_0(k-x+a)&>L_1(k),& &O,\ r=2k,\\ x+L_1(k-x+a-1)&>L_0(k),& &O,\ r=2k-1.\nonumber \end{aligned}(43) Here EE and OO indicate the phase of the full cohort, while the source potential is qm+J(r)qm+J(r) in both cases.

To verify these inequalities, write cc for the source surplus. In the first row, the cost difference is a+ρ1(target)ca+\rho_1(\text{target})-c. It is positive if ac1a\ge c-1. Otherwise the bounds k(c1)(c2)+1k\ge(c-1)(c-2)+1 and xa2x\le a^2 place the target above (ca)(ca1)(c-a)(c-a-1): their difference is at least 2c(a1)2a2+3>02c(a-1)-2a^2+3>0. Its surplus is therefore at least ca+1c-a+1. For the second row, only a<ca<c needs checking; the target exceeds (ca)2(c-a)^2 by at least 2c(a1)2a2+a+2>02c(a-1)-2a^2+a+2>0. For the third row, use a2a\ge2, xa(a1)x\le a(a-1), and k(c1)(c2)+1k\ge(c-1)(c-2)+1; when a<ca<c, the target exceeds (ca)2(c-a)^2 by at least (2a3)c2a2+2a+3>0(2a-3)c-2a^2+2a+3>0. For the last row, its cost difference is a1+ρ1(target)ca-1+\rho_1(\text{target})-c. When a<ca<c, the target exceeds (ca+1)(ca)(c-a+1)(c-a) by at least (2a3)c2a2+3a+1>0(2a-3)c-2a^2+3a+1>0. The required surpluses are all at most their plateau caps. The remaining cases follow from the minimum positive surpluses one and two. This proves (43).

Suppose now that a strategy captured in 2q+12q+1 days. Its available inspections total 2C2C, so every step must be tight in the envelope inequality and every day must use all mm useful inspections. A positive full departure has d<pd'<p. A proper nonempty source has d<d+pd'<d+p on every noncapture step: its majority survivors have surplus at least zero, and its minority survivors have surplus at least two. Together with (42), these facts make a target linear branch strictly inefficient. Every tight target after departure therefore uses FF, and its potential remains below CC.

A positive full departure lowers jj exactly once. For pBp\le B its rank gain is less than DD, and (43) excludes no drop. For p>Bp>B there is no corner clipping: a majority departure is strict because its initial FF value is C+1C+1, while a tight minority departure has one drop by Lemma 8.3.

Consider a later clipped step, with proper-source deficit dd and x=d+pBx=d+p\le B. Its output equals that of a full-cohort xx-inspection departure. Its source quotient is either qq or q1q-1, since D2B1D\ge2B-1 and r2r\ge2. If both source and target quotients equal qq, the strict corner inequalities give p+F(target)>CdΦ(source)p+F(\text{target})>C-d\ge\Phi(\text{source}). If the source quotient is q1q-1, then F(source)<Cd. F(\text{source})<C-d. (44) For completeness, when r=2sr=2s put α=ρ1(s)\alpha=\rho_1(s), so m/2=s+αm/2=s+\alpha; when r=2s1r=2s-1 put α=ρ0(s)\alpha=\rho_0(s), so again m/2=s+αm/2=s+\alpha. Substitution in FF bounds CdF(source)C-d-F(\text{source}) below by α1,α,α,α\alpha-1,\alpha,\alpha,\alpha for EE/even, OO/even, EE/odd, OO/odd, respectively. All are positive. At q=1q=1 the source quotient is zero and only even rr occurs; its cardinality potential gives exactly α1\alpha-1 and α\alpha. Thus (44) includes this endpoint. The full-corner lower bound gives x+F(target)Cx+F(\text{target})\ge C, making this proper transition strict too.

Consequently every tight clipped step goes from qq to q1q-1. Every other tight noncapture step has a single quotient drop by Lemma 8.3, and capture starts at quotient zero. Each cohort therefore has exactly q+1q+1 consecutive active days, from its first positive allocation through capture. Two such intervals covering the 2q+12q+1-day horizon start on days 00 and qq and overlap once. The first day spends all mm on its only active cohort, which must be minority: a full-majority mm-inspection departure is unclipped and strict. The first cohort spends qmqm before the shared day and therefore needs exactly Cqm=m/2C-qm=m/2 inspections on that final day.

For even r=2sr=2s, the other cohort is minority on the shared day. Its necessary quotient drop requires at least s+1s+1 majority rooms to be absent from the next belief. All neighbors of those absent rooms must be inspected, requiring at least g0(s+1)=L0(s+1)=J(r)+δ(r)=m/2+1g_0(s+1)=L_0(s+1)=J(r)+\delta(r)=m/2+1 inspections. For odd r=2s1r=2s-1, the other cohort is majority and the same argument uses ss absent minority rooms and g1(s)=L1(s)=m/2+1g_1(s)=L_1(s)=m/2+1. These profiles equal LzL_z: the complementary deficits of the absent sets are at least m>Bm>B, using q1q\ge1 and the parity of qq (for odd rr, qq is even and at least two). Thus the shared day needs more than mm inspections, a contradiction.

For b=1b=1, the case m=2m=2 has D=1D=1 and r=0r=0, and follows directly from C=F(N)C=F(N) and the solo construction. At m3m\ge3 the same equality argument applies; a critical remainder has m4m\ge4, r=m31r=m-3\ge1, and the clipped proper-source cases are immediate since B=1B=1: only a majority survivor of deficit one can clip, and its neighborhood is the full minority class, of potential CC. Such a return to full is impossible after a tight departure. This proves the formula for every mB+bm\ge B+b.

The full range mB+1m\ge B+1: a one-unit slack argument

It remains to add B+1m<B+bB+1\le m<B+b. For b=1b=1 this interval is empty. For b=2b=2 its only budget is m=5m=5: then q=n2q=n-2, r=4r=4, and J(4)=4J(4)=4. The corner-correction lemma gives C5q+3C\ge5q+3, so the initial potential 2C10q+62C\ge10q+6 exceeds the 10q+510q+5 inspections available in 2q+12q+1 days. The two sweeps above attain 2q+22q+2 days. This proves that endpoint directly, without using a separate five-row classification. Henceforth assume b3b\ge3. The minimum square size and D2B3D\le2B-3 give q2q\ge2. Put η=F(N)C{0,1}\eta=F(N)-C\in\{0,1\}. At r=0r=0, the c=0c=0 positive-discount bounds in the proof of Lemma 8.6 are nonpositive, so η=0\eta=0 and the lower time is 2q2q.

A positive corner discount necessarily has δ(r)=0\delta(r)=0. To see this, suppose δ(r)=1\delta(r)=1. In an even-remainder row of the corner table, c=ρ1(k)=ρ0(k+1)c=\rho_1(k)=\rho_0(k+1), so k(c1)2k\ge(c-1)^2, improving the earlier lower bound by c2c-2. In an odd-remainder row, ρ1(k+1)=c+1\rho_1(k+1)=c+1, so kc(c1)k\ge c(c-1), an improvement by c1c-1. The four upper bounds on mBm-B for a positive discount become vd,v,v+ca,v+2d+cb,v=2d(ca).v-d,\qquad v,\qquad v+c-a,\qquad v+2d+c-b, \quad v=2d(c-a). The first three are nonpositive since d0d\ge0 and cac\le a. The last is at most d1-d-1, since ca1c\le a-1. The exceptional last minority band a=b+1a=b+1 already has upper bound 1-1 before this improvement. Thus a discount contradicts m>Bm>B when δ=1\delta=1.

For r>0r>0, Lemma 8.6 gives Cqm+1C\ge qm+1. The lower time is at least 2q+12q+1, so only a proposed upper of 2q+22q+2 needs attention. Its unresolved cases are precisely η2J(r)mδ(r)A001B110C120.\begin{array}{c|ccc} &\eta&2J(r)-m&\delta(r)\\\hline A&0&0&1\\ B&1&1&0\\ C&1&2&0. \end{array} We exclude 2q+12q+1 days in all three cases.

Exact counters and tight proper tails.

By Corollary 5.4, it suffices to study exact profile counters. More explicitly, retain any alleged physical strategy’s useful allocations and evolve the minimum-profile counters, capping allocations if the smaller counter has already been reached. Monotonicity keeps these counters below the actual cardinalities, and compatible prefixes attain them with no greater daily budget. They therefore capture by the alleged deadline; pad with zero allocations if capture occurs early. All following equalities use these exact gzg_z updates.

The nonnegative slack of one cohort step is p+Φ(next)Φ(current)p+\Phi(\text{next})-\Phi(\text{current}). Add each day’s unused budget. Over a (2q+1)(2q+1)-day successful schedule the total is (2q+1)m2C(2q+1)m-2C, which is 0,1,00,1,0 in cases A,B,CA,B,C, respectively. In AA and BB, Ch=(q1)w+m+(2Jm)2ηr2>1.C-h=\frac{(q-1)w+m+(2J-m)-2\eta-r}{2}>1. Indeed mr3m-r\ge3, q2q\ge2, and w7w\ge7 suffice. Every nonempty linear branch CdC-d is thus positive and strictly exceeds the support size.

Every tight noncapture step from a proper nonempty support is positive, remains proper, and lowers jj by one. Here are the adjustments needed to extend the preceding argument to the present budgets. A linear target is still strict because d<d+pd'<d+p. An unclipped tight step has one quotient drop by Lemma 8.3. A return to full is strict because its potential CC exceeds that of the source.

For a positive clipped step, d+pBd+p\le B, so dB1d\le B-1. Its source quotient is qq or q1q-1, because D+r>2B2D+r>2B-2. For b4b\ge4, in case AA the even and odd bounds are, respectively, D+r3B4bD+r\ge3B-4b and D+r3B4b+1D+r\ge3B-4b+1; case BB improves them by one. They all exceed 2B22B-2. For b=3b=3, direct substitution into JJ gives J(4)=4J(4)=4, J(5)=5J(5)=5, J(6)=J(7)=6J(6)=J(7)=6, J(8)=7J(8)=7, and δ(5)=δ(7)=1\delta(5)=\delta(7)=1, δ(6)=0\delta(6)=0. Hence the possible critical residues are exactly mrD+rA10518B11621C10619.\begin{array}{c|ccc} &m&r&D+r\\\hline A&10&5&18\\ B&11&6&21\\ C&10&6&19. \end{array} In particular the rows A,BA,B needed here both exceed 2B2=162B-2=16. This strict inequality also handles the positive-remainder convention at zero. The target quotient is qq or q1q-1 since every full-corner gain is less than DD.

If both source and target have quotient qq, the full departure with x=d+px=d+p inspections costs strictly more than F(N)F(N) in AA, by (43), or at least F(N)>CF(N)>C in BB. Subtracting dd rules out equality. If the source quotient is q1q-1, write r=2sr=2s, α=ρ1(s)\alpha=\rho_1(s), or r=2s1r=2s-1, α=ρ0(s)\alpha=\rho_0(s). Substitution gives lower bounds CdF(source)αη1,αη,αη,αηC-d-F(\text{source})\ge \alpha-\eta-1,\quad\alpha-\eta,\quad \alpha-\eta,\quad\alpha-\eta in the order EE/even, OO/even, EE/odd, OO/odd. They are positive: case AA needs only α2\alpha\ge2 in even parity and α1\alpha\ge1 in odd parity. In BB, J=(m+1)/26J=(m+1)/2\ge6 forces even α3\alpha\ge3 and odd α2\alpha\ge2. There is no cardinality exception because q2q\ge2. The full-corner lower bound again rules out equality. Only a transition from qq to q1q-1 remains.

A zero allocation from a proper support is strict directly. A minority neighborhood adds at least two rooms. A majority neighborhood adds at least one, except at deficit one when it returns to the full minority class. Thus FF increases strictly in the former cases, and the full potential CC is strictly larger in the latter. The linear branch also increases, since d<dd'<d. Finally, tight capture begins at quotient zero: its potential can equal the support size only in the cardinality branch. A proper tight tail consequently lasts exactly j+1j+1 consecutive days.

Case AA: the phase obstruction persists.

Every step and day is tight. The full-departure argument using (43) is unchanged, so each cohort has q+1q+1 consecutive active days. They overlap once, the first cohort is minority, and it requires J=m/2J=m/2 inspections on the shared day. The fresh cohort requires J+δ=m/2+1J+\delta=m/2+1 by the omitted-set argument above. The small-set profiles are uncut: their complementary deficits are (qD+w)/2(qD+w)/2 for even rr, when qq is odd and at least three, and at least (qD+w1)/2(qD+w-1)/2 for odd rr, when qq is even and at least two. Both exceed BB. Hence the shared day exceeds the budget.

Discounted cases: the first day uses the slack.

A tight positive full departure in BB or CC uses the FF target branch, has pBp\le B, and crosses a quotient boundary. The linear branch is strict by d<pd'<p; an uncut departure costs at least F(N)>CF(N)>C. The crossing conditions imply E departureO departurer evenpJ+1pJr oddpJpJ+1.\begin{array}{c|cc} &E\text{ departure}&O\text{ departure}\\\hline r\text{ even}&p\ge J+1&p\ge J\\ r\text{ odd}&p\ge J&p\ge J+1. \end{array} For even r=2sr=2s, an EE crossing has pR(p)s+1p-R(p)\ge s+1 with R(p)Q(s)R(p)\ge Q(s); an OO crossing has pQ(p)sp-Q(p)\ge s with Q(p)Q(s)Q(p)\ge Q(s). For odd r=2s1r=2s-1, use R(s)R(p)R(s)\le R(p) in the majority case and R(s)Q(p)1R(s)\le Q(p)-1 in the minority case. These prove the displayed bounds, including the surplus caps since pBp\le B.

The first day’s total slack is at least one. Unused budget already contributes one; allocating all mm to one cohort costs at least one slack because m>Bm>B and C<F(N)C<F(N). If all mm are divided between two positive tight departures, their minima sum to at least 2J+1>m2J+1>m, impossible. Case CC, which has zero total slack, is excluded.

In case BB, day one consumes exactly the single available unit. Every later day uses all mm inspections and every later step is tight. If both outputs of day one are proper, their quotients are at most qq: a proper output of a full departure has rank at most NN. Both tails then finish by day q+2<2q+1q+2<2q+1, leaving an entirely unused later day, a contradiction.

If exactly one output is proper, the other remains full. Its probes and any unused budget contribute their entire amount to slack, and so total at most one. The proper allocation is therefore pm1Bp\ge m-1\ge B. Define its gain here as NN minus the target rank (the initial majority rank is N+1N+1). This gain lies between D3D-3 and DD: the majority gain is 2B2b2B-2b at p=Bp=B and 2p2b22p-2b-2 at p>Bp>B; the minority gain is 2p2b12p-2b-1. The opposite corner is on its plateau since nwn\ge w and pm<B+bp\le m<B+b. Here rm3<D3r\le m-3<D-3 and r2r\ge2, so this output has quotient q1q-1. Both outputs cannot remain full, since that would cost slack m>1m>1.

The proper cohort has exactly qq consecutive tight days left; a fresh tight departure of the other begins q+1q+1 consecutive days. They cover the remaining 2q2q days and overlap once, since no later day’s budget may be unused. Immediately after day one the proper potential is Cm+1C-m+1. Before the overlap it receives another q1q-1 full allocations, so its capture requires Cqm+1=JC-qm+1=J inspections. The fresh tight departure requires at least JJ too. But 2J=m+12J=m+1, again exceeding the budget. This excludes BB and proves Theorem 8.1 for every mB+1m\ge B+1.

Removing the root functions

For Corollary 8.2, the function H(r)=2J(r)+δ(r)H(r)=2J(r)+\delta(r) is strictly increasing for r1r\ge1: its increments alternate between positive increments of L0L_0 and L1L_1. If m=2B+1m=2B+1 and b2b\ge2, put k=b(b1)k=b(b-1). Then H(2k)=L1(k)+L0(k+1)=m,H(2k+1)=L0(k+1)+L1(k+1)=m+2.H(2k)=L_1(k)+L_0(k+1)=m,\qquad H(2k+1)=L_0(k+1)+L_1(k+1)=m+2. The last admissible remainder is therefore 2k=mw2k=m-w. If m>2B+1m>2B+1, substitution at r=mw1r=m-w-1 and r+1=mwr+1=m-w puts the relevant arguments on the plateaus. The only endpoint is m=2B+2m=2B+2, where L1(Bb)=BL_1(B-b)=B; there H(mw1)=m1H(m-w-1)=m-1 and H(mw)=m+1H(m-w)=m+1. Otherwise H(mw1)=mH(m-w-1)=m and H(mw)>mH(m-w)>m. For b=1b=1, the cutoffs at m=3,4m=3,4 are zero and follow directly from H(1)=5H(1)=5; the other cases use the same plateau calculation.

Exact profiles on every even-area rectangle

Let G=PwPnG=P_w\mathbin{\square}P_n, where 2wn2\le w\le n and wnwn is even, and put b=w/2b=\left\lfloor w/2\right\rfloor and h=wn/2h=wn/2. Reflection in an even-length coordinate interchanges the checkerboard classes, so their profiles agree. Write ρ(d)=min{s0:ds(s+1)}\rho(d)=\min\{s\ge0:d\le s(s+1)\}.

Theorem 9.1 (Even-area neighborhood profile). For every 0kh0\le k\le h, g(k)=k+min{k,b,ρ(hk)}.g(k)=k+\min\{\left\lceil\sqrt{k}\right\rceil,b,\rho(h-k)\}. Equivalently, every one-color set of surplus s=N(S)S<bs=|N(S)|-|S|<b satisfies Ss2orhSs(s+1). |S|\le s^2\quad\hbox{or}\quad h-|S|\le s(s+1). (45) The minimum is attained for each cardinality and each color. These minimizers are not asserted to form a compatible dynamic order.

Matching contraction and a common component

Choose an even side length ee and let oo be the other side. Use physical coordinates (x,y)(x,y) with 0x<e0\le x<e, 0y<o0\le y<o. Match rows 2i,2i+12i,2i+1 in every column. Identify each color-pp vertex with (i,y)(i,y) by x=2i+((py)mod2)x=2i+((p-y)\bmod2). A physical edge followed by the inverse matching gives a directed graph DpD_p on an (e/2)×o(e/2)\times o array. It has loops, bidirectional horizontal edges, and vertical rungs directed down in one column parity and up in the other. The two choices of pp transpose the directed graph.

For the image RR of SS, put B=NDp+(R)RB=N^+_{D_p}(R)\setminus R. Then B=s0|B|=s\ge0, and RR is outgoing-closed in DpBD_p-B. If s<bs<b, at most ss columns contain BB. Since o2b2s+2o\ge2b\ge2s+2, two consecutive columns avoid BB. They form a strongly connected ladder: its two rung directions allow travel both ways between rows. Every row avoiding BB meets this ladder and is a full bidirectional path. Thus all such rows lie in a single strongly connected component CC, and at least one exists because e/2b>se/2\ge b>s. An outgoing-closed RR either contains CC or avoids it.

A sharp area bound outside the component

Suppose UB=U\cap B=\varnothing, N+(U)UBN^+(U)\setminus U\subseteq B, and every row avoiding BB is empty in UU. We prove Us2|U|\le s^2. Choose an empty row rr avoiding BB. Above it, let PP be the column parity with downward rungs and put αi=UiP,βi=UiP,ti=BiP,wi=Bi.\alpha_i=|U_i\cap P|,\quad \beta_i=|U_i\setminus P|, \quad t_i=|B_i\cap P|,\quad w_i=|B_i|. Rung closure gives αiαi+1+ti+1\alpha_i\le\alpha_{i+1}+t_{i+1} and hence αii<j<rtj\alpha_i\le\sum_{i<j<r}t_j. Horizontal matching gives βiαi+ti\beta_i\le\alpha_i+t_i. For even oo use a perfect matching of the horizontal path. For odd o=2q+1o=2q+1, every proper subset of the majority column parity matches into its neighbors, as does every subset of the minority. The sole possible exception is the full majority. That would force qαi+tiij<rtjsq\le\alpha_i+t_i\le\sum_{i\le j<r}t_j\le s, contrary to qb>sq\ge b>s. Thus in all cases each occupied row satisfies Uiwi+2i<j<rwj. |U_i|\le w_i+2\sum_{i<j<r}w_j. (46)

Let W=i<rwiW=\sum_{i<r}w_i and let aa be the number of occupied rows above rr. Every occupied row contains a boundary vertex, so aWa\le W. In the sum of (46), a boundary vertex in row jj has coefficient twice the number of earlier occupied rows, plus one if its own row is occupied. Reserve one vertex in each occupied row. Their coefficients are 1,3,,2a11,3,\ldots,2a-1, summing to a2a^2; every remaining vertex has coefficient at most 2a2a. The total is therefore at most a2+2a(Wa)W2a^2+2a(W-a)\le W^2.

Below rr, reverse row order and use upward rungs. If WW' counts the boundary there, this gives area at most (W)2(W')^2. Since W+W=sW+W'=s, we obtain UW2+(W)2s2|U|\le W^2+(W')^2\le s^2. The argument includes b=1,s=0b=1,s=0.

If RR avoids CC, apply this bound to RR. Otherwise set U=V(Dp)(RB)U=V(D_p)\setminus(R\cup B). It avoids every boundary-free row and is outgoing-closed outside BB in the transposed graph: an edge from UU to RR there would be an edge from RR to UU originally. The same area bound gives hR=U+ss(s+1)h-|R|=|U|+s\le s(s+1). This proves (45) and the profile lower bound for every physical support.

Attaining the three bounds

For the plateau bound, return to coordinates with ww transverse rows and nn longitudinal columns. Take an ideal of the predecessor relation (x,y)(x±1,y1)(x,y)\succ(x\pm1,y-1) on one checkerboard class. Its row cutoffs axa_x have the required row parity and satisfy ax+1ax=1|a_{x+1}-a_x|=1; virtual cutoffs 2,1-2,-1 represent empty rows. The neighborhood cutoff in row xx is at most ax+1a_x+1. Write sx=(px)mod2s_x=(p-x)\bmod2 for its source parity. The rowwise cardinality change is (axax+2sx1)/2(a'_x-a_x+2s_x-1)/2. For even ww, the parity correction sums to zero; for odd ww, choose p=0p=0, when it sums to 1-1. In both cases the total surplus is at most b=w/2b=\left\lfloor w/2\right\rfloor. Reflection in an even-length coordinate supplies the other color. Every size kk occurs: take an initial segment of any linear extension of this finite predecessor order.

If s=k<bs=\left\lceil\sqrt{k}\right\rceil<b, the even-color quadrant prefix of size kk, ordered by increasing coordinate sum and then decreasing transverse coordinate, has exactly k+sk+s neighbors. It lies within coordinates 0,,2s20,\ldots,2s-2, with neighborhood within 0,,2s10,\ldots,2s-1, so both fit inside GG. This attains the small-corner bound; k=0k=0 is immediate.

For the other end put d=hkd=h-k and s=ρ(d)<bs=\rho(d)<b. Then x=dsx=d-s satisfies 0xs20\le x\le s^2. The small-corner construction provides an opposite-color set XX of size xx with at most x+s=dx+s=d neighbors. Choose kk vertices outside N(X)N(X) in the desired color. Their neighborhood avoids XX, so has size at most hx=k+sh-x=k+s. Reflection in an even-length coordinate supplies either color in these constructions. Each branch that improves on bb is thus attained, proving the theorem.

Together with Theorem 5.1, this settles the static neighborhood profiles for all nondegenerate rectangles. The scalar profile alone need not determine optimal time: on 6×66\times6 with five inspections its full-budget solo recurrence permits 18,15,13,11,9,6,2,018,15,13,11,9,6,2,0. Combining two six-step preparations with a central inspection would give thirteen days if those prescribed sizes were physically attainable. The exact physical optimum is fourteen, as independently certified in the research archive. This is an obstruction to dynamic attainment, not to the profile theorem.

Corner restrictions and memory on an even-width half-strip

Static minimizers need not be compatible with an earlier belief. Here we quantify one source of incompatibility without imposing a shape on that belief. Work in the whole half-strip Hb={(x,y):0x<2b, y0},b1,H_b=\{(x,y):0\le x<2b,\ y\ge0\},\qquad b\ge1, with square-grid adjacency. For color zero put c=(0,0)c=(0,0) and c=(2b1,0)c'=(2b-1,0). These are the favorable bottom corners of the current and next colors. Reflection supplies the other color. A restriction on a source set does not delete vertices from the graph: every neighborhood below is taken in HbH_b. Write R(k)=k,Q(k)=min{s1:ks(s1)},Ch(s)=max{s(s1)/2,s(sh)}.R(k)=\left\lceil\sqrt{k}\right\rceil,\qquad Q(k)=\min\{s\ge1:k\le s(s-1)\},\qquad C_h(s)=\max\{s(s-1)/2,s(s-h)\}. The last function is the punctured-quadrant capacity of Theorem 4.1.

Theorem 10.1 (Exact conditional corner profiles). For every k>0k>0, the least neighborhood size of a kk-room color-zero set subject to each indicated condition is kk plus the following surplus: condition on Sminimum surplusnonemin{R(k),b}cSmin{Q(k),b+1}cN(S)min{Q(k),b}cN(S){R(k),k<b2,b+1,kb2.\begin{array}{c|c} \text{condition on }S&\text{minimum surplus}\\ \hline \text{none}&\min\{R(k),b\}\\ c\notin S&\min\{Q(k),b+1\}\\ c'\in N(S)&\min\{Q(k),b\}\\ c'\notin N(S)& \begin{cases}R(k),&k<b^2,\\b+1,&k\ge b^2.\end{cases} \end{array} For the joint condition cSc\notin S, cN(S)c'\notin N(S), the exact capacity at surplus at most ss is, when b2b\ge2, Γb(s)={C2(s),0sb,max{b(b+1)/2,b22},s=b+1,,sb+2. \Gamma_b(s)= \begin{cases} C_2(s),&0\le s\le b,\\ \max\{b(b+1)/2,b^2-2\},&s=b+1,\\ \infty,&s\ge b+2. \end{cases} (47) Thus its minimum surplus is min{s:kΓb(s)}\min\{s:k\le\Gamma_b(s)\}. For b=1b=1 the joint minimum is instead two for every k>0k>0. Every asserted minimum is attained at every cardinality.

Matching rows and the marginal restrictions

Use the matching contraction of Section 9: the source room represented by (i,y)(i,y) has physical coordinate x=2i+(ymod2)x=2i+(y\bmod2). The contracted graph has horizontal edges in both directions, upward rungs at even yy, and downward rungs at odd yy. If B=ND+(S)SB=N_D^+(S)\setminus S, then B=N(S)S=:s|B|=|N(S)|-|S|=:s. A matched row avoiding BB is horizontally closed in a ray and finite, hence empty in SS. Its two empty physical rows separate the support into parts with disjoint neighborhoods. Each part has its full neighborhood unchanged when viewed as a quadrant; the empty row supplies its transverse neighbor layer. Surpluses therefore add. Such a row always exists if s<bs<b.

The two unrestricted quadrant capacities are C0(u)=u2C_0(u)=u^2 and C1(u)=u(u1)C_1(u)=u(u-1), so their sum at total surplus ss is at most s2s^2. If cc is omitted, the capacities become C2C_2 and C1C_1, both at most u(u1)u(u-1); their sum is at most s(s1)s(s-1). If cc' belongs to the neighborhood, the odd-quadrant part is nonempty and consumes surplus r2r\ge2. Even allowing the other part its square capacity gives S(sr)2+r(r1)s(s1).|S|\le(s-r)^2+r(r-1)\le s(s-1). These prove the subcritical lower bounds in the first three rows.

For the omitted-current bound at s=bs=b, only the absence of a boundary-free row remains. Every matched row then has exactly one boundary vertex. Its occupied set is empty or an initial interval of length cic_i, because any other finite subset of a ray has two horizontal boundary vertices. Here c0=0c_0=0. Upward even rungs give ci+1ci+2c_{i+1}\le c_i+2, including when ci=0c_i=0, and consequently Si=0b12i=b(b1).|S|\le\sum_{i=0}^{b-1}2i=b(b-1). Thus omission of cc requires surplus at least b+1b+1 beyond this size.

For later use, omission of the outgoing corner has the sharper critical bound cN(S), s=bSb21. c'\notin N(S),\ s=b\quad\Longrightarrow\quad |S|\le b^2-1. (48) With a boundary-free row the two capacities are C0C_0 and C3C_3, whose sum is at most b2b^2. Equality forces all surplus into the unrestricted even quadrant and the full square extremizer there. Indeed, equality in the full-layer proof of Theorem 4.1 forces every occupied diagonal to be full and consecutive. That square reaches transverse coordinate 2b22b-2, whereas a component before an empty matched row reaches at most 2b32b-3. Equality is impossible. Without a boundary-free row, all occupied rows are prefixes, the last is empty, and downward odd rungs give ci2(bi)1c_i\le2(b-i)-1 for i<b1i<b-1. Their sum is b21b^2-1. This proves (48) and the fourth lower bound in the theorem.

We record the constructions together. Finite downward pyramids, meaning ideals under (x,y)(x±1,y1)(x,y)\succ(x\pm1,y-1), exist at every size and have surplus at most bb: their neighborhood cutoffs are at most their source cutoffs plus one. Small even-quadrant prefixes give surplus R(k)R(k); odd-quadrant prefixes at the opposite corner give surplus Q(k)Q(k) and touch cc'. Fill a partial diagonal toward smaller transverse coordinate. Then every even prefix of size k<b2k<b^2 avoids the two neighbors of cc', attaining the fourth row below its threshold.

The following elementary bounds supply all larger constructions. If (v,t)(v,t) is missing from a pyramid of source color zero, its cutoffs obey axt2+xva_x\le t-2+|x-v|, and its size is at most x(t+xv(xmod2))/2\sum_x(t+|x-v|-(x\bmod2))/2. In particular, omission of (1,1)(1,1) bounds the size by b(b1)+1b(b-1)+1, and omission of (2b2,2)(2b-2,2) bounds it by b2+1b^2+1. The sharper bottom-root threshold in Lemma 11.2 is b(b1)b(b-1). For k>b(b1)k>b(b-1), take a pyramid of size k+1k+1 and remove cc. The forced room (1,1)(1,1) covers both neighbors of cc, so this has surplus at most b+1b+1. A pyramid of size k>b(b1)k>b(b-1) also contains (2b2,0)(2b-2,0) and hence touches cc', proving the remaining attainment with outgoing corner present. For kb2k\ge b^2, take a pyramid of size k+2k+2 and remove the two neighbors (2b2,0),(2b1,1)(2b-2,0),(2b-1,1) of cc'. The forced room (2b2,2)(2b-2,2) and its predecessors cover every other neighbor of these rooms. Exactly cc' disappears from the neighborhood, so the resulting surplus is at most b+1b+1. This completes all marginal profiles, including b=1b=1.

Both omissions, including the critical extra unit

Suppose first b2b\ge2. The joint condition forbids exactly the three source rooms (0,0),(2b2,0),(2b1,1).(0,0),\qquad (2b-2,0),\qquad(2b-1,1). A boundary-free row splits their capacities into C2C_2 on the left and C3C_3 on the reflected right. Convexity, their zero values at zero, and C3C2C_3\le C_2 give total capacity at most C2(s)C_2(s). If s=bs=b and there is no such row, the preceding prefix argument has both endpoint rows empty and gives cimin{2i,2(bi)1}(1ib2),Sb(b1)/21C2(b).c_i\le\min\{2i,2(b-i)-1\}\quad(1\le i\le b-2), \qquad |S|\le b(b-1)/2-1\le C_2(b). This proves the first line of (47).

Now let s=b+1s=b+1. If both neighbors of cc already belong to N(S)N(S), adding cc leaves the neighborhood unchanged and still omits cc'. Equation (48) then gives S+1b21|S|+1\le b^2-1, or Sb22|S|\le b^2-2. Assume henceforth that this origin-addition argument is unavailable.

If there is a boundary-free row and the right part is nonempty, its surplus is at least two. For b3b\ge3, convexity bounds the total by max{C3(b+1), C2(b1)+C3(2)}b22.\max\{C_3(b+1),\ C_2(b-1)+C_3(2)\}\le b^2-2. If only the left part is nonempty, its sole larger possibility is C2(b+1)=b21C_2(b+1)=b^2-1. Equality in the punctured-quadrant proof forces full diagonals 2,4,,2b22,4,\ldots,2b-2, which cannot fit before an empty matched row. Diagonal compression toward the smaller transverse coordinate preserves that width restriction, so equality is impossible even for an uncompressed source. For b=2b=2 the direct quadrant bound is already C2(3)=3C_2(3)=3, as required.

It remains to consider s=b+1s=b+1 with no boundary-free row. Exactly one row has two boundary vertices; all other occupied rows are prefixes. First suppose both endpoint rows are empty. Write αi,βi\alpha_i,\beta_i for the numbers of even and odd occupied columns and ti,uit_i,u_i for the respective boundary counts. Rung inclusion gives αij<itj,βij>iuj,\alpha_i\le\sum_{j<i}t_j,\qquad \beta_i\le\sum_{j>i}u_j, and therefore Sj((b1j)tj+juj)(b+1)(b1)(b2)=b2b+1.|S|\le\sum_j\bigl((b-1-j)t_j+j u_j\bigr) \le(b+1)(b-1)-(b-2)=b^2-b+1. For the second inequality reserve one boundary vertex on each internal row, where its coefficient is at most b2b-2; every other coefficient is at most b1b-1. This is at most b22b^2-2 for b3b\ge3, and is three when b=2b=2. No interval assumption on the exceptional internal row was used.

If an endpoint row is occupied, it must be the exceptional row. Its source is a single interval avoiding column zero, since two components away from zero would require more than two horizontal boundary vertices. There are two endpoint cases.

Each bound is at most b22b^2-2 for b3b\ge3; the endpoint cases for b=2b=2 give at most three. Together these exhaust the extra-unit cases and prove the finite upper capacity in (47).

For sharpness at sbs\le b, both the proper-ramp and full-layer constructions for C2(s)C_2(s) avoid all three forbidden rooms. The full layers end at diagonal 2s42s-4; the ramp is filled toward small transverse coordinate. Their partial terminal layers give every intermediate size. For b3b\ge3, fill the even diagonals 2,4,,2b22,4,\ldots,2b-2 and delete (2b2,0)(2b-2,0). This has b22b^2-2 rooms and surplus b+1b+1. Every smaller size at this surplus bound comes from an even-quadrant prefix of size k+1k+1, filled toward smaller transverse coordinate, with its origin deleted. For b=2b=2 the ramp {(0,2),(0,4),(1,3)}\{(0,2),(0,4),(1,3)\} and its initial subprefixes give sizes up to three.

For every larger kk, take a downward pyramid of size k+3k+3 and remove all three forbidden rooms. Its size forces (1,1)(1,1) and (2b2,2)(2b-2,2) by the two omission bounds above; their predecessors ensure that all three rooms to be removed are present. Their other neighbors remain covered, so only cc' disappears from the neighborhood. The surplus is at most b+2b+2. This proves every-size attainment, not just unboundedness along a subsequence. When b=1b=1, the two bottom forbidden rooms coincide; the joint restriction is exactly the outgoing-absent restriction already proved, with minimum surplus two. This finishes the theorem.

Localization gives more than availability bits

Corollary 10.2 (Triangular localization and propagation delay). Let SS be a nonempty color-zero set, with surplus s<bs<b. If S>s(s1)|S|>s(s-1), then SS is connected under the relation of sharing a neighbor, contains cc, and x+y2s2((x,y)S),cNj(S)(j<2(bs)+1).x+y\le2s-2\quad((x,y)\in S),\qquad c'\notin N^j(S)\quad\bigl(j<2(b-s)+1\bigr). If cSc\notin S and S>C2(s)|S|>C_2(s), then SS is connected under the same relation, cN(S)c'\in N(S), and (2b1x)+y2s3((x,y)S),cNj(S)(j<2(bs)+2).(2b-1-x)+y\le2s-3\quad((x,y)\in S),\qquad c\notin N^j(S)\quad\bigl(j<2(b-s)+2\bigr). Both exclusions remain valid after arbitrary intervening inspections. Here jj counts movements from the survivor SS.

Proof. Sharing-neighbor components have disjoint neighborhoods, so their sizes and surpluses add. A nonempty component omitting cc has surplus at least two and capacity u(u1)u(u-1) at surplus u<bu<b. For the first claim, if no component contains cc, the total capacity is at most s(s1)s(s-1). If one contains cc with surplus a1a\ge1 and has companions of total surplus d2d\ge2, its total capacity is at most a2+d(d1)(a+d)(a+d1)a^2+d(d-1)\le(a+d)(a+d-1). Both are contradictions. Thus SS is one component containing cc.

For the second claim, every component has surplus at least two. Two or more components have total capacity at most (s2)(s3)+2s(s2)C2(s),s4;(s-2)(s-3)+2\le s(s-2)\le C_2(s),\qquad s\ge4; this follows by merging all but one component and maximizing the convex two-part pronic sum at an endpoint. For s<4s<4 two components are impossible. Thus SS is connected; the joint profile then forces cN(S)c'\in N(S).

A boundary-free matched row exists in both cases. Connectedness confines the whole support to the corresponding corner quadrant, with its actual neighborhood unchanged. In the first case its occupied even diagonals are 0,2,,2L20,2,\ldots,2L-2: a sharing-neighbor edge changes the coordinate sum by zero or two, so there is no gap. Diagonal compression preserves which diagonals are occupied. The layer inequalities in Theorem 4.1 charge at least one surplus unit per occupied diagonal; hence LsL\le s. This bounds the original support, without claiming it is compressed. In the reflected odd quadrant of the second case, cN(S)c'\in N(S) forces the first diagonal to be one. The occupied diagonals are 1,3,,2L11,3,\ldots,2L-1, and the output origin supplies one more surplus unit, so L+1sL+1\le s.

The bottom corners have distance 2b12b-1. Subtracting the respective triangle radii gives the two stated distances. Every later belief is a subset of the corresponding free neighborhood iterate, proving the inspection-independent exclusions. Full square and pronic triangles attain these distances, so the strict inequalities on jj are intentional. ◻

The sharp localization examples for b=4,s=3b=4,s=3. Filled rooms are SS; open rooms are N(S)N(S). Crosses mark the excluded opposite corner. Its shortest arrival times are three and four movements.

These statements concern arbitrary supports, but are not a sufficiency theorem for corner-availability bits. For example, on width fourteen a 30-room set omitting its current favorable corner and having surplus six must be the opposite odd triangle on diagonals 1,3,5,7,91,3,5,7,9. Indeed the separating-row capacities force all surplus into that quadrant; equality in its full-layer bound forces each raw diagonal to be full. Its 36-room neighborhood cannot reach the other bottom corner on the following movement. Remembering only current corner presence loses this distance information even though each individual conditional profile is sharp. No full-board capture time is being asserted by this example.

Finally, on a finite rectangle the half-strip profile applies to a source that avoids the far longitudinal row, so its neighborhood agrees with the half-strip neighborhood. That guard must be checked at every use of a profile inequality. Once localization has been established, the propagation exclusions also hold on the finite board, whose free neighborhoods can only be smaller.

Uniform time bounds and exact large-budget searches on even widths

Continue with G=P2bPnG=P_{2b}\mathbin{\square}P_n, n2bn\ge2b, and h=bnh=bn. The preceding static profile gives an all-budget lower bound without assuming that its minimizing sets can be chained.

Lemma 11.1 (A scalar lower bound with a central-day test). More generally, let gg be the symmetric profile of any even-area rectangle, with hh vertices in each color. Starting with c0=hc_0=h, define ct+1=g((ctm)+),τ=min{t:ct=0}.c_{t+1}=g(\left(c_t-m\right)_+),\qquad \tau=\min\{t:c_t=0\}. If τ\tau is finite, then Tm2τ1T_m\ge2\tau-1, and Tm2τT_m\ge2\tau when 2cτ1>m2c_{\tau-1}>m.

Proof. The inverse profile is I(z)=hg(hz)=zmin{ρ(z),b,R(hz)},0zh.I(z)=h-g(h-z) =z-\min\{\rho(z),b,R(h-z)\},\qquad0\le z\le h. Its subtracted term is subadditive. If a cap or decreasing reflected branch minimizes either summand, that branch bounds the value at the sum. Otherwise use subadditivity of ρ\rho, following from ur(r+1)u\le r(r+1), vs(s+1)v\le s(s+1) and u+v(r+s)(r+s+1)u+v\le(r+s)(r+s+1). Thus I(x)+I(y)I(x+y)I(x)+I(y)\le I(x+y) when x+yhx+y\le h.

Put Dt=hctD_t=h-c_t. Then Dt+1=I(min{h,Dt+m})D_{t+1}=I(\min\{h,D_t+m\}). For t<τt<\tau, the total physical deficit of both cohorts after tt inspections and moves is at most DtD_t. Indeed, useful allocations of total at most mm give next deficit at most I(d0+p)+I(d1+q)I(Dt+m)I(d_0+p)+I(d_1+q)\le I(D_t+m) whenever t+1<τt+1<\tau. Here Dt+m<hD_t+m<h follows from Dt+1<hD_{t+1}<h and I(h)=hI(h)=h. This proves the invariant inductively from zero.

The case τ=1\tau=1 is immediate. Otherwise, for a purported 2τ22\tau-2-day capture, set L=τ1L=\tau-1. After the first LL inspections and moves the belief has more than hh vertices. Reversing the last LL inspections, using L1L-1 moves and then a final inspection, also leaves more than hh vertices: its deficit is at most DL1+m<hD_{L-1}+m<h. The two sets occupy the same day and intersect, giving an avoiding walk. Thus Tm2τ1T_m\ge2\tau-1.

At the central day of a (2τ1)(2\tau-1)-day search, the forward and backward beliefs each have deficit at most Dτ1D_{\tau-1}. Their intersection has at least 2h2Dτ1=2cτ12h-2D_{\tau-1}=2c_{\tau-1} vertices, all of which must be inspected centrally. This proves the second bound. ◻

A common enlargement and erosion lemma

The following construction supplies the physical upper strategies in both parity cases. It also permits a nonpyramidal terminal survivor. Let QQ be a finite connected bipartite graph with at least two vertices, with bipartition map χ:V(Q){0,1}\chi:V(Q)\to\{0,1\}. In QPnQ\mathbin{\square}P_n, a downward pyramid is a one-color set closed under every valid predecessor (u,y1)(u,y-1) of (v,y)(v,y), where uvE(Q)uv\in E(Q) and y>0y>0. Write cl(R)\operatorname{cl}(R) for the least such set containing RR. These are ideals of a finite poset, since every predecessor lowers yy. Put HQ=maxvV(Q)uV(Q)distQ(v,u)/2.H_Q=\max_{v\in V(Q)}\sum_{u\in V(Q)} \left\lceil\operatorname{dist}_Q(v,u)/2\right\rceil. The sharper, phase-dependent threshold needed for erosion is BQ,p=maxv:χ(v)=puV(Q)distQ(v,u)/2.B_{Q,p}=\max_{v:\chi(v)=p}\sum_{u\in V(Q)} \left\lfloor\operatorname{dist}_Q(v,u)/2\right\rfloor.

Lemma 11.2 (Prescribed envelopes with arbitrary terminal supports). Let RR be any set in physical color pp, and let kk satisfy cl(R)kVp,k>BQ,p,|\operatorname{cl}(R)|\le k\le |V_p|,\qquad k>B_{Q,p}, where VpV_p is the full physical color class in the cylinder. There are pyramids ARA\supseteq R of color pp and EE of color 1p1-p such that A=k,E=kχ1(p),N(E)A.|A|=k,\qquad |E|=k-|\chi^{-1}(p)|, \qquad N(E)\subseteq A. Consequently, after a movement from any survivor contained in EE, the designated inspections ARA\setminus R leave an actual survivor contained in RR, using exactly kRk-|R| designated inspections.

Proof. Two predecessor moves show that every fiber of a pyramid is a spacing-two prefix. Put sv=(pχ(v))mod2s_v=(p-\chi(v))\bmod2. If its fiber size is kvk_v, the virtual last height av=sv2+2kva_v=s_v-2+2k_v satisfies auav=1|a_u-a_v|=1 on every QQ-edge; empty fibers have heights 2-2 or 1-1. If fiber vv is empty, distance along QQ gives kusv+dist(v,u)su2={dist(v,u)/2,sv=0,dist(v,u)/2,sv=1.k_u\le\frac{s_v+\operatorname{dist}(v,u)-s_u}{2} =\begin{cases} \left\lfloor\operatorname{dist}(v,u)/2\right\rfloor,&s_v=0,\\ \left\lceil\operatorname{dist}(v,u)/2\right\rceil,&s_v=1. \end{cases} Thus a pyramid with any empty fiber has at most HQH_Q rooms. If an empty fiber has sv=0s_v=0, its sharper bound is BQ,pB_{Q,p}. These are exactly the fibers whose bottom room contributes to erosion.

Extend the ideal cl(R)\operatorname{cl}(R) to exactly kk elements by repeatedly adding a minimal element of its complement. Call it AA. Define the opposite-color cutoffs by ev=max{av1,(1sv)2}.e_v=\max\{a_v-1,(1-s_v)-2\}. Both vectors inside the maximum are edgewise 11-Lipschitz with the required parity; their maximum has the same properties. Opposite parity on an edge makes its height difference exactly one. The cutoffs obey both physical boundaries and therefore define a pyramid EE. Its exact cardinality loss is the number of occupied fibers with sv=0s_v=0. Since k>BQ,pk>B_{Q,p}, all these fibers are occupied, giving loss χ1(p)|\chi^{-1}(p)|. The other term in the maximum represents an empty fiber and contributes no actual room. Every neighbor of an actual room of EE has height at most the appropriate cutoff of AA, proving N(E)AN(E)\subseteq A even at the physical ends. Movement therefore enters AA, and inspecting ARA\setminus R leaves only rooms of RR. ◻

The all-fiber threshold HQH_Q is sharp across the two colors when ndiam(Q)n\ge\operatorname{diam}(Q): at a maximizing vertex vv, choose sv=1s_v=1 and heights au=dist(v,u)1a_u=\operatorname{dist}(v,u)-1. Bipartiteness makes adjacent distances differ by one, giving a valid pyramid of size HQH_Q with an empty fiber. For a path of order aa, HPa=a2/4.H_{P_a}=\left\lfloor a^2/4\right\rfloor. Indeed the distance sum is maximized at an endpoint, by the nondecreasing increments of j=1tj/2\sum_{j=1}^t\left\lceil j/2\right\rceil. The root threshold BQ,pB_{Q,p} is separately sharp when nmax{1,diam(Q)}n\ge\max\{1,\operatorname{diam}(Q)\}: at a maximizing vertex vv of color pp, the cutoffs au=dist(v,u)2a_u=\operatorname{dist}(v,u)-2 give a pyramid of size BQ,pB_{Q,p} with an empty bottom root. For paths the sharper thresholds are BP2b,0=BP2b,1=b(b1),BP2b+1,0=b2,BP2b+1,1=b(b1),B_{P_{2b},0}=B_{P_{2b},1}=b(b-1),\qquad B_{P_{2b+1},0}=b^2,\quad B_{P_{2b+1},1}=b(b-1), where color zero contains the endpoints of the odd path. Indeed, at vertex vv of a path indexed from zero, the floor-distance sum is v2/4+(a1v)2/4\left\lfloor v^2/4\right\rfloor+\left\lfloor(a-1-v)^2/4\right\rfloor; convexity maximizes it at an extreme vertex of the required parity. Taking k=R+mk=|R|+m gives the usual backward step whenever m>BQ,pm>B_{Q,p} and the requested envelope fits; the additional admission condition for a nonpyramidal RR is exactly cl(R)Rm|\operatorname{cl}(R)|-|R|\le m.

The exact large-budget formula

Theorem 11.3 (Every even width above a quadratic budget). Let max{b+1,b(b1)+1}m<h\max\{b+1,b(b-1)+1\}\le m<h, and write D=mb,hb=qD+r,0r<D.D=m-b,\qquad h-b=qD+r,\quad0\le r<D. Set J(0)=0J(0)=0 and J(r)=r+min{r,b}J(r)=r+\min\{\left\lceil\sqrt r\right\rceil,b\} for r>0r>0. Then Tm(G)={2q,r=0,2q+1,r>0 and 2J(r)m,2q+2,otherwise.T_m(G)= \begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }2J(r)\le m,\\ 2q+2,&\text{otherwise}. \end{cases} For hm<2hh\le m<2h the answer is two days, and for m2hm\ge2h it is one. The constructions are physical searches; the lower bounds permit arbitrary interleaving and arbitrary support shapes.

An optimal seven-day search on 6×96\times9 with ten daily inspections, constructed backwards from the final survivor envelope. Every displayed possible-position set and inspection has been replayed on the physical room graph.

Lower bound. Because m>b(b1)m>b(b-1), the reflected term in the full-budget scalar recurrence is saturated. Thus ct+1=L((ctm)+)c_{t+1}=L(\left(c_t-m\right)_+), where L(0)=0L(0)=0 and L(k)=k+min{R(k),b}L(k)=k+\min\{R(k),b\} for k>0k>0. Now D(b1)2D\ge(b-1)^2. When D>(b1)2D>(b-1)^2 or r>0r>0, successive plateau steps give ct=htD(0tq1),cq=J(r).c_t=h-tD\quad(0\le t\le q-1),\qquad c_q=J(r). If r=0r=0, then τ=q\tau=q and cq1=mc_{q-1}=m. If r>0r>0, then 0<J(r)<m0<J(r)<m, so τ=q+1\tau=q+1. The only new endpoint is D=(b1)2D=(b-1)^2, r=0r=0, b2b\ge2. Here q2q\ge2, and the penultimate plateau step has survivor D=(b1)2D=(b-1)^2, whose surplus is b1b-1. Consequently cq1=m1c_{q-1}=m-1 and τ=q\tau=q. Since m3m\ge3, one still has 2cq1>m2c_{q-1}>m, giving the same answer 2q2q. For b=1b=1, D1>(b1)2D\ge1>(b-1)^2 already covers every feasible budget. Lemma 11.1 gives precisely the claimed lower bounds. Its argument also covers the two extreme budget ranges. ◻

Physical upper construction. Apply Lemma 11.2 with Q=P2bQ=P_{2b}. Its root threshold is BQ,p=b(b1)B_{Q,p}=b(b-1), and erosion loses exactly bb rooms in either color. The prescribed-size enlargement and physical neighborhood inclusion are supplied by that common lemma.

Choose a terminal pyramid RR of size rr with N(R)J(r)|N(R)|\le J(r). The small-corner construction, ordered toward the longitudinal near edge as above, supplies it when r<b\left\lceil\sqrt r\right\rceil<b, and the plateau bound supplies it otherwise. Reflection in the even short axis permits either physical color. Enlarge RR by mm vertices and apply the clipped erosion. This constructs a preceding survivor of size r+Dr+D, whose neighborhood lies inside that enlarged envelope. Repeat q1q-1 times, and enlarge by mm once more. This first envelope has size r+(q1)D+m=hr+(q-1)D+m=h, so is the full color class. Every enlargement fits, and its size is at least m>b(b1)m>b(b-1), giving the required erosion loss even if some other fibers are empty.

Read the construction forward. On each day inspect the difference between its envelope and prescribed survivor, using exactly mm designated rooms. The actual belief stays inside the next envelope. After qq days its survivor lies in RR and its next belief has at most J(r)J(r) rooms. When r=0r=0, this is a qq-day solo capture; otherwise one more day suffices.

For r>0r>0 and 2J(r)m2J(r)\le m, join one such qq-day preparation and the time reversal of another on opposite cohorts. Inspect both final neighborhood envelopes on the central day. Their colors are opposite and their total size is at most 2J(r)2J(r), giving 2q+12q+1 days. Otherwise concatenate two (q+1)(q+1)-day solo searches. For r=0r=0 concatenate two qq-day searches. Reflection lets each half choose its required physical color independently. Finally, when mhm\ge h, two inspections of one fixed physical color capture both initial cohorts; inspecting the entire board gives one day when m2hm\ge2h. ◻

Exact symbolic transitions between physical fronts

The next results evaluate transitions between prescribed fronts, rather than assuming that every optimal intermediate support has this form. They include exact one-day costs at the physical ends and arbitrary prescribed daily quotas in the interior. A later application eliminates the translation coordinate from the finite-interface graph.

Let QQ be connected and bipartite, with A2A\ge2 vertices and bipartition map χ\chi. For a downward pyramid of physical color pp in QPnQ\mathbin{\square}P_n, write sv=(pχ(v))mod2s_v=(p-\chi(v))\bmod2. Its virtual last occupied heights satisfy av=sv2+2kv,auav=1(uvE(Q)),a_v=s_v-2+2k_v,\qquad |a_u-a_v|=1\quad(uv\in E(Q)), where kvk_v is the fiber cardinality. The values 2,1-2,-1 denote empty fibers. This is the height representation established in Lemma 11.2. All the results have reflected versions for upward pyramids.

Proposition 12.1 (Maximal erosion and exact one-day costs). Let BB be a downward pyramid of color pp, with heights bvb_v. Its maximal graph erosion in the opposite color, E(B)={xV1p:N({x})B},E(B)=\{x\in V_{1-p}:N(\{x\})\subseteq B\}, is a pyramid with heights ev=max{bv1,(1sv)2}+21{Tv}, e_v=\max\{b_v-1,(1-s_v)-2\}+2\mathbf{1}_{\{T_v\}}, (49) where TvT_v means that n11sv(mod2)n-1\equiv1-s_v\pmod2, bv=n2b_v=n-2, and bu=n1b_u=n-1 for every neighbor uu of vv in QQ.

For any downward pyramid PP of the opposite color, with heights ava_v, the minimum useful inspections forcing the next belief to be contained in BB are exactly PE(B)=12v(avev)+. |P\setminus E(B)|=\frac12\sum_v\left(a_v-e_v\right)_+. (50) The exact next belief BB is attainable if and only if N(PE(B))=BN(P\cap E(B))=B; when it is, the same cost is minimal. These minima allow arbitrary competing survivors.

Proof. A candidate room below the top has an upward longitudinal neighbor, so its height is at most bv1b_v-1. The transverse inequalities add nothing: adjacent cutoffs are bv1b_v-1 or bv+1b_v+1. The lower maximum in (49) represents an empty opposite-color fiber when no room is admissible. At the top, the upward neighbor is absent. That one additional room is admissible exactly under TvT_v, by its downward and transverse neighbors. This also handles n=1n=1, when the condition reduces to the transverse neighbor test.

The bottom correction raises a local minimum 3-3 to 1-1, with neighboring new cutoffs 2-2. A top correction raises a local minimum n3n-3 to n1n-1, with neighboring new cutoffs n2n-2. Thus edge differences remain one, proving that the erosion is a pyramid. Its intersection with PP has cutoffs min(av,ev)\min(a_v,e_v).

A survivor has neighborhood contained in BB exactly when it is contained in E(B)E(B). The largest admissible survivor is therefore PE(B)P\cap E(B), proving the minimum cost. If any survivor has neighborhood exactly BB, its inclusion in this largest survivor forces BN(PE(B))BB\subseteq N(P\cap E(B))\subseteq B. The converse is immediate. ◻

Lemma 12.2 (Exact height descent with a quota word). Let a,za,z be integer height configurations on QQ, each with edge differences one and checkerboard vertex parities. Fix t0t\ge0 and nonnegative integer quotas p1,,ptp_1,\ldots,p_t. In the virtual height model, a day consists of at most pjp_j legal local-maximum lowerings by two, followed by adding one to every height. The endpoint zz is reachable from aa in exactly tt days if and only if zvav+t(mod2),zvav+tfor every v,F:=vavvzv+At2j=1tpj. \begin{gathered} z_v\equiv a_v+t\pmod2,\qquad z_v\le a_v+t\quad\hbox{for every }v,\\ F:=\frac{\sum_v a_v-\sum_v z_v+At}{2} \le\sum_{j=1}^t p_j. \end{gathered} (51) Exactly FF lowerings suffice. The same criterion holds with movement before each day’s lowerings.

Proof. Each lowering reduces the height sum by two, while movement raises each coordinate by one. This proves necessity, including the componentwise and parity conditions.

Put c=zt1c=z-t\mathbf1. It has the same vertexwise parities as aa and satisfies cac\le a. From any current xcx\ne c, choose a vertex vv of maximum current height among those with xv>cvx_v>c_v. A higher neighbor uu would also be above its target: otherwise cu=xu=xv+1c_u=x_u=x_v+1 and cvxv2c_v\le x_v-2, contradicting the target edge condition. Such a neighbor contradicts maximality, so all neighbors are one lower. Lowering xvx_v by two is legal and preserves xcx\ge c. Repeated descent reaches cc in exactly FF steps.

Choose integers 0qjpj0\le q_j\le p_j summing to FF and divide this word into successive pieces of lengths qjq_j. Uniform additions commute with the local-maximum test. Inserting one addition per piece, before or after it, gives endpoint c+t1=zc+t\mathbf1=z. The case t=0t=0 forces a=za=z and uses the empty word. ◻

The following physical lower bound is what permits comparison with arbitrary, possibly nonpyramidal competitors. Suppose QQ has a Hamiltonian path, indexed 0,,A10,\ldots,A-1, and take its parity as χ\chi. All color indices in the following formulas are read modulo two. Put CA=(A2)2/4,γp=χ1(1p).C_A=\left\lfloor(A-2)^2/4\right\rfloor,\qquad \gamma_p=|\chi^{-1}(1-p)|. For any finite color-pp support SS in QPQ\mathbin{\square}P_\infty, N(S)S,S>CA  N(S)S+γp. |N(S)|\ge|S|,\qquad |S|>C_A\ \Longrightarrow\ |N(S)|\ge|S|+\gamma_p. (52) Indeed, deleting the extra transverse edges leaves the spanning rectangle. Put the finite support in a sufficiently long auxiliary rectangle so that its neighborhood is unchanged and the far profile branch cannot lower the cap. For A=2bA=2b, the proved profile becomes k+min(k,b)k+\min(\left\lceil\sqrt k\right\rceil,b), whose plateau begins at k>(b1)2k>(b-1)^2. For A=2b+1A=2b+1, choose the auxiliary length odd. Its two profiles are k+min(R(k),b)k+\min(R(k),b) and k+min(Q(k),b+1)k+\min(Q(k),b+1), with their common plateau beginning at k>b(b1)k>b(b-1). These are exactly the stated CAC_A and γp\gamma_p. Their small branches also prove nonnegative expansion.

Theorem 12.3 (Unrestricted physical transitions in a guarded interior). Let QQ be bipartite with a Hamiltonian path and A2A\ge2. Let P,ZP,Z be downward pyramids in QPnQ\mathbin{\square}P_n, with heights a,za,z. Fix t1t\ge1, quotas p1,,ptp_1,\ldots,p_t, and P:=jpjP_*:=\sum_jp_j. Assume tminvav,tminvzv,maxvav, maxvzvn1t,PP>CA. \begin{gathered} t\le\min_v a_v,\quad t\le\min_v z_v,\qquad \max_v a_v,\ \max_v z_v\le n-1-t,\\ |P|-P_*>C_A. \end{gathered} (53) An actual tt-day block with these daily quotas and exact endpoint ZZ exists, without restrictions on intermediate supports, if and only if (51) holds. Whenever it exists, there is such a block with every survivor and belief a downward pyramid. Both longitudinal parities and arbitrary partial initial pyramids are included.

Proof. Free evolution from PP has heights a+ja+j for 0jt0\le j\le t under the height margins. Every competitor is contained in this free belief, so the endpoint inclusion and parity conditions are necessary. Before each movement no survivor meets the far longitudinal row; hence its neighborhood agrees with that in the half-strip.

Nonnegative expansion in (52) bounds every survivor below by PP>CA|P|-P_*>C_A. If the initial color is pp, its jjth expansion is therefore at least γp+j1\gamma_{p+j-1}. For svp=(pχ(v))mod2s^p_v=(p-\chi(v))\bmod2, j=1tγp+j1=At+vsvpvsvp+t2,PZ=vavvzvvsvp+vsvp+t2.\sum_{j=1}^t\gamma_{p+j-1} =\frac{At+\sum_v s^p_v-\sum_v s^{p+t}_v}{2},\qquad |P|-|Z|=\frac{\sum_v a_v-\sum_v z_v-\sum_v s^p_v+\sum_v s^{p+t}_v}{2}. Summing the useful inspections and canceling these parity terms gives FPF\le P_*. This lower bound did not constrain the intermediate shapes.

For sufficiency use the descent in Lemma 12.2. Its unshifted heights stay between zt1z-t\mathbf1 and aa. The margins keep every surviving fiber nonempty and, before a movement, its height at most n2n-2. Its actual neighborhood consequently has cutoffs exactly one higher. Each lowering removes one actual top room; successive lowerings of the same fiber remove distinct rooms. Thus the virtual construction is an exact physical block with the prescribed daily quotas. ◻

The cardinality guard is only a lower-bound hypothesis. The construction itself extends to arbitrarily long durations with fixed physical margins. Write r=diam(Q)r=\operatorname{diam}(Q) and μ(x)=A1vxv\mu(x)=A^{-1}\sum_vx_v.

Proposition 12.4 (Balanced inspections in fixed physical margins). Let QQ be connected and bipartite with A2A\ge2, and suppose the criterion (51) holds for a constant quota mm and t1t\ge1. If r+2μ(a),μ(z)nr3, r+2\le\mu(a),\mu(z)\le n-r-3, (54) there is an exact physical pyramid block from aa to zz using at most mm inspections each day, regardless of its duration.

Proof. Use the legal descent word, with piece lengths qj=jF/t(j1)F/tm.q_j=\left\lfloor jF/t\right\rfloor-\left\lfloor(j-1)F/t\right\rfloor\le m. The completed-day mean is μ(a)+j2AjF/t=(1j/t)μ(a)+(j/t)μ(z)+2A{jF/t}.\mu(a)+j-\frac2A\left\lfloor jF/t\right\rfloor =(1-j/t)\mu(a)+(j/t)\mu(z)+\frac2A\{jF/t\}. Here braces denote the fractional part. It lies between the smaller endpoint mean and the larger plus 2/A2/A. The survivor immediately before a movement is one lower. Each partial inspection step lies coordinatewise between that day’s source and survivor, and every height configuration has range at most rr. All partial heights therefore lie in [min(μ(a),μ(z))r1,max(μ(a),μ(z))+r+2/A].[\min(\mu(a),\mu(z))-r-1,\quad \max(\mu(a),\mu(z))+r+2/A]. The margin keeps them in the nonempty, unclipped physical range. Neighborhoods are exactly the global additions, completing the proof. ◻

For m>A/2m>A/2, define D=2mAD=2m-A. Between prescribed height endpoints, the least virtual duration is the smallest nonnegative integer t0t_0 of the required color parity satisfying t0max{0, maxv(zvav),vavvzvD}. t_0\ge\max\left\{0,\ \max_v(z_v-a_v),\quad \left\lceil\frac{\sum_v a_v-\sum_v z_v}{D}\right\rceil\right\}. (55) Thus two maxima, an integer ceiling, and a parity adjustment give its cost. Under (54) the corresponding block is physical. An unrestricted lower bound for a long connection requires control of possible boundary excursions; it does not follow by applying (53) with a large mt0mt_0. The finite ports below handle those excursions explicitly.

Odd widths and even lengths above a quadratic budget

The remaining parity of rectangular boards requires remembering the orientation of an efficient boundary. The resulting formula has the same corner cost as the odd-board formula, but no middle-day parity penalty. Throughout this section let w=2b+13,n=2w,h=wn/2,B=b(b+1).w=2b+1\ge3,\qquad n=2\ell\ge w,\qquad h=wn/2,\qquad B=b(b+1). Use L0,L1,J,FL_0,L_1,J,F from (32), (33), and (36), with the present b,mb,m.

Theorem 13.1 (Odd width, even length, every sufficiently large budget). Suppose mb(b+1)+1m\ge b(b+1)+1. For m<hm<h, write D=2mw,2hw1=qD+r,0r<D.D=2m-w,\qquad 2h-w-1=qD+r,\qquad 0\le r<D. Then Tm(PwPn)={2q,r=0,2q+1,r>0 and 2J(r)m,2q+2,r>0 and 2J(r)>m. T_m(P_w\mathbin{\square}P_n)= \begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }2J(r)\le m,\\ 2q+2,&r>0\text{ and }2J(r)>m. \end{cases} (56) For hm<2hh\le m<2h the answer is two days, and for m2hm\ge2h it is one. The upper bounds are explicit physical searches. The lower bounds allow arbitrary inspection locations and arbitrary interleaving of the cohorts.

A sharp orientation constraint

Call a survivor critical when its surplus is bb, and strictly middle when its cardinality ss satisfies b2<s<hB.b^2<s<h-B. Match longitudinal rooms (x,2j)(x,2j) and (x,2j+1)(x,2j+1), and identify a color-pp room with (x,j)(x,j) by y=2j+((px)mod2)y=2j+((p-x)\bmod2). The matching-contracted graph has bidirectional edges in xx and longitudinal edges pointing toward j=0j=0 on even xx, toward j=1j=\ell-1 on odd xx, when p=0p=0; phase one reverses the directions. Put U={0,2,,2b}U=\{0,2,\ldots,2b\} and V={1,3,,2b1}V=\{1,3,\ldots,2b-1\}.

Lemma 13.2 (Critical orientation and a corner consequence). A phase-zero strictly middle critical survivor consists of prefixes of lengths txt_x with 1tu1(uU),tvtutv+1(uv an edge).1\le t_u\le\ell-1\quad(u\in U),\qquad t_v\le t_u\le t_v+1\quad(uv\text{ an edge}). Phase one gives reflected suffixes. Two successive strictly middle survivors cannot both be critical. After a strictly middle critical survivor, any next survivor of size sb2s\le b^2 has at least L1(s)L_1(s) neighbors.

More generally, a survivor of size hxh-x, xBx\le B, and surplus aba\le b can precede a strictly middle critical survivor only if xa2x\le a^2.

Proof. Let HH be the outside directed boundary, of size bb. If two adjacent xx-columns avoid HH, they form a strongly connected ladder, and all horizontal rows avoiding HH belong to one common component. The anchored-area argument of (46) still bounds a set outside that component by b2b^2. At this equality threshold the only new issue is a horizontal matching exception: an occupied row could contain the entire majority parity UU. In that case every one of the bb minority columns has a selected or boundary vertex. Following each minority column toward an empty boundary-free anchor forces a boundary vertex in that same column. All bb boundary vertices would therefore mark exactly VV, contradicting the assumed adjacent unmarked pair. The exception is excluded. The original weighted row sum now gives area at most b2b^2; applied to the transposed complement it gives deficiency at most b2+bb^2+b. Both contradict the strict-middle inequalities.

Thus no adjacent columns are unmarked. With only bb marked columns on a path of 2b+12b+1 positions, they must be exactly VV, with one boundary vertex (v,cv)(v,c_v) on each. In phase zero every UU fiber is a prefix, and directed closure gives RvRu,RuRv{cv}(uv an edge).R_v\subseteq R_u,\qquad R_u\setminus R_v\subseteq\{c_v\} \quad(uv\text{ an edge}). If fiber 2jU2j\in U were empty, summing the neighboring length bounds would give Rj2+(bj)2b2|R|\le j^2+(b-j)^2\le b^2. Applying the same argument to the transposed complement shows that a full UU fiber forces deficiency at most BB. Thus every UU fiber is nonempty and nonfull. A VV fiber cannot contain a point above cvc_v: its forward chain would reach the missing far endpoint without another boundary vertex. Hence it too is a prefix, with the asserted adjacent lengths.

Its neighborhood leaves the UU fibers unchanged, so misses their far endpoints. An opposite-phase strictly middle critical suffix contains all those endpoints, proving incompatibility. Physically the next belief omits an entire longitudinal endpoint row. Its next survivor lies in the minority class of the odd rectangle obtained by removing that row. Theorem 5.1 gives L1(s)L_1(s) for sb2s\le b^2; its opposite-corner term cannot improve the bound.

For the final assertion set A=N(R)A=\overline{N(R)}. Then A=xa|A|=x-a and N(A)RN(A)\subseteq\overline R, so its surplus is at most aa. If the next survivor is strictly middle critical, it contains the favored endpoint row, and AA omits it. In the smaller odd rectangle the minority capacity is hb12Bh-b-1\ge2B, whereas ABa|A|\le B-a. Its reflected profile term is at least b+1b+1. Thus surplus at most aba\le b forces Aa(a1)|A|\le a(a-1), or xa2x\le a^2. ◻

The physical construction

Lemma 11.2 with Q=P2b+1Q=P_{2b+1} has threshold HQ=BH_Q=B. A physical-color-pp envelope AA larger than BB erodes to an opposite-phase pyramid EE with N(E)A,E=A(b+1p). N(E)\subseteq A,\qquad |E|=|A|-(b+1-p). (57)

Choose a phase-pp terminal survivor RR of rank 2R+p=r+12|R|+p=r+1: use (R,p)=(r/2,1)(|R|,p)=(r/2,1) for even rr, and ((r+1)/2,0)((r+1)/2,0) for odd rr. Quadrant prefixes and the pyramid plateau bound provide such an RR with N(R)J(r)|N(R)|\le J(r). For r=0r=0 use the empty phase-one survivor.

Enlarge RR by mm vertices inside the finite predecessor ideal, then apply (57). This backward step raises its rank by exactly DD; every enlarged set has at least m>Bm>B vertices. After q1q-1 steps the first survivor has rank r+1+(q1)D=2h2mr+1+(q-1)D=2h-2m and phase zero, since qq and rr have the same parity. One last enlargement by mm gives the full color class. Reading the nested envelopes forwards gives qq inspection days ending, after movement, in at most J(r)mJ(r)\le m rooms. All requested cardinalities are at most hh, since the backward ranks increase to 2h2m2h-2m.

Reflection in the even longitudinal side lets either initial physical cohort use this favorable relative phase independently. A forward qq-day half-search and a reversed half-search meet on one middle day; their endpoint envelopes have opposite colors and total size at most 2J(r)2J(r). Inspect their union when 2J(r)m2J(r)\le m. Otherwise concatenate two (q+1)(q+1)-day solo searches. For r=0r=0, two qq-day searches suffice. Walk reversal justifies the backward half even when its terminal set is only a containing envelope. This proves all upper bounds in (56).

A corner potential with at most one lost inspection

Put N=2hN=2h and retain the function FF of (36). Define C=min0xB{x+F(2(hx+ρ(x)))}. C=\min_{0\le x\le B}\{x+F(2(h-x+\rho(x)))\}. (58) The following arithmetic records precisely how much the far corner can improve the potential.

Lemma 13.3 (Corner estimates). One has F(N)1CF(N)F(N)-1\le C\le F(N), with equality C=F(N)C=F(N) if r=0r=0. For 0ab0\le a\le b, 0xa(a+1)0\le x\le a(a+1), and U{N,N1}U\in\{N,N-1\}, xa2  x+F(U2(xa))F(U),x+F(U2(xa)+1)F(U).\begin{aligned} x\le a^2&\ \Longrightarrow\ x+F(U-2(x-a))\ge F(U), \\ x+F(U-2(x-a)+1)&\ge F(U). \end{aligned}(59, 60) In particular CF(N1)C\ge F(N-1).

Proof. Cases with xax\le a, or a source in the cardinality branch, follow directly from monotonicity and F(v)v/2F(v)\ge\left\lfloor v/2\right\rfloor. Otherwise put t=xa>0t=x-a>0, d=bad=b-a. Since 2t2b2<D2t\le2b^2<D, a target crosses at most one period boundary. If it enters the final cardinality branch, replacing its actual value by the periodic expression only lowers it, as in Lemma 8.3. Write ρp(v)=Lp(v)v\rho_p(v)=L_p(v)-v, with ρp(0)=0\rho_p(0)=0.

Without a crossing, an even remainder 2k2k in the uncorrected cost has possible discount ρ1(k)ρ1(kt)a\rho_1(k)-\rho_1(k-t)-a. If kt>0k-t>0, square/pronic subadditivity makes this nonpositive. If k=tk=t, it is at most one since Q(t)a+1Q(t)\le a+1; when xa2x\le a^2, the stronger ta(a1)t\le a(a-1) makes it nonpositive. An odd remainder gives ρ0(k+1)ρ0(kt+1)a0\rho_0(k+1)-\rho_0(k-t+1)-a\le0 by square-root subadditivity. For the corrected cost, put v=kt+1>0v=k-t+1>0. The two discounts are ρ1(k)a1ρ0(v),ρ0(k+1)aρ1(v),\rho_1(k)-a-1-\rho_0(v),\qquad \rho_0(k+1)-a-\rho_1(v), both nonpositive: use kR(v)2+a21k\le R(v)^2+a^2-1 and k+1Q(v)(Q(v)1)+a2k+1\le Q(v)(Q(v)-1)+a^2, respectively. If a root is clipped, either the same estimate applies or the cap makes the claim immediate.

At a crossing set λ=mb+kx+ab2a2+k+1.\lambda=m-b+k-x+a\ge b^2-a^2+k+1. For even remainder 2k>02k>0 put c=ρ1(k)a+1c=\rho_1(k)\le a+1; for odd remainder 2k+12k+1 put c=ρ0(k+1)ac=\rho_0(k+1)\le a. The uncorrected discounts are respectively d+cρ0(λ)d+c-\rho_0(\lambda) and d+1+cρ1(λ)d+1+c-\rho_1(\lambda). They are at most one, because λ(d+c2)22d(ac+2)+c>0,λ(d+c1)(d+c2)2d(ac)+3d+c>0.\begin{aligned} \lambda-(d+c-2)^2&\ge2d(a-c+2)+c>0,\\ \lambda-(d+c-1)(d+c-2)&\ge2d(a-c)+3d+c>0. \end{aligned} These follow from k(c1)(c2)+1k\ge(c-1)(c-2)+1 and k(c1)2k\ge(c-1)^2, respectively. When k=0k=0 in the even case, λ>d2\lambda>d^2 instead makes the discount negative; this also proves C=F(N)C=F(N) for remainder zero.

Under xa2x\le a^2, the lower bound on λ\lambda gains aa, and the stronger estimates are λ(d+c1)22d(ac+1)+ac+3>0,λ(d+c)(d+c1)2d(ac)+d+ac+2>0.\begin{aligned} \lambda-(d+c-1)^2&\ge2d(a-c+1)+a-c+3>0,\\ \lambda-(d+c)(d+c-1)&\ge2d(a-c)+d+a-c+2>0. \end{aligned} Here cac\le a in both rows. They prove (59). For the corrected target the discounts are d+cρ1(λ)d+c-\rho_1(\lambda) and d+cρ0(λ+1)d+c-\rho_0(\lambda+1), controlled by λ(d+c1)(d+c2)2d(ac)+3d+2>0,λ+1(d+c1)22d(ac+1)+2>0.\begin{aligned} \lambda-(d+c-1)(d+c-2)&\ge2d(a-c)+3d+2>0,\\ \lambda+1-(d+c-1)^2&\ge2d(a-c+1)+2>0. \end{aligned} The required root thresholds do not exceed their caps b+1b+1 and bb. Again k=0k=0 in the even case follows directly from λ>d(d1)\lambda>d(d-1). A corrected target exactly at a period boundary uses J(D)=mJ(D)=m, equal to the next period’s zero remainder. This proves (60). Finally apply it at U=N1U=N-1, with a=ρ(x)a=\rho(x), to obtain CF(N1)C\ge F(N-1); x=0x=0 gives CF(N)C\le F(N). ◻

Initially mark both cohorts zero. Subsequently mark a belief by z=1z=1 exactly when its preceding survivor was strictly middle critical. Give a belief of size kk potential Φz(k)=min{F(2k+z),max(0,Ch+k)},Φz(0)=0.\Phi_z(k)=\min\{F(2k+z),\max(0,C-h+k)\},\qquad\Phi_z(0)=0. Every physical transition lowers this potential by at most its useful inspection allocation. For a survivor below hBh-B, this follows from Lemma 8.3 and Lemma 13.2: a critical middle move has marks 010\to1, a larger surplus dominates the alternating rank step, and a small survivor uses L0L_0 or L1L_1 according to the source mark. The small target counts are at most b2+b+1mb^2+b+1\le m, so their two ranks have the same cardinality potential. Sources of size at most mm are handled directly by matching. For a co-small survivor with deficiency xx, the definition of CC handles the target’s FF branch. Matching makes deficits grow by at most the useful allocation, handling the linear branch. Thus Tm2C/m. T_m\ge\left\lceil 2C/m\right\rceil. (61)

Since F(N)=qm+J(r)F(N)=qm+J(r), the corner estimates match the upper bound except possibly when r>0,J(r)=m/2+1,C=F(N)1. r>0,\qquad J(r)=\left\lfloor m/2\right\rfloor+1,\qquad C=F(N)-1. (62)

Separating the two corners on longer boards

Suppose h>m+2b2+b. h>m+2b^2+b. (63) It suffices to settle (62). Now mark a belief if its preceding survivor was either strictly middle critical, or co-small with deficiency xx, surplus aba\le b, and x>a2x>a^2. Use the common-cap potential Ψz(k)=min{F(N),F(2k+z)},Ψz(0)=0.\Psi_z(k)=\min\{F(N),F(2k+z)\},\qquad\Psi_z(0)=0. The new mark also forbids a critical next middle move by Lemma 13.2. For a co-small target, the corner estimates give x+F(target rank)F(N):x+F(\text{target rank})\ge F(N): use (59) when xa2x\le a^2 and (60) otherwise. Surplus greater than bb already gives the interior rank inequality.

For a source deficiency dd, monotonicity by two rank units gives d+F(N2d)F(N)d+F(N-2d)\le F(N). A marked source has d1d\ge1, and (62) together with CF(N1)C\ge F(N-1) gives d+F(N2d+1)F(N1)+1F(N).d+F(N-2d+1)\le F(N-1)+1\le F(N). Since the allocation is xdx-d, these estimates prove the potential inequality for every co-small target, including the common cap. For a small target, the old mark uses the conditional L1L_1 bound. A new co-small mark has source size at least hBh-B, so (63) prevents it from reaching size at most b2b^2 in one day. All other steps are the interior cases already checked. Both initial potentials are F(N)F(N), proving Tm2F(N)/m=2q+2T_m\ge\left\lceil 2F(N)/m\right\rceil=2q+2 in the sole possible gap.

Every q4q\ge4 satisfies (63), since h4m3b1,hm2b2bb2b+2>0.h\ge4m-3b-1,\qquad h-m-2b^2-b\ge b^2-b+2>0. Also q1q\ge1 because h>mh>m. For q=1q=1, write r=2s1r=2s-1; then h=m+sh=m+s and F(N)=h+min(R(s),b)F(N)=h+\min(R(s),b). A corner departure with t=xaa2t=x-a\le a^2 costs h+ah+a when tst\ge s, and h+a+min(R(st),b)h+a+\min(R(s-t),b) otherwise. Square-root subadditivity makes both at least F(N)F(N), so C=F(N)C=F(N) and there is no gap. For q=3q=3 in (62), write r=2k+1r=2k+1 and c=min(R(k+1),b)c=\min(R(k+1),b). Then k+c=m/2k+c=\left\lfloor m/2\right\rfloor, so kb(b1)/2k\ge b(b-1)/2, while h=3m2b+kh=3m-2b+k. Hence hm2b2bkb+2(b23b+4)/2>0.h-m-2b^2-b\ge k-b+2\ge(b^2-3b+4)/2>0. Only q=2q=2 still requires an argument.

A two-day bound closes the short-board case

Let q=2q=2, r=2k>0r=2k>0, and c=min(Q(k),b+1)c=\min(Q(k),b+1). Thus h=2mb+kh=2m-b+k and J(r)=k+cJ(r)=k+c. We claim that after any two inspections and their following moves the total deficit of the two cohorts is at most D=hkc. D_*=h-k-c. (64) Use the symmetric inverse profile I(z)=zmin{ρ(z),b,R(hz)},0zh,I(z)=z-\min\{\rho(z),b,R(h-z)\},\qquad0\le z\le h, whose superadditivity was proved in Lemma 11.1. Since hm=mb+k>b2h-m=m-b+k>b^2, the first-day reflected term exceeds bb. Unless all mm useful first-day inspections go to one cohort and its survivor has surplus exactly bb, the first-day total deficit is at most mb1m-b-1. Indeed a nontrivial split would otherwise have positive costs a,aa,a' with a+aba+a'\le b, forcing ma(a+1)+a(a+1)Bm\le a(a+1)+a'(a'+1)\le B, a contradiction. Higher actual surplus only strengthens this conclusion.

In these cases superadditivity bounds the second-day total deficit by I(Z)I(Z), where Z=2mb1<hZ=2m-b-1<h. As Z>BZ>B and hZ=k+1h-Z=k+1, I(Z)=Zmin(b,R(k+1))hkc,I(Z)=Z-\min(b,R(k+1))\le h-k-c, using 1+min(b,R(k+1))c1+\min(b,R(k+1))\ge c.

In the exceptional pure first day, the survivor of size hmh-m is strictly middle critical. The active next belief has m+km+k rooms, and its mate is full. Allocate mum-u to the active cohort and uu to its mate on day two, leaving active survivor size s=k+us=k+u. If s<hBs<h-B, Lemma 13.2 gives at least L1(s)L_1(s) neighbors, both in the small and middle ranges. The mate’s deficit is at most uu, so their total deficit is at most hL1(k+u)+uhkch-L_1(k+u)+u\le h-k-c. If shBs\ge h-B, then u2mbB>mbb2+1u\ge2m-b-B>m-b\ge b^2+1, and the inverse profile gives I(u)=ubI(u)=u-b. The active survivor is nonempty and proper; the exact static profile therefore gives at least s+1s+1 neighbors. The total deficit is at most hkb1hkch-k-b-1\le h-k-c. This proves (64). Unused quotas may be filled monotonically, so the argument includes all schedules with budget at most mm.

Finally, a five-day capture would have two forward days, one middle inspection, and two reversed days. By (64), the two possible-position sets at the middle inspection intersect in at least 2h2D=2J(r)2h-2D_*=2J(r) cells. Every cell in this intersection supports an avoiding walk on each side; their concatenation must be intercepted by the middle inspection. If 2J(r)>m2J(r)>m, this is impossible, giving the required sixth day. All remaining cases already match (61). The one- and two-day regimes follow by inspecting whole color classes. This completes Theorem 13.1.

An exact isoperimetric order in every all-odd box

The preceding rectangle theorem extends to every dimension. The extension uses a weighted exchange argument: compression in lower-dimensional faces first makes neighborhood size a sum of local costs, and an order comparison then identifies exchanges that cannot increase that sum. Parity-restricted isoperimetry on hypercubes was studied by Körner and Wei (1984), and local-to-global methods for Cartesian-product vertex boundaries by Bezrukov and Serra (2002). Here the neighborhood is the open neighborhood of a single color class. We give the face compressions and their exchange argument explicitly, rather than infer the result from a theorem about closed vertex boundaries.

Delete any factors of side length one, and write the remaining box as B=i=1d{0,,Li},2L1Ld,Li even.B=\prod_{i=1}^d\{0,\ldots,L_i\},\qquad 2\le L_1\le\cdots\le L_d,\qquad L_i\text{ even}. Thus coordinates are ordered from the shortest side to the longest. Let BpB_p be its color-pp class, where the color of xx is the parity of x=ixi|x|=\sum_i x_i. Within either color, order vertices by increasing x|x| and then by decreasing lexicographic coordinates. Write xyx\prec y for this order and Ip(k)I_p(k) for its first kk vertices. The direction of the lexicographic tie is part of the definition.

Theorem 14.1 (Compatible isoperimetric nesting in all-odd boxes). For every SBpS\subseteq B_p, N(S)N(Ip(S)).|N(S)|\ge |N(I_p(|S|))|. Moreover, N(Ip(k))N(I_p(k)) is a prefix in the opposite color. Consequently the minimum capture time for every inspection budget on BB is given by an exact recurrence on O(B2)O(|B|^2) states, and optimal inspection sets can be recovered from that recurrence.

For d=1d=1 the minimizing order is the spacing-two prefix order of Lemma 3.4. For d=2d=2, putting the shorter coordinate first and ordering it decreasingly within a weight layer is equivalent to the increasing-long-coordinate convention of Theorem 5.1. These provide the induction bases. In particular, the higher-dimensional assertion does not assume a general Cartesian-product isoperimetric principle.

Prefix neighborhoods and a local cost identity

For a nonzero vertex zz, let j(z)j(z) be its last positive coordinate and put (z)=zej(z).\ell(z)=z-e_{j(z)}. This is its earliest lower neighbor in decreasing lexicographic order.

Lemma 14.2 (Nesting of prefix neighborhoods). For the stated weight and lexicographic order, the neighborhood of a prefix is a prefix of the opposite color. This statement holds even without the assumptions that the side lengths are odd and sorted.

Proof. Within a fixed weight layer, \ell preserves order, allowing ties. Indeed, suppose zwz\prec w first differ in coordinate ii, so zi>wiz_i>w_i. Equal weights imply that ww has a positive coordinate after ii. If zz does too, neither predecessor operation changes the first difference. Otherwise j(z)=ij(z)=i and zi1wiz_i-1\ge w_i. A strict inequality preserves the order. In the equality case the tail of ww has total weight one; removing its unique unit gives (z)=(w)\ell(z)=\ell(w).

Consider a nonempty prefix whose last, possibly partial, layer has weight rr. Every smaller opposite-color layer is completely covered: its nonzero vertices have lower neighbors in complete source layers. When weight zero belongs to the opposite color, it is covered by the first odd layer. No vertex above layer r+1r+1 is covered. On layer r+1r+1, a vertex is covered precisely when its earliest lower neighbor belongs to the selected prefix in layer rr. The order preservation just proved makes these covered vertices an initial interval of layer r+1r+1. The empty prefix is immediate. ◻

Call a set pair-compressed if, after fixing all but any two coordinates, its selected vertices in either free-coordinate parity form a prefix of the inherited order. Define a(0)=d,a(x)=dj(x)+11{xj(x)=Lj(x)}(x0). a(0)=d,\qquad a(x)=d-j(x)+1-\mathbf{1}_{\{x_{j(x)}=L_{j(x)}\}}\quad(x\ne0). (65)

Lemma 14.3 (Neighborhood cost of a pair-compressed set). If d2d\ge2 and SBp\varnothing\ne S\subseteq B_p is pair-compressed, then N(S)=xSa(x)+1{p=1}. |N(S)|=\sum_{x\in S}a(x)+\mathbf{1}_{\{p=1\}}. (66)

Proof. For every nonzero zz, we claim zN(S)(z)S.z\in N(S)\quad\Longleftrightarrow\quad\ell(z)\in S. Only the forward implication needs proof. Choose a neighbor xSx\in S of zz. The vertices xx and (z)\ell(z) differ in at most two coordinates. If xx is a lower neighbor, then (z)\ell(z) is no later than xx in their common weight layer. If xx is an upper neighbor, (z)\ell(z) has weight two less than xx. Pair compression therefore puts (z)\ell(z) in SS. If only one coordinate differs, any second coordinate can be used; one exists because d2d\ge2.

For x0x\ne0 with last positive coordinate JJ, the preimages of xx under \ell are obtained by adding one in coordinate JJ, if it is not full, or by adding one in any coordinate after JJ. Their number is a(x)a(x). The origin has the dd unit vectors as preimages. Thus the sum in (66) counts every nonzero neighbor exactly once.

If p=1p=1, a nonempty pair-compressed set contains a unit vector. Starting with any of its vertices of weight greater than one, decrease by two in a coordinate that is at least two, or decrease by one in two positive coordinates. Each move stays in a pair fiber and goes earlier in its order, so it preserves membership. The process ends at weight one. The origin is therefore an additional neighbor when p=1p=1, and it can never be a neighbor when p=0p=0. ◻

Face compression and its partial order

Suppose d3d\ge3 and the isoperimetric theorem has been proved in dimension d1d-1. On each fixed color define a partial order P\le_P as the reflexive transitive closure of x<Pyif xy and xi=yi for at least one i. x<_P y\quad\hbox{if }x\prec y \hbox{ and }x_i=y_i\hbox{ for at least one }i. (67) All generating relations increase the total order, so this is indeed a partial order. Its ideals are exactly the sets whose restriction to every codimension-one fiber is a prefix.

The inductive isoperimetric theorem and compatible neighborhood nesting make the prefix map on each (d1)(d-1)-dimensional box a strategy compression: it is monotone, preserves cardinality, and sends each color’s neighborhood into the corresponding prefix of the original neighborhood’s size. The remaining side lengths are still sorted, and their order is the restriction of the global order to a fixed-coordinate fiber. By Lemma 3.3, compressing all such fibers for one coordinate index is a strategy compression of BB.

Cycle through the dd indices. Every change strictly decreases the sum of the selected vertices’ positions in the global weight and lexicographic order. This nonnegative integer is bounded by B(B1)/2|B|(|B|-1)/2. The simultaneous-compression argument in Section 3 therefore gives a uniform finite composition whose output is fixed by every face compression. In particular, every SBpS\subseteq B_p can be replaced by a PP-ideal of the same size without increasing its neighborhood.

Every PP-ideal is pair-compressed. A two-coordinate fiber lies inside a codimension-one fiber obtained by fixing a coordinate outside the pair; such a coordinate exists because d3d\ge3. The restriction of a prefix to a subfiber is a prefix of its inherited order. Thus Lemma 14.3 applies to the resulting ideals.

The exchange comparison

The following elementary comparison is the step that links the local cost identity to the global order.

Lemma 14.4 (Terminal-coordinate comparison). Let d3d\ge3. If same-parity vertices satisfy xyx\prec y and xd=0<ydx_d=0<y_d, then xPyx\le_P y. Also, if xyx\prec y and xd<yd=Ldx_d<y_d=L_d, then xPyx\le_P y.

Proof. First, if uvu\le v coordinatewise and their weights have the same parity, then uPvu\le_P v. Perform all required increments of size two within individual coordinates, and then pair the remaining increments of size one. Each step increases weight by two and changes at most two coordinates. Since d3d\ge3, it leaves a coordinate unchanged and is a generator of (67).

For the first assertion, a coordinate agreement between xx and yy already gives a generator. Assume henceforth that all coordinates differ. If x<y|x|<|y| and some i<di<d has xi>yix_i>y_i, transfer t=xiyit=x_i-y_i units from coordinate ii to coordinate dd of xx, obtaining zz. This is legal because 0<tLiLd0<t\le L_i\le L_d and xd=0x_d=0. We have xzx\prec z within their common weight layer, while zyz\prec y follows from z=x<y|z|=|x|<|y|. The vertex zz retains d21d-2\ge1 coordinates of xx and agrees with yy in coordinate ii. Hence x<Pz<Pyx<_P z<_P y. If there is no such excess coordinate, then xyx\le y coordinatewise, and the preceding observation applies.

It remains to consider x=y|x|=|y|. Since all coordinates differ, x1>y1x_1>y_1. If a middle coordinate 2id12\le i\le d-1 has xi>yix_i>y_i, use the same transfer to coordinate dd. Again xzx\prec z, and zyz\prec y because z1=x1>y1z_1=x_1>y_1. The same coordinate agreements give the two generators. Otherwise all middle coordinates increase: xi<yix_i<y_i for 2id12\le i\le d-1. Weight equality gives x1y1=yd+i=2d1(yixi).x_1-y_1=y_d+\sum_{i=2}^{d-1}(y_i-x_i). Transfer ydy_d units from the first to the last coordinate of xx. The resulting vertex zz is valid, since z1=y1+i=2d1(yixi)>y10,zd=ydLd.z_1=y_1+\sum_{i=2}^{d-1}(y_i-x_i)>y_1\ge0, \qquad z_d=y_d\le L_d. It satisfies xzyx\prec z\prec y, shares the middle coordinates with xx, and shares the last coordinate with yy. This proves the first assertion.

The coordinate complement ρ(x)i=Lixi\rho(x)_i=L_i-x_i reverses the weight and lexicographic order, and it preserves coordinate agreements. It therefore reverses the generated partial order. Applying the first assertion to ρ(y)ρ(x)\rho(y)\prec\rho(x) proves the second assertion. ◻

Lemma 14.5 (Cost comparison). If xyx\prec y have the same parity and a(x)>a(y)a(x)>a(y), then xPyx\le_P y.

Proof. If xd=ydx_d=y_d, they share a coordinate. If xd=0<ydx_d=0<y_d, use the first part of Lemma 14.4. The case yd=0<xdy_d=0<x_d cannot give a strict cost decrease, since a(x)1a(x)\le1 and a(y)1a(y)\ge1. Finally, if both last coordinates are positive, both costs are zero or one. A strict decrease forces xd<Ld=ydx_d<L_d=y_d, so the second part of that lemma applies. ◻

Proof of Theorem 14.1. The path and rectangle bases were noted above. In dimension d3d\ge3, the inductive face compressions replace an arbitrary SBpS\subseteq B_p by a PP-ideal of the same size and with no larger neighborhood. The empty set needs no further argument.

If a nonempty PP-ideal is not a global prefix, let xx be its earliest missing vertex and yy its latest included vertex. Then xyx\prec y. They are incomparable in PP: xPyx\le_P y would contradict ideality, and yPxy\le_P x would contradict the global order. By Lemma 14.5, a(x)a(y)a(x)\le a(y).

Replace yy by xx. Removing yy preserves ideality because every proper successor of yy is later in the global order and hence absent. Adding xx preserves ideality because every proper predecessor of xx is earlier and hence present; yy is not such a predecessor. The new set has the same positive cardinality and color. The neighborhood cost identity (66) shows that its neighborhood does not increase. The sum of global positions strictly decreases, so iteration ends at the global prefix of that size. This proves the isoperimetric inequality. Lemma 14.2 gives compatible nesting, completing the induction. ◻

Profiles, exact capture times, and optimal inspections

Write V=BV=|B|, E=(V+1)/2E=(V+1)/2, and M=(V1)/2M=(V-1)/2. The theorem supplies the complete profiles by a direct cumulative-sum construction: gp(0)=0,gp(k)=xIp(k)a(x)+1{p=1}(k>0). g_p(0)=0,\qquad g_p(k)=\sum_{x\in I_p(k)}a(x)+\mathbf{1}_{\{p=1\}}\quad(k>0). (68) For d=1d=1 these expressions also agree with the odd-path profiles. Enumerate the vertices, order each color as specified, evaluate (65), and take cumulative sums. Using a mixed-radix lexicographic index, sorting requires O(VlogV)O(V\log V) integer comparisons; computing weights, indices and costs directly requires O(dV)O(dV) additional operations. This is a constructive profile algorithm, without an isoperimetric optimization subroutine.

Corollary 14.6 (Feasibility by one profile maximum). For every nontrivial all-odd box, the minimum feasible daily budget is h(B)=1+max0kE(g0(k)k)=1+max0kExI0(k)(a(x)1). h(B)=1+\max_{0\le k\le E}\bigl(g_0(k)-k\bigr) =1+\max_{0\le k\le E} \sum_{x\in I_0(k)}\bigl(a(x)-1\bigr). (69) The one-room box has threshold one by direct inspection.

Proof. We verify the hypotheses of the general hunter-number criterion of Bolkema and Groothuis (2019, Theorem 16). That theorem states that a bipartite graph with compatible isoperimetric nesting has hunter number 1+min(u0,u1)1+\min(u_0,u_1) when the maximum neighborhood surpluses up=maxk(gp(k)k)u_p=\max_k(g_p(k)-k) differ by at most one.

For completeness, the exact profile duality gives the required relation between these maxima. Define J(z)=max{x:0xE, g0(x)z},0zM.J(z)=\max\{x:0\le x\le E,\ g_0(x)\le z\}, \qquad 0\le z\le M. Then g1(y)=EJ(My). g_1(y)=E-J(M-y). (70) Indeed, a majority set of size xx with at most MyM-y neighbors leaves a minority yy-set with no edges to it, giving g1(y)Exg_1(y)\le E-x. Conversely, the majority complement of the neighborhood of a minimizing minority yy-set has size Eg1(y)E-g_1(y) and at most MyM-y neighbors. These two choices prove (70). Since E=M+1E=M+1, it follows that u1=1+max0zM(zJ(z)).u_1=1+\max_{0\le z\le M}(z-J(z)). This last maximum equals u0u_0. If J(z)<EJ(z)<E, let x=J(z)+1x=J(z)+1. Then g0(x)>zg_0(x)>z, so zJ(z)g0(x)xu0z-J(z)\le g_0(x)-x\le u_0. If J(z)=EJ(z)=E, the absence of isolated vertices implies g0(E)=Mg_0(E)=M; thus z=Mz=M and zJ(z)=1u0z-J(z)=-1\le u_0. For the reverse inequality choose a positive xx attaining u0u_0. Such an xx exists even when u0=0u_0=0, because g0(1)1g_0(1)\ge1 then forces g0(1)=1g_0(1)=1. For z=g0(x)1z=g_0(x)-1 we have 0z<M0\le z<M and J(z)x1J(z)\le x-1, hence zJ(z)g0(x)x=u0z-J(z)\ge g_0(x)-x=u_0. Therefore u1=u0+1u_1=u_0+1.

Theorem 14.1 supplies compatible nesting, so the cited criterion yields h(B)=1+u0h(B)=1+u_0. Its general lower-bound theorem is being used here; profile duality alone is not a lower-bound proof. The cumulative-sum formula follows from (68). ◻

The upper bound also admits a direct description. Spend all m=u0+1m=u_0+1 inspections on one current prefix cohort. If it is not yet captured, a majority step decreases its size by at least one, while a minority step does not increase it, because u1=u0+1u_1=u_0+1. Thus it clears after finitely many steps. Clear the other initial cohort next. This proves feasibility without asserting that serial allocation minimizes the time.

For example, the partial-sum scan gives B3×35×53×3×33×5×55×5×53×3×3×3h(B)23581212\begin{array}{c|rrrrrr} B&3\times3&5\times5&3\times3\times3&3\times5\times5 &5\times5\times5&3\times3\times3\times3\\\hline h(B)&2&3&5&8&12&12 \end{array} Feasibility therefore needs only the profile scan. Minimum capture time uses the following two-count recurrence.

Define C(S)=I0(SB0)I1(SB1).C(S)=I_0(|S\cap B_0|)\cup I_1(|S\cap B_1|). Isoperimetry and nesting imply that CC is an idempotent strategy compression. Theorem 3.2 therefore gives an optimal strategy from the full board in which both current-color parts and both survivor parts are prefixes.

A state is the pair (u,v)(u,v) of counts in the current colors. Choosing survivor counts 0iu0\le i\le u and 0jv0\le j\le v costs u+viju+v-i-j inspections and gives the exact next state (u,v)(g1(j),g0(i)). (u,v)\longrightarrow (g_1(j),g_0(i)). (71) The inspection sets are the suffixes I0(u)I0(i)I_0(u)\setminus I_0(i) and I1(v)I1(j)I_1(v)\setminus I_1(j). Thus every transition is physically realized, and every unrestricted successful search is matched by a path in this state graph.

For a fixed daily budget mm, the optimum is the shortest-path distance from (E,M)(E,M) to (0,0)(0,0), with value infinity when there is no such path. There are (E+1)(M+1)=O(V2)(E+1)(M+1)=O(V^2) states. If u+vmu+v\le m, one final day captures every possibility. Otherwise, additional inspections cannot hurt, so it suffices to allocate exactly mm useful inspections. For max(0,mv)pmin(m,u),\max(0,m-v)\le p\le\min(m,u), the corresponding transition is (u,v)(g1(vm+p),g0(up)). (u,v)\longrightarrow \bigl(g_1(v-m+p),\,g_0(u-p)\bigr). (72) There are at most m+1m+1 transitions per state. Constructing the graph and performing breadth-first search therefore take O((m+1)V2)O((m+1)V^2) operations after constructing the profiles. Recording a shortest path recovers an explicit optimal inspection sequence. A finite optimum is at most (E+1)(M+1)1(E+1)(M+1)-1, since a shortest path repeats no state. The bounds are polynomial in the number of rooms, rather than in the logarithms of the side lengths.

Equivalently, all budgets can be considered together. Let Wt(u,v)W_t(u,v) be the smallest daily budget sufficient in at most tt days. Then W0(0,0)=0,W0(u,v)=((u,v)(0,0)),Wt+1(u,v)=min0iu0jvmax{u+vij, Wt(g1(j),g0(i))}.\begin{aligned} W_0(0,0)&=0,& W_0(u,v)&=\infty\quad((u,v)\ne(0,0)),\notag\\ W_{t+1}(u,v) &=\min_{\substack{0\le i\le u\\0\le j\le v}} \max\bigl\{u+v-i-j,\ W_t(g_1(j),g_0(i))\bigr\}. \end{aligned}(73) This exact recurrence includes arbitrary interleaving of the two initial parity cohorts; it makes no serial-allocation assumption.

Remark 14.7. Every weight and lexicographic prefix is a checkerboard corner ideal: a distinct coordinatewise smaller vertex of the same parity has smaller weight. Hence the theorem also proves a corner-ideal normal form for the full-board game on every all-odd box. It does not assert that a global prefix can replace an arbitrary prescribed partial starting set without altering its optimum, and it does not settle boxes with even side lengths. The all-odd-box result gives exact feasibility, minimum time, and strategies through a polynomial recurrence; a uniform closed arithmetic expression for that time is a further question.

Paths: matching geometry and a probe-count potential

We prove the path formula stated in (1). The geometric lower proof applies to arbitrary possible-position sets. An interval description is used only for the explicit strategy attaining the bound.

An optimal four-day search of eight rooms with two daily probes. The rows show every position still possible before that day’s inspection.

Neighborhood inequalities

Number the vertices 0,,n10,\ldots,n-1. Each set below is contained in one color class. If nn is even, the edges (0,1),(2,3),(0,1),(2,3),\ldots give a perfect matching and therefore N(R)R|N(R)|\ge |R|. We need the following information about equality.

Lemma 15.1. On an even path, if 0<R<n/20<|R|<n/2 and N(R)=R|N(R)|=|R|, then N(R)N(R) contains neither endpoint. Every nonempty set containing neither endpoint has strictly more neighbors than vertices. On an odd path with larger class EE and smaller class OO, N(R)min{R,O}(RE),N(R)R+1(RO).|N(R)|\ge\min\{|R|,|O|\}\quad(R\subseteq E),\qquad |N(R)|\ge |R|+1\quad(\varnothing\ne R\subseteq O).

Proof. Let MM send each vertex of an even path to its matching partner. Equality implies N(R)=M(R)N(R)=M(R). If RR consists of even vertices and contains 2i>02i>0, its neighbor 2i12i-1 forces 2i2R2i-2\in R. Thus equality makes RR an initial segment of the even vertices. Similarly an odd equality set is a final segment of the odd vertices. These statements prove both assertions about endpoints: a proper initial even segment has an odd neighborhood missing the far endpoint, and a proper final odd segment has an even neighborhood missing the other endpoint. Conversely, a nonempty equality set must itself contain an endpoint.

When nn is odd, for every even vertex gg there is a matching covering all vertices except gg: match consecutive vertices separately to its left and right. If RER\subsetneq E, choose gRg\notin R to inject RR into N(R)N(R). For R=ER=E its neighborhood is OO. Finally, for nonempty ROR\subseteq O, the matching exposing vertex 00 injects RR into N(R)N(R), and equality is impossible: the least occupied odd vertex has a left neighbor that would force a smaller occupied odd vertex, or the unmatched vertex 00. Thus there is at least one extra neighbor. ◻

Track separately the targets that started in the two colors. Their current colors are opposite each day, so their allocations p,qp,q always satisfy p+qmp+q\le m. Write bb for a cohort’s size before inspection. On an even path retain a bit zz: it is one just after a nonempty proper zero-growth neighborhood, and zero otherwise. Such a set is endpointless by the lemma. A surviving subset of it therefore expands strictly. The rank u=2b+zu=2b+z, with rank zero for the empty set, is at most nn and each physical step dominates FC(u,p)={0,u/2p,min{C,u2p+c},u/2>p, F_C(u,p)=\begin{cases} 0,&\left\lfloor u/2\right\rfloor\le p,\\ \min\{C,u-2p+c\},&\left\lfloor u/2\right\rfloor>p, \end{cases} (74) with C=n,c=1C=n,c=1. Indeed, a zero-growth step raises the bit from zero to one; a step following bit one gains a vertex and may discard the bit. Both changes give at least one unit after subtracting 2p2p.

For odd nn, assign rank 2b2b in EE, rank 2b+12b+1 in nonempty OO, and zero to the empty set. The same comparison holds with c=1c=1 and alternating new caps n+1n+1 in EE and nn in OO. Initially the ranks are n+1,nn+1,n. Replacing both caps and initial ranks by nn gives a valid lower comparison, since FCF_C is nondecreasing in CC and uu.

A general potential for the counting argument

Lemma 15.2 (Affine-rank potential). Let 0c<2m0\le c<2m, D=2mcD=2m-c, and uCu\le C. Define J(u)=max{uc2,0}D,Φ(u)=u+cJ(u)2.J(u)=\left\lfloor\frac{\max\{u-c-2,0\}}D\right\rfloor,\qquad \Phi(u)=\left\lfloor\frac{u+cJ(u)}2\right\rfloor. For 0pm0\le p\le m, the constant-cap transition (74) satisfies Φ(u)p+Φ(FC(u,p))\Phi(u)\le p+\Phi(F_C(u,p)). Consequently two such ranks sharing budget mm need at least (Φ(u0)+Φ(v0))/m\left\lceil(\Phi(u_0)+\Phi(v_0))/m\right\rceil rounds to become zero.

Proof. Both JJ and Φ\Phi are nondecreasing. If capture occurs, then u2p+12m+1u\le2p+1\le2m+1, whence J(u)=0J(u)=0 and Φ(u)p\Phi(u)\le p. If 2pc2p\le c and capture does not occur, the next rank is at least uu, because uCu\le C. Otherwise put v=u2p+cv=u-2p+c. It is positive and at most uCu\le C, so the cap does not act. Since 2pcD2p-c\le D, J(u)J(v)+1J(u)\le J(v)+1. Therefore u+cJ(u)v+2p+cJ(v).u+cJ(u)\le v+2p+cJ(v). Divide by two and take floors. Summing the resulting inequalities over both ranks and all rounds proves the last assertion. ◻

For paths c=1c=1. Suppose n>m2n>m\ge2, put D=2m1D=2m-1, and use positive remainder coordinates n=qD+r+2,1rD.n=qD+r+2,\qquad 1\le r\le D. Here n3n\ge3 and q0q\ge0. Direct substitution gives Φ(n)=qm+(r+2)/2.\Phi(n)=qm+\left\lfloor(r+2)/2\right\rfloor. The resulting lower bound is 2q+12q+1 when rm2r\le m-2, or when r=m1r=m-1 and mm is even; otherwise it is 2q+22q+2. For even nn this is the required answer. For odd nn it misses just the case mm even and r=m1r=m-1, which we now settle.

The equality obstruction on odd paths

Here n=q(2m1)+m+1n=q(2m-1)+m+1 with m,qm,q even. Assume a strategy succeeds in T=2q+1T=2q+1 days. Use the exact alternating-cap comparison counters. For each counter, select its first zero and its last full state before that zero. If this interval starts at time aa, has length LL, and uses PP probes, all intermediate transitions are unsaturated. Telescoping the affine transitions, including the final capture inequality, gives C(a)+L2P+2,PLm.C(a)+L\le2P+2,\qquad P\le Lm. Since C(a)nC(a)\ge n, these imply Lq+1L\ge q+1 and PA:=qm+m/2P\ge A:=qm+m/2. The two cohorts together have only Tm=2ATm=2A probes, so equality holds for both. In particular L=q+1L=q+1 and C(a)=nC(a)=n: both intervals start when their cohort is in the smaller color class.

Their starting times have opposite parity and are at most qq. The odd one, aa, satisfies 1aq11\le a\le q-1 because qq is even. If the even starting time is zero, both intervals lie in the first 2q2q days; otherwise both lie in the last 2q2q days. Their total probe count 2A=(2q+1)m2A=(2q+1)m exceeds the 2qm2qm available in either window. This contradiction proves that one extra day is necessary. The argument permits overlapping active intervals and arbitrary wasted inspections outside them.

For m=1m=1, the same potential has D=1D=1 and Φ(n)=n2\Phi(n)=n-2 for n3n\ge3, giving 2n42n-4 days. On P2P_2 one probe cannot inspect both initial possibilities, and two consecutive inspections of one endpoint suffice. A single room is inspected directly.

An explicit strategy attaining the bound

For this construction number rooms 1,,n1,\ldots,n. Put A(r)={r,r2,r4,}{1,,n}.A(r)=\{r,r-2,r-4,\ldots\}\cap\{1,\ldots,n\}. For 1r<n1\le r<n, N(A(r))=A(r+1)N(A(r))=A(r+1). Inspecting the bb largest vertices of A(r)A(r) leaves A(r2b)A(r-2b); if nonempty, movement changes the frontier to r2b+1r-2b+1. Reflection in the middle of the path gives the same rule in the opposite direction.

Assume n3n\ge3 and n>mn>m. Set d=2m1d=2m-1 and e=n2d,ρ=n2(e1)d,c=ρ/2+1,=mc.e=\left\lceil\frac{n-2}{d}\right\rceil,\qquad \rho=n-2-(e-1)d,\qquad c=\left\lfloor\rho/2\right\rfloor+1,\qquad \ell=m-c. Thus 1ρd1\le\rho\le d. Start with the cohort occupying A(n1)A(n-1) and inspect its largest mm possible rooms each day. Its frontier before day tt is n1(t1)dn-1-(t-1)d, so it finishes on day ee, using only cc inspections that day. If >0\ell>0, assign the remaining \ell inspections to the other cohort immediately; if =0\ell=0, start that cohort on day e+1e+1.

Before its first inspection the second cohort is a whole color class. For odd nn, use the same orientation. Its frontier is nn on an odd starting day and n1n-1 on an even starting day. For even nn, choose the orientation whose frontier is n1n-1: reflect when the starting day is odd. If its first batch has size bb, the surviving frontier is R02b+1R_0-2b+1. Continue with batches of mm until capture. A nonempty frontier A(R)A(R) with R2R\ge2 requires (R1)/d\left\lceil(R-1)/d\right\rceil such days; a singleton is inspected once.

For completeness the arithmetic determining the joining day is as follows. If =0\ell=0 the total is 2e2e. If >0\ell>0, the totals are 2e2+2ρ+2d(n odd),2e2+ρ+2cd(n even).2e-2+\left\lceil\frac{2\rho+2}{d}\right\rceil\quad(n\text{ odd}),\qquad 2e-2+\left\lceil\frac{\rho+2c}{d}\right\rceil\quad(n\text{ even}). They equal 2e12e-1 exactly when ρm2\rho\le m-2, or when ρ=m1\rho=m-1 and n,mn,m are both even; otherwise they equal 2e2e. Comparing with (2n4)/d\left\lceil(2n-4)/d\right\rceil proves (1). For m=1m=1 it gives 2n42n-4. If nmn\le m, inspect every vertex on the first day. This completes both the construction and the arbitrary- strategy lower bound.

Two rows: an exact pair of counters

A two-row rectangle P2PnP_2\mathbin{\square}P_n is also called a ladder: the two horizontal paths are joined by one vertical edge in each column. Its graph terminology does not impose any restriction on the searcher’s movements between inspections.

For a cohort of fixed initial color, at any one time exactly one room per column has the right color. Identify its possible rooms with their column set B{1,,n}B\subseteq\{1,\ldots,n\}. A vertical move keeps the column, and a horizontal move changes it by one. Consequently the next column set after inspections is the closed path neighborhood NPn[BS]=(BS)NPn(BS).N_{P_n}[B\setminus S]=(B\setminus S)\cup N_{P_n}(B\setminus S). Every nonempty proper column set gains at least one column. An initial or final interval attains the bound and stays an interval. Therefore the exact one-cohort size transition with pp probes is F(b,p)={0,pb,min{n,bp+1},p<b.F(b,p)=\begin{cases}0,&p\ge b,\\ \min\{n,b-p+1\},&p<b. \end{cases} The two counters start at (n,n)(n,n) and share the budget mm. This is an exact lower and upper model: the inequality holds for arbitrary supports, and two boundary intervals attain every chosen sequence of allocations.

Theorem 16.1. For n2n\ge2 the minimum-time function is (2), with value \infty for m1m\le1 and value one for m2nm\ge2n.

Proof. For 2m<2n2\le m<2n, put N=n1N=n-1 and M=m1M=m-1. Assign a counter of size bb the weight w(b)=max{b1,0}w(b)=\max\{b-1,0\}. With a positive allocation pp, its weight drops by at most p1p-1; with no allocation its weight cannot drop. Thus the combined daily drop is at most MM, and T2N/MT\ge\left\lceil 2N/M\right\rceil.

Suppose 2N=TM2N=TM. Equality in this bound requires every day to allocate all mm probes to exactly one cohort and to reduce its weight by exactly MM. Each initial weight NN must consequently be divisible by MM. If 2N2N is divisible by MM but NN is not, one extra day is necessary. This is exactly the exceptional condition that MM is even and NM/2(modM)N\equiv M/2\pmod M.

To attain the answer, write N=qM+sN=qM+s, 0s<M0\le s<M. If s=0s=0, clear the first interval in qq full days and the second in qq more. Suppose s>0s>0. After qq full days on the first interval its size is s+1s+1. On the next day finish it with s+1s+1 probes and assign the remaining MsM-s to the other, still full, interval. Its next size is b=n(Ms)+1=(q1)M+2s+2.b=n-(M-s)+1=(q-1)M+2s+2. It then needs (b1)/M\left\lceil(b-1)/M\right\rceil days. The total is 2q+2s+1M,2q+\left\lceil\frac{2s+1}{M}\right\rceil, which is the claimed ceiling plus precisely the equality correction. The second interval always survives the shared day. If q=0q=0, then s=n1s=n-1 and its allocation is Ms=mn<nM-s=m-n<n, because m<2nm<2n. If q1q\ge1, then Mn1M\le n-1 and Ms<nM-s<n as well. Thus b2b\ge2 in both cases, and the displayed solo-day formula counts at least one remaining day. The algebra also holds for q=0q=0, by the integer translation rule for ceilings.

For one probe, an uninspected cohort remains full. Inspecting one room of a full color class also leaves the other color class full after movement, since every room on a ladder with n2n\ge2 has at least two neighbors. Hence capture is impossible. The one-day assertion is immediate from the number of initial rooms. For n=1n=1 the graph is P2P_2 and the path result applies. ◻

Three rows: a historical rank and the exact time

We prove the three-row classification in (3), including optimal inspection schedules. Put G=P3PnG=P_3\mathbin{\square}P_n. The length n=1n=1 is a three-vertex path. Henceforth n2n\ge2; a four-cycle contained in GG precludes capture with one inspection per day. Indeed, a target may stay on that cycle, where a nonempty parity cohort always has two possible vertices after movement. The constructions below show that two inspections suffice.

Even lengths: the efficient survivor sets

Let n=2sn=2s and h=3sh=3s, so both parity classes have hh vertices. In coordinates (column,row)(\text{column},\text{row}), label one parity by ai=(2i,0),bi=(2i,2),ci=(2i+1,1)(0i<s).a_i=(2i,0),\qquad b_i=(2i,2),\qquad c_i=(2i+1,1) \quad(0\le i<s). Match these vertices respectively to (2i+1,0),(2i+1,2),(2i,1)(2i+1,0),(2i+1,2),(2i,1) in the other parity. Contracting an edge followed by the inverse matching map gives a directed graph DD on the labelled parity. Besides loops, its arcs are aicibi,aiai1,bibi1,cici+1,a_i\leftrightarrow c_i\leftrightarrow b_i,\qquad a_i\to a_{i-1},\quad b_i\to b_{i-1},\quad c_i\to c_{i+1}, with out-of-range subscripts omitted. Consequently, for every survivor set RR in this parity, NG(R)R=ND+(R)R. |N_G(R)|-|R|=|N_D^+(R)\setminus R|. (75) Each triple is strongly connected; its middle chain moves right and its outer chains move left. Thus DD is strongly connected, and every nonempty proper parity set has surplus at least one.

Lemma 17.1. If RR is nonempty, Rh2|R|\le h-2, and N(R)=R+1|N(R)|=|R|+1, then R={ai,bi,ci:0i<j}U,U{aj,bj},0j<s.R=\{a_i,b_i,c_i:0\le i<j\}\cup U, \qquad U\subseteq\{a_j,b_j\},\quad 0\le j<s. For the opposite parity the analogous sets start at the other end. Moreover, if RN(R)R'\subseteq N(R) is nonempty, also has surplus one, and Rh2|R'|\le h-2, then R=h2|R|=h-2 and R=1|R'|=1.

Proof. By (75), the outside boundary is a single vertex vv, and RR is closed under outgoing arcs of DvD-v. Deleting an outer vertex leaves a strongly connected graph: the other outer chain still moves left, the middle chain moves right, and all remaining outer vertices connect to their middle vertices. A nonempty closed set would then have all h1h-1 remaining vertices, contrary to the hypothesis.

Deleting cjc_j leaves the prefix triples, the two singletons aj,bja_j,b_j, and the suffix triples as strongly connected components, omitting empty components. Arcs go from the suffix to each singleton and from each singleton to the prefix. A nonempty outgoing-closed set of size at most h2h-2 is therefore precisely the stated prefix with some of the two singletons. Reflection in the long coordinate exchanges the physical parities and gives the opposite description.

Every nonempty classified set contains an outer corner at its starting end, and a set of size at least two contains both outer corners there. The neighborhood of RR contains no outer corner at the opposite end unless j=s1j=s-1. In that case the size bound permits at most one of aj,bja_j,b_j. Containing an opposite corner therefore forces R=h2|R|=h-2 and supplies exactly one such corner. Hence RR' must be a singleton. ◻

A rank valid for arbitrary supports

We first assume m<h2m<h-2. Track the two initial-parity cohorts separately. For a physical support AA, set z=1z=1 if the preceding survivor set was nonempty, had surplus one, and had size at most h2h-2; otherwise set z=0z=0. In particular full and empty supports have label zero. Define ρ(A)=2A+z\rho(A)=2|A|+z for nonempty AA, and ρ()=0\rho(\varnothing)=0. This label records history and imposes no shape restriction on AA.

For a numerical rank 0u2h0\le u\le2h and an allocation pp, put Fh(u,p)={0,u/2p,min{2h,u2p+3},u/2>p. F_h(u,p)= \begin{cases} 0,&\left\lfloor u/2\right\rfloor\le p,\\ \min\{2h,u-2p+3\},&\left\lfloor u/2\right\rfloor>p. \end{cases} (76) It is nondecreasing in uu and nonincreasing in pp.

Lemma 17.2. If pm<h2p\le m<h-2 useful probes leave RAR\subseteq A, then ρ(N(R))Fh(ρ(A),p)\rho(N(R))\ge F_h(\rho(A),p).

Proof. Write r=R=Apr=|R|=|A|-p. Empty survivors are immediate. If r=hr=h or r=h1r=h-1, the neighborhood is full: every opposite-parity vertex has degree at least two. Thus its rank is the cap 2h2h.

Suppose 1rh21\le r\le h-2. If the surplus is one, the next label is one. The old label cannot be one: Lemma 17.1 would require a support of size h1h-1 to be reduced to one vertex, using h2h-2 probes. Hence the new rank is 2(r+1)+1=ρ(A)2p+32(r+1)+1=\rho(A)-2p+3. If the surplus is at least two, the new rank is at least 2r+4ρ(A)2p+32r+4\ge\rho(A)-2p+3, since the old label is at most one. Capping can only weaken these inequalities. ◻

Starting from (2h,2h)(2h,2h), compare any actual schedule to the two-counter process (u,v)(Fh(u,p),Fh(v,mp)),0pm.(u,v)\longmapsto\bigl(F_h(u,p),F_h(v,m-p)\bigr),\qquad 0\le p\le m. Its terminal inspection condition is u/2+v/2m\left\lfloor u/2\right\rfloor+\left\lfloor v/2\right\rfloor\le m. Use the actual two useful allocations; assign unused budget arbitrarily. Monotonicity and Lemma 17.2 keep the abstract ranks below the actual ranks throughout, so the numerical process captures no later than the actual schedule.

Conversely this process is physically realizable. Order each parity by increasing coordinate sum, breaking ties by increasing column. The two orders are E:;(0,0),((2i2,2),(2i1,1),(2i,0))i=1s1,(2s2,2),(2s1,1),O:;(0,1),(1,0),((2i1,2),(2i,1),(2i+1,0))i=1s1,(2s1,2).\begin{aligned} E:;&(0,0),\quad ((2i-2,2),(2i-1,1),(2i,0))_{i=1}^{s-1},\quad(2s-2,2),(2s-1,1),\\ O:;&(0,1),(1,0),\quad ((2i-1,2),(2i,1),(2i+1,0))_{i=1}^{s-1},\quad(2s-1,2). \end{aligned} Empty repeated blocks are omitted. Reading the neighbors of successive vertices in these lists gives, for every k>0k>0, N(Ek)=Omin(h,k+1),N(Ok)=Emin(h,k+2).N(E_k)=O_{\min(h,k+1)},\qquad N(O_k)=E_{\min(h,k+2)}. Here Ek,OkE_k,O_k denote prefixes of size kk; empty prefixes have empty neighborhood. Deleting a suffix of pp vertices and moving therefore realizes (76), with phases z=0,1z=0,1 respectively. A full cohort may choose either reflected orientation freely; reflection in the long coordinate exchanges physical parities. The two cohorts choose these orientations independently. Proper cohorts retain their orientation until they fill a parity class again or disappear. Thus the numerical process gives the exact time for m<h2m<h-2.

The even case: one critical budget and a specialization

At m=2m=2 and n4n\ge4, put V(u)=(u4)+V(u)=\left(u-4\right)_+. Directly from (76), allocating zero or one probe cannot lower VV, and allocating two lowers it by at most one, including capture. The shared two-probe budget therefore lowers the sum of the two potentials by at most one per day. Its initial value is 2(2h4)=6n82(2h-4)=6n-8, proving T26n8T_2\ge6n-8. A full two-probe solo sweep decreases its rank by one until the final rank is at most five, then captures; its duration is 2h42h-4. Two independently oriented sweeps attain 6n86n-8. For n=2n=2, the same value is four by the two-row theorem (2).

For every m3m\ge3 and even n4n\ge4, specialize Theorem 13.1 to b=1b=1. Its numerator is 3n43n-4, its denominator is D=2m3D=2m-3, and its corner cost is J(r)=r/2+2J(r)=\left\lfloor r/2\right\rfloor+2 for r>0r>0. Since 3n4=qD+r3n-4=qD+r is even, rq(mod2)r\equiv q\pmod2, so 2J(r)=r+4(qmod2).2J(r)=r+4-(q\bmod2). This is exactly the even-length condition in (3). The same theorem includes all boundary budgets and the one- and two-day cases; n=2n=2 is already covered by the two-row theorem.

The preceding numerical model also retains a useful interval bound. For m<h2m<h-2, put W=2h4W=2h-4 and D=2m3D=2m-3. In a cohort’s interval from its last full state before first capture to that capture, let \ell be the number of days and PP its total inspections. No intermediate step saturates; the 1\ell-1 nonterminal moves each add three rank units. The final capture inequality and PmP\le m\ell give PW+32,DW. P\ge\left\lceil\frac{W+3\ell}{2}\right\rceil,\qquad \ell D\ge W. (77) These two cohort intervals may overlap arbitrarily, and their inspection totals still sum to at most the whole schedule’s budget.

Odd lengths as a specialization of the general theorem

For odd n3n\ge3, Theorem 8.1 applies with b=1b=1 at every feasible budget m2m\ge2. For a positive argument, its corner functions are L0(k)=k+1L_0(k)=k+1 and L1(k)=k+2L_1(k)=k+2. Consequently J(r)=r/2+2,δ(r)=rmod2,2J(r)+δ(r)=r+4(r>0).J(r)=\left\lfloor r/2\right\rfloor+2,\qquad \delta(r)=r\bmod2,\qquad 2J(r)+\delta(r)=r+4\quad(r>0). Since Nw1=3n4N-w-1=3n-4, its quotient, remainder, and shared-day condition are exactly the odd-length branch of (3). The same theorem gives the one- and two-day thresholds. Its lower bound applies to arbitrary strategies, and its two sweeps give the attaining schedules. Thus no separate odd-length rank or equality argument is required. Together with the even-length proof and the already treated degenerate boards, this completes every three-row parameter case.

Four rows as a uniform-theorem corollary

For G=P4PnG=P_4\mathbin{\square}P_n, n4n\ge4, the improved root threshold makes every feasible budget a case of Theorem 11.3. No separate productive-inspection argument is needed.

Corollary 18.1 (Every four-row budget). Formula (4) holds, with physical attaining strategies and lower bounds against arbitrary searches. In particular T3(G)=4n4,T4(G)=2n2.T_3(G)=4n-4,\qquad T_4(G)=2n-2.

Proof. Put b=2b=2, h=2nh=2n. The uniform budget threshold is max{3,2(21)+1}=3\max\{3,2(2-1)+1\}=3. Its division is h2=q(m2)+rh-2=q(m-2)+r. Since J(1)=2J(1)=2 and J(r)=r+2J(r)=r+2 for r2r\ge2, the central-day condition is automatic for r=1r=1 and otherwise is m2r+4m\ge2r+4. This gives (4), including its extreme budgets. For m=3,4m=3,4 the remainder is zero, giving the two displayed specializations. The rectangular feasibility threshold excludes m2m\le2. Smaller lengths reduce by exchanging coordinates to the path, two-row, or three-row cases. ◻

Five rows

Five rows admit a complete minimum-time classification at every budget. The two parities of the long side require different lower arguments.

Theorem 19.1 (Five rows, three inspections). For every n5n\ge5, T3(P5Pn)=10n20. T_3(P_5\mathbin{\square}P_n)=10n-20. (78) The odd-length proof uses the profiles of Theorem 5.1. The even-length proof uses an exhaustive finite symbolic certificate for arbitrary supports. Both arithmetic potential inequalities are verified in Lean; the complete five-row geometric argument is not presently formalized.

Odd lengths: exact profiles and a parity potential

Suppose n5n\ge5 is odd, and put h=(5n1)/212h=(5n-1)/2\ge12. The even physical parity has h+1h+1 vertices and the odd physical parity has hh. Denote these parities by z=0,1z=0,1, respectively. Specializing Theorem 5.1 to short-side parameter b=2b=2 gives g0(0)=g1(0)=0g_0(0)=g_1(0)=0 and g0(k)={h,hkh+1,k+1,k=1 or h3kh1,k+2,2kh4,g1(k)={h+1,k=h,k+2,1k2 or h2kh1,k+3,3kh3.\begin{aligned} g_0(k)&=\begin{cases} h,&h\le k\le h+1,\\ k+1,&k=1\text{ or }h-3\le k\le h-1,\\ k+2,&2\le k\le h-4, \end{cases} \\ g_1(k)&=\begin{cases} h+1,&k=h,\\ k+2,&1\le k\le2\text{ or }h-2\le k\le h-1,\\ k+3,&3\le k\le h-3. \end{cases} \end{aligned}(79, 80) For example, the complementary corner term in the majority profile is at most one exactly when h+1k4h+1-k\le4. The minority corner term Q(k)Q(k) is at most two exactly when k2k\le2, and Q(0)=1Q(0)=1 handles its full set.

Define Wh(b,z)={0,b=0,1,1b2,b2,3b5,min{2b+z8, b+h+z10},b6. W_h(b,z)=\begin{cases} 0,&b=0,\\ 1,&1\le b\le2,\\ b-2,&3\le b\le5,\\ \min\{2b+z-8,\ b+h+z-10\},&b\ge6. \end{cases} (81) A reachable nonempty support has at least three vertices in parity zero and at least two in parity one: these are the minimum degrees of vertices in the opposite parities. Thus its size satisfies b=0or3zbh+1z. b=0\quad\hbox{or}\quad 3-z\le b\le h+1-z. (82)

Lemma 19.2 (Odd-length potential inequality). For h12h\ge12, z{0,1}z\in\{0,1\}, a size satisfying (82), and 0p30\le p\le3, Wh(b,z)Wh(gz((bp)+),1z)+1{p2}. W_h(b,z)\le W_h\bigl(g_z(\left(b-p\right)_+),1-z\bigr) +\mathbf{1}_{\{p\ge 2\}}. (83) For fixed h,zh,z, the function Wh(b,z)W_h(b,z) is nondecreasing in bb.

Proof. Substitute (79)(81), split source and target sizes at 0,2,50,2,5, select the smaller affine expression for sizes above five, and split the survivor size at the displayed profile endpoints. Every resulting branch is a linear integer inequality under h12h\ge12, p3p\le3, and (82). This complete case split, including truncated subtraction, is checked by potential_step and value_monotone in FiveRowOddRankArithmetic.lean. These proofs use Lean’s ordinary kernel-checked integer-arithmetic tactic and have no admitted cases. ◻

Take pp to be the number of useful probes actually meeting one cohort. Its survivor support has size bpb-p, and its actual next support has at least gz(bp)g_z(b-p) vertices. Monotonicity makes (83) valid for this actual transition. The cohorts occupy disjoint parities each day. Their useful allocations sum to at most three, so at most one receives two or more inspections. The sum of their potentials decreases by at most one per day. Initially Wh(h+1,0)=Wh(h,1)=2h9;W_h(h+1,0)=W_h(h,1)=2h-9; at capture both vanish. Thus every strategy takes at least 4h18=10n204h-18=10n-20 days.

For an attaining strategy, sweep the initially minority cohort first. Use the compatible diagonal prefixes of Theorem 5.1; each day delete its last three vertices, or all of it if fewer remain. The first two transitions are (h,1)(h,0)(h2,1).(h,1)\longrightarrow(h,0)\longrightarrow(h-2,1). For every minority size 6bh26\le b\le h-2, two rounds give (b,1)(b,0)(b1,1).(b,1)\longrightarrow(b,0)\longrightarrow(b-1,1). After h7h-7 such pairs the support has size five in the minority parity. The final three transitions are (5,1)(4,0)(2,1)0.(5,1)\longrightarrow(4,0)\longrightarrow(2,1)\longrightarrow0. The solo duration is 2+2(h7)+3=2h92+2(h-7)+3=2h-9, which is odd. The untouched cohort stays the full alternating parity, and is consequently minority when its own sweep begins. Repeat the same sweep, for a total of 4h184h-18 days. For n=5n=5, each solo sweep takes fifteen days.

Even lengths: a finite symbolic boundary classification

Suppose n=2q6n=2q\ge6, and put h=5qh=5q. Match horizontal pairs of columns. In row yy and matched column jj, the physical parity-zero vertex is (2j+(ymod2),y)(2j+(y\bmod2),y). Use the matching to identify the opposite parity with the same 5×q5\times q array. The resulting directed adjacency has a loop at every vertex, bidirectional vertical edges, leftward horizontal edges on rows 0,2,40,2,4, and rightward edges on rows 1,31,3. The other physical parity reverses the horizontal arrows. For a support RR, write σ(R)=N(R)R\sigma(R)=|N(R)|-|R|. The matching identifies this surplus with its directed outside-boundary size. The directed graph is strongly connected: vertical travel reaches a row of either horizontal orientation. Thus a nonempty proper support has positive surplus.

Represent a column by a subset B{0,1,2,3,4}B\subseteq\{0,1,2,3,4\}, and let V(B)V(B) be its vertical neighbors. For successive column masks A,B,CA,B,C, define c(A,B,C)=B(V(B)(A{1,3})(C{0,2,4})). c(A,B,C)=\left|\overline B\cap \bigl(V(B)\cup(A\cap\{1,3\})\cup(C\cap\{0,2,4\})\bigr)\right|. (84) The complement is within the five rows. With zero sentinel columns, the surplus of a word B1BqB_1\cdots B_q is exactly j=1qc(Bj1,Bj,Bj+1).\sum_{j=1}^q c(B_{j-1},B_j,B_{j+1}).

For a bound s2s\le2, use states (A,B,e)(A,B,e), 0es0\le e\le s. Every (0,B,0)(0,B,0) is initial. For each of the 32 choices of CC, retain (A,B,e)(B,C,e+c(A,B,C))(A,B,e)\longrightarrow(B,C,e+c(A,B,C)) if the new weight is at most ss. A state is terminal for boundary exactly ss when e+c(A,B,0)=se+c(A,B,0)=s. Explore every reachable state. Remove only self-loops, verifying that each repeats an empty or full column at zero additional weight. The remaining graph is acyclic. Its complete enumeration gives

boundary one boundary two
Reduced terminal paths 59 1057
Maximum reduced word length 5 8

At bound two the reduced reachable graph has 1124 states and 3874 edges. These counts follow from the stated finite rule; they are not a cutoff on physical grid length.

Every accepted word reduces to one of these terminal paths by deleting loop repetitions. Conversely, arbitrary nonnegative repetitions at the recorded positions preserve its boundary. A reduced word with kk present and aa absent cells therefore represents counts k+5uk+5u and a+5va+5v, where u,v0u,v\ge0 count allowed full and empty repetitions. A parameter is zero if its loop type is absent. Repetition preserves whether each row is a prefix.

Lemma 19.3 (Five-row small-boundary geometry). For q3q\ge3, in the directed orientation just specified:

  1. A surplus-one support has size 11, h2h-2, or h1h-1.

  2. A surplus-two support of size 3kh53\le k\le h-5 has left-prefix rows.

  3. A surplus-two support with prefix rows and an empty row has at most five vertices.

  4. A surplus-two prefix support of size four, five, or six has no neighbor in the last column.

Finite symbolic verification. Enumerate every terminal path in the specified finite graph, recording every removed-loop position. For a reduced word let k,ak,a be its present and absent counts, and let F,EF,E indicate a full or empty repetition position. Discard only words shorter than three columns with no repetition positions. Every remaining word satisfies these checks:

  1. At boundary one, either k=1k=1 and FF is false, or a{1,2}a\in\{1,2\} and EE is false.

  2. At boundary two, FF implies k10k\ge10. If (k3 or F)(k\ge3\text{ or }F) and (a5 or E)(a\ge5\text{ or }E), all rows are prefixes.

  3. At boundary two, prefix rows and an empty row imply that FF is false and k5k\le5.

  4. At boundary two, prefix rows and 4k64\le k\le6 imply that FF is false and BqV(Bq)(Bq1{1,3})=.B_q\cup V(B_q)\cup(B_{q-1}\cap\{1,3\})=\varnothing.

These checks cover 59 and 1057 reduced words, respectively. They are implemented directly from (84) in five_row_boundary_automaton.py; the full words and repetition positions are included in the accompanying certificate. No interval assumption is made about arbitrary supports.

The first three conclusions persist for all repetition counts by kk+5uk\mapsto k+5u and aa+5va\mapsto a+5v. In the fourth size range, no full repetition is possible. Empty repetitions occur after the nonempty part of a prefix support, and cannot create a neighbor in the new last column. This proves the assertions for every q3q\ge3. ◻

Lemma 19.4 (Incompatible efficient transitions). Suppose σ(R)=2\sigma(R)=2, 4k=Rh54\le k=|R|\le h-5, and RN(R)R'\subseteq N(R) belongs to the opposite physical parity. If k1Rk+2,Rh5,k-1\le |R'|\le k+2,\qquad |R'|\le h-5, then σ(R)2\sigma(R')\ne2.

Proof. If both surpluses were two, the preceding lemma would give left-prefix rows for RR and right-prefix rows for RR', since the second parity reverses horizontal arrows. The neighborhood of a left-prefix support also has left-prefix rows. Its size is k+2h3k+2\le h-3, so some row misses its last cell. The corresponding right-prefix row of RR' must be empty. Part 3 gives R5|R'|\le5, hence k6k\le6. Part 4 now says N(R)N(R) misses the entire last column, forcing every right-prefix row of RR' to be empty, a contradiction. ◻

The even-length historical potential and attaining sweeps

Mark a current cohort by z=1z=1 exactly when its immediately preceding survivor support had surplus two and size in [4,h5][4,h-5]; otherwise use z=0z=0. A marked support has 6bh36\le b\le h-3. Every nonempty reachable support has size at least two. Define Vh(b,z)={0,b=0,1,1b2,b2,3b5,min{2b+z8, b+h10},b6. V_h(b,z)=\begin{cases} 0,&b=0,\\ 1,&1\le b\le2,\\ b-2,&3\le b\le5,\\ \min\{2b+z-8,\ b+h-10\},&b\ge6. \end{cases} (85) Here zz records history, unlike the physical-parity variable in (81).

For p3p\le3 useful inspections put r=bpr=b-p, and denote the next state by (b,z)(b',z'). These alternatives exhaust every physical transition:

  1. r=0r=0, giving (b,z)=(0,0)(b',z')=(0,0);

  2. r=hr=h, necessarily b=h,p=0b=h,p=0, giving (h,0)(h,0);

  3. σ=1\sigma=1, giving r{1,h2,h1}r\in\{1,h-2,h-1\} and (b,z)=(r+1,0)(b',z')=(r+1,0);

  4. σ=2\sigma=2, giving b=r+2b'=r+2 and z=1{4rh5}z'=\mathbf{1}_{\{4\le r\le h-5\}}; if z=1z=1 and 3rh53\le r\le h-5, this is forbidden by Lemma 19.4;

  5. σ3\sigma\ge3, giving br+3b'\ge r+3 and z=0z'=0.

In the forbidden case, the previous survivor size is k=b2k=b-2 and r=k+2pr=k+2-p, so k1rk+2k-1\le r\le k+2 follows from 0p30\le p\le3.

Substitution into (85) gives Vh(b,z)Vh(b,z)+1{p2}. V_h(b,z)\le V_h(b',z')+\mathbf{1}_{\{p\ge 2\}}. (86) This is a finite split of linear integer inequalities under h15h\ge15, bhb\le h, b=0b=0 or b2b\ge2, and z=16bh3z=1\Rightarrow6\le b\le h-3. Its universal proof is FiveRowRankArithmetic.potential_step in the Lean artifact; the geometric alternatives remain the ordinary argument just given. The two-cohort potential decreases by at most one per day. Initially it is 2Vh(h,0)=4h20=10n202V_h(h,0)=4h-20=10n-20, proving the lower bound.

For the upper bound use ascending (x+y,x)(x+y,x) prefixes, choosing a fixed reflected orientation independently for each initial cohort. Their surpluses are as follows; these describe the stated orders, rather than claiming that they simultaneously minimize all even-length profiles:

Phase survivor sizes surplus
0 1,h2,h11,h-2,h-1 1
0 all other proper nonempty sizes 2
1 h1h-1 1
1 1,2,h4,h3,h21,2,h-4,h-3,h-2 2
1 3,,h53,\ldots,h-5 3

Empty and full supports have empty and full neighborhoods. Neighborhoods of prefixes are opposite-phase prefixes. To derive the tables, let L(d)L(d) be the length of diagonal x+y=dx+y=d, and set A(0)=0A(0)=0, A(d+1)=L(d)A(d)A(d+1)=L(d)-A(d). For a prefix with jj cells in its final diagonal, the surplus is A(d)+11{d4}1{max(0,d4)+j1=n1}.A(d)+1-\mathbf{1}_{\{d\ge 4\}} -\mathbf{1}_{\{\max(0,d-4)+j-1=n-1\}}. The diagonal lengths are 1,2,3,4,51,2,3,4,5, then five through diagonal n1n-1, then 4,3,2,14,3,2,1. The recurrence gives A(d)=d/2A(d)=\left\lceil d/2\right\rceil for d4d\le4, A(d)=2+(dmod2)A(d)=2+(d\bmod2) for 4dn14\le d\le n-1, and final values 2,2,1,12,2,1,1. Substitution gives the tables and the neighborhood-prefix assertion.

Starting in phase zero, three rounds give hh1h2h3h\to h-1\to h-2\to h-3. Then h8h-8 pairs of a stationary round and a one-cell decrease reach size five. The last three rounds are 54205\to4\to2\to0. The solo duration is 3+2(h8)+3=2h10.3+2(h-8)+3=2h-10. Reflection xn1xx\mapsto n-1-x swaps physical parities because nn is even, so each initial cohort can start its sweep in favorable phase zero. The untouched cohort remains full until its sweep begins. Two consecutive sweeps take 4h204h-20 days, completing Theorem 19.1.

Even lengths at every budget

The one-bit obstruction can be strengthened enough to resolve every budget on the even-length boards. We treat these first, then solve the odd-length recurrence explicitly.

Theorem 19.5 (Five rows, even length, every budget). Let n6n\ge6 be even and h=5n/2h=5n/2. Budgets one and two are impossible; T3=4h20T_3=4h-20; and T4=22h83. T_4=2\left\lceil\frac{2h-8}{3}\right\rceil. (87) For 5m<h5\le m<h, write 2h6=q(2m5)+r2h-6=q(2m-5)+r, 0r<2m50\le r<2m-5, and set J(0)=0,J(1)=2,J(2)=3,J(3)=J(4)=4,J(r)=r+52(r5).J(0)=0,\quad J(1)=2,\quad J(2)=3,\quad J(3)=J(4)=4, \qquad J(r)=\left\lceil\frac{r+5}{2}\right\rceil\quad(r\ge5). Then Tm={2q,r=0,2q+1,r>0 and 2J(r)m,2q+2,otherwise. T_m=\begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }2J(r)\le m,\\ 2q+2,&\text{otherwise}. \end{cases} (88) Finally, Tm=2T_m=2 for hm<2hh\le m<2h, and Tm=1T_m=1 for m2hm\ge2h.

For m7m\ge7, this is already Theorem 13.1 with b=2b=2: its numerator is 2h62h-6, and its corner function is exactly the displayed JJ. We retain the stronger boundary relation below, then use it to settle the remaining budgets four, five, and six.

We first strengthen the geometry in Lemma 19.3. Call the two endpoints in the last matched column outward corners when considering the reversed directed orientation.

Lemma 19.6 (Endpoint compatibility). Suppose σ(R)=2\sigma(R)=2 and 3k=Rh53\le k=|R|\le h-5. If N(R)N(R) contains an outward corner, then kh6k\ge h-6. If RN(R)R'\subseteq N(R) has opposite physical parity, surplus two, and 3=Rh53\le\ell=|R'|\le h-5, then (k,){(h6,3),(h5,3),(h5,4)}. (k,\ell)\in\{(h-6,3),(h-5,3),(h-5,4)\}. (89)

Proof. Write n=2sn=2s. For k6k\ge6, the prefix and empty-row conclusions of Lemma 19.3 imply that every row of RR is a nonempty left prefix. Let its lengths be tit_i and set di=stid_i=s-t_i. The missing lengths in the rows of N(R)N(R) are exactly e0=min(d0,d1),e1=min(d0,(d11)+,d2),e2=min(d1,d2,d3),e3=min(d2,(d31)+,d4),e4=min(d3,d4).\begin{aligned} e_0&=\min(d_0,d_1),& e_1&=\min(d_0,\left(d_1-1\right)_+,d_2),& e_2&=\min(d_1,d_2,d_3),\\ e_3&=\min(d_2,\left(d_3-1\right)_+,d_4),& e_4&=\min(d_3,d_4). \end{aligned} The surplus identity is di=ei+2\sum d_i=\sum e_i+2. Splitting the minima gives these three elementary integer consequences: e0e4=0  di6,(e0=e1=e2=0) or (e2=e3=e4=0)  di5,e0=e2=e4=0  di2.\begin{aligned} e_0e_4=0&\ \Longrightarrow\ \sum d_i\le6,\\ (e_0=e_1=e_2=0)\text{ or }(e_2=e_3=e_4=0) &\ \Longrightarrow\ \sum d_i\le5,\\ e_0=e_2=e_4=0&\ \Longrightarrow\ \sum d_i\le2. \end{aligned} Their complete universal arithmetic proofs are the theorems endpoint, three_rows, and alternating_rows in FiveRowDeficitArithmetic.lean. The first proves the corner claim.

The rows of RR' are right prefixes. Every occupied row must therefore be full in N(R)N(R), that is, have ei=0e_i=0. Since N(R)h3|N(R)|\le h-3, some row is not full, so the empty-row conclusion implies 5\ell\le5. The surplus-two prefix row vectors of sizes three through five, up to vertical reflection, are 3(2,1,0,0,0), (1,1,1,0,0), (1,0,1,0,1)4(2,1,1,0,0), (1,1,1,0,1)5(2,1,1,0,1), (1,1,1,1,1).\begin{array}{c|l} 3&(2,1,0,0,0),\ (1,1,1,0,0),\ (1,0,1,0,1)\\ 4&(2,1,1,0,0),\ (1,1,1,0,1)\\ 5&(2,1,1,0,1),\ (1,1,1,1,1). \end{array} This finite list follows by substituting the row-neighborhood maxima for vectors with total at most five. For s6s\ge6 the far boundary cannot affect the check; direct substitution for s=3,4,5s=3,4,5 gives the same list. A size-three vector forces a zero endpoint deficit; a size-four vector forces three consecutive zeros at an end or the stronger alternating zeros; a size-five vector forces alternating zeros. The three inequalities above now give respectively kh6k\ge h-6, kh5k\ge h-5, and the contradiction kh2k\ge h-2.

For the source sizes 3k53\le k\le5, use the same finite list directly. Every neighborhood row has length at most two, hence misses the last column because s3s\ge3. It contains neither an outward corner nor a nonempty right prefix. This separate check is needed because the displayed deficit formula assumes that every source row is nonempty. ◻

For this all-budget argument, mark a cohort by z=1z=1 when its previous survivor had surplus two and size in [3,h5][3,h-5]. Thus z=1z=1 implies 5bh35\le b\le h-3, and the previous survivor size was b2b-2. Every physical transition, for pp useful inspections and a=bpa=b-p, belongs to the following relation:

  1. a=0a=0 gives (0,0)(0,0), and a=ha=h gives (h,0)(h,0);

  2. surplus at least three gives any (b,0)(b',0) with a+3bha+3\le b'\le h;

  3. surplus one gives (a+1,0)(a+1,0) for a{1,h2,h1}a\in\{1,h-2,h-1\}, with a=1a=1 forbidden when z=1z=1 and b<h4b<h-4;

  4. surplus two gives (a+2,1{3ah5})(a+2,\mathbf{1}_{\{3\le a\le h-5\}}); when z=1z=1 and 3ah53\le a\le h-5, the pair (b2,a)(b-2,a) must satisfy (89).

The last two restrictions are precisely Lemma 19.6. In particular, the large-surplus branch includes every possible target size, so this is a lower relaxation for arbitrary supports.

A boundary potential and the budgets five and six

For m5m\ge5, let FmF_m be the general potential (36) with b=2b=2. An explicit residue form is D=2m5,j(u)=(u7)+D,s(u)=((u7)+modD)+1,D=2m-5,\qquad j(u)=\left\lfloor\frac{\left(u-7\right)_+}D\right\rfloor,\qquad s(u)=(\left(u-7\right)_+\bmod D)+1, Fm(u)=u+5j(u)21{j(u)1, s(u){1,2,4}}. F_m(u)=\left\lfloor\frac{u+5j(u)}2\right\rfloor -\mathbf{1}_{\{j(u)\ge 1,\ s(u)\in\{1,2,4\}\}}. (90) The common interior lemma gives the following properties:

  1. FmF_m is nondecreasing and Fm(u+2)Fm(u)3F_m(u+2)-F_m(u)\le3;

  2. if u/2m\left\lfloor u/2\right\rfloor\le m, then Fm(u)=u/2F_m(u)=\left\lfloor u/2\right\rfloor;

  3. if pmp\le m and u/2>p\left\lfloor u/2\right\rfloor>p, then Fm(u)p+Fm(u2p+5)F_m(u)\le p+F_m(u-2p+5).

Indeed, Lemma 8.3 applies because mb2+1=5m\ge b^2+1=5. Writing u=2k+zu=2k+z, its target rank is at most u2p+5u-2p+5, since L0(s)s+2L_0(s)\le s+2 and L1(s)s+3L_1(s)\le s+3. Monotonicity gives property 3, while property 2 is the defining cardinality branch. The only additional assertion, the upper bound on a two-unit increment, follows from the displayed JJ values and J(D)=mJ(D)=m, including the first period and the wrap between periods.

For 5mh85\le m\le h-8, set C=min{Fm(2h), 2+Fm(2h2), 4+Fm(2h4)},Φ(b,z)=min{C,Fm(2b+z)}.C=\min\{F_m(2h),\ 2+F_m(2h-2),\ 4+F_m(2h-4)\}, \qquad \Phi(b,z)=\min\{C,F_m(2b+z)\}. Every permitted transition lowers Φ\Phi by at most its useful allocation pp. Here are all exceptional cases in that verification. A bulk surplus-two transition from z=0z=0 has target rank u2p+5u-2p+5; from z=1z=1 it would require ph7>mp\ge h-7>m by (89). Surplus at least three has target rank at least u2p+5u-2p+5. The three properties of FmF_m therefore handle these branches; a common cap preserves the inequality.

Capture follows from property 2. A surplus-one singleton is impossible from a marked state because it would require ph5p\ge h-5. From an unmarked state, bm+1b\le m+1; the only extra endpoint value is Fm(2m+2)=m+2F_m(2m+2)=m+2, paid by mm inspections and the target pair. For surplus two at survivor sizes one or two, states bmb\le m follow from cardinality. The four extra source values at (b,z)=(m+1,0),(m+1,1),(m+2,0),(m+2,1)(b,z)=(m+1,0),(m+1,1),(m+2,0),(m+2,1) are m+2,m+3,m+4,m+4m+2,m+3,m+4,m+4, respectively, and the target size is at most four.

Finally consider survivor sizes h4,,h1h-4,\ldots,h-1. Rank increases need only monotonicity. The sole proper-source rank decrease is unmarked h1h2h-1\to h-2 with three inspections, paid by property 1. The improvements from the full state to h1h-1 with two inspections and to h2h-2 with four inspections are exactly the last two terms defining CC. The full, zero-inspection transition is tautological. This exhausts the relation.

Both initial cohorts have potential CC and both final potentials vanish, so this boundary relation gives Tm2C/mT_m\ge\left\lceil 2C/m\right\rceil throughout 5mh85\le m\le h-8. Direct substitution in the quotient and remainder of (88) gives, for m6m\ge6, C=qm+J(r)1{r=2}.C=qm+J(r)-\mathbf{1}_{\{r=2\}}. Only m=5,6m=5,6 remain after the general theorem, and both satisfy mh8m\le h-8 because h15h\ge15. For m=5m=5, the physical value hh is divisible by five: q=n2q=n-2, r=4r=4, and C=5q+4C=5q+4, giving T52q+2=2n2T_5\ge2q+2=2n-2. For m=6m=6, the values of C6qC-6q for r=0,,6r=0,\ldots,6 are 0, 2, 2, 4, 4, 5, 6.0,\ 2,\ 2,\ 4,\ 4,\ 5,\ 6. The resulting lower bounds 2C/6\left\lceil 2C/6\right\rceil are 2q2q, 2q+12q+1 for r=1,2r=1,2, and 2q+22q+2 for r3r\ge3, as required.

The four-inspection lower bound

Define H(b,z)={b,b4,6,(b,z)=(5,0),4(2b+z)/38+31{(2b+z)mod3=2},otherwise,H(b,z)=\begin{cases} b,&b\le4,\\ 6,&(b,z)=(5,0),\\ 4\left\lfloor(2b+z)/3\right\rfloor-8+3\mathbf{1}_{\{(2b+z)\bmod 3=2\}},&\text{otherwise}, \end{cases} and A1=min{H(h1,0),3+H(h2,0)},C4=min{H(h,0),2+A1,4+H(h2,0)}.A_1=\min\{H(h-1,0),3+H(h-2,0)\},\qquad C_4=\min\{H(h,0),2+A_1,4+H(h-2,0)\}. Use potential C4C_4 at the full state, A1A_1 at the unmarked state h1h-1, and HH elsewhere. Allocating p4p\le4 lowers it by at most pp. This assertion is a finite residue split with the unbounded parameter h15h\ge15: the theorem potential_step in FiveRowFourProbeArithmetic.lean checks every branch of the physical relaxation above. In this budget range a marked source forbids all surplus-one transitions and all bulk surplus-two transitions; the endpoint restrictions prove these exclusions. The checker includes all larger targets in the surplus-at-least-three branch.

Writing h=3t,3t+1,3t+2h=3t,3t+1,3t+2 gives respectively (A1,C4)=(8t12,8t10),(8t9,8t8),(8t5,8t4).(A_1,C_4)=(8t-12,8t-10),\quad(8t-9,8t-8),\quad(8t-5,8t-4). For L=(2h8)/3L=\left\lceil(2h-8)/3\right\rceil, this means C4=4LC_4=4L except when h0(mod3)h\equiv0\pmod3, where C4=4L2C_4=4L-2. The total-ammunition inequality already proves T42LT_4\ge2L outside that residue.

In the exceptional residue, 2L12L-1 days would use exactly 2C42C_4 probes, so every cohort transition must be tight and every day must use four useful probes. From a full state, the only positive tight allocation is two inspections, producing size h1h-1. Thus the first day must split 2+22+2. From an unmarked state of size h1h-1, every tight allocation requires four inspections. Two such transitions cannot share day two. This proves T42LT_4\ge2L. The two local tightness assertions are universally checked by full_tight and penultimate_tight in FiveRowFourProbeEquality.lean.

Explicit attaining schedules for the remaining budgets

All budgets m7m\ge7, including the boundary cases, are covered by Theorem 13.1. The independent finite lower certificates at (h,m)=(15,8),(15,11),(20,14)(h,m)=(15,8),(15,11),(20,14) remain kernel checked in FiveRowHighBudgetArithmetic.lean.

For the matching upper bounds, use the previously displayed physical prefix tables. With four inspections, start each solo sweep in phase one. Its first round gives (h2,0)(h-2,0). At phase-zero size b9b\ge9, two rounds give (b2,1)(b-2,1) and (b3,0)(b-3,0). Repeat until size 7,8,67,8,6, for hh modulo three equal to 0,1,20,1,2, respectively. The final tails are 75307\to5\to3\to0, 86408\to6\to4\to0, and 6406\to4\to0. The solo duration is LL, so two independently oriented sweeps attain 2L2L.

For m=5,6m=5,6, full allocations decrease the bulk rank by D=2m5D=2m-5. If r=0r=0, each solo sweep lasts qq rounds. If r>0r>0, after qq full allocations its remaining size is J(r)J(r); substitution in the last two prefix transitions gives the special residues one, two, and four. At m=5m=5, only r=4r=4 occurs, so two separate sweeps suffice. At m=6m=6, a shared day is needed only for r=1,2r=1,2, where J(r)=2,3J(r)=2,3. The corresponding initial allocations to a suitably oriented fresh cohort decrease its rank by one and two, respectively. Its new rank is therefore at most qD+6qD+6, which clears within qq further full allocations by the same prefix table. Finish the first cohort and start the second with J(r)J(r) inspections each on that shared day. The remaining residues use two separate sweeps, attaining (88).

The impossibility at budgets below three follows from the 4×44\times4 subgrid obstruction. At budget at least hh, inspect one full parity then the other cohort’s full parity; one day is possible exactly at budget 2h2h. Together with Theorem 19.1, these facts complete the proof of Theorem 19.5. The geometry here is an ordinary proof with a finite symbolic certificate; the cited Lean modules verify its universal scalar consequences, not the complete physical five-row classification.

Odd lengths at every budget

Theorem 19.7 (Five rows, odd length, every budget). Let n5n\ge5 be odd and h=(5n1)/2h=(5n-1)/2. Budgets at most two are impossible, T3=10n20T_3=10n-20, and T4=25n93+21{3n},T5=2n2.T_4=2\left\lceil\frac{5n-9}{3}\right\rceil+2\mathbf{1}_{\{3\mid n\}},\qquad T_5=2n-2. For 5m<h5\le m<h, write 5n6=q(2m5)+r5n-6=q(2m-5)+r, 0r<2m50\le r<2m-5. Use the function JJ from Theorem 19.5, and put δ(r)=1{r{1,2,4} or (r5 and r odd)}.\delta(r)=\mathbf{1}_{\{r\in\{1,2,4\}\text{ or }(r\ge 5\text{ and }r\text{ odd})\}}. Then Tm={2q,r=0,2q+1,r>0 and 2J(r)+δ(r)m,2q+2,otherwise. T_m=\begin{cases} 2q,&r=0,\\ 2q+1,&r>0\text{ and }2J(r)+\delta(r)\le m,\\ 2q+2,&\text{otherwise}. \end{cases} (91) Finally, Tm=2T_m=2 for hm<2h+1h\le m<2h+1, and Tm=1T_m=1 for m2h+1m\ge2h+1.

All transitions below use the exact profiles (79)(80). An arbitrary physical search dominates the corresponding count search, and compatible prefixes attain it. Thus a lower proof may either use a nondecreasing potential directly on arbitrary supports, or rule out an equally fast prefix search. No serial-search assumption is needed.

Four inspections

Use the interior function H(b,z)H(b,z) from the four-inspection even-length proof. For h=3t,3t+1,3t+2h=3t,3t+1,3t+2, respectively, put C(h)=8t8,8t5,8t4C(h)=8t-8,8t-5,8t-4, and define Vh(b,z)={C(h)1,z=0, b=h,min{H(b,0),C(h)2},z=0, b=h1,min{C(h),H(b,z)},otherwise.V_h(b,z)=\begin{cases} C(h)-1,&z=0,\ b=h,\\ \min\{H(b,0),C(h)-2\},&z=0,\ b=h-1,\\ \min\{C(h),H(b,z)\},&\text{otherwise}. \end{cases} For h12h\ge12, b=0b=0 or 3zbh+1z3-z\le b\le h+1-z, and 0p40\le p\le4, Vh(b,z)p+Vh(gz((bp)+),1z). V_h(b,z)\le p+V_h(g_z(\left(b-p\right)_+),1-z). (92) Here is a finite reduction that verifies the assertion for unbounded hh. The identities C(h+3)=C(h)+8C(h+3)=C(h)+8 and H(b+3,z)=H(b,z)+8H(b+3,z)=H(b,z)+8 for b6b\ge6 give the same translation for both exceptional caps. Also gh+3,z(k+3)=gh,z(k)+3g_{h+3,z}(k+3)=g_{h,z}(k)+3 for k3k\ge3 in the domain. For h24,b13h\ge24,b\ge13, reduce both h,bh,b by three; survivors are at least six before reduction, and both sides of (92) decrease by eight. For b12b\le12, reduce only hh by three: target sizes are at most fifteen, no high-end clause is reached, and the caps are inactive since C(h3)48>H(b,z)C(h-3)\ge48>H(b',z') for b15b'\le15. Only 12h2312\le h\le23 remain. All states and all five allocations in this finite range are checked by RecurrenceBridgeOddFiveFour.finite_certificate in Lean. The translations are ordinary proofs, separate from this finite check.

The initial potential sum is 2C(h)2C(h), so summation gives T4C(h)/2T_4\ge\left\lceil C(h)/2\right\rceil. For attainment start the majority cohort. The first two rounds give (h+1,0)(h2,1)(h3,0)(h+1,0)\to(h-2,1)\to(h-3,0). From majority size b9b\ge9, two rounds give (b2,1)(b3,0)(b-2,1)\to(b-3,0). The final majority sizes 6,7,86,7,8 have tails 6406\to4\to0, 75307\to5\to3\to0, and 86408\to6\to4\to0. The solo durations are L=2t2,2t1,2t1L=2t-2,2t-1,2t-1, respectively. When LL is odd the second cohort starts in majority parity. When LL is even, its minority solo has the same duration: the first round reaches majority size h1h-1, followed by the same pairs and the size-eight tail. Thus 2L=C(h)/22L=\left\lceil C(h)/2\right\rceil days attain the formula.

Larger budgets as a specialization of the general theorem

For m5m\ge5, apply Theorem 8.1 with b=2b=2. Its parameter B=b2B=b^2 is four, so its full budget range applies. The two uncapped corner functions simplify to L0(k)={0,k=0,2,k=1,k+2,k2,L1(k)={0,k=0,k+2,1k2,k+3,k3.L_0(k)=\begin{cases}0,&k=0,\\2,&k=1,\\k+2,&k\ge2,\end{cases} \qquad L_1(k)=\begin{cases}0,&k=0,\\k+2,&1\le k\le2,\\k+3,&k\ge3.\end{cases} Substituting in (33) gives precisely the function JJ in Theorem 19.5. Substitution in (34) gives δ(r)=1{r{1,2,4} or (r5 and r odd)}.\delta(r)=\mathbf{1}_{\{r\in\{1,2,4\}\text{ or }(r\ge 5\text{ and }r\text{ odd})\}}. Finally Nw1=5n6N-w-1=5n-6. Thus the general theorem is exactly (91), including its one- and two-day thresholds and its explicit attaining schedules. At m=5m=5, the quotient and remainder are q=n2,r=4q=n-2,r=4, giving T5=2n2T_5=2n-2. The proof of the general theorem establishes this boundary case directly, so this specialization has no circular dependency.

The independent audits and direct room-coordinate constructions remain in the research archive. The finite Lean arithmetic bases do not amount to a complete physical Lean proof of the five-row theorem.

Seven rows with five inspections per day

The following low-budget family illustrates how a periodic potential and a short equality obstruction can solve the two-count recurrence explicitly. The proof is an ordinary argument with finite rational certificates; it is not presently a complete physical Lean theorem.

Theorem 20.1. For every odd n7n\ge7, T5(P7Pn)=27n163.T_5(P_7\mathbin{\square}P_n)=2\left\lceil\frac{7n-16}{3}\right\rceil.

Put H=(7n+1)/2H=(7n+1)/2, so the two checkerboard classes have sizes H,H1H,H-1. Theorem 5.1, with b=3b=3, supplies exact profiles g0,g1g_0,g_1 and compatible prefixes. Thus gp(0)=0g_p(0)=0, and g0(k)=k+min{R(k),3,R(Hk)1},g1(k)=k+min{Q(k),4,Q(H1k)}g_0(k)=k+\min\{R(k),3,R(H-k)-1\},\qquad g_1(k)=k+\min\{Q(k),4,Q(H-1-k)\} on the respective nonempty domains. We use the profiles for the lower bound on arbitrary supports and the compatible prefixes for construction.

Finite potentials and the exceptional residue.

Assign charges c0=(0,0,12,34,1,1),c1=(0,0,14,12,1,1).c_0=(0,0,\tfrac12,\tfrac34,1,1),\qquad c_1=(0,0,\tfrac14,\tfrac12,1,1). They satisfy c0(r)+c1(s)1c_0(r)+c_1(s)\le1 whenever r+s5r+s\le5. For each finite base below, define fp(k)f_p(k) as the least total charge of a path from (p,k)(p,k) to an empty state in the one-cohort graph (p,k)(1p,gp(max{kr,0})),edge charge cp(r),0r5.(p,k)\longrightarrow \bigl(1-p,g_p(\max\{k-r,0\})\bigr), \qquad\text{edge charge }c_p(r),\quad 0\le r\le5. All quantities are multiples of 1/41/4. The accompanying certificate computes these finite shortest-path distances exactly and verifies their monotonicity, zero terminal values, and every inequality fp(k)cp(r)+f1p(gp(max{kr,0})). f_p(k)\le c_p(r)+f_{1-p}\bigl(g_p(\max\{k-r,0\})\bigr). (93) The complete base data give the following initial sums V=f0(H)+f1(H1)V=f_0(H)+f_1(H-1) and attaining serial times UU: n7911131517192123V2263/24150119/26978175/297U223242506070788898\begin{array}{c|rrrrrrrrr} n&7&9&11&13&15&17&19&21&23\\\hline V&22&63/2&41&50&119/2&69&78&175/2&97\\ U&22&32&42&50&60&70&78&88&98 \end{array} There are 5,778 one-cohort inequalities in these nine certificates. Summing (93) across the current physical colors bounds the total potential loss by one per day. Monotonicity handles neighborhoods larger than the profile minimum. Hence T5VT_5\ge\left\lceil V\right\rceil.

For n=11,17,23n=11,17,23, this leaves one day. If capture occurred in V=U1V=U-1 days, every day would have to lose exactly one potential unit. In these three bases the only tight first allocation is three inspections in color zero and two in color one. Its minimum successor counts are (H1,H2)(H-1,H-2). The second-day losses from that state, for allocations r=0,,5r=0,\ldots,5 in color zero, are (34,14,12,0,0,14). \left(\tfrac34,-\tfrac14,\tfrac12,0,0,\tfrac14\right). (94) None is one, a contradiction. An actual first successor with larger counts cannot evade this calculation: if its first day is tight, its potential equals that of the minimum successor, while monotonicity makes its next potential at least as large. Filling unused quota is harmless. This proves all nine base lower bounds.

A periodic extension valid at every larger length.

Use the three base triples (n0,H0,c)=(19,67,33), (21,74,36), (23,81,39).(n_0,H_0,c)=(19,67,33),\ (21,74,36),\ (23,81,39). Their exact tables satisfy, for both colors, fp(k+3)=fp(k)+2,c10kc+10,gp(k)=k+3+p,c15kc+15.\begin{aligned} f_p(k+3)&=f_p(k)+2,&&c-10\le k\le c+10, \\ g_p(k)&=k+3+p,&&c-15\le k\le c+15.\nonumber \end{aligned}(95) For n=n0+6jn=n_0+6j, write Δ=21j\Delta=21j, so H=H0+ΔH=H_0+\Delta. Keep fpf_p unchanged through cc. On the inserted interval define f~p(c+3+r)=fp(c+r)+2,1r3,0<3+rΔ.\widetilde f_p(c+3\ell+r)=f_p(c+r)+2\ell, \qquad 1\le r\le3,\quad 0<3\ell+r\le\Delta. Above c+Δc+\Delta, put f~p(k)=fp(kΔ)+2Δ/3\widetilde f_p(k)=f_p(k-\Delta)+2\Delta/3. The period identity makes this a nondecreasing extension.

We check (93) by three exhaustive source ranges. For kc5k\le c-5, every output is at most c1c-1 and the distant upper corner has no effect; the old inequality is unchanged. For kc+Δ+5k\ge c+\Delta+5, subtract Δ\Delta from source and output. The lower corner is saturated, and both profile and potential translate exactly. In the remaining range c4kc+Δ+4c-4\le k\le c+\Delta+4, residuals are at least c9c-9 and outputs are at most c+Δ+8c+\Delta+8. All relevant profiles are on their plateau. Reduce the source modulo three to a representative in {c,c+1,c+2}\{c,c+1,c+2\}. The output changes by the same multiple of three, and both potentials change by the same multiple of two. The ten-place collar in (95) contains all needed old values, so this too is a verified base inequality. The explicit profile formulas justify the corner invariance and translation at every Δ\Delta.

The initial sum increases by 4Δ/3=28j4\Delta/3=28j. For the residue n5(mod6)n\equiv5\pmod6, the first two transitions remain in the translated upper part, so the tight first allocation and the loss table (94) are unchanged. The extra-day obstruction therefore persists. Since the stated formula also increases by 28j28j when nn increases by 6j6j, all lower bounds follow. The six smaller bases cover the lengths below these three starting points.

An attaining physical strategy.

Use the compatible prefixes from Theorem 5.1. Allocate five inspections to one cohort until it is captured, assigning any spare quota on its last day to the other cohort, and then finish that cohort. The base times in the table are direct evaluations of this strategy. At bases n0=19,21,23n_0=19,21,23, successful first colors are respectively 1,0,01,0,0. The two active middle visits, recorded as (count, current color), are n0first cohortsecond cohort19(34,1)(34,1)21(37,1)(38,1)23(41,1)(41,1)\begin{array}{c|cc} n_0&\text{first cohort}&\text{second cohort}\\\hline 19&(34,1)&(34,1)\\ 21&(37,1)&(38,1)\\ 23&(41,1)&(41,1) \end{array} All cuts exceed five. The companion is consequently globally full at the first visit and empty at the second; the finite certificates check these conditions directly.

On the common plateau, two consecutive five-inspection days reduce an active count by three and restore its color, from either starting color. Insert 2Δ/3=14j2\Delta/3=14j days at each visit to reduce the translated count from k+Δk+\Delta to kk. Before a visit, the profile trajectory translates by Δ\Delta; afterwards its lower part is unchanged. The active count decreases under five inspections, so the old segments stay on their respective sides. The inserted segment lies wholly in the plateau. Its even duration preserves the companion’s color and the original last-day spare allocation. Both insertions are therefore compatible physical prefix strategies. Their total added time is 28j28j, matching the lower bound and proving Theorem 20.1.

The finite certificates and their independent replay include the full rational base tables, all inequalities, the strict second-day losses, the collar identities, and actual coordinate-neighborhood replays of the nine base searches. The three-range proof and the physical insertion establish every larger length; the result does not rely on extrapolating the finite time table.

Minimum-budget searches on every odd width

At the minimum feasible budget, one width-dependent corner clock gives the exact time on every odd rectangle. The common-ancestry lemma removes the last central-day ambiguity uniformly, including widths for which many exceptional mixed states survive near the final corner.

Fix w=2b+1w=2b+1, m=b+1m=b+1, and set C=b(b1)C=b(b-1). Define the width-only recurrence A0=B0=0,At+1=Bt+mmin{q(Bt+m),b},Bt+1=At+mmin{R(At+m),b+1}.\begin{aligned} A_0=B_0&=0,\notag\\ A_{t+1}&=B_t+m-\min\{q(B_t+m),b\},\notag\\ B_{t+1}&=A_t+m-\min\{R(A_t+m),b+1\}. \end{aligned}(96) Here q(z)q(z) is the least nonnegative integer rr with zr(r+1)z\le r(r+1). Let LbL_b be the first time Bt=CB_t=C, with L1=0L_1=0.

Theorem 21.1. For every odd nw=2b+13n\ge w=2b+1\ge3, Tb+1(PwPn)=2wnCw,Cw=8b24b4Lb+4. T_{b+1}(P_w\mathbin{\square}P_n)=2wn-C_w, \qquad C_w=8b^2-4b-4L_b+4. (97) The budget b+1b+1 is the minimum feasible budget, and the recurrence (96) terminates independently of nn. Its clock can be evaluated in O(b)O(b) arithmetic stages using Proposition 6.4. In particular, w3579111315Cw8204484136208288.\begin{array}{c|rrrrrrr} w&3&5&7&9&11&13&15\\\hline C_w&8&20&44&84&136&208&288. \end{array}

Proof. The two scalar maps in (96) are at least z+1z+1 and zz, respectively; each two-step composition therefore increases its argument by at least one. The recurrence is monotone from zero. At input C1C-1 both maps equal CC, while at CC they equal C+1C+1 and CC. Before BB first reaches CC, AA cannot exceed CC: producing AC+1A\ge C+1 requires the preceding BCB\ge C. Thus the first arrival is (C1,C)(C-1,C) or (C,C)(C,C), followed by (C+1,C)(C+1,C) and (C+1,C+1)(C+1,C+1). For b=1b=1 this follows directly from (A0,B0)=(0,0)(A_0,B_0)=(0,0); expressions at C1C-1 are needed only for b2b\ge2. These observations also prove finite termination and exact arrival at CC rather than an overshoot.

This bottom history through time Lb+2L_b+2 is the physical solo history on every allowed rectangle. Its inverse inputs are at most b2+2b^2+2. A reflected branch can first improve ι0\iota_0 at input MCM-C, at least b2+3bb^2+3b, and the corresponding ι1\iota_1 threshold is farther away. The b=1b=1 endpoints satisfy the same exclusion directly. At time Lb+2L_b+2 both solo deficits are C+1C+1. Total concentration makes every mixed state low-total; Lemma 7.2 therefore replaces the retained frontier by the two pure endpoints exactly.

In the common affine interval the solo ties evolve as (s,s)(s+1,s)(s+1,s+1).(s,s)\longmapsto(s+1,s)\longmapsto(s+1,s+1). At the first step every mixed successor has total at most ss, by both inverse concentration inequalities. The second step is a solo tie and again has no exceptional states. Hence the retained frontier stays pure. Choose a=Mb21,t=Lb+2(aC).a_*=M-b^2-1,\qquad t_*=L_b+2(a_*-C). The inverse formulas give these affine transitions through the tie (a,a)(a_*,a_*). It lies after C+1C+1 since a(C+1)3b2>0a_*-(C+1)\ge3b-2>0. At time tt_* the two active solo belief sizes are b2+2b^2+2 and b2+1b^2+1.

For a canonical monochromatic belief of current color pp and size kk, greedy capture within TT days is equivalent to km+Dp(T1), k\le m+D_p(T-1), (98) where DD is the fresh inverse recursion from zero. Indeed, apply the integer inverse profile successively backward through the T1T-1 nonterminal moves, with the final inspection threshold mm. For the two displayed belief sizes the required fresh deficits are C+1C+1 in color zero and CC in color one. Their exact upper-tail solo durations are consequently Lb+2L_b+2 and Lb+1L_b+1. The full-board solo durations are consecutive, the faster being τ=t+Lb+1=wn4b2+2b+2Lb2.\tau=t_*+L_b+1=wn-4b^2+2b+2L_b-2.

It remains to exclude 2τ12\tau-1 days. At the last pure tie, every subsequent secondary ancestry starts from zero. The precentral upper tail lasts exactly LbL_b steps, so monotonicity bounds every secondary by the fresh solo deficits up to time LbL_b, hence by CC. Lemma 7.3 says all final exceptional pairs have the same primary ancestry. Any two such pairs leave at least M2C4b>b+1=mM-2C\ge4b>b+1=m rooms in their other color, so cannot win centrally. If either pair is nonexceptional, their combined total is at most D0+D1D_0+D_1 and they cannot improve on the solo endpoints. The slower solo needs τ+1\tau+1 days; its remaining count at time τ1\tau-1 therefore exceeds mm, or it could be captured on day τ\tau. Thus the solo central sum also exceeds mm. The exact midpoint theorem forces T=2τT=2\tau, proving (97).

Finally the majority profile has maximum surplus bb, so Corollary 14.6 gives minimum budget b+1b+1. The clock also satisfies Lb=μ1(C)/(b+1)L_b=\left\lceil\mu_1(C)/(b+1)\right\rceil by Proposition 7.6. Equivalently, (98) identifies Lb+1L_b+1 with the solo clearing time of a minority prefix of size b2+1b^2+1 on the width-ww square. Proposition 6.4 evaluates this time in O(b)O(b) stages. Evaluating the width-only recurrence gives the seven displayed constants. ◻

The proof is uniform in the width. It does not assert serial optimality from arbitrary partial states. Its geometric and corner-clock arguments are ordinary proofs; the abstract inverse, persistence and ancestry implications have separate Lean verification with their hypotheses explicit.

Reusable lower certificates and affine insertion

The following certificate method has a broader purpose than the numerical corollaries above: its insertion lemmas also apply to other compatible profile families, including the three-dimensional cylinder below.

Set w=2b+1w=2b+1, m=b+1m=b+1, D=m+1D=m+1, and let the two color classes have sizes HH and H1H-1. Use the profiles g0,g1g_0,g_1 from Theorem 5.1. Choose nonnegative rational numbers cp(r)c_p(r), for p{0,1}p\in\{0,1\} and 0rm0\le r\le m, with c0(r)+c1(mr)1. c_0(r)+c_1(m-r)\le1. (99) Suppose nonnegative functions FpF_p, with Fp(0)=0F_p(0)=0, satisfy Fp(k)F1p(gp((kr)+))cp(r)(0kHp, 0rm). F_p(k)-F_{1-p}\bigl(g_p(\left(k-r\right)_+)\bigr)\le c_p(r) \quad(0\le k\le H-p,\ 0\le r\le m). (100) Here (x)+=max(x,0)\left(x\right)_+=\max(x,0), as elsewhere in the search recurrences.

At a current state (u,v)(u,v) the sum F0(u)+F1(v)F_0(u)+F_1(v) decreases by at most one per day, by (99). It suffices to consider strategies using the full quota whenever more than mm possibilities remain: additional suffix inspections preserve the prefix normal form and cannot hurt. On the final day one can pad the two quotas to sum to mm, with the positive-part convention making both survivors empty. Consequently TmF0(H)+F1(H1). T_m\ge\left\lceil F_0(H)+F_1(H-1)\right\rceil. (101) The functions are indexed by current color, so this argument includes arbitrary interleaving of the two initial cohorts.

For each finite certificate below, Fp(k)F_p(k) is computed as the shortest total charge of a path from (p,k)(p,k) to an empty cohort, where a quota rr costs cp(r)c_p(r) and sends the cohort to (1p,gp((kr)+))(1-p,g_p(\left(k-r\right)_+)). Multiplying by the common denominator gives a finite graph with nonnegative integer edge weights. After computing the functions, the verifier checks every inequality (99)(100) directly with exact fractions.

Inserting an arbitrarily long affine interval

Lemma 21.2 (Affine insertion). Let A=b(b+1)A=b(b+1). Suppose a certificate at majority size HH has an integer cut cc such that cA+2D,HcA+2D+2,Fp(k)=2k+αp(c2Dkc+2D, p{0,1}).\begin{aligned} c&\ge A+2D,& H-c&\ge A+2D+2,\\ F_p(k)&=2k+\alpha_p &&(c-2D\le k\le c+2D,\ p\in\{0,1\}). \end{aligned}(102, 103) For every integer Δ0\Delta\ge0, replace HH by H+ΔH+\Delta in the profile formulas and define Fp(k)={Fp(k),kc,Fp(c)+2(kc),ckc+Δ,Fp(kΔ)+2Δ,kc+Δ. F'_p(k)= \begin{cases} F_p(k),&k\le c,\\ F_p(c)+2(k-c),&c\le k\le c+\Delta,\\ F_p(k-\Delta)+2\Delta,&k\ge c+\Delta. \end{cases} (104) Then FpF'_p satisfies the same charge inequalities. The initial lower bound (101) increases by exactly 4Δ4\Delta.

Proof. The pieces of (104) agree at their endpoints. For either the base or enlarged profiles, every successor j=gp((kr)+)j=g_p(\left(k-r\right)_+) satisfies jkD. |j-k|\le D. (105) For a nonempty survivor, its surplus lies between 1-1 and b+1b+1, and rmr\le m. For an empty survivor, kmk\le m and j=0j=0.

If k<cDk<c-D, the enlarged profile agrees with the base profile at q=(kr)+q=\left(k-r\right)_+. Indeed, the far-corner terms in both profile formulas exceed their plateau caps by (102). The successor is unchanged and is less than cc by (105). Both potentials are unchanged, so the base inequality applies.

If k>c+Δ+Dk>c+\Delta+D, write k0=kΔk_0=k-\Delta and q0=k0rq_0=k_0-r. Since q0>c+Dm=c+1q_0>c+D-m=c+1, the low-corner terms have reached their plateau caps. The profile formulas therefore give gp(q0+Δ)=gp(q0)+Δ.g'_p(q_0+\Delta)=g_p(q_0)+\Delta. Writing j0j_0 for the base successor of k0k_0, we have j=j0+Δj=j_0+\Delta and j0>cj_0>c. Both potentials gain 2Δ2\Delta, which cancels in their difference.

Finally suppose cDkc+Δ+Dc-D\le k\le c+\Delta+D. The survivor q=krq=k-r is positive, with qcDmA+1,H+ΔqHcDA+D+2.q\ge c-D-m\ge A+1, \qquad H+\Delta-q\ge H-c-D\ge A+D+2. Both profiles are therefore on their affine plateaus: j=kr+δpj=k-r+\delta_p, where δ0=b\delta_0=b and δ1=b+1\delta_1=b+1. By (105), both kk and jj lie in [c2D,c+Δ+2D][c-2D,c+\Delta+2D]. Throughout that interval the corresponding potentials are 2k+αp2k+\alpha_p and 2j+α1p2j+\alpha_{1-p}. Their difference is 2r2δp+αpα1p.2r-2\delta_p+\alpha_p-\alpha_{1-p}. This is exactly the base potential difference at source k=ck=c with the same current color and quota rr. Its survivor and successor lie in the same affine profile and potential collar, so the verified base inequality bounds the expression by cp(r)c_p(r).

These three cases exhaust the enlarged state space. At each full color class (104) adds 2Δ2\Delta to the potential, giving the stated increase of 4Δ4\Delta in the integer lower bound. ◻

The matching upper construction has the same insertion property. A serial strategy directs the full budget to one initial cohort until it can be eliminated, uses any unused quota on that finishing day on the other cohort, and then directs the full budget to the other.

Lemma 21.3 (Insertion in a serial strategy). Under (102), suppose a base serial strategy visits count cc in each active cohort before an inspection. An enlarged rectangle with majority size H+ΔH+\Delta has a strategy taking exactly 4Δ4\Delta more days.

Proof. Under a full-budget inspection an active cohort’s size never increases, because every neighborhood surplus is at most mm. The certified visit to cc is therefore reached from above, and the subsequent base trajectory stays at or below cc. Above the cut, the enlarged active trajectory is the translation by Δ\Delta of the base trajectory, by the high profile translation identity in the preceding proof. The uninspected cohort remains its full current color class. When the first active cohort reaches c+Δc+\Delta, insert 2Δ2\Delta full-budget days. Throughout this inserted interval the profile plateaus give g0(km)=k1,g1(km)=k.g_0(k-m)=k-1,\qquad g_1(k-m)=k. Every two days reduce its size by one and restore its current color. The inserted block therefore ends at cc with the phase of the base schedule unchanged. Follow the base trajectory below the cut.

The first cohort’s finishing-day unused quota is unchanged. The second cohort consequently begins its active phase at the translated base state. This state is above the cut: it lies within m+1m+1 of a full color class, whereas (102) places cc farther from that edge. Follow its translated trajectory until c+Δc+\Delta, insert another 2Δ2\Delta full-budget days, and then finish along the unchanged lower trajectory. Both inserted blocks have even length, so the later phases of the schedule agree with those in the base strategy. ◻

The two insertion proofs also apply to any other compatible profile family with color-class sizes H,H1H,H-1 and a fixed budget mm, provided that a corner radius AA has the following properties: every surplus is between 1-1 and mm; the central profiles are k+m1k+m-1 and k+mk+m; the low profiles are unchanged when the remaining tail exceeds AA; and the high profiles translate when the source count exceeds AA. These are exactly the properties used in the displacement, collar, and trajectory arguments. In that formulation one sets D=m+1D=m+1 and uses the same margin and affine-collar conditions. This observation will also give an exact three-dimensional family below.

The original exact-rational certificates for widths three through fifteen remain in the companion artifact. Their verifier is src/odd_minimum_budget_all_lengths.py; its receipt is research/odd-minimum-budget-all-lengths.json. They check every charge inequality, base potential, affine collar and attaining serial sweep; no numerical linear-programming output is trusted by the verifier. Those separate width calculations are now consequences of Theorem 21.1, so their charge tables are not needed for its proof. The generic certificate and insertion statements above retain their full conditional scope.

Eventual affine periods in odd cylinders

The interior-crossing argument extends to every fixed all-odd cross-section, in every dimension. The first step is an exact finite description of its two end regions; an affine plateau alone would not justify changing the cylinder’s length.

Let QQ be a fixed nontrivial box with odd side lengths. Put W=Q,S=i(sidei1),Z=W(S+1),β=(W1)/2.W=|Q|,\qquad S=\sum_i(\text{side}_i-1),\qquad Z=W(S+1), \qquad \beta=(W-1)/2. Consider QPnQ\mathbin{\square}P_n with odd longitudinal length nn. The one-point cross-section gives paths, already classified separately. For nS+3n\ge S+3, the longitudinal coordinate is longest and is placed last in the order of Theorem 14.1. Write H=(Wn+1)/2H=(Wn+1)/2 for its majority class size and gpng_p^n for its exact color-pp profile.

Two finite tables describe both ends

For vQpv\in Q_p, let rp(v)r_p(v) be the rank of (v,0)(v,0) in the parity order of the infinite prism Q×{0,1,}Q\times\{0,1,\ldots\}. Every such point has weight at most SS, so every preceding point has longitudinal coordinate at most SS. Its rank is therefore independent of nn for nS+1n\ge S+1 and can be computed in the single finite slab QPS+1Q\mathbin{\square}P_{S+1}. At most Z=W(S+1)Z=W(S+1) vertices have weight at most SS, so rp(v)Zr_p(v)\le Z.

Using the transverse cost aQa_Q from (65), define Up(k)=vQprp(v)kaQ(v),Bp(k)={vQp:rp(v)k}.U_p(k)=\sum_{\substack{v\in Q_p\\r_p(v)\le k}}a_Q(v), \qquad B_p(k)=\bigl|\{v\in Q_p:r_p(v)\le k\}\bigr|. Both tables are constant for kZk\ge Z.

Lemma 22.1 (Stable corner decomposition). For nS+3n\ge S+3 and k>0k>0, gpn(k)=k+1{p=1}+Up(k)Qp+Bp(Hpk),gpn(0)=0. g_p^n(k)=k+\mathbf{1}_{\{p=1\}}+U_p(k)-|Q_p|+B_p(H-p-k), \qquad g_p^n(0)=0. (106) In particular, every surplus is at most β+p\beta+p, and k>Z,Hpk>Zgpn(k)=k+β+p. k>Z,\quad H-p-k>Z \quad\Longrightarrow\quad g_p^n(k)=k+\beta+p. (107)

Proof. The ambient cost a(x)1a(x)-1 equals aQ(v)a_Q(v) on the bottom slice, zero on an interior slice, and 1-1 on the top slice. This includes the origin: its ambient cost minus one is the transverse origin cost. The prefix-cost identity therefore counts the selected bottom weights through Up(k)U_p(k) and subtracts the number of selected top vertices.

Coordinate complement preserves parity and reverses both weight and lexicographic order. It carries the top slice to the bottom slice. Thus selected top vertices correspond to bottom vertices outside the prefix of size HpkH-p-k, and their number is QpBp(Hpk)|Q_p|-B_p(H-p-k). This proves (106). The empty prefix is separate because the extra origin-neighbor term requires a nonempty odd prefix.

The transverse full-class cost identity gives Up()=Q1p1{p=1}U_p(\infty)=|Q_{1-p}|-\mathbf{1}_{\{p=1\}} and Bp()=QpB_p(\infty)=|Q_p|. Nonnegativity of aQa_Q gives the asserted upper bound on surplus. Stabilizing both tables gives (107). ◻

The local contribution a(x)1a(x)-1 in a cylinder with 3×33\times3 cross-section: transverse costs on the first slice, zero in interior slices, and 1-1 on the last slice. The surplus of a nonempty odd prefix also has the additional 11 in (106); that term is outside the local sum.

The decomposition gives the stronger identities needed to change length. For two valid majority sizes HH and H+δH+\delta, with both longitudinal lengths at least S+3S+3, we have Hpk>ZgpH+δ(k)=gpH(k),k>ZgpH+δ(k+δ)=gpH(k)+δ.\begin{aligned} H-p-k>Z&\quad\Longrightarrow\quad g_p^{H+\delta}(k)=g_p^H(k), \\ k>Z&\quad\Longrightarrow\quad g_p^{H+\delta}(k+\delta)=g_p^H(k)+\delta. \end{aligned}(108, 109) In the first identity the tail table is full; in the second the bottom weight table is full and the tail argument is unchanged. The first also holds at k=0k=0, since both profiles are zero there. Superscripts now indicate majority size rather than longitudinal length.

An all-odd box has a spanning path whose two endpoints lie in its majority color: traverse successive slices alternately forward and backward and induct on dimension. On that odd path a proper majority kk-set has at least kk neighbors, by omitting an unselected majority vertex and matching selected vertices toward it from both sides. A nonempty minority kk-set has at least k+1k+1 neighbors, by its consecutive blocks in the spacing-two path order. The box contains these path edges, so g0(k)k (k<H),g1(k)k+1 (k>0),g0(H)=H1. g_0(k)\ge k\ (k<H),\qquad g_1(k)\ge k+1\ (k>0),\qquad g_0(H)=H-1. (110)

Corollary 22.2 (Eventual feasibility threshold). If H2Z+3H\ge2Z+3, then h(QPn)=(W+1)/2h(Q\mathbin{\square}P_n)=(W+1)/2.

Proof. The size condition implies n>S+3n>S+3. The majority surplus is at most β\beta and attains β\beta at k=Z+1k=Z+1 by (107). Apply Corollary 14.6. ◻

This is an eventual threshold; shorter cylinders can need fewer inspections. For example, a 5×5×55\times5\times5 box needs twelve, whereas a sufficiently long cylinder with 5×55\times5 cross-section needs thirteen.

The period and an explicit threshold

Fix a feasible eventual budget mβ+1m\ge\beta+1 and set d=2mW>0,g=gcd(W,d),Δ=lcm(W,d)=Wd/g.d=2m-W>0,\qquad g=\gcd(W,d),\qquad \Delta=\operatorname{lcm}(W,d)=Wd/g. For the explicit threshold define J=m+1,A=Z+1,R=Δ+2J,B=8Z+6d+2,L=Z+m+1,E=B+4L(B+1),H=R+2A+4J+2+2E(R+2J+1).\begin{aligned} J&=m+1,& A&=Z+1,& R&=\Delta+2J,\notag\\ B&=8Z+6d+2,& L&=Z+m+1,& \mathcal{E}&=B+4L(B+1),\notag\\ H_*&=R+2A+4J+2+2\mathcal{E}(R+2J+1). \end{aligned}(111)

Theorem 22.3 (Eventual affine period in every odd cylinder). For every odd nn with (Wn+1)/2H(Wn+1)/2\ge H_*, Tm(QPn+2d/g)=Tm(QPn)+4W/g. T_m(Q\mathbin{\square}P_{n+2d/g}) =T_m(Q\mathbin{\square}P_n)+4W/g. (112) At the eventual minimum budget m=(W+1)/2m=(W+1)/2, increasing a sufficiently large odd length by two increases the optimal time by exactly 4W4W.

The threshold is not intended to be sharp. The proof uses the profile bounds, plateau and stable translations just proved, together with connectedness.

A potential with a bounded total deficit

For nS+3n\ge S+3, write H=(Wn+1)/2H=(Wn+1)/2 and M=H1M=H-1. Define K=2Z+2m+1,Γ=(2H4Z2m5)+,Fp(k)=min{Γ,(2k+pK)+}.K=2Z+2m+1,\qquad \Gamma=\left(2H-4Z-2m-5\right)_+,\qquad F_p(k)=\min\{\Gamma,\left(2k+p-K\right)_+\}.

Lemma 22.4 (Uniform potential and time bounds). For 0rm0\le r\le m, Fp(k)F1p(gp((kr)+))(2rW)+. F_p(k)-F_{1-p}\bigl(g_p(\left(k-r\right)_+)\bigr) \le\left(2r-W\right)_+. (113) Consequently 2Γ/dTm(QPn)4(Mm)+/d+2. \left\lceil 2\Gamma/d\right\rceil\le T_m(Q\mathbin{\square}P_n) \le4\left\lceil\left(M-m\right)_+/d\right\rceil+2. (114)

Proof. The potential inequality is trivial if Γ=0\Gamma=0. Otherwise let q=(kr)+q=\left(k-r\right)_+ and j=gp(q)j=g_p(q). If qZq\le Z, then kZ+mk\le Z+m and 2k+pK02k+p-K\le0, so the current potential is zero. If qHZ1q\ge H-Z-1, then jq1HZ2j\ge q-1\ge H-Z-2, and 2j+(1p)K2H2Z4K=Γ.2j+(1-p)-K\ge2H-2Z-4-K=\Gamma. The successor potential is therefore Γ\Gamma. In the remaining region both profiles are on their plateaus, so j=kr+β+pj=k-r+\beta+p. The difference of the unclipped affine expressions is 2rW2r-W. Common monotone, 11-Lipschitz clipping proves (113).

For two quota shares r,mrr,m-r, the right sides sum to at most d=2mWd=2m-W. Both full color classes have potential Γ\Gamma, giving the lower bound by summing daily decreases. For the upper bound, start with the minority cohort of size MM. Each pair of full-budget days reduces an uncleared cohort by at least dd. Thus 2(Mm)+/d+12\left\lceil\left(M-m\right)_+/d\right\rceil+1 days suffice. Pad early clearing to this fixed odd phase length. The other initial cohort remains its full current color class and, after the odd phase, is also in the minority color with size MM. Repeat the phase to obtain the upper bound. ◻

For a rectangle Q=PwQ=P_w, w=2b+1w=2b+1, the explicit profiles of Theorem 5.1 permit the sharper corner radius Z=b2Z=b^2 in the preceding argument. At minimum budget, strengthen its potential slightly as follows, for every odd nwn\ge w. Take K=2b2+2b+2K=2b^2+2b+2 and Γ=(2H4b22b6)+\Gamma=\left(2H-4b^2-2b-6\right)_+. In the low region the current potential is zero for r<mr<m and at most one for r=mr=m; the high-region and plateau arguments are unchanged. This gives the useful uniform estimate max{0,2wn2w2+2w10}T(w+1)/2(PwPn)2wn2w2. \max\{0,\,2wn-2w^2+2w-10\} \le T_{(w+1)/2}(P_w\mathbin{\square}P_n) \le2wn-2w-2. (115) Thus its leading term is 2wn2wn for every fixed odd width, independently of whether a sharper correction has been determined.

Return to the general cylinder, with Z=W(S+1)Z=W(S+1) and the potential of Lemma 22.4. Assume HHH\ge H_*, so Γ>0\Gamma>0 and M>mM>m. Fix an optimal prefix strategy, using padded full quotas as in Section 21. Let Φt\Phi_t be the sum of its two current-color potentials and put ηt=d(ΦtΦt+1)0.\eta_t=d-(\Phi_t-\Phi_{t+1})\ge0. These are integers, and the upper bound in (114) gives tηt=dTm2Γ8Z+6d+2=B. \sum_t\eta_t=dT_m-2\Gamma\le8Z+6d+2=B. (116) Here d(Mm)/dMm+d1d\left\lceil(M-m)/d\right\rceil\le M-m+d-1 accounts for the rounding. Call a day efficient if ηt=0\eta_t=0, and bad otherwise. There are at most BB bad days.

An efficient day gives all mm inspections to one cohort. Indeed, if both positive-part losses in (113) are positive, their sum is dW<dd-W<d. If only one is positive but neither share is mm, it is at most d2d-2. Thus on an efficient day the active cohort loses exactly dd potential and the inactive cohort’s potential remains exactly constant.

From flat potentials to empty or full cohorts

Zero inspections strictly increase every intermediate potential: 0<Fp(k)<ΓF1p(gp(k))>Fp(k). 0<F_p(k)<\Gamma \quad\Longrightarrow\quad F_{1-p}(g_p(k))>F_p(k). (117) For a proper majority prefix, g0(k)kg_0(k)\ge k, so its unclipped expression increases by at least one after the color reversal. A full majority prefix has potential Γ\Gamma and is excluded. For a nonempty minority prefix, g1(k)k+1g_1(k)\ge k+1, giving the same conclusion. Clipping preserves strict growth while the old value is below Γ\Gamma.

After an active cohort loses dd on an efficient day, its potential is strictly below Γ\Gamma. If it is still positive, (117) forces it to stay active on the next efficient day. A switch is possible only when its potential reaches zero. It cannot become active again in the same efficient run, since zero cannot lose dd and its inactive value must stay constant. Hence each consecutive efficient run has at most two focused blocks, and there are at most 2(B+1)2(B+1) such blocks in total.

Call a day clean when all mm inspections target one cohort and the other cohort is actually empty or actually its full current color class. Flat potential alone is insufficient for this conclusion. We now bound the transient days needed to reach actual emptiness or fullness.

If a nonempty proper support XX lies in one color of a connected bipartite graph without isolated vertices, then XN2(X)X\subsetneq N^2(X). Inclusion follows by backtracking along an edge. Equality would make XX closed under two-step paths; connectivity makes the two-step graph connected within each color and would force XX to be full. Therefore an uninspected nonempty proper prefix grows by at least one every two days until it is full.

During an efficient focused block the inactive potential is constantly zero or Γ\Gamma. At zero, its count is at most Z+m=L1Z+m=L-1; if nonempty, it cannot remain in that range for more than 2L2L days. At Γ\Gamma, its count is at least HZ2H-Z-2, hence within LL of its full class; it becomes full within 2L2L days. Empty and full cohorts remain so under further uninspected moves. Each efficient block therefore contributes at most 2L2L nonclean days. Counting all bad days as well, the entire optimal search has at most E=B+4L(B+1) \mathcal{E}=B+4L(B+1) (118) nonclean days.

A protected band and its two individual cuts

Every one-day count change has absolute value at most J=m+1J=m+1: profile surplus is between 1-1 and β+1\beta+1, and each quota is at most mm. Record both source counts from each nonclean day. A count kk forbids integer cuts cc with k[cJ,c+R+J]k\in[c-J,c+R+J], at most R+2J+1R+2J+1 cuts. There are at most 2E2\mathcal{E} records. Restrict candidate cuts to A+2JcHRA2J2. A+2J\le c\le H-R-A-2J-2. (119) There are HR2A4J1H-R-2A-4J-1 candidates. By (111), this exceeds 2E(R+2J+1)2\mathcal{E}(R+2J+1). Choose a cut forbidden by no record.

No nonclean transition can touch the protected interval [c,c+R][c,c+R]. A cohort in that interval is therefore active on every day, receiving all mm inspections; an inactive clean cohort is empty or full, both outside the interval. Its count never increases. Nor can it cross the interval upwards: a nonclean transition cannot touch it, and a clean active transition does not increase. Both cohorts begin above and finish below the interval.

For each initial cohort ii, choose its first count xix_i at most c+Δ+Jc+\Delta+J. The previous count is larger, so the displacement bound gives c+Δ<xic+Δ+J. c+\Delta<x_i\le c+\Delta+J. (120) The entire protected interval is inside the profile plateaus, including all relevant survivors. A full-budget step there sends kk to km+β+pk-m+\beta+p, so every pair of days reduces its count by exactly dd and restores its color. The next τ=2Δ/d\tau=2\Delta/d days therefore take xix_i to xiΔ(c,c+J]x_i-\Delta\in(c,c+J]. This duration is even, and the trajectory stays in the protected band. Throughout the block its inactive companion remains empty or full. The two crossing blocks cannot overlap.

Define the individual endpoints i=xiΔ,ui=xi.\ell_i=x_i-\Delta,\qquad u_i=x_i. They need not agree for the two cohorts. This avoids an otherwise real residue problem: when d>1d>1, a trajectory may skip a prescribed count, and the two cohorts need not have matching residues. One common protected band supplies two legitimate individual cuts. Every visit to (i,ui)(\ell_i,u_i) belongs to the chosen crossing block, because active clean trajectories are nonincreasing and nonclean transitions cannot touch the larger band. Boundary stalls at the minimum budget are harmless; the even block duration preserves the needed phase.

Removing and enlarging the crossing blocks

Proof of Theorem 22.3. First contract the majority size from HH to HΔH-\Delta and delete both crossing blocks of length τ\tau. At each remaining state transform initial cohort ii by fi(k)={k,ki,kΔ,kui.f_i(k)= \begin{cases} k,&k\le\ell_i,\\ k-\Delta,&k\ge u_i. \end{cases} No retained state lies strictly between these cases. At the ends of a deleted block, uiu_i and i\ell_i both map to i\ell_i. Its inactive companion is empty or full at both ends; a full class maps to the contracted full class. Since τ\tau is even, the color labels also match. The two state paths therefore glue.

For a low retained source, its survivor is at most i\ell_i. The contracted far-distance satisfies (HΔ)i=HuiH(c+R)A+2J+2,(H-\Delta)-\ell_i=H-u_i \ge H-(c+R)\ge A+2J+2, so the low profile identity (108) applies. Its successor cannot enter the removed interval, by the protected-band argument. For a high retained source, the contracted survivor is at least im>cm>Z.\ell_i-m>c-m>Z. The stable upper profile identity (109) therefore gives gpH(q+Δ)=gpHΔ(q)+Δ.g_p^H(q+\Delta)=g_p^{H-\Delta}(q)+\Delta. These identities verify every retained transition. Quotas remain within the same budget, and unused quota may be wasted. The result is a physical prefix search on length n2Δ/Wn-2\Delta/W. Its majority size is at least HΔ2Z+6J+4H_*-\Delta\ge2Z+6J+4, so its length exceeds 4(S+1)4(S+1) and the longitudinal coordinate remains longest. Thus all stable profile identities still apply. The resulting search is completed in Tm(QPn)4Δ/dT_m(Q\mathbin{\square}P_n)-4\Delta/d days. Hence Tm(QPn2Δ/W)Tm(QPn)4Δ/d. T_m(Q\mathbin{\square}P_{n-2\Delta/W}) \le T_m(Q\mathbin{\square}P_n)-4\Delta/d. (121)

Conversely, start with an optimal search on any HHH\ge H_* and its protected blocks. Enlarge HH to H+ΔH+\Delta. Keep lower counts at or below i\ell_i unchanged and increase upper counts at or above uiu_i by Δ\Delta. Replace each block from uiu_i to i\ell_i by a clean block from ui+Δu_i+\Delta to i\ell_i, lasting 4Δ/d4\Delta/d days. The affine profiles realize this trajectory explicitly, with the inactive companion empty or the enlarged full class. The extra τ\tau days per block are even. The same low and high identities verify every other transition. Thus Tm(QPn+2Δ/W)Tm(QPn)+4Δ/d.T_m(Q\mathbin{\square}P_{n+2\Delta/W}) \le T_m(Q\mathbin{\square}P_n)+4\Delta/d. Apply (121) at H+ΔH+\Delta for the reverse inequality. Since Δ/W=d/g\Delta/W=d/g and Δ/d=W/g\Delta/d=W/g, this proves (112). ◻

Let n0n_0 be the least odd length at or beyond the threshold. For each of the d/gd/g odd residue classes modulo 2d/g2d/g, the exact two-count recurrence determines the optimum and an optimal strategy at one of n0,n0+2,,n0+2d/g2.n_0,n_0+2,\ldots,n_0+2d/g-2. The theorem then determines every later time in that class and constructs its optimal strategy by insertion. In particular, Tm(QPn)=2W2mWn+OQ,m(1).T_m(Q\mathbin{\square}P_n)=\frac{2W}{2m-W}\,n+O_{Q,m}(1). At the eventual minimum budget there is one offset C(Q)C(Q), with T(W+1)/2(QPn)=2WnC(Q)T_{(W+1)/2}(Q\mathbin{\square}P_n)=2Wn-C(Q) for every sufficiently large odd nn. The offset can depend on the transverse shape, not only on its number of rooms. For rectangular cross-sections Q=PwQ=P_w, the stronger bounds in (115) give 2w+2C(w)2w22w+102w+2\le C(w)\le2w^2-2w+10. Finding smaller corner recurrences or closed expressions for the eventual offsets remains a further problem.

An exact three-dimensional family

For one cross-section the finite corner calculation gives the optimum from the shortest nontrivial cylinder, without the conservative threshold in Theorem 22.3.

Theorem 22.5. For every odd n3n\ge3, five inspections per day are necessary and sufficient on P3P3PnP_3\mathbin{\square}P_3\mathbin{\square}P_n, and T5(P3P3Pn)=18n36.T_5(P_3\mathbin{\square}P_3\mathbin{\square}P_n)=18n-36.

Proof. Put H=(9n+1)/2H=(9n+1)/2. For Q=P3P3Q=P_3\mathbin{\square}P_3, the ranks of bottom-slice vertices in their respective parity orders, and their transverse costs, are prankscosts0(1,2,3,5,8)(2,1,1,0,0)1(1,2,4,6)(2,1,1,0).\begin{array}{c|l|l} p&\text{ranks}&\text{costs}\\\hline 0&(1,2,3,5,8)&(2,1,1,0,0)\\ 1&(1,2,4,6)&(2,1,1,0). \end{array} These ranks already stabilize at n=3n=3. The last even bottom point (2,2,0)(2,2,0) is first in weight layer four, and its earlier even layers have longitudinal coordinate at most two. The last odd bottom point (1,2,0)(1,2,0) is sixth in its parity order: its predecessors are the three unit vectors and (2,1,0),(2,0,1)(2,1,0),(2,0,1). Enlarging the longitudinal path therefore introduces no earlier point in either list.

Let Up(k)U_p(k) be the cumulative listed cost through rank kk, and let Bp(k)B_p(k) count the listed ranks at most kk. The cost and complement argument of Lemma 22.1 gives, for k>0k>0, g0(k)=k+U0(k)5+B0(Hk),g1(k)=k+1+U1(k)4+B1(H1k),g_0(k)=k+U_0(k)-5+B_0(H-k),\qquad g_1(k)=k+1+U_1(k)-4+B_1(H-1-k), with g0(0)=g1(0)=0g_0(0)=g_1(0)=0. Thus the corner radius is eight, and the central profiles are k+4k+4 and k+5k+5. The majority surplus is at most four and equals four at k=3k=3: U0(3)=4U_0(3)=4 and B0(H3)=5B_0(H-3)=5 for every H14H\ge14. Corollary 14.6 gives the minimum budget five.

For the exact time use the identical charge sequences c0=c1=(0,0,13,23,1,1).c_0=c_1=(0,0,\tfrac13,\tfrac23,1,1). They satisfy the daily charge bound (99). The rational shortest-charge potentials described in the preceding section are checked against every transition Fp(k)F1p(gp(max{kr,0}))cp(r),0r5.F_p(k)-F_{1-p}\bigl(g_p(\max\{k-r,0\})\bigr)\le c_p(r), \qquad 0\le r\le5. Together with a minority-first serial strategy, the five finite certificates give n357911F0(H)+F1(H1)185490126162strategy length185490126162.\begin{array}{c|rrrrr} n&3&5&7&9&11\\\hline F_0(H)+F_1(H-1)&18&54&90&126&162\\ \text{strategy length}&18&54&90&126&162. \end{array} Here the strategy spends all available inspections on the first cohort until it is captured, uses any remaining inspections on its finishing day on the second cohort, and then finishes that cohort. The finite verifier checks the physical room neighborhoods and replays these inspection sets, as well as checking all 1,950 rational inequalities.

At the base n=11n=11, take H=50H=50, c=25c=25, and D=6D=6. The exact arrays satisfy Fp(k)=2k14+p(13k37).F_p(k)=2k-14+p\qquad(13\le k\le37). This is the full collar [c2D,c+2D][c-2D,c+2D], and c8+2Dc\ge8+2D, Hc8+2D+2H-c\ge8+2D+2. Both active cohorts visit count 25. At the first visit the other cohort is full, since 25>525>5 places the visit before the first cohort’s finishing day. At the second visit the first cohort is empty.

Consequently Lemmas 21.2 and 21.3, in their compatible-profile formulation, apply with corner radius eight. Increasing HH by Δ\Delta inserts an affine interval in each potential and raises their initial sum by 4Δ4\Delta. Inserting 2Δ2\Delta full-budget days at each serial cut realizes the same increase in time. Each pair of inserted days reduces the active count by one and restores its color, while the other cohort stays full or empty. All remaining transitions follow the stable low and translated high profiles above.

For every odd n11n\ge11, choose Δ=9(n11)/2\Delta=9(n-11)/2. The matching bounds are then 162+4Δ=18n36162+4\Delta=18n-36. The finite certificates cover the smaller odd lengths, completing the proof. ◻

The exact verifier and receipt are included in the companion artifact:

src/three_by_three_cylinder_time.py
research/three-by-three-cylinder-time.json

The receipt stores the corner tables, charges, finite values, and complete base potential arrays. An independent verifier also checked actual room neighborhoods and schedules at seven lengths, including 13 and 31. These checks establish the finite premises of the insertion proof. The variable-length theorem is an ordinary proof with exact rational certificates; it is not claimed here as a complete physical Lean theorem.

Higher-dimensional boxes

The preceding compression theorems work in arbitrary dimension, but do not by themselves provide a closed time formula for every box. We give two unbounded applications and a fully certified three-dimensional example.

A side of length two

Let HH be bipartite, with color function χ\chi, and put G=HP2G=H\mathbin{\square}P_2. In either color class of GG, there is exactly one vertex above each vertex vv of HH: its second coordinate is sχ(v)s-\chi(v) modulo two. Under this identification, π(NG(R))=π(R)NH(π(R)).\pi(N_G(R))=\pi(R)\cup N_H(\pi(R)). The vertical move preserves the projection, and an HH-move changes it to an HH-neighbor. This proves the equality for arbitrary sets, including boundary and empty sets.

Suppose HH has an order with prefixes IkI_k such that every kk-set has at least c(k)c(k) vertices in its closed neighborhood and IkNH(Ik)=Ic(k)I_k\cup N_H(I_k)=I_{c(k)}. Put A=HA=|H|. The two initial-color cohorts then have the exact state transition (a,b)(c(max{ap,0}),c(max{bm+p,0})),0pm, (a,b)\longmapsto \bigl(c(\max\{a-p,0\}),c(\max\{b-m+p,0\})\bigr), \qquad 0\le p\le m, (122) starting at (A,A)(A,A). A state is capturable on the current day exactly when a+bma+b\le m. Tail inspections of the prefixes attain each step. Conversely the cardinalities in every unrestricted search dominate these counters when the same allocations are used. Thus shortest-path search on (A+1)2(A+1)^2 states returns both the exact time and an actual optimal strategy, using O((m+1)(A+1)2)O((m+1)(A+1)^2) transitions after the profile is known.

Theorem 23.1. Under the preceding closed-neighborhood nesting hypothesis, h(HP2)=1+max0kA(c(k)k).h(H\mathbin{\square}P_2)=1+\max_{0\le k\le A}(c(k)-k). Both this feasibility formula and recurrence (122) apply to every Cartesian box having a side of length two.

Proof. Write B=maxk(c(k)k)B=\max_k(c(k)-k). If mBm\le B, select kk with c(k)k+mc(k)\ge k+m. A cohort of size at least k+mk+m retains at least kk possible positions after inspection and has at least k+mk+m after movement. Initially Ak+mA\ge k+m. Since k>0k>0, the invariant prevents capture forever. If m>Bm>B, a canonical cohort of size b>mb>m has next size at most bm+B<bb-m+B<b. Clear it, then clear the other cohort in the same way; the untouched projected cohort stays full.

For Cartesian HH, omit length-one factors, list the other side lengths in increasing order, and order vertices by increasing coordinate sum, breaking a tie by putting the larger first differing coordinate first. The classical simplicial isoperimetric theorem gives exactly the closed- neighborhood nesting hypothesis. We use the statement and definitions in Otachi–Suda (Otachi and Suda 2011, Theorem 2.5), where the result is attributed to Moghadam and Bollobás–Leader. For the one-vertex empty product take c(0)=0,c(1)=1c(0)=0,c(1)=1. ◻

For a,b2a,b\ge2, the vertex boundary width of PaPbP_a\mathbin{\square}P_b is min(a,b)\min(a,b), so h(PaPbP2)=min(a,b)+1h(P_a\mathbin{\square}P_b\mathbin{\square}P_2)=\min(a,b)+1. If exactly one of a,ba,b is one, the remaining nontrivial ladder has threshold two; if both are one, it is a single edge with threshold one. The theorem also covers all hypercubes. Its input is a classical closed-neighborhood theorem; it does not assert open-neighborhood nesting on arbitrary even rectangles.

Exact profile transfer for either longitudinal parity

There is a useful further recurrence even when global minimizing prefixes are unavailable. Let a bipartite transverse graph QQ have compatible minimizing parity orders with profiles g0,g1g_0,g_1. For a one-color support in QPnQ\mathbin{\square}P_n, let kjk_j be its size in column j=0,,n1j=0,\ldots,n-1, and let pp be its global color.

Proposition 23.2. For each prescribed column-count vector, the exact minimum neighborhood size is j=0n1max{g(p+j)mod2(kj),kj1,kj+1},k1=kn=0.\sum_{j=0}^{n-1} \max\{g_{(p+j)\bmod2}(k_j),k_{j-1},k_{j+1}\}, \qquad k_{-1}=k_n=0. This holds for every positive nn, including even nn.

Proof. In column jj, the neighborhood is the union of the transverse neighborhood of that column and the supports in the two adjacent columns. Its size is at least the displayed maximum. Replace every column support by the corresponding transverse prefix. All three sets are now prefixes of the same opposite color order, and their union has size exactly the maximum. These replacements attain all column minima simultaneously. ◻

Minimize the sum over vectors with kj=k\sum k_j=k to obtain the exact global cardinality profile. A transfer state remembers the previous count aa, current count bb, and cumulative count. Appending cc charges max{g(b),a,c}\max\{g(b),a,c\} and replaces the pair by (b,c)(b,c). Zero counts at the two outside columns give the boundary conditions. Writing W=QW=|Q|, this direct recurrence uses O(n2W4)O(n^2W^4) arithmetic operations and O(nW3)O(nW^3) memory once the transverse profiles are known. It applies in particular to every all-odd cross-section.

This computes exact neighborhood minima, not compatible global orders. The minimizing vector can depend on kk without being nested. A search using only these cardinality profiles therefore supplies a lower time bound; it is not asserted to attain that bound on arbitrary even cylinders. The accompanying code checks the recurrence against all 524288524\,288 one-color supports of the 3×3×43\times3\times4 box.

The finite 3×3×43\times3\times4 check as a corollary

Proposition 23.3. On P3P3P4P_3\mathbin{\square}P_3\mathbin{\square}P_4, the optimal capture time with five inspections per day is 3636.

Proof. This is n=4n=4 in the all-length theorem 23.5: 18n36=3618n-36=36. ◻

An independent finite verification remains available. Slice compression reduces the physical game to eight counts; exhaustive breadth-first search first leaves at most five rooms after 35 movements. It checks 1,109,364 transitions and discovers 2,017 states. A separately implemented physical-neighborhood search obtains the same layers and optimum, and its saved 36-day schedule replays on the actual room graph. The complete recurrence and verifier are in src/three_by_three_by_four_exact.py, with receipt and witness in research/three-by-three-by-four-exact.json. This supplies an independent finite check of the general theorem; repeating its full finite proof is unnecessary. It is not a complete physical Lean theorem.

Two complete examples with even sides

The distinction between a minimum neighborhood size and a sequence of compatible minimizing shapes is visible even on small cubes. The following two tables are exact ordinary computer-assisted theorems. Their lower certificates and physical schedules have been checked by a second implementation, independently of the search that found them.

Theorem 23.4. The minimum capture times on P43P_4^3 and P3P42P_3\mathbin{\square}P_4^2 are as follows.

4×4×44\times4\times4 3×4×43\times4\times4
Daily budget Minimum days Daily budget Minimum days
0077 \infty 0066 \infty
88 4040 77 2020
99 2020 88 1414
1010 1616 99 1111
1111 1212 1010 88
1212 1010 1111 77
13131414 88 12121313 66
1515 77 1414 55
16161717 66 15151919 44
1818 55 20202323 33
19192525 44 24244747 22
26263131 33 4848 or more 11
32326363 22
6464 or more 11

Proof. Apply Theorem 3.6 to every equal-length pair, and also compress the length-three coordinate in the second box. The one-color fixed families contain respectively 292292 and 19361936 sets per color. These families are enumerated without a geometric guess: order vertices by increasing iixi\sum_i i x_i, and either omit each vertex or include it when all its legal predecessors are already present. The predecessor moves are (3.6), together with xx2eix\mapsto x-2e_i on an odd axis. This recursively enumerates every ideal exactly once. Direct physical neighborhoods preserve the fixed families.

Minimizing N(R)|N(R)| at each cardinality in these families gives the exact unrestricted one-color neighborhood profiles, by compression. They give an impossibility trap below budgets eight and seven, respectively. On the four-cube the profile is the same in both colors and is g=(0,3,6,7,9,11,12,13,15,16,17,18,19,19,21,22,23,24,25,25,26,27,28,28,29,29,30,31,31,31,32,32,32).\begin{split} g={}&(0,3,6,7,9,11,12,13,15,16,17,18,19,19,21,22,23,\\ &24,25,25,26,27,28,28,29,29,30,31,31,31,32,32,32). \end{split} For example, a cohort of size at least 2121 retains at least 1414 rooms after seven inspections, and then has at least g(14)=21g(14)=21 positions again.

The two-count lower relaxation formed from the exact profiles gives every listed finite lower bound except at budget eight in either box. To verify this statement, enumerate all count pairs, all quota splits, and successive sets of pairs that can reach capture. This calculation is the same monotone finite recurrence used for the three-cube above. Actual room-coordinate schedules attain every listed bound; the verifier updates the complete physical belief set after each inspection and movement. Budget monotonicity extends endpoint schedules across each displayed range.

The two exceptional lower bounds have short certificate descriptions. For each fixed one-color set AA let F(A)F(A) be the nonnegative integer in the accompanying table. For every fixed survivor RAR\subseteq A, put p=ARp=|A|-|R|. At budget eight the tables satisfy F(A)c(p)+F(N(R)),0p8,F()=0. F(A)\le c(p)+F(N(R)),\qquad 0\le p\le8, \qquad F(\varnothing)=0. (123) On P43P_4^3, the charges at p=0,,8p=0,\ldots,8 are (0,0,0,0,1,2,2,2,2)(0,0,0,0,1,2,2,2,2); both full-color potentials are 4040. Two allocations totaling at most eight have total charge at most two. Telescoping (123) therefore gives T8(40+40)/2=40T_8\ge(40+40)/2=40. There are 2968629\,686 inequalities to check. An attaining prefix sweep for each cohort has sizes 32,29,27,25,24,23,22,22,21,21,19,19,18,18,17,16,15,13,11,8,0.\begin{split} &32,29,27,25,24,23,22,22,21,21,19,19,\\ &18,18,17,16,15,13,11,8,0. \end{split} Each sweep takes twenty days; reflection in an even axis gives the favorable starting phase for the second cohort.

On P3P42P_3\mathbin{\square}P_4^2, take c(p)=pc(p)=p and full-color potential 5454. The 654570654\,570 inequalities give T8108/8=14T_8\ge\left\lceil 108/8\right\rceil=14, attained by the stored physical schedule. These certificate checks require only integer inequalities and direct finite neighborhoods. They do not trust the shortest-path procedure that generated the potential tables.

Finally, both boxes have a perfect matching. Its disjoint alternating trajectories require at least half the volume in two days; two successive inspections of one full color attain that threshold. One-day capture requires the entire volume. This proves the remaining endpoint ranges. ◻

The independent verifier is src/even_cube_resumed_independent_review.py; complete certificates, room schedules, and review receipts are in the corresponding research/even-resume-* files in the research archive. At eight probes the four-cube’s cardinality relaxation predicts only 3232 days, compared with the true 4040; on 3×4×43\times4\times4 it predicts 1212 instead of 1414. Thus exact neighborhood profiles alone need not determine exact capture times. The shape information retained by the compression is mathematically necessary for these lower arguments.

The complete 3×3×33\times3\times3 example

Encode a room (x,y,z){0,1,2}3(x,y,z)\in\{0,1,2\}^3 by 9x+3y+z9x+3y+z. Its color is x+y+zx+y+z modulo two. The two classes have sizes 14,1314,13. Their minimum open-neighborhood sizes are the following; a dash indicates a source cardinality larger than the class.

The three-cube drawn as three layers. Adjacent rooms in a layer are connected; rooms at the same position in consecutive layers are also connected. Shading marks the first five inspections of the schedule.
kk 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
gE(k)g_E(k) 0 3 5 7 8 9 10 10 11 12 12 13 13 13 13
gO(k)g_O(k) 0 4 6 7 9 10 11 12 12 13 13 14 14 14

Here is a finite certificate procedure for the table. For each color, list its vertices; recursively either include or exclude the next vertex, maintaining the selected count kk and the union UU of its physical neighbor sets. At every leaf check Ug(k)|U|\ge g(k). This has 214+213=245762^{14}+2^{13}=24\,576 leaves. The generic recursion is proved sound in Lean before the concrete finite check is kernel evaluated. Prefixes in increasing coordinate sum with decreasing lexicographic tie breaking attain the values. Neither the lower bound nor the formal classification assumes that an arbitrary search uses these prefixes.

For a fixed budget define the relaxed count successor fp(a,b)=(gO(max{bm+p,0}),gE(max{ap,0})).f_p(a,b)=\bigl(g_O(\max\{b-m+p,0\}), g_E(\max\{a-p,0\})\bigr). All arbitrary physical successors dominate one of these. The finite calculation below independently specifies the time lower bounds. It uses just 1514=21015\cdot14=210 count pairs; WtW_t denotes relaxed states that can reach zero in at most tt inspection rounds.

W = {(0, 0)}
for t = 1, 2, ...:
    Wnext = W union {(a,b): 0<=a<=14, 0<=b<=13,
                   f_p(a,b) belongs to W for some 0<=p<=m}
    if (14,13) belongs to Wnext: return t
    if Wnext == W: return infinity
    W = Wnext

The required lower endpoint checks are 18,10,6,4,318,10,6,4,3 at budgets 5,6,8,11,125,6,8,11,12, respectively. In Lean the corresponding distance potentials are stored as finite integers and checked to be nondecreasing in both counts, zero at zero, and to drop by at most one under every relaxed transition. This proves the lower bound without trusting the search routine that found the potentials. For budgets at most four, there is a shorter proof: every same-color triple has at least seven neighbors, so a cohort of at least seven positions can never fall below seven after four inspections and movement.

For clarity, explicit upper schedules are given next. Each row is a sequence of daily inspection sets; a superscript ×2\times2 means repeat the entire listed sequence twice. The physical update BN(BS)B\leftarrow N(B\setminus S), starting from all 2727 rooms, verifies every schedule directly.

mm Inspection sets in order
5 ({1,3,5,9,11},{4,6,10,12,18},{5,7,11,13,15},\bigl(\{1,3,5,9,11\},\{4,6,10,12,18\},\{5,7,11,13,15\}, {8,10,12,14,16},{9,11,13,15,17},{10,12,14,16,18},\{8,10,12,14,16\},\{9,11,13,15,17\},\{10,12,14,16,18\}, {11,13,15,19,21},{8,14,16,20,22},{15,17,21,23,25})×2\{11,13,15,19,21\},\{8,14,16,20,22\},\{15,17,21,23,25\}\bigr)^{\times2}
6 ({8,14,16,20,22,26},{5,7,11,13,19,25},\bigl(\{8,14,16,20,22,26\},\{5,7,11,13,19,25\}, {2,4,10,16,22,24},{1,7,13,15,19,21},\{2,4,10,16,22,24\},\{1,7,13,15,19,21\}, {0,4,6,10,12,18})×2\{0,4,6,10,12,18\}\bigr)^{\times2}
7 ({8,14,16,20,22,24,26},{5,7,11,13,15,19,21},\bigl(\{8,14,16,20,22,24,26\},\{5,7,11,13,15,19,21\}, {0,2,4,6,10,12,18})×2\{0,2,4,6,10,12,18\}\bigr)^{\times2}
9 {2,4,8,14,16,20,22,24,26},{1,3,7,9,11,13,15,19,21},\{2,4,8,14,16,20,22,24,26\},\{1,3,7,9,11,13,15,19,21\}, {5,7,11,13,15,17,19,23,25},{0,2,4,6,10,12,18,22,24}\{5,7,11,13,15,17,19,23,25\},\{0,2,4,6,10,12,18,22,24\}
12 {2,4,6,8,10,12,14,16,20,22,24,26},\{2,4,6,8,10,12,14,16,20,22,24,26\}, {1,3,8,9,14,16,19,20,21,22,24,26},\{1,3,8,9,14,16,19,20,21,22,24,26\}, {1,3,5,7,9,11,13,15,19,21}\{1,3,5,7,9,11,13,15,19,21\}
13 All odd-numbered rooms, on each of two consecutive days.

Larger budgets inherit these schedules. Fewer than 2727 probes cannot capture every possible initial room in one day, and 2727 can. We have therefore proved the complete table stated in the introduction. Its geometry, finite inequalities, physical schedules, and interpretation as capture of every actual target walk are all checked in Lean.

The exact five-inspection time on every 3×3×n3\times3\times n cylinder

Theorem 23.5. For every n3n\ge3, T5(P3P3Pn)=18n36.T_5(P_3\mathbin{\square}P_3\mathbin{\square}P_n)=18n-36. The proof combines an explicit physical sweep with an ordinary lower certificate for arbitrary supports. The new even-length argument is not presently a complete physical Lean theorem.

The odd case is Theorem 22.5. Assume n=2L4n=2L\ge4 and put h=9Lh=9L. Both checkerboard classes have hh rooms. The compatible transverse 3×33\times3 profiles are G0=(0,2,3,4,4,4),G1=(0,3,4,5,5).G_0=(0,2,3,4,4,4),\qquad G_1=(0,3,4,5,5). Compress every transverse slice to its parity prefix. This operator CC is monotone and cardinality preserving, and satisfies N(CS)C(NS)N(CS)\subseteq C(NS) by the fiber-compression theorem. For a compressed phase-pp set with slice counts kjk_j, its exact neighborhood count in slice jj is max{G(p+j)mod2(kj),kj1,kj+1},k1=kn=0.\max\{G_{(p+j)\bmod2}(k_j),k_{j-1},k_{j+1}\}, \qquad k_{-1}=k_n=0. We first establish a sharp obstruction to consecutive small boundaries.

A finite word certificate for every even length

For phase zero, pair consecutive counts into letters (a,b)(a,b) with 0a50\le a\le5, 0b40\le b\le4. Give a letter the cost v(a,b)=max{G0(a),b}a+max{G1(b),a}b,v(a,b)=\max\{G_0(a),b\}-a+\max\{G_1(b),a\}-b, and consecutive letters s=(a,b)s=(a,b), t=(c,d)t=(c,d) the edge cost e(s,t)=max{G1(b),a,c}max{G1(b),a}+max{G0(c),d,b}max{G0(c),d}.\begin{aligned} e(s,t)={}&\max\{G_1(b),a,c\}-\max\{G_1(b),a\}\\ &+\max\{G_0(c),d,b\}-\max\{G_0(c),d\}. \end{aligned} The neighborhood surplus is exactly iv(si)+i<L1e(si,si+1)\sum_i v(s_i)+\sum_{i<L-1}e(s_i,s_{i+1}); no outside edge is added. Every edge cost is nonnegative. The vertex costs are the following nonnegative matrix, with rows a=0,,5a=0,\ldots,5 and columns b=0,,4b=0,\ldots,4: (034552334433333433324322143210).\begin{pmatrix} 0&3&4&5&5\\2&3&3&4&4\\3&3&3&3&3\\ 4&3&3&3&2\\4&3&2&2&1\\4&3&2&1&0 \end{pmatrix}. Thus a word of surplus at most four has no prefix of larger cost.

Here is the entire finite certificate specification. A state records its last letter, cost at most four, occupied count capped at four, omitted count capped at eight, whether its first a3a\ge3, and length capped at two. Initialize with every one-letter word of cost at most four. Appending t=(c,d)t=(c,d) adds v(t)+e(s,t)v(t)+e(s,t) to the cost, c+dc+d to the occupied count, and 9cd9-c-d to the omitted count; saturate the two counts, preserve the first-letter flag, and cap length at two. Discard costs above four. Finite closure gives exactly 113 states and 346 edges. Every terminal state of capped length two satisfies:

  1. Its cost is at least zero if either capped count is zero, and otherwise at least min{4,K+1,(D+2)/2}\min\{4,K+1,\left\lfloor(D+2)/2\right\rfloor\}, where K,DK,D are its two capped counts.

  2. If its cost is four, K=4K=4, and D=8D=8, its first a3a\ge3 and its last letter is (a,0)(a,0) with a2a\le2.

These are finite integer checks of the stated initialization and transition rule, supplied in the accompanying certificate. Induction on word length makes them valid for every L2L\ge2; costs above four trivially satisfy the first bound. Reflection in the even longitudinal side exchanges the colors, giving phase one too.

Consequently every monochromatic set of size kk has at least gh(k)g_h(k) neighbors, where gh(0)=0,gh(h)=h,gh(k)=k+min{4,k+1,(hk+2)/2}(0<k<h). g_h(0)=0,\quad g_h(h)=h,\quad g_h(k)=k+\min\{4,k+1,\left\lfloor(h-k+2)/2\right\rfloor\}\quad(0<k<h). (124) Compression transports this bound to arbitrary supports. Call a survivor critical if its surplus is four and 4kh84\le k\le h-8. A compressed phase-zero critical set has at most two neighbors in the last slice, whereas every compressed phase-one critical set contains at least three rooms in that slice. Hence consecutive compressed critical survivors are impossible. For arbitrary critical RR, (124) forces N(CR)=N(R)=R+4|N(CR)|=|N(R)|=|R|+4. The compression inclusion therefore becomes N(CR)=C(NR)N(CR)=C(NR). If a second critical SS lay in N(R)N(R), monotonicity would give CSC(NR)=N(CR)CS\subseteq C(NR)=N(CR), the same contradiction. This proves the obstruction for arbitrary consecutive survivors.

A two-component integer potential

Let e{0,1}e\in\{0,1\} record whether the previous survivor was critical, starting with e=0e=0. A marked count satisfies 8kh48\le k\le h-4, and the obstruction forbids e=e=1e=e'=1. Use charges c(0),,c(5)=(0,0,1,2,3,3),c(p)+c(q)3if p+q5.c(0),\ldots,c(5)=(0,0,1,2,3,3), \qquad c(p)+c(q)\le3\quad\text{if }p+q\le5. Define P0(k)=(0,0,1,2,3,3,5,6,9)[k],0k8,P0(k)=min{6k42,3k+3h51,6h54},k9,P1(k)=6k39,8kh4.\begin{aligned} P_0(k)&=(0,0,1,2,3,3,5,6,9)[k],&&0\le k\le8,\\ P_0(k)&=\min\{6k-42,3k+3h-51,6h-54\},&&k\ge9,\\ P_1(k)&=6k-39,&&8\le k\le h-4. \end{aligned} Both functions are nondecreasing in their valid count domains. For every one-cohort step with useful allocation p5p\le5, Pe(k)c(p)+Pe(k). P_e(k)\le c(p)+P_{e'}(k'). (125) To specify its complete check, put s=kps=k-p. At s=0s=0 the only output is (0,0)(0,0). If 4sh84\le s\le h-8, the minimum marked output is (s+4,1)(s+4,1) and the minimum unmarked output is (s+5,0)(s+5,0); the former is forbidden when e=1e=1. Outside this interval the output is unmarked with count at least gh(s)g_h(s). Monotonicity handles every larger actual neighborhood. These cases include all geometric outputs.

For h=18,27,36,45h=18,27,36,45, substitution checks respectively 183, 345, 507, and 669 inequalities, using integers only. The following three cases prove every larger parameter, so this finite verification is not an extrapolation. Write h=45+Δh=45+\Delta, Δ0\Delta\ge0. If k17k\le17, every minimum output is at most 22 and the base inequality is unchanged. If k27+Δk\ge27+\Delta, subtract Δ\Delta from source and output counts: the residual is at least 22+Δ22+\Delta, and all profiles, history endpoints, and potentials translate exactly, the latter by 6Δ6\Delta. Finally, if 18k26+Δ18\le k\le26+\Delta, the residual lies in [13,26+Δ][4,h8][13,26+\Delta]\subseteq[4,h-8], and source and minimum output are in the affine region Pe(k)=6k42+3eP_e(k)=6k-42+3e. The possible drops are 6p276p-27 for 010\to1 or 101\to0, and 6p306p-30 for 000\to0; each is at most c(p)c(p). This proves (125) for every h45h\ge45. The four bases cover all remaining physical half-sizes h=9n/2h=9n/2.

Both initial potentials are P0(h)=6h54P_0(h)=6h-54, and both terminal potentials vanish. The combined potential decreases by at most three per day. Therefore T52(6h54)3=4h36=18n36.T_5\ge\frac{2(6h-54)}3=4h-36=18n-36.

An explicit sweep attaining the bound

By Lemma 14.2, weight-then-reverse-lexicographic prefixes have prefix neighborhoods even when a box has an even side. We use this nesting only for construction. Let Up(k)U_p(k) be the cumulative cost through the bottom-slice ranks at most kk, and Bp(k)B_p(k) the number of such ranks. The stable bottom data are prankscosts0(1,2,3,5,8)(2,1,1,0,0)1(1,2,4,6)(2,1,1,0).\begin{array}{c|c|c} p&\text{ranks}&\text{costs}\\\hline 0&(1,2,3,5,8)&(2,1,1,0,0)\\ 1&(1,2,4,6)&(2,1,1,0). \end{array} They stabilize already at n=3n=3, as in the odd-cylinder proof. Reflection now exchanges the colors. Counting the top slice gives the exact physical prefix profiles, zero at zero, fp(k)=k+Up(k)4+B1p(hk),k>0.f_p(k)=k+U_p(k)-4+B_{1-p}(h-k),\qquad k>0. Indeed the top slice has 4+p4+p vertices of source color pp, its omitted vertices have the bottom ranks of color 1p1-p, and the origin correction is pp; the resulting constant is p(4+p)=4p-(4+p)=-4.

Start one cohort in phase zero of this order and inspect its last five rooms each day. The full count follows hh2h3,h\longrightarrow h-2\longrightarrow h-3, returning to phase zero. For every phase-zero count 10kh310\le k\le h-3, the next two days are kk1k1k\to k-1\to k-1. After h12h-12 such pairs, the count is nine in phase zero. The final four days are 98750.9\longrightarrow8\longrightarrow7\longrightarrow5\longrightarrow0. All these transitions follow by direct substitution in fpf_p: U0U_0 is saturated by rank three and U1U_1 by rank four, while the opposite tails supply the displayed upper range. Thus the solo duration is 2+2(h12)+4=2h18=9n182+2(h-12)+4=2h-18=9n-18 for every h18h\ge18.

This duration is even. The untouched cohort is then in physical phase one. Reflect the order in the longitudinal coordinate for its sweep; reflection exchanges colors, so it starts in virtual phase zero and has the same duration. The first cohort is empty and remains empty. The two physical sweeps take 18n3618n-36 days, proving the theorem. The independently reflected second order matters: the same orientation would take one additional day.

The accompanying integer certificate and an independent implementation check the finite boundary assertions and all base inequalities. Separate coordinate-neighborhood replays check the two complete sweeps at n=4,6,8,10,12,30n=4,6,8,10,12,30. The displayed word induction, three-interval potential argument, and explicit sweep establish the unbounded theorem.

Six inspections on even 3×3×n3\times3\times n cylinders

Theorem 23.6. For every even n4n\ge4, T6(P3P3Pn)=6n8.T_6(P_3\mathbin{\square}P_3\mathbin{\square}P_n)=6n-8.

Proof. Put n=2Ln=2L and h=9Lh=9L. We reuse the arbitrary-support geometry proved in Section 23.6; those geometric statements do not depend on the inspection budget. For a cohort of size kk, let ee record whether the preceding survivor had surplus four and size in [4,h8][4,h-8]. Initially (k,e)=(h,0)(k,e)=(h,0). The valid domains are 0kh0\le k\le h for e=0e=0, and 8kh48\le k\le h-4 for e=1e=1. After pp useful inspections, put s=kps=k-p. An empty survivor gives (0,0)(0,0). Otherwise the next size yy satisfies ygh(s)y\ge g_h(s), where ghg_h is (124). The next bit is one exactly when 4sh84\le s\le h-8 and y=s+4y=s+4. Consecutive bits equal to one are impossible. This relaxes every physical search, including searches whose supports are not global prefixes.

Assign charges (c(0),,c(6))=(0,0,0,1,1,2,2)(c(0),\ldots,c(6))=(0,0,0,1,1,2,2). They satisfy c(p)+c(q)2c(p)+c(q)\le2 whenever p+q6p+q\le6. Define (F0(0),,F0(8))=(0,0,0,1,1,2,2,3,4),F0(k)=min{4k/37,4h/38}(k9),F1(k)=(4k+2)/37(8kh4).\begin{aligned} (F_0(0),\ldots,F_0(8))&=(0,0,0,1,1,2,2,3,4),\\ F_0(k)&=\min\left\{\left\lfloor 4k/3\right\rfloor-7,\,4h/3-8\right\} &&(k\ge9),\\ F_1(k)&=\left\lfloor(4k+2)/3\right\rfloor-7 &&(8\le k\le h-4). \end{aligned} Both functions are nondecreasing. Every allowed transition satisfies Fe(k)c(p)+Fe(y). F_e(k)\le c(p)+F_{e'}(y). (126) Here is a finite verification with an explicit extension to all lengths. For h=18,27h=18,27, enumerate valid (k,e)(k,e), 0pmin(k,6)0\le p\le\min(k,6), and every gh(kp)yhg_h(k-p)\le y\le h. Set e=1e'=1 precisely in the critical case above, reject e=e=1e=e'=1, and check (126); when p=kp=k, check just (y,e)=(0,0)(y,e')=(0,0). These are respectively 1,095 and 3,174 integer inequalities, all satisfied. This specification and the formulas fully determine the finite certificate; the companion artifact includes an exact enumerator.

For h=27+Δh=27+\Delta, where Δ9N\Delta\in9\mathbb{N}, it suffices by monotonicity to check the least output in each next-bit class. Split the source range:

This proves (126) for every even length. The two initial potentials sum to 2(4h/38)2(4h/3-8) and both vanish at capture. Their combined daily drop is at most two, giving T64h/38=6n8T_6\ge4h/3-8=6n-8.

For the upper bound, the first two moves depart slightly from a global prefix sweep. Start with the phase-one cohort, whose full slice counts are (4,5)L(4,5)^L. Retain the transverse slice prefixes with counts R1=((4,5)L1,2,1),R2=((5,4)L1,1,0)R_1=((4,5)^{L-1},2,1),\qquad R_2=((5,4)^{L-1},1,0) on the first two days. Their successive neighborhoods, calculated from the transverse profiles, are ((5,4)L1,5,2),A=((4,5)L1,4,1).((5,4)^{L-1},5,2),\qquad A=((4,5)^{L-1},4,1). Each move inspects six rooms, and A=h4|A|=h-4. The global weightlex prefix of size h10h-10 is contained in AA. Indeed, its only missing rooms are four final-slice cells of coordinate weight at least n+1n+1. Reflection in all three coordinates maps rooms of weight at least n+1n+1 to the seven phase-zero rooms of weight at most two. Thus all four missing cells lie among the seven largest-weight rooms and are omitted by this prefix.

Now repeatedly retain the global prefix of size max(k6,0)\max(k-6,0). The compatibility and exact prefix profiles established in the preceding subsection justify every later move. Starting in phase one, each pair with k{17,20,,h4}k\in\{17,20,\ldots,h-4\} gives kk1k3k\to k-1\to k-3. After (h18)/3(h-18)/3 pairs the count is 14, and the final six days are 14131110860.14\longrightarrow13\longrightarrow11\longrightarrow10 \longrightarrow8\longrightarrow6\longrightarrow0. One cohort therefore takes 2+2(h18)/3+6=3n42+2(h-18)/3+6=3n-4 days, an even number. The other cohort stays full during these moves. Reflecting the long coordinate converts its phase zero into the virtual starting phase one, so the same construction clears it in a further 3n43n-4 days. ◻

The finite arithmetic certificate and its all-length extension are ordinary proofs. This additional even-cylinder result is not presently a complete physical Lean theorem.

A uniform height strategy for cylinders

Theorem 23.7. If HH is any finite bipartite graph with A1A\ge1 vertices and n2n\ge2, then h(HPn)A/2+1.h(H\mathbin{\square}P_n)\le\left\lfloor A/2\right\rfloor+1. For m>A/2m>A/2, at most 2A(n+2)/(2mA)2\left\lceil A(n+2)/(2m-A)\right\rceil days suffice.

Proof. We first clear one initial-color cohort. Write the path coordinate as 0z<n0\le z<n. Bound the possible positions in each fiber by a cutoff ava_v, of the current required parity, such that auav=1|a_u-a_v|=1 whenever uvuv is an edge of HH. Initially take av=n1a_v=n-1 or n2n-2 according to its parity; this bounds the full cohort. Cutoffs may later be negative or exceed the board.

At a local maximum vv, lower ava_v by two. Record the room at the old height if it lies on the board. Every adjacent difference stays one. A sequence of mm such virtual operations records at most mm distinct rooms: repeated operations in a fiber use strictly decreasing heights. Inspect those rooms simultaneously. The survivors lie below the new cutoffs ava'_v. After movement their cutoffs are bounded by av+1a'_v+1: a path move increases height by at most one, and an HH-move arrives from uu with auav+1a'_u\le a'_v+1.

Choose the virtual operations in a fixed cyclic order. List first the initially higher color class of HH, then the other class, and repeat this AA-letter word. Every operation is at a local maximum; after a whole color class has been lowered, the other is higher. Adding one to all cutoffs after a day changes no comparison. Isolated vertices of HH cause no difficulty.

After tt days every vertex has been lowered at least mt/A\left\lfloor mt/A\right\rfloor times, so maxvav(t)n1+t2mt/A<n+1t(2mA)/A.\max_v a_v(t)\le n-1+t-2\left\lfloor mt/A\right\rfloor < n+1-t(2m-A)/A. The displayed number of days per cohort makes every cutoff negative. Since HPnH\mathbin{\square}P_n has no isolated vertices, an empty post-movement belief certifies capture during inspection. Repeat for the other initial cohort, starting with the full bound of its then-current parity. ◻

Theorem 23.8 (Exact feasibility on sufficiently long boxes). Let HH be a finite bipartite graph with A2A\ge2 vertices and a Hamiltonian path. If n2A/2n\ge2\left\lfloor A/2\right\rfloor, then h(HPn)=A/2+1.h(H\mathbin{\square}P_n)=\left\lfloor A/2\right\rfloor+1. In particular, this applies to every Cartesian box used as the transverse graph, with arbitrary even or odd side lengths.

Proof. The Hamiltonian path supplies a spanning subgraph PAP_A of HH, so PAPnP_A\mathbin{\square}P_n is a subgraph of HPnH\mathbin{\square}P_n. An evader can restrict its moves to this subgraph; the subgraph need not be induced. The classical rectangle theorem (Abramovskaya et al. 2016, Theorem 2) therefore gives h(HPn)min(A,n)/2+1=A/2+1.h(H\mathbin{\square}P_n)\ge\left\lfloor\min(A,n)/2\right\rfloor+1 =\left\lfloor A/2\right\rfloor+1. Theorem 23.7 gives the matching upper bound. A Cartesian box has a Hamiltonian path by the usual snake construction: traverse successive slices alternately forwards and backwards along a Hamiltonian path in the lower-dimensional box. The joining endpoints differ only in the new coordinate. ◻

Thus, for example, 4×4×n4\times4\times n requires exactly nine probes for every n16n\ge16, and 3×4×n3\times4\times n requires exactly seven for every n12n\ge12. The length threshold is sufficient; no claim is made that it is the first length attaining the eventual budget. This theorem settles feasibility in an unbounded family containing all side parities, without asserting an optimal-time formula.

Corollary 23.9. For every n3n\ge3, h(P3P3Pn)=5h(P_3\mathbin{\square}P_3\mathbin{\square}P_n)=5. The remaining values are two at n=1n=1 and four at n=2n=2.

Proof. For n3n\ge3 the board contains the three-cube. An evader may choose to stay in that subgraph, so its hunting number is at least five. Theorem 23.7 gives the upper bound with A=9A=9. At n=1n=1 use the rectangle theorem; at n=2n=2 use Theorem 23.1 with the 3×33\times3 base. ◻

For a general box this construction can be applied along a longest axis, giving (ijni)/2+1\left\lfloor(\prod_{i\ne j}n_i)/2\right\rfloor+1 as a sufficient budget. It can be loose. The five-inspection time of every 3×3×n3\times3\times n cylinder is determined above; the full classification at larger budgets remains open here.

The optimal growth rate for every transverse box

The exact offsets remain sensitive to geometry, but the leading term of the optimal time has a uniform answer across all side parities.

Theorem 23.10. Let HH be a finite bipartite graph with A2A\ge2 vertices and a Hamiltonian path. For each fixed integer m>A/2m>A/2, as nn\to\infty through either parity, Tm(HPn)=2An2mA+OA,m(1). T_m(H\mathbin{\square}P_n)=\frac{2An}{2m-A}+O_{A,m}(1). (127) The height strategy in Theorem 23.7 has a bounded additive excess over the optimal time. When AA is even, the following bounds hold explicitly for every n2n\ge2: 2(An/2A2m)+mA/2Tm(HPn)2A(n+2)2mA. \frac{2\left(An/2-A^2-m\right)_+}{m-A/2} \le T_m(H\mathbin{\square}P_n) \le 2\left\lceil\frac{A(n+2)}{2m-A}\right\rceil. (128) In particular the theorem applies to every Cartesian transverse box.

Lemma 23.11 (An interior expansion bound for even-width rectangles). On P2bPnP_{2b}\mathbin{\square}P_n, b1,n2b\ge1,n\ge2, put h=bnh=bn and K=2b2K=2b^2. Every one-color set RR with K<R<hKK<|R|<h-K satisfies N(R)R+b|N(R)|\ge|R|+b.

Proof. Match consecutive short-axis rows in pairs. Contract an edge followed by the inverse matching to obtain a directed b×nb\times n grid DD. It has loops, bidirectional horizontal edges, and vertical rungs directed one way in even columns and the other way in odd columns. The opposite physical color reverses all rung directions. In either case N(R)R=ND+(R)R.|N(R)|-|R|=|N_D^+(R)\setminus R|. Suppose the outside boundary B=ND+(R)RB=N_D^+(R)\setminus R has size s<bs<b. In DBD-B, at least one entire horizontal row is undeleted. Its vertices lie in a single strongly connected component CC.

Call a column bad if it contains a vertex of BB. Every adjacent pair of good columns is strongly connected: the horizontal edges go both ways, and the opposite rung directions let a walk go both ways between adjacent rows. The pair meets the undeleted row, hence belongs to CC. Only bad columns and isolated good columns can contain vertices outside CC. There are at most ss of the former and s+1s+1 of the latter, so V(D)Cb(2s+1)<2b2=K.|V(D)\setminus C|\le b(2s+1)<2b^2=K. This count includes deleted vertices and also covers the case with no adjacent good columns. The set RR is outgoing-closed in DBD-B. It therefore either avoids CC or contains CC entirely. In the first case RK|R|\le K; in the second hRKh-|R|\le K, proving the contrapositive. ◻

Proof of Theorem 23.10. First let A=2bA=2b and consider the spanning rectangle PAPnP_A\mathbin{\square}P_n. Put C=(h2Km)+C=\left(h-2K-m\right)_+, L=K+mL=K+m, and ψ(k)=min{C,(kL)+}.\psi(k)=\min\{C,\left(k-L\right)_+\}. If a cohort of size kk receives pmp\le m useful inspections, write r=kpr=k-p and k=N(R)k'=|N(R)| for its survivor size and actual next size. The matching gives krk'\ge r for every survivor set. If rKr\le K, the source potential is zero. If rhKr\ge h-K, the target potential is CC whenever C>0C>0, while C=0C=0 is trivial. In the remaining case Lemma 23.11 gives kkp+bk'\ge k-p+b. Since clipping is monotone and has Lipschitz constant one, all cases give ψ(k)ψ(k)max{0,pb}.\psi(k)-\psi(k')\le\max\{0,p-b\}. The two cohorts’ useful allocations sum to at most mm, so their combined potential decreases by at most mbm-b. Their initial sum is 2C2C and their final sum zero. Thus Tm2C/(mb)T_m\ge2C/(m-b) on the rectangle. The rectangle is a subgraph of HPnH\mathbin{\square}P_n, giving the same lower bound there. Theorem 23.7 gives the displayed upper bound, with the same coefficient of nn.

For odd A3A\ge3, take the largest odd n\ell\le n. The spanning rectangle PAPP_A\mathbin{\square}P_\ell has, by the fixed-budget odd-rectangle theorem, an eventual affine period with length increment 2(2mA)/gcd(A,2mA)2(2m-A)/\gcd(A,2m-A) and time increment 4A/gcd(A,2mA)4A/\gcd(A,2m-A). Its time is consequently 2A/(2mA)+OA,m(1)2A\ell/(2m-A)+O_{A,m}(1). Since n1n-\ell\le1, this gives the required lower bound on the whole cylinder. The same height upper bound completes the proof. ◻

For example, at budgets nine and ten respectively, T9(P42Pn)=16n+O(1)T_9(P_4^2\mathbin{\square}P_n)=16n+O(1) and T10(P42Pn)=8n+O(1)T_{10}(P_4^2\mathbin{\square}P_n)=8n+O(1). At seven probes, T7(P3P4Pn)=12n+O(1)T_7(P_3\mathbin{\square}P_4\mathbin{\square}P_n)=12n+O(1). Here the cross-section and budget are fixed while the longitudinal side grows. The next theorem strengthens this leading-term result to an exact eventual affine period for every fixed transverse box. Exact constant terms for all short boxes remain a separate question.

Eventual affine periods for every fixed transverse box

The optimal growth rate in Theorem 23.10 can be strengthened to an exact eventual recurrence for every fixed transverse box, without a parity restriction on its remaining side.

Theorem 24.1 (Every fixed transverse box). Let QQ be a fixed Cartesian product of finite paths, with A=Q1A=|Q|\ge1. For each fixed integer m>A/2m>A/2, put D=2mA,g=gcd(A,D),Δ=2D/g.D=2m-A,\qquad g=\gcd(A,D),\qquad \Delta=2D/g. There is an effectively specified positive integer NN, bounded by a polynomial in AA and mm, such that Tm(QPn+Δ)=Tm(QPn)+4A/g,nN. T_m(Q\mathbin{\square}P_{n+\Delta}) =T_m(Q\mathbin{\square}P_n)+4A/g,\qquad n\ge N. (129) Both longitudinal parities are covered, and Δ\Delta is an even integer. For each integer 0mA/20\le m\le A/2, all sufficiently long cylinders are impossible to search with that budget.

We prove the time statement first for even-order Hamiltonian cross-sections, then for odd-order Hamiltonian cross-sections at even longitudinal lengths. The earlier odd-box theorem closes the remaining case for boxes. The argument applies to arbitrary strategies: optimality forces all but a bounded number of days to move a narrow physical boundary. A common interval untouched by exceptional behavior lets us shorten or lengthen the two boundary passages through it.

Theorem 24.2. Let QQ be a finite bipartite graph with a Hamiltonian path and 2b2b vertices, where b1b\ge1. Fix an integer m>bm>b, and put d=mbd=m-b. There is an effective positive integer NN such that, with the even period Δ=2d/gcd(b,d)\Delta=2d/\gcd(b,d), Tm(QPn+Δ)=Tm(QPn)+2bΔd,nN. T_m(Q\mathbin{\square}P_{n+\Delta}) =T_m(Q\mathbin{\square}P_n)+\frac{2b\Delta}{d},\qquad n\ge N. (130) The assertion holds for both parities of nn. Thus the optimal time is eventually affine on every residue class modulo Δ\Delta. The displayed period is valid but need not be the smallest; the effective threshold below is deliberately conservative.

Fix a Hamiltonian order on QQ and match consecutive vertices in that order. Each checkerboard class in the cylinder identifies with a b×nb\times n array of matched pairs. Write h=bnh=bn. As in Lemma 23.11, following an edge by the inverse matching gives a directed graph containing loops, bidirectional edges along every longitudinal row, and alternating vertical rungs between consecutive rows. Extra edges of QQ add directed edges inside columns. For a one-color support RR, its ordinary neighborhood, expressed using the opposite-color matching, is RBR\cup B, where BB is the directed outside boundary. In particular N(R)R=B|N(R)|-|R|=|B|.

Equality in the interior expansion bound

Lemma 24.3 (A finite family of minimum-surplus frontiers). Put K=4b2K=4b^2. Suppose a one-color set RR in QPnQ\mathbin{\square}P_n satisfies K<R<hK,N(R)=R+b.K<|R|<h-K,\qquad |N(R)|=|R|+b. In the matched array, its rows are either all prefixes or all suffixes: there are integers 1cin21\le c_i\le n-2, 0i<b0\le i<b, such that either Ri={0,,ci1}for every i,orRi={ci+1,,n1}for every i.R_i=\{0,\ldots,c_i-1\}\quad\hbox{for every }i, \qquad\hbox{or}\qquad R_i=\{c_i+1,\ldots,n-1\}\quad\hbox{for every }i. Adjacent cuts satisfy ci+1ci2|c_{i+1}-c_i|\le2. If their difference is two, the rung at the sole intermediate column points from outside RR into RR. The outside boundary consists exactly of the bb cut points. Additional edges of QQ may exclude some such patterns, but introduce no additional forms.

Proof. First use only the spanning Hamiltonian rectangle. Its boundary has size at most bb, and Lemma 23.11 shows that its size is at least bb. Hence its boundary BB has exactly bb points and also equals the boundary for the whole cylinder.

If one row misses BB, the strongly connected component argument in Lemma 23.11 still applies with bb deleted points. One component contains all but at most b(2b+1)Kb(2b+1)\le K vertices, including the deleted points in the exceptional count. The outgoing-closed set RR either contains or avoids that component, contrary to the two strict size bounds. Thus every row contains exactly one boundary point, say cic_i. Horizontal bidirectionality shows that a row of RR is empty, a prefix, a suffix, or the entire row except its boundary point.

For two adjacent rows, the difference of their row sets is a union of at most two integer intervals. At a column where a rung points from the first row to the second, such a difference can contain only the second row’s boundary point. It therefore has at most one point of that column parity. A union of at most two intervals with this property has at most four points. Applying this in both directions gives RiRi+14,Ri+1Ri4.|R_i\setminus R_{i+1}|\le4,\qquad |R_{i+1}\setminus R_i|\le4. An empty row would now imply R4b2|R|\le4b^2, by propagating the bound through all rows. A row full except at its boundary similarly implies hRb(1+4(b1))4b2h-|R|\le b(1+4(b-1))\le4b^2. Both are excluded.

Suppose an adjacent prefix and suffix have lengths uu and vv. Their two differences have sizes min(u,nv)\min(u,n-v) and min(v,nu)\min(v,n-u), both at most four. The hypotheses give n>8n>8. If either length exceeds four, both lengths are at least n4n-4; otherwise both are at most four. Propagation through all rows again makes either RR or its complement have size at most KK. Hence all rows have the same orientation, and their cuts are interior.

Every column strictly between two adjacent cuts has one rung endpoint inside RR and its other endpoint outside both RR and BB. Its rung must therefore point into RR. Alternating directions permit at most one such column, proving the cut bound and parity condition. Conversely, for the spanning rectangle these conditions give exactly the indicated boundary: horizontal edges reach every cut, and no rung reaches another outside point. Extra transverse edges impose only further restrictions on these same bounded-width patterns. ◻

The cuts have total range at most 2(b1)2(b-1); for subsequent spatial margins use the larger value v=2b+2v=2b+2. For a prefix survivor with cuts (ci)(c_i), the next matched belief consists of prefixes of lengths ci+1c_i+1. A following prefix survivor with cuts (ei)(e_i) is possible precisely when eici+1e_i\le c_i+1, and its useful inspection count is p=i=0b1(ci+1ei). p=\sum_{i=0}^{b-1}(c_i+1-e_i). (131) At p=mp=m its sum of cuts decreases by dd. The suffix case is reflected and its sum increases by dd. An orientation cannot change between two such bulk survivors: the next belief of a prefix survivor omits the last column in every row, whereas every nonempty suffix contains it.

Only boundedly many days can behave differently

Consider an optimal strategy on a sufficiently long cylinder, and set C=h2Km>d,ψ(k)=min{C,(kKm)+}.C=h-2K-m>d,\qquad \psi(k)=\min\{C,\left(k-K-m\right)_+\}. The argument proving Theorem 23.10, with the larger cutoff K=4b2K=4b^2, gives for a cohort receiving pp useful inspections and changing from count kk to kk', ψ(k)ψ(k)max{0,pb}. \psi(k)-\psi(k')\le\max\{0,p-b\}. (132) The two cohorts start with total potential 2C2C and end with zero. Their combined daily decrease is at most dd. The height upper bound Tm2b(n+2)/dT_m\le2\left\lceil b(n+2)/d\right\rceil consequently gives dTm2CB,B=4K+4m+2b2. dT_m-2C\le B, \qquad B=4K+4m+2b-2. (133) Indeed the integer ceiling bound gives dTm2b(n+2)+2d2dT_m\le2b(n+2)+2d-2.

Call a day efficient when its total potential loss is exactly dd. Every other day contributes at least one to the nonnegative integer slack in (133), so at most BB days are inefficient. Potential increases contribute additional slack and cause no exception. Equality forces all mm useful inspections to be assigned to one cohort, called the day’s owner: any nontrivial split makes the sum of the two positive-part bounds in (132) strictly less than dd.

On an efficient day the owner loses potential dd, while its untouched mate has constant potential. The owner’s source potential is positive, so its survivor count rr exceeds KK. Its target potential is below CC, so its next count, and therefore rr, is below hKh-K. The interior expansion bound gives raw count loss at most mb=dm-b=d. Clipping cannot increase a positive loss; equality forces exactly mm useful inspections, raw count loss dd, and survivor surplus exactly bb. Thus every efficient owner survivor has the form in Lemma 24.3.

An untouched cohort with potential strictly between zero and CC cannot have constant potential: its actual count lies in the interior range and its neighborhood grows. The mate of an efficient owner therefore has potential zero or CC. A consecutive run of efficient days has at most two owner blocks. Once a cohort has owned a day its potential is below CC; if ownership switches, that cohort can remain unchanged only at zero, from which it cannot subsequently lose another dd in the run. There are consequently at most 2(B+1)2(B+1) owner blocks.

The matching-contracted graph is strongly connected for n2n\ge2: neighboring pairs of columns allow movement in both rung directions, and rows are bidirectional. Every proper nonempty untouched support therefore grows by at least one room per day. Put L=K+m+1L=K+m+1. An untouched nonempty mate with zero potential cannot stay in that collar for LL days, while an untouched mate with potential CC has deficit at most KK and becomes full within KK days. Mark every inefficient day and the first LL days of every owner block as nonclean. Their total number is at most E=B+2L(B+1). E=B+2L(B+1). (134) On each remaining clean day the mate is globally full or empty. A maximal clean block has one owner, a fixed frontier orientation, and both its owner beliefs and survivors have bounded-width descriptions: its first belief is already the neighborhood of the preceding efficient survivor. By (131), its average cut moves at the constant speed d/bd/b toward clearance. Individual cuts need not move monotonically.

A physical interval protected from all exceptional behavior

At the start of every consecutive block of nonclean days, mark the preceding clean frontier’s bb cut columns, if there is one. Initially the board is full, so no cuts need be marked. Also mark every actual inspection column on every nonclean day, and the two board ends. There are at most b(E+1)+mE+2F,F=(b+m)(E+1)+2b(E+1)+mE+2\le F,\qquad F=(b+m)(E+1)+2 marked columns. Enlarge each mark by radius ρ=E+2b+m+2\rho=E+2b+m+2. Outside these intervals, each cohort is locally full or empty throughout every nonclean block. At its start, all cuts are far away. During its at most EE days there are no nearby inspections, and movement propagates information by at most one longitudinal column per day. An empty region thus stays empty in the protected interior. A full region stays full using the matching inside each column. This proves the assertion for all intermediate states as well as the endpoints, even if remote shots create arbitrary holes elsewhere.

For any prescribed WW, the inequality n>F(2ρ+1)+(F+1)(W+2v+4) n>F(2\rho+1)+(F+1)(W+2v+4) (135) provides an unmarked interval of length at least W+2v+4W+2v+4. Trim v+2v+2 columns from each end and call the retained interval JJ; it has length at least WW.

A clean block has its endpoint frontiers outside the untrimmed interval: the preceding nonclean block ends uniformly there, and the cuts preceding the following nonclean block were marked. Its average frontier moves strictly toward clearance, with cut range at most vv. Consequently it can change its owner’s status on JJ only from full to empty, through a single complete passage. If its endpoint statuses agree, trimming removes any partial excursion onto JJ. It cannot start empty and end full, since that would move the average across the interval in the wrong direction. Nonclean blocks preserve the local status. Since each cohort starts full on JJ and ends empty there, each has exactly one clean crossing. These crossings occur at disjoint times; during either one the other cohort is globally full or empty.

Connecting physical cutoff frontiers

A direct height descent connects any compatible endpoints once the duration exceeds a short bound. This supplies the replacement segments needed for the exact period, without enumerating frontier states.

Put A=2bA=2b and D=2mA=2dD=2m-A=2d. For a left frontier, let ava_v be the last occupied physical longitudinal coordinate in the fiber over vQv\in Q. The two cutoffs in transverse matched pair ii are ci1c_i-1 and ci2c_i-2, in the order required by parity. Its actual next neighborhood advances both by one. A transverse edge uvuv consequently forces auav+1a_u\le a_v+1, and reversing the edge gives the opposite inequality. Their parities differ, so auav=1on every edge uv of Q. |a_u-a_v|=1\qquad\hbox{on every edge }uv\hbox{ of }Q. (136) This includes every extra transverse edge. Inside the protected crossing, all fiber cutoffs are far from both longitudinal ends. Conversely, any such interior prefix configuration satisfying (136) has neighborhood cutoffs exactly av+1a_v+1: longitudinal movement supplies them and transverse edges supply nothing larger. Right frontiers use reflected coordinates.

Lemma 24.4 (Height endpoints). Let QQ be connected and bipartite, with A2A\ge2 vertices and diameter RR. Fix m>A/2m>A/2 and put D=2mAD=2m-A. Let a,ba,b be integer height configurations satisfying (136). If tAR/m,bvav+t(mod2)for every v,vavvbv=Dt,t\ge\left\lceil AR/m\right\rceil,\qquad b_v\equiv a_v+t\pmod2\quad\hbox{for every }v, \qquad \sum_v a_v-\sum_v b_v=Dt, then tt global additions of one, each followed by mm legal local maximum flips, take aa to bb. At completed days the mean height moves steadily between the endpoint means. All intermediate cutoffs, including partial inspection steps, lie in [μ(b)R, μ(a)+R+1],μ(x)=A1vxv.[\mu(b)-R,\ \mu(a)+R+1],\qquad \mu(x)=A^{-1}\sum_v x_v. Whenever this interval lies inside the cylinder’s interior, these operations are actual movements and mm useful inspections per day.

Proof. This is a corollary of the exact quota-word criterion in Lemma 12.2. Put c=bt1c=b-t\mathbf1. Its mean difference from aa is 2mt/A-2mt/A. Edgewise height differences bound the range of cac-a by 2R2R, so for every vertex cvav2mt/A+2R0.c_v-a_v\le-2mt/A+2R\le0. Thus ba+t1b\le a+t\mathbf1 and the number of required lowerings in that lemma is exactly mtmt. Its movement-first construction gives mm useful lowerings after each of the tt additions.

Every completed day lowers the mean by D/AD/A. A configuration has range at most RR, so its completed-day cutoffs lie between μ(b)R\mu(b)-R and μ(a)+R\mu(a)+R. Movement can raise the upper bound by one; subsequent lowerings descend coordinatewise to the next survivor. This proves the displayed movement-first margin, including partial inspection steps. Within a physical interior, all lowerings remove actual distinct rooms and the global additions are exact neighborhoods. ◻

Set g=gcd(A,D)g=\gcd(A,D), 0=2A/g\ell_0=2A/g, and Δ=2D/g\Delta=2D/g. These are even integers satisfying AΔ=D0A\Delta=D\ell_0. Suppose a clean survivor path from aa to bb has length tAR/m+0t\ge\left\lceil AR/m\right\rceil+\ell_0. After deleting Δ\Delta columns, a left crossing requires endpoints aΔ1,ba-\Delta\mathbf1,b. Their sum difference is D(t0)D(t-\ell_0) and their phase difference is t0t-\ell_0, since both shifts are even. Lemma 24.4 supplies a path of exactly that shorter length. For insertion use endpoints a+Δ1,ba+\Delta\mathbf1,b and duration t+0t+\ell_0. Reflection handles right frontiers. The mean and range bound controls each replacement inside the protected physical band, independently of the old path’s details.

For the present even-order case, 0=2bgcd(b,d),Δ=2dgcd(b,d),K0=2b(2b1)m. \ell_0=\frac{2b}{\gcd(b,d)},\qquad \Delta=\frac{2d}{\gcd(b,d)},\qquad K_0=\left\lceil\frac{2b(2b-1)}{m}\right\rceil. (137) Here are conservative explicit margins that guarantee such a path well inside the protected interval. Set U=K0+0+4,W=2(Δ+v+m+3)+d(U+4)b+2v+2m+10.\begin{aligned} U&=K_0+\ell_0+4,\nonumber\\ W&=2(\Delta+v+m+3) +\left\lceil\frac{d(U+4)}b\right\rceil+2v+2m+10. \end{aligned}(138) In a complete crossing, take the central segment after its average cut has entered JJ with margin Δ+v+m+3\Delta+v+m+3, and before it leaves at the opposite margin. Its average advances by d/bmd/b\le m per edge, so entry and exit overshoots lose at most 2m2m of spatial length. The remaining travel exceeds dU/bdU/b, providing more than UU edges. Every cut is within vv of the average, so the entire segment stays more than Δ\Delta from the ends of JJ. Its endpoint frontiers lie on opposite sides of a central interval of Δ\Delta columns. These margins also cover the entry and exit edges.

For definiteness, one may take N=4+2K+m+d+1b+F(2ρ+1)+(F+1)(W+2v+4)+Δ. N=4+\left\lceil\frac{2K+m+d+1}{b}\right\rceil +F(2\rho+1)+(F+1)(W+2v+4)+\Delta. (139) This ensures C>dC>d, the protected-gap condition, and the same conditions after contracting by Δ\Delta. All constants depend only on bb and mm.

Deleting and inserting the common interval

Start with an optimal strategy on a cylinder long enough for the preceding construction. Delete Δ\Delta consecutive columns from the center of JJ. Outside the two central crossing segments, map rooms and inspections by ordinary column deletion. No nonclean inspection is lost. Every nonclean state is uniformly full or empty near the join, so neighborhood formation commutes with the deletion there. Other clean frontiers are entirely on one side of the join, and their transitions are either left fixed or translated as a whole by the even displacement Δ\Delta.

Within each central crossing, replace its tt-edge path by the (t0)(t-\ell_0)-edge path in Lemma 24.4. For a prefix frontier the new initial cutoffs are Δ\Delta lower and the final cutoffs are the old ones, matching the natural column map at both endpoints. For a suffix frontier use the reflected construction. The mean of the replacement decreases steadily between the mapped endpoint means, and its range is at most 2b12b-1. The chosen margins therefore keep every intermediate cutoff inside the shorter board. Every new daily edge is an actual movement followed by at most mm inspections.

The mate is globally full or empty during this operation. Deleting an even number of days and columns preserves its phase and state. The two crossings are disjoint in time, so their edits do not interfere. An edge is one subsequent inspection day, hence exactly 0\ell_0 days have been removed in each crossing. All remaining inspections respect the original budget. We have proved Tm(QPnΔ)Tm(QPn)20. T_m(Q\mathbin{\square}P_{n-\Delta})\le T_m(Q\mathbin{\square}P_n)-2\ell_0. (140)

For the reverse inequality, prepare an optimal strategy on the shorter, still sufficiently long cylinder and insert Δ\Delta columns in its protected interval. Extend the locally full or empty regions across the inserted band and translate the far-side rooms. Within each crossing, use Lemma 24.4 to replace its tt days by t+0t+\ell_0 days. A prefix frontier starts shifted right by Δ\Delta and ends at the old final cutoff; reflect this for a suffix. The same local transition and margin arguments apply. The full or empty mate returns to its phase, and the total added time is 202\ell_0. Therefore Tm(QPn)Tm(QPnΔ)+20. T_m(Q\mathbin{\square}P_n)\le T_m(Q\mathbin{\square}P_{n-\Delta})+2\ell_0. (141) Combining (140) and (141), and using 20=2bΔ/d2\ell_0=2b\Delta/d, proves Theorem 24.2 for every nNn\ge N after renaming the shorter length nn. The even displacement preserves either longitudinal parity throughout.

Odd-order cross-sections: geometry in paired columns

When the cross-section has odd order, there is no transverse perfect matching. At even longitudinal lengths we instead match consecutive columns. This changes the smallest bulk expansion from a constant cost to two alternating costs. A single bit recording the previous expansion will recover constant progress.

Theorem 24.5. Let QQ be a finite bipartite graph with a Hamiltonian path and A=2b+13A=2b+1\ge3 vertices. Fix an integer mb+1m\ge b+1 and put D=2mAD=2m-A. Put g=gcd(A,D)g=\gcd(A,D) and Δ=2D/g\Delta=2D/g. There is an effective positive integer NN such that Tm(QPn+Δ)=Tm(QPn)+4A/gT_m(Q\mathbin{\square}P_{n+\Delta}) =T_m(Q\mathbin{\square}P_n)+4A/g for every even nNn\ge N.

Write n=2Ln=2L and let X,YX,Y be the bipartition of QQ, with X=b+1|X|=b+1 and Y=b|Y|=b. A Hamiltonian path ensures these color sizes. Match columns 2j2j and 2j+12j+1. Each cohort now identifies with an A×LA\times L array of vertices (v,j)(v,j), one for each vV(Q)v\in V(Q) and paired-column index jj. The contracted graph has loops, bidirectional QQ-edges within every layer, and opposite one-way longitudinal flows on the two QQ colors. Choose phase zero so that XX fibers flow left and YY fibers flow right; phase one reverses both flows. There is no dependence on jj. The ordinary neighborhood surplus is again the cardinality of the directed outside boundary. Throughout the paired-column argument put h=ALh=AL and K=A2K=A^2.

Lemma 24.6 (Minimum surplus in paired columns). Every survivor RR with K<R<hKK<|R|<h-K has surplus at least bb. If its surplus equals bb, then in phase zero all fibers are left prefixes. Across each QQ-edge xyxy, xX,yYx\in X,y\in Y, the XX prefix has the same length as the YY prefix or is one position longer. In phase one the reflected statement holds, with right suffixes. Every fiber has at least two occupied and two unoccupied positions. Two consecutive middle survivors in an actual strategy cannot both have surplus bb.

Proof. Let BB be the outside boundary, of size sbs\le b. If one XX fiber and one YY fiber both avoid BB, all completely undeleted QQ layers lie in one strongly connected component of the graph with BB deleted. Each layer is strongly connected, and the two untouched, oppositely directed fibers connect these layers in both longitudinal directions. At most ss layers contain a boundary point, so this component contains all but at most As<KAs<K vertices, counting the deleted layers among the exceptions. The outgoing-closed set RR either contains or avoids the component, contradicting its middle size. There is at least one undeleted layer: h>2A2h>2A^2 implies L>2A>bL>2A>b.

If s<bs<b, both colors have an untouched fiber, a contradiction. If s=bs=b, there is still an untouched XX fiber, so every YY fiber must contain a boundary point. Thus BB consists of exactly one point (y,cy)(y,c_y) on each YY fiber, and no points on XX fibers.

In phase zero, the boundary-free XX fibers flow left and are prefixes. Bidirectional QQ-edges give, for every edge xyxy, RyRx,RxRy{cy}.R_y\subseteq R_x,\qquad R_x\setminus R_y\subseteq\{c_y\}. Adjacent cardinalities differ by at most one. Connectivity bounds the global range of fiber sizes by A1A-1. Both the average size and average complement size exceed AA, so each fiber has at least two occupied and two unoccupied positions. If Rx={0,,k1}R_x=\{0,\ldots,k-1\}, the inclusions make RyR_y either that prefix or that prefix with its boundary point removed. Removing a point strictly below k1k-1 would leave k1k-1 occupied; its right-going edge would then make kk a second boundary point. Thus Ry={0,,cy1},k{cy,cy+1}.R_y=\{0,\ldots,c_y-1\},\qquad k\in\{c_y,c_y+1\}. This proves the prefix description. Reflection proves the phase-one statement.

The next belief of a phase-zero minimum-surplus frontier leaves its XX lengths unchanged and increases each YY length by one. It still omits position L1L-1 in every fiber. A phase-one minimum-surplus middle survivor would be a nonempty right suffix in every fiber, hence could not be contained in that belief. Reflection handles the other direction. ◻

Lemma 24.7 (The intervening frontier). Suppose RR is a phase-zero middle survivor of surplus bb, and a phase-one middle survivor SN(R)S\subseteq N(R) has surplus b+1b+1. Then all fibers of SS are left prefixes. Across each QQ-edge, its YY prefix has the same length as its XX prefix or is one position longer. The reflected assertion holds with both orientations reversed.

Proof. For any support with boundary BB, a QQ-edge gives SuSvBvS_u\setminus S_v\subseteq B_v. Following a simple QQ path shows that any two fiber cardinalities differ by at most B|B|: its target fibers are distinct, so their boundary counts sum to at most B|B|. At B=b+1|B|=b+1, an empty fiber would give SA(b+1)<A2|S|\le A(b+1)<A^2, contrary to the middle-size hypothesis. Every fiber is nonempty.

The containment SN(R)S\subseteq N(R) ensures that all fibers omit L1L-1. In phase one, each XX fiber flows right. If such a fiber had no boundary point, its nonempty set would be right-closed and would contain L1L-1. Hence each of the b+1b+1 XX fibers meets BB. They exhaust the boundary, leaving no boundary point on any YY fiber. The latter flow left and are prefixes. Applying the same bidirectional-edge and endpoint argument as in Lemma 24.6, with X,YX,Y exchanged, proves that the XX fibers are prefixes as well, with the stated length relation. Reflection gives the other orientation. ◻

Both frontier families have finitely many relative-length patterns. Their length range is at most A1A-1, and choosing the zero-or-one length differences along a spanning tree gives at most 2A12^{A-1} patterns for fixed phase and orientation. Extra edges impose consistency conditions on these patterns.

A history bit and the paired-cylinder period

For each cohort, define et=1e_t=1 precisely when its preceding day’s survivor was in the strict middle range and had surplus bb; otherwise set et=0e_t=0. Initially e0=0e_0=0. If its before-inspection count is ktk_t, use the raw rank 2kt+et2k_t+e_t. Let pp be its useful inspection count, so the current survivor has size r=ktpr=k_t-p, surplus ss, and next count kt+1=r+sk_{t+1}=r+s. The raw loss is (2kt+et)(2kt+1+et+1)=2p2s+etet+1. (2k_t+e_t)-(2k_{t+1}+e_{t+1}) =2p-2s+e_t-e_{t+1}. (142) For a middle survivor with s=bs=b, Lemma 24.6 gives (et,et+1)=(0,1)(e_t,e_{t+1})=(0,1), so the loss is 2pA2p-A. If sb+1s\ge b+1, the new bit is zero and the old bit at most one, again giving loss at most 2pA2p-A.

Set L0=2(K+m)+1,C=2h4K2m1>D,ψt=min{C,(2kt+etL0)+}.L_0=2(K+m)+1,\qquad C=2h-4K-2m-1>D, \qquad \psi_t=\min\{C,\left(2k_t+e_t-L_0\right)_+\}. A survivor of size at most KK gives source rank at most L0L_0, hence source potential zero. A survivor of size at least hKh-K gives next rank at least 2h2K=L0+C2h-2K=L_0+C, hence target potential CC, by the longitudinal matching. Clipping and (142) therefore give, in every case, ψtψt+1max{0,2pA}. \psi_t-\psi_{t+1}\le\max\{0,2p-A\}. (143) For the two useful allocations p+qmp+q\le m, the sum of these charges is at most DD, with equality only if all mm useful inspections belong to one cohort.

Both initial potentials equal CC. The height upper bound T2A(n+2)/DT\le2\left\lceil A(n+2)/D\right\rceil and its integer ceiling estimate imply DT2CB,B=8K+8m+2A.DT-2C\le B, \qquad B=8K+8m+2A. Thus at most BB days have total potential loss below DD. On every efficient day the owner has positive source potential and target potential below CC, which force its survivor into the strict middle range. Equality in the clipped loss then forces equality in (142). The only cases are (s,et,et+1)=(b,0,1)or(b+1,1,0). (s,e_t,e_{t+1})=(b,0,1)\quad\hbox{or}\quad(b+1,1,0). (144) The first survivor is a frontier by Lemma 24.6. In the second case the preceding survivor was a middle minimum-surplus frontier, so the actual containment in its neighborhood permits Lemma 24.7. Both efficient phases therefore have physical frontiers.

The paired contraction is strongly connected for L2L\ge2. An untouched proper nonempty cohort grows by at least one room each day, while its history bit can drop by at most one. Its raw rank therefore increases by at least one, so its potential cannot remain constant strictly between zero and CC. The owner-block argument in Section 24.2 applies unchanged. There are at most 2(B+1)2(B+1) owner blocks. The zero-potential collar has at most K+mK+m possible rooms and the full-potential collar has deficit at most KK. Marking the first L1=K+m+1L_1=K+m+1 days of every owner block, as well as every inefficient day, leaves at most E=B+2L1(B+1) E=B+2L_1(B+1) (145) nonclean days. On each clean block the mate is globally full or empty, with bit zero, and the owner’s surpluses alternate b,b+1b,b+1. The frontiers have a fixed orientation throughout this block: the bridge preserves orientation, and the next minimum-surplus phase has the same orientation as the preceding minimum-surplus phase.

There is a timing distinction when the graph vertices are survivors. At such a vertex write ee for the newly set bit, referring to that survivor itself. If consecutive survivor sizes are r,rr,r' and the first has surplus ss, then r=r+smr'=r+s-m. Their constant-drift rank is 2re2r-e, rather than the before-inspection rank 2k+e2k+e: (2re)(2re)=D (2r-e)-(2r'-e')=D (146) in both alternating cases (s,e,e)=(b,1,0)(s,e,e')=(b,1,0) and (b+1,0,1)(b+1,0,1). The ordinary average occupied length is nonincreasing and may be stationary for one round when m=b+1m=b+1. Its corrected version (2re)/(2A)(2r-e)/(2A) decreases by exactly D/(2A)D/(2A) per edge and differs from it by at most 1/(2A)1/(2A). Use the enlarged margin v=A+2v=A+2 to cover this correction, the fiber range, and the direct height replacements.

These frontiers are also physical height configurations. If lvl_v is the occupied paired-column length and σv{0,1}\sigma_v\in\{0,1\} its physical longitudinal parity, then av=2(lv1)+σv.a_v=2(l_v-1)+\sigma_v. In either phase, the boundary-free color has parity zero and its length equals its neighbor’s length or exceeds it by one. Hence auav=1|a_u-a_v|=1 across every QQ-edge. The bridge lemma ensures this on the intervening phase as well. For a left frontier the sum of the parity indicators is b+1eb+1-e, so the sum of physical heights differs from 2re2r-e by a constant. The drift in (146) is therefore the same physical height drift used in Lemma 24.4.

Apply that lemma with g=gcd(A,D)g=\gcd(A,D) and the conservative diameter bound A1A-1. We may use K0=A(A1)m,0=2A/g,δ=D/g,Δ=2δ. K_0=\left\lceil\frac{A(A-1)}m\right\rceil,\qquad \ell_0=2A/g,\qquad \delta=D/g,\qquad \Delta=2\delta. (147) A crossing of length at least K0+0K_0+\ell_0 can be replaced by one shorter by 0\ell_0 days, shifting the initial endpoint by δ\delta paired columns, or by one longer by 0\ell_0 with the opposite shift. The construction connects actual physical height endpoints, without an additional assumption about intermediate survivor shapes.

We spell out the changes to the protected-band argument to ensure that this is a physical reduction. Mark the paired-column index of every nonclean inspection and the initial frontier cuts of every nonclean block. Together with the ends there are at most F=(A+m)(E+1)+2F=(A+m)(E+1)+2 marks. A physical move crosses at most one pair boundary, so radius ρ=E+2A+m+2\rho=E+2A+m+2 shields all nonclean blocks. Local full preservation uses the longitudinal matching inside each pair; it requires no perfect matching in the odd-order graph QQ. Local empty preservation follows from finite propagation. Thus the argument of Section 24.3 applies in the paired coordinate. Choose a raw gap of length W+2v+4W+2v+4 and trim v+2v+2 at each end. The corrected mean, its nonzero speed, and the margin vv give one complete clean crossing per cohort through the retained band. Their mates are globally full or empty and the crossings are disjoint in time.

Explicit constants are obtained by putting U=K0+0+4,W=2(δ+v+m+3)+D(U+4)2A+2v+2m+10,L=4+4K+2m+1+D2A+F(2ρ+1)+(F+1)(W+2v+4)+δ,\begin{aligned} U&=K_0+\ell_0+4,\nonumber\\ W&=2(\delta+v+m+3) +\left\lceil\frac{D(U+4)}{2A}\right\rceil+2v+2m+10,\nonumber\\ L_*&=4+\left\lceil\frac{4K+2m+1+D}{2A}\right\rceil +F(2\rho+1)+(F+1)(W+2v+4)+\delta, \end{aligned}(148) and taking N=2LN=2L_*. The corrected mean moves by D/(2A)mD/(2A)\le m per edge, so the entry and exit overshoots cost at most 2m2m paired positions. The stated WW leaves at least UU edges in a central path, with its endpoints on opposite sides of a δ\delta-pair band and all intermediate cuts more than δ\delta from the outer edges. The threshold ensures C>DC>D, the raw gap, and the same conditions after contraction.

Delete that central band of δ\delta pairs and replace each central crossing by the walk shorter by 0\ell_0 supplied by Lemma 24.4. Start a left frontier shifted by δ-\delta pairs, equivalently Δ-\Delta physical columns; its new endpoint is exactly the old endpoint. Reflect this for a right frontier. Every new edge is a valid physical-height transition, and the constant mean drift and bounded range keep its filled-tail configuration interior. Outside the crossings, neighborhood formation commutes with the natural column map because the protected neighborhood is uniformly full or empty, including every nonclean intermediate state. No nonclean inspection is deleted. The mate’s full or empty state is preserved; the removed time is even, and paired-column translation preserves phase. As survivor edges count the following inspection, exactly 0\ell_0 days are removed per cohort. This proves Tm(QPnΔ)Tm(QPn)20.T_m(Q\mathbin{\square}P_{n-\Delta})\le T_m(Q\mathbin{\square}P_n)-2\ell_0. Starting instead from a sufficiently long shorter board, insert the same number of pairs and use the longer endpoint connection to add 0\ell_0 days to each crossing. The same filled-tail, endpoint, and mate arguments prove the reverse inequality, exactly as in Section 24.5. Since 20=2AΔ/D2\ell_0=2A\Delta/D, this proves Theorem 24.5 on every sufficiently long even cylinder, with the displayed effective threshold.

Combining the parity classes

Proof of Theorem 24.1. Every transverse box has a Hamiltonian path by the snake construction used in Theorem 23.8. If A2A\ge2 is even, Theorem 24.2 already supplies the asserted recurrence for both longitudinal parities. If A3A\ge3 is odd, every nontrivial transverse side is odd. Theorem 22.3 applies to odd longitudinal lengths, while Theorem 24.5 applies to even lengths. Both give exactly the same even period Δ=2(2mA)/gcd(A,2mA)\Delta=2(2m-A)/\gcd(A,2m-A) and the same increment 4A/gcd(A,2mA)4A/\gcd(A,2m-A). Taking the larger threshold proves the common recurrence on both parity classes.

If A=1A=1, the cylinder is a path. For m=1m=1 the formula T1(Pn)=2n4T_1(P_n)=2n-4, n3n\ge3, gives period two and increment four. For m2m\ge2, take Δ=2(2m1)\Delta=2(2m-1) and N=m+1N=m+1 in (1). This changes its ceiling by four and preserves both the exceptional congruence and the parity correction, giving the required increment 2Δ/(2m1)=42\Delta/(2m-1)=4.

For A2A\ge2 and integer mA/2m\le A/2, Theorem 23.8 gives impossibility whenever n2A/2n\ge2\left\lfloor A/2\right\rfloor. If A=1A=1, the only such budget is zero; no target on a nonempty path can be captured without an inspection.

For completeness the displayed sufficient time thresholds are polynomial. With X=A+m+1X=A+m+1, their definitions give K,B,L1=O(X2)K,B,L_1=O(X^2), E=O(X4)E=O(X^4), F=O(X5)F=O(X^5), and ρ=O(X4)\rho=O(X^4). Because m>A/2m>A/2, we have K02(A1)K_0\le2(A-1) and 02A\ell_0\le2A, so U=O(A)U=O(A) and W=O(X)W=O(X). The dominating threshold term FρF\rho is O(X9)O(X^9). For the earlier odd-length box theorem, S=i(ni1)A1S=\sum_i(n_i-1)\le A-1, hence its corner bound satisfies Z=A(S+1)A2Z=A(S+1)\le A^2. Substitution into (111) also gives a polynomial bound, dominated by O(X9)O(X^9). The path threshold is smaller. Taking the larger parity threshold thus preserves a uniform polynomial sufficient bound. ◻

At the eventual minimum budget m=A/2+1m=\left\lfloor A/2\right\rfloor+1, the period is two. The time increase on adding two columns is 2A2A when AA is even and 4A4A when AA is odd. The polynomial onset bound is sufficient, not a claim of the earliest length at which this recurrence holds.

The theorem fixes the entire cross-section and the budget while the last side grows. It does not supply the smallest period, the finite exception values, or a simple formula for every arbitrary finite box. The proof covers every transverse box; for a general odd-order Hamiltonian graph the new paired-column theorem only asserts the even-length case. These eventual-period results have ordinary proofs and independent review, rather than complete Lean formalizations.

Exact finite interfaces for even-area cylinders

The efficient-frontier arguments yield more than an eventual formula. They identify an exact finite collection of local search problems. The symbolic height theorem then evaluates every connection through the interior directly, leaving a graph of bounded size. Arbitrary intermediate supports are retained inside the boundary problems; a daily pyramid normal form is not assumed.

Theorem 25.1 (An exact finite-interface representation). Let QQ be a fixed finite bipartite graph with a Hamiltonian path, with A2A\ge2 vertices, and fix an integer m>A/2m>A/2. For every positive nn such that AnAn is even, the following construction determines the exact value Tm(QPn)T_m(Q\mathbin{\square}P_n) and an optimal physical strategy.

After an effective finite preprocessing depending only on Q,mQ,m, the value is obtained using OQ,m(1)O_{Q,m}(1) integer arithmetic stages on OQ,m(log(n+1))O_{Q,m}(\log(n+1))-bit integers. Its final graph has boundedly many vertices depending only on Q,mQ,m. Every vertex has at most one proper cohort, which is a physical pyramid; its mate is full or empty. Boundary edges are actual search blocks of bounded duration, retaining arbitrary nonpyramidal behavior in bounded longitudinal slabs. Interior edges have the exact symbolic costs in (55) and admit physical pyramid realizations. The sufficient size threshold and all bounds are explicit below.

The calculation gives a compressed description of an optimal strategy. Expanding it into individual inspections additionally costs its output length. No small bound on the parameter-dependent preprocessing is asserted.

For rectangles this covers every even-area board with both sides at least two, at every feasible budget, by choosing the shorter path as QQ. The one-row case is already solved. Theorem 7.1 covers odd-area rectangles. These are uniform exact algorithms; the closed formulas in earlier sections remain useful explicit evaluations in their stated budget ranges.

This theorem is a geometric strengthening, rather than an asymptotic speed claim over an eventual-period formula with its entire finite prefix precomputed. It specifies the exact local transition problems and a physical strategy reconstruction. The finite preprocessing described here is a mathematical construction, not a claimed implemented generic compiler.

Put α=A/2\alpha=\left\lceil A/2\right\rceil and define K=A2,B=8A2+8m+2A,E=B+2(K+m+1)(B+1),L=E+1,q=(m+α)L,R=100(q+A2+L+A+1),n0=10R.\begin{aligned} K&=A^2,& B&=8A^2+8m+2A,\nonumber\\ E&=B+2(K+m+1)(B+1),& L&=E+1,\nonumber\\ q&=(m+\alpha)L,& R&=100(q+A^2+L+A+1),\qquad n_0=10R. \end{aligned}(149) These constants depend only on A,mA,m. We prove the result for nn0n\ge n_0. Every smaller admissible length is a finite exception, determined by the ordinary exact belief recurrence. The displayed threshold dominates the clipping guards in both parity cases of Section 24, and gives An/2>mLAn/2>mL.

Physical pyramids, including the end boundaries

Index QQ by a Hamiltonian order 0,,A10,\ldots,A-1, so its bipartition is the parity of this index. A downward pyramid is a one-color set PP such that (v,y)P,y>0,uvE(Q)(u,y1)P.(v,y)\in P,\quad y>0,\quad uv\in E(Q) \quad\Longrightarrow\quad (u,y-1)\in P. An upward pyramid is its longitudinal reflection. Empty and full color classes are allowed in either orientation. For current color pp, put sv=(pv)mod2s_v=(p-v)\bmod2. A downward pyramid has a spacing-two prefix in each fiber. If that prefix has kvk_v rooms, its virtual last height is av=sv2+2kv.a_v=s_v-2+2k_v. The predecessor condition is equivalent to 2avn1,avpv(mod2),auav=1(uvE(Q)). -2\le a_v\le n-1,\qquad a_v\equiv p-v\pmod2, \qquad |a_u-a_v|=1\quad(uv\in E(Q)). (150) The values 2,1-2,-1 handle empty fibers. Two predecessor moves give spacing-two closure, and the higher cutoff forces the required adjacent predecessor; this proves both directions, including the bottom row. Along the Hamiltonian path the heights form a ±1\pm1 walk, so their range is at most A1A-1 and there are at most (n+2)2A1(n+2)2^{A-1} downward pyramids of each color. Extra edges of QQ impose additional conditions on these walks.

Neighborhoods preserve this family at the physical ends. Indeed, let (v,y)N(P)(v,y)\in N(P), y>0y>0, and consider its predecessor (u,y1)(u,y-1). A witnessing neighbor (v,y1)P(v,y-1)\in P is already adjacent to that predecessor. A witness (v,y+1)P(v,y+1)\in P supplies (u,y)P(u,y)\in P. A transverse witness (z,y)P(z,y)\in P supplies (v,y1)P(v,y-1)\in P. In all cases the required predecessor belongs to N(P)N(P).

Writing tvt'_v for the largest coordinate below nn of parity 1sv1-s_v, the exact neighborhood cutoff is η(a)v=max(hv,{au:uvE(Q)}),hv={(1sv)2,kv=0,min(av+1,tv),kv>0.\eta(a)_v=\max\bigl(h_v,\{a_u:uv\in E(Q)\}\bigr), \qquad h_v=\begin{cases} (1-s_v)-2,&k_v=0,\\ \min(a_v+1,t'_v),&k_v>0. \end{cases} In particular η(a)vav+1\eta(a)_v\le a_v+1. The simpler formula av+1a_v+1 alone need not be exact in an empty bottom fiber. A perfect matching of the cylinder is supplied by transverse Hamiltonian pairs when AA is even, or by longitudinal column pairs when AA is odd and nn is even. Thus every support SS satisfies N(S)S|N(S)|\ge|S|. The two fiber parity sums differ by at most one, giving 0N(P)Pα,PNr(P)P+αr. 0\le |N(P)|-|P|\le\alpha, \qquad |P|\le |N^r(P)|\le |P|+\alpha r. (151) Every Nr(P)N^r(P) has the same pyramid orientation.

A pyramid with at most uu rooms lies within 2u+A+22u+A+2 columns of its filled end. Its complement in its color class is an oppositely oriented pyramid, so the same bound locates a deficit of at most uu near the unfilled end. Finally, Lemma 11.2 bounds a pyramid with an empty physical fiber by HQA2H_Q\le A^2 rooms. The height range also confines it to an end band of width at most AA.

Canonical checkpoints of bounded separation

Call a full-board belief canonical if at most one cohort is nonempty and nonfull, that proper cohort is a pyramid, and its mate is full or empty. Initial full/full and final empty/empty beliefs are canonical.

The clean-day arguments already proved in Section 24 give the following interface. For even A=2bA=2b, the potential loss is at most mbm-b per day; every efficient owner survivor has surplus bb and is a physical pyramid by Lemma 24.3 and (136). For odd A=2b+1A=2b+1 and even nn, the history-bit potential has daily bound 2mA2m-A. Its two efficient cases are exactly (144). Surplus bb gives a pyramid by Lemma 24.6; surplus b+1b+1 also gives a pyramid by the actual containment hypothesis in Lemma 24.7. Thus both efficient phases have the physical height condition (150) on every QQ-edge.

The BB in (149) dominates the slack bound in both cases. At most BB days are inefficient, and there are at most 2(B+1)2(B+1) efficient owner blocks. Mark their first K+m+1K+m+1 days and all inefficient days. There are at most EE marked days. The proved untouched-cohort growth argument makes the mate literally full or empty on every remaining clean day, rather than merely placing it in a flat potential collar. Its source is the neighborhood of a preceding efficient pyramid, so both its source and successor are canonical.

Partition an optimal physical strategy at the sources of its clean days, also including the initial and terminal states. Following the last successful inspection by the empty movement step does not add a day. Every resulting block has duration at most E+1=LE+1=L: except for its possible first clean day, all intervening days are marked. If there are no clean days, the whole strategy has duration at most EE.

Consequently some optimum is a path of physical blocks of length at most LL between canonical states. Conversely every such concatenation is an actual strategy. No history bit is needed in its state: the bit establishes the existence of checkpoints in an optimum, whereas edge legality is checked on the physical supports themselves.

Localizing a physical transition

Lemma 25.2 (Exact endpoint localization). Suppose an rr-day block, rLr\le L, takes a one-cohort pyramid P0P_0 to a pyramid P1P_1, possibly of the opposite orientation. Set P2=Nr(P0)P_2=N^r(P_0) and D=P2P1D=P_2\setminus P_1. Then P1P2P_1\subseteq P_2 and D(m+α)r|D|\le(m+\alpha)r. Removing every inspection whose longitudinal distance from DD exceeds rr preserves the final support exactly. Moreover DD lies in an interval of at most 2(m+α)r+2A2+4A+42(m+\alpha)r+2A^2+4A+4 longitudinal columns.

Proof. The matching gives P1P0mr|P_1|\ge|P_0|-mr, while (151) bounds P2|P_2|, proving the cardinality claim. Removing inspections enlarges the final support. Any newly surviving walk must finish in DD, since its endpoint is freely reachable but not in P1P_1. Every earlier point of its rr-step walk is within longitudinal distance rr of DD. All original inspections that could hit it were retained, a contradiction. The endpoint is therefore unchanged.

For equal orientations, compare the two included height vectors of P1P2P_1\subseteq P_2. Each fiber’s cutoff difference is twice its contribution to D|D|, and the individual height ranges are at most A1A-1. This confines DD to at most 2D+2A+22|D|+2A+2 columns.

Suppose P2P_2 is downward and P1P_1 upward. If every fiber of P1P_1 is nonempty, it contains the topmost room of its color in each fiber, forcing P2P_2 to be full. Its difference DD is then the downward complement of P1P_1, of size at most (m+α)r(m+\alpha)r. Otherwise P1A2|P_1|\le A^2, whence P2A2+(m+α)r|P_2|\le A^2+(m+\alpha)r; this downward pyramid lies in the corresponding bounded initial band. Reflection handles the other case. Empty and full sets may be assigned either orientation. The stated bound covers all cases. ◻

Apply the lemma separately to the two initial-color cohorts. Their current colors are disjoint on every day, so the retained inspections still respect the shared daily quota. The lemma concerns actual avoiding walks, with no condition on intermediate support shapes.

It also gives an effective finite test for an edge. If II is the difference band, all shots lie in its rr-enlargement; only endpoints in its 2r2r-enlargement can be affected. Every rr-step walk to such an endpoint remains in the 3r3r-enlargement. Enumerate the daily shot sets there, simulate from the restricted initial support in the largest band, and compare final membership on the middle band. Outside that checked band the uninspected baseline already agrees with P1P_1. First reject an endpoint unless P1Nr(P0)P_1\subseteq N^r(P_0), an exact cutoff comparison. This proves an exact physical edge test, including the presence as well as absence of endpoint rooms.

Only one longitudinal coordinate remains

If the same cohort is proper at both ends with the same orientation, its cardinality changes between mr-mr and αr\alpha r. Height ranges are at most A1A-1, and the parity-sum correction is at most one. The two cutoff positions consequently differ by at most 2(m+α)r+4A+6<R2(m+\alpha)r+4A+6<R. Away from the board ends the localized block depends only on relative height shapes, bounded displacement, color, and duration. Translation by two columns preserves its complete physical test.

Every other possibility is confined to end collars. A proper cohort becoming empty has initial size at most mrmr; one becoming full has initial deficit at most αr\alpha r. A full cohort becoming proper has final deficit at most mrmr, while an empty cohort cannot become proper. For an orientation change, the two cases in Lemma 25.2 show either that both endpoint deficits are at most (m+α)r(m+\alpha)r, or that both sizes are at most A2+(m+α)rA^2+(m+\alpha)r. All their cutoffs are therefore in bounded end collars. A full mate ending full needs no inspections by the same localization lemma; a full mate cannot become empty in rLr\le L days because An/2>mLAn/2>mL.

An interior state is encoded by its physical color, orientation, mate status, a relative height walk, and z=(a0p)/2.z=(a_0-p)/2. For upward pyramids use the physical cutoff of their downward complement, so both orientations use the same longitudinal coordinate. Filter the Hamiltonian height walks by the additional QQ-edge conditions. This gives OA(n)O_A(n) canonical states. The preceding bounds give finitely many interior edge types of bounded displacement and finitely many boundary edge types. Opposite-end gadgets are tested together with the shared daily quota; for n10Rn\ge10R their movement cones cannot communicate within LL days. Their only dependence on length is the checkerboard parity at the far end.

Let Cn\mathcal C_n contain these states and all physical edges of duration 1,,L1,\ldots,L. It has OQ,m(n)O_{Q,m}(n) edges. Its shortest-path value from full/full to empty/empty is exactly TmT_m: an optimum supplies a path by the checkpoint argument, and every graph path expands to an actual strategy. Nonpyramidal intermediate supports are kept inside the finite edge tests, rather than projected away.

Finite ports and exact symbolic interior costs

Use the common homogeneous counter interval Rz(n22R)/2.R\le z\le\left\lfloor(n-2-2R)/2\right\rfloor. The first RR and last RR levels are called ports. Keep every vertex outside this interval, every port vertex, and all original boundary edges between retained vertices. There are only boundedly many of them depending on Q,mQ,m. The strict displacement bound <R<R ensures that an edge crossing between the interior and a boundary family meets a port. Retain the original edges joining the two remote boundary families, with their shared-quota tests; their legality depends only on the longitudinal parity once nn0n\ge n_0.

The proper cohort, its orientation, and its full or empty mate cannot change on an interior stretch: all such changes were confined to end collars above. Call these fixed data its sector. Endpoint physical colors may differ, and give the required duration parity. For every ordered pair of ports in the same sector, add a direct edge of weight t0t_0 from (55), using the proper cohort’s height vectors. Reflect longitudinal coordinates for an upward sector. The same construction includes connections returning to the same end.

We verify both directions of this replacement. Every original interior edge has duration rLr\le L. The large collar in (149) implies the height margins in (53), and its initial proper support has more than CA+mrC_A+mr rooms. Indeed its cutoff position is at least 2RA2R-A from its filled end, while R>100(mL+A2+L+A)R>100(mL+A^2+L+A). Theorem 12.3 therefore bounds that edge against arbitrary intermediate supports by zvav+r,vavvzv+Ar2mr.z_v\le a_v+r,\qquad \sum_v a_v-\sum_v z_v+Ar\le2mr. If its mate is full at both ends, omitting every mate inspection preserves that endpoint; an empty mate remains empty. Thus assigning the proper cohort the entire budget gives the relevant comparison. Summing these inequalities along any interior path makes the height sums telescope and gives exactly the criterion in (55). Its duration is at least t0t_0. This lower bound applies the guarded theorem to each bounded edge, never to a long block with an unjustified Pmt>CA|P|-mt>C_A guard.

Conversely, port cutoffs are far enough from both physical ends that (54) holds. Proposition 12.4 realizes the direct edge in exactly t0t_0 days, allocating at most mm inspections to the proper cohort and none to its full or empty mate. For t0=0t_0=0 the endpoints coincide. The realized block need not stay in the auxiliary counter interval: it stays within the actual physical board, which is the condition needed for an upper strategy.

Take an optimal path in Cn\mathcal C_n and split it at visits to the retained boundary families. Every omitted stretch has port endpoints in one sector. Replacing it by the corresponding direct edge cannot increase its cost. Conversely, every edge of the new graph is an actual physical block, so every new graph path is a valid strategy. The new finite graph therefore has exactly the same optimal value TmT_m. This argument allows arbitrary reverse travel, repeated visits to the same boundary, opposite-end gadgets, and owner changes within the retained boundary graph; it assumes neither two pure sweeps nor monotone excursions.

Port heights are affine functions of nn, with the end parity fixed. Their edge weights require maxima, one integer ceiling, and one parity adjustment. One fixed-size shortest-path closure consequently evaluates all paths using OQ,m(1)O_{Q,m}(1) integer arithmetic stages after finite preprocessing. The finitely many smaller lengths n<n0n<n_0 remain in that preprocessing, rather than being discarded by an asymptotic claim. Integer bit lengths are OQ,m(log(n+1))O_{Q,m}(\log(n+1)).

Store a shortest path after removing cycles. It has boundedly many edges. Each boundary edge stores its finite local inspections. Each interior edge stores its endpoints, duration, the balanced quota rule in Proposition 12.4, and the legal height-descent rule. This gives a bounded-size description of an optimal physical strategy; expanding its individual inspections costs the output length. The construction does not claim that all parameter-dependent boundary tables have been implemented. Its strengthening is the exact symbolic elimination of the interior transition problems, preserving all physical boundary and shared-quota effects. This completes the proof of Theorem 25.1.

A spatial transfer matrix for a fixed deadline

The preceding reductions retain geometric information about the current belief. A different choice of state removes every parity restriction: fix the number of inspection days, and retain the history of each column. The resulting matrix is independent of the longitudinal length. It gives an exact recurrence and an eventual formula for the inverse tradeoff.

Let QQ be any nonempty finite simple graph, put A=V(Q)A=|V(Q)|, and let bT(n)b_T(n) be the minimum daily budget guaranteeing capture within TT days on QPnQ\mathbin{\square}P_n, where n2n\ge2 and T1T\ge1.

Theorem 26.1. For fixed Q,TQ,T, there are effectively computable integers n0,p>0n_0,p>0 and rational constants c0,,cp1c_0,\ldots,c_{p-1} such that bT(n)=AnT+cnmodp(nn0).b_T(n)=\frac{An}{T}+c_{n\bmod p}\qquad(n\ge n_0). The period can be chosen divisible by T/gcd(A,T)T/\gcd(A,T). The finitely many remaining values, and a winning strategy at any specified length, are also effectively computable. No bipartiteness assumption on QQ is needed.

Here “effectively computable” asserts a terminating finite procedure, not a small uniform complexity bound. The state space below has 22A(T1)2^{2A(T-1)} states. In particular, this theorem does not supply a fixed matrix when the deadline itself grows with the box length.

Exact local certificates

The case T=1T=1 is b1(n)=Anb_1(n)=An. Assume T2T\ge2, and use the finite alphabet W=(2V(Q))T1\mathcal W=(2^{V(Q)})^{T-1}. A letter b=(b1,,bT1)b=(b_1,\ldots,b_{T-1}) records proposed survivor sets in one column. Put bT=b_T=\varnothing, and let 00 denote the all-empty letter. For a,b,cWa,b,c\in\mathcal W define w1(a,b,c)=Ab1,wt(a,b,c)=(NQ(bt1)at1ct1)bt(2tT).\begin{aligned} w_1(a,b,c)&=A-|b_1|,\\ w_t(a,b,c)&=\bigl|(N_Q(b_{t-1})\cup a_{t-1}\cup c_{t-1}) \setminus b_t\bigr|\quad(2\le t\le T). \nonumber \end{aligned}(152) A word b1bnb^1\cdots b^n, with boundary letters b0=bn+1=0b^0=b^{n+1}=0, has day-tt cost j=1nwt(bj1,bj,bj+1)\sum_{j=1}^n w_t(b^{j-1},b^j,b^{j+1}).

Lemma 26.2. A successful TT-day strategy with respective daily capacities m1,,mTm_1,\ldots,m_T exists if and only if such a word has day-tt cost at most mtm_t for every tt.

Proof. Let RtR_t be the union of the word’s day-tt column sets, with RT=R_T=\varnothing. Define nominal beliefs B1=V(QPn)B_1=V(Q\mathbin{\square}P_n) and Bt=N(Rt1)B_t=N(R_{t-1}) for t2t\ge2, and inspect St=BtRtS_t=B_t\setminus R_t. The product-neighborhood identity shows that St|S_t| is exactly the local cost sum in (152).

The actual belief UtU_t satisfies UtBtU_t\subseteq B_t inductively: its survivors are contained in RtR_t, so their neighborhood is contained in Bt+1B_{t+1}. On day TT, the empty survivor envelope makes ST=BTS_T=B_T cover every possibility. This argument intentionally does not require RtBtR_t\subseteq B_t; extra envelope vertices do not compromise soundness.

Conversely, take the actual survivors of a successful strategy, discard inspections outside the actual belief, and extend an earlier capture by empty inspections and survivors. Its column sections form a word whose costs are exactly the useful inspection counts. ◻

Use pairs (a,b)W2(a,b)\in\mathcal W^2 as matrix states. The transition (a,b)(b,c)(a,b)\to(b,c) has monomial weight t=1Txtwt(a,b,c)\prod_{t=1}^T x_t^{w_t(a,b,c)}. Let M(x)M(\mathbf x) be this matrix; let uu indicate states (0,b)(0,b) and vv indicate states (b,0)(b,0). There is exactly one nn-edge walk for each nn-column word, so Fn(x)=uTM(x)nvF_n(\mathbf x)=u^{\mathsf T}M(\mathbf x)^n v has a positive coefficient at xc\mathbf x^{\mathbf c} precisely when a certificate with exact cost vector c\mathbf c exists. Thus n0Fn(x)zn=uT(IzM(x))1v\sum_{n\ge0}F_n(\mathbf x)z^n =u^{\mathsf T}(I-zM(\mathbf x))^{-1}v is a rational formal series encoding the exact daily-budget tradeoff. All coefficients are nonnegative; multiplicities of envelopes do not affect the existential criterion.

For a direct algorithm, retain the accumulated cost vector and discard it if any coordinate exceeds the proposed budget mm. This uses at most O(nW3(m+1)T)O(n|\mathcal W|^3(m+1)^T) transitions. Since an optimum never needs m>Anm>An, searching budgets remains polynomial in nn for fixed Q,TQ,T. Backtracking recovers the word and the physical inspections in the lemma.

Why the optimum has an eventual formula

A subset of Nr\mathbb N^r is linear if it is a translate of a finitely generated additive monoid, and semilinear if it is a finite union of linear sets. Add a length coordinate one to each edge weight. The attainable vectors (n,c1,,cT)(n,c_1,\ldots,c_T) form an effectively semilinear set LL. To see this directly, eliminate the finite automaton’s states to obtain a regular expression. Its additive image is computed using union, Minkowski sum and additive closure, all of which preserve semilinearity. For the only less immediate operation, if S=i(bi+monoid(Pi))S=\bigcup_i(b_i+\operatorname{monoid}(P_i)), then S=I(iIbi+monoid({bi:iI}iIPi)).S^*=\bigcup_I\left(\sum_{i\in I}b_i+ \operatorname{monoid}\left(\{b_i:i\in I\}\cup \bigcup_{i\in I}P_i\right)\right). Here II ranges over subsets of component indices. Reserve one base for each used component; extra bases account for repeated occurrences, and all periods can be assigned to the reserved occurrence. The empty II supplies zero. This proves both containments and effectivity.

By the effective equivalence of semilinear and Presburger-definable sets (Ginsburg and Spanier 1966, Theorems 1.1 and 1.3), the relation E(n,m)n2 and c((n,c)L and ctm for all t)E(n,m)\quad\Longleftrightarrow\quad n\ge2\ \text{and}\ \exists\mathbf c\, ((n,\mathbf c)\in L\ \text{and}\ c_t\le m\ \text{for all }t) is effectively Presburger-definable. The same holds for E(n,m)(m=0 or ¬E(n,m1))E(n,m)\wedge(m=0\ \text{or}\ \neg E(n,m-1)), which is the graph of bTb_T. Convert that graph to a finite union of linear sets.

Every infinite linear component of a function’s graph lies on a rational affine line. Indeed, a nonzero period cannot have zero first coordinate. For two periods (ai,di),(aj,dj)(a_i,d_i),(a_j,d_j) with positive first coordinates, using them aja_j and aia_i times gives the same input, so uniqueness of the output forces ajdi=aidja_jd_i=a_id_j. All periods therefore have one slope. The component’s input projection is a translated numerical semigroup; it eventually contains exactly one residue class modulo the gcd of its positive generators. A threshold is computable by shortest paths among residues modulo any generator. Taking a common multiple of the finitely many periods and a maximum of their thresholds gives an affine formula on each eventual residue class. Finite components contribute only finitely many exceptions.

It remains to identify the slopes. The longitudinal matching between columns (1,2),(3,4),(1,2),(3,4),\ldots supplies 2An/22A\left\lfloor n/2\right\rfloor alternating target trajectories, pairwise disjoint on every inspection day. A probe intercepts at most one of these trajectories on that day. Consequently TbT(n)2An/2A(n1).T b_T(n)\ge2A\left\lfloor n/2\right\rfloor\ge A(n-1). For the upper bound put q=n/Tq=\left\lceil n/T\right\rceil. When the possible rooms lie in a suffix beginning at column LL, inspect its first q+1q+1 columns, clipped to the board. After movement the suffix begins at least at L+qL+q. After T1T-1 days at most n(T1)qqn-(T-1)q\le q columns remain; inspect all of them on the final day. Thus bT(n)A(n/T+1)<An/T+2A.b_T(n)\le A(\left\lceil n/T\right\rceil+1)<An/T+2A. Internal QQ-edges never change the column index. The two bounds force every infinite affine component to have slope A/TA/T. Enlarging the period by T/gcd(A,T)T/\gcd(A,T) if necessary proves Theorem 26.1, including its effective exception table and integral additive increment.

The survivor-envelope equivalence and the exact product-fiber cost sum are verified in Lean by SurvivorEnvelope. The matrix and semilinearity arguments above are ordinary proofs. The reference transfer implementation was compared with the independently proved path and two-row formulas in 56 cases, with physical replay of its recovered inspection sets. Neither these finite comparisons nor the formal semantic lemma are being substituted for the general periodicity proof.

Formal verification, reproducibility, and open problems

The development comprises 83 source modules using Lean 4.33.1 and Std. There are no admitted proofs, project-specific mathematical axioms, or trusted external solver results. Finite certificates are reduced by the Lean kernel. Printed dependencies use only propositional extensionality, classical choice, and quotient soundness where needed.

Complete classifications and reusable formal theorems

Four classifications are complete for the physical game:

Each includes feasibility, optimal time, and attaining schedules against all legal target walks. Independent semantic reviews check the physical graph, daily budget, and indexing: formal round zero is the first inspection, so last-round index tt means t+1t+1 days.

The reusable developments formalize the following separate layers. BeliefSemantics equates possible positions with avoiding walks; CaptureRecurrence verifies the winning recurrence and losing traps. StrategyCompression compares whole strategies, including arbitrary daily budgets. Product lifting, finite stabilization, and the concrete square operators used for the four-cube theorem are also proved. The generic complement/inverse identity in BipartiteProfileDuality uses actual attained graph minima, with inverse arithmetic in ProfileInverse. SurvivorEnvelope connects local column certificates to actual walk capture and global daily budgets. MiddleIntervalTransfer proves the exact bounded-counter interval theorem and constructs its legal daily allocations. RootConvolution defines the pronic and square roots internally and proves the exact two-candidate interval minimum. The more general ConvexCapacityConvolution constructs least inverses of monotone unbounded discrete-convex integer capacities and derives endpoint maximization from increasing increments. It proves an attained two-candidate interval minimum, with concrete instances for the square, pronic, and every punctured capacity ChC_h of (13). The triangular identity and the convexity of the maximum and truncated quadratic are proved inside Lean. ProbeLocalization proves on arbitrary directed graphs that retaining inspections only in the backward cone of unwanted endpoints preserves the final possible-position set exactly.

FastestAncestry proves concentration, low-total persistence, fastest-cohort ancestry after a pure reset, and the resulting midpoint obstruction for two deficit recurrences. Its inverse-concentration, proper-input, and bounded-secondary trace hypotheses are explicit. ClippedPyramidErosion uses actual nonnegative cylinder cells: it proves neighborhood inclusion after clipped erosion and the exact loss of occupied bottom roots, including empty fibers and both finite ends. Its room lists have unique entries and the asserted physical cardinalities.

Ordinary proofs and partial formalization

The other graph classifications and unbounded geometric theorems in this manuscript have ordinary proofs, not complete Lean proofs. This includes three through five rows; both general rectangle profile theorems; the uniform one-day determination and large-budget formulas; all-odd-box nesting and the other higher-dimensional reductions; the cylinder time formulas and eventual periods; and fixed-deadline semilinearity. The physical application of the formal middle-transfer lemma and the geometric bounded-interface application of probe localization are also ordinary proofs. The bounded odd frontier and its acceleration are not claimed to be Lean-verified by the root-convolution module.

Some arithmetic components of these results are formalized separately: the five-row scalar ranks, deficit consequences, four-probe transition and equality lemmas, three finite large-budget bounds, and the uniform minimum-budget scalar potential in UniformOddRank. These checks do not formalize their geometric hypotheses or the full unbounded classifications. Likewise, formal survivor-envelope semantics does not formalize the subsequent semilinearity argument. The uniform all-width minimum-budget formula also uses ordinary proofs of the rectangle inverse formulas, fresh-secondary clock, and physical midpoint reduction; FastestAncestry does not supply these instantiations. The punctured-quadrant and conditional half-strip neighborhood theorems, their every-size geometric attainment, and the corner propagation delays remain ordinary mathematics despite the formal inverse-capacity arithmetic. The erosion module does not prove the distance thresholds ensuring root occupancy, prescribed-size ideal enlargement, or maximal-erosion corrections at the top boundary. The detailed module-to-theorem map in lean/README.md records these distinctions. Successful compilation must not be described as formal verification of every theorem in the manuscript.

Reproduction and open scope

The companion at https://angelraychev.com/princess/ provides the presentation, complete proof text, formal sources, and mathematical archive. The archive includes independent physical replays, finite certificates, counterexample searches, and dated research notes. The verification receipt records the compiler version, exact source hashes, dependency order, axiom reports, and exit codes. Reproduce the complete check with python3 src/check_lean.py --lean /path/to/lean from the archive root. Compilation is sequential with one worker and requires no extra Lean packages.

The central open target is a simple explicit optimal-time formula for every rectangle and budget. Static neighborhood minimization is solved for all rectangles, but successive minimizing shapes can be incompatible. On odd rectangles the exact bounded frontier decides between the two times left by the solo recurrence; whether the two pure solo endpoints alone always suffice remains unresolved. The large-budget formulas now cover all side parities, with their stated quadratic thresholds. Below those thresholds, the exact algorithms and eventual theorems do not supply a single quotient-and-remainder formula. General higher-dimensional optimal time remains open as well.

Research and writing provenance

The path results originated in the author’s October 2019–March 2020 work. Reconstructing shorter proofs does not reassign that credit. The 2026 grid and box investigation, new arguments, experiments, formal developments, and manuscript were developed with substantial assistance from Astra 6 through the Codex harness. The research log distinguishes recovered results, established literature, new derivations with unverified priority, failed approaches, and open claims. The human author retains responsibility for the manuscript and any eventual submission.

Acknowledgments

The author thanks Dimitar Rusev for writing the preliminary section on monotonicity (Section 3) in the 2020 student-conference version of this work. By agreement, his contribution to that version is acknowledged here; both authors remain credited in its bibliographic entry. The author also thanks his mathematics teacher and mentor Dimitar Dimitrov, who encouraged him to pursue mathematical research and guided his early work.

Abramovskaya, Tatjana V., Fedor V. Fomin, Petr A. Golovach, and Michał Pilipczuk. 2016. “How to Hunt an Invisible Rabbit on a Graph.” European Journal of Combinatorics 52: 12–26. https://doi.org/10.1016/j.ejc.2015.08.002.
Beluhov, Nikolay, and Emil Kolev. 2017. “Search for a Moving Target in a Graph.” Electronic Notes in Discrete Mathematics 57: 39–46. https://doi.org/10.1016/j.endm.2017.02.008.
Ben-Ameur, Walid, Harmender Gahlawat, and Alessandro Maddaloni. 2026. “Hunting a Rabbit: Complexity, Approximability and Some Characterizations.” Theoretical Computer Science 1075: 115946. https://doi.org/10.1016/j.tcs.2026.115946.
Bezrukov, Sergei L., and Oriol Serra. 2002. “A Local–Global Principle for Vertex-Isoperimetric Problems.” Discrete Mathematics 257 (2–3): 285–309. https://doi.org/10.1016/S0012-365X(02)00431-4.
Bolkema, Jessalyn, and Corbin Groothuis. 2019. “Hunting Rabbits on the Hypercube.” Discrete Mathematics 342 (2): 360–72. https://doi.org/10.1016/j.disc.2018.10.011.
Britnell, John R., and Mark Wildon. 2013. “Finding a Princess in a Palace: A Pursuit-Evasion Problem.” The Electronic Journal of Combinatorics 20 (1): P25. https://doi.org/10.37236/2296.
Dissaux, Thomas, Foivos Fioravantes, Harmender Gahlawat, and Nicolas Nisse. 2025. “Further Results on the Hunters and Rabbit Game Through Monotonicity.” Information and Computation 305: 105302. https://doi.org/10.1016/j.ic.2025.105302.
Ginsburg, Seymour, and Edwin H. Spanier. 1966. “Semigroups, Presburger Formulas, and Languages.” Pacific Journal of Mathematics 16 (2): 285–96. https://doi.org/10.2140/pjm.1966.16.285.
Haslegrave, John. 2014. “An Evasion Game on a Graph.” Discrete Mathematics 314: 1–5. https://doi.org/10.1016/j.disc.2013.09.004.
Kamenetsky, Dmitry. 2018a. Entry A301337: Number of Steps Required in the Worst Case for Two Knights to Find the Princess in a Castle with nn Rooms Arranged in a Line. The On-Line Encyclopedia of Integer Sequences. https://oeis.org/A301337.
Kamenetsky, Dmitry. 2018b. Entry A301426: Number of Steps Required in the Worst Case for Three Knights to Find the Princess in a Castle with nn Rooms Arranged in a Line. The On-Line Encyclopedia of Integer Sequences. https://oeis.org/A301426.
Körner, János, and Victor K. Wei. 1984. “Odd and Even Hamming Spheres Also Have Minimum Boundary.” Discrete Mathematics 51 (2): 147–65. https://doi.org/10.1016/0012-365X(84)90068-2.
Otachi, Yota, and Ryohei Suda. 2011. “Bandwidth and Pathwidth of Three-Dimensional Grids.” Discrete Mathematics 311 (10–11): 881–87. https://doi.org/10.1016/j.disc.2011.02.019.
Raychev, Angel. 2020. “Optimal Strategies for Finding a Princess in a Linear Table.” Unpublished manuscript.
Raychev, Angel, and Dimitar Rusev. 2020. “Optimal Strategies for Finding a Princess in a Linear Graph.” Unpublished manuscript.