Caps and progression-free sets in \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\mathbb {Z}}}_m^n$$\end{document}Zmn

We study progression-free sets in the abelian groups \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G=({{\mathbb {Z}}}_m^n,+)$$\end{document}G=(Zmn,+). Let \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_k({{\mathbb {Z}}}_m^n)$$\end{document}rk(Zmn) denote the maximal size of a set \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S \subset {{\mathbb {Z}}}_m^n$$\end{document}S⊂Zmn that does not contain a proper arithmetic progression of length k. We give lower bound constructions, which e.g. include that \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_3({{\mathbb {Z}}}_m^n) \ge C_m \frac{((m+2)/2)^n}{\sqrt{n}}$$\end{document}r3(Zmn)≥Cm((m+2)/2)nn, when m is even. When \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=4$$\end{document}m=4 this is of order at least \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3^n/\sqrt{n}\gg \vert G \vert ^{0.7924}$$\end{document}3n/n≫|G|0.7924. Moreover, if the progression-free set \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\subset {{\mathbb {Z}}}_4^n$$\end{document}S⊂Z4n satisfies a technical condition, which dominates the problem at least in low dimension, then \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$|S|\le 3^n$$\end{document}|S|≤3n holds. We present a number of new methods which cover lower bounds for several infinite families of parameters m, k, n, which includes for example: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_6({{\mathbb {Z}}}_{125}^n) \ge (85-o(1))^n$$\end{document}r6(Z125n)≥(85-o(1))n. For \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_3({{\mathbb {Z}}}_4^n)$$\end{document}r3(Z4n) we determine the exact values, when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n \le 5$$\end{document}n≤5, e.g. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_3({{\mathbb {Z}}}_4^5)=124$$\end{document}r3(Z45)=124, and for \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_4({{\mathbb {Z}}}_4^n)$$\end{document}r4(Z4n) we determine the exact values, when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n \le 4$$\end{document}n≤4, e.g. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r_4({{\mathbb {Z}}}_4^4)=128$$\end{document}r4(Z44)=128. With regard to affine caps, i.e. sets without 3 points on a line, the new methods asymptotically improve the known lower bounds, when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=4$$\end{document}m=4 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=5$$\end{document}m=5: in \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\mathbb {Z}}}_4^n$$\end{document}Z4n from \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2.519^n$$\end{document}2.519n to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(3-o(1))^n$$\end{document}(3-o(1))n, and when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=5$$\end{document}m=5 from \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2.942^n$$\end{document}2.942n to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(3-o(1))^n$$\end{document}(3-o(1))n. This last improvement modulo 5 appears to be the first asymptotic improvement of any cap in AG(n, m), when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m \ge 5$$\end{document}m≥5 over a tensor lifting from dimension 6 (see Edel, in Des Codes Crytogr 31:5–14, 2004).


Introduction
There has been great interest in finding progression-free sets in Z n m :=(Z/(mZ)) n , especially when m = 3 or 4. When m = 3, 4, 5 the properties "no arithmetic progression of length 3 modulo m" and "no 3 points on any line" are equivalent. The last property is also well known under the name cap-sets. In spite of this great interest in progression-free sets and caps there is not much literature on progression-free sets in Z n m , in the case of general m > 3, and of general progressions of length k, and hardly any explicit values of the maximal size of such sets is known. 1 This paper intends to fill this gap and provides several new techniques to find lower bounds, and even to find exact values in the case m = 4, which are comparable in size to the known values for m = 3.
However, before we come to this, we briefly summarize a number of related questions. The problem of finding sets S ⊂ Z n m with, or without, a given property has been investigated frequently. Often one is actually interested in the maximal size of |S|. Also, often even the one-dimensional case has been of fundamental interest. Let us recall some of the properties that have been investigated.
(1) Erdős and Turán [28] raised the problem of studying the maximal size r k (N ) of sets in {1, . . . , N } without an arithmetic progression of length k. There are important contributions by Behrend, Bloom and Sisask, Bourgain, Gowers, Green, Roth, Salem and Spencer, Sanders, Szemerédi, Tao [5,7,31,33,50,51,53,55]. In particular, the proof of r k (N ) = o(N ), as N tends to infinity, and quantitative versions thereof, proved to be very influential in this area. It is interesting to note that the size of progression-free sets even enters the complexity of matrix multiplication, see [14,58]. The question of arithmetic progressions has also been studied modulo m, see e.g. Croot [15]. In this setting "modulo m" one has to clarify if elements of the progression can occur more than once. For example (1, 3, 1, 3) can possibly be considered as a progression of length 4 modulo m = 4. In this paper, however, we study "proper arithmetic progressions" meaning that all elements in the progression are distinct, unless otherwise stated. (2) Assume that S does not have k elements x 1 , . . . , x k ∈ Z n m that satisfy (for fixed constants a 1 , . . . , a k ∈ Z) a linear equation a 1 x 1 + a 2 x 2 + · · · + a k x k = 0 ∈ Z n m . (a) The case n = 1, k = m, a 1 = a 2 = · · · = a k = 1 was first investigated by Erdős, Ginzburg and Ziv [29], who proved that for any 2m − 1 elements in Z m , where in this problem repetition is allowed, there exists a subset of m elements with sum 0 ∈ Z m . (There are hundreds of papers on generalizations and variants, the general topic is called "zero sums in finite abelian groups"). In the case n = 2 there has been important work by Reiher [48]. The multidimensional case with n ≥ 3 is widely open, even though there are lower bounds by Edel, Elsholtz et al. [19,22,25], and upper bounds by Alon and Dubiner [2], Naslund [42] and Hegedüs [35]. (b) The case x 1 + x 2 − x 3 = 0, x i ∈ S corresponds to sum-free sets. In the onedimensional case S ⊂ {1, . . . , m} it is known that the maximal size is |S| ≤ m 2 +1, if all x i are distinct, or |S| ≤ m+1 a prime m it follows from the Cauchy-Davenport theorem that the maximal size satisfies |S| ≤ m+1 3 (x i all distinct). In the multidimensional case of an integer grid there are results by Cameron [10], Elsholtz and Rackham [26].
(3) The case of no geometric line (of m points) in the integer grid {1, . . . , m} n is known as Moser's cube problem, see [41,45]. Closely related is the question of finding the maximal number of lattice points in the same cube {1, . . . , m} n , but without any combinatorial line. The famous upper bound by Hales-Jewett [34] of o(m n ) points, when m is fixed and n tends to infinity, became very influential.
In this paper we concentrate on sets S ⊂ Z n m of maximal size |S| = r k (Z n m ) with no k distinct elements in arithmetic progression. Observe that an arithmetic progression of length k can be expressed by means of k −2 linked linear conditions The multidimensional case of no 3 points in arithmetic progression has frequently been studied, especially modulo m = 3. Here the questions of "no zero sums x 1 +x 2 +x 3 = 0" and "no arithmetic progression x 1 + x 3 = 2x 2 " turn out to be equivalent as 1 ≡ −2 mod 3. The problem is known as the "cap set problem". There were important contributions by Brown and Buhler [8], Frankl, Graham and Rödl [30], Meshulam [40], Lev [38], Bateman and Katz [4], Croot et al. [16], Ellenberg and Gijswijt [24].
For a long time it was an important open problem if there is a δ > 0 such that |S| < (3−δ) n holds, for all progression-free sets S ⊂ Z n 3 . Various authors mentioned this statement with varying degree of certainty or doubt, (see [1,2,18,32,36,56]) until the solution by Croot et al. [16] (when m = 4), and finally Ellenberg and Gijswijt [24].
Meshulam's [40] long-standing bound r 3 (Z n m ) = O( m n n ) for odd values of m ≥ 3 was extended by Lev [38] to even values m ≥ 4. Improving this, Sanders [52] proved the following result: for some positive c. Green and Tao [33] write that c = 2 −22 is admissible. Introducing an entirely new approach, based on the polynomial method rather than Fourier techniques, Croot et al. [16] proved that where γ ≈ 0.926. The new methods introduced in [16] also led to the result in the case r 3 (Z n 3 ) ≤ 2.756 n by Ellenberg and Gijswijt [24]. Again, the case of cap sets has applications to the complexity of matrix multiplication, see [3,6].
The corresponding problem on lower bounds of progression-free sets in G = (Z n 3 , +) has also been studied in detail. It is known (see [18] for the history and current record) that there is a set S with |S| > 2.217389 n = |G| β with β = log 2.217389 log 3 ≈ 0.724851). The currently strongest lower bound example comes from a product construction, based on an example in dimension 480.
For a lower bound when m = 4 Sanders [52] proved: there exists S ⊂ G = (Z n 4 , +) which does not contain a proper three term arithmetic progression with |S| |G| 2/3 ≈ 2.519 n .

Remark 1.1
As J (s) is decreasing and J (3) ≤ 0.9184, with the additional consideration of composite m (see below), one can conclude, that for every m ≥ 3 the following holds (see e.g. [6,44]).
For m not being a power of 2 this also holds: if p is an odd prime divisor of m, then r 3 (Z n m ) ≤ (m/ p) n r 3 (Z n p ) ≤ (m/ p) n ( p J ( p)) n ≤ (0.9184m) n . For integers divisible by 4 this follows from [16], since r 3 (Z n m ) ≤ (m/4) n r 3 (Z 4 ) n ≤ (0.91m) n .
There are only very few explicit values known. In the case of cap sets modulo m = 3 the following is known: The author of the 6-dimensional result (Potechin [46]), and the authors of the classification of the unique 5-dimensional maximum cap [21], (required for the 6-dimensional case by Potechin) mentioned they used computer calculations. Y. Edel informed us that for the paper [21] the computation time was a few weeks. The remaining part of the paper is organized as follows: After some necessary notation and describing the results we first prove the asymptotic lower bounds in Sect. 4, as these proofs are shorter. In Sect. 5 we give a reformulation for the problem of finding r 3 (Z n 4 ) and r 4 (Z n 4 ). In Sect. 3.1 we give a lower bound for r 3 (Z n 4 ), we then prove that this construction gives the exact values up to dimension 5 (Sects. 6 and 7), which require some detailed case studies. Finally, in Sect. 8 we prove the exact values for r 4 (Z n 4 ) up to dimension 4.
In Sections 6, 7, 8 we will work with linear and affine subspaces of F n 2 . If L is a linear subspace of dimension d, for brevity we will say that L is a d-subspace. The smallest linear subspace containing the vectors v 1 , . . . , v k will be denoted by v 1 , . . . , v k .
Similarly, if L is an affine subspace of dimension d, we will say that L is an affine d-subspace and the smallest affine subspace containing v 1 , . . . , v k will be denoted by v 1 , . . . , v k a f f .
Throughout the paper for a subset A ⊆ F n 2 we use the notation A+ A = {a+a : a, a ∈ A} for the sumset and A+A = {a + a : a, a ∈ A, a = a } for the restricted sumset.

