Orthogonal trades in complete sets of MOLS

Let $B_p$ be the Latin square given by the addition table for the integers modulo an odd prime $p$. Here we consider the properties of Latin trades in $B_p$ which preserve orthogonality with one of the $p-1$ MOLS given by the finite field construction. We show that for certain choices of the orthogonal mate, there is a lower bound logarithmic in $p$ for the number of times each symbol occurs in such a trade, with an overall lower bound of $(\log{p})^2/\log\log{p}$ for the size of such a trade. Such trades imply the existence of orthomorphisms of the cyclic group which differ from a linear orthomorphism by a small amount. We also show that any transversal in $B_p$ hits the main diagonal either $p$ or at most $p-\log_2{p}-1$ times. Finally, if $p\equiv 1\mod{6}$ we show the existence of Latin square containing a $2\times 2$ subsquare which is orthogonal to $B_p$.


Introduction and Definitions
Let p be an odd prime. Consider the "complete" set of p − 1 MOLS of order p, constructed via the finite field of order p. (It is conjectured, but not yet proven, that a complete set of MOLS of order p is unique up to isomorphism.) The problem considered in this paper is how to change a "small" number of entries in one of these Latin squares so that it maintains orthogonality with at least one other Latin square in the complete set of MOLS.
To this end, for each k, 1 k p −1, define B p (k) to be the Latin square where the entry in cell (i, j) of B p (k) is given by ki + j, for each i, j ∈ Z p . (In the above and throughout this paper, arithmetic is performed modulo p with residues in Z p whenever the context makes this clear.) Then it is well-known that B p := {B p (1), B p (2), . . . , B p (p − 1)} is a set of p − 1 MOLS of order p. For convenience we often write B p instead of B p (1). The Latin squares B 7 and B 7 (3) are given in Figure 1. Observe that after each symbol is replaced by its subscript in B 7 , the Latin squares remain orthogonal. We will refer to this change as an orthogonal trade. We are interested in determining general properties of orthogonal trades; in particular lower bounds for the size of an orthogonal trade.
Considering a Latin square of order n to be a set of ordered (row, column, entry) triples (in this paper a subset of Z n ×Z n ×Z n ), a Latin trade is a subset T of a Latin square L such that there exists a partially filled-in Latin square T ′ (called a disjoint mate of T ) such that for each (i, j, k) ∈ T (respectively, T ′ ), there exists unique i ′ = i, j ′ = j and k ′ = k such that (i ′ , j, k), (i, j ′ , k) and (i, j, k ′ ) ∈ T ′ (respectively, T ). It follows that (L \ T ) ∪ T ′ is a Latin square not equal to L. In fact, Latin trades describe differences between Latin squares of the same order; see [2] for more details. We define an orthogonal trade (in B p ) of index (ℓ, k) to be a Latin trade T ⊂ B p (ℓ) such that there exists a disjoint mate T ′ such that (B p (ℓ) \ T ) ∪ T ′ is orthogonal to B p (k). Thus Figure 1 gives an example of an orthogonal trade in B p of index (1,3).
Using symmetries of B p , we may assume certain properties of an orthogonal trade therein. In this paper, k −1 is always taken to be the least nonnegative integer representing the congruence class of k −1 (mod p). Lemma 1.1. Let T be an orthogonal trade in B p of index (ℓ, k). Then we may assume, without loss of generality, that ℓ = 1, k k −1 and (0, 0, 0) ∈ T .
Proof. Let 1 x p−1. The mapping φ : (a, b, ax+b) → (a, b/ℓ, (ax+b)/ℓ) maps B p (x) onto B p (x/ℓ) and thus acts as a bijection on the set B p . We may thus assume that ℓ = 1. Next, the mapping φ ′ : (a, b, ax+ b) → (b, −a/x, (b− a)/x) maps maps B p (x) to B p (x −1 ) (again as part of a bijection on the set B p ), fixing B p (1) and mapping B p (k) to B p (k −1 ). We may thus assume k k −1 . Finally, if 0 i p−1, the map φ ′′ : (a, b, ax+b) → (a, b+i, ax+b+i) maps each element of B p to itself, allowing us to assume that (0, 0, 0) ∈ T .
It is possible, of course, to consider Latin trades which preserve orthogonality within pairs of MOLS that do not necessarily belong to B p . The spectrum of possible sizes of such Latin trades is explored in [6]. However for the rest of the paper we assume that any orthogonal trade is always in B p with the assumptions of the previous lemma.

