Blocking sets, minimal codes and trifferent codes

We prove new upper bounds on the smallest size of affine blocking sets, that is, sets of points in a finite affine space that intersect every affine subspace of a fixed codimension. We show an equivalence between affine blocking sets with respect to codimension-$2$ subspaces that are generated by taking a union of lines through the origin, and strong blocking sets in the corresponding projective space, which in turn are equivalent to minimal codes. Using this equivalence, we improve the current best upper bounds on the smallest size of a strong blocking set in finite projective spaces over fields of size at least $3$. Furthermore, using coding theoretic techniques, we improve the current best lower bounds on strong blocking set. Our main motivation for these new bounds is their application to trifferent codes, which are sets of ternary codes of length $n$ with the property that for any three distinct codewords there is a coordinate where they all have distinct values. Over the finite field $\mathbb{F}_3$, we prove that minimal codes are equivalent to linear trifferent codes. Using this equivalence, we show that any linear trifferent code of length $n$ has size at most $3^{n/4.55}$, improving the recent upper bound of Pohoata and Zakharov. Moreover, we show the existence of linear trifferent codes of length $n$ and size at least $\frac{1}{3}\left( 9/5 \right)^{n/4}$, thus (asymptotically) matching the best lower bound on trifferent codes. We also give explicit constructions of affine blocking sets with respect to codimension-$2$ subspaces that are a constant factor bigger than the best known lower bound. By restricting to~$\mathbb{F}_3$, we obtain linear trifferent codes of size at least $3^{23n/312}$, improving the current best explicit construction that has size $3^{n/112}$.


Introduction
A classic problem in finite geometry is to study sets of points that block every subspace of a specific dimension.This problem was first introduced in 1956 by Richardson [47], who called such sets in finite projective spaces blocking coalitions.We follow the now standard terminology of blocking sets [15] and study the extremal problem of determining their minimum possible size.In combinatorial terminology, finding the smallest size of a blocking set is equivalent to determining the vertex cover number of the hypergraph that has points as its vertices and subspaces of the given dimension as its edges (see [30] for a survey on covers of hypergraphs).In this paper, our main focus is on blocking sets in finite affine spaces and strong blocking sets in finite projective spaces.
For, 0 ≤ s ≤ k an s-blocking set in F k q is a set of points that contains at least one point from every affine subspace of dimension k − s.Let b q (k, s) denote the smallest possible size of an s-blocking set in F k q .Jamison [37], and independently Brouwer and Schrijver [17], proved that b q (k, 1) ≥ (q − 1)k + 1, using algebraic methods.This is a foundational result for polynomial methods in combinatorics, and it is often shown as a corollary of the well-known combinatorial nullstellensatz [6,11], or the Alon-Füredi theorem [8,13].Note that the lower bound of Jamison/Brouwer-Schrijver is easily seen to be tight by taking all points on the k axes of F k q .Using a geometric argument (see for example [11,Section 3]), the lower bound on b q (k, 1) implies the following, b q (k, s) ≥ (q s − 1)(k − s + 1) + 1. (1) Unlike the s = 1 case, there is no s > 1 for which the bound in ( 1) is known to be tight (for infinitely many values of q, k).In fact, it is a major open problem to determine tight lower bounds on b q (k, s), for any s > 1.Some special cases of this problem have been studied extensively under different names.A subset B ⊆ F k q is s-blocking if and only if the set F k q \ B does not contain a (k − s)-dimensional affine subspace.Hence, it follows from the density Hales-Jewett theorem [31] that for fixed q, d, and k → ∞, b q (k, k − d) = q k − o(q k ).In the special case d = 1 and q = 3, 1-blocking sets are the complements of affine caps, and thus determining b 3 (k, k − 1) is equivalent to the famous cap set problem.The upper bound on affine caps proved in the work of Ellenberg and Gijswijt [25], which also uses the polynomial method, implies that b 3 (k, k − 1) > 3 k − 2.756 k .Therefore, the lower bound of b 3 (k, k − 1) ≥ 3 k − 3 k−1 − 1 from (1) is far from the truth.More generally, for q = 2, 3 we have b q (k, k − d) ≥ q k − o(c k ) for a constant c < q depending on q and d.For q = 2, this is implicit in [16] and for q = 3 this follows from the multidimensional cap set theorem [29] (see [32] for a short proof for q = 2, 3).The exact asymptotics b 2 (k, k − 2) = 2 k − Θ(2 k/2 ) follows from [50].
As far as upper bounds on b q (k, s) are concerned, the general upper bound on vertex cover numbers in terms of fractional vertex cover numbers [42] implies that b q (k, s) ≤ q s 1 + ln k s q , which can be upper bounded by q s (s(k−s) ln q+3) using the inequality k s q ≤ e 2 q s(k−s) (see Lemma 2.3 for more precise estimates).
In this paper, we first prove the following bound which, for fixed q and s, improves on (2) for k large enough.
Theorem 1.1.Let s, k be integers such that 2 ≤ s ≤ k and let q be a prime power.If q = 2, then b q (k, s) ≤ s(k − s) + s + 2 log q q s q s −1 + 1.
The bound for q ≥ 3 that we prove is in fact valid for q = 2 as well, but it is worse than the other bound, which is why we have separated the two cases.
We then focus on a particular notion of projective blocking sets and show that it is deeply connected to affine blocking sets.A strong t-blocking set is a set of points in a projective space that intersects ever codimension-t subspace in a set that spans the subspace.For t = 1, they are simply known as strong blocking sets [24,36].Recently, these objects have been shown to be equivalent to minimal codes from coding theory [4].Minimal codewords in a linear code were first studied in 1980's for decoding purposes and then for their connection to cryptography (see [19] and the references therein).This ultimately led to the study of minimal codes: linear codes where every codeword is minimal.Over the binary field, minimal codes are also equivalent to linear intersecting codes [20,22], which are codes with the property that the supports of any two codewords have non-empty intersection.
The newfound equivalence between minimal codes and strong blocking sets has immensely increased the interest in proving bounds on the smallest size of a strong blocking sets and finding explicit constructions [7,2,3,12,36].We prove the following new equivalence between strong blocking sets and certain affine 2-blocking sets, and use it to improve the best lower and upper bounds (for q ≥ 3) on the smallest size of a strong blocking set.Let PG(k − 1, q) denote the (k − 1)-dimensional projective space obtained from the vector space F k q .The points of PG(k − 1, q) correspond to lines passing through the origin in F k q (see Section 2 for further details).Therefore, for every set L of points in PG(k − 1, q), we can construct the set B = ∪ ℓ∈L ℓ of points in F k q .This allows us to translate the properties of L in the projective space to properties of the set B in the affine space.Lemma 1.2.Let L be a set of points in PG(k − 1, q).Then L is a strong (s − 1)-blocking set if and only if the set B = ∪ ℓ∈L ℓ ⊆ F k q is an affine s-blocking set.Let b * q (k, t) denote the minimum size of a strong t-blocking set in PG(k − 1, q).From this equivalence, and the upper bound on b q (k, 2) given by Theorem 1.1, we derive the following upper bound on b * q (k, 1), which improves the previous best upper bound (see [36,Theorem 1.5]) of for all q ≥ 3 and k sufficiently large. .
Using a mix of coding theoretic and geometric arguments, we then prove the following new lower bound on the size of a strong blocking set.
Theorem 1.4.For any prime power q, there is a constant c q > 1 such that every strong blocking set in PG(k − 1, q) has size at least (c q − o( 1))(q + 1)(k − 1), where o(1) only depends on k.
The constant c q can be taken to be the unique solution x ≥ 1 to the equation , where M q is the function appearing in the MRRW bound for linear codes (see Theorem 2.10 below).
We do not have a closed formula for c q , but for any q it can be computed efficiently up to an arbitrary order of precision using a computer.Some estimates on c q have been obtained in [48].For every q ≥ 3, our result improves the previous best lower bound of (q + 1)(k − 1) [4].For q = 2, our result matches the current best lower bound, which can be deduced from [38].