Progression-free sets
Theorem 3.1 For sets without arithmetic progression of length 3 we have the following results: We give quite uniform proofs for all these dimensions. The value r 3 (Z 3 4 ) = 16 was stated before by Sanders [52] (and was indeed a computer calculation by O. Sisask), and the value r 3 (Z 4 4 ) = 42 was determined in a Masters' Thesis by Lawrence Newcombe [43] (a student of the first author). From that proof it was already apparent that r 3 (Z n 4 ) could be much smaller than 4 n , due to a Z n 2 -substructure of Z n 4 , but proceeding to higher dimension might have been very tedious.
Next we give a lower bound on r 3 (Z n 4 ). In the construction we use binary codes with certain minimum distances. Let A(m, d) denote the largest possible size of a (possibly non-linear) code in F m 2 with minimum distance at least d. Note that A(m, 1) = 2 m (all vectors can be taken) and A(m, 2) = 2 m−1 (all codewords can be taken with even Hamming-weight Hence T (a) = T (c) ⊇ T (b) and a and c differ only at positions i ∈ T (a)\T (b).
Fix t and let S ⊆ {0, 1, 2} n be such that |T (a)| ≥ t for every a ∈ S and such that {a ∈ S : T (a) = T } has minimum Hamming distance at least |T | − t + 1 for every T with |T | ≥ t. Then S does not contain a proper 3-progression We can construct such S as follows. For every T ⊆ [n] of size i ≥ t we take a binary code in {0, 2} T of size A(i, i − t) of minimum distance i − t and add symbols '1' in the positions [n]\T to get a code A T . The set S = ∪ |T |≥t A T gives the stated lower bound.
As a consequence of this result one can prove a quite good lower bound. 3 n √ n which implies that there exists a progression-free set S ⊂ Z n 4 with |S| 4 0.7924n .
The exponent 0.7924 is not only much larger than the previous one of 2/3, but it is also much larger than the corresponding one 0.724851 when m = 3. This can be interpreted that the progression-free sets in Z n 4 are denser than those in Z n 3 . The ultimate reason for this is that we find a geometrically well structured subset, namely {0, 1, 2} n , on which we can find a very dense progression-free subset. As two elements from the same coset of the subgroup {0, 2} n forbid 2 n other points, namely an affine copy of {0, 2} n , it comes handy that this forbidden set has some geometric-algebraic structure.
This Corollary is the first nontrivial case of the lower bound constructions and is suitable for discussing various methods. We first prove it as a direct application of Theorem 3.2.

Proof of Corollary (Proof 1)
Calculations show that the optimal choice for t in Theorem 3.2 satisfies t ∼ 2n/3. In particular, for 2 ≤ n ≤ 10 the optimal choice is t = (2n − 5)/3 . Note that the sum of only the first two terms in the lower bound n i=t+1 n i A(i, i − t), with an optimal value of t, is The total sum is not much larger as it is bounded above by 3 √ π · 3 n √ n (see also [12]). The proof of Theorem 3.2 and Corollary 3.3 above may appear a bit formal. In Section 4 we explain in detail the geometric motivation of a direct proof of Corollary 3.3, i.e. the connection to Moser's cube problem, and to the Behrend and Salem-Spencer constructions.
Finally, we found a quite different proof, based on weighted Sperner capacity of the 2vertex graph with one directed edge, and vertex weights 1 and 2, but decided not to include it. 10 4 ). Let us explain this with two examples: when n = 5, choose t = 2. Then which is best possible by Theorem 3.1. When n = 8, choose t = 4.
Theorem 3.5 For sets without arithmetic progression of length 4 we have the following results: It is well known that results of this type can be lifted to higher dimensions and yield asymptotic results by a simple product construction, compare also Proposition 3.5 [22] in the similar setting of zero-sum free sets.

Lemma 3.6 Let q be a prime power.
(a) Let S 1 ⊂ Z n 1 q and S 2 ⊂ Z n 2 q be k-progression-free sets, then S 1 × S 2 ⊂ Z n 1 +n 2 q is also k-progression-free.
(b) A repeated application of part a) gives: Lifting the largest known exact values r 3 (Z 5 4 ) = 124 and r 4 (Z 4 4 ) = 128 gives: The first result is considerably weaker than Corollary 3.3, while the second one is the strongest that is currently known. The product construction only makes use of "local" information from small dimensions. The "relative density" for the high dimensional problem is the same as for the low dimensional base-example that was lifted. Lifting for example the bound r 3 (Z 10 4 ) ≥ 22232, (which is not known to be sharp), gives a better estimate r 3 (Z n 4 ) 2.720 . . . n . But for k = 3 it is better to use the "global" information from the digits giving the lower bound 3 n √ n . But for k = m = 4 we do not know how to replace the product construction by a better strategy.
In many cases we present constructions much better than the product construction. These make use of "global" properties i.e. making full use of the actual dimension n. With our current understanding this only works when k < m. For k = m the product construction appears to be the strongest available method, see also Edel [18].
These proofs describe a set explicitly in terms of its coordinate entries, similar to the constructions by Salem and Spencer [51], and Behrend [5]. Salem and Spencer constructed progression-free sets in the integers by representing integers in an m-ary digit system, m odd, and using the digits 0 ≤ a i ≤ (m − 1)/2 a fixed number of times, namely with frequency n/d for integers of length n. Restricting the digits avoids wrapping over modulo m. Behrend constructed large progression-free sets in the integers by mapping a high-dimensional sphere, which by convexity is progression-free, to the integers. He also represented integers in an m-ary system with digits 0 ≤ a i ≤ (m − 1)/2, where m is odd, and fixed value n i=1 a 2 i . In the integer case the optimization of the values of m and n shows that Behrend's construction is greatly superior. In our setting we make use of both ideas, and observe that m, n are fixed by the problem, and the method of Behrend, when applicable, is only slightly stronger, but a bit more complicated. It follows from Theorems 3.11 and 3.12 that m+1 2 ≤ α k,m ≤ m. For k = 3 more is known, see Sect. 1: α 3, p ≤ J ( p) p, when m = p is an odd prime, and where J ( p) was defined by (1). We state a more general conjecture: Conjecture 3.9 By the proposition above and the theorems below we know: for each k ≥ 3 and each prime p ≥ k there exists a constant α k, p , which is certainly in ( p 2 , p], such that r k (Z n p ) = (α k, p + o(1)) n holds, as n tends to infinity. We conjecture that the following limit α k := lim p→∞ α k, p p exists, and thus is in [ 1 2 , 1]. (If k ≥ 4 the bound α k < 1 would mean that an exponential saving for the upper bound holds, as is the case with k = 3.) In view of the above results, and also in view of an upper bound in a relevant case, see Theorem 3.18, we state the following conjecture: Their proof makes use of a product construction, as explained in Lemma 3.6. They also have some results, when m is a pure prime power, but this refers to finite fields F m , which are different from Z m . In particular, when m is prime and m k−1 is large, and n increases, the exponential growth of the lower bound is based on the constant m k−1 k , compared to m+2 2 here. We now give our general theorems, which improve the above lower bound and remove the prime condition on m: Theorem 3.11 Let m ≥ 5 be odd. There exists some C m > 0 such that The case m = 5 also improves the asymptotic lower bound of affine caps, for details see Sect. 3.2 In the case m = 3 this would give a lower bound of 2 n √ n only which is smaller than the trivial lower bound by taking all 2 n elements with coordinate entries 0 or 1. Also note that in view of r k (Z n m ) ≥ r 3 (Z n m ) the theorem trivially induces lower bounds for any k ≥ 3 (also in the theorem below).
A crucial idea again is to avoid any product construction and to use one more digit than Tao and Vu [57, exercise 10.1.3] used, with some extra constraints, which are less costly (if m is constant and n increases). Their lower bound m n 2 n · 1 m 2 n 2 in case m = 4 would also be weaker than the trivial progression-free set {0, 1} n with 2 n elements. Theorem 3.12 Let m ≥ 4 be even. There exists some C m > 0 such that . For large m one has that (A version of this result, in the special case m = 8 has also been observed in [44], having seen a precursor of this manuscript. Their main concern is an improvement of the upper bound.) As is well known from Behrend's construction there are good reasons to restrict to half of the available digits. In the above cases we go up to one element more than half of the digits. In the cases of even m one additionally has to study progressions of type 0 m 2 0 carefully. In the examples below we go even further, and note that those progressions which actually use the reduction modulo m cause quite a bit of extra work. (For example, in the case r 4 (Z n 11 ) we have to care about progressions of type 1, 6, 0, 5 modulo 11.) Theorem 3. 13 The following holds r 4 (Z n 11 ) 7 n n 3 .
(No attempt was made to reduce the exponent 3.) For comparison Lin and Wolf [39] have a lower bound of about about 6.04 n . (For fixed k the improvement increases, as m increases.) It is clear that on a case by case study one can prove related results for several individual values of m and k. Here we present two further cases where these ideas are generalized to infinite families m = p s , k = p s−1 + 1 (or k = p s−2 + 1 respectively), where p is prime. It should be noted that in this case the set of digits used is not consecutive, but makes use of the structure of orbits of length p, and hence the algebraic structure. As can be seen, several good properties are preserved: many progression types can be excluded by the Salem-Spencer "same-frequency property", and the "all-elements-distinct" property, (i.e. proper progressions). Theorem 3.14 Let m = p s be a pure prime power, s ≥ 2. Let k = p s−1 + 1. Then there exist constants C m > 0 and 0 < c m ≤ m/2 such that the following holds:

