Permutations that separate close elements

Let $n$ be a fixed integer with $n\geq 2$. For $i,j\in\mathbb{Z}_n$, define $||i,j||_n$ to be the distance between $i$ and $j$ when the elements of $\mathbb{Z}_n$ are written in a cycle. So $||i,j||_n=\min\{(i-j)\bmod n,(j-i)\bmod n\}$. For positive integers $s$ and $k$, the permutation $\pi:\mathbb{Z}_n\rightarrow\mathbb{Z}_n$ is \emph{$(s,k)$-clash-free} if $||\pi(i),\pi(j)||_n\geq k$ whenever $||i,j||_n<s$ with $i\not=j$. So an $(s,k)$-clash-free permutation $\pi$ can be thought of as moving every close pair of elements of $\mathbb{Z}_n$ to a pair at large distance. More geometrically, the existence of an $(s,k)$-clash-free permutation is equivalent to the existence of a set of $n$ non-overlapping $s\times k$ rectangles on an $n\times n$ torus, whose centres have distinct integer $x$-coordinates and distinct integer $y$-coordinates. For positive integers $n$ and $k$ with $k<n$, let $\sigma(n,k)$ be the largest value of $s$ such that an $(s,k)$-clash-free permutation on $\mathbb{Z}_n$ exists. In a recent paper, Mammoliti and Simpson conjectured that \[ \lfloor (n-1)/k\rfloor-1\leq \sigma(n,k)\leq \lfloor (n-1)/k\rfloor \] for all integers $n$ and $k$ with $k<n$. The paper establishes this conjecture, by explicitly constructing an $(s,k)$-clash-free permutation on $\mathbb{Z}_n$ with $s=\lfloor (n-1)/k\rfloor-1$. Indeed, this construction is used to establish a more general conjecture of Mammoliti and Simpson, where for some fixed integer $r$ we require every point on the torus to be contained in the interior of at most $r$ rectangles.


