Permutations destroying arithmetic progressions in finite cyclic groups

A permutation \pi of an abelian group G is said to destroy arithmetic progressions (APs) if, whenever (a,b,c) is a non-trivial 3-term AP in G, that is c-b=b-a and a,b,c are not all equal, then (\pi(a),\pi(b),\pi(c)) is not an AP. In a paper from 2004, the first author conjectured that such a permutation exists of Z/nZ, for all n except 2,3,5 and 7. Here we prove, as a special case of a more general result, that such a permutation exists for all n>= n_0, for some explcitly constructed number n_0 \approx 1.4 x 10^{14}. We also construct such a permutation of Z/pZ for all primes p>3 such that p = 3 (mod 8).


Introduction
Let G be an abelian group, S a subset of G. A bijection π : S → S is said to destroy 1 arithmetic progressions (APs) if there is no triple (a, b, c) of elements of S satisfying (i) a, b, c are not all equal, This notion was introduced by the first author in [H], though earlier Sidorenko [S] had given an example of such a permutation in the case G = Z, S = N. It should not be confused with the somewhat different, and probably more famous, notion of a permutation containing no arithmetic progressions [DEGS].
The most important open question from [H] concerns the existence of AP-destroying permutations of finite cyclic groups Z n . Conjecture C of that paper asserts that such permutations exist if and only if n ∈ {2, 3, 5, 7}. In this paper we come close to resolving this conjecture in full. Before stating our main result, we need to define an extension of the concept of APdestroying permutation, in the special case of finite cyclic groups: Definition 1.1. Let s, t ∈ N 0 . A permutation π of Z n is said to destroy (s, t)-almost APs if there is no triple (a, b, c) of elements of Z n satisfying (i) a, b, c are not all equal, (ii) a + c − 2b ≡ η 1 (mod n) for some η 1 ∈ {0, ±1, . . . , ±s}, (iii) π(a) + π(c) − 2π(b) ≡ η 2 (mod n) for some η 2 ∈ {0, ±1, . . . , ±t}.
Hence (s, t) = (0, 0) is the case of an AP-destroying permutation. We shall prove (ii) For every s, t ∈ N 0 there is an n 0 (s, t) such that there exists a permutation of Z n destroying (s, t)-almost APs for all n ≥ n 0 (s, t).
As we shall see, there are obvious ways one could try to tinker with this proof so as to make it work also for other primes. So far, however, we have not found any such tinkering that works. This and other outstanding issues will be addressed in Section 4.