Corollary 3.15
There exist positive constants C m and c m ≤ m/2 such that the following holds: For p = 2, this is certainly not best possible. By Theorem 3.12 for m = 8, k = 3 one can use 5 digits, rather than 4.

Corollary 3.17
There exist positive constants C m and c m ≤ m/2 such that the following holds: We are not aware of any earlier results of this type. We now briefly discuss some aspects of the proofs of the exact values, and of a conditional upper bound.
For the estimations of r 3 (Z n 4 ) we shall need a reformulation of the problem which is presented in Section 5. Let us say that a system of subsets A(x) ⊆ F n 2 (x ∈ F n 2 ) satisfies property ( * ), if the following implication holds: (Note that for A(x) = ∅ we define x + A(x)+A(x):=∅.) In Lemma 5.1 we will show that the largest possible total size of a system of subsets satisfying property ( * ) is exactly r 3 (Z n 4 ). Hence, estimating the maximal total size of a system of subsets {A(x) : x ∈ F n 2 } satisfying ( * ) is equivalent with our original question.
As it turns out it is very useful that we can reduce the case of arbitrary subsets A(x) to the case of subspaces. We do not know, if this can be done for higher dimension, but for the low dimensions studied here explicitly this is a quite powerful method. In this case, the upper bound O(3 n ) is quite close to the general lower bound in the unrestricted case, namely n. This is the heuristic reason why we state Conjecture 3.10. Note that for n = 1 any 2-element subset forms a progression-free subset in Z n 4 . If n ∈ {2, 3, 4}, then the extremal construction is also unique in the following sense: x ∈ F n 2 } both have total size r 3 (Z n 4 ) and they satisfy ( * ), then there is an invertible affine linear transformation ϕ : Z n 2 → Z n 2 and vectors c(x) ∈ Z n 2 (x ∈ Z n 2 ) such that A (x) = A(ϕ(x)) + c(x) for every x ∈ Z n 2 .

Caps
An affine cap in AG(n, q) is a set in F n q with no three points on a line. Here we set m = q, and we study sets without three points on a line in Z n m . In other words, when m = q is a prime, caps in Z n m and AG(n, q) are the same. The condition "no three points on a line" can be expressed by linear equations of the type ax + by + cz = 0 (where a + b + c = 0). As we see below when m = 3, 5 it is enough to consider the case of arithmetic 3-progressions, x − 2y + z = 0. The case m = 4 does not correspond to affine caps, as Z 4 = F 4 , but in Z m with m = 3, 4, 5 any line with three points actually contains 3 points in arithmetic progression. To see this modulo m = 5, one just has to examine all cases in one dimension. There are obvious cases such as {0, 1, 2} or {0, 2, 4}. The crucial case is that also the example {0, 1, 3} ⊂ Z 5 is a progression, as 1, 3, 5 = 0 is a progression.
Modulo m = 3 the cap set problem is known even from the popular card game S E T . The size of the caps in dimension up to 6 are r 3 ( More generally modulo prime m = q the following is known about affine caps in Z n m = AG(n, q), (we would like to thank Yves Edel for this collection): in dimension n = 2 : one has m + 1 points (a so called oval) n = 3 : one has m 2 points (which is the affine part of an ovoid in projective space) n = 4, m = 5 at least 65 points (which is the affine part of a projective cap of 66 points, see [20]. n = 5, m = 5 one has at least 195 points. 3 n = 6 : one has at least m 4 + m 2 − 1 points, see Edel [18]. For large dimensions, the best lower bound constructions are due to Edel [18] and are based on a tensor product construction of this best cap in dimension 6. For prime m, this gives a lower bound of r 3 (Z n m ) ≥ m n(log m (m 4 +m 2 −1))/6 , (which is also the construction of Lin and Wolf [39]), and this gives an asymptotic exponent of about 2/3. Some refinements are known, when q = 3 or q = 4 (finite field case, different from Z 4 ). Edel ([18]) writes: "No better lower bound seems to be known for general q, except for the ternary and quaternary cases." Especially in the case m = 3 there have been a number of refinements to an exponent of 0.724851 (see [18]). The progress over the previous record 0.7218 (see [9]) seems small, but this progress is, of course, on a logarithmic scale.
When m = 5 the above lifting from dimension 6 gives a lower bound of 5 0.6705n ≈ 2.9421 n points. In contrast, Theorem 3.11 above gives the lower bound of C 5 3 n / √ n ≈ 5 0.6826n points. It may be possible to optimise the constant C 5 in the construction modulo 5, similar to the case m = 4 in Theorem 3.2. In any case this improvement appears to be the first improvement for any affine cap in AG(n, m), when m = q ≥ 5.
As the case of affine caps modulo primes (or prime powers) has been well studied in the literature it seems somewhat surprising to us that the quite simple construction of vectors with n/3 of the entries being 1, and the other 2n/3 of the entries being 0 or 2 has not been observed before, and still asymptotically breaks the record. The reason may be that the improvement actually can only be seen for n ≥ 138. Even with an improved constant C 5 one will not see the improvement for small dimension.

Proofs of the asymptotic lower bounds
We will use several times that the central multinomial coefficients can be approximated by Stirling's formula: Here we give a geometrically inspired proof of Corollary 3.3.

Proof of Corollary 3.3 (Proof 2):
The crucial idea is that an arithmetic progression of length 3 (with 3 distinct points) in Z n 4 has a uniquely defined middle point. For comparison, this is not the case in Z n 3 . We relate the problem to a problem posed by Moser [41]. Find in H = {0, 1, 2} n the maximal set of elements without "three on a line" (which is also known as Moser's cube problem). Observe that in this case there is no reduction modulo 3. Let f (n) denote the largest [45]. In dimensions 1, 2, 3 and 5 these values are the same as r 3 (Z n 4 ), but in dimension 4 one has that r 3 (Z 4 4 ) = 42 < f (4) = 43. A simple observation by Komlós [37] shows that f (n) 3 n √ n , and the implicit constant was refined again by Chvátal [12]. The construction by Chvátal relates the problem to coding theory and gives f (5) ≥ 124, for example.
Let us adapt Komlós' [37] observation to our situation: the set has the claimed number of elements and has no three points on a line. Let us count the number of such points, let n be a multiple of 3, then by Stirling's formula S has |S| = 2 n−m n m = 2 2n/3 n n/3 elements. When n ≡ 1, 2 mod 3 we have the same order of magnitude, up to a constant factor, for example, by filling the extra 1 or 2 coordinates with entries from {0, 1}. Further observe that for three points P 1 , P 2 , P 3 to be on a line (in this order), one would need, in each coordinate, that i) all entries are the same, or ii) the entries are 0, 1, 2 or 2, 1, 0 (in this order). Since the number of "middle entries 1" is constant for all points, there cannot be an arithmetic progression of three distinct digits. Let us embed the set S from {0, 1, 2} n canonically into G = (Z n 4 , +). Think of G as the lattice points {0, 1, 2, 3} n but now with reduction modulo 4 in each coordinate. Observe that the set S does not have a single "3"-entry. An arithmetic progression of length 3 modulo 4 that does not make use of x i = 3 in any coordinate must be of one of the types below, in a given coordinate. The digits are: (i) the same, (ii) or are 0, 1, 2 or 2, 1, 0 in this order, (iii) or 0, 2, 0, or 2, 0, 2.
We will show that the set S ⊂ Z n 4 does not contain a proper 3-progression. Suppose S does contain three distinct points P 1 , P 2 , P 3 in arithmetic progression. The case i) where all entries are the same does not play any role. Let us look at those coordinates where the entries differ. Since all points have the same number of 1 entries, let us study, where one of the three elements uses a "1", but another point does not: For this, the only possibilities are 0, 1, 2 and 2, 1, 0. But here only the middle point P 2 can make use of a 1. So, the two points P 1 and P 3 cannot make use of their ones, unless all three entries are identically 1. This means that all three points have their ones in exactly the same position, and that there is no coordinate with a progression 012 or 210. So, let us look at the other coordinates. The only possibilities left are 020 or 202. But then P 1 and P 3 would be the very same point, a contradiction to the definition of a proper progression.

Proof of Proposition 3.8
The idea of this proof might go back to Shannon [54], see also Davis and Maclagan [17]. Let α k,m (n) = r k (Z n m ) 1/n , so that we have the following properties: By the product construction (Lemma 3.6) we have i.e. α k,m (n 1 ) n 1 α k,m (n 2 ) n 2 ≤ α k,m (n 1 + n 2 ) n 1 +n 2 and therefore Therefore, the sequence {n log α k,m (n)} ∞ n=1 is superadditive. By Fekete's Lemma on superadditive sequences the limit lim n→∞ log α k,m (n) exists and equals sup n log α k,m (n).