The theory of Latin trades in B p
In this section we give relevant known results and theory of Latin trades in B p -that is, the operation table for the integers modulo p, also known as the back circulant Latin square. Since an orthogonal trade necessarily is also a Latin trade in B p , this theory will be useful in later sections.
A trade matrix A = [a ij ] is an m × m matrix with integer entries such that for all 1 i, j m: The following lemmas are implied by the theory in [3]. The results therein are expressed in terms of symbols rather than rows; however statements about rows, columns and symbols are equivalent due to equivalences of B p . Lemma 2.2. Let x 1 , x 2 , . . . , x m , x m+1 be the non-empty rows of a Latin trade T in B p . Then there exists an (m + 1) × (m + 1) trade matrix A such that AX = B, where X = (x 1 , x 2 , . . . , x m , x m+1 ) T , a ii gives the number of entries in row x i of T and B is an (m + 1) × 1 vector of integers, each a multiple of p. Moreover, the row and column sums of A are each equal to 0. We will also need the following corollary from the theory in [3]. Proof. If such a row exists, Equation (1) of [3] becomes 2x i ≡ 2x j (mod p), which implies x i = x j since p is odd, a contradiction to the rows being distinct.
Those readers who refer back to the detail in paper [3] may notice that the step of proving that a trade matrix has a non-zero determinant is omitted. However Theorem 3.2 in the next section addresses the original oversight from that paper.

Smallest orthogonal trade
In this section we give a lower bound on the number of times each symbol occurs in an orthogonal trade (Theorem 3.4) and an overall lower bound for the size of an orthogonal trade (Theorem 3.5).
Suppose that k = 1 and symbol s occurs in the rows in the set R = {r 1 , r 2 , . . . , r m } of an orthogonal trade T of index (1, k). Then clearly the set of columns of T which include s is equal to {s − r 1 , s − r 2 , . . . , s − r m }. Let φ be the devolution on R such that s occurs in the set of cells . Thus, considering orthogonality, the set of orthogonal ordered pairs {(s, (k − 1)r i + s) | r i ∈ R} must be covered after T is replaced by T ′ ; it follows that (1) We thus may define another permutation We thus obtain a linear system of the form Au = 0 (mod p), where u = (r 1 , r 2 , . . . , r m ) T and A is a square matrix of dimensions m × m with the following properties: (P1) Each entry of the main diagonal of A is k.
(P3) The sum of each row and column of A is 0.
Lemma 3.1. Any symbol in an orthogonal trade occurs at least 3 times.
Next, property (P3) above implies that det(A) = 0. From Lemma 1.1, we may assume without loss of generality that r 1 = 0. Let A ′ be the (m − 1) × (m − 1) matrix obtained by deleting the first row and column of A and let u ′ = (r 2 , . . . , r m ) T . Then A ′ u ′ = 0, where A ′ satisfies (P1), (P2) and the following properties: (P4) The sum of each row of A is 0 except for at least two rows which have a positive sum.
(P5) The sum of each column of A is 0 except for at least two columns which have a positive sum.
then A is non-singular.
Thus if A ′ is irreducible, we have from the previous theorem, det(A ′ ) = 0. However the case when A ′ is reducible can be dealt with in the following lemma, which is easy to prove. Thus there exists an m ′ × m ′ matrix A ′′ , satisfying (P1), (P2) and Equation (2) above, with non-zero determinant, where m ′ m. Moreover, A ′′ is a type of trade matrix as defined in the previous section. From Lemma 2.1, the determinant of A ′′ is bounded above by k m−1 . Thus from Lemma 2.3, p < k m−1 and we have shown the following. Theorem 3.4. Let K = min{k, k −1 }. The number of times each symbol occurs in an orthogonal trade is greater than log K p + 1.
We next find a lower bound on the size of T .
Proof. Let T contain m distinct symbols and let s i be the the number of But the function x/ log x is strictly increasing for x > e; thus the result follows from the previous theorem.