Proof of Theorem 1.1
We introduce some further notation. Let s, t ∈ N 0 . A permutation π of Z n is said to destroy the pattern s → t if there is no triple (a, b, c) of elements of Z n satisfying (i) a, b, c are not all equal, (ii) a + c − 2b ≡ s (mod n), (iii) π(a) + π(c) − 2π(b) ≡ t (mod n).
Hence, π destroys (s, t)-almost APs if and only if it destroys the patterns s ′ → t ′ , for all In the following assertions, ξ −1 denotes the inverse of ξ modulo n. The proofs are almost trivial: Lemma 2.1. (i) Suppose π : Z n → Z n is a permutation destroying the pattern 0 → 1 and that GCD(t, n) = 1. Then π 1 : Z n → Z n given by is a permutation destroying the pattern 0 → t.
(ii) Suppose π : Z n → Z n is a permutation destroying the pattern 1 → 1 and that GCD(s, n) = GCD(t, n) = 1. Then π 2 : Z n → Z n given by is a permutation destroying the pattern s → t.
(iii) If π : Z n → Z n is a permutation destroying the pattern s → t, then π −1 destroys t → s.
Let (a i , b i , c i ), i = 1, . . . , 6, be the projections on the various factors of this triple, after applying σ. We note that a i + c i − 2b i ≡ s (mod n i ), and for every i. Since (a, b, c) is non-trivial, there must be at least one factor, i 1 say, such that (a i 1 , b i 1 , c i 1 ) is non-trivial. We consider two cases: Clearly, this can only occur if s = 0, so (a, b, c) and all its projections are APs. As π i 1 is AP-destroying, we have π i 1 (a i 1 ) For any t ∈ {0, ±1, ±2} we have that, by choice of π 1 , . . . π 6 , there exists an i such that π i destroys the pattern s → t. Hence, we have π 0 (a) + π 0 (c) − 2π 0 (b) ≡ t (mod √ n 0 ) as, by 2.4, they are not even congruent modulo n i .
To prove Theorem 1.1(i), it thus remains to show how to use the master permutation π 0 to construct an AP-destroying permutation of Z n for every n ≥ n 0 . To begin with, let m, n be any positive integers and write n = k · m + l, where 0 ≤ l < m. Place the numbers 0, 1, . . . , n − 1 clockwise around a circle, and divide them up into consecutive blocks B 0 , . . . , B m−1 , each of which has size k or k + 1. Thus there will be exactly l blocks of size k + 1. Let β(x) denote the number of the block containing x, i.e.: x ∈ B β(x) . We make two claims: To see this, consider a "worst case" where a = 0 and b is the furthest clockwise (last) element of block B i , for some 0 ≤ i < m/2 and such that 2b < n. Then For the claim to hold, we need 2b to lie in one of the blocks B 2i−2 , . . . , B 2i+2 . The last element of B 2i−3 is at most (k + 1)(2i − 2), while the first element of B 2i+3 is at least k(2i + 3). Hence the claim holds provided Both inequalities are easily checked to hold provided k ≥ m. The symmetric "worst case" where a is the last and b the first element in their respective blocks is handled similarly.
Claim 2: For any n, if numbers are placed in blocks according to β(x) := ⌊mx/n⌋, then every block has size k or k + 1 and, for any (a, b, c) an AP modulo n, one has the stronger conclusion that β(a) This claim is easily verified by plugging in the formula for β(x). Now suppose n ≥ n 0 . Write n = k · √ n 0 + l, where 0 ≤ l < √ n 0 . Imagine the numbers 0, 1, . . . , n − 1 placed clockwise around a circle. We shall describe a rearrangement of this circular string of n numbers such that, if π(x) denotes the location of the number x after the rearrangement, then π will be an AP-destroying permutation of Z n . Firstly, divide the n numbers into consecutive clockwise blocks B 0 , . . . , B √ n 0 −1 , such that For each i = 0, 1, . . . , √ n 0 − 1, let τ i be a permutation of the elements of block B i which destroys APs, considering the elements of the block as lying in the group Z of ordinary integers. It follows from Proposition 2.3(ii) of [H] that such permutations exist. Note that the τ i will automatically also destroy APs modulo n. Our AP-destroying permutation π of Z n is gotten by first rearranging the blocks according to the master permutation π 0 , and then applying τ i within each block (or vice versa, the two operations commute). In other words, after applying π to the circular arrangement of numbers, the blocks B π −1 appear in clockwise order and, within block B i , its integer elements have been permuted according to τ i . Since π 0 is (1, 2)-almost AP-destroying, it is easily deduced from Claims 1 and 2 that π destroys APs modulo n. This completes the proof of Theorem 1.1(i).
We now turn to part (ii) of the theorem and divide the proof into three steps.
Step 1: There exists a (2, 2)-almost AP-destroying permutation of Z r for some r.
Step 2: For every s, t ∈ N 0 there exists r 0 (s, t) ∈ N and an (s, t)-almost AP-destroying permutation of Z r 0 (s, t) .
Proof. Let m be an integer such that there exists an AP-destroying permutation of Z m , and let χ m be such a permutation. Identify Z N with the set {0, 1, . . . , N − 1} for any N . Let r = r 0 (2, 2) be as in Step 1. Then (see Lemma 3.5 of [H]) the map χ rm : Z rm → Z rm given by is easily seen to be (2, 2)-almost AP-destroying, provided m > 2. Thus, by the already proven Theorem 1.1(i), there exists a (2, 2)-almost AP-destroying permutation χ rm of Z rm , for all sufficiently large m. Moreover, after a suitable translation, we can choose χ rm so that rm − 1 is a fixed point. In this case, the restriction of χ rm to {0, 1, . . . , rm − 2} can be considered as a permutation of Z rm−1 and, since χ rm was (2, 2)-almost AP-destroying, it is easily seen that this restriction is (1, 1)-almost AP-destroying. To summarise, we have shown that there is an infinite arithmetic progression A, consisting of numbers congruent to −1 (mod r), such that there exists a (1, 1)-almost AP-destroying permutation of Z n for all n ∈ A. Furthermore, since the first term and common difference of A are relatively prime, there is an infinite subsequence a 1 , a 2 , . . . of elements of A consisting of pairwise relatively prime numbers. This follows from Dirichlet's theorem, though it is actually trivial to prove, in a similar manner to Euclid's proof of the existence of infinitely many primes. Now fix s, t ∈ N 0 . For a permutation of some Z n to be (s, t)-almost AP-destroying, it just needs to destroy a finite number of patterns. Using Lemma 2.1 it follows that there exists an i = i(s, t) and (1, 1)-almost AP-destroying permutations χ j of Z a j , j = 1, . . . , i, which collectively destroy every pattern s ′ → t ′ , |s ′ | ≤ s, |t ′ | ≤ t. Then, by a construction similar to (2.3), we can construct an (s, t)-almost AP-destroying permutation of Z r 0 (s, t) , where r 0 (s, t) = i(s, t) j=1 a j .
To simplify notation, set M := r 0 (4t + 7, 4t + 7) and fix n ≥ M 2 . Our task is to construct a (t, t)-almost AP-destroying permutation of Z n . Write n = kM + l, 0 ≤ l < M and place the numbers 0, 1, . . . , n − 1 clockwise around a circle. As before, we find it most convenient to describe our permutation in terms of a reearrangement of this circular string of n numbers. The rearrangement will be broken down into 4 stages, of which stages 2 and 3 correspond to the procedure in the proof of part (i) of Theorem 1.1, while stages 1 and 4 deal with the fact that t > 0. Stage 4 is essentially the "reverse" of Stage 1. Next, partition the blocks B i into ⌊ M t+1 ⌋ "superblocks" C 0 , . . . , C ⌊M/(t+1)⌋ , each consisting of either t + 1 or t + 2 ordinary blocks, with the larger superblocks placed furthest clockwise from zero. Thus Note that since M is extremely large compared to t, there is no problem in making this subdivision of ordinary blocks. Now rearrange the individual numbers in each superblock in such a way that, if the superblock contains t + i ordinary blocks, i ∈ {1, 2}, then after this rearrangement, the numbers inside any ordinary block will form an AP of common difference t + i. For example, consider the superblock C 0 . There is a unique reordering (i 0 , i 1 , . . . , i t ) of (0, 1, . . . , t) such that |B i 0 | ≥ |B i 1 | ≥ · · · ≥ |B it | and the indices are increasing as long as the block sizes are constant. After rearrangement, B i 0 would contain 0, t+1, 2(t+1), . . . , B i 1 would contain 1, t+2, 2t+3, . . . and so on up to B it which would contain t, 2t + 1, . . . . Let β 2 (x) denote the (ordinary) block containing x at this point and note that where plus one comes from the fact that some superblocks may contain t + 2 ordinary blocks.
Stage 3: Let τ 0 , τ 1 be AP-destroying permutations of 1, . . . , ⌊ n M ⌋ and 1, . . . , ⌈ n M ⌉ respectively, considered as subsets of N. From Proposition 2.3(ii) of [H] we know that such permutations exist. Given any set S of integers which forms an AP of length ⌊n/M ⌋ (resp. ⌈n/M ⌉), it is obvious how to extract from τ 0 (resp. τ 1 ) an AP-destroying permutation of S. We perform such a permutation on each scripted block B i . We then rearrange the numbers in each superblock in such a way that, for each block B i , the positions of its elements after rearrangement form an AP of common difference |C 0 | ∈ {t + 1, t + 2}. This is accomplished by reversing the procedure in Stage 1 -we hope it is clear what is meant by this and spare the reader further details. Let β 4 (x) be the number of the scripted block containing x at this point and note that, analogous to (2.9), one has (2.12) |β 4 (x) − β 3 (x)| ≤ t + 1.
Let π : Z n → Z n be the permutation defined by the rearrangement accomplished in Stages 1-4, that is, π(x) denotes the location of the number x in the string after the rearrangement. We claim that π is (t, t)-almost AP-destroying. To see this, let (a, b, c) be a triple of elements of Z n satisfying (I) a, b, c not all equal, (II) a + c − 2b ≡ η (mod n) for some η ∈ [−t, t] and consider two cases: Case 1: a, b, c all lie in the same ordinary block B i at the end of Stage 1.
Since a, b, c are not all equal and the numbers in B i , as it stands after Stage 1, form an AP with common difference strictly greater than t, property (II) can only hold if a, b, c form a non-trivial AP modulo n. But since the appropriate τ j destroys APs of integers, and hence also APs modulo n since n is much larger than M , we see that the locations of a, b, c will not form an AP modulo n after Stage 3. But they will still lie in the same scripted block hence, after Stage 4, π(a) + π(c) − 2π(b) must be a non-zero multiple of t + i, i ∈ {1, 2}. In particular, Case 2: a, b, c are not all in the same ordinary block upon completion of Stage 1.
By definition, what we're assuming in this case is that β 2 (a), β 2 (b), β 2 (c) are not all equal. If a, b, c formed an AP modulo n then it would follow from Claim 1 in the proof of part (i) of Theorem 1.1 that Given that (II) holds and that each ordinary block has size greater than t, we can at least be sure that (2.14) Combined with (2.9) it follows that But the permutation π 0 is (4t + 7, 4t + 7)-almost AP-destroying and thus, by (2.10), By (2.12), this implies in turn that Since the scripted blocks still have size greater than t, it follows from Claim 1 on page 4 that π(a) + π(c) − 2π(b) (mod n) ∈ [−t, t], as desired.