Proof of Theorem 3.11:
We first prove a slightly weaker result based on the Salem-Spencer construction [51] for sets of integers without arithmetic 3-progression. Recall that m is odd and that we only need to study k = 3. Assume first that n is a multiple of (m + 1)/2. Choose vectors with digits The number of such vectors is maximized when n i = n m+1 2 for every i. This gives at least C m ( m+1 2 ) n 1 n cm points, for positive constants C m , c m . If n is not a multiple of (m + 1)/2 one can fill the remaining coordinates with entries 0 ≤ a i < k, which slightly weakens the constant C m .
We show that there is no arithmetic 3-progression: by the choice of the allowed digits, if the digit a > 0 occurs, then the digit m − a ≡ −a mod m is forbidden, so 0 is never in the centre of a proper 3-progression. As all vectors have the same number of 0-entries, all of these digits 0 must occur in the same coordinate position, giving a trivial 000-progression. One then continues: All nontrivial 3-progressions, without the digit 0 do not have a digit 1 in the centre, and hence the digit 1 can only come from a 111-progression.
As there are three distinct points, there must be a proper 3-progression of 3 distinct digits abc. As the digit 0 is never in the centre of any of these nontrivial 3-progressions, and as all vectors have the same number of 0-entries, the digit can only occur in the trivial way: 000. This leaves the following shorter list of nontrivial 3-progressions: 123, 135, 234, 321, 345, 432, 531, 543.
Now the digit 1 is never in the centre, and 1 can only occur in the trivial 111 progression. leaving the list 234, 345, 432, 543. Now, the digit 2 is never in the centre, so 2 can only occur as 222, leaving 345, 543. Now 3 is never in the centre, which gives the final contradiction.
Note that initially we have restricted the frequency of all digits 0, 1, 2, 3, 4, 5, but we can now observe that restricting the frequency of the digits 0, 1, 2, 3 is enough.
Based on a comment of a referee, we can also observe that one gets some saving on the number of restrictions, when fixing the total number of occurrences of "digit is 0 or 5". As there is no 0 or 5 in the centre position one can remove 0 and 5 so that the list of nontrivial progressions 012, 024, 123, 135, 234, 210, 345, 321, 420, 432, 531, 543 immediately shrinks to 123, 234, 321, 432. Now a second condition such as "the total number of occurrences of 1 and 4 is constant" also forbids these cases, so that we have used only two restrictions. In general it seems that about m/4 such restrictions of joint occurrence of digits a and (m − 1)/2 − a are sufficient.
We now prove the theorem in its full strength, based on Behrend's construction. The number of elements used is larger by a factor n c only.
Let m be odd, and n be a multiple of (m + 1)/2. Let Here S R can be thought of as a sphere about centre ((m − 1)/4, . . . , (m − 1)/4)) with R as squared radius. We prove that all S R are progression-free and there exists an S R of size at least C m Suppose there are three distinct points P 1 , P 2 , P 3 in arithmetic progression. None of the progressions in a fixed coordinate makes use of the reduction modulo m, so the convexity of the geometric sphere gives a contradiction. But let us look at this arithmetically: Let the progression in the i-th coordinate be a i − d i , a i , a i + d i . Then for the three points one has In other words, the three points are identical, which is a contradiction. The size of large sets S R follows from the observation that most elements in (a 1 , . . . , a n ) in an interval of size the standard deviation around the mean value. To make this more precise, we follow Elkin [23] and consider a i − m−1 As the proof only makes use of effective bounds, the result is valid for all odd m ≥ 5 and all n. If the odd value m tends to infinity, then, asymptotically σ m ∼ m 2 24 √ 5 holds, giving the claimed value of C m .
Remark While the Salem-Spencer type construction with all frequencies of the digits being constant is completely explicit, the above Behrend-type proof uses the pigeonhole principle, which is not explicit, and in algorithmic terms slowly, as one would need to search for a good value R. However, a result of Rankin [47] gives entirely explicit bounds on the number of representations of numbers as a sum of n squares of bounded size. In particular this shows that not only there are good values R but that all values R in the interval are good, when weakening the constant C m by a small factor only. In particular, one can choose R = μn . In another direction, as the above argument does not make use of reduction modulo m, it seems possible to implement the improvement by Elkin [23], which might gain an extra factor, maybe of size n c . Elkin observed that 3-progressions in a suitable union of spheres (annulus) are geometrically quite restricted. One can then prove that there is a large subset of this union which is progression-free.
Proof of Theorem 3.12: Again, we first prove a sightly weaker version based on the Salem-Spencer construction. This proof is similar to the previous case, but as m is even there is one extra complication to care for. Assume first that n is a multiple of (m + 2)/2, and that there is an arithmetic progression of three distinct points. Let us define the Behrend-sphere: We prove that S R is 3-progression-free in Z n m . The estimate on the number of points is as in the case of odd m above.
Suppose there are three distinct points P 1 , P 2 , P 3 in arithmetic progression. The nonconstant progressions in a fixed coordinate do not make use of the reduction modulo m, with the two exceptions of 0 m 2 0 and m 2 0 m 2 . Let n 1 , n 2 , . . . , n s denote the number of coordinates with a fixed progression-pattern such as 000, 012, 024 etc. Of these, let n 1 count the pattern 0 m 2 0 and and let n 2 count the pattern m 2 0 m 2 . As all other patterns do not wrap over modulo m let n i count the pattern points (a 1 , . . . , a n ) in S R lie on a sphere with centre (m/4, . . . , m/4). Let the progression pattern of the j-th coordinates be p j − d j , p j , p j + d j .
Then for the three points P 1 , P 2 , P 3 one has that n 1 This gives s i=3 n i 2d 2 i = 0. Hence for all non-constant patterns with i ≥ 3 one has that n i = 0. The three points only consist of patterns aaa, 0 m 2 0 or m 2 0 m 2 . Therefore the first and the third point are exactly the same point, in contradiction to the assumption.
We estimate C m as above: Note that σ 4 =   1 a 2 a 3 a 4 ) denote the number of coordinates, where the pattern a 1 a 2 a 3 a 4 occurs among the 4 points which are in arithmetic progression. As the digit 0 occurs in all 4 positions with the same frequency, and applying it to positions 3 and 1 we see that the number of occurrences of a pattern 1605 equals the sum of the number of occurrences of patterns 0123 and 0246 together. (See underlined symbols in the list of patterns.) Also looking at digit 1 at positions 2 and 1, and combining these gives: which implies: As 1234 is the only nontrivial progression with digit 4 in the last position, all 4's must occur in form of a trivial progression, 4444. Therefore This leaves only the following nontrivial progressions.

0123, 1605, 3210, 5061
Here we observe that there are no digits 2 or 6 at the boundary, and also no digits 3 or 5 in the positions 2 and 3. So, in each coordinate there can only be a constant progression, which contradicts that we have a proper progression of distinct points in S. The number of elements in S is the multinomial coefficient n n/7,n/7,n/7,n/7,n/7,n/7,n/7 = n! ((n/7)!) 7 ∼ C 7 n n 3 for some constant C > 0, by Stirling's formula. If n is not a multiple of 7, say n = 7r + i, one adds i ≤ 6 further coordinates with constant digits, which weakens the overall lower bound by a small factor. Proof of Theorem 3.14 In this situation we do not take the digits consecutively, but make use of the algebraic structure of (Z m , +). In particular p s−1 generates a subgroup of order p, and k-progressions in Z m with gap size divisible by p have the property that the first element is the same as the last element. We choose the digits as follows: Observe that D contains p s−1 − 1 complete cycles of length p, and one extra element, and so |D| = ( p s−1 − 1) p + 1 = p s − p + 1. There are three types of progressions of length k = p s−1 + 1 in D: 1. Type I progressions have a non-zero gap size divisible by p. In this case the first element and the last element of the progression are the same. 2. For Type II progressions the gap size is not divisible by p. In this case all residue classes modulo p s−1 occur, and the first and last element are the same modulo p s−1 , but cannot be the same modulo m = p s . The residue class p s−1 − 1 mod m must occur, as D contains only one element −1 mod p s−1 . We observe that no such k-progression can start with p s−1 − 1, as it would have to end at another element −1 mod p s−1 , which is impossible. 3. Type III progressions are constant.
So far this was the part which generalized the algebraic situation from m = 4 to prime powers. The last part is the set-theoretic trick inspired by Salem and Spencer.
Let |D| | n and let S = (a 1 , . . . , a n ) : The number |S| of elements is the multinomial coefficient Let us study the occurrence of the digit p s−1 − 1 in the first vector. It cannot be part of a type I or type II progression, and hence must be a constant type III progression. Therefore all coordinate entries p s−1 − 1 in all vectors occur in the same positions. In all other coordinates we only have type I and type III progressions. For these the first and the last elements are the same, modulo m. Hence there cannot be a proper arithmetic progression of length k, which by definition consists of k distinct elements. The number |S| of elements is the multinomial coefficient n n/|D|,...,n/|D| ∼ C m |D| n n (|D|−1)/2 . As all elements contain the same number of 0-entries, the constant progressions (type IV) are the only ones that contain any 0-entry. Now suppose that S has a proper progression of length k = p s−2 + 1. All k elements contain in n |D| positions an entry d ∈ D 3 . Looking at the first element of the progression we see that these progressions starting with d ∈ D 3 can only be of type IV, i.e. constant. Hence all digits D 3 cannot take part in any nontrivial progression. With all other digits in Z m \ (D 1 ∪ D 2 ) and with all progression types we observe that the first and the last elements are the same. Altogether, the set S of vectors does not have a proper arithmetic progression of length k, which by definition consists of k distinct elements.

Subset reformulation
In this section we give a "subset formulation" for the question of determining r 3 (Z n 4 ) and r 4 (Z n 4 ). As an application of the former one, we give another proof for Corollary 3.3, then we prove Theorem 3.18.

Reformulation for 3AP-free-ness
Let us say that a system of subsets A(x) ⊆ F n 2 (x ∈ F n 2 ) satisfies property ( * ), if the following implication holds: The proof of Lemma 5.1 (below) shows that property ( * ) nicely captures the condition that the "corresponding" A ⊆ Z n 4 is 3AP-free.
Every element a ∈ Z n 4 can be written as a = f + r ( f ∈ F, r ∈ R) in a unique way. Let A ⊆ Z n 4 . Let us assign to every x = 2r ∈ F (where r ∈ R) a subset A(x) ⊆ F in the following way: A(x) = {y ∈ F : r + y ∈ A}. Three distinct elements form an arithmetic progression (in this order) if and only if a 1 + a 3 = 2a 2 , that is, if f 1 + f 3 + r 1 + r 3 = 2r 2 . As f 1 , f 3 , 2r 2 ∈ F, this implies r 1 = r 3 , so the condition gives 2r 2 = 2r 1 + f 1 + f 3 . Such elements can be found in A if and only if for distinct x = 2r 1 , y = 2r 2 ∈ F we have y ∈ x + A(x)+A(x) and A(y) = ∅. Note that F ∼ = F n 2 , and this is equivalent with the condition that the system of subsets satisfies property ( * ). Furthermore, |A| = |A(x)|, so the maximal possible size of a 3AP-free subset of Z n 4 is equal to the maximal possible total size of a system of subsets A(x) satisfying property ( * ).

