Transversals, near transversals, and diagonals in iterated groups and quasigroups

Given a binary quasigroup $G$ of order $n$, a $d$-iterated quasigroup $G[d]$ is the $(d+1)$-ary quasigroup equal to the $d$-times composition of $G$ with itself. The Cayley table of every $d$-ary quasigroup is a $d$-dimensional latin hypercube. Transversals and diagonals in multiary quasigroups are defined so as to coincide with those in the corresponding latin hypercube. We prove that if a group $G$ of order $n$ satisfies the Hall--Paige condition, then the number of transversals in $G[d]$ is equal to $ \frac{n!}{ |G'| n^{n-1}} \cdot n!^{d} (1 + o(1))$ for large $d$, where $G'$ is the commutator subgroup of $G$. For a general quasigroup $G$, we obtain similar estimations on the numbers of transversals and near transversals in $G[d]$ and develop a method for counting diagonals of other types in iterated quasigroups.


Introduction
A latin square of order n is the Cayley table of a binary quasigroup of order n, i.e., an n × n-table filled by n symbols so that each line (row or column) contains all symbols. A transversal in a latin square of order n is a set of n entries filled by all different symbols such that there is exactly one entry from the set in each row and each column.
In algebraic terms, transversals in binary groups and quasigroups G correspond to complete mappings. A bijection ϕ : G → G is called a complete mapping if the mapping x → x * ϕ(x) is bijective.
The most intriguing conjecture on transversals in latin squares belongs to Ryser [18].
Conjecture 1 (Ryser's conjecture). Every latin square of odd order has a transversal.
Here a near transversal in a latin square of order n is a diagonal that contains at least n − 1 different symbols.
It happens that both of these conjectures are true for groups. The following statement, known as the Hall-Paige conjecture, describes all groups with transversals in their Cayley tables.
Theorem 1 (Hall-Paige conjecture). The Cayley table of a group G has a transversal if and only if every Sylow 2-subgroup of G is trivial or non-cyclic.
The Hall-Paige conjecture first appeared in [14] and was open for quite a long time. It was proved (modulo the classification of finite simple groups) in a series of papers of Wilcox [26], Evans [9] and Bray [2]. Recently in preprint [8] there was given an alternative (asymptotic) proof for the conjecture. Concerning Brualdi's conjecture, in [12] it was proved that the Cayley table of every group contains a near transversal.
Note that the Hall-Paige conjecture includes the easy observation that the Cayley table of every group of odd order has a transversal. Further, we will say that a group is a Hall-Paige group if its Sylow 2-subgroups are trivial or non-cyclic.
Alongside the existence, it is also interesting to know how many transversals a latin square has. An asymptotic upper bound on the number of transversals was proved in [20] and in [10] by another technique. In [7], Eberhard, Manners, and Mrazović found the asymptotics of the number of transversals in the Cayley table of cyclic groups Z n of odd order n, later Eberhard established it for arbitrary (iterated) abelian groups [6], and recently these researchers submitted a preprint [8] with a similar result for all groups.
Theorem 2 ( [8]). Let G be a Hall-Paige group of order n and G ′ be the commutator subgroup in G. Then the number of transversals in the Cayley table of G is n! |G ′ |n n−1 · n!(e −1/2 + o(1)).
While studying latin squares, we can increase not only their order but also their dimension. Let a d-dimensional latin hypercube of order n be a d-dimensional array of the same order filled by n symbols so that in each line all symbols are different. Latin hypercubes can be considered as the Cayley tables of d-ary quasigroups of order n. A transversal in a latin hypercube of order n is a collection of n entries hitting each hyperplane exactly once and containing all n different symbols of the hypercube. For more formal definitions of latin hypercubes and their transversals see Section 2.
Wanless [25] generalized Ryser's conjecture on latin hypercubes and proposed that every latin hypercube of odd dimension or odd order has a transversal. As far as we know, there is no evidence against the generalization of Brualdi's conjecture on latin hypercubes.

Conjecture 3. Every latin hypercube has a near transversal.
In the present paper we focus on a special class of latin hypercubes corresponding to diterated quasigroups. Such quasigroups have applications in cryptography (see e.g. [11]), and their transversals were previously studied in paper [23] of the present author.
Given a binary quasigroup G of order n with the operation * , define the d-iterated quasigroup G[d] to be the (d + 1)-ary quasigroup of order n such that There were several results on transversals in iterated groups and quasigroups of small order before. The numbers of transversals in both d-iterated groups of order 4 were calculated in [22], and the numbers of transversals in d-dimensional latin hypercubes of orders 2 and 3 were found in [21]. Moreover, in [21,Theorem 26] it was proved that for all even d every d-iterated quasigroup has a transversal. One of the main results of [23] states that for every binary quasigroup G of order n there is c = c(G) such that the number of transversals in the d-iterated quasigroup G[d] (if it is nonzero) asymptotically equals cn! d (1 + o(1)).
The present paper significantly refines the technique and results from [23] and gives the exact asymptotic of the number of transversals in d-iterated groups. Theorem 3. Let G be a group of order n and G ′ be the commutator subgroup of G. Then the following hold.
It is interesting to note that Theorems 2 and 3 give similar asymptotics for the number of transversals. It seems probable that Theorem 2 admits an extension to the case of arbitrary d-iterated groups of large order (see [6]).
For a general quasigroup we prove the following result.
Theorem 4. Let G be a binary quasigroup of order n. There is d 0 ∈ N such that for all d ≥ d 0 one of the following possibilties for transversals in iterated quasigroups G[d] occurs: • every iterated quasigroup G[d] has a transversal; • G[d] has no transversals when d is odd and contains transversals when d is even.
There is an integer Theorems 3 and 4 imply that iterated abelian groups have the asymptotically maximal number of transversals among all iterated quasigroups, that answers one of the questions from [23].
The method developed in this paper allows us to count not only transversals but other types of diagonals and structures in iterated quasigroups. For instance, we prove the following result for near transversals being in line with Conjecture 3.
Theorem 5. Let G be a binary quasigroup of order n. 2. There is an integer r = r(G), 1 ≤ r ≤ n, such that the number N(d) of near transversals in has a transversal, and c(G, d) = n 2 r otherwise. If G is a group, then r = |G ′ |.
Recall that we treat a near transversal in a latin hypercube of order n as a set of n entries filled by n or n − 1 different symbols.

Main definitions and preliminaries
In what follows, I n stands for the set {1, . . . , n} and I k n is used for the set of all k-tuples with entries from I n .
An n-tuple W ∈ I n n , W = (w 1 , . . . , w n ), with different entries w i in all positions is said to be a permutation. Let W denote the set of all permutations and W be the identity permutation (1, . . . , n). Let us denote by a the n-tuple from I n n all of whose entries are equal to a. Given a tuple V ∈ I n n , we use V i (b) for a tuple from I n n that coincides with V in all positions except, possibly, the i-th position, in which V i (b) equals b. For a permutation π ∈ S n and a tuple V ∈ I n n , V = (v 1 , . . . , v n ), let π(V ) = (π(v 1 ), . . . , π(v n )) and V π = (v π(1) , . . . , v π(n) ).
A binary quasigroup G of order n is defined by a binary operation * over a set I n satisfying the following condition: for each a 0 , a 1 , a 2 ∈ I n there exist unique x 1 , x 2 ∈ I n such that both a 0 = a 1 * x 2 and a 0 = x 1 * a 2 hold. A d-ary quasigroup f of order n is a function f : I d n → I n such that the equation x 0 = f (x 1 , . . . , x n ) has a unique solution for any one variable if all the other n variables are specified arbitrarily.
A composition of a d-ary quasigroup f and a k-ary quasigroup g of orders n is the (d+k−1)-ary quasigroup h of order n such that for some permutation σ ∈ S d+k it holds In this paper we mostly will work with the composition of quasigroups f and g defined as Given a binary quasigroup G of order n with the quasigroup operation * , the d-iterated quasigroup G[d] is the (d + 1)-ary quasigroup of order n obtained as the composition of d copies of the quasigroup G with itself: In particular, the 0-iterated quasigroup G[0] is the identity 1-ary mapping (G[0](x) = x for all x), and the 1-iterated quasigroup G [1] coincides with the binary quasigroup G.
A d-dimensional latin hypercube Q of order n is the Cayley table of a d-ary quasigroup of the same order. Equivalently, a d-dimensional latin hypercube of order n is an array indexed by elements from I d n , whose entries take values from the set I n so that in each line (1-dimensional plane) of the array all n symbols occur. In what follows, we identify a d-ary quasigroup and the corresponding d-dimensional latin hypercube.
Every d-ary quasigroup f = f (x 1 , . . . , x d ) of order n can be considered as an imaging of the first coordinate x 1 by the action of all other coordinates x 2 , . . . , x d . Similarly, for any k-tuple U from I k n we can find an image V of the tuple U in the d-ary quasigroup f by the action of k-tuples W 1 , . . . , W d−1 ∈ I k n from the relation f (U, W 1 , . . . , W d−1 ) = V satisfied entrywise. Let us use this approach to define a collection of elements in a quasigroup which are close to being diagonals.
Given a d-ary quasigroup f , define an U-diagonal of type V to be a collection of permutations (W 1 , . . . , W d−1 ), W i ∈ W, for which the equality f (U, W 1 , . . . , W d−1 ) = V holds entrywise. We define a transversal in a quasigroup f to be an arbitrary W-diagonal of type W , where W is a permutation.
In the definition of U-diagonals of type V , we require that the middle tuples W 1 , . . . , W d−1 are permutations only because in the framework of this study we are interested in transversals and diagonals. For other structures in latin hypercubes, one can take the tuples W 1 , . . . , W d−1 from any other appropriate class.
Given a d-ary quasigroup f of order n, define the transition matrix T to be the matrix of order n n with entries t U,V , U, V ∈ I n n , equal to the number of U-diagonals of type V in the quasigroup f . Note that for every d-ary quasigroup of order n, the transition matrix T is an integer nonnegative matrix with row and column sums equal to n! d−1 .
For an illustration of the introduced concepts, consider the following simple example. Example 1. Let G be a binary quasigroup (and group) of order 2 with the Cayley table * 1 2 1 1 2 2 2 1 The set I 2 2 consists of four tuples: (1, 1), (1, 2), (2, 1), (2, 2), with two of them being permutations: (1,2), (2,1). The transition matrix T of the quasigroup G is the following matrix of order 4, in which a diagonal given by the first permutation is highlighted in bold text and the other is highlighted in italics: Let us establish several properties of transition matrices. Firstly, we consider the transition matrices of isotopic binary quasigroups.
Binary quasigroups (G, * ) and (H, ·) are called isotopic if there are bijections α, β, γ : G → H such that α(x) · β(y) = γ(x * y) for all x, y ∈ G. Appealing to the terms of latin squares, we will say that α is a row isotopy, β is a column isotopy, and γ is a symbol isotopy. Proof. The proof is by induction on d. For d = 0 and d = 1 the statement of the lemma follows from definitions.
Assume that the (d−1)-iterated quasigroup G[d−1] has the transition matrix R = T d−1 , R = (r U,V ). To prove the induction step, we note that a collection of permutations (W 1 , . . . , if and only if for some tuple Z ∈ I n n the collection (W 1 , . . . , Summing up, we see that the problem of the asymptotics of the numbers of U-diagonals of type V in iterated quasigroups G[d] is equivalent to the question of the asymptotic behavior of the powers of the transition matrices T of G.

Perron-Frobenius theory, equivalence classes, and units
To study the behavior of powers of a transition matrix T , we use some results of Perron-Frobenius theory.
A matrix A = (a i,j ) is said to be nonnegative if all a i,j ≥ 0. A nonnegative matrix is called doubly stochastic if the sum of entries of A in each row and column equals 1. Let J n denote the doubly stochastic matrix of order n, whose entries all equal 1/n.
A nonnegative matrix A is called irreducible if for each pair of indices (i, j) there is l ∈ N such that the (i, j)-th entry of A l is positive. The period of an irreducible matrix can be defined as the greatest common divisor of all l for which the (i, i)-th entries of A l are positive for all i.
The following property can be found in [16] or it can be easily derived from definitions.
Theorem 6 ( [16]). For every doubly stochastic matrix A there is a permutation matrix P such that where B i are irreducible doubly stochastic matrices.
From the Perron-Frobenius theory, we have the following result for irreducible doubly stochastic matrices.
Theorem 7. Let A be an irreducible doubly stochastic matrix of order n and period τ . After appropriate simultaneous permutations of rows and columns, we have the following limits for powers of A: Moreover, for all i, j ∈ {1, . . . , n} there is r ∈ {0, . . . , τ − 1} such that the (i, j)-entry of the t-power of A is nonzero only if t ≡ r mod τ .
Note that, for a given binary quasigroup G of order n with transition matrix T , the matrix n! −1 T is a doubly stochastic matrix of order n n . By Theorem 6, there is a permutation matrix P for which where B i are some irreducible doubly stochastic matrices. Next, there is a simultaneous permutation of rows and columns of P T P −1 that preserves its block-diagonal form and puts each block B i into a block matrix whose limits and structure are given by Theorem 7. In what follows, we assume everywhere that the transition matrix T has the described block-diagonal form. For a given binary quasigroup G, we divide the set of all n-tuples I n n into m = m(G) equivalence classes U 1 , . . . , U m such that each equivalence class U i is exactly the set of rows (or columns) of the block B i of the transition matrix T . In particular, tuples U and V belong to the same equivalence class U i if and only if there exists a U-diagonal of type V in G[d] for some d. Let the period τ i of the equivalence class U i be the period of the irreducible block B i . By Theorem 7 and the construction of matrix T , we divide each equivalence class U i into τ i subsets Y i 1 , . . . , Y i τ i of equal sizes defined by the following property: For the binary quasigroup G of order 2 from Example 1, the set of all tuples I 2 2 composes the single equivalence class U 1 , which consists of two units:

Diagonals in iterated quasigroups
By Theorem 7, the question on the asymptotic behavior of the number of U-diagonals of type V in a d-iterated quasigroup G[d] is reduced to studying of the properties and sizes of equivalence classes and units produced by the transition matrix T . In the present section, we carry out this research.
To distinguish equivalence classes and their units, we use n-tuples a i (b), whose entries all equal a, except the i-th position, which is equal to b. We stress that this notation includes the possibility that b = a.
We start this section with the fact that every equivalence class contains at least one tuple of the form a i (b). Proposition 1. Let G be a binary quasigroup of order n. Then for each n-tuple V ∈ I n n and a, i ∈ I n there is b ∈ I n and k ∈ N such that there exists a V -diagonal of type Proof. The proof is by induction on the number of positions in which tuple V is distinct from Assume that the tuple V is different from some tuples a i (b) in at most k positions, k ≥ 1. Without loss of generality, suppose that i equals n, the tuple V equals a in the first n − k − 1 positions and it is different from a in positions n − k, . . . , n: V = (a, . . . , a, v n−k , . . . , v n ).
Consider permutations W, W ′ ∈ W, W = (w 1 , . . . , w n ), W ′ = (w ′ 1 , . . . , w ′ n ), such that the following equalities hold In other words, we demand that (V * W ) * W ′ = V ′ for some n-tuple V ′ , whose first n − k positions are equal to a. Let us show that such permutations W and W ′ exist. Firstly, we chose their entries w n−k and w ′ n−k so that the equality (v n−k * w n−k ) * w ′ n−k = a holds. Note that for every a ∈ I n there are exactly n different pairs (w, w ′ ) satisfying the equality (a * w) * w ′ = a. The choice of w n−k and w ′ n−k spoils no more than two of these pairs, so we are able to find n − k − 1 different pairs (w 1 , w ′ 1 ), . . . , (w n−k−1 , w ′ n−k−1 ) for the first components of permutations W and W ′ . All other components of permutations W and W ′ are arbitrary.
Thus we have found a tuple V ′ different from tuples a i (b) in at most k − 1 components and for which there is a V -diagonal of type V ′ in G [2]. By the assumption of induction, there is a To estimate the sizes and numbers of equivalence classes and their units, we prove the following proposition.
Proposition 2. Let G be a binary quasigroup of order n. Then for given a, j ∈ I n every unit contains at least one of the tuples a j (b), b ∈ I n . Moreover, for a given equivalence class U i , each unit Y i k from this class contains the same number of tuples a j (b).
Proof. By Proposition 1, for given a, j ∈ I n each equivalence class U i contains at least one of the tuples a j (b), b ∈ I n . Let Y i 1 , . . . , Y i τ i be the units in an equivalence class U i . Note that one can always find a pair of permutations W, W ′ ∈ W such that (a j (b) * W ) * W ′ = a j (b ′ ) for some b ′ ∈ I n . By definition of units and since Y i 1 , . . . , Y i τ i is a partition of the equivalence class U i , if a j (b) belongs to some unit Y i k , then the unit Y i l with l ≡ k + 2 mod τ i contains some tuple a j (b ′ ). From this and Proposition 1 we deduce that all units within an equivalence class U i contain tuples of the form a j (b), b ∈ I n .
Assume that a j (b 1 ), . . . , a j (b l ) are all tuples of such a form in a unit Y i k , and that a j (c 1 ) is from any other unit Y i k ′ . By definition of units and equivalence classes, there is some d ∈ N for which there exists an a j (b 1 )-diagonal of type a j (c 1 ) in G[d] corresponding to a collection of permutations (W 1 , . . . , W d ). Note the same collection of permutations gives a j (b s )-diagonals of type a j (c s ) in G[d], s = 1, . . . , l, with all c 1 , . . . , c l being distinct. So each unit Y i k ′ in the class U i contains the same number of tuples of the form a j (b), b ∈ I n , as the unit Y i k . As a trivial corollary of Proposition 2, we see that the total number of all units across all equivalence classes is not greater than the order n of G.
Recall that for a given n-tuple V we use V i (b) for denoting the n-tuple that coincides with V in all but the i-th position and equals b in the i-th position. Let Proposition 3. Let G be a binary quasigroup of order n and Y i 1 , . . . , Y i τ i be the units in an equivalence class U i . Then for all V ∈ I n n and j ∈ I n each unit Y i k contains the same number r i of tuples from the set V * j .
Proof. Proposition 1 and definition of units imply that each unit Y i k in an equivalence class U i contains at least one tuple from the set V * j . Acting similar to the proof of Proposition 2, we see that the number of tuples from V * j in Y i k coincides with the number of canonical tuples a j (b) in this unit. Recall that, by Theorem 7, each unit within an equivalence class U i has the same size, so units Y i k contain the same number r i of tuples from V * j . Note that Proposition 3 is equivalent to the following fact: for all tuples U, V ∈ I n n and i ∈ I n , every d-iterated quasigroup G[d] with large enough d has a U-diagonal of type V i (a) for an appropriate a ∈ I n . As a simple corollary of Proposition 3, we have the below estimation on the sizes of units. Corollary 1. Let G be a binary quasigroup of order n. There exist integers r i , 1 ≤ r i ≤ n such that each unit in an equivalence class U i has cardinality r i n n−1 .
Using similar ideas, let us prove that units and equivalence classes are closed under permutations of positions.
Proposition 4. Given a binary quasigroup G of order n, if a tuple V ∈ I n n belongs to a unit Y of an equivalence class U, then every tuple V π , whose coordinates are permuted by π ∈ S n , belongs to Y.
Proof. It is sufficient to show that there exists a set of tuples S ⊂ Y such that for all U ∈ S and permutations π ∈ S n the tuple U π belongs to S. Indeed, for every tuple V ∈ Y, we can find a tuple U ∈ S such that there exists a U-diagonal of type V in some G[d] given by a collection of permutations (W 1 , . . . , W d ). Applying π to coordinates of tuples U, V , and W i , i = 1, . . . , d, we obtain an U π -diagonal of type V π in G[d]. Since U π belongs to Y, the tuple V π is also from the unit Y.
Let us find the required set S. By Proposition 2, every unit Y has a tuple a j (b) for any a, j ∈ I n and certain b ∈ I n . Let r be the number of tuples of the form a j (b) in Y for given a, j ∈ I n . By definitions of units, there are collections of permutations D i = (W i 1 , . . . , W i d ) corresponding to a 1 (b i )-diagonals of types a 2 (c i ). Here a 1 (b i ) and a 2 (c i ) are all tuples of such a form in the unit Y, i = 1, . . . , r. For every k ∈ I n , k = 1, there is a permutation of coordinates π k ∈ S n such that the collections D π k i correspond to a 1 (b i )-diagonals of types a k (c i ). Since all c i are different, the sets {a k (c 1 ), . . . , a k (c r )} consist of all tuples of the form a k (b). Using similar reasoning for other coordinates of tuples, we conclude that S = {a i (c j )}, i ∈ I n , j = 1, . . . , r, is the set of all tuples of such a form in the unit Y. It is easy to see that S is closed under permutations of coordinates.
A direct corollary of Proposition 4 is that all permutations W are contained in a single unit of some equivalence class. Without loss of generality, let U 1 be the equivalence class including the set W.
Since we are interested in transversals and W-diagonals of other types in iterated quasigroups, we pay special attention to the class U 1 . Most significantly, the class U 1 has several remarkable properties that other equivalence classes do not possess.
Lemma 3. Let G be a binary quasigroup of order n. Then the period τ 1 of the class U 1 is not greater than 2. Moreover, all permutations W ∈ W and tuples a, a ∈ I n , belong to the equivalence class U 1 .
Proof. Since G is a quasigroup, for every permutation W ∈ W and a ∈ I n there are permutations W ′ , W ′′ ∈ W such that W * W ′ = a and a * W ′′ = W . In other words, the quasigroup G = G [1] contains W -diagonals of type a and a-diagonals of type W . Therefore, a and W belong to the same equivalence class and the period of this class is equal to 1 or 2.
For the equivalence class U 1 we can refine the general estimation on the size from Corollary 1 with the help of the following quasigroup invariant.
Given a binary quasigroup G, define P k (G) to be the set of all elements of G that allow a factorization (ordered and bracketed in any way) containing every element of G precisely k times. For shortness, let P (G) = P 1 (G).
For all k ∈ N it holds P k (G) ⊆ P k+2 (G), since for each g ∈ P k (G) there is h ∈ G such that g * h = g and h can be presented as a product f 1 * f 2 exactly n times, where f 1 ranges over the elements of G as f 2 also ranges over the elements of G. Note that there are examples where P k (G) ⊆ P k+1 (G), e.g., when G is Z 4 .
Let us define the set P ∞ (G) = ∞ i=1 P i (G). It is well defined due to P k (G) ⊆ P k+2 (G) and G is a finite quasigroup. It is easy to check that P ∞ (G) is a subquasigroup in G.
For a tuple V ∈ I k n , From the definitions of sets P ∞ (G) and Π(V ), we have the following property.
Proposition 5. Let G be a quasigroup of order n. Then for every tuple V ∈ U 1 it holds Π(V ) ∈ P ∞ (G).
Proof. It is sufficient to note that for every V ∈ U 1 there is a collection of permutations From this statement, we have the following bound on the size of U 1 .
Corollary 2. Given a binary quasigroup G of order n, the cardinality of the equivalence class Proof. By Proposition 3 and Corollary 1, the size of the equivalence class U 1 is equal to pn n−1 , where p is the number of tuples from the sets V * j in the class U 1 . For a given V ∈ I n n there are exactly |P ∞ (G)| tuples U ∈ V * j with Π(U) ∈ P ∞ (G). By Proposition 5, for every U ∈ U 1 we have Π(U) ∈ P ∞ (G), therefore the constant p is not greater than |P ∞ (G)|.
Unfortunately, the size of the class U 1 for a quasigroup G is not defined by |P ∞ (G)| and we cannot distinguish tuples U and V from different equivalence classes by the sets Π(U) and Π (V ). It is easy to see that G is isotopic to the group Z 2 2 by the means of transposition of the first two rows.
By Lemma 6 from the next section, the group Z 2 2 has four equivalence classes U 1 , . . . , U 4 of period 1, where U i = {V |Π(V ) = i}. With the help of Lemma 1, we obtain that the quasigroup G has three equivalence classes: Here classes U ′ 1 and U ′ 2 have period 1, and the class U ′ 3 has period 2. It can be verified directly that there are tuples U ∈ U ′ 1 and V ∈ U ′ 2 (e.g. U = (1, 2, 3, 4) and V = (1, 1, 3, 4)) such that Summarizing obtained results, we prove the main theorem of the present section that describes diagonals in a general iterated quasigroup. Theorem 8. Let G be a binary quasigroup of order n, U, V ∈ I n n , and U 1 , . . . , U m be the partition of I n n into equivalence classes of periods τ 1 , . . . , τ m , respectively. Suppose that all units of a class U i have sizes r i n n−1 , 1 ≤ r i ≤ n. Then the following hold: • If tuples U and V belong to different equivalence classes, then for all d ∈ N there are no U-diagonals of type V in the d-iterated quasigroup G[d].
• If both U and V belong to the same equivalence class U i , then there is 0 ≤ k ≤ τ i − 1 such that for all d greater than some d 0 ∈ N the number where M i is the size of units in the equivalence class U i , for which U, V ∈ U i . The sizes of units were estimated in Corollary 1.

Diagonals in iterated loops and other special quasigroups
In this section, we consider how additional conditions on a quasigroup G affect equivalence classes and their units. We start with quasigroups having the right inverse-property.
A quasigroup (G, * ) is said to have the right inverse-property if there is a permutation π of the set G such that (g * h) * π(h) = g for all g, h ∈ G. Proposition 6. Let G be a binary quasigroup with the right-inverse property. Then each equivalence class U i has period 1 or 2.
Proof. By Proposition 2, each equivalence class U i of G contains tuples of the form a j (b). Since G has the right inverse-property, for every permutation W ∈ W there is a permutation W ′ ∈ W such that (a j (b) * W ) * W ′ = a j (b). Thus the period of the tuple a j (b) from U i is not greater than 2.
The right-inverse property (and the complementary left-inverse property) was introduced in book [1]. If a quasigroup G has the left and right inverse-properties, then G is said to be a quasigroup with the inverse property or an IP-quasigroup. For more information on inverse properties of quasigroups see [15].
Next, we consider the case of loops. A quasigroup G is said to be a loop if there is the identity element e ∈ G such that for each g ∈ G it holds e * g = g * e = g.
Given a loop G, a normal subloop of G is defined in the same way as for a general algebraic system. Let the commutator subloop G ′ of a loop G be the smallest normal subloop of G such that G/G ′ is an abelian group.
In [17] it was proved a number of properties of sets P k (G) and P ∞ (G), when G is a loop. For example, the set P ∞ (G) is a subloop of G and for every k ∈ N the set P k (G) is contained in a single coset of G ′ . Moreover, if P ∞ (G) is a normal subloop, then P ∞ (G) = G ′ or P ∞ (G) = G ′ ∪ gG ′ , where g * g ∈ G ′ .
These results give the following improvement on the sizes of units in the equivalence class U 1 .

Proposition 7.
If G is a loop of order n, then the size of units in the equivalence class U 1 is equal to rn n−1 for some integer r, 1 ≤ r ≤ |G ′ |.
Proof. By definitions, there is k ∈ N such that for every tuple V from a unit Y of the class U 1 it holds Π(V ) ∈ P k (G). Since P k (G) is contained in a single coset of G ′ , we have |P k (G)| ≤ |G ′ |. Acting similar to the proof of Corollary 2, we obtain the required statement.
We don't know how to efficiently find equivalence classes and units and estimate their sizes for a general binary quasigroup G. It seems probable that in this case they cannot be expressed in terms of some algebraic invariant and mostly depend on the structure of the Cayley table of the quasigroup. To illustrate this, consider the following example. Moreover, for all a, b ∈ I n we have a * b ∈ S 2 if a and b belong to different symbol sets, and a * b ∈ S 1 otherwise. We will say that a tuple V ∈ I n n is even if V contains an even number of symbols from each of the sets S 1 and S 2 , and that V is odd otherwise. It is easy to check that if k is even (n ≡ 0 mod 4), then for every permutation W ∈ W the tuple V * W has same parity as V , and if k is odd (n ≡ 2 mod 4), then V * W has the different parity.
Therefore, for n ≡ 0 mod 4 the quasigroup G has at least two different equivalence classes (composed of odd or even tuples), and for n ≡ 2 mod 4 each (possibly unique) equivalence class of G contains at least two units.

Diagonals in iterated groups
Thanks to the association property, for a given group G we can completely describe the structure of equivalence classes and their units. In particular, we will see that the variety of diagonals in an iterated group depends on the fulfillment of the Hall-Paige condition. We also refine the statement of Theorem 8 for groups and prove that for large d the number of diagonals in d-iterated groups G[d] is given by the size of the commutator G ′ .
Recall that G is a Hall-Paige group if all its Sylow 2-subgroups are trivial or non-cyclic (G satisfies the condition of Theorem 1).
Given a group G, the commutator subgroup G ′ is the smallest normal subgroup of G such that G/G ′ is an abelian group. Equivalently, G ′ is a subgroup generated by commutators ghg −1 h −1 , g, h ∈ G. The group H = G/G ′ is known as the abelianization of G. Since G ′ is a normal subgroup, the group G is partitioned into cosets hG ′ , h ∈ H.
The following result of Dénes and Hermann [4] connects the commutator subgroup G ′ with the set P (G). Recall that here P (G) denotes the set of products of all elements of G: P (G) = {Π(W )|W ∈ W}.
Theorem 9 ([4]). Let G be a group. Then either P (G) = G ′ or P (G) = gG ′ , where g is the unique element of order 2 in a nontrivial, cyclic Sylow 2-subgroup of G.
For our purposes, we need several approaches to the definition of Hall-Paige groups. Some requirements, which are equivalent to the Paige-Hall condition, are presented in the following table.
G is a Hall-Paige group G is a non-Hall-Paige group (1)   Proof.
In order to describe equivalence classes and units for iterated groups, we need the following refinement of Proposition 1, controlling the resulting tuples. Proof. Suppose that the last n − k positions of V are equal to e and the last element of V that is distinct from e is located in the k-th position. The proof goes by the induction on k. For the base of induction (k = 0 and k = 1) the statement is true with l = 0.
Assume that k ≥ 2. Consider permutations W, W ′ ∈ W, W = (w 1 , . . . , w n ), W ′ = (w ′ 1 , . . . , w ′ n ), for which the following equalities hold These equalities mean that V * W * W ′ = V ′ for some tuple V ′ , whose first k − 2 positions are the same as in tuple V , Π(V ′ ) = Π(V ) and the last n − k + 1 elements of V ′ are equal to e. Let us show that the required permutations W and W ′ exist. Let g be an arbitrary element of G. Put Note that the condition v k = e implies that w k−1 = w k and w ′ k−1 = w ′ k . It is easy to see that (k − 1)-th and k-th required equalities are satisfied by these choices.
Lemma 4. Let G be a group of order n. Then the equivalence class U 1 is a subgroup in the n-th Cartesian power G n . Moreover, each equivalence class U i , i = 1, . . . , m, is a left coset of U 1 in G n .
Proof. By Lemma 3, the identity element e of the group G n belongs to the class U 1 . By the definitions, every tuple V ∈ U 1 is a product of some permutations W ∈ W. Thanks to associativity, if tuples U and V belong to U 1 , then U * V ∈ U 1 . At last, for every V ∈ U 1 , V = W 1 * · · · * W k its inverse V −1 = W −1 k * · · · * W −1 1 also belongs to the class U 1 . Thus U 1 is a subgroup in G n . By definition of equivalence classes, each U i consists of tuples constructed by the means of consecutive right multiplications of a tuple by permutations from W. Thanks to the associativity of the multiplication in the group G n , the class U i is a left coset of U 1 .

Corollary 3.
If G is a group, then each equivalence class U i has the same size.
We are interested to know if it is true that for any quasigroup G the equivalence class U 1 is a subquasigroup in G n . Note that in a general case there are no equalities between sizes of equivalence classes (see Example 2). Now we are ready to describe the equivalence class U 1 for iterated groups. For abelian groups a similar result was established by Hall in [13].
Lemma 5. Let G be a group of order n and G ′ be the commutator subgroup of G.
1. Assume that G is a Hall-Paige group. Then the equivalence class U 1 consists of a single unit. A tuple V belongs to U 1 if and only if Π(V ) ∈ G ′ . In particular, |U 1 | = |G ′ |n n−1 .
2. Assume that G is a non-Hall-Paige group and g is the element of order 2 from a nontrivial, cyclic Sylow 2-subgroup of G. Then the equivalence class U 1 consists of two units Y 1 and Y 2 . A tuple V belongs to the unit Y 1 if and only if Π(V ) ∈ gG ′ and V belongs to Y 2 whenever Π(V ) ∈ G ′ . The cardinality of each unit Y i is |G ′ |n n−1 .
Proof. 1. Let G be a Hall-Paige group of order n. By condition (2) of the definition of Hall-Paige groups, the Cayley table of G has a transversal. In other words, there exists a W-diagonal of type W for some permutation W ∈ W in the iterated group G [1]. So there are two consecutive units in U 1 containing permutations. Meanwhile, Proposition 4 claims that all permutations are contained in a single unit. Therefore, the equivalence class U 1 has a unique unit. For every tuple V ∈ U 1 it holds Π(V ) ∈ G ′ , because, by Proposition 5, Π(V ) ∈ P ∞ (G) and the condition (3) in the definition of Hall-Paige groups gives that P (G) = G ′ = P ∞ (G).
We prove that every tuple V with property Π(V ) ∈ G ′ belongs to the class U 1 by comparing cardinalities of these sets. It is obvious that the number of tuples V for which Π(V ) ∈ G ′ is equal to |G ′ |n n−1 .
Let us estimate the size of the class U 1 . Consider an arbitrary permutation W ∈ W from the equivalence class U 1 (see Lemma 3). By Proposition 8, the tuple e 1 (Π(W )) also belongs to the class U 1 . Therefore, for every b ∈ P (G) we have e 1 (b) ∈ U 1 . Since P (G) = G ′ by Theorem 9, there are at least |G ′ | different tuples of the form e 1 (b) in the class U 1 . Finally, Proposition 3 implies that the equivalence class U 1 contains at least |G ′ |n n−1 tuples.
2. Assume now that G is a non-Hall-Paige group of order n. By condition (3) of the definition of non-Hall-Paige groups, we have that P (G) = gG ′ for some g ∈ G of order 2. From the definition of the equivalence class U 1 it follows that every V ∈ U 1 can be presented as a product W 1 * · · · * W k for some collection of permutations W i ∈ W and k ∈ N. If k is even, then Π(V ) ∈ G ′ , and Π(V ) ∈ gG ′ otherwise. Therefore, the equivalence class U 1 has at least two units Y 1 and Y 2 that are contained in sets {V |Π(V ) ∈ gG ′ } and {V |Π(V ) ∈ G ′ } respectively. But by Lemma 3, the number of units in U 1 is not greater than 2.
To prove the equalities Y 1 = {V |Π(V ) ∈ gG ′ } and Y 2 = {V |Π(V ) ∈ G ′ }, we compare their cardinalities by the same way as in the previous clause.
For groups, we are able to describe not only tuples in the equivalence class U 1 but all other equivalence classes and their units. Lemma 6. Let G be a group of order n and G ′ be the commutator subgroup of G.
1. If G is a Hall-Paige group, then each equivalence class U i contains a single unit and there are some h i ∈ G such that U i = {V |Π(V ) ∈ h i G ′ }.
2. Assume that G is a non-Hall-Paige group and g is the element of order 2 from a nontrivial, cyclic Sylow 2-subgroup of G. Then each equivalence class U i consists of two units Y i 1 and Y i 2 and there are some Proof. By Lemma 4, each equivalence class U i is a left coset of the class U 1 . Therefore, all classes U i have the same size and the same number of units as the equivalence class U 1 , for which these quantities were found in Lemma 5. Consider a tuple V from an equivalence class U i and assume that Π(V ) belongs to some coset h i G ′ . By the definition of equivalence classes, for every other tuple U from the class U i there is some collection of permutations (W 1 , . . . , W d ) such that U = V * W 1 * · · · * W d . Using the condition (3) of the definition of Hall-Paige groups, we see that if G is a Hall-Paige group, then Π(U) belongs to the same coset h i G ′ . In the case when G is a non-Hall-Paige group, if d is even then Π(U) belongs to the coset h i G ′ and if d is odd then Π(U) ∈ h i gG ′ .
The equalities U i = {V |Π(V ) ∈ h i G ′ } for Hall-Paige groups and Y i 1 = {V |Π(V ) ∈ h i gG ′ } and Y i 2 = {V |Π(V ) ∈ h i G ′ } for non-Hall-Paige groups follow from equalities between the cardinalities of these sets.
At last, we are ready to prove the general result on diagonals in iterated groups.
Theorem 11. Let G be a group of order n with the commutator subgroup G ′ and let U, V ∈ I n n .
The resulting asymptotic of the number of near transversals follows from Theorems 8 and 11.

Concluding remarks
There are many ways to extend the technique described in the present paper. First of all, in one of our subsequent papers we are going to consider diagonals in a general composition of multiary quasigroups and connect them with the permanents and contractions of multidimensional matrices. In particular, we study the composition not only of quasigroups and latin hypercubes but other stochastic multidimensional arrays. Another direction of future work is finding explicit formulas for the numbers of transversals and diagonals of other types in some iterated quasigroups of small orders or arity.
At last, in paper [23], the author estimated the asymptotic numbers of partial diagonals, plexes, and multiplexes in iterated quasigroups. Using similar methods, these bounds can be significantly refined. Moreover, it is possible to generalize our approach to other structures in latin hypercubes, for example, to subcubes or trades.