Permutations that Destroy Arithmetic Progressions in Elementary $p$-Groups

Given an abelian group $G$, it is natural to ask whether there exists a permutation $\pi$ of $G$ that"destroys"all nontrivial 3-term arithmetic progressions (APs), in the sense that $\pi(b) - \pi(a) \neq \pi(c) - \pi(b)$ for every ordered triple $(a,b,c) \in G^3$ satisfying $b-a = c-b \neq 0$. This question was resolved for infinite groups $G$ by Hegarty, who showed that there exists an AP-destroying permutation of $G$ if and only if $G/\Omega_2(G)$ has the same cardinality as $G$, where $\Omega_2(G)$ denotes the subgroup of all elements in $G$ whose order divides $2$. In the case when $G$ is finite, however, only partial results have been obtained thus far. Hegarty has conjectured that an AP-destroying permutation of $G$ exists if $G = \mathbb{Z}/n\mathbb{Z}$ for all $n \neq 2,3,5,7$, and together with Martinsson, he has proven the conjecture for all $n>1.4 \times 10^{14}$. In this paper, we show that if $p$ is a prime and $k$ is a positive integer, then there is an AP-destroying permutation of the elementary $p$-group $(\mathbb{Z}/p\mathbb{Z})^k$ if and only if $p$ is odd and $(p,k) \not\in \{(3,1),(5,1), (7,1)\}$.


Introduction
Let G be an abelian group, and let π : G → G be any permutation. Following the terminology of Hegarty and Martinsson (see [3]), we say that π destroys all nonconstant arithmetic progressions (henceforth, APs) in G if there is no ordered triple (a, b, c) ∈ G 3 such that b−a = c − b = 0 and π(b) − π(a) = π(c) − π(b) (i.e., (a, b, c) and (π(a), π(b), π(c)) are never both APs; note that this condition holds for π if an only if it holds for π −1 ). It is natural to seek a complete classification of abelian groups G that have such an AP-destroying permutation.
For G infinite, it was shown by Hegarty in [2] that there exists an AP-destroying permutation of G if and only if G/Ω 2 (G) has the same cardinality as G, where Ω 2 (G) denotes the subgroup of all elements in G whose order divides 2. On the other hand, in the case when G is finite, such a classification has not yet been obtained. Hegarty conjectured in [2] that there exists an AP-destroying permutation of Z/nZ for all n = 2, 3, 5, 7 (in these four cases, one readily checks that there is no AP-destroying permutation of Z/nZ). It was shown by Hegarty and Martinsson in [3] that there exists an AP-destroying permutation of Z/nZ for all n ≥ n 0 = (9 · 11 · 16 · 17 · 19 · 23) 2 ≈ 1.4 × 10 14 . Moreover, the following lemma, proved by Hegarty in [2], shows that one can find AP-destroying permutations of larger groups given AP-destroying permutations of smaller groups: Lemma 1 (Hegarty). Let G be an abelian group and H ⊂ G a subgroup. If there exists an AP-destroying permutation of H and an AP-destroying permutation of G/H, then there exists an AP-destroying permutation of G.
It follows from Lemma 1 that the set of all finite abelian groups G that have AP-destroying permutations is closed under taking direct sums, and that the set of all positive integers n for which Z/nZ has an AP-destroying permutation is closed under multiplication. This last implication motivates a closer study of the case when n = p is a prime, and in this regard, it was shown in [3] that there is an AP-destroying permutation of Z/pZ for all primes p > 3 such that p ≡ 3 (mod 8). In this paper, we prove a result that includes Hegarty's conjecture for Z/pZ where p > 7 is any prime. Our main theorem is stated as follows: Theorem 2. Let p be a prime and k be a positive integer. Then there is an AP-destroying permutation of (Z/pZ) k if and only if p is odd and (p, k) ∈ {(3, 1), (5, 1), (7, 1)}.
Remark. Although one can use Lemma 1 to show that there is an AP-destroying permutation of (Z/pZ) k for all k > 3 given the existence of such a permutation for (Z/pZ) k where k = 1 or where k ∈ {2, 3}, our approach yields such a permutation directly for all elementary pgroups of odd order greater than 7. Using this result, together with Lemma 1 and the result of [3], we then see that to prove Hegarty's conjecture for finite cyclic groups, it suffices to find AP-destroying permutations of Z/nZ for all n such that n ∈ {2p, 3p, 5p, 7p : p prime} and n < n 0 .
The proof of Theorem 2 occupies the remainder of this paper. We first construct a permutation f that destroys all but O(1) APs in (Z/pZ) k . We then show that if p k is large enough, say p k > n 1 , then a small modification of f destroys all APs. This n 1 , unlike the bound n 0 of [3], is small enough that we can deal with the remaining cases q k ≤ n 1 by exhibiting an AP-destroying permutation in each case. This concludes the proof.