Linear trifferent codes
Our study of affine 2-blocking sets and strong blocking sets is mainly motivated by a new connection to the trifference problem, which we establish in this paper.A perfect q-hash code of length n is a subset C of {0, 1, . . ., q − 1} n such that for any q distinct elements in C, there is a coordinate where they have pairwise distinct values.Understanding the largest possible size of a perfect q-hash code is a natural extremal problem that has gained much attention since the 1980s because of its connections to various topics in cryptography, information theory, and computer science [34,40,53,54].We will focus on the q = 3 case where these codes are also known as trifferent codes, and the problem of determining their largest possible size is called the trifference problem.Let T (n) denote the largest size of a trifferent code of length n.The exact value of T (n) is only known for n up to 10, where the last six values were obtained very recently via computer searches [28,41].Asymptotically, the upper bound obtained by Körner [39] in 1973 is still the best known upper bound, despite considerable effort (see for example [23] where it is shown that a direct application of the slice rank method will not improve the bound.)Similarly, the current best lower bound was proved by Körner and Marton [40] in 1988, who used a "probabilistic lifting" of the optimal trifferent code of length 4. A natural restriction of the trifference problem is to study linear trifferent codes, that is, trifferent codes C in F n 3 which are also vector subspaces.This restriction is motivated by the fact that the best known explicit constructions of trifferent codes are linear [53].Moreover, the probabilistic construction of Körner and Marton [40] uses an optimal linear trifferent code in F 4  3 .Let T L (n) denote the largest size of a linear trifferent code of length n.Pohoata and Zakharov [46] have recently proven the following upper bound on T L (n), which shows a big separation from the known upper bounds on T (n): The ǫ in their result is a small positive number, not determined explicitly.We prove an equivalence between linear trifferent codes and affine 2-blocking sets in F k 3 that are a union of lines through the origin.By Lemma 1.2, this also implies an equivalence between strong blocking sets over F 3 and linear trifferent codes.In fact, we show that a linear code C is trifferent if and only if it is minimal.By using our new lower bounds on strong blocking sets, we deduce the following improvement to (5) and prove a lower bound on T L (n) by using Theorem 1.3.
Theorem 1.5.For n large enough, the largest size of linear trifferent code of lenght n has the following bounds: In [53] it was shown that T L (n) ≥ 3 n/112 , via an explicit construction, whereas our bound is roughly 3 n/7.48 .Note that our lower bound on T L (n) is only a factor of 3 away from the best lower bound T (n) ≥ (9/5) n/4 given in (4).Moreover, the lower bound on T (n) was obtained by constructing nonlinear trifferent codes [40], whereas we have constructed linear trifferent codes. 1 Even a tiny further improvement will break the current best lower bounds for the trifference problem, which have not been improved since 1988.Therefore, our results give a new motivation for studying linear trifferent codes and strong blocking sets.
Our lower bounds on trifferent codes so far, which follow from our upper bounds on affine 2blocking sets, are based on probabilistic constructions.It is of great interest to also obtain explicit constructions (see for example [53] and the references therein).In this direction, we first provide an explicit construction of affine 2-blocking sets whose sizes are just a constant factor away from the best lower bound (given in (1)).
Theorem 1.6.There is an absolute constant c, such that for every prime power q, and k large enough, we can explicitly construct c(q + 1)k lines through the origin in F k q whose union blocks every codimension-2 affine subspace, thus implying b q (k, 2) ≤ c(q 2 − 1)k + 1.
Our construction is based on a recent breakthrough on explicit constructions of strong blocking sets [7].By restricting to q = 3, and using a different construction of strong blocking sets [12], we obtain a new explicit construction of linear trifferent codes, which improves the current best explicit construction of length-n linear trifferent codes from dimension n/112 (obtained in [53]) to dimension n/48.By using a linear trifferent code of dimension 6 in F 24  3 and standard concatenation with algebraic geometric codes, we prove the following.
Theorem 1.7.There exists an infinite sequence of lengths n for which there is an explicit construction of linear trifferent codes of dimension ⌈23n/312⌉.