Orthogonal trades permuting entire rows
In this section we investigate the case when T and T ′ are constructed taking complete rows of B p and permuting them. It turns out that such orthogonal trades arise from considering a symbol from an arbitrary orthogonal trade.
Theorem 4.1. Let T be an orthogonal trade in B p . Let R be the set of rows that contain a particular symbol s in T . Then there exists an orthogonal trade of size p|R| constructed by permuting the rows of R.
Thus if we replace row r i with row φ(r i ) for each r i ∈ R we obtain an orthogonal trade.
In fact, the existence of an orthogonal trade permuting entire rows is equivalent to the existence of any matrix A satisfying properties from Section 2.  Then there exists an orthogonal trade T of index (1, k) whose disjoint mate T ′ is formed by permuting the rows r 1 , r 2 , . . . , r m of T .  Proof. From the theory in the previous section, the determinant of A ′ must be equal to k 2 − k + 1. However k 2 − k + 1 = 0 has a solution mod p if and only if −3 is a square mod p. Elementary number theory can be used to show that −3 is a square mod p if and only if p ≡ 1 mod 6. Finally, if p ≡ 1 mod 6, replacing row 0 with row 1, row 1 with row k and row k with row 0 in B p creates a Latin square which remains orthogonal to B p (k).
It is an open problem to determine whether there exists an orthogonal trade permuting a bounded number of rows for any odd prime p.

Orthogonal trades via Latin trades in B p
Our aim in this section is to construct an orthogonal trade T with index (1, 2) with disjoint mate T ′ such that T ′ permutes O(log p) entire rows of T . We do this by showing the existence of orthogonal Latin trades in B p with size O(log p). In order to prove Theorem 5.1 we modify a construction given by Szabados [10] which proved the following. Since our proof is a modification of that given in [10] (which was in turn inspired by classic results on dissections of squares by Brooks, Smith, Stone and Tutte [1,13] and Trustum [12]) we borrow from the notation given in [10].
A dissection of order k of a rectangle R with integer sides is a set of k squares of integral side which partition the area of the rectangle (i.e. they cover the rectangle and overlap at most on their boundaries). A dissection is said to be ⊕-free if no four of them share a common point.
For the following definition we position our rectangle R with a corner at the origin, its longest side along the positive x-axis and another side along the negative y-axis.
We say that a dissection is good if it is: (G1) ⊕-free; (G2) the square with the origin as a corner point has side at least 3; (G3) there is no line of gradient −1 intersecting corner points of more than one square; and (G4) the lines y = 1 − x and y = 2 − x do not intersect corner points of any square.
We wish to construct a good dissection of a rectangle of dimensions n × (n + 3) for any n 3. We first deal with small values of n. Proof. In every case, make one of the squares an n × n square with the origin as a corner point and another 3 × 3 subsquare with (n + 3, −n) as a corner point. Then (G2) and (G4) are satisifed. It is then easy to find a dissection of the remaining (n − 3) × 3 rectangle satisfying (G1) and (G3), using at most 6 squares for each case (one can simply use a greedy algorithm, cutting off a largest possible square at each step).     Proof. From the previous lemma, the result holds for 3 n 14. If n 15, write n = 4k + z where k 3 and z ∈ {3, 4, 5, 6} and use a dissection as in Figure 4, recursively using a good dissection of the k × (k + 3) rectangle with the length of each square doubled. Property (G2) of the smaller rectangle ensures that (G1) holds for the larger rectangle. Property (G2) clearly holds for the larger rectangle as k 3 > 0. Next, property (G4) (avoiding the line y = 1 − x) for the smaller rectangle ensures that (G3) holds for the larger rectangle. Finally, property (G4)(avoiding the line y = 2 − x) for the smaller rectangle ensures than (G4) holds for the larger rectangle. Note in the previous that y = 2 − x with respect to the larger rectangle cannot hit any corners of squares in the smaller rectangle because each square has even length side.
The proof of Theorem 5.1 now follows from the following theorem, which is outlined in [10] and first established in [7]. Theorem 5.6. Suppose there exists a good dissection of order k of an n × m rectangle. Then there exists a Latin trade T in the addition table for the integers modulo m + n (i.e. B m+n if m + n is prime) such that each entry of T appears exactly twice and T has size 2k + 2.
Proof. The proof follows from the construction, first given in [7], showing that a dissection of a right-angled isoceles triangle (with two sides of length p) into smaller, integer-sided right-angled isoceles triangles gives rise to a Latin trade T in B p , provided that no point is the vertex of 6 of the smaller triangles. In such a construction, the number of smaller triangles gives the size of the Latin trade. Reposition the triangle on the Euclidean plane so that its vertices have positions (0, 0), (0, p) and (p, 0). Then the coordinates of the vertices of the smaller triangles give precisely the cells of B p which T occupies.
Next, reposition the n × m rectangle so that its vertices have coordinates (0, 0), (0, m), (n, 0) and (m, n). Embed this rectangle into an isocoles rightangled triangle as above (with two equal sides of length n + m). Dissect each square in the good dissection into two triangles so that the sides of each triangle are parallel to the larger triangle. This gives a dissection of the right-angled triangle into 2k + 2 smaller right-angled isoceles triangles. Reposition the triangle as above.
Then in our construction, the line segements of gradient −1 contain the same symbol in B p . Each such line segment intersects only two corners of squares and thus only two vertices of triangles. Together with condition (G3), this ensures that each symbol occurs exactly twice in the Latin trade.
Note that each symbol occurs twice. For a general proof of why this construction gives a Latin trade, see [7].