Proof of Theorem 2
Let p be any prime, let k be any positive integer, and let G denote the elementary p-group (Z/pZ) k . If π is a permutation of G, then for any a, r ∈ G with r = 0, the permutation π destroys the AP (a − r, a, a + r) if and only if π destroys the reversed AP (a + r, a, a − r). Moreover, if p = 3, then all six permutations of the AP (a − r, a, a + r) are APs, and if π destroys one of them then π destroys them all. Thus, in the remainder of our proof, we will somewhat loosely use the notation "(a − r, a, a + r)" to refer to both the AP (a − r, a, a + r) and the reversed AP (a + r, a, a − r), and when p = 3, the notation "(a − r, a, a + r)" will refer to any permutation of this AP.
If p = 2 then no permutation of G destroys any AP, so we need only consider the case when p is odd. We identify (Z/pZ) k with the additive group of the finite field F q of order q = p k . We shall construct an AP-destroying permutation of (Z/pZ) k as a permutation of F q , by applying small modifications to the fixed permutation f : F q → F q defined by The next lemma shows that f is indeed very close to being an AP-destroying permutation: The permutation f destroys all APs in F q other than (−1, 0, 1) when p = 3 and (0, 3 2 , 3), ( 1 3 , 2 3 , 1) when p > 3. Proof. Let (a − r, a, a + r) be an AP in F q such that {a − r, a, a + r} ∩ {0, 1} = ∅. Then f sends the AP (a − r, a, a + r) to 1 a−r , 1 a , 1 a+r , which is an AP when 2 a = 1 a − r + 1 a + r =⇒ 2(a 2 − r 2 ) = 2a 2 =⇒ 2r 2 = 0, but this cannot hold since p > 2. Thus, all APs disjoint from {0, 1} are destroyed by f . The remaining cases are handled as follows: (a) First, consider APs of the form (−r, 0, r). If r = ±1, then f sends (−r, 0, r) to (− 1 r , 1, 1 r ), which is not an AP because p > 2. However, f sends (−1, 0, 1) to (−1, 1, 0), which is an AP if and only if p = 3. (b) Next, consider APs of the form (0, r, 2r). If {r, 2r} ∩ {1} = ∅, then f sends (0, r, 2r) to (1, 1 r , 1 2r ), which is an AP if and only if 2 r = 1 + 1 2r , and this happens if and only if p > 3 and r = 3 2 . If r = 1, then f sends (0, r, 2r) to (1, 0, 1 2 ), which is an AP if and only if p = 3. If 2r = 1, then f sends (0, r, 2r) to (1, 2, 0), which is again an AP if and only if p = 3. We may now restrict our attention to APs containing 1 but not 0. (c) Consider APs of the form (1 − r, 1, 1 + r), where r = ±1. The permutation f sends this AP to 1 1−r , 0, 1 1+r , which is not an AP because p > 2. (d) Finally, consider APs of the form (1, 1 + r, 1 + 2r) with r / ∈ {−1, − 1 2 }. Then f sends (1, 1 + r, 1 + 2r) to 0, 1 1+r , 1 1+2r , which is an AP if and only if 2 1+r = 1 1+2r + 0, and this happens if and only if p > 3 and r = − 1 3 . Remark. Because f is an involution, it also acts as an involution on the set of APs that are not destroyed by f .
Our strategy is to modify f by composing it with a permutation τ that is a simple transposition if p = 3 and a product of two transpositions τ 1 , τ 2 if p > 3, with each transposition moving exactly one term in each of the APs not destroyed by f . The resulting permutation f ′ then destroys those APs but may restore others. However, if we choose τ at random then the expected number of restored APs is O(1), so once q is at all large there should be some choices of τ for which no AP is restored and thus f ′ destroys all APs. We will prove this by counting how many τ or τ i move a given AP term and introduce no new APs, and showing that the count is positive. Because our f is given by an algebraic rule, each of the needed enumerations reduces to estimating the number of points on certain algebraic curves over F q . The estimates suffice with few enough small exceptions (each with p > 3) that we can dispose of each remaining q computationally. In most cases we find some τ i that works (even though the estimate was not strong enough to guarantee its existence). In the remaining cases, q is prime and small enough that an AP-destroying permutation of Z/pZ was already exhibited by Hegarty in [2]; we also construct such permutations by starting from the τ i that come closest to destroying all APs and then composing with further transpositions until the number of surviving APs drops to zero.
In what follows, we consider the cases of p = 3 and p > 3 separately, because we saw in the proof of Lemma 3 that the APs not destroyed by f are different in each case.  , which is an AP when 2 y + r = −1 + 1 y + 2r =⇒ r 2 = y 2 + y.
Also, one readily checks that if {y + r, y + 2r} ∩ {0, ±1} = ∅, the AP (y, y + r, y + 2r) is destroyed by f ′ . To verify this claim, note that there are 6 cases to consider, depending on which of y + r and y + 2r belongs to the set {0, ±1}. For the sake of clarity, we shall work out the case where y + r = 0; the remaining five cases may be handled analogously. If y + r = 0, then because y ∈ {0, ±1}, we have that f ′ sends the AP (y, y + r, y + 2r) = (−r, 0, r) to (−1, 1, 1 r ), which is an AP if and only if 1 r = 3, but this is of course impossible modulo 3. Thus, f ′ destroys the AP (y, y + r, y + 2r) when y + r = 0. Now, let χ denote the Legendre symbol over F q . It follows from the above case analysis that if y ∈ {0, ±1} is chosen so that 1 − χ(y + 1) · 1 − χ(y(y + 1)) > 0, then f ′ destroys all APs in F q . Such a y exists if and only if the sum is positive. To compute A q (y), we use the following well-known elementary formula: Lemma 4. Let F q be a finite field of odd characteristic, and let χ be the Legendre symbol on F q . If q is odd and g ∈ F q [x] is a polynomial of degree at most 2 such that g = c · h 2 for any c ∈ F q and h ∈ F q [x], then where a is the coefficient of the degree-2 term in g.
Remark. Alternatively, note that we can handle the case p = 3 by simply exhibiting APdestroying permutations of F 9 and F 27 , for it would then follow by Lemma 1 that there is an AP-destroying permutation of F 3 k for each k > 1. Making the identification F 9 ≃ F 3 [α]/(α 2 + 2α + 2), one readily checks that the permutation f ′ of F 9 obtained by taking y = α+1 destroys all APs in F 9 . Similarly, making the identification F 27 ≃ F 3 [β]/(β 3 +2β+1), one readily checks that the permutation f ′ of F 27 obtained by taking y = β 2 destroys all APs in F 27 . Nonetheless, this ad hoc argument does not readily generalize to primes p > 3, while the proof provided prior to the present remark extends quite naturally to primes p > 3, as we demonstrate in Sections 2.2 and 2.3.

