\section{A criterion for prime numbers of classes}\label{sec:U} An intercalate of $K$ is a \emph{cross intercalate} if its two rows lie in different sectors, its two columns lie in different sectors, and its two symbols have different classes. The criterion needs one condition on the splits. \begin{theorem}\label{thm:U} Let $k$ be prime, let $\beta$ be a column map, and suppose that \begin{enumerate}[label=\textup{(A)}] \item for every $x \in \Z_m$ and every nonzero $d \in \Z_m$ the orbit $\{x + i d : i \ge 0\}$ meets both row parts and both column parts. \end{enumerate} Then $K$ has no proper subsquare if and only if \begin{enumerate}[label=\textup{(\alph*)}] \item $K$ has no cross intercalate; \item there is no residue $y$ such that $\beta(g, y)$ is the same for all blocks $g$; \item there are no subgroup $H$ of $\Z_m$ with $\{0\} \ne H \ne \Z_m$ and residues $x$, $z$ such that $\beta(g, x + h) \in z + H$ for all blocks $g$ and all $h \in H$. \end{enumerate} \end{theorem} Each of the three conditions is necessary for a direct reason. A cross intercalate is a proper subsquare. If (b) fails, the $k$ rows $(h, 0)$ and the $k$ columns $(g, y)$ form a subsquare of order $k$: the class of the cell $((h, 0), (g, y))$ is $g - h - \varepsilon$ with $\varepsilon$ independent of $g$ and $h$, and its symbol $(j, \beta_j(g, y))$ depends only on the class $j$. If (c) fails, the rows $(h, a)$ and the columns $(g, x + a)$ with $h, g \in \Z_k$ and $a \in H$ form a subsquare of order $k|H|$, since in these cells the symbols of class $0$ have values in $x + H$ and those of class $j \ne 0$ have values in $z + H$. These constructions use neither (A) nor the primality of $k$. Cosets and a divisor condition also govern the subsquares in Wanless's prolongations of cyclic squares: the subsquares of a cyclic square consist of residue classes \cite[Lemma~2]{W01}, and his exact criterion for a prolongation to have only one proper subsquare contains a divisor condition of the same kind as (A) \cite[Theorem~2]{W01}. Condition (c) refers to all subgroups of $\Z_m$. The following corollary replaces (b) and (c) by a condition that the mirror rule satisfies under a simple condition on the shifts (Lemma~\ref{lem:mirror}). For a column part $P$ and residues $x, y \in P$, call $y$ a \emph{successor} of $x$ if $\beta(g + 1, y) = \beta(g, x)$ for some block $g$. \begin{corollary}\label{cor:gen} Let $k$ be prime, let $\beta$ be a column map, and suppose (A) and \begin{enumerate}[label=\textup{(\Alph*)}] \setcounter{enumi}{1} \item for each column part $P$, every nonempty subset of $P$ that contains the successors of its elements is $P$; \item both column parts have at least two elements. \end{enumerate} Then $K$ has no proper subsquare if and only if it has no cross intercalate. \end{corollary} \begin{proof} If $\beta(g, y)$ is the same for all $g$, then every successor $y'$ of $y$ satisfies $\beta(g + 1, y') = \beta(g + 1, y)$, so $y' = y$ since $\beta$ is injective on each sector. Hence $\{y\}$ contains the successors of its element, and by (B) the part of $y$ is $\{y\}$, contrary to (C). This proves (b). For (c), let $H$, $x$ and $z$ be as there. For each column part $P$ and each block $g$, the map $y \mapsto \beta(g, y)$ sends $(x + H) \cap P$ injectively into $(z + H) \cap P$. Both cosets have $|H|$ elements, so taking both parts together shows that all these maps are bijections. If $y'$ is a successor of an element $y$ of $(x + H) \cap P$, with $\beta(g + 1, y') = \beta(g, y)$, then $\beta(g + 1, y')$ lies in $(z + H) \cap P$, which is the image of $(x + H) \cap P$ under $\beta(g + 1, \cdot)$; by injectivity $y' \in x + H$. Thus $(x + H) \cap P$ contains the successors of its elements. It is not empty, since by (A) the orbit of $x$ under a nonzero element of $H$ meets $P$. By (B) it is $P$, for both parts, so $H = \Z_m$, contrary to the assumption on $H$. Now Theorem~\ref{thm:U} applies. \end{proof} For the proof let $S$ be a subsquare of $K$ of order at least $2$, with set of rows $A$, set of columns $B$ and set of symbols $\Sigma$, and let $E_j = \{v : (j, v) \in \Sigma\}$ be the values of its symbols of class $j$. Every row of $A$ carries every symbol of $\Sigma$ in exactly one column of $B$, and likewise for columns. In terms of the formula for $K$ this means, for $r \in A$ and $c \in B$, \begin{equation}\label{eq:E} E_j = \{x_r + \beta_j(c') : c' \in B,\ \cls(r, c') = j\} = \{x_{r'} + \beta_j(c) : r' \in A,\ \cls(r', c) = j\}, \end{equation} where the elements listed are distinct. \subsection{Translations and the large case} The proof rests on translations of the sets $E_j$. \begin{lemma}\label{lem:transl} If two rows $r \ne r'$ of $A$ lie in the same sector, then $E_j + (x_{r'} - x_r) = E_j$ for every class $j$, and $x_{r'} - x_r \ne 0$. If two columns $c \ne c'$ of $B$ lie in the same sector, then $E_j + (\beta_j(c') - \beta_j(c)) = E_j$ for every class $j$, and $\beta_j(c') - \beta_j(c) \ne 0$. \end{lemma} \begin{proof} Rows in the same sector give every column the same class by \eqref{eq:class}, so the cell $(r', c)$ has the class of $(r, c)$ and the value of $(r, c)$ plus $x_{r'} - x_r$. Hence $E_j + (x_{r'} - x_r) \subseteq E_j$, with equality since $E_j$ is finite. Two rows of one sector have different residues. The statement for columns is proved in the same way, using that $\beta$ is injective on each sector. \end{proof} If $E_j + d = E_j$, then \eqref{eq:E} shows that for $r \in A$ the values $\beta_j(c')$ of the cells of class $j$ of $r$ in $B$ form a set invariant under $d$, and so do the residues of the rows of $A$ with a cell of class $j$ in a column $c \in B$. By (A) such a set meets both parts whenever $d \ne 0$. This gives a \emph{move} that is used repeatedly below: from a cell of class $j$ of $r$ in $B$ one can move to another cell of class $j$ of $r$ in $B$ whose value of $\beta_j$ is shifted by any multiple of $d$, in particular into the other part, and back. \begin{proposition}\label{prop:large} Assume (A) and (c). If two rows of $A$ or two columns of $B$ lie in the same sector, then $B$ contains every column, so $S = K$. \end{proposition} \begin{proof} By Lemma~\ref{lem:transl} there are nonzero $d_0$ and $d$ with $E_0 + d_0 = E_0$ and $E_j + d = E_j$ for all $j \ne 0$. \emph{Every sector contains a row of $A$.} Let $j$ be a class with $E_j \ne \emptyset$, and let $r \in A$ lie in the sector $(h, a)$. By the proof of Lemma~\ref{lem:latin} the cells of class $j$ of $r$ lie in the columns of the sectors $(h + j + a, 0)$ and $(h + j, 1)$, and by (A) both contain a column of $B$. Conversely, a column of $B$ in the sector $(g, b)$ has its cells of class $j$ in the rows of the sectors $(g - j, 0)$ and $(g - j - (1 - b), 1)$, and both contain a row of $A$. Applying the first statement to a row in $(h, 0)$ and the second to the column in $(h + j, 1)$ gives a row in $(h, 1)$; applying them to a row in $(h, 1)$ and to the column in $(h + j + 1, 0)$ gives a row in $(h + 1, 0)$. Hence every sector contains a row of $A$, and then by the first statement both parts contain a column of $B$. \emph{Same residue in the next block.} Let $c \in B$ be lower, in the block $g$. A row $r \in A$ in the sector $(g, 0)$ has the cell $(r, c)$ of class $0$. Moving by a multiple of $d_0$ gives a column $c_1 \in B$ with a cell of class $0$ in $r$ and an upper residue, so $c_1$ lies in the sector $(g, 1)$. A row $r' \in A$ in the sector $(g, 1)$ has a cell of class $0$ in $c_1$, and moving back gives a column of $B$ with a cell of class $0$ in $r'$ and the residue of $c$; it is lower, so it lies in the block $g + 1$. If $c$ is upper, the same argument with the rows in $(g, 1)$ and $(g + 1, 0)$ applies. Thus with $(g, x)$ also $(g + 1, x)$ belongs to $B$, and hence $(g', x) \in B$ for every block $g'$. \emph{Cosets.} By the previous step $B$ consists of the columns $(g, x)$ with $g \in \Z_k$ and $x$ in a set $X$ of residues, and $X$ meets both parts. A row $r \in A$ has its cells of class $0$ in the columns with residues in $X$ (in a lower row the columns of its own block, in an upper row the upper columns of its block and the lower columns of the next), so $E_0 = x_r + X$ for every $r \in A$. Let $Y$ be the set of residues of the rows of $A$, and $H$ the subgroup of $\Z_m$ generated by the differences of elements of $Y$. Then $X + H = X$, so $X$ is a union of cosets of $H$ and $|H| \le |X|$, while $Y$ lies in one coset of $H$ and $|Y| \le |H|$. On the other hand $|A| = |B| = k|X|$, and at most $k$ rows have a given residue, so $|Y| \ge |X|$. Hence $X$ and $Y$ are cosets of $H$, and $A$ consists of all rows with residues in $Y$. For $c \in B$ the rows of class $1$ in the column $c$ are the rows of two sectors with different parts (proof of Lemma~\ref{lem:latin}), and their residues in $A$ form $Y$; thus $E_1 = Y + \beta(c)$, and all values $\beta(c)$ with $c \in B$ lie in one coset of $H$. As $X$ meets both parts, $H \ne \{0\}$, and (c) gives $H = \Z_m$. Hence $B$ contains every column. \end{proof} \subsection{Thin subsquares} From now on every sector contains at most one row of $A$ and at most one column of $B$; I call such a subsquare \emph{thin}. A row of $A$ then has at most one column of $B$ in each of its two sectors of class $j$, so each class has at most two symbols in $\Sigma$. \begin{lemma}\label{lem:allsectors} If some class has two symbols in a thin subsquare, then every sector contains a row of $A$ and a column of $B$. \end{lemma} \begin{proof} If $E_j$ has two elements, every row of $A$ has two cells of class $j$ in $B$, in different columns; as the subsquare is thin, these columns lie in its two sectors of class $j$. Likewise every column of $B$ has rows of $A$ in both of its row sectors of class $j$. Now the propagation in the first step of the proof of Proposition~\ref{prop:large} applies without change. \end{proof} If every sector meets a thin subsquare, the values of $\beta_j$ on its lower columns form an arithmetic progression, and (A) forces this progression to be constant. \begin{lemma}\label{lem:alt} Suppose that every sector contains exactly one row $\rho(g, b)$ of $A$ and exactly one column $\gamma(g, b)$ of $B$. Then for every class $j$ and every block $g$, \[ \beta_j(\gamma(g + 1, 0)) = \beta_j(\gamma(g, 0)). \] \end{lemma} \begin{proof} Write $f(g, b) = \beta_j(\gamma(g, b))$ and $x(h, b)$ for the residue of $\rho(h, b)$. The row $\rho(h, 0)$ has its cells of class $j$ in the columns $\gamma(h + j, 0)$ and $\gamma(h + j, 1)$, and the row $\rho(h, 1)$ in $\gamma(h + j + 1, 0)$ and $\gamma(h + j, 1)$. Let \begin{align*} a_h &= x(h, 0) + f(h + j, 0), & a'_h &= x(h, 0) + f(h + j, 1), \\ b_h &= x(h, 1) + f(h + j + 1, 0), & b'_h &= x(h, 1) + f(h + j, 1) \end{align*} be the four values. Since each row of $A$ carries every symbol of class $j$, $E_j = \{a_h, a'_h\} = \{b_h, b'_h\}$, and the Latin property gives $a_h \ne a'_h$, $b_h \ne b'_h$, $a'_h \ne b'_h$ (column $\gamma(h + j, 1)$) and $b_h \ne a_{h+1}$ (column $\gamma(h + j + 1, 0)$). Hence $b'_h = a_h$, $b_h = a'_h$ and $a_{h+1} = a_h$, $a'_{h+1} = a'_h$. With $D = a'_h - a_h \ne 0$, which does not depend on $h$, the first two equations give \[ f(g + 1, 0) = f(g, 0) + 2D \qquad \text{for all } g. \] All $f(g, 0)$ lie in the lower part, since $\beta_j$ maps a sector into its part. If $2D \ne 0$, then by (A) some $f(0, 0) + i \cdot 2D = f(i, 0)$ is upper, a contradiction. Hence $2D = 0$. \end{proof} \begin{proposition}\label{prop:onesym} Assume (A) and (b). In a thin subsquare every class has at most one symbol. \end{proposition} \begin{proof} Otherwise Lemma~\ref{lem:allsectors} applies. Lemma~\ref{lem:alt} with $j = 0$ shows that all lower columns $\gamma(g, 0)$ have one residue $y$, and with $j = 1$ that $\beta(g + 1, y) = \beta(g, y)$ for all $g$, contrary to (b). \end{proof} Thus in a thin subsquare each symbol of $\Sigma$ has its own class, and the order of $S$ is the number of classes present. For prime $k$ this number is $k$ as soon as two rows lie in the same part. \begin{lemma}\label{lem:classes} If $k$ is prime and two rows of a thin subsquare lie in different blocks and in the same part, then every class has a symbol in $\Sigma$. \end{lemma} \begin{proof} Let the rows be $r$ and $r'$, in the blocks $h$ and $h'$ and in the same part. If $r$ has a cell of class $j$ in a column $c \in B$, then by \eqref{eq:class} the cell $(r', c)$ has class $j + h - h'$, since $\varepsilon(r, c) = \varepsilon(r', c)$. Hence the set of classes present is invariant under adding $h - h' \ne 0$, and since $k$ is prime it is empty or all of $\Z_k$. \end{proof} \begin{proposition}\label{prop:orderk} Assume (A) and (b). If $k \ge 3$, no thin subsquare has exactly one symbol of every class. \end{proposition} \begin{proof} Suppose that $S$ has the symbol $(j, v_j)$ for every class $j$. Every row of $A$ has exactly one cell of each class in $B$, and likewise for columns. \emph{Position.} If $A$ has a lower row $r$ (in the block $h$) and an upper row $r'$ (in the block $h'$), then all columns of $B$ lie in one part. Indeed, for every block $g$ exactly one of the sectors $(g, 0)$, $(g, 1)$ contains a column of $B$ (they are the two sectors of class $g - h$ of $r$), and exactly one of $(g + 1, 0)$, $(g, 1)$ does (the two sectors of class $g - h'$ of $r'$). Thus a lower column in the block $g$ excludes an upper one there and forces a lower column in the block $g + 1$; by induction all columns are lower, or else none is. \emph{Different values.} Suppose $v_i \ne v_j$ for two classes $i, j \ne 0$, and put $w = v_i - v_j$. For $c \in B$ let $r$ be the row of $A$ with $\cls(r, c) = j$ and $c'$ the column of $B$ with $\cls(r, c') = i$. Then $x_r + \beta(c) = v_j$ and $x_r + \beta(c') = v_i$, so $\beta(c') = \beta(c) + w$. Hence the values of $\beta$ on $B$ form a set invariant under $w$, which meets both parts by (A); so $B$ has columns in both parts. In the same way the residues of the rows of $A$ are invariant under $-w$, so $A$ has rows in both parts. This contradicts the position statement. \emph{Equal values.} Otherwise all classes $j \ne 0$ have the same value $v$. Two rows $r, r' \in A$ have a common column $c \in B$ in which neither has its cell of class $0$, because $B$ has $k \ge 3$ columns; then $x_r + \beta(c) = v = x_{r'} + \beta(c)$. Hence all rows of $A$ have one residue $x$, every column $c \in B$ has $\beta(c) = v - x$ (from its row of class $1$) and residue $v_0 - x$ (from its row of class $0$). These $k$ columns lie in different sectors of one part, hence in all $k$ blocks: $B$ consists of the columns $(g, y)$ with $y = v_0 - x$, all with the same value of $\beta$, contrary to (b). \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:U}] The conditions are necessary, as shown after the statement. Conversely, assume (a), (b) and (c), and let $S$ be a proper subsquare. By Proposition~\ref{prop:large} it is thin, and by Proposition~\ref{prop:onesym} every class has at most one symbol in $\Sigma$. If two rows of $A$ lie in the same part, they lie in different blocks, and by Lemma~\ref{lem:classes} every class has exactly one symbol; for $k \ge 3$ this is excluded by Proposition~\ref{prop:orderk}, and for $k = 2$ the order is $2$. Otherwise $A$ has at most one row in each part, and again the order is $2$. A subsquare of order $2$ is an intercalate; its rows and columns lie in different sectors as $S$ is thin, and its two symbols have different classes. This contradicts (a). \end{proof}