Introduction
Let n be a fixed integer with n ≥ 2. Define ||i, j|| n = min{(i − j) mod n, (j − i) mod n} to be the distance between i and j when the elements of Z n are written in a cycle. Let s and k be positive integers. For a permutation π of Z n , we define an (s, k)-clash to be a pair (i, j) of distinct elements of Z n such that ||i, j|| n < s and ||π(i), π(j)|| n < k. A permutation is (s, k)-clash-free if it has no (s, k)-clashes. An (s, k)-clash-free permutation π can be thought of as being 'chaotic' in the sense that pairs of distinct elements at distance less than s are always mapped under π to pairs at distance at least k. The notion of a clash-free permutation was introduced by Mammoliti and Simpson [6].
If we draw a set of s × t rectangles on an n × n torus with centres at points (i, π(i)), we see that a permutation is (s, k)-clash-free if and only if the rectangles do not intersect. See Figure 1 for an example of a (5, 3)-clashfree permutation depicted in this way.
We mention that 'non-cyclic' variations of the problem, where we draw rectangles on a cylinder or a square, have also been considered [6], as have generalisations of the k = 2 case (known as cyclic matching sequencibility for graphs) [1,4,5]. We also mention papers by Bevan, Homberger and Tenner [2] and Blackburn, Homberger and Winkler [3], which consider the related problem of packing diamonds rather than rectangles on a torus. This problem can be rephrased as finding permutations π of Z n such that the distances between the points (i, π(i)) are large in the Manhattan metric (the ℓ 1 -metric).
For integers u and v with u ≤ v, we write [u, v] for the set of all integers i such that u ≤ i ≤ v. We say that the length of the interval is v − u. For integers n and k, define σ(n, k) to be the largest value of s ∈ [1, n] such that an (s, k)-clash-free permutation of Z n exists. It is easy to see directly from the definition of an (s, k)-clash that σ(n, k) = 1 when k ≥ n, so we may assume that k < n.We prove the following theorem: Theorem 1. Let n and k be integers with 1 ≤ k < n. Define σ(n, k) as above. Then ⌊(n − 1)/k⌋ − 1 ≤ σ(n, k) ≤ ⌊(n − 1)/k⌋. We prove this theorem in Section 2 below. The theorem answers in the affirmative a conjecture of Mammoliti and Simpson [6, Conjecture 3.9]. We remark that the two cases σ(n, k) = ⌊(n−1)/k⌋ and σ(n, k) = ⌊(n−1)/k⌋−1 both occur: A computer search in [6] showed that σ(25, 4) = 6 and σ(26, 4) = 5. These examples also show that σ(n, k) is not monotonically increasing in n. The key contribution of this paper is to establish the lower bound in Theorem 1 by explicitly constructing an (s, k)-clash-free permutation; the upper bound is [6,Lemma 2.3].
The construction in the proof of Theorem 1 can also be used in a generalisation (due to Mammoliti and Simpson) of the situation above, where we consider r + 1-subsets rather than pairs. In more detail, for a subset X ⊆ Z n , we define ||X|| n to be the minimum length of an interval containing X. So For a permutation π of Z n , we define an (s, k, r)-clash to be a subset X ⊆ Z n of cardinality r+1 such that ||X|| n < s and ||π(X)|| n < k. The permutation π is (s, k, r)-clash-free if it has no (s, k, r)-clashes X. Geometrically, we are asking for a collection of s × k rectangles in the n × n torus with centres (i, π(i)) such that each point lies in the interior of no more than r rectangles. When r = 1 we are in the situation we considered above.
For fixed integers n, k and r, we define σ(n, k, r) to be the largest value s ∈ [0, n] such that an (s, k, r)-clash-free permutation of Z n exists. When r ≥ n every permutation is (s, k, r)-clash-free, and so σ(n, k, r) = n. We have already dealt with the situation when r = 1 above. So we may assume that 1 < r < n. Similarly, when k ≤ n is not hard to see that we have σ(n, k, r) = r, and when r ≥ k we have σ(n, k, r) = n (the key fact for both situations being that every r + 1-subset X ⊆ Z n has r ≤ ||X|| n < n). So we may assume that 1 < r < k < n. We prove the following theorem in Section 3 below: Theorem 2. Let n, k and r be integers such that 1 < r < k < n. Then The theorem answers in the affirmative a conjecture of Mammoliti and Simpson [6, Conjecture 6.1] (that generalises [6, Conjecture 3.9]).
Let s = ⌊(n − 1)/k⌋ − 1. The theorem is trivially true when s ≤ 1, as every permutation of Z n is (s, k)-clash-free. So we may assume that s ≥ 2. Similarly, since every permutation is (s, 1)-clash-free, we may assume that k ≥ 2.
To prove the theorem, it suffices to construct an (s, k)-clash-free permutation of Z n . In fact, we will construct a (k, s)-clash-free permutation π of Z n . Since a pair (i, j) is a (k, s)-clash for a permutation π if and only if the pair (π(i), π(j)) is an (s, k)-clash for the permutation π −1 , we see that π −1 is (s, k)-clash-free as required; see [6, Theorem 2.1].
Let d = gcd(s + 1, n), and let ℓ be the additive order of s + 1 in Z n . So ℓ = n/d and the additive group s + 1 generated by s + 1 in Z n consists of all elements r mod n where r is an integer such that d divides r.
We define a d × ℓ matrix A over Z n by setting the (i, j) entry A i,j of A to be A i,j = i + j(s + 1) mod n for 0 ≤ i < d and 0 ≤ j < ℓ. An example of the matrix A is given in Figure 2.
We will now show that every element of Z n occurs exactly once in A. Row i of A lists the ℓ elements of the coset i + s + 1 . We claim these cosets are distinct. To see this, let 0 ≤ i < i ′ < d. The difference between an element in row i ′ and an element in row i lies in the coset (i ′ −i)+ s+1 . But 1 ≤ i ′ − i < d, and so i ′ − i is not a multiple of d. Hence i ′ − i / ∈ s + 1 and so the cosets listed in rows i and i ′ are distinct, as claimed. Thus the entries of the matrix A are distinct. Since there are dℓ = d(n/d) = n elements in A, every element of Z n occurs exactly once in A, as required.
The following three properties of A are easy to verify. First, moving one place east (cyclically), in A always increases the entry by s + 1:  Secondly, moving southeast by one position (cylically), when not in the bottom row, increases the entry by s + 2: Finally, moving northeast by one position (cylically), when not in the top row, increases the entry by s: We order the entries of A into a cycle as follows. We begin at the entry A 0,0 . If we are currently at the entry A i,j , we move east unless: • j ≡ (ℓ − 1) − i mod ℓ and i < d − 1, when we move south east; • j ≡ (ℓ − 1) − i + 1 mod ℓ and i > 0, when we move north east.
Our cycle is well-defined, since ℓ > k ≥ 2. An example of this cycle is given on the right hand side of Figure 2. When d = 1 our array has a single row, and all our moves are east-moves. We note that southeast-moves are separated by at least ℓ − 2 east-moves (and the d − 1 northeast-moves occur consecutively). Moreover the cycle visits all the entries of A.
We will now show that π has no (k, s)-clashes. This is sufficient to establish the theorem. Let z be a positive integer, with z < k. Let i, j ∈ Z n be such that ||j − i|| n = z. Without loss of generality, we may assume that the entry of A corresponding to π(j) can be reached by moving z times along our cycle, starting at the entry corresponding to π(i). Suppose these z moves are made up of a 0 northeast-moves, a 1 east-moves and a 2 southeast moves, where a 0 + a 1 + a 2 = z. The equations (2), (3) and (4) show that π(j) ≡ π(i) + δ mod n, where δ = zs + a 1 + 2a 2 . Since z is positive, δ ≥ s. Now z < k, and we showed earlier that k < ℓ. Hence z ≤ ℓ − 2. Each southeast move is separated by at least ℓ − 2 east-moves on our cycle, and the z moves we are examining are consecutive on our cycle, so we must have a 2 ≤ 1. Hence But since π(j) ≡ π(i)+δ where s ≤ δ ≤ n−1−s we see that ||π(i), π(j)|| n ≥ s. We have shown that whenever ||j − i|| n = z < k we have ||π(i), π(j)|| n ≥ s. So π is a (k, s)-clash-free permutation, and the theorem follows. ✷