3AP-free sets: lower bound and subspace version
In this subsection, first, as an illustration, we give an alternative -different from the proof presented in Section 4 -proof (using the subset reformulation) for Corollary 3.3, then we prove Theorem 3.18.
The total size of the subsets A(x) is n r 2 r . The optimal choice is r = 2n/3 yielding Proof of Theorem 3. 18 For 0 ≤ k ≤ n let X k contain those x for which A(x) is a subspace of codimension k. If there is an A(x) of codimension 0, that is, A(x) = F n 2 , then all the other A(y) sets are empty, thus the total size of the subsets is only 2 n . From now on, we assume that each nonempty subset is a subspace of positive codimension.
Let us fix k. For x ∈ X k let x (1) , . . . , x (k) be a basis for the orthogonal complement of i . Therefore, the total size of the subsets A(x) is at most n k=1 k i=1 n+1 i 2 n−k ≤ 6 · 3 n . Now we use the tensor power trick to get rid of the factor 6. Let us assume that in F n 2 the system of subsets A(x) satisfies ( * ) and all the non-empty subsets are subspaces. Let S = |A(x)|. Now, we can define a system of subsets in F nt 2 as follows. For (x 1 , x 2 It is easy to check that this system satisfies ( * ), all the non-empty subsets are subspaces and the total size of the subspaces is S t . Therefore, S t ≤ 6 · 3 nt , thus S ≤ 6 1/t 3 n . This holds for every t, so the statement is proven.
Furthermore, |A| = |A(x)|, so the maximal possible size of a progression-free subset of Z n 4 is the same as the maximal possible total size of a family of subsets A(x) satisfying property ( * * ).

3AP-free subsets of Z n 4 , if n ≤ 4
Now, we are ready to prove Theorem 3.1. In this section we give a proof for n ≤ 4, the case n = 5 is covered in the next section. Before starting the proof we give a brief outline of the main strategy. If we take a look at condition ( * ) or ( * * ), then heuristically it seems to be a good idea to use sets with small doubling, since ( * ) and ( * * ) seem to be less restrictive for sets with a small doubling.
Subspaces have a small doubling, and working with them is easier, an important step will be to show that it can be assumed (up to n ≤ 5) that in a maximal configuration all the (non-empty) subsets are subspaces. To arrive at this all-subspace state, we can use arguments of the following type. If A(x) + A(x) ⊇ V for a large subspace V (where "large" means that |V | ≥ |A(x)|), then we can replace A(x) by V , since ( * ) (or ( * * )) remains true (that is, the corresponding subset is still 3AP/4AP-free) and the total size of the subsets is larger (not smaller). So the general plan is to replace the subsets with subspaces, and then solve the subspace version of the problem. If the dimension is small, then for almost all subsets A(x) we can do this reduction step easily, there are just a few cases, when A(x) + A(x) does not contain a sufficiently large subspace. However, even in these exceptional cases A(x) + A(x) turns out to be too large, so these cases can be excluded, as well. As the dimension increases, both the reduction step and both handling the all-subspace problem is getting more difficult. The 5-dimensional case is considerably more difficult than the previous cases, the proof of it is presented in the next section. Now, we continue with the proof of the cases 1 ≤ n ≤ 4. Proof of Theorem 3.1 in the cases n ≤ 4. According to Lemma 5.1 and Corollary 3.4 it suffices to show that r 3 Case 1: n = 1. If the dimension is 1, then it is trivial that every 2-element subset of Z 4 is 3AP-free and any three elements form a 3AP, so r 3 (Z 4 ) = 2.
We continue with some general observations that are going to be used when the dimension is at least 2. Let us take a system of subsets A(x)(⊆ F n 2 ) (indexed by elements x ∈ F n 2 ) satisfying ( * ). For brevity let S = x∈F n 2 |A(x)|.
Observation 1 If 2 n−1 < |A(x)| for some x ∈ F n 2 , then by the pigeon-hole principle x + A(x) + A(x) = F n 2 . Since, for every y ∈ F n 2 we have (x + A(x)) ∩ (y + A(x)) = ∅, so, for some a 1 , a 2 ∈ A(x) we have x + a 1 = y + a 2 , that is, y = x + a 1 + a 2 ∈ x + A(x) + A(x). Therefore, x + A(x)+A(x) = F n 2 \ {x}, so all the subsets are empty except A(x), thus S = |A(x)| ≤ 2 n . Hence, in this case the statement holds.
From now on, let us assume that |A(x)| ≤ 2 n−1 for every x.

|A(x)| ∈ {3, 4}, let u and v be two different nonzero elements of A(x), that is,
, so we may replace A(x) by the 2-dimensional linear subspace A (x). This way ( * ) is still satisfied, and either S does not change or it increases by 1. Now we consider the cases n = 2, 3, 4 one by one.
Case 2: n = 2. Now, we continue with the case when the dimension is 2. If none of the subsets is empty, then all of them can have size at most 1, thus S ≤ 4. Otherwise, by Observation 1 we can assume that every nonempty subset has size at most 2, thus S ≤ 6, since there must be an empty set.
Case 3: n = 3. If the dimension is 3, then let e 1 , e 2 , e 3 be a basis for F 3 2 . According to Observations 1-3 we can assume that all subsets have size at most 4 and every nonempty subset is a subspace (of dimension at most 2).
Let k denote the number of 2-subspaces and l the number of empty sets. If k = 0, then S ≤ 2 · 8 = 16, and we are done. Note that in fact S < 16, since either all subsets have size at most 1 or at least one of them is empty.
So we can assume that k > 0. If A(x) = u, v a 2-subspace, then A(x + u), A(x + v), A(x +u +v) are all empty, that is, we can assign an "empty triple" {x +u, x +v, x +u +v} to each 2-subspace. To different 2-subspaces we assign different triples, as the sum of the elements in the triple is x. That is, k ≤ l 3 . We have S ≤ 4k + 2(8 − k − l) = 16 + 2k − 2l ≤ 16 + 2 l 3 − 2l ≤ 16, if l ≤ 4, equality holds if and only if l = 4. If 5 ≤ l, then S ≤ 3 · 4 = 12. Therefore, S ≤ 16 is shown and the maximum occurs when k = l = 4.
We continue with the 4-dimensional case. Case 4: n = 4. We will show that if the system of subsets {A(x) ⊆ F 4 2 | x ∈ F 4 2 } satisfies ( * ), then x∈F 4 2 |A(x)| ≤ 42. At first it is going to be shown that "in most of the cases" it can be assumed that all the nonempty A(x) subsets are linear subspaces, then we will prove the statement for the special case when the non-empty A(x) subsets are all linear subspaces and finally we will also cover the remaining cases.
By Observations 1-3 we can assume that all subsets have size at most 8 and every nonempty subset of size at most 4 is a subspace (of dimension at most 2).

and let
contains all the elements of the subspace f 1 , f 2 , f 3 , possibly with the exception of f 1 + f 2 + f 3 .
We claim that if there exists some 0 To see this, we only need to show that f 1 + f 2 + f 3 ∈ A(x)+A(x). However, either g = f i + f j (with some distinct i, j ∈ {1, 2, 3}) and f 1 + f 2 + f 3 = g + f k (where {i, j, k} = {1, 2, 3}) or g = f 1 + f 2 + f 3 and f 1 + f 2 + f 3 = g + 0 is a good representation. Therefore, in this case we can replace A(x) by f 1 , f 2 , f 3 . It remains to check the case when any four vectors in A(x) \ {0} are linearly independent.
Step 1. Assuming that A(x) is not a subspace, and any four vectors in A(x) \ {0} are linearly independent we prove S < 42 under the additional assumption that at most two subsets have size 8.
Without loss of generality it can be assumed that {0, 4 is a basis. The 3-subspaces spanned by three out of these basis vectors cover F 4 2 with the exception of a larger set A (x). So, it suffices to check the case when A(x) = {0, f 1 , f 2 , f 3 , f 4 }. The system of subsets {A(y) | y ∈ F 4 2 } can be replaced by a "translate" of itself: (not depending on y). So by taking c = x we may suppose that Then |0 + A(0)+A(0)| = 10, so at least 10 subsets are empty. The size of A(0) is 5 and the size of the other five (possibly) nonempty subsets is at most 8. If at least two out of these five subsets have size at most 5, then S ≤ 5 + 5 + 5 + 3 · 8 = 39 < 42. If this does not hold, then at least four of them are of size 8. We will cover this case later: indeed, it is going to be shown that if at least three subsets are of size 8, then S < 42.

Subcase 3 (h = 2) Let A(u) and A(v) be the two 3-subspaces. Then U = u + A(u)+ A(u)
, that is, at least 10 subsets are empty. Then S ≤ 2 · 8 + 4 · 4 = 32. Subcase 4 (h ≥ 3) Finally, let us assume that A(u), A(v), A(w) are 3-subspaces. Note that in this case it can happen that some of the nonempty subsets are not subspaces (these sets have size 5 and contain 5 affine independent vectors). According to Subcase 3, at least 10 subsets are empty. If at least 11 subsets are empty, then S ≤ 5 · 8 = 40, and we are done. So it can be assumed that exactly 10 subsets are empty.
Since there are only 10 empty subsets, from the argument of Subcase 3 it follows that these are exactly the 10 subsets A(x) which are assigned to the 10 elements x ∈ (U ∪ V ) \ {u, v}. However, U , V , U ∩ V are all affine subspaces, so the sum of the vectors in U adds up to 0 and the same holds for V and U ∩ V . Thus the sum of the vectors in U ∪ V is also 0. Hence, the sum of all vectors to which the empty set is assigned is u + v. However, we can repeat this argument with U and W and get that the sum is also equal to u + w, which is a contradiction. We are done.
Proof of Theorem 3. 19 We are going to use the implications of the previous proof.
When n = 2, one of the sets must be empty and all other sets must have size 2 in order to get 6 elements. If, say, A(x 0 ) = ∅, then for any x = x 0 the set A(x) must contain two elements whose difference is x. Two such configurations always can be mapped to each other in the required way.
When n = 3, then we need four empty sets and four 2-subspaces to get the total size of 16. Assume that A( are affine independent. Otherwise they form an affin 2-subspace, however, taking some 4 (and x as the fourth element) which is impossible. Therefore, x 1 , x 2 , x 3 , x 4 are affine independent, and by some affine linear transformation ϕ these can be mapped to 0, e 1 , e 2 , e 3 , for simplicity. Now, we can assume that 0 is contained in every nonempty A(x) (by suitable translations). Then it follows that A(e i + e j ) = e i , e j , for 1 ≤ i < j ≤ 3 and A(e 1 + e 2 + e 3 ) = e 1 + e 2 , e 2 + e 3 .
Finally, let n = 4. Note that S = 42 can hold only in Subcase 1 when k = 10, l = 5. From the proof it follows that S = 42 is possible only if there are exactly five empty sets, ten 2-subspaces and one 1-subspace. Moreover, if u 1 , u 2 , u 3 , u 4 , u 5 are the vectors to which the empty set is assigned, then the 3-term sums made out of these 5 vectors have to be all distinct. Clearly, by applying a suitable affine linear transformation ϕ we can assume that u 1 = 0 and u 2 , u 3 , u 4 are linearly independent. If u 5 ∈ u 2 , u 3 , u 4 , then all the 10 triple sums lie in a 3-subspace, so they can not be all distinct. Thus u 2 , u 3 , u 4 , u 5 are linearly independent. Therefore, by renaming u 1 , . . . , u 5 (if necessary), let A(0) = A(e 1 ) = A(e 2 ) = A(e 3 ) = A(e 4 ) = ∅, where e 1 , e 2 , e 3 , e 4 is a basis. The set A(e 1 + e 2 + e 3 + e 4 ) can not be a 2-subspace, since all vectors in it must have Hamming-weight at least 3 to satisfy e 1 + e 2 + e 3 + e 4 + A(e 1 + e 2 + e 3 + e 4 )+A(e 1 + e 2 + e 3 + e 4 ) ⊆ {0, e 1 , e 2 , e 3 , e 4 }. So it is the unique 1-subspace, for instance A(e 1 + e 2 + e 3 + e 4 ) = e 1 + e 2 + e 3 + e 4 is an appropriate choice, but e i + e j + e k is also fine with any 3-subset {i, j, k} of {1, 2, 3, 4}. By permuting 0, e 1 , e 2 , e 3 , e 4 with a suitable affine linear transformation we might assume that A(e 1 + e 2 + e 3 + e 4 ) = e 1 + e 2 + e 3 + e 4 .
The remaining 10 sets need to be 2-subspaces. For A(e i +e j ) the unique appropriate choice is A(e i +e j ) = e i , e j , with this choice e i +e j + A(e i +e j )+A(e i +e j ) = {0, e i , e j } holds. For A(e i + e j + e k ) the unique appropriate choice is A(e i + e j + e k ) = e i + e j , e i + e k = {0, e i +e j , e j +e k , e k +e i }, with this choice e i +e j +e k + A(e i +e j +e k )+A(e i +e j +e k ) = {e i , e j , e k } is satisfied.

Proof of r 3 (Z 5 4 ) = 124
We will show that if the system of subsets {A(x) ⊆ F 5 2 | x ∈ F 5 2 } satisfies ( * ), then S:= x∈F 5 2 |A(x)| ≤ 124. Again, by Observations 1-3 we can assume that all subsets have size at most 16 and every nonempty subset of size at most 4 is a subspace (of dimension at most 2). Now, let us assume that 8 < |A(x)| ≤ 16. The set A(x) must contain at least 4 linearly independent vectors. (Note that by Observation 2 we have 0 ∈ A(x).) Step 1. First, let us assume that a set A(x) with size 8 < |A(x)| ≤ 16 spans a 4-dimensional subspace. Our aim is to show it can be assumed that A(x) itself is a 4-subspace. Let Now, let us assume that Let us call the 2-term sums f i + f j (with i = j) pairs and the 3-term sums f i + f j + f k (with i, j, k distinct) triples. The pair f i + f j can be identified with the set of indices {i, j}, let us call this subset {i, j} ⊆ {1, 2, 3, 4} also a pair, and similarly the 3-element subset {i, j, k} will be called a triple corresponding to the vector f i + f j + f k . As the size of A(x) is at least 9, the set A(x) must contain at least (9 − 4 − 1 =)4 elements among the six pairs and four triples. Now, we will prove that (at least) one of following cases holds: contains a pair and a triple such that their intersection has size 1: for instance: contains a triple and all the three pairs contained in it: for instance: For the sake of contradiction let us assume that none of (i-iv) holds. Since we need at least four more vectors, at least one triple is contained in A(x), by symmetry we shall assume that f 1 + f 2 + f 3 ∈ A(x). Note that the pairs f 1 + f 4 , f 2 + f 4 , f 3 + f 4 are not in A(x), since (ii) does not hold. Therefore, there must be (at least) one more triple in A(x), otherwise (iv) would hold. We may assume that f 1 + f 2 + f 4 ∈ A(x). Now, it follows that the pairs f 1 + f 3 , f 2 + f 3 are not in A(x). However, A(x) must contain at least one pair, this pair can only be f 1 + f 2 (since the other five pairs are already excluded). The two remaining triples ( f 1 + f 3 + f 4 and f 2 + f 3 + f 4 ) intersect the pair f 1 + f 2 in a single element, so they are not contained in A(x) which contradicts that A(x) contains at least 4 elements from the 4 triples and 6 pairs.
Finally, we show that the equality A(x) + A(x) = f 1 , f 2 , f 3 , f 4 holds in all of the four cases (i)-(iv).
In case (i) we have and each triple contains either {1, 2} or {3, 4}, thus they can be expressed like In case (ii) we have In case (iii) all the triples can be written like In case (iv) all the triples can be written like Thus in all cases we get is a set of size at least 9 (and at most 16) such that A(x) is not a 4-subspace, then we can assume that dim A(x) = 5.
Step 2. We show that it can be assumed that there is no subset for which 8 < |A(x)| ≤ 16 and dim A(x) = 5. Our aim is to show that A(x) can be replaced by a 4-subspace. Together with Step 1 this implies that we can assume that all sets having size larger than 8 are 4subspaces. Moreover, we show that there can be at most one such subset.
Our aim is to show that either there is a 4-subspace A (x) such that A (x) ⊆ A(x) + A(x) or the total size S of the sets is at most 124.
Let us assume that 0, where f 1 , . . . , f 5 is a basis. Then all singletons f i and pairs f i + f j lie in A(x)+A(x). If a 4-term sum, like  6 vectors w 1 , . . . , w 6 from A(x) in such a way that they span a 4-dimensional affine subspace and their sum is 0, then A(x) can be replaced by a 4-subspace, since translating A(x) by w 6 and taking f 1 = w 1 +w 6 , f 2 = w 2 +w 6 , . . . , f 4 = w 4 + w 6 gives w 5 + w 6 = f 1 + f 2 + f 3 + f 4 , so this case can be handled in the same way as the previous case.
Thus the remaining elements of A(x) are all pairs and triples. We claim that the following cases can be excluded with the help of Observation 4: (i) there are two disjoint pairs, e.g.
there are two triples intersecting each other in a single element, e.g.
there is a pair and a triple intersecting each other in a single element, e.g.
Finally, let us assume that (i-iii) do not hold. From (i) it follows that the pairs either form a star or a triangle. If they form a triangle, let us assume that it is . Furthermore, (iii) implies that none of the other triples is in A(x). Hence, we will refer to this as case (a). From now on, we assume that the pairs in A(x) form a star.
If this star contains 4 vectors, e.g.
can not contain any triples because of (iii). (Case (b).) If this star contains 3 vectors, e.g.
can not contain any triples because of (iii). (Case (c).) If this star contains 2 vectors, e.g. f 1 + f 2 , f 1 + f 3 . At least one triple must lie in A(x) and (iii) implies that this triple is If only one pair is in A(x), e.g. f 1 + f 2 ∈ A(x). There are at least two more vectors (thus triples) in A(x). If one of them is f 3 + f 4 + f 5 , then the other triple intersects the pair {1, 2} or the triple {3, 4, 5} in one element, contradicting (ii) or (iii). Thus, by (iii) these two triples must contain {1, 2}, which gives case (e).
If there are no pairs, then there are at least three triples. Any two of them have an intersection of size 2, giving case (f) or case (g).
We summarize this: Note that the size of A(x) is 10 in case (b) and 9 in the remaining cases (a) and (c-g). Also, the size of A(x)+A(x) is 21 in cases (b), (c), (e), (f) and 22 in cases (a), (d), (g).
Let us assume that there is at least one subset A(x) having size at least 9 and not being a 4-subspace. Then at least 21 subsets out of the 32 sets A(y) are empty, so at most 11 subsets are non-empty. Let k denote the number of 4-subspaces among the subsets A(x). Then S = |A(y)| ≤ 16k + 10(11 − k) = 110 + 6k. If k ≤ 2, then this is at most 122. So let us assume that there are at least three 4-subspaces, namely, A(y), A(z), A(u). Therefore, it can be assumed that all subsets having at least 9 elements are 4-subspaces, moreover there are at most 2 such subsets. If there are 2 such subsets A(x) and A(y), then |A(x)∪ A(y)| = |A(x)|+|A(y)|−|A(x)∩ A(y)| ≥ 16+16−8 = 24, so at least 24−2 = 22 subsets are empty and S ≤ 2 · 16 + 8 · 8 = 96. Hence, it can be assumed that there is at most one 4-subspace.
Step 3. Now we show that if |A(x)| ∈ [5,8], then it can be assumed that A(x) is either a 3-subspace or a set of 5 or 6 affine independent points.
Let us assume that 4 < |A(x)| ≤ 8. If A(x) has dimension 3, then A(x) can be replaced with this 3-subspace. If dim A(x) = 4, then it can be assumed that 0, If at least one more element is in A(x), then A(x) + A(x) contains a 3-subspace and we can replace A(x) by this 3-subspace, otherwise A(x) = {0, f 1 , f 2 , f 3 , f 4 }, we will refer to this case as case (A).
If dim A(x) = 5, then it can be assumed that 0, . If at least one more element with Hamming-weight at most 4 is in we will refer to this case as case (B).
Hence, it can be assumed that if there is a subset A(x) (with size in [5,8]) which is not a subspace, then it contains 5 or 6 affine independent points: Note that the size of A(x) in these cases is either 5 or 6.
Step 4. We show that it can be assumed that all subsets have size at most 8. Note that we have already seen (in Step 2) that there can be at most one 4-subspace, so let us assume that there exists a (unique) 4-subspace A(y). Then |A(y)+A(y)| = 15, so there are at least 15 empty subsets. All the other subsets are 3-subspaces or have size at most 6. If there is no 3-subspace, then S ≤ 16+16·6 = 112, and we are done. Let A(x) be a 3-subspace and K = y + A(y), L = x + A(x). As |K ∩ L| ≤ 4, we have |K ∪ L| ≥ 16 + 8 − 4 = 20, so there are at least 20 − 2 = 18 empty subsets, thus at most 14 non-empty ones implying S ≤ 16 + 13 · 8 = 120, and we are done. Therefore, none of the subsets can be a 4-subspace, and consequently all the subsets have size at most 8.
Step 5. We show that it can be assumed that all nonempty subsets are subspaces of dimension at most 3 or a set of 5 or 6 affine independent points. Furthermore, the number of empty sets among the A(x) subsets is at most 16 and there exists a subset of size at least 5.
If 0 < |A(x)| ≤ 4, then by Observations 1-3 it can be assumed that A(x) is a subspace. Now, we can assume that all the subsets have size at most 8 and all those non-empty subsets that are not subspaces are of type (A) or (B).
If there are at least 17 empty subsets, then S ≤ 8 · 15 = 120, so it can be assumed that at most 16 subsets are empty.
If there is no subset with size larger than 2, then S ≤ 64. If there is no subset with size larger than 4, then there must be a subset with size 4 and there are at most 29 non-empty sets, so S ≤ 29 · 4 = 116. So there is a subset of size at least five, this can be either of type (A) or (B) or a 3-subspace. Now our aim is to show that we can assume that there is no subset of type (A) neither of type (B).
Hence, there exists some y / ∈ T such that A(y) = ∅, so the number of the empty subsets is at least 16. If the number of 3-subspaces is at most 14, then S ≤ 14 · 8 + 2 · 6 = 124, and we are done. So we can suppose that the number of 3-subspaces is at least 15 and one subset has size 6. The set A(e 1 + e 2 + e 3 + e 4 + e 5 ) is not a 3-subspace, since any affine 3-subspace containing e 1 + e 2 + e 3 + e 4 + e 5 contains at least 2 more elements that are not in T . Hence A(e 1 + e 2 + e 3 + e 4 + e 5 ) is the 16th empty subset. Now, we claim that A(e 1 + e 2 + e 3 + e 4 ) is not a 3-subspace. This holds, since any affine 3-subspace containing e 1 + e 2 + e 3 + e 4 has at least one more element outside of T ∪ {e 1 + e 2 + e 3 + e 4 + e 5 }.
Therefore, there is no subset of type (B).
If A(z + e 5 ) is a 3-subspace, then K z = z + e 5 + A(z + e 5 ) is an affine 3-subspace containing z + e 5 . The 1-codimensional affine subspace R = {x : xe 5 = 1} contains either all 8 elements of K z or 4 elements of K z . In the first case we get 7 new empty subsets, so the total number of empty subsets is at least 17 and we are done: S ≤ 15 · 8 = 120. So for every 3-subspace K z exactly 4 elements of K z lie in R. The sum of these 4 vectors is 0, so the sum of the three vectors in (K z ∩ R) \ {z + e 5 } is z + e 5 . Hence, for every 3-subspace K z we get an "empty triple" of vectors from R, therefore, By (3) and (4) we obtain that l(l − 1)(l − 2)/2 ≥ 5l + 8, which yields l ≥ 6. Then (3) implies that k ≥ 13, which is a contradiction, since 6 + 13 > 16 = |R|. Hence, it can be assumed that the total size of the sets

A(123), A(124), A(134), A(234), A(1234)
is at least 33, on the other hand, it is clearly at most 40. It follows that none of them is empty and at least three of them are 3-subspaces, so we can assume that A(123) is a 3-subspace. So e 1 + e 2 + e 3 + A(123) intersects nontrivially R, so |(e 1 + e 2 + e 3 + A(123)) ∩ R| = 4, thus at least 4 subsets (among subsets A(x) with x ∈ R) are empty: l ≥ 4. Note that that the sum of the four corresponding vectors is 0. Also, note that in this case (similarly to (3) in the previous case) we shall assume that 3k ≥ 5l.
Now (5) yields that at least 7 such subsets are 3-subspaces: k ≥ 7. Then (4) implies that the number of empty ones is at least 5. Again, by (5) we get k ≥ 9. If l = 5, then we have 5 3 = 10 triples, but there is a 4-term zero-sum, so 4 triples can not be "empty triples", thus there is a 6th empty subset: l ≥ 6, and by (5)  If v ∈ {e 1 +e 2 +e 3 , e 1 +e 2 +e 4 , e 1 +e 3 +e 4 , e 2 +e 3 +e 4 , e 1 +e 2 +e 3 +e 4 }, then v + A(v) intersects R in 4 vectors whose sum is 0. It can be checked that this set of 4 vectors can not be the same for all the 5 possible v-s. (Otherwise F 5 2 \ R would contain at least 15 vectors to which the empty set is assigned, however, there are only 10 such vectors.) So there must be at least two such 4-element sets. Their intersection has size at least 2, since we have only 6 vectors in R to which the empty set is assigned, and also at most 2, since otherwise they would be the same. Let A(z 1 + e 5 ), . . . , A(z 6 + e 5 ) be the empty ones, and let us assume that the two 4-zero-sum-sets are {z 1 , . . . , z 4 } and {z 3 , . . . , z 6 }. Then z 1 + z 2 = z 3 + z 4 = z 5 + z 6 . 20 triples can be chosen out of these 6 vectors, but just 8 of them can be "empty triples", contradiction.
Therefore, we can assume that there is no subset of type (A), that is, all the nonempty subsets are subspaces of dimension at most 3. According to Step 5 there must be at least one 3-subspace among the subsets, as Steps 6-7 imply that all the sets of size at least 5 are 3-subspaces.
Step 8. We show that the number of empty subsets is at least 13. Let 1 ≤ k be the number of 3-subspaces and l the number of empty subsets. Let us colour the elements of F 5 2 : x is coloured red if A(x) = ∅ and x is coloured blue if A(x) is a 3-subspace. (If A(x) is a subspace of dimension at most 2, then x is not coloured.) Now, since each triple appears in at most two 3-subspaces, we obtain that implying that l ≥ 13. Therefore, k ≥ l ≥ 13, as we claimed.
Step 9. We show that if A(x), A(y), A(z) are 3-subspaces (with distinct x, y, z), then A(x) ∩ A(y) ∩ A(z) is not an affine 2-subspace. Now, for the sake of contradiction, assume that there are three 3-subspaces, A(x), A(y), A(z) whose intersection is an affine 2-subspace L. Without loss of generality we can assume that L is a linear (2-) Note that F 5 2 can be partitioned into 8 translates of L. Every affine 3-subspace contains the same number of vectors from those L-translates that has a nonempty intersection with it. That is, given a 2-subspace L, we can distinguish three types of affine 3-subspaces, we are going to say that a 3-subspace is of In M = L ∪ (L + x) ∪ (L + y) ∪ (L + z) there are 13 red elements, namely, all the vectors except x, y, z. If t / ∈ M is blue, thenÃ(t) is a 3-subspace of type-1, type-2 or type-4 which contains t and 7 seven red vectors.
If at least two L-translates do not contain any red vector, then the elements of these translates can not be blue, so k ≤ 11, contradiction. Hence, there is at most one L-translate without any red vector. In particular, this means that l ≥ 16, since there are 13 red vectors in M and at least 3 red vectors outside of M.
Thus k = l = 16. Let us assume that the red vectors outside of M are v 1 , v 2 , v 3 , these vectors must be in different L-translates. Let L = {u 1 , u 2 , u 3 , u 4 } be the unique L-translate not containing any red vector. If v 1 + v 2 + v 3 ∈ L , then at most one of the A(u i ) sets can be a 3-subspace (namely, A(v 1 + v 2 + v 3 )), contradiction. Now assume that v 1 + v 2 + v 3 / ∈ L . By symmetry we can assume that v 1 + v 2 + v 3 / ∈ L + x also holds. But then the union of thẽ A(u i ) = u i , v 1 , v 2 , v 3 a f f sets (that are all affine 3-subspaces of type-1) cover L + x and the (unique) u i for which x ∈Ã(u i ) can not be blue (since x is not red). Hence, no three-wise intersection of 3-subspaces can be a 2-subspace.
Step 10. Now we know that 13 ≤ l ≤ k and no three-wise intersection of 3-subspaces is a 2-subspace. We finish the proof of the upper bound 124 by verifying the statement in these cases.
Let N be the number of those pairs of 3-subspaces whose intersection is a 2-subspace. Then since each of the k 3-subspaces contain 35 empty triples. Hence, for l < 16 we have N > 0, that is, two of the 3-subspaces assigned to blue vectors intersect each other in a 2-subspace.
In the following subcases we always take two such subsets first. Subcase 1. If l = 13, then we can assume that L is a linear 2-subspace andÃ(x) = L ∪ (L + x),Ã(y) = L ∪ (L + y) are 3-subspaces corresponding to blue vectors x and y. At least 2 translates of L does not contain any red vector, and in these translates there can not be any blue vectors, either. So the number of blue vectors is at most 32 − 13 − 8 = 11, contradiction. Subcase 2. If l = 14, then again let L be a linear 2-subspace andÃ(x) = L ∪ (L + x),Ã(y) = L ∪ (L + y) be 3-subspaces corresponding to blue vectors x and y. Note that in L ∪ (L + x) ∪ (L + y) there are 10 red vectors. We have 4 more red vectors, say, v 1 , v 2 , v 3 , v 4 , which must lie in different L-translates. (Otherwise there would be two L-translates without any red vector, which would imply that the 8 vectors in these translates are not coloured, contradicting that that the number of non-coloured vectors is at most 4.) Note that all the 3-subspaces assigned to some blue vector different from x, y are of type-1 or type-2. To get a 3-subspace of type-2 we need to take 2-2 red vectors from L, L + x, L + y. Moreover, these pairs must determine parallel vectors in these three L-translates (that is, in each pair the sum of the two vectors is the same), so there are at most 6 such subspaces. A type-1 3-subspace must correspond to a (blue) vector from the last L-translate, so there are at most 4 such subspaces. Hence k ≤ 4 + 6 + 2 = 12, contradiction. Subcase 3. Let us assume that l = 15. Again, we can assume that for some linear 2subspace L the sets A(x) = L ∪ (L + x), A(y) = L ∪ (L + y) are two 3-subspaces. Let L 4 , . . . , L 8 be the remaining five L-translates. They contain altogether 5 red vectors. If at least two of them do not contain any red vector, then in these two L-translates there aren't any blue vectors either, so the number of blue vectors is at most 9, contradiction. So without the loss of generality it can be assumed that either (i) L 4 contains two red vectors and L 5 , L 6 , L 7 contain one-one red vector: v i in L i (5 ≤ i ≤ 7) or (ii) L 4 , . . . , L 8 contain one-one red vector: v i in L i (4 ≤ i ≤ 8).
In case (i) let α, β be the two directions that are different from the direction determined by the two red vectors of L 4 . That is, α and β are those two nonzero elements of L that are different from the sum of the two red vectors in L 4 . Let us consider the following 6 vectors in L 5 , L 6 , L 7 : v i + α, v i + β (for 5 ≤ i ≤ 7). If such a vector is blue, then the corresponding 3-subspace is of type-2, moreover, L 1 , L 2 , L 3 contain one-one red pair of this 3-subspace, and in each pair the sum is the same, either α or β. There are only 4 such triples (of pairs of vectors) meaning that at least two of the vectors v i + α, v i + β (5 ≤ i ≤ 7) are not blue. To get 15 blue vectors all vectors in L 8 must be blue (as there are at most 2 non-coloured vectors). Note that the corresponding 3-subspaces must be of type-1. If v 5 + v 6 + v 7 ∈ L 8 , then there can be at most one blue element in L 8 (namely v 5 + v 6 + v 7 ). If v 5 + v 6 + v 7 / ∈ L 8 , then by symmetry we can also assume that v 5 + v 6 + v 7 / ∈ L 2 . If t ∈ L 8 is blue, then the corresponding 3-subspace isÃ(t) = v 5 , v 6 , v 7 , t a f f , but these four 3-subspaces cover L 2 , which contradicts that L 2 contains only 3 red vectors.
In case (ii) there are two 3-subspaces of type-4. To get a 3-subspace of type-2, we have to choose one-one red pair from L 1 , L 2 , L 3 in such a way that these pairs determine parallel directions. This can be done in 6 ways, and every affine 3-subspace is determined by 6 points of it, so there are at most six 3-subspaces of type-2. To get a 3-subspace of type-1 we have to choose a red vector from all but one of the L-translates. First assume that no four-element subset of {v 4 , . . . , v 8 } is a 2-subspace. Then the (at least) four red vectors chosen to be in this 3-subspace from {v 4 , . . . , v 8 } determine uniquely a 3-subspace, so the number of 3-subspaces of type-1 is at most 5, thus k ≤ 2 + 6 + 5 = 13, a contradiction. Now assume that a 4-element subset, say, {v 4 , v 5 , v 6 , v 7 } forms a 2-subspace. Each 3-subspace of type-1 contains at least 3 elements of {v 4 , v 5 , v 6 , v 7 }, hence all of them contain all these four vectors. Then the blue vector is in L 8 \ {v 8 }, so there are at most 3 such subspaces, thus, k ≤ 2 + 6 + 3 = 11, a contradiction. Subcase 4. Finally, let us assume that l = k = 16, that is, all vectors are either red or blue. First we show that there are two 3-subspaces whose intersection is a 2-subspace. For the sake of contradiction, assume the contrary. Let S 1 , S 2 , S 3 , S 4 be four 3-subspaces assigned to blue vectors. If every pairwise intersection has size less than 4 (that is, the intersection is either empty or has size 2), then so S 1 ∪ S 2 ∪ S 3 ∪ S 4 contains at least 20 − 4 = 16 red vectors. Since there are only 16 red vectors, we must have equality in (7), so each pairwise intersection has size 2 and each tripleintersection has size 0. Clearly, these hold for any four 3-subspaces assigned to blue vectors. Pick such a 3-subspace, for instance, S 1 . Then the other fifteen 3-subspaces have to intersect S 1 in pairwise disjoint pairs, which is impossible. Therefore, there are two 3-subspaces whose intersection is a 2-subspace. Hence, we can assume that this 2-subspace is a linear 2-subspace L and the sets A(x) = L ∪ (L + x), A(y) = L ∪ (L + y) are two 3-subspaces corresponding to blue vectors x and y. Let L 4 , . . . , L 8 be the remaining five L-translates. These contain 6 more red vectors. As there can be at most one L-translate without any red vector, we can assume that the number of red vectors among them is i) 3-1-1-1-0 or ii) 2-2-1-1-0 or iii) 2-1-1-1-1.
In case (i) let v 5 , v 6 , v 7 be the red vectors in L 5 , L 6 , L 7 . If v 5 + v 6 + v 7 ∈ L 8 , then in L 8 there is at most one blue vector (namely, v 5 + v 6 + v 7 ), contradiction. Assume that v 5 + v 6 + v 7 / ∈ L 8 . We can assume that v 5 + v 6 + v 7 / ∈ L 2 . If t ∈ L 8 is blue, theñ A(t) = t, v 5 , v 6 , v 7 a f f , but these cover L 2 , which contradicts that L 2 contains a blue element.
In case (ii) let us assume that the direction 0 = α ∈ L is different from the direction(s) determined by the pairs in L 4 , L 5 . Let v 6 ∈ L 6 , v 7 ∈ L 7 be the red vectors in these translates. Consider the blue vectors v 6 + α and v 7 + α. The 3-subspaces corresponding to them are of type-2, and both of them contain one-one pair from L 1 , L 2 , L 3 , moreover, all these pairs determine direction α. In L 2 and L 3 these pairs are uniquely determined. In L 1 there are two choices (two disjoint pairs). However, these two pairs in L 1 together with the pairs from L 2 and L 3 determine two pairs in the same L-translate, which contradicts the existence of such a pair in both L 6 and L 7 .
First assume that the L-translate containing 2 red vectors is L 4 , we can assume that these vectors are e 3 + e 4 and e 1 + e 3 + e 4 . Let t be a blue vector in one of the four L-translates L 5 , . . . , L 8 . ThenÃ(t) is either of type-2 or type-1. However, only L 1 , L 2 , L 3 , L 4 contain at least two red vectors, which means that any 3-subspace of type-2 must contain at least 6 vectors from L 1 ∪ L 2 ∪ L 3 ∪ L 4 , which is a 4-subspace, thus the remaining two vectors of the 3-subspace must also lie in this subspace, too. SoÃ(t) is of type-1. As L 5 ∪ L 6 ∪ L 7 ∪ L 8 is an affine 4-subspace, it intersectsÃ(t) in an affine 2-subspace. Therefore, if, say, t ∈ L 8 , then t and the red vectors from L 5 , L 6 , L 7 form an affine 2-subspace, that is, t is the sum of these three red vectors. But then in L 8 the only blue vector is t, contradiction.
Hence, L 4 contains one red vector. By symmetry, we can assume that L 5 contains 2 red vectors and these are e 5 and e 1 + e 5 . Let the red vector in L i be l i + t i for i ∈ {4, 6, 7, 8}.
Let i ∈ {6, 7, 8}. We claim thatÃ(l i + t i + e 2 ) andÃ(l i + t i + e 1 + e 2 ) must be of type-1. Otherwise,Ã(l i + t i + e 2 ) orÃ(l i + t i + e 1 + e 2 ) would contain at least two vectors from L 5 ∪ L 6 ∪ L 7 ∪ L 8 , so it would have to contain two more red vectors from one of the L-translates L 5 , L 6 , L 7 , L 8 , these could only be e 5 and e 5 + e 1 from L 5 . But then the blue vector l i + t i + e 1 would also lie in the 3-subspace (to get parallel pairs from the different translates), a contradiction. Hence,Ã(l i + t i + e 2 ) andÃ(l i + t i + e 1 + e 2 ) are of type-1.
Hence, N ∈ {91, 92} and there is at most one pair of distinct elements x, y ∈ H such that xϕ(y) = yϕ(x) = 0. By dropping out one of the two elements of this pair from H (if such a pair exists at all) we obtain a 13-element subset H ⊆ H such that xϕ(y) + yϕ(x) = 1 for every x, y ∈ H , x = y. Again, let u(x) = (1, x, ϕ(x)), v(x) = (1, ϕ(x), x) ∈ F 9 2 for every x ∈ H . Then u(x)v(y) = δ xy , thus {u(x), v(x)} x∈H is a biorthogonal system, implying that |H | ≤ 9, which is a contradiction.