Orthomorphisms of cyclic groups and transversals in B p
As in previous sections we assume that p is prime. An orthomorphism of the cyclic group Z p is a permutation φ of the elements of Z p such that φ(x) − x is also a permutation. We note that orthomorphisms have a more general definition for arbitrary groups. However in this section we assume that orthomorphisms are of the cyclic group only. Trivial examples of orthomorphisms are given by φ(x) = kx for any k, 2 k p − 1. Given any orthomorphism φ, construct a Latin square L φ by placing φ(r) + c in cell (r, c). Then by definition L φ is orthogonal to B p . Given two orthomorphisms φ and φ ′ , the distance between φ and φ ′ is defined to be the number of values x for which φ(x) = φ ′ (x). Corollary 4.3 implies the following result about orthomorphisms. Theorem 6.1. Let φ ′ be an orthomorphism not equal to φ(x) = kx. Then the distance between φ and φ ′ is at least log K p + 1 where K = min{k, k −1 }.
A transversal of a Latin square of order n is a set of ordered triples that include each row, column and symbol exactly once. Given any orthomorphism φ, the set of triples (x, φ(x) − x, φ(x)) is a transversal of B p . For example, if φ(x) = 2x we obtain a transversal on the main diagonal of B p . So we have the following corollary.
Corollary 6.2. Any transversal of B p not equal to the main diagonal has at least log 2 p + 1 elements off the main diagonal.
From Theorem 5.2, we also have the following.