Proof of Theorem 1.2
Let p be a prime. We denote by R p (resp. N p ) the collection of quadratic residues (resp. non-residues) modulo p. We will be slightly abusive in this context and use the same notations to denote subsets of Z p and of Z. Hence, as subsets of Z p one has (3.1) whereas, as subsets of Z, Lemma 3.1. Let p be a prime such that p ≡ 3 (mod 8). Then both −1 and 2 are in N p .
Proof. This is elementary number theory. That −1 is not a square mod p follows from Lagrange's theorem for groups. That 2 is not a square follows from Gauss' Lemma.
Lemma 3.2. Let p > 3 be a prime. Then there exists an integer ξ such that both ξ and ξ − 1 lie in N p .
Lemma 3.3. Let p > 2 be a prime, and let a, b, c be integers not divisible by p. Then (0, 0) is the only solution in Z p to the congruence ax 2 + bxy + cy 2 ≡ 0 (mod p) if and only if b 2 − 4ac ∈ N p .
Proof. Elementary. Suppose we have a solution with y ≡ 0. Then completion of squares gives We are now ready to prove Theorem 1.2. Let p > 3 be a prime congruent to 3 (mod 8) and let ξ be any integer satisfying the conditions of Lemma 3.2. Define the map f : Z p → Z p as follows: Note that f is one-to-one. Let (a, b, c) be an arithmetic progression modulo p. Denote a := x, b := x + y, c := x + 2y. We need to show that Denote also E := {0, 2, 4, . . . , p−1} and O := {1, 3, 5, . . . , p−2}. We do a case-by-case analysis.
The case when a, b, c ∈ O is completely analogous to Case 1.
By the choice of ξ we know that ξ − 1 ∈ N p , so in particular ξ − 1 ≡ 0. Also, 2ξ − 1 ≡ 0, for otherwise we would have ξ − 1 ≡ −1/2, contradicting Lemma 3.1 and the fact that ξ − 1 ∈ N p . Hence all the coefficients in the binary quadratic form in (3.8) are non-zero modulo p, so we can apply Lemma 3.3 and deduce that there is no solution with y ≡ 0 if and only if hence this lies in R p if and only if −1 2(ξ−1) does so. But the latter contradicts Lemma 3.1 and the choice of ξ.
The case when a ∈ O, b, c ∈ E is completely analogous to Case 2.
The congruence in (3.5) becomes (3.10) x 2 + (x + 2y) 2 ≡ 2ξ(x + y) 2 , which can be expanded as Once again, all the coefficients are non-zero modulo p, so we can apply Lemma 3.3 and deduce that there is no solution with y ≡ 0 if and only if [ hence this lies in R p if and only if 1 ξ−1 does so. But the latter contradicts the choice of ξ.
The coefficients are all non-zero modulo p so, by Lemma 3.3, there is no solution with y ≡ 0 if and only if [4(ξ − 1)] 2 − 8(ξ − 1)(ξ − 2) ∈ R p . But hence this lies in R p if and only if ξ 2(ξ−1) does so. Once again, this contradicts Lemma 3.1 and the choice of ξ.
The case when a ∈ E, b, c ∈ O is completely analogous to Case 4.
The coefficients are still non-zero modulo p so, by Lemma 3.3, there is no solution with y ≡ 0 if and only if [2(ξ − 1)] 2 − 4(ξ − 1)(2ξ − 1) ∈ R p . But hence this lies in R p if and only if −ξ ξ−1 does so. Once again we have a contradiction to Lemma 3.1 and the choice of ξ. This covers all possible cases and completes the proof of Theorem 1.2.

Final remarks
We don't know of any reason to suspect that Conjecture C of [H] may be false. However, a full proof of it remains a challenging problem, given that the value of n 0 in Theorem 1.1(i) still leaves a brute-force computational attack way out of reach. A less ambitious goal could be to see how small n 0 can be made using the ideas of this paper.
An obvious approach to Conjecture C is to consider a uniformly random permutation π of Z n and let X be the number of non-trivial APs not destroyed by π. It is easy to check that E[X] = Θ(n). As a first hypothesis, one might guess that the events that individual APs are not destroyed by π are almost independent and hence that X is approximately Poisson distributed. In that case, the proportion of AP-destroying permutations of Z n would decrease exponentially with n. A priori, this approach could still only yield Conjecture C for n sufficiently large, but probably with a value of n 0 which is sufficiently small to complete the proof by direct computation. However, it remains an open question whether this intuition can be made rigorous. A successful moment analysis was carried out in [JS] for permutations destroying APs of length 4, with the important point being that the expected number of non-trivial 4-term APs not destroyed by a random permutation of Z n is O(1). This provides some additional circumstantial evidence for Conjecture C.
An AP of length 4 is a common solution to the pair of linear equations x 1 − 2x 2 + x 3 = 0, x 2 − 2x 3 + x 4 = 0. It is natural to ask the following more general question: Question 4.1. Let k, m ∈ N and let L i (x 1 , . . . , x k ) = 0, i = 1, . . . , m, be linear equations with integer coefficients. When is it the case that there is an n 0 = n 0 (L 1 , . . . , L m ) such that there exists a permutation of Z n destroying all non-trivial solutions (as defined in [R]) to L 1 = · · · = L m = 0 for all n ≥ n 0 ? Indeed, it seems reasonable even to ask this kind of question for general polynomial equations, not just linear ones. Here we confine further speculation to the case of a single linear equation Recall that the equation is said to be (translation) invariant if a 0 = k i=1 a i = 0. One can make the following straightforward observations: (i) Suppose a 0 = 0. If n > 2|a 0 |, then there exists a unit u ∈ Z × n such that ua 0 ≡ a 0 (mod n). Then the permutation x → ux (mod n) will destroy all solutions to the equation.
(ii) Suppose k i=1 a i = 0. If n > k i=1 a i then the translation x → x + 1 (mod n) will destroy all solutions to the equation.
(iii) Suppose the equation is invariant and k = 2, so the equation reads a 1 (x 1 − x 2 ) = 0, for some a 1 = 0. A permutation π of Z n will destroy all non-trivial solutions if and only if, whenever x 1 and x 2 are distinct but lie in the same congruence class modulo n GCD(a 1 , n) , then π(x 1 ) and π(x 2 ) lie in different congruence classes. Clearly, such a permutation exists for all n ≥ [GCD(a 1 , n)] 2 .
Hence, for a single linear equation, Question 4.1 is only interesting if the equation is invariant and k ≥ 3. If we then consider a uniformly random permutation of Z n , it is easy to see that the expected number of non-trivial solutions not destroyed is Θ(n k−2 ). This suggests that permutations destroying all non-trivial solutions should exist when k = 3, but perhaps do not do so at all when k > 3. We therefore ask the following: Question 4.2. Let L(x 1 , . . . , x k ) = a 0 + k i=1 a i x i = 0, a i , ∈ Z, a i = 0 ∀ i > 0, be a linear equation. Is it true that the following statements are equivalent: (i) There is an n 0 = n 0 (L) such that, for every n ≥ n 0 , there exists a permutation π of Z n destroying all non-trivial solutions of L = 0.
(ii) Either the equation L = 0 is variant, or it is invariant and k ∈ {2, 3} ?
As a final remark, note that in Propostion 2.3(i) of [H] we proved that no permutation of any finite abelian group can destroy all non-trivial solutions to the Sidon equation x 1 +x 2 −x 3 −x 4 =