Outline of the paper
In Section 2, we describe some basic theory of finite geometry and error-correcting codes.We also recall previous results on strong blocking sets and prove Lemma 1.2.In Section 3, we prove Theorem 1.1.
We use this bound for the case s = 2, along with Lemma 1.2, to prove Theorem 1.3.In Section 4, we prove Theorem 1.4 using the MRRW bound from coding theory and lower bounds on affine blocking sets.In Section 5, we prove Theorem 1.6 using the new explicit construction of strong blocking sets.Finally, in Section 6, we focus on linear trifferent codes and prove Theorems 1.5 and 1.7.The diagram in Figure 1.1 summarises all the equivalences between blocking sets, minimal codes and trifferent codes, which form the backbone of our work.
L is a strong (s − 1)blocking set in PG(k − 1, q) for s=2, see [4] Minimal linear code of

Preliminaries
Throughout this paper we will use q to denote a prime power.A projective space of dimension k − 1 over the finite field F q is defined as where u ∼ v if u = λv for some nonzero λ ∈ F q .The equivalence class that a nonzero vector v belongs to is denote by [v].The 1-dimensional, 2-dimensional, . . ., (k − 1)-dimensional vector subspaces of F k q correspond to the points, lines, . . ., hyperplanes of PG(k − 1, q).In fact, we will often identify the points of PG(k − 1, q) with the 1-dimensional vector subspaces of F k q , that is, lines of the affine space F k q that pass through the origin.Note that while the dimension of a projective subspace is one less than the dimension of its corresponding vector subspace, the codimensions remain the same.For a subset S of points in PG(k − 1, q), the subspace formed by taking the linear span of S is denoted by S .We refer to [18] for further details on projective spaces.Definition 2.1 (q-binomial coefficient).For integers 0 ≤ s ≤ k, the q-binomial coefficient is defined as where we define the empty product to be 1.For other values of s and k, we define k s q to be zero.
The number k s q is also known as the Gaussian coefficient.We will often use the fact that k s q = k k−s q .A straightforward double counting argument shows the following.
(a) The number of (s − 1)-dimensional subspaces of PG(k − 1, q) is equal to k s q .
(b) The number of s-dimensional affine subspaces of F k q is equal to q k−s k s q .
We will use the following estimates on Gaussian coefficients.
Lemma 2.3.Let q be a prime power and let 1 ≤ s ≤ k be integers.
(b) If s ≥ 3 and k ≥ s + 3, we have: Note that the upper bound in (a) is decreasing in q and is less than 2 for q ≥ 3.
Proof.We first prove part (a).Since q n −1 q m −1 ≥ q n q m for any positive integers n ≥ m, we have For the other inequality, we use where we used that ∞ i=2 1 q−1 , the inequality follows for all prime powers q.For part (b), it can be easily verified that where in the inequality, we used that k − 3 ≥ s.
Lemma 2.4.Let H be an affine hyperplane in F k q that does not pass through the origin.The number of i-dimensional affine subspaces disjoint from H and passing through the origin is equal to k−1 i q .Proof.Any such subspace must be contained in the unique hyperplane parallel to H that passes through the origin, and by Lemma 2.2 the number of i-dimensional vector subspaces of a (k − 1)dimensional vector space is equal to k−1 i q .
Definition 2.5.Let H be a (k − s)-dimensional affine subspace of F k q , not passing through origin.We denote by n q (k, s) the number of s-dimensional affine subspaces through the origin that are disjoint from H.
Note that n q (k, s) is independent of the particular choice of H since the general linear group acts transitively on (k − s)-dimensional not passing through the origin.A formula is given by the following lemma.
Lemma 2.6.We have Proof.Let H be a (k − s)-dimensional affine subspace of F k q not passing through origin and let H ′ be the (k − s + 1)-dimensional subspace spanned by H and the origin.For 1 ≤ i ≤ s, let S i denote the set of s-dimensional subspaces through the origin, disjoint from H, that intersect H ′ in an idimensional subspace.As S 1 ∪ • • • ∪ S s is a partition of the set of subspaces that we need to count, we have n q (k, s) = s i=1 |S i |.Therefore, it suffices to show that The number of ways of picking an i-dimensional subspace in H ′ that is disjoint from H is equal to k−s i q by Lemma 2.4.Once we have picked such a subspace T , the number of ways of picking an s-dimensional subspace S such that S ∩ H ′ = T amounts to picking s − i remaining basis vectors outside H ′ , which gives us exactly choices for S.