2.2.
Destroying (0, 3 2 , 3) in the Case p > 3. This case takes more work than the case p = 3, but the strategy is similar. We begin by constructing a permutation f ′ of F q that destroys all but one AP. Take y ∈ F q \ {0, 1 3 , 2 3 , 1, 3 2 , 3} (note that this already requires q > 5), and let f ′ be the permutation obtained by switching the images of 3 and y under f ; that is, y , 1 3+r , which is an AP when 2 y = 1 3 − r + 1 3 + r =⇒ r 2 = 9 − 3y.
(Note that the remaining cases here are when y + 2r ∈ {0, 3} and y + r ∈ {0, 1, 3} and when both y + r and y + 2r are in {0, 1, 3}.) (b) If {y − r, y + r} ∩ {0, 1, 3, y} = ∅, then f ′ sends the AP (y − r, y, y + r) to 1 y−r , 1 3 , 1 y+r , which is an AP when If y −r = 0 and y +r ∈ {0, 1, 3}, then f ′ does not destroy the AP (y −r, y, y +r) = (0, y, 2y) when y = − 3 2 . If y − r = 1 and y + r ∈ {0, 1, 3}, then f ′ does not destroy the AP (y − r, y, y + r) = (1, y, 2y − 1) when y = 5 4 . If y − r = 3 and y + r ∈ {0, 1, 3}, then f ′ does not destroy the AP (y − r, y, y + r) = (3, y, 2y − 3) when y = 3 4 . The only remaining AP of the form (y − r, y, y + r) that satisfies {y −r, y +r}∩{0, 1, 3} = ∅ is given by (y −r, y, y +r) = (1, 2, 3), but f ′ evidently destroys this AP. Now, taking χ to be the Legendre symbol over F q as before, it follows from the above case analysis that if , 3, 5, 10, 11, 12 is chosen so that then f ′ destroys all APs other than the AP ( 1 3 , 2 3 , 1) in F q . Expanding the product on the left-hand side (LHS) of (4) under the assumption that y = 3 (so that χ((3 − y) 2 ) = 1), we obtain a lengthy expression that we denote by B q (y) for the sake of readability: Clearly, there exists y ∈ F q \ S satisfying (4) if and only if To estimate the LHS of (5), we first estimate y∈Fq B q (y), for which must invoke not only Lemma 4 but also the Hasse bound (see [1] for the original paper and Corollary 1.4 of [4] for a more modern reference): Theorem 5. [Hasse] Let F q be a finite field of odd characteristic, and let χ be the Legendre symbol on F q . If g ∈ F q [x] is a polynomial of degree 3 or 4 such that g = c · h 2 for any c ∈ F q and h ∈ F q [x], then where a is the coefficient of the degree-4 term in g.
we should discard the case where z − r = 0 and z + r = 3, which would imply that z = 3 2 , contradicting our restriction on the value of z. We therefore end up with at most 5 + 10 − 1 = 14 values of z. There are no cases that remain to be considered for the AP (z − r, z, z + r). As in Section 2.2, we can use the above case analysis to write down a condition on when f ′′ destroys all APs in F q . Indeed, if is chosen so that we have 3z)) > 0, then f ′′ destroys all APs in F q . Let w · · = 1 z for z = 0, and define S ′′ · · = { 1 x : x ∈ S ′ \{0}}∪{0}. Then, rewriting the above condition in terms of w and S ′′ , we obtain the following "new condition": if w ∈ S ′′ is chosen so that then f ′′ destroys all APs in F q . But upon making the replacements y w and S S ′′ , one readily observes that this "new condition" is the same as the analogous condition obtained in Section 2.2, namely (4). Therefore, there exists w ∈ F q \ S ′′ satisfying (9) if and only if To estimate the LHS of (11), we first recall the bound (7): Next, estimating w∈S ′′ B q (w) by using the trivial bound |χ(g(w))| ≤ 1 for each w ∈ S ′′ unless g(w) = 0 (which can occur when w ∈ {0, 1 3 , 3}), we find that (13) w∈S ′′ B q (w) ≤ 58 · 16 + 0 + 8 + 8 = 944, where the term 58 · 16 bounds the contributions of w ∈ S ′′ \ {0, 1 3 , 3}, the term 0 is the contribution of w = 0, and the terms 8+8 bound the contributions of w ∈ { 1 3 , 3}. Combining the estimates (12) and (13), we deduce that (11) holds if q − 10 √ q ≥ 945, which happens when q ≥ 1307. Thus, there exists w ∈ F q \ S ′′ such that f ′′ destroys all APs in F q for q ≥ 1307 a prime power.

Remaining Cases.
We have now shown that there exists an AP-destroying permutation of (Z/pZ) k if p = 3 and k ≥ 2 and if p k ≥ 1307. To complete the proof of Theorem 2, it remains to check the finitely many remaining cases, and we do this by resorting to a computer program. By Lemma 1, it suffices to check that (Z/pZ) k has an AP-destroying permutation for the following cases: (p, k) ∈ {(p, 1) : 7 < p < 1307 is prime} ∪ {(5, 2), (5, 3), (7, 2), (7, 3)}.
In each of these cases other than p = q = 11, 13, 29, 31, our code relies on the construction used in the argument of Section 2. Indeed, for these cases, the idea of modifying the values of f (3) and f ( 1 3 ) actually works to yield an AP-destroying permutation of (Z/pZ) k . For q ∈ {11, 13, 29, 31}, explicit AP-destroying permutations of Z/pZ were constructed by Hegarty in [2]. The code required to check these cases, as well as a database listing the explicit APdestroying permutations for all of the above exceptional cases, may be obtained by downloading the source files from the following website: https://arxiv.org/format/1601.07541v3.