\section{Rectangular boxes}\label{sec:boxes} We prove Theorem~\ref{thm:all-boxes}. A prescribed-family corner lemma and a uniform lower obstruction come first, followed by the thin-box upper bounds and the remaining shapes. The only certified input is Theorem~\ref{thm:main}; the prescribed-family lemma is independent of it. After ordering the sides as $a\le b\le c$, the upper bound has three exhaustive regimes: \begin{center} \begin{tabular}{ll} \toprule Shape & Main mechanism\\ \midrule $a=2,\ b=3$ & Exceptional-defect control and retargeting\\ $a=b=2$ & Concentration and retargeting along a rod\\ $a+b\ge6$ & Weighted compatibility and reservations\\ \bottomrule \end{tabular} \end{center} For the quantitative arguments, write $m=a-2$, $t=b-2$, $M=c-2$, and $\tau=m+t+M$. Thus $L=8+4\tau$ is the frame size, and $N$ is the number of available copies. A source's \emph{defect} is the number of target positions it misses. The parameter $d$ is the Hall cutoff; a bichromatic pair is called rare when at most $d-1$ sources possess it. Its missing family then has at least $N-d+1$ copies. The main bounds are: \begin{center} \small \begin{tabular}{llll} \toprule Regime & $N=L$ & $d$ & Exceptional Hall sets\\ \midrule $2\times3\times c$, $c\ge4$ & $12+4M$ & $2M+6$ & Size $d+1$; Theorem~\ref{thm:23c-sharp}\\ $2\times2\times c$, $c\ge5$ & $8+4M$ & $2M+4$ & Sizes $d+1,d+2$; Theorem~\ref{thm:sharp-rods-upper}\\ $a+b\ge6$ & $8+4\tau$ & $\tau+M+6$ & Reservations; Theorem~\ref{thm:boxes-wide}\\ \bottomrule \end{tabular} \end{center} In the wide regime every source's defect is at most $d$. The last column lists the exceptional Hall-set sizes that require additional arguments in the thin regimes; these are distinct from individual source defects and are handled by concentration and retargeting. The smaller boundary shapes are treated separately, with spare sources where necessary. We establish the thin regimes first, then the general weighted bound. In each case an initial corner matching verifies part of Hall's inequalities; the final matching may rearrange those placements. \begin{lemma}[Rare pairs]\label{lem:rare-pairs} In a collection of five-colour cubes, any family of bichromatic pairs each missing from more than half the source copies consists of at most two pairwise disjoint pairs. \end{lemma} \begin{proof} The missing families of two such pairs intersect. A source missing both pairs forces them to be disjoint, by Lemma~\ref{lem:cube-incidence}. There are at most two disjoint pairs in a five-colour palette. \end{proof} \subsection{Corners from a missing-pair family} Retain the family $\mathcal H_{\alpha\beta}$ from Lemma~\ref{lem:fixed-missing-pair}, with its opposite-repeat varieties and their $2\times2$ corner array. Write $K(W)$ for the cyclic corner types of $W$. \begin{lemma}[Corner projections onto a missing-pair family]\label{lem:thin-projections} Fix a bichromatic pair $\alpha\beta$. Let $C^+$ and $C^-$ be the two sets of six tricoloured corner types shared by the three adjacent-repeat varieties of the respective cyclic orientations in $\mathcal H_{\alpha\beta}$. An opposite-repeat variety in $\mathcal H_{\alpha\beta}$ has four corners in each set. For a source $W\notin\mathcal H_{\alpha\beta}$, put \[ p(W)=|K(W)\cap C^+|,\qquad m(W)=|K(W)\cap C^-|. \] Then \[ (p(W),m(W))\in\{(4,0),(2,1),(1,2),(2,2),(0,4)\}. \] \end{lemma} \begin{proof} Relabel the poles as $0,1$ and the ring colours as $2,3,4$. Choose the positive orientation so that \[ C^+=\{023,034,042,124,132,143\},\qquad C^-=\{024,032,043,123,134,142\}. \] Triples denote cyclic classes; face order is $(+x,-x,+y,-y,+z,-z)$. The following table gives representatives of all geometric cases outside $\mathcal H_{01}$, up to a colour permutation preserving the pole pair and a simultaneous reflection, which may exchange $C^+$ and $C^-$. Such a reflection is only a symmetry of this incidence calculation, not an allowed assembly move. \[ \begin{array}{c|cc} W&p(W)&m(W)\\\hline (0,0,1,2,3,4)&2&2\\ (0,1,0,2,3,4)&0&4\\ (0,2,0,3,1,4)&2&1\\ (0,2,1,2,3,4)&0&4\\ (0,2,1,3,2,4)&2&1\\ (0,2,1,3,4,4)&2&2 \end{array} \] To see that these cases exhaust the possibilities, first suppose a pole colour is repeated. Its two faces are either opposite, or adjacent; in the latter case the other pole is opposite one repeated face or adjacent to both. If a ring colour is repeated, the two pole faces must be adjacent, since otherwise $W$ belongs to $\mathcal H_{01}$. Fix them at $x^+$ and $y^+$. Among the remaining faces $x^-,y^-,z^+,z^-$, an opposite repeated pair is $z^+,z^-$. An adjacent repeated pair is either $x^-,y^-$, or one of $x^-,y^-$ together with one of $z^+,z^-$. These are the final three rows. Each entry follows by reading the eight corners of the displayed cube. The projections of the nine family varieties themselves are $(6,0),(0,6)$, and $(4,4)$, as follows directly from their ring descriptions. \end{proof} \begin{lemma}[Eight cubes with a common missing pair]\label{lem:eight-common-missing} Eight cubes from $\mathcal H_{\alpha\beta}$, together with any three additional five-colour cubes, have a corner solution whose target belongs to $\mathcal H_{\alpha\beta}$. \end{lemma} \begin{proof} Let $O,P,Q$ count the opposite-repeat, positive adjacent-repeat, and negative adjacent-repeat copies among the chosen eight. Thus $O+P+Q=8$; $C^+$ and $C^-$ are as in Lemma~\ref{lem:thin-projections}. If $O+\min(P,Q)\ge4$, the $2\times2$ Hall argument gives an opposite-repeat corner solution from these eight copies alone. Explicitly, choose $O_r$ whose opposite-repeat multiplicity is maximal. Each other opposite-repeat multiplicity is at most $O/2$: it is no larger than the chosen multiplicity, and their sum is at most $O$. Among these eight family sources, the two positions in a cell have identical neighbourhoods. Any deficient set can therefore be enlarged to a union of whole cells without enlarging its neighbourhood. Each cell has at least $O/2+\min(P,Q)\ge2$ neighbours, each row has at least $8-O/2\ge4$, and each column has at least $O+\min(P,Q)\ge4$. Every other nonempty union of cells has all eight copies as neighbours. Otherwise exchange the signs so that $O+Q\le3$. Put $\kappa=O+Q=8-P$, so $P\ge5$ and $0\le \kappa\le3$. Some positive variety $A_r^+$ occurs at least twice. If its eight corners have a matching among all eleven copies, we are done. Otherwise, choose a deficient Hall set $D$ of its corners. The two copies of $A_r^+$ fit every corner, so $|D|\ge3$ and $D$ contains a tricoloured corner. All $P$ positive copies are therefore neighbours of $D$. Let $R$ be its other neighbours and put $U=C^+\setminus D$, $u=|U|$. Since $|D|+u\le8$, \[ P+|R|<|D|\le8-u,\qquad |R|+u\le \kappa-1. \] Remove the $P$ positive copies and the copies in $R$. Every surviving copy has all its positive corners in $U$, and $u\le2$. Every family opposite-repeat variety has four corners in $C^+$, so no such chosen copy remains. At least \[ \kappa-|R|\ge u+1 \] of the chosen nonpositive copies remain, and all of them are negative adjacent-repeat copies. Each fits every corner in $C^-$. The remaining pool has at least \[ \kappa+3-|R|\ge4+u \] copies. Lemma~\ref{lem:thin-projections} gives the following implications for every source: \[ \begin{array}{c|ccc} |K(W)\cap C^+|\le u &u=0&u=1&u=2\\\hline |K(W)\cap C^-|\ge&4&2&1. \end{array} \] Indeed, the family varieties have projection sizes $(6,0),(0,6),(4,4)$, and every variety outside the family has one of $(4,0),(2,1),(1,2),(2,2),(0,4)$. Partition $C^-$ into three pairs, indexed by the unordered pairs of ring colours. The negative half of each family opposite-repeat target is the union of two of these pairs. We will match one such four-position half using the remaining pool, then use four positive copies for its positive half. Let $j$ be the number of negative-family copies in the remaining pool; thus $j\ge u+1$. If $j\ge4$, the conclusion is immediate. If $j=3$, another remaining copy fits at least one negative corner; choose a target whose negative half contains it and fill the other three positions with negative-family copies. If $j=2$, then $u\le1$. Two other remaining copies each fit at least two negative corners, so they can be assigned distinct ones. Any two negative corners lie in the union of two of the three pairs. Choose the corresponding opposite-repeat target and fill its other two negative positions with the two negative-family copies. Finally, if $j=1$, then $u=0$, and there are at least three other copies, each fitting at least four of the six negative corners. Choose one of these copies $W$. Some union of two of the three pairs contains at least three of its negative corners. In that four-position half, every other copy fits at least two positions. Hence $W$ and any two other copies can be matched to three distinct positions: two copies have at least two neighbours, and all three together have at least three. The one negative-family copy fills the fourth position. In every case we obtain the negative half of an opposite-repeat target in $\mathcal H_{\alpha\beta}$. Four of the $P\ge5$ positive copies fill its positive half. The positive copies used here are disjoint from the surviving pool. This proves the lemma. \end{proof} \subsection{A uniform lower bound} \begin{samepage} \begin{lemma}[A three-variety obstruction]\label{lem:thin-three-variety-obstruction} Let $a,b,c\ge2$ and put $\tau=a+b+c-6$. In face order $(+x,-x,+y,-y,+z,-z)$, define \[ U=(0,1,0,2,3,4),\qquad V=(0,1,1,2,3,4),\qquad W=(0,3,1,4,2,3). \] The collection \[ U+(\tau+5)V+(\tau+6)W \] of $2\tau+12$ cubes has no $a\times b\times c$ frame using all five colours. In particular, $U+7V+8W$ fails for both a $2\times3\times3$ frame and a $2\times2\times4$ box. \end{lemma} \end{samepage} \begin{proof} The corner types are \[ \begin{array}{c|l} U&003,004,013,024,032,041,123,142\\ V&113,114,013,024,032,041,123,142\\ W&133,334,012,024,031,043,132,234. \end{array} \] Triples denote cyclic classes. The only two-colour types in their union are $003,004$, $113,114$, and $133,334$. An adjacent-repeat target must therefore repeat colour $0$, $1$, or $3$. Its two repeated-colour corners force the colours on the opposite faces at the ends of its monochromatic edge to be, respectively, $\{3,4\}$, $\{3,4\}$, or $\{1,4\}$. The two orders of the remaining colours give $U,V,W$, respectively, and their mirrors. The mirrors of $U$ and $V$ require $023$, which is absent from the union; the mirror of $W$ requires $021$, also absent. An opposite-repeat target requires both cyclic orientations of four distinct unordered tricoloured triples. The union above contains both orientations only for $013$ and $123$. Thus no opposite-repeat target is possible. The only corner-supported targets are $U,V,W$. The corners $003$ and $004$ of target $U$ each require a $U$ copy, but only one is available. For target $V$, seven of its corner types are absent from $W$; the only shared type is $024$. In addition, exactly one geometric edge in each coordinate direction has a type absent from $W$: these are $14,14,11$. Consequently, in any orientation of an $a\times b\times c$ frame, $7+\tau$ positions require a $U$ or $V$ source. There are only $\tau+6$ such copies. For target $W$, seven corner types are absent from both $U$ and $V$. Again, one geometric edge in each direction has a private type, now $34,33,34$. Hence $7+\tau$ positions require a $W$ source, whereas only $\tau+6$ are available. Every possible target therefore fails (Figure~\ref{fig:uniform-obstruction}). \end{proof} \begin{figure}[ht] \centering \input{uniform-obstruction} \caption{The uniform obstruction $U+(\tau+5)V+(\tau+6)W$, where $\tau=a+b+c-6$. Each net has $+x$ at its centre, and corner types are read counterclockwise from outside. Only $U$, $V$ and $W$ can be targets. Their pools are $U$ alone, $U$ or $V$, and $W$ alone; faded corner types also occur on a cube outside the pool. For $V$ and $W$, one edge in each direction has a private type, and these edges have $\tau$ noncorner positions in total.} \label{fig:uniform-obstruction} \end{figure} \begin{proposition}\label{cor:all-lower-bounds} For every $a,b,c\ge2$, \[ F_5(a,b,c)\ge\max\{15,\;4(a+b+c)-16,\;2(a+b+c)+1\}. \] \end{proposition} \begin{proof} The three terms follow from the fourteen-cube corner obstruction (Lemma~\ref{lem:lower}), the number of frame positions, and Lemma~\ref{lem:thin-three-variety-obstruction}, respectively. \end{proof} \subsection{Choosing a thin target} \begin{lemma}[Choosing a target when one side has length two]\label{lem:thin-target} Let $2\le b\le c$ and suppose $N\ge15$ five-colour sources are available. There is a corner-solvable target and an orientation for a $2\times b\times c$ frame in which every noncorner edge position has a bichromatic requirement possessed by at least $\lceil N/2\rceil$ sources. An adjacent-repeat target's monochromatic edge is parallel to a side of length two. If $b=2$ and the target is opposite-repeat, its repeated-colour axis can also be placed along $c$. \end{lemma} \begin{proof} Put $h=\lceil N/2\rceil$ and call a bichromatic pair rare if fewer than $h$ sources possess it. Its missing family has at least $N-h+1=\lfloor N/2\rfloor+1>N/2$ members, hence at least eight. The missing families of any two rare pairs intersect, so Lemma~\ref{lem:rare-pairs} gives at most two rare pairs, which are disjoint. If no pair is rare, the fifteen-cube theorem supplies a corner target. Put its monochromatic edge, if any, parallel to a side of length two, where it contributes no noncorner positions. All actual edge requirements are then bichromatic and have at least $h$ neighbours. For an opposite rod target, put the repeated-colour axis along $c$. Otherwise choose a rare pair $\alpha\beta$. Apply Lemma~\ref{lem:eight-common-missing} to eight sources from $\mathcal H_{\alpha\beta}$ and any three others. The resulting corner solution has a target in that family. Put its singleton $\alpha\beta$ axis along a side of length two. Every actual edge requirement joins a pole colour to a ring colour, so it avoids $\alpha\beta$ and the other possible rare pair, whose colours are both ring colours. The possible monochromatic edge is parallel to the short axis. In an opposite rod target the repeated-colour axis is perpendicular to the singleton axis, so it can simultaneously be put along $c$. \end{proof} \subsection{The smallest thin box} \begin{lemma}[Compatibility for a thin frame]\label{lem:thin-compatibility} Choose an orientation of a five-colour target for a $2\times2\times3$ frame such that its four noncorner edge positions are bichromatic. Every source cube fits at least four of the twelve positions. \end{lemma} \begin{proof} If either source or target is opposite-repeat, Lemma~\ref{lem:cube-incidence} gives two shared corners. The four parallel bichromatic edges have either four distinct types or two types occurring twice each. In the latter case both contain the target's repeated colour. The source's missing pairs are disjoint, so it fits at least two of these edges, giving four compatible positions. If both varieties are adjacent-repeat, the four parallel edge types are distinct and transverse to the monochromatic edge. The source fits either all four, or at least three and a corner by Lemma~\ref{lem:transverse-corner}. Again it fits four positions. \end{proof} \begin{theorem}[The $2\times2\times3$ box]\label{thm:223} We have \[ F_5(2,2,3)=15. \] In particular, any fifteen five-colour cubes contain twelve that form a $2\times2\times3$ box with monochromatic exterior faces using all five colours. \end{theorem} \begin{proof} The fourteen-cube corner obstruction (Lemma~\ref{lem:lower}) gives the lower bound: the eight corner cubes of any box would themselves give a corner solution. For the upper bound, apply Lemma~\ref{lem:thin-target} to fifteen sources. The target has a corner matching, and each of its four noncorner edge positions has a bichromatic requirement with at least eight neighbours. For this target and orientation, every source fits at least four of the twelve positions, by Lemma~\ref{lem:thin-compatibility}. Thus each source misses at most eight positions. Apply Lemma~\ref{lem:partial-matching} with the corners as $P_0$, $L=12$, $N=15$ and $d=8$. It supplies a matching of all twelve positions to distinct source copies. The final matching may rearrange the preliminary corner placements. \end{proof} \subsection[Sharp thresholds for 2 by 3 by c frames]{Sharp thresholds for $2\times3\times c$ frames} \begin{lemma}[Compatibility for $2\times3\times c$]\label{lem:23c-compatibility} Let $M=c-2\ge2$ and put $d=2M+6$. Orient a five-colour target for a $2\times3\times c$ frame so that its monochromatic edge, if any, is parallel to the side of length two. An adjacent-repeat source misses at most $d$ positions, and an opposite-repeat source misses at most $d+1$ positions. If a source misses $d+1$ positions, it is the unique opposite-repeat variety lacking the two bichromatic types appearing among those missed edge positions. \end{lemma} \begin{proof} The nonzero edge weights, counting noncorner positions, are $1,M$. By Lemma~\ref{lem:cube-incidence}, for an opposite-repeat source, at most six corners are incompatible. Its two missing bichromatic pairs are disjoint, so at most three geometric edges are incompatible, with at most two parallel to either nonzero direction. If their counts are $k_1,k_M$, the defect is at most \[ 6+k_1+Mk_M\le6+3+2(M-1)=2M+7=d+1. \] Equality requires six incompatible corners, two incompatible long edges, and one incompatible edge of weight $1$. These three geometric edges display exactly two bichromatic types: there are at least two because any target type occurs at most twice, and at most two because the source lacks only two types. They are disjoint and determine the opposite-repeat source variety uniquely. An adjacent-repeat source lacks only one bichromatic type. Against an opposite-repeat target, at most six corners and edge positions of total weight $2M$ are incompatible, giving defect at most $d$. Against an adjacent-repeat target, an incompatible edge lies transverse to the monochromatic edge, so Lemma~\ref{lem:transverse-corner} gives a shared corner. The absent type contributes weight at most $M+1$: a doubled type has one edge in each nonzero direction. The defect is therefore at most \[ 7+(M+1)=M+8\le2M+6=d. \] If no actual edge is incompatible, the defect is at most eight, which is also at most $d$. \end{proof} \begin{lemma}[An opposite-repeat target along the short axis] \label{lem:23c-opposite-short} Let $c\ge3$. For a $2\times3\times c$ frame, orient an opposite-repeat target with its repeated-colour axis along the side of length two. Every source misses at most $2(c-2)+6$ positions. \end{lemma} \begin{proof} Every actual edge type contains the target's repeated colour. By Lemma~\ref{lem:cube-incidence}, a source can lack at most one such bichromatic type, because its missing pairs are disjoint. The absent type accounts for at most two parallel geometric edges, of total weight at most $2(c-2)$. At least two corners are shared, so at most six further positions are missed. \end{proof} \begin{theorem}[The remaining $2\times3\times c$ frames] \label{thm:23c-sharp} \[ F_5(2,3,3)=17,\qquad F_5(2,3,c)=4c+4\quad(c\ge4). \] \end{theorem} \begin{proof} First let $c=3$ and take seventeen sources. Lemma~\ref{lem:thin-target} gives a corner target with its possible monochromatic edge along the side of length two and at least nine neighbours for each actual edge position. Every source misses at most nine of the sixteen frame positions. Indeed, if source or target is opposite-repeat, at most six corners and three actual geometric edges are incompatible. If both are adjacent-repeat, at most two actual geometric edges are incompatible; whenever one is incompatible, Lemma~\ref{lem:transverse-corner} supplies a shared corner. If no edge is incompatible, at most eight positions are missed. The chosen target has a corner matching, and every edge requirement has at least nine neighbours. Lemma~\ref{lem:partial-matching}, with the corners as the matched subset, completes the frame. This proves $F_5(2,3,3)\le17$; the collection $U+7V+8W$ in Lemma~\ref{lem:thin-three-variety-obstruction} gives equality. Now let $c\ge4$, put $M=c-2\ge2$, and set \[ d=2M+6,\qquad N=4M+12=2d. \] There are $N=4c+4$ frame positions. Apply Lemma~\ref{lem:thin-target} to any $N$ sources. The target has a corner matching, its possible monochromatic edge lies along the side of length two, and every actual edge requirement has at least $d=N/2$ neighbours. Hall's inequality holds for corner-only sets, and for any set of at most $d$ positions containing an edge. By Lemma~\ref{lem:23c-compatibility}, sets of more than $d+1$ positions neighbour every source. Suppose the frame has no matching. A deficient Hall set $D$ must therefore have exactly $d+1$ positions. Every nonneighbour misses all of those positions, so Lemma~\ref{lem:23c-compatibility} says that all nonneighbours have one opposite-repeat variety $V$, determined by the two absent bichromatic types. Since $D$ has at most $d$ neighbours among $N=2d$ copies, the inventory contains at least $d$ copies of $V$. Retarget the frame to $V$ with its repeated-colour axis along the side of length two. By Lemma~\ref{lem:23c-opposite-short}, every source misses at most $d$ positions. The $d$ copies of $V$ fit every position, so the universal-copy consequence of Lemma~\ref{lem:partial-matching} supplies a frame. Thus $N$ sources always suffice. The number of frame positions supplies the matching lower bound. \end{proof} % Analytic resolution of the 2 x 2 x c family. % Inputs: N_5=15; the eight-family-plus-three corner lemma; basic geometry. \subsection[Sharp thresholds for 2 by 2 by c boxes]{Sharp thresholds for $2\times2\times c$ boxes} Put $M=c-2$. The frame of a $2\times2\times c$ box consists of eight corners and four parallel geometric edges, each with $M$ positions. Its size is $L=4M+8=4c$. We call an orientation of an adjacent-repeat target \emph{transverse} if its monochromatic edge is not parallel to the long axis. For an opposite-repeat target, its \emph{axial} orientation has its repeated-colour axis along the long direction. \begin{lemma}[Directional compatibility]\label{lem:rod-compatibility} Let $M\ge2$. \begin{enumerate} \item For a transverse adjacent-repeat target, every adjacent-repeat source misses at most $M+7$ positions. Every opposite-repeat source misses at most $2M+6$ positions. An opposite-repeat source missing more than $M+6$ positions must be one of two varieties; their missing long-edge types are complementary pairs. \item For an axial opposite-repeat target $V$, every source misses at most $d=2M+4=L/2$ positions. If $M\ge3$, a source different from $V$ can miss $d$ positions only if it is one of the other two opposite-repeat varieties with the same repeated colour. These two varieties have complementary missing long-edge types. \end{enumerate} \end{lemma} \begin{proof} For (i), write the target in face order $(+x,-x,+y,-y,+z,-z)$ as \[ (r,\alpha,r,\beta,\gamma,\delta), \] and take the long direction to be $x$. Its four long-edge types are \[ r\gamma,\quad r\delta,\quad \beta\gamma,\quad \beta\delta. \] An adjacent-repeat source lacks at most one of these. If it lacks one, Lemma~\ref{lem:transverse-corner} gives a shared corner, so its defect is at most $M+7$. If it lacks none, its defect is at most eight, also bounded by $M+7$. By Lemma~\ref{lem:cube-incidence}, an opposite-repeat source shares at least two corners and lacks at most two long-edge types, giving defect at most $2M+6$. To lack two of the four displayed types, its two missing pairs must be one of the disjoint matchings \[ \{r\gamma,\beta\delta\}\qquad\text{or}\qquad\{r\delta,\beta\gamma\}. \] Each matching determines exactly one opposite-repeat variety, with repeated colour $\alpha$. The two varieties have complementary missing long-edge types. Every other opposite-repeat source lacks at most one long-edge type, and hence has defect at most $M+6$. For (ii), let the repeated colour of $V$ be $r$, and put its singleton opposite pairs on the two transverse axes. The four long-edge types are the four edges of the resulting $K_{2,2}$ on the singleton colours. The other two opposite-repeat varieties with repeated colour $r$ each share four corners and two long-edge types with $V$. Their compatible position count is $4+2M=d$, and their missing long-edge pairs are complementary. Every adjacent-repeat source lacks at most one long-edge type. An opposite-repeat source with repeated colour different from $r$ also lacks at most one: one of its two missing pairs contains $r$, whereas no long-edge type does. By Lemma~\ref{lem:cube-incidence}, these sources share at least two corners with $V$, so they fit at least $2+3M\ge d$ positions. If $M\ge3$, this last inequality is strict. The target variety $V$ itself fits every position. This proves both assertions. \end{proof} \begin{lemma}[Concentrated opposite-repeat copies]\label{lem:rod-concentration} Let $M\ge3$ and $d=2M+4$. A collection of $2d=4M+8$ cubes containing at least $d-1$ copies of one opposite-repeat variety forms a $2\times2\times(M+2)$ box. \end{lemma} \begin{proof} Let that variety be $V$ with multiplicity $v$. Use its axial target orientation. Every source misses at most $d$ positions. If $v\ge d$, the universal-copy consequence of Lemma~\ref{lem:partial-matching} applies, since $N=L=2d$. Suppose $v=d-1$. The same reasoning handles all position sets except sets $D$ of size exactly $d$. If such a set fails Hall, no non-$V$ copy neighbours it. Those copies must each miss $d$ positions, so Lemma~\ref{lem:rod-compatibility}(ii) restricts them to the other two opposite-repeat varieties with the same repeated colour. Since $d>8$, $D$ contains a long-edge position. The two candidate varieties have complementary missing long-edge types, so at most one can be absent from the neighbourhood of $D$. All $2d-v=d+1$ non-$V$ copies are therefore one variety $W$. Using $W$ as the axial target gives the previous case, with at least $d$ universal copies, and completes the box. \end{proof} \begin{theorem}[Thin rods]\label{thm:sharp-rods-upper} \[ F_5(2,2,4)\le17, \qquad F_5(2,2,c)=4c\quad(c\ge5). \] \end{theorem} \begin{proof} First let $c=4$, so $M=2$ and $L=16$, and take seventeen source copies. Lemma~\ref{lem:thin-target} gives a corner target, transverse if adjacent-repeat and axial if opposite-repeat, with at least nine sources for every long-edge type. If the target is opposite-repeat, every source misses at most eight positions by Lemma~\ref{lem:rod-compatibility}. Lemma~\ref{lem:partial-matching}, with the corners as the matched subset, completes the frame. For an adjacent-repeat target, adjacent-repeat sources miss at most nine positions and opposite-repeat sources at most ten. A failing Hall set $D$ cannot consist only of corners. Since it contains an edge position, it has at least nine neighbours; and if $|D|>10$, it neighbours every source. Therefore a failure would have $|D|=10$ and exactly nine neighbours. Its eight non-neighbouring source copies must all be opposite-repeat. Each must miss two long-edge types, since otherwise its defect is at most $M+6=8$. The two candidate varieties in Lemma~\ref{lem:rod-compatibility}(i) have complementary missing long-edge types. As $D$ contains an edge position, all eight copies must be the same opposite-repeat variety $V$. For the axial target $V$, every source misses at most eight positions. Its eight universal copies and $N=17\ge L=16$ satisfy the universal-copy consequence of Lemma~\ref{lem:partial-matching}, proving the upper bound. Now let $M=c-2\ge3$, put $d=2M+4$, and take exactly $N=2d=L$ cubes. Lemma~\ref{lem:thin-target} gives a transverse or axial corner target as appropriate, with at least $d=N/2$ sources for each long-edge type. An opposite-repeat target is completed directly by Hall, since every source misses at most $d$ positions. For an adjacent-repeat target, adjacent-repeat sources miss at most $M+7\le d$ positions; opposite-repeat sources miss at most $2M+6=d+2$. Any failing Hall set $D$ therefore has \[ d+1\le |D|\le d+2. \] It has at most $d+1$ neighbours, leaving at least $d-1$ non-neighbouring source copies. All are opposite-repeat. An opposite-repeat source missing only one long-edge type has defect at most $M+6n_f\ge d-2\ge8$, every copy of $V$ is also a neighbour, since it misses at most six positions. These are distinct from the $n_f$ copies possessing $f$, so \[ |\Gamma(D)|\ge n_f+v\ge d+1. \] This handles $|D|\le d$; larger sets neighbour every source. Hall's theorem completes the frame in the final case. The number of frame positions gives the lower bound, proving equality. All preliminary placements certify Hall inequalities; the final matching may rearrange them. \end{proof} \subsection{Completion of the classification} \begin{proof}[Proof of Theorem~\ref{thm:all-boxes}] Order the sides as $2\le a\le b\le c$. When $a+b\ge6$, Theorem~\ref{thm:boxes-wide} gives $F_5=L$. The remaining possibilities are exactly $(a,b)=(2,2)$ and $(2,3)$, settled by Proposition~\ref{cor:sharp-rods} and Theorem~\ref{thm:23c-sharp}. Together with the corner theorem at $(2,2,2)$, these give $F_5=15$ for sums six and seven, $F_5=17$ for sum eight, and $F_5=L$ for every larger sum. Proposition~\ref{cor:all-lower-bounds} proves sharpness and yields the stated maximum formula. For the complete box, take $\max\{abc,F_5(a,b,c)\}$ sources and first choose a frame. Every source has every colour, so any unused source can fill any face-interior position after a suitable proper rotation. All fully interior positions are unrestricted. There are enough unused sources to fill the remaining $abc-L$ positions. Conversely, any complete box supplies a frame and uses $abc$ sources. Hence \[ G_5(a,b,c)=\max\{abc,F_5(a,b,c)\}. \] Putting $x=a-2$, $y=b-2$, and $z=c-2$ gives \[ abc-L=xyz+2(xy+xz+yz)\ge0, \] which simplifies this identity to the claimed formula for $G_5$. If $(a,b)=(2,2)$, this formula is $\max\{4c,15,2c+9\}$: it exceeds the volume only for $c=2,3,4$. In every other sorted case, $b\ge3$; then $abc\ge18\ge15$ and \[ abc-2(a+b+c)-1\ge 2bc-2b-2c-5\ge1. \] The first inequality follows by increasing $a$ from two, and the second is minimised at $b=c=3$. There are no further exceptions. \end{proof}