A construction for an orthogonal trade with size not divisible by p
In this section we construct an orthogonal trade of size not divisible by p whenever p ≡ 1 (mod 6). Figure 1 gives the construction for p = 7. Figure 5 is an example of the construction for p = 13, where the trademate is shown via subscripts. Let k 2; since p ≡ 1 (mod 6) there exists k such that k 2 − k + 1 is divisible by p (since −3 is a square modulo p if and only if p − 1 is divisible by 6). Note that if k is a solution then 1 − k is also a solution modulo p; thus we assume in this section that k is an integer such that 2 k (p + 1)/2. We remind the reader that all values are evaluated modulo p with a residue between 0 and p − 1. We define the following subsets T 0 , T 1 , . . . , T k−1 of B p : and if 1 i k − 1, We then define T to be the union of all these sets; i.e.
The condition p > 2k −2 ensures that the above sets are disjoint. Observe that |T 0 | = 2(k − 1) and for each 1 i k − 1, |T i | = 3k − 2. Thus |T | = 3k(k − 1) which is not divisible by p. In the case where p = k 2 − k + 1 (where p and k are integers), the size of T is 3(p − 1), but in general may be larger relative to p.
We will show that T is a Latin trade which preserves orthogonality between the Latin squares B p and B p (k).
With this aim in view, we define a partial Latin square T ′ which we will show is a disjoint mate of T . Let and if 1 i k − 1, Note that for i = k − 1 the first set in T ′ i is empty and for i = 0 the last set is empty. We define T ′ to be the union of the above sets; i.e.
By observation, T and T ′ occupy the same set of cells and are disjoint. We next check that corresponding rows contain the same set of symbols. This is easy to check for row 0.
Thus row i(k −1) of T ′ contains the same set of symbols as the corresponding row of T .
Next, row i(k − 1) + 1 of T ′ contains the symbols {i(k − 1) Thus row i(k − 1) + 1 of T ′ contains the same set of symbols as the corresponding row of T . We have shown that T and T ′ share the same sets of symbols in correpsonding rows.
We now show this property for the columns. It suffices to show that each symbol in a column of T ′ occurs within the same column of T . First consider elements of T ′ 0 . Let 0 j k − 2. Then symbol j + k in cell (0, j) of T ′ 0 belongs also to cell (k, j) of T 1 . Moreover symbol j in cell (0, k + j) of T ′ 0 belongs also to cell ((k − 1) 2 , k + j) of T k−1 since (k − 1) 2 + k is divisible by p.
In this paragraph we deal with symbols which occur in row i(k − 1) of T ′ i for some 1 i k − 1. Consider symbol i(k − 1) + j + k in column j of T ′ i where i j k −2. This symbol also lies in cell ((i+ 1)(k −1) . This symbol lies in cell Finally, to verify that T ′ is indeed a disjoint mate of T , we look at symbols which occur in row i(k − 1) + 1 of T ′ i for some 1 i k − 1. Consider symbol i(k − 1) + j + k which occurs in column j of T ′ i where 0 j i − 1. This symbol occurs in cell ((i + 1)(k − 1) We have shown that T is a Latin trade in B p with disjoint mate T ′ . Next we show orthogonality. it suffices to show that for each element (r, c, r + c) ∈ T , there is a cell (r ′ , c ′ ) ∈ T ′ containing r + c such that (r ′ , c ′ ) contains rk + c in B p (k) (equivalently, r ′ k + c ′ = rk + c).
Firstly, let (0, j, j) i+1 . An intercalate in a Latin square is a 2 × 2 subsquare. The construction in this section shows the potential of using trades to construct MOLS with particular properties. We demonstrate this with the following theorem.
Theorem 7.1. Let p be a prime such that p ≡ 1 (mod 6). Then there exists a Latin square L orthogonal to B p such that L contains an intercalate.
Proof. Let L := (B p \ T ) ∪ T ′ , where T and T ′ are defined as in this section. We have shown above that L is orthogonal to B p (k). Observe that (k − 1, 1, 2k), (k −1, k, k) and (k, 1, k) are each elements of T ′ 1 and thus L. Finally, cell (k, k) is not included in T so (k, k, 2k) ∈ L.

Computational results
In this section, we give some computational results on the spectrum of the possible sizes of orthogonal trades mentioned in the previous sections. These orthogonal trades can be found as ancillary files in [4].
Let S p be the set of sizes so that an orthogonal trade in B p of index (1, k) exists for some k. For p = 5, S 5 = {0, 10, 15, 20, 25}.
The results for p = 7 and p = 11 are summarised in the following lemma. Note that an orthogonal trade in B 7 of size 18 is given in Figure 1.
Our theoretical results only considered orthogonal trades when p is prime. A similar question can be studied for odd values of p in general. Here B p (1) is orthogonal to B p (k) if and only if k ≡ 1 mod p. Then the spectrum of the sizes of orthogonal trades in B 9 is the set {0, 6, 9, 12, 15, 16, 18, 19, . . . , 81}.
Here, the non-trivial cases occur when the number of rows are not p − 1 or p. So, we continue with only those cases.
Next, we consider the orthogonal trades in B p which preserve orthogonality with three other MOLS from the complete set of size p − 1. The possible number of rows needed to be permuted are the sets {5, 9} and {6, 11} for p = 11 and 13, respectively.
The orthogonal trades which preserve orthogonality with four of the p − 1 MOLS can be constructed by permuting 6 or 11 rows for p = 13. Lastly, an orthogonal trade which preserve orthogonality with five of the p − 1 MOLS cannot be constructed by permuting entire rows for these orders.