Error-correcting codes
We now recall some definitions and results from coding theory (see [35] for a standard reference).
Definition 2.7.The support of a vector v ∈ F n q is the set The Hamming weight induces a metric on F n q , given by d(u, v) := wt(u − v), which is known as the Hamming distance.
Definition 2.8.An [n, k, d] q code C is a k-dimensional subspace of F n q , with minimum distance The elements of C are called codewords.A generator matrix for C is a matrix The rate of C is equal to k/n and the relative Hamming distance of C is equal to d/n.Definition 2.9.Let {n i } i≥1 be an increasing sequence of lengths and suppose that there exist sequences {k i } i≥1 and {d i } i≥1 such that for all i ≥ 1 there exists an and the relative distance of C is defined as assuming that these limits exist.
A family C for which R(C) > 0 and δ(C) > 0, is known as an asymptotically good code, and various explicit constructions of such codes are known [35,52].However, the problem of understanding the optimal trade-off between the rate and relative distance of a family of codes is in general not well understood.As a result, the following open question lies at the heart of the subject: What is the largest rate that can be achieved for a family of codes of a given relative distance δ?
For our purposes, we will focus on upper bounds on the rate.To continue, let us define the following two functions.The q-ary entropy is defined by: A relevant property of M q is that it provides an asymptotic upper bound on the rate of any code with a given relative distance.
Theorem 2.10 (MRRW bound for q-ary codes [1,44]).For any fixed alphabet size q, and relative distance δ > 0, any family of q-ary codes with relative distance δ and rate R satisfies One may verify that M q is a continuous and strictly decreasing function in the domain [0, 1 − 1/q], satisfying M q (0) = 1 and M q (1 − 1/q) = 0, which can be used to show that the constant c q appearing in Theorem 1.4 is well defined.Note that c q is also equal to the maximum x for which M q ((q − 1)/(x(q + 1)) ≤ 1/(x(q + 1)) and x ≥ 1 (see Appendix A for further details).

Strong blocking sets
The code C is a minimal (linear) code if all its nonzero codewords are minimal.
So a linear code is minimal if for all u, v ∈ C we have: supp(u) supp(v) =⇒ u = 0. Definition 2.12.A set S of points in a projective space is called a strong blocking set if for every hyperplane H, we have S ∩ H = H.These special kinds of (projective) blocking sets have been studied under the names of generator sets [26] and cutting blocking sets [4], but we adopt the terminology of strong blocking sets used in the earliest work [24].Definition 2.13.An [n, k, d] q code C is nondegenerate if there is no coordinate where every codeword has 0 entry.
The following is a standard equivalence between nondegenerate codes and certain sets of points in the projective space (see for example [52, Theorem 1.1.6]).
where the maximum is taken over all hyperplanes H. Conversely for d > 0, any set of n points in PG(k − 1, q) whose maximum intersection with a hyperplane has size n − d gives rise to a nondegenrate [n, k, d] q code by taking a generator matrix whose columns are the coordinates of these n points.
In particular, Lemma 2.14 implies that if a set of n points in PG(k − 1, q) meets every hyperplane in at most m points, then there exists an [n, k, n − m] q code.Under this correspondence, minimality of an [n, k, d] q code has been shown to be equivalent to the corresponding point set giving rise to a strong blocking set in PG(k − 1, q).Theorem 2.15 (see [4], [51]).Let C be a nondegenerate [n, k, d] q code and let G = (g 1 | . . .| g n ) ∈ F k×n q be any of its generator matrices.The following are equivalent: Remark 2.16.Note that the Hamming distance d plays no role in the definition of minimal codes.However, it can be shown that if an [n, k, d] q code is minimal, then d ≥ (q − 1)(k − 1) + 1 (see [4,Theorem 2.8]).This implies that any minimal [n, k, d] q code where k is a linear function of n is asymptotically good, which is another motivation for studying these codes.
The main problem is to find small strong blocking sets in PG(k − 1, q), which is then equivalent to finding short minimal codes of dimension k.The following is the best lower bound on the size of a strong blocking set, for all q ≥ 3, and it was proved using the polynomial method.
Remark 2.18.This is in general not tight.For q = 2, a better bound follows from [38] and Lemma 1.2 and for k = 3, a better lower bound follows from [10] as then a strong blocking set equivalent to a 2-fold blocking set.
The following is the best upper bound on the smallest size of a strong blocking set.
Theorem 2.19 (see [36]).The the smallest size of a strong blocking set in PG(k − 1, q) is at most otherwise.
We now prove the new characterization of strong blocking sets based on affine blocking sets, outlined in Lemma 1.2.First, we define a generalization of strong blocking sets, which also appears in [27,Definition 2] under the name of generator sets.Definition 2.21.A set of points in PG(k − 1, q) is called a strong t-blocking set if it intersects every codimension-t subspace in a set of points that spans the subspace.
Proof of Lemma 1.2.First assume that L is a strong (s − 1)-blocking set in PG(k − 1, q).Let V ⊆ F k q be a codimension-s vector subspace and let u ∈ Now assume that B blocks all codimension-s affine subspaces.Say L is not a strong (s−1)-blocking set.Then there is some codimension-(s − 1) vector subspace V such that L ∩ V is contained inside a codimension-s vector subspace V ′ of V .Then the set B does not block any affine codimension-s subspace contained in V \ V ′ that is parallel to V ′ .Remark 2.22.By combining Lemma 1.2 and (1), we get a new proof of the lower bound on strong blocking sets given in Theorem 2.17 (see [36] for another proof that uses (1)).

Upper bounds on blocking sets
In this section, we give a probabilistic construction of s-blockings sets in F k q , thus obtaining an upper bound on b q (k, s).For q = 2, we simply pick random points and show that if the number of points is large enough, then the probability that they form an s-blocking set is positive.Our novel idea for q ≥ 3 is to randomly pick s-dimensional linear subspaces instead.We start with a preliminary lemma that estimates n q (k, s) as defined in Definition 2.5 Lemma 3.1.Let q be a prime power.Let 2 ≤ s ≤ k be integers.We have the following estimate on n q (k, s).n q (k, s) ≤ q 3 − q + 1 q 4 k s q .
Proof.We will split the proof into three cases: Case s = 2.We use Lemma 2.6 and write out the given expression for s = 2.We obtain n q (k, 2) The inequality in the second line is an equality if k − 2 ≥ 2.
Case s ≥ 3 and k ≥ s + 3. We will use the q-Vandermonde identity (see [49], solution of exercise 1.100): which is the form we will use.Using again Lemma 2.6, we obtain The first summand can be upper bounded by where we used Lemma 2.3(b) in the second inequality.
The second summand can be upper bounded using the q-Vandermonde identity (6): The result now follows from combining the two bounds and the fact that (q 2 −1)(q−1) s s q as required.If k = s + 1, then by Lemma 2.6 we have n q (k, s) = q s−1 and We leave it to the reader to verify that indeed q s−1 (q − 1)q 4 ≤ q s+4 − q s+2 + q s+1 − q 3 + q − 1.
Combining the two inequalities, we obtain k s q q 3 −q+1 q 4 ≥ n q (k, s).
Proof of Theorem 1.1.First let q = 2. Let P 1 , . . ., P m be points in F k 2 chosen uniformly at random independently from each other.Let H be a codimension-s affine subspace.The probability that H does not contain any P 1 , . . ., P m is equal to (1 − 2 −s ) m .Since there are in total 2 s k k−s 2 = 2 s k s 2 choices for H, the probability that B = {P 1 , . . ., P m } is not an s-blocking set is at most By Lemma 2.3, this probability is upper bounded by It follows that the probability is less than 1 for m ≥ s(k−s)+s+2 ⌉ points blocking all codimension-s affine subspaces in F k 2 .We now consider the case q ≥ 3. Let log q q 4 q 3 −q+1 be an integer and let π 1 , . . ., π m be s-dimensional spaces through the origin chosen uniformly at random, and independently from each other.
For any codim-s affine subspace H that does not pass through the origin, the probability that π 1 , . . ., π m are disjoint from H is at most ( q 3 −q+1 q 4 ) m by Lemma 3.1.The number of such H equals (q s − 1) k s q .Hence, the expected number of H that are disjoint from π 1 , . . ., π m is at most Here we used k s q ≤ 2q s(k−s) , see Lemma 2.3(a).So there is an instance where B = π 1 ∪ • • • ∪ π m is a s-blocking set.By taking m as small as possible, we have m ≤ (s(k − s) + s + 2)/ log q ( q 4 q 3 −q+1 ), so we obtain as required.
Remark 3.2.For a fixed s, picking random points instead of picking random s-dimensional subspaces through the origin gives the upper bound of ∼ (q s ln q)s(k − s), which is worse for every q ≥ 3, since ln q > 1 for q > e.It can also be shown that picking i-dimensional subspaces, for any i < s, gives us worse bounds for q ≥ 3.
Proof of Theorem 1.3.Let s = 2 and q ≥ 3.In the proof of Theorem 1.1 above, we have a random collection of planes through the origin whose union blocks every codimension-2 affine subspace in F k q .Each plane consists of q + 1 lines through the origin, which implies that we have a set of at most (q + 1)2k/ log q ( q 4 q 3 −q+1 ) lines through the origin in F k q whose union blocks every codimension-2 affine subspace.By Lemma 1.2, this collection of lines corresponds to a strong blocking set in PG(k − 1, q) of the same size.
Remark 3.3.Our upper bound improves the previous best upper bound on strong blocking sets (see Theorem 2.19) for all q ≥ 3. Independent of our work, Alfarano, Borello and Neri have obtained the same upper bound in [3] using different techniques.We have also been informed by the authors of [36] that a more careful analysis of their argument implies our upper bound.Remark 3.4.Our upper bound on affine s-blocking sets also implies that for 2 ≤ s ≤ k, the smallest size of a strong (s − 1)-blocking set in PG(k − 1, q), for q ≥ 3, is at most .

Lower bounds on strong blocking sets
In this section we prove Theorem 1.4.Let q be a prime power.
Lemma 4.1.Let k be a positive integer.Then there is a a strong blocking set of size n := b * q (k, 1) and let C be the nondegenerate code with generator matrix G = (g 1 | . . .| g n ).By Theorem 2.15, C is a minimal code, which has minimum distance d ≥ (q − 1)(k − 1) + 1 by Remark 2.16.
Proof of Theorem 1.4.Recall that c q is the unique solution x ≥ 1 to M q q−1 x(q+1) = 1 x(q+1) .In Appendix A we show that c q is well-defined and that c q > 1.Let c be a constant such that 1 < c < c q .We will show that b * q (k, 1) ≥ c(q + 1)(k − 1) for k large enough.Set R = 1 c(q+1) and δ = q−1 c(q+1) .Note that δ < 1 − 1 q .Since c < c q and M q is strictly decreasing on [0, 1 − 1/q], we have M q (δ) < R. By the MRRW bound for q-ary codes, Theorem 2.10, there is an integer k 0 such that for all k ≥ k 0 there is no linear code C ⊆ F n q with rate at least R and relative minimum distance at least δ.
This concludes the proof.
Remark 4.2.From Lemma 1.2 and (1), it follows that every strong (s−1)-blocking set in PG(k −1, q) has size at least q s −1 q−1 (k − s + 1).Using an inductive argument, we can also improve this lower bound by a constant factor, for every fixed q, s and large k.

Explicit constructions
In Section 3 we constructed s-blocking sets by picking random s-dimensional subspaces through the origin in F k q .However, for explicit constructions, we will pick 1-dimensional subspaces as then we can use the connection to strong (s − 1)-blocking sets in PG(k − 1, q) outlined in Lemma 1.2.If the strong (s − 1)-blocking set has size m, then the corresponding affine s-blocking set has size (q − 1)m + 1.For example, if q > s(k − s), there exists an explicit construction of strong (s − 1)-blocking sets of size at most (s(k − s) + 1)(q s − 1)/(q − 1) in PG(k − 1, q) [27,33], which we can use to give an explicit construction of affine s-blocking sets of size at most (q s − 1)s(k − s) + q s .While this is a good explicit construction, it requires the field to be large with respect to k and s.We will focus on fixed q, s, and large k.
The main focus of explicit constructions has been on the special case of strong 1-blocking sets, as these objects are equivalent to minimal codes [4].An easy construction, known as the "tetrahedron", is as follows.Take the union of all lines joining pairs of k points in general position to get a strong blocking set of size k 2 (q−1)+k in PG(k−1, q), and thus an affine 2-blocking set of size k 2 (q−1) 2 +k(q−1)+1 in F k q .Note that the dependency on the dimension k is quadratic in this construction.For q = 2, minimal codes are equivalent to intersecting codes, and thus we already have explicit constructions of strong blocking sets in F k 2 of size linear in k [22].Recently, an explicit construction of a strong blocking set of size linear in the dimension, for any fixed q ≥ 3, was obtained by Bartoli and Borello [12,Corollary 3.3].The same construction also appears in an earlier work of Cohen, Mesnager and Randriam [21], and the main idea is to concatenate algebraic geometric codes with the simplex code.They proved that for every prime power q, there exists an infinite sequence of k's such that there is an explicit construction of a strong blocking set in the projective space PG(k − 1, q) of size ∼ q 4 k/4.The problem of giving an explicit construction which also has a linear dependence on q, has recently been solved in [7].
Theorem 5.1 (Alon, Bishnoi, Das, Neri 2023).There is an absolute constant c such that for every prime power q and k large enough, there is an explicit construction of strong blocking sets in PG(k−1, q) of size at most c(q + 1)k.
Proof of Theorem 1.6.Let S be an explicitly constructed strong blocking set of size at most c(q + 1)k in PG(k − 1, q).By Lemma 1.2, the union of lines in F k q corresponding to the points of S gives us an explicit construction of an affine-2 blocking set in F k q of size (q − 1)c(q + 1)k + 1 = c(q 2 − 1)k + 1.
For the sake of completeness we give a sketch of the construction in [7].
Lemma 5.2.Let M = {P 1 , . . ., P n } be a set of points in PG(k − 1, q) and let G = (M, E) be a graph on these points.If for every S ⊆ M there exists a connected component C in G − S such that S ∪ C = PG(k − 1, q), then the set For a graph G, its vertex integrity [9] is defined as where κ(G − S) denotes the size of the largest connected component of the graph obtained by deleting the set S of vertices from G. Graphs with high vertex integrity along with points in PG(k − 1, q) that have low intersection with every hyperplane give rise to the construction that we want.
Corollary 5.3.Let P = {P 1 , . . ., P n } be a set of points in PG(k − 1, q) such that every hyperplane meets P in at most n − d points and let G be a graph on P with ι(G) ≥ n − d + 1.Then the set A set of n points in PG(k−1, q) that meets every hyperplane in at most n−d points is equivalent to a (nondegenerate) [n, k, d] q code (see Lemma 2.14).Therefore, if we pick our set P corresponding to an asymptotically good linear code and our graph G to be a bounded degree graph with ι(G) ≥ n − d + 1, then we can get a construction where for any fixed q the size of the strong blocking set is linear in qk.
Corollary 5.4.Say there exists a family of codes C with lengths {n i } i≥1 , rate R and relative distance δ, and a family of graphs G i on n i vertices with maximum degree ∆ and ι(G i ) > (1 − δ)n i .Then there exists strong blocking sets of size ∆n i /2 in PG(Rn i − 1, q), for al i ≥ 1.
It is shown in [7] that constant degree expander graphs G on n vertices have the property that ι(G) = Ω(n).The explicit constructions of these graphs [43] and asymptotically good linear codes [52] thus imply Theorem 5.1, and we refer to [7] for the best values of the constant c obtained from this construction.

Linear trifferent codes
Recall that a linear subspace C of F n 3 is called a linear trifferent code if for all distinct x, y, z ∈ C there exists a coordinate i such that {x i , y i , z i } = F 3 .The maximum size of a linear trifferent code is denoted by T L (n).
We say that an (affine) 2-blocking set S ⊆ F k 3 is symmetric if it is of the form S = { 0} ∪ B ∪ −B for some set B ⊆ F k 3 .So by Lemma 1.2, a set S ⊆ F k 3 is a symmetric 2-blocking set if and only if it is of the form S = ∪ ℓ∈L ℓ for a strong blocking set L ⊆ PG(k − 1, 3).
In [46] it was shown that a linear trifferent code of dimension k in F n 3 gives rise to a symmetric 2-blocking set in F k 3 .We prove that this relation goes both ways.

Upper bound
Let C ⊆ F n 3 be a linear trifferent code of size k = T L (n).Then by Theorem 6.1, C gives rise to a set B ⊆ F k 3 of size n such that { 0} ∪ B ∪ −B is an affine 2-blocking set.The equivalence given in Lemma 1.2 shows that we thus have a strong blocking set of size m ≤ n in PG(k − 1, 3).A computer calculation shows that c 3 > 1.1375, so by Theorem 1.4 we have n ≥ m > 4.55(k − 1) for sufficiently large k.Therefore, T L (n) < n/4.55 + 1 for sufficiently large n, thus proving the upper bound in Theorem 1.5.

Explicit construction
The explicit construction outlined in Section 5 gives us an affine 2-blocking set in F k 3 of size 8ck + 1.This gives us an explicit construction of linear trifferent codes of length n and dimension at least n 4c because the construction is from a strong blocking set, and hence a union of lines through the origin.The best constant c that we get from [7] is not good enough to improve the construction from [53], which has size dimension n/112.However, the construction in [12] does manage to improve the state of the art for q = 3.In particular, Corollary 3.3 in [12] (with q 0 = 3) implies that there is an explicit construction of strong blocking sets of size at most 48k i in PG(k − 1, q), for an infinite sequence of {k i } i≥1 (see [12,Theorem 3.2] for the exact value of k i ).Therefore, we get an explicit construction of linear trifferent codes of length n i ≤ 48k i and dimension k i .We now improve this explicit construction by computing T L (n) for some small values of n.For fixed dimension k, the minimum size of a symmetric 2-blocking set in F k 3 can be found using integer linear programming: 2b * 3 (k, 1) + 1 = min The inequalities v∈H x v ≥ 2k−1 are redundant and follow from the bound b q (k, 1) ≥ (q−1)(k−1)+1.However, adding these inequalities seems to significantly speed up computations2 .We obtained the following explicit values for small k: In particular, we have found a linear trifferent code of dimension 6 and length 24, that we now use to find our general explicit construction.
Proof of Theorem 1.7.Let C in be the [24,6]  .Such a family can be constructed using algebraic-geometric codes [52].Then by the argument in [5] we know that C out has the trifference property.Therefore, the concatenation C out • π C in is an F 3 -linear trifferent code of length n = 24N and dimension k = 6RN , and k/n = R/4 = 23/312.

Conclusion
In this paper, we established new connections between affine blocking sets, strong blocking sets, and trifferent codes.We obtained new bounds on affine blocking sets which improve the state of the art for bounds on the latter two objects as well.Moreover, using the recent explicit constructions of strong blocking sets, we gave new explicit constructions of trifferent codes, beating the current bound.Despite this progress, many interesting problems remain open.
Recall that b q (k, s) denotes the smallest size of an affine s-blocking set in F k q .While we can prove upper bounds on b q (k, s) that, for any fixed s, are only a constant factor away from the lower bound given in (1), the problem of determining the asymptotics of b q (k, s) when s varies with k is wide open.Question 7.1.What is the asymptotic growth of b q (k, s), for fixed q, s = Θ(k), and k → ∞?
While we could improve the lower bounds on strong (s − 1)-blocking sets, we are unable to improve the lower bounds on affine s-blocking sets given in (1), for fixed s and q, k large.In particular, we ask the following.Question 7.2.For every fixed prime power q, is there a constant C q > 1 such that b q (k, 2) ≥ C q q 2 k, for large enough k?
Finally, we proved a lower bound on linear trifferent codes that is asymptotically equal to the best lower bound on trifferent codes.Our lower bound is based on the new upper bound on strong blocking sets, obtained by picking a random set of planes through the origin in F k q .Any improvement in our argument would be very interesting, as it might lead to a breakthrough for the trifference problem.The data on T L (n) for small n, that we computed in Section 5, suggests that lim n→∞ log 3 (T L (n))/n = 1/5, but we are not too confident to make that conjecture.
While it is natural to extend the notion of linear perfect 3-hash codes to linear perfect q-hash codes, with q > 3, the following argument shows that these objects are trivial.Let F q be a finite field with q > 3. We show that there is no linear perfect q-hash code C ⊆ F n q of dimension ≥ 2. Suppose that C ⊆ F n q is a subspace of dimension ≥ 2, and let u, v be two linearly independent vectors.Write F q \ {0} = {ζ i : 0 ≤ i ≤ q − 2} and consider the set of vectors {u, ζu} ∪ {v, ζv, ζ 2 v, . . ., ζ q−3 v}.Say there is a coordinate i where they are all distinct.Since q > 3, u i and v i must both be nonzero.But we then have q distinct nonzero coordinates, which is impossible.So C cannot be a perfect q-hash code.
Therefore, it is more sensible to study linear codes C ⊆ F n q , with the property that for any t distinct codewords in C, there is a coordinate where they are all pairwise distinct, for some parameter t < q.Such codes have been studied in the literature under the name of linear perfect hash families, and in fact it can be shown that these codes cannot exist for t ≥ c √ q for some constant c (see [14, Section 5]).In [53], an explicit construction is given that has dimension at least a linear function of n, when t = O(q 1/4 ).It would be interesting to improve these results on perfect hash families in view of our work.
For the second inequality, we used the fact that − log q (1 − x) < 2x for x < 0.5, and for the second last inequality, we used (7), (8), and (9).

Figure 1 :
Figure 1: Equivalences between blocking sets and codes.
λu) be the codimension-(s − 1) vector subspace spanned by V ∪ {u}.Then W meets L in a spanning set.In particular, there exists an element b ∈ B such that b ∈ W \ V .Thus we can write b = v + λu for some v ∈ V and λ = 0. Then b ′ = λ −1 b is contained in B as B is closed under taking scalar multiples, and b

Theorem 6 . 1 .
Let G ∈ F k×n 3 be a matrix of rank k.Let B be the set of columns of G and let C be the row-space of G. Then C is a linear trifferent code in F n 3 if and only if { 0} ∪ B ∪ −B is a 2-blocking set in F k 3 .