A Proof of Theorem 2
We use the following lemma, which follows from the fact that X is a (k, s, r)clash for a permutation π if and only if π(X) is an (s, k, r)-clash for π −1 . Lemma 3. A permutation π of Z n is (k, s, r)-clash-free if and only if π −1 is (s, k, r)-clash-free.
We separate the proof of Theorem 2 into two parts. We first prove Theorem 4 below, which constructs a permutation that is (s, k, r)-clash-free provided a certain inequality holds. We then prove Theorem 2 by showing that this inequality holds in the situations we need.
Theorem 4. Let r, s, k and n be positive integers with r < k < n and s + 1 < n. Let d = gcd(s + 1, n) and let ℓ = n/d. There exists an (s, k, r)clash-free permutation of Z n whenever Proof. By Lemma 3, just as in Section 2, we choose to construct a (k, s, r)clash-free permutation π of Z n . Since d ≤ s + 1 < n, we see that ℓ = n/d ≥ 2. We construct the permutation π exactly as in Section 2. For i ∈ Z n , we have π(i+1) ≡ π(i)+δ i , where δ i ∈ Z is equal to one of s, s + 1 or s + 2, depending on whether we have moved north-east, east, or southeast when moving from position i to position i + 1 in our cycle.
It remains to prove that π is (k, s, r)-clash free. Suppose, for a contradiction, that π has a (k, s, r)-clash. So there exists an (r + 1)-subset X ⊂ Z n such that ||X|| n < k and ||π(X)|| r < s. Let x ∈ Z n be such that X ⊆ x + [0, k − 1] mod n, and let y ∈ Z n be such that π(X) ⊆ y + [0, s − 1] mod n. In particular, there exists an element of Z n (namely the element y + s − 1) that can be written in at least r + 1 ways in the form π(i) + j with i ∈ X and j ∈ [0, s − 1]. Since X ⊆ x + [0, k − 1], this element of Z n can be written in at least r + 1 ways in the form π(x + i) + j with i ∈ [0, k − 1] and j ∈ [0, s − 1]. We derive our contradiction by showing that this cannot happen.
The theorem follows, by Theorem 4.