On sets defining few ordinary hyperplanes

: Let P be a set of n points in real projective d -space, not all contained in a hyperplane, such that any d points span a hyperplane. An ordinary hyperplane of P is a hyperplane containing exactly d points of P . We show that if d > 4, the number of ordinary hyperplanes of P is at least (cid:0) if n is sufﬁciently large depending on d . This bound is tight, and given d , we can calculate the exact minimum number for sufﬁciently large n . This is a consequence of a structure theorem for sets with few ordinary hyperplanes: For any d > 4 and K > 0, if n > C d K 8 for some constant C d > 0 depending on d , and P spans at most K ordinary hyperplanes, then all but at most O d ( K ) points of P lie on a hyperplane, an elliptic normal curve, or a rational acnodal curve. We also ﬁnd the maximum number of ( d + 1 ) -point hyperplanes, solving a d -dimensional analogue of the orchard problem. Our proofs rely on Green and Tao’s results on ordinary lines, our earlier work on the 3-dimensional case, as well as results from classical algebraic geometry.


Introduction
An ordinary line of a set of points in the plane is a line passing through exactly two points of the set. The classical Sylvester-Gallai theorem states that every finite non-collinear point set in the plane spans at least one ordinary line. In fact, for sufficiently large n, an n-point non-collinear set in the plane spans at least n/2 ordinary lines, and this bound is tight if n is even. This was shown by Green and Tao [9] via a structure theorem characterising all finite point sets with few ordinary lines.
It is then natural to consider higher dimensional analogues. Motzkin [22] noted that there are finite non-coplanar point sets in 3-space that span no plane containing exactly three points of the set. He proposed considering instead hyperplanes Π in d-space such that all but one point contained in Π is contained in a (d − 2)-dimensional flat of Π. The existence of such hyperplanes was shown by Motzkin [22] for 3-space and by Hansen [10] in higher dimensions. Purdy and Smith [25] considered instead finite non-coplanar point sets in 3-space with no three points collinear, and provided a lower bound on the number of planes containing exactly three points of the set. Referring to such a plane as an ordinary plane, Ball [1] proved a 3-dimensional analogue of Green and Tao's [9] structure theorem, and found the exact minimum number of ordinary planes spanned by sufficiently large non-coplanar point sets in real projective 3-space with no three points collinear. Using an alternative method, we [20] were able to prove a more detailed structure theorem but with a stronger condition; see Theorem 4.1 in Section 4.
Ball and Monserrat [3] made the following definition, generalising ordinary planes to higher dimensions.
Definition. An ordinary hyperplane of a set of points in real projective d-space, where every d points span a hyperplane, is a hyperplane passing through exactly d points of the set.
They [3] also proved bounds on the minimum number of ordinary hyperplanes spanned by such sets (see also [21]). Our first main result is a structure theorem for sets with few ordinary hyperplanes. The elliptic normal curves and rational acnodal curves mentioned in the theorem and their group structure will be described in Section 3. Our methods extend those in our earlier paper [20], and we detail them in Section 2.
Theorem 1.1. Let d 4, K > 0, and suppose n C max{(dK) 8 , d 3 2 d K} for some sufficiently large absolute constant C > 0. Let P be a set of n points in RP d where every d points span a hyperplane. If P spans at most K n−1 d−1 ordinary hyperplanes, then P differs in at most O(d2 d K) points from a configuration of one of the following types: (i ) A subset of a hyperplane; (ii ) A coset H ⊕ x of a subgroup H of an elliptic normal curve or the smooth points of a rational acnodal curve of degree d + 1, for some x such that (d + 1)x ∈ H.
It is easy to show that conversely, a set of n points where every d span a hyperplane and differing from (i ) or (ii ) by O(K) points, spans O(K n−1 d−1 ) ordinary hyperplanes. By [3,Theorem 2.4], if a set of n points where every d points span a hyperplane itself spans K n−1 d−1 ordinary hyperplanes, and is not contained in a hyperplane, then K = Ω(1/d). Theorem 1.2 below implies that K 1 for sufficiently large n depending on d.
For a similar structure theorem in dimension 4 but with K = o(n 1/7 ), see Ball and Jimenez [2], who show that P lies on the intersection of five quadrics. Theorem 1.1 proves [2, Conjecture 12], noting that elliptic normal curves and rational acnodal curves lie on d 2 − 1 linearly independent quadrics [6,Proposition 5.3;17,p. 365]. We also mention that Monserrat [21, Theorem 2.10] proved a structure theorem stating that almost all points of the set lie on the intersection of d − 1 hypersurfaces of degree at most 3.
Our second main result is a tight bound on the minimum number of ordinary hyperplanes, proving [3, Conjecture 3]. Note that our result holds only for sufficiently large n; see [3,14,21] for estimates when d is small or n is not much larger than d. and Ω(·) statements in this paper have implicit dependence on the dimension d.

Notation and tools
We write A △ B for the symmetric difference of the sets A and B. Let F denote the field of real or complex numbers, let F * = F \ {0}, and let FP d denote the ddimensional projective space over F. We denote the homogeneous coordinates of a point in d-dimensional projective space by a (d + 1)-dimensional vector [x 0 , x 1 , . . . , x d ]. We call a linear subspace of dimension k in FP d a k-flat; thus a point is a 0-flat, a line is a 1-flat, a plane is a 2-flat, and a hyperplane is a (d − 1)-flat. We denote by Z F ( f ) the set of F-points of the algebraic hypersurface defined by the vanishing of a homogeneous polynomial f ∈ F[x 0 , x 1 , . . . , x d ]. More generally, we consider a (closed, projective) variety to be any intersection of algebraic hypersurfaces. We say that a variety is pure-dimensional if each of its DISCRETE ANALYSIS, 2020:4, 34pp. irreducible components has the same dimension. We consider a curve of degree e in CP d to be a variety δ of pure dimension 1 such that a generic hyperplane in CP d intersects δ in e distinct points. More generally, the degree of a variety X ⊂ CP d of dimension r is deg(X) := max {|Π ∩ X| : Π is a (d − r)-flat such that Π ∩ X is finite} .
We say that a curve is non-degenerate if it is not contained in a hyperplane, and non-planar if it is not contained in a 2-flat. We call a curve real if each of its irreducible components contains infinitely many points of RP d . Whenever we consider a curve in RP d , we implicitly assume that its Zariski closure is a real curve.
We denote the Zariski closure of a set S ⊆ CP d by S. We will use the secant variety Sec C (δ ) of a curve δ , which is the Zariski closure of the set of points in CP d that lie on a line through some two points of δ .

Bézout's theorem
Bézout's theorem gives the degree of an intersection of varieties. While it is often formulated as an equality, in this paper we only need the weaker form that ignores multiplicity and gives an upper bound. The (set-theoretical) intersection X ∩Y of two varieties is just the variety defined by P X ∪ P Y , where X and Y are defined by the collections of homogeneous polynomials P X and P Y respectively.

Projections
Given p ∈ FP d , the projection from p, π p : FP d \ {p} → FP d−1 , is defined by identifying FP d−1 with any hyperplane Π of FP d not passing through p, and then letting π p (x) be the point where the line px intersects Π [11,Example 3.4]. Equivalently, π p is induced by a surjective linear transformation F d+1 → F d where the kernel is spanned by the vector p.
As in our previous paper [20], we have to consider projections of curves where we do not have complete freedom in choosing a generic projection point p.
Let δ ⊂ CP d be an irreducible non-planar curve of degree e, and let p be a point in CP d . We call π p generically one-to-one on δ if there is a finite subset S of δ such that π p restricted to δ \ S is one-to-one. (This is equivalent to the birationality of π p restricted to δ \ {p} [11, p. 77].) If π p is generically one-toone, the degree of the curve π p (δ \ {p}) is e − 1 if p is a smooth point on δ , and is e if p does not lie on δ ; if π p is not generically one-to-one, then the degree of π p (δ \ {p}) is at most (e − 1)/2 if p lies on δ , and is at most e/2 if p does not lie on δ [11,Example 18.16], [18,Section 1.15].
The following three lemmas on projections are proved in [20] in the case d = 3. They all state that most projections behave well and can be considered to be quantitative versions of the trisecant lemma [15]. The proofs of Lemmas 2.3 and 2.4 are almost word-for-word the same as the proofs of the 3-dimensional cases in [20]. All three lemmas can also be proved by induction on the dimension d 3 from the 3-dimensional case. We illustrate this by proving Lemma  Proof. The case d = 3 was shown in [20], based on the work of Furukawa [8]. We next assume that d 4 and that the lemma holds in dimension d − 1. Since d > 3 and the dimension of Sec C (δ ) is at most 3 [11,Proposition 11.24], there exists a point p ∈ CP d such that all lines through p have intersection multiplicity at most 1 with δ . It follows that the projection δ ′ := π p (δ ) of δ is a non-planar curve of degree e in CP d−1 . Consider any line ℓ not through p that intersects δ in at least three distinct points p 1 , p 2 , p 3 . Then π p (ℓ) is a line in CP d−1 that intersects δ ′ in three points π p (p 1 ), π p (p 2 ), π p (p 3 ). It follows that if x ∈ δ is a point such that for all but finitely many points y ∈ δ , the line xy intersects δ in a point other than x or y, then x ′ := π p (x) is a point such that for all but finitely many points y ′ := π p (y) ∈ δ ′ , the line x ′ y ′ intersects δ ′ in a third point. That is, if π x restricted to δ is not generically one-to-one, then the projection map π x ′ in CP d−1 restricted to δ ′ is not generically one-to-one. 3 Curves of degree d + 1 In this paper, irreducible non-degenerate curves of degree d + 1 in CP d play a fundamental role. Indeed, the elliptic normal curve and rational acnodal curve mentioned in Theorem 1.1 are both such curves. In this section, we describe their properties that we need. These properties are all classical, but we did not find a reference for the group structure on singular rational curves of degree d + 1, and therefore consider this in detail. It is well-known in the plane that there is a group structure on any smooth cubic curve or the set of smooth points of a singular cubic. This group has the property that three points sum to the identity if and only if they are collinear. Over the complex numbers, the group on a smooth cubic is isomorphic to the torus (R/Z) 2 , and the group on the smooth points of a singular cubic is isomorphic to (C, +) or (C * , ·) depending on whether the singularity is a cusp or a node. Over the real numbers, the group on a smooth cubic is isomorphic to R/Z or R/Z × Z 2 depending on whether the real curve has one or two semi-algebraically connected components, and the group on the smooth points of a singular cubic is isomorphic to (R, +), (R, +) × Z 2 , or R/Z depending on whether the singularity is a cusp, a crunode, or an acnode. See for instance [9] for a more detailed description.
In higher dimensions, it turns out that an irreducible non-degenerate curve of degree d + 1 does not necessarily have a natural group structure, but if it has, the behaviour is similar to the planar case. For instance, in CP 3 , an irreducible non-degenerate quartic curve is either an elliptic quartic, with a group isomorphic to an elliptic curve such that four points on the curve are coplanar if and only if they sum to the identity, or a rational curve. There are two types, or species, of rational quartics. The rational quartic curves of the first species are intersections of two quadrics (as are elliptic quartics), they are always singular, and there is a group on the smooth points such that four points on the curve are coplanar if and only if they sum to the identity. Those of the second species lie on a unique quadric, are smooth, and there is no natural group structure analogous to the other cases. See [20] for a more detailed account. The picture is similar in higher dimensions.
Definition (Clifford [4], Klein [17]). An elliptic normal curve is an irreducible non-degenerate smooth curve of degree d + 1 in CP d isomorphic to an elliptic curve in the plane.
). An elliptic normal curve δ in CP d , d 2, has a natural group structure such that d + 1 points in δ lie on a hyperplane if and only if they sum to the identity. This group is isomorphic to (R/Z) 2 .
If the curve is real, then the group is isomorphic to R/Z or R/Z × Z 2 depending on whether the real curve has one or two semi-algebraically connected components.
A similar result holds for singular rational curves of degree d + 1. Since we need to work with such curves and a description of their group structure is not easily found in the literature, we give a detailed discussion of their properties in the remainder of this section.
A rational curve δ in FP d of degree e is a curve that can be parametrised by the projective line, where each q i is a homogeneous polynomial of degree e in the variables x and y. The following lemma is well known (see for example [27, p. 38, Theorem VIII]), and can be proved by induction from the planar case using projection.
2. An irreducible non-degenerate curve of degree d + 1 in CP d , d 2, is either an elliptic normal curve or rational.
We next describe when an irreducible non-degenerate rational curve of degree d + 1 in CP d has a natural group structure. It turns out that this happens if and only if the curve is singular.
We write ν d+1 for the rational normal curve in CP d+1 [11, Example 1.14], which we parametrise as Any irreducible non-degenerate rational curve δ of degree d + 1 in CP d is the projection of the rational normal curve, and we have where A is a (d + 2) × (d + 1) matrix of rank d + 1 (since δ is non-degenerate) with entries derived from the coefficients of the polynomials q i of degree d + 1 in the parametrisation of the curve (with suitable alternating signs). Thus δ ⊂ CP d is the image of ν d+1 under the projection map π p defined by A. In particular, the point of projection p = [p 0 , p 1 , . . . , p d+1 ] ∈ CP d+1 is the (1-dimensional) kernel of A. If we project ν d+1 from a point p ∈ ν d+1 , then we obtain a rational normal curve in CP d . However, since δ is of degree d + 1, necessarily p / ∈ ν d+1 . Conversely, it can easily be checked that for any p / ∈ ν d+1 , the projection of ν d+1 from p is a rational curve of degree d + 1 in CP d . We will use the notation δ p for this curve. We summarise the above discussion in the following proposition that will be implicitly used in the remainder of the paper.  3. An irreducible non-degenerate rational curve of degree d + 1 in CP d is projectively equivalent to δ p for some p ∈ CP d+1 \ ν d+1 .
We use the projection point p to define a binary form and a multilinear form associated to δ p . The fundamental binary form associated to δ p is the homogeneous polynomial of degree d + 1 in two variables f p (x, y) := ∑ d+1 i=0 p i d+1 i x d+1−i y i . Its polarisation is the multilinear form F p :

Consider the multilinear form
since the second factor on the right-hand side does not vanish because the points [x i , y i ] are distinct. We first note that DISCRETE ANALYSIS, 2020:4, 34pp. 8 We next replace (−1) i p i by x i y d+1−i for each i = 0, . . . , d + 1 in the last row of the determinant in (3) and obtain the Vandermonde determinant where P i is as defined in (1). It follows that the coefficient of p i in (3) is P i , and (2) follows. We next complete the argument for the case when the points [x i , y i ] are not all distinct. First suppose that a hyperplane Π intersects δ p in δ p [x i , y i ], i = 0, . . . , d. By Bertini's theorem [12, Theorem II.8.18 and Remark II.8.18.1], there is an arbitrarily close perturbation Π ′ of Π that intersects δ p in distinct points By what has already been proved, The secant variety Sec C (ν d+1 ) of the rational normal curve ν d+1 in CP d+1 is equal to the set of points that lie on a proper secant or tangent line of ν d+1 , that is, on a line with intersection multiplicity at least 2 with ν d+1 . We also define the real secant variety of ν d+1 to be the set Sec R (ν d+1 ) of points in RP d+1 that lie on a line that either intersects ν d+1 in two distinct real points or is a tangent line of ν d+1 . The tangent variety Tan F (ν d+1 ) of ν d+1 is defined to be the set of points in FP d+1 that lie on a tangent line DISCRETE ANALYSIS, 2020:4, 34pp. 9 of ν d+1 . We note that although Tan R (ν d+1 ) = Tan C (ν d+1 ) ∩ RP d+1 , we only have a proper inclusion We will need a concrete description of Sec C (ν d+1 ) and its relation to the smoothness of the curves δ p . For any p ∈ FP d+1 and k = 2, . .
we have that the quadratic form has repeated roots.
If p / ∈ Sec(ν d+1 ), then δ p is a smooth curve of degree d + 1. It follows that δ p is singular if and only if p ∈ Sec(ν d+1 ) \ ν d+1 . For the purposes of this paper, we make the following definitions.
Definition. A rational singular curve is an irreducible non-degenerate singular rational curve of degree d + 1 in CP d . In the real case, a rational cuspidal curve, rational crunodal curve, or rational acnodal curve is a rational singular curve isomorphic to a singular planar cubic with a cusp, crunode, or acnode respectively.
In particular, we have shown the case k = 2 of the following well-known result.  We next use Corollary 3.6 to show that the projection of a smooth rational curve of degree d + 1 in CP d from a generic point on the curve is again smooth when d 4. This is not true for d = 3, as there is a trisecant through each point of a quartic curve of the second species in 3-space. (The union of the trisecants form the unique quadric on which the curve lies [11,Exercise 8.13].) Lemma 3.7. Let δ p be a smooth rational curve of degree d + 1 in CP d , d 4. Then for all but at most three points q ∈ δ p , the projection π q (δ p \ {q}) is a smooth rational curve of degree d in CP d−1 .
The coefficients of this polynomial are of the form The binary cubic form c 0 x 3 +3c 1 x 2 y+c 2 xy 2 +c 3 y 3 then has the factorisation (x 0 x+y 0 y)(x 1 x+y 1 y)(x 2 x+y 2 y), hence its roots give the collinear points on δ p . Since δ p is smooth, M 3 (p) has rank at least 3 by Corollary 3.6, and so the cubic form is unique up to scalar multiples. It follows that there are at most three points q such that the projection π q (δ p \ {q}) is not smooth.
We need the following theorem on the fundamental binary form f p that is essentially due to Sylvester [30] to determine the natural group structure on rational singular curves. Reznick [26] gives an elementary proof of the generic case where p does not lie on the tangent variety. (See also Kanev [16, Lemma 3.1] and Iarrobino and Kanev [13,Section 1.3].) We provide a very elementary proof that includes the non-generic case.
Moreover, if p / ∈ ν d+1 then L 1 and L 2 are linearly independent, and if p ∈ RP d+1 then L 1 and L 2 are both real.
then L 1 and L 2 are complex conjugates, while if p ∈ Sec R (ν d+1 ) then there exist linearly independent real binary linear forms L 1 , L 2 such that f p (x, y) = L 1 (x, y) d+1 ± L 2 (x, y) d+1 , where we can always choose the lower sign when d is even, and otherwise depends on p.
be the point on ν d+1 such that the line pp * is tangent to ν d+1 (if p ∈ ν d+1 , we let p * = p). We will show that First consider the special case α 1 = 0. Then p * = [1, 0, . . . , 0] and the tangent to ν d+1 at p * is the line , then p 1 = 0, and x and p 0 x + p 1 (d + 1)y are linearly independent.
We next consider the general case α 1 = 0. Equating coefficients in (4), we see that we need to find This can be simplified to Since we are working projectively, we can fix the value of β 1 from the instance i = d + 1 of (5) to get If p d+1 = 0, we can divide (5) by (6). After setting α = α 2 /α 1 , β = β 2 /β 1 , and a i = p i /p d+1 , we then have to show that for some β ∈ F, for each i = 0, . . . , d. We next calculate in the affine chart x d+1 = 1 where the rational normal curve be- The tangency condition means that p * − p is a scalar multiple of giving (7) as required. If α = β , then λ = 0 and p = p * ∈ ν d+1 . Thus, if p / ∈ ν d+1 , then α = β , and α 2 x − α 1 y and β 2 x − β 1 y are linearly independent.
If p ∈ Sec R (ν d+1 ), then p 1 and p 2 are real, so [µ 1 , µ 2 ], [α 1 , α 2 ], [β 1 , β 2 ] ∈ RP 1 , and we obtain f p (x, y) = L d+1 We are now in a position to describe the group laws on rational singular curves. We first note the effect of a change of coordinates on the parametrisation of δ p . Let ϕ : FP 1 → FP 1 be a projective transformation. Then ν d+1 • ϕ is a reparametrisation of the rational normal curve. It is not difficult to see that there exists a projective transformation ψ : FP d+1 → FP d+1 such that ν d+1 • ϕ = ψ • ν d+1 . It follows that if we reparametrise δ p using ϕ, we obtain where ψ ′ : FP d → FP d is an appropriate projective transformation such that first transforming FP d+1 with ψ and then projecting from p is the same as projecting from ψ −1 (p) and then transforming FP d with ψ ′ . So by reparametrising δ p , we obtain δ p ′ for some other point p ′ that is in the orbit of p under the action of projective transformations that fix ν d+1 . Since up to a scalar multiple. Thus, we obtain the same reparametrisation of the fundamental binary form f p . Proposition 3.9. A rational singular curve δ p in CP d has a natural group structure on its subset of smooth points δ * p such that d + 1 points in δ * p lie on a hyperplane if and only if they sum to the identity. This group is isomorphic to (C, +) if the singularity of δ p is a cusp and isomorphic to (C * , ·) if the singularity is a node.
If the curve is real and cuspidal or acnodal, then it has a group isomorphic to (R, +) or R/Z depending on whether the singularity is a cusp or an acnode, such that d + 1 points in δ * p lie on a hyperplane if and only if they sum to the identity. If the curve is real and the singularity is a crunode, then the group is isomorphic to (R, +) × Z 2 , but d + 1 points in δ * p lie on a hyperplane if and only if they sum to (0, 0) or (0, 1), depending on p.
Proof. First suppose δ p is cuspidal and F ∈ {R, C}, so that p ∈ Tan F (ν d+1 ) \ ν d+1 . By Theorem 3.8, f p = L d 1 L 2 for some linearly independent linear forms L 1 and L 2 . By choosing ϕ appropriately, we may assume without loss of generality that L 1 (x, y) = x and L 2 (x, y) = (d + 1)y, so that f p (x, y) = (d + 1)x d y and p = [0, 1, 0, . . . , 0], with the cusp of δ p at δ p [0, 1]. It follows that the polarisation of f p is Thus we identify δ p [x, y] ∈ δ * p with y/x ∈ F, and the group is (F, +).
The group on an elliptic normal curve or a rational singular curve of degree d + 1 as described in Propositions 3.1 and 3.9 is not uniquely determined by the property that d + 1 points lie on a hyperplane if and only if they sum to some fixed element c. Indeed, for any t ∈ (δ * , ⊕), x ⊞ y := x ⊕ y ⊕ t defines another abelian group on δ * with the property that d + 1 points lie on a hyperplane if and only if they sum to c ⊕ dt. However, these two groups are isomorphic in a natural way with an isomorphism given by the translation map x → x ⊖ t. The next proposition show that we always get uniqueness up to some translation. It will be used in Section 5.
Proposition 3.10. Let (G, ⊕, 0) and (G, ⊞, 0 ′ ) be abelian groups on the same ground set, such that for some d 2 and some c, c ′ ∈ G, Proof. It is clear that the cases d 3 follow from the case d = 2, which we now show. First note that for any x, y ∈ G,

Structure theorem
We prove Theorem 1.1 in this section. The main idea is to induct on the dimension d via projection. We start with the following statement of the slightly different case d = 3, which is [20, Theorem 1.1]. Note that it contains one more type that does not occur when d 4.
Theorem 4.1. Let K > 0 and suppose n C max{K 8 , 1} for some sufficiently large absolute constant C > 0. Let P be a set of n points in RP 3 with no 3 points collinear. If P spans at most Kn 2 ordinary planes, then up to projective transformations, P differs in at most O(K) points from a configuration of one of the following types: (i ) A subset of a plane; (ii ) A subset of two disjoint conics lying on the same quadric with n 2 ± O(K) points of P on each of the two conics; (iii ) A coset of a subgroup of the smooth points of an elliptic or acnodal space quartic curve.
We first prove the following weaker lemma using results from Section 2.
Lemma 4.2. Let d 4, K > 0, and suppose n C max{d 3 2 d K, (dK) 8 } for some sufficiently large absolute constant C > 0. Let P be a set of n points in RP d where every d points span a hyperplane. If P spans at most K n−1 d−1 ordinary hyperplanes, then all but at most O(d2 d K) points of P are contained in a hyperplane or an irreducible non-degenerate curve of degree d + 1 that is either elliptic or rational and singular.
Proof. We use induction on d 4 to show that for all K > 0 and all n f (d, K), for all sets P of n points in RP d with any d points spanning a hyperplane, if P has at most K n−1 d−1 ordinary hyperplanes, then all but at most g(d, K) points of P are contained in a hyperplane or an irreducible non-degenerate curve of degree d + 1, and that if the curve is rational then it has to be singular, where for appropriate C 1 ,C 2 > 0 to be determined later and C from Theorem 4.1. We assume that this holds in RP d−1 if d 5, while Theorem 4.1 takes the place of the induction hypothesis when d = 4. Let P ′ denote the set of points p ∈ P such that there are at most d−1 d−2 K n−2 d−2 ordinary hyperplanes through p. By counting incident point-ordinary-hyperplane pairs, we obtain which gives |P ′ | > n/(d − 1) 2 . For any p ∈ P ′ , the projected set π p (P \ {p}) has n − 1 points and spans at most d−1 d−2 K n−2 d−2 ordinary (d − 2)-flats in RP d−1 , and any d − 1 points of π p (P \ {p}) span a (d − 2)-flat. To apply the induction hypothesis, we need If there exists a p ∈ P ′ such that all but at most g(d − 1, d−1 d−2 K) points of π p (P \ {p}) are contained in a (d − 2)-flat, then we are done, since g(d, K) > g(d − 1, d−1 d−2 K). Thus we may assume without loss of generality that for all p ∈ P ′ we obtain a curve γ p .
Let p and p ′ be two distinct points of P ′ . Then all but at most 2g(d − 1, d−1 d−2 K) points of P lie on the intersection δ of the two cones π −1 p (γ p ) and π −1 p ′ (γ p ′ ). Since the curves γ p and γ p ′ are 1-dimensional, the two cones are 2-dimensional. Since their vertices p and p ′ are distinct, the cones do not have a common irreducible component, so their intersection is a variety of dimension at most 1. By Bézout's theorem (Theorem 2.1), δ has total degree at most d 2 , so has to have at least one 1-dimensional irreducible component. Let δ 1 , . . . , δ k be the 1-dimensional components of δ , where 1 k d 2 . Let δ 1 be the component with the most points of P ′ amongst all the δ i , so that Choose a q ∈ P ′ ∩ δ 1 such that π q is generically one-to-one on δ 1 . By Lemma 2.2 there are at most Since . However, this follows from the definition of f (d, K). If π q does not map δ 1 \ {q} into γ q , then by Bézout's theorem (Theorem 2.1), n − 1 − g(d − 1, d−1 d−2 K) d 3 . However, this does not occur since f (d, K) > g(d − 1, d−1 d−2 K) + d 3 + 1. Thus, π q maps δ 1 \ {q} into γ q , hence δ 1 is an irreducible curve of degree d + 1 (or, when d = 4, possibly a twisted cubic containing at most n/2 + O(K) points of P).
Note that g(d, K) = O(d2 d K) since K = Ω(1/d) by [3,Theorem 2.4]. We have shown that all but O(d2 d K) points of P are contained in a hyperplane or an irreducible non-degenerate curve δ of degree d + 1. By Proposition 3.2, this curve is either elliptic or rational. It remains to show that if δ is rational, then it has to be singular. Similar to what was shown above, we can find more than 3 points p ∈ δ for which the projection π p (δ \ {p}) is a rational curve of degree d that is singular by the induction hypothesis. Lemma 3.7 now implies that δ is singular.
To get the coset structure on the curves as stated in Theorem 1.1, we use a simple generalisation of an additive combinatorial result used by Green and Tao [9,Proposition A.5]. This captures the principle that if a finite subset of a group is almost closed, then it is close to a subgroup. The case d = 3 was shown in [19].  -tuples (a 1 , a 2 , . . . , a d ) ∈ A 1 × A 2 × · · · × A d for which a 1 ⊕ a 2 ⊕ · · · ⊕ a d / ∈ A d+1 . Then there is a subgroup H of G and cosets H ⊕ x i for i = 1, . . . , d such that Proof. We use induction on d 2 to show that the symmetric differences in the conclusion of the lemma have size at most C ∏ d i=1 (1 + 1 i 2 )K for some sufficiently large absolute constant C > 0. The base case d = 2 is [9, Proposition A.5].
Fix a d 3. By the pigeonhole principle, there exists b 1 ∈ A 1 such that there are at most we can use induction to get a subgroup H of G and x 2 , . . . , x d ∈ G such that for j = 2, . . . , d we have K, we repeat the same pigeonhole argument on DISCRETE ANALYSIS, 2020:4, 34pp.
(d −1)-tuples (a 1 , . . . , a d−1 ) ∈ A 1 ×· · · A d−1 with a 1 ⊕· · ·⊕a d−1 ⊕b d / ∈ A d+1 , for some absolute constants C 1 ,C 2 > 0 depending on C, by making c sufficiently small. Now (1 + 1 d 2 )K cn/(d − 1) 2 , so by induction again, there exist a subgroup H ′ of G and elements x 1 , x ′ 2 , . . . , x ′ d−1 ∈ G such that for k = 2, . . . , d − 1 we have is non-empty, it has to be a coset of H ′ ∩ H. If H ′ = H, then |H ′ ∩ H| n/2 + O(K), a contradiction since c is sufficiently small. Therefore, H = H ′ , and To apply Lemma 4.3, we first need to know that removing K points from a set does not change the number of ordinary hyperplanes it spans by too much.
Lemma 4.4. Let P be a set of n points in RP d , d 2, where every d points span a hyperplane. Let P ′ be a subset that is obtained from P by removing at most K points. If P spans m ordinary hyperplanes, then P ′ spans at most m + 1 d K n−1 d−1 ordinary hyperplanes.
Proof. Fix a point p ∈ P. Since every d points span a hyperplane, there are at most n−1 d−1 sets of d points from P containing p that span a hyperplane through p. Thus, the number of (d + 1)-point hyperplanes through p is at most 1 d n−1 d−1 , since a set of d + 1 points that contains p has d subsets of size d that contain p. If we remove points of P one-by-one to obtain P ′ , we thus create at most 1 d K n−1 d−1 ordinary hyperplanes.
The following lemma then translates the additive combinatorial Lemma 4.3 to our geometric setting. Lemma 4.5. Let d 4, K > 0, and suppose n C(d 3 K + d 4 ) for some sufficiently large absolute constant C > 0. Let P be a set of n points in RP d where every d points span a hyperplane. Suppose P spans at most K n−1 d−1 ordinary hyperplanes, and all but at most dK points of P lie on an elliptic normal curve or a rational singular curve δ . Then P differs in at most O(dK + d 2 ) points from a coset H ⊕ x of a subgroup H of δ * , the smooth points of δ , for some x such that (d + 1)x ∈ H. In particular, δ is either an elliptic normal curve or a rational acnodal curve.
We can now prove Theorem 1.1.
Proof of Theorem 1.1. By Lemma 4.2, all but at most O(d2 d K) points of P are contained in a hyperplane or an irreducible curve δ of degree d + 1 that is either elliptic or rational and singular. In the prior case, we get Case (i ) of the theorem, so suppose we are in the latter case. We then apply Lemma 4.5 to obtain Case (ii ) of the theorem, completing the proof.

Extremal configurations
We prove Theorems 1.2 and 1.3 in this section. It will turn out that minimising the number of ordinary hyperplanes spanned by a set is equivalent to maximising the number of (d + 1)-point planes, thus we can apply Theorem 1.1 in both theorems. Then we only have two cases to consider, where most of our point set is contained either in a hyperplane or a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve.
The first case is easy, and we get the following lower bound.
Lemma 5.1. Let d 4, K 1, and let n 2dK. Let P be a set of n points in RP d where every d points span a hyperplane. If all but K points of P lie on a hyperplane, then P spans at least n−1 d−1 ordinary hyperplanes, with equality if and only if K = 1.
Proof. Let Π be a hyperplane with |P ∩ Π| = n − K. Since n − K > d, any ordinary hyperplane spanned by P must contain at least one point not in Π. Let m i be the number of hyperplanes containing exactly d − 1 points of P ∩ Π and exactly i points of P \ Π, i = 1, . . . , K. Then the number of unordered d-tuples of elements from P with exactly d − 1 elements in Π is Now consider the number of unordered d-tuples of elements from P with exactly d − 2 elements in Π, which equals K 2 n−K d−2 . One way to generate such a d-tuple is to take one of the m i hyperplanes containing i points of P \ Π and d − 1 points of P ∩ Π, choose two of the i points, and remove one of the d − 1 points. Since any d points span a hyperplane, there is no overcounting. This gives Hence the number of ordinary hyperplanes is at least We next show that for all K 2, if n 2dK then This is equivalent to Note that if n > 3K + 2d − 5 and if n (i + 2)d for each i = 1, . . . , K − 2. However, since 2dK > (i + 2)d and also 2dK > 4K + 2d − 5, the inequality (10) now follows from (11) and (12).
The second case needs more work. We first consider the number of ordinary hyperplanes spanned by a coset of a subgroup of the smooth points δ * of an elliptic normal curve or a rational acnodal curve. By Propositions 3.1 and 3.9, we can consider δ * as a group isomorphic to either R/Z or R/Z × Z 2 . Let H ⊕ x be a coset of a subgroup H of δ * of order n where (d + 1)x = ⊖c ∈ H. Since H is a subgroup of order n of R/Z or R/Z × Z 2 , we have that either H is cyclic, or Z n/2 × Z 2 when n is divisible by 4. The exact group will matter only when we make exact calculations.
Note that it follows from the group property that any d points on δ * span a hyperplane. Also, since any hyperplane intersects δ * in d + 1 points, counting multiplicity, it follows that an ordinary hyperplane of H ⊕ x intersects δ * in d points, of which exactly one of them has multiplicity 2, and the others multiplicity 1. Denote the number of ordered k-tuples (a 1 , . . . , a k ) with distinct a i ∈ H that satisfy m 1 a 1 ⊕ · · · ⊕ m k a k = c by [m 1 , . . . , m k ; c]. Then the number of ordinary hyperplanes spanned by H ⊕ x is We show that we can always find a value of c for which (13) is at most n−1 d−1 .
By the pigeonhole principle, there must then exist a c such that We next want to show that [2, Proof. We can arbitrarily choose distinct values from H for a 1 , . . . , a k−1 , which determines a k , and then we have to subtract the number of k-tuples where a k is equal to one of the other a i , i = 1, . . . , k − 1.
We next bound A and B. We apply Lemma 5.4 to each term in A, after which we obtain (d − 1)(d − 2) · · · (d − (d + 1)/2) terms of length (d − 1)/2. Then using the bound in Lemma 5.3, we obtain For B, we again use Lemma 5.3 to get Thus we obtain which finishes the proof for odd d.
If d is even, we obtain where R now is the sum of (d − 1)(d − 2) · · · (d − d/2) terms of length d/2. Among these there are ; c]).
Similar to the previous case, we obtain which finishes the proof for even d.
Computing [2, . . . , 2; c] and [3, 2, . . . , 2; c] exactly is more subtle and depends on c and the group H. We do not need this for the asymptotic Theorems 1.2 and 1.3, and will only need to do so when computing exact extremal values.
To show that a coset is indeed extremal, we first consider the effect of adding a single point. The case where the point is on the curve is done in Lemma 5.6, while Lemma 5.7 covers the case where the point is off the curve. We then obtain a more general lower bound in Lemma 5.8.
Lemma 5.6. Let δ * be an elliptic normal curve or the smooth points of a rational acnodal curve in RP d , d 2. Suppose H ⊕ x is a coset of a finite subgroup H of δ * of order n, with (d + 1)x ∈ H. Let p ∈ δ * \ (H ⊕ x). Then there are at least n d−1 hyperplanes through p that meet H ⊕ x in exactly d − 1 points.
The following Lemma generalises [9,Lemma 7.7], which states that if δ * is an elliptic curve or the smooth points of an acnodal cubic curve in the plane, H ⊕ x is a coset of a finite subgroup of order n > 10 4 , and if p / ∈ δ * , then there are at least n/1000 lines through p that pass through exactly one element of H ⊕ x. A naive generalisation to dimension 3 would state that if δ * is an elliptic or acnodal space quartic curve with a finite subgroup H of sufficiently large order n, and x ∈ δ * and p / ∈ δ * , then there are Ω(n 2 ) planes through p and exactly two elements of H ⊕ x. This statement is false, even if we assume that 4x ∈ H (the analogous assumption 3x ∈ H is not made in [9]), as can be seen from the following example.
Let δ be an elliptic quartic curve obtained from the intersection of a circular cylinder in R 3 with a sphere which has centre c on the axis ℓ of the cylinder. Then δ is symmetric in the plane through c perpendicular to ℓ, and we can find a finite subgroup H of any even order n such that the line through any element of H parallel to ℓ intersects H in two points. If we now choose p to be the point at infinity on ℓ, then we obtain that any plane spanned by p and two points of H not collinear with p, intersects H in two more points. Note that the projection π p maps δ to a conic, so is not generically one-to-one. The number of such p is bounded by the trisecant lemma (Lemma 2.3). However, as the next lemma shows, a generalisation of [9, Lemma 7.7] holds except that in dimension 3 we have to exclude such points p.
Lemma 5.7. Let δ be an elliptic normal curve or a rational acnodal curve in RP d , d 2, and let δ * be its set of smooth points. Let H be a finite subgroup of δ * of order n, where n Cd 4 for some sufficiently large absolute constant C > 0. Let x ∈ δ * satisfy (d + 1)x ∈ H. Let p ∈ RP d \ δ * . If d = 3, assume furthermore that δ is not contained in a quadric cone with vertex p. Then there are at least c n d−1 hyperplanes through p that meet the coset H ⊕ x in exactly d − 1 points, for some sufficiently small absolute constant c > 0.
Proof. We prove by induction on d that under the given hypotheses there are at least such hyperplanes for some sufficiently small absolute constant c ′ > 0. The base case d = 2 is given by [9,Lemma 7.7]. Next assume that d 3, and that the statement holds for d − 1. Fix a q ∈ H ⊕ x, and consider the projection π q . Since q is a smooth point of δ , π q (δ \ {q}) is a non-degenerate curve of degree d in RP d−1 (otherwise its degree would be at most d/2, but a non-degenerate curve has degree at least d − 1). The projection π q can be naturally extended to have a value at q, by setting π q (q) to be the point where the tangent line of δ at q intersects the hyperplane onto which δ is projected. (This point is the single point in π q (δ \ {q}) \ π q (δ \ {q}).) The curve π q (δ ) has degree d and is either elliptic or rational and acnodal, hence it has a group operation ⊞ such that d points are on a hyperplane in RP d−1 if and only if they sum to the identity.
We would like to apply the induction hypothesis, but we can only do that if π q (p) / ∈ π q (δ * ), and when d = 4, if π q (p) is not the vertex of a quadric cone containing π q (δ ). We next show that there are only O(d 2 ) exceptional points q to which we cannot apply induction.
Note that π q (p) ∈ π q (δ * ) if and only if the line pq intersects δ with multiplicity 2, which means we have to bound the number of these lines through p. To this end, we consider the projection of δ from the point p. Suppose that π p does not project δ generically one-to-one to a degree d + 1 curve in RP d−1 . Then π p (δ ) has degree at most (d + 1)/2. However, its degree is at least d − 1 because it is non-degenerate. It follows that d = 3, and that π p (δ ) has degree 2 and is irreducible, so δ is contained in a quadric cone with vertex p, which we ruled out by assumption.
Therefore, π p projects δ generically one-to-one onto the curve π p (δ ), which has degree d + 1 and has at most d 2 double points (this follows from the Plücker formulas after projecting to the plane [31, Chapter III, Theorem 4.4]). We thus have that an arbitrary point p ∈ RP d \ δ lies on at most O(d 2 ) secants or tangents of δ (or lines through two points of δ * if p is the acnode of δ ).
If d = 4, we also have to avoid q such that π q (p) is the vertex of a cone on which π q (δ ) lies. Such q have the property that if we first project δ from q and then π q (δ ) from π q (p), then the composition of these two projections is not generically one-to-one. Another way to do these to successive projections is to first project δ from p and then π p (δ ) from π p (q). Thus, we have that π p (q) is a point on the quintic π p (δ ) in RP 3 such that the projection of π p (δ ) from π p (q) onto RP 2 is not generically one-to-one. However, there are only O(1) such points by Lemma 2.3. Thus there are at most Cd 2 points q ∈ H ⊕ x to which we cannot apply the induction hypothesis.
For all remaining q ∈ H ⊕ x, we obtain by the induction hypothesis that there are at least c ′ ∏ d−1 i=2 (1 − 1 i 2 ) n d−2 hyperplanes Π in RP d−1 through π q (p) and exactly d − 2 points of H ′ ⊞ x ′ . If none of these d − 2 points equal π q (q), then π −1 q (Π) is a hyperplane in RP d through p and d − 1 points of H ⊕ x, one of which is q. There are at most n−1 d−3 such hyperplanes in RP d−1 through π q (q). Therefore, there are at least c ′ ∏ d−1 i=2 (1 − 1 i 2 ) n d−2 − n−1 d−3 hyperplanes in RP d that pass through p and exactly d − 1 points of H ⊕ x, one of them being q. If we sum over all n −Cd 2 points q, we count each hyperplane d − 1 times, and we obtain that the total number of such hyperplanes is at least It can easily be checked that if n > 2Cd 4 , and that if n > 4d 3 /c ′ . It now follows from (15) and (16) that the expression (14) is at least which finishes the induction.
Lemma 5.8. Let δ * be an elliptic normal curve or the smooth points of a rational acnodal curve in RP d , d 4, and let H ⊕ x be a coset of a finite subgroup H of δ * , with (d + 1)x ∈ H. Let A ⊆ H ⊕ x and B ⊂ RP d \ (H ⊕ x) with |A| = a and |B| = b. Let P = (H ⊕ x \ A) ∪ B with |P| = n be such that every d points of P span a hyperplane. If A and B are not both empty and n C(a + b + d 2 )d for some sufficiently large absolute constant C > 0, then P spans at least (1 + c) n−1 d−1 ordinary hyperplanes for some sufficiently small absolute constant c > 0. since we can find such a hyperplane by choosing a point p ∈ A and d − 1 points p 1 , . . . , p d−1 ∈ (H ⊕ x) \ A, and then the remaining point ⊖(p ⊕ p 1 ⊕ · · · ⊕ p d−1 ) might not be a new point in (H ⊕ x) \ A by either being in A (possibly equal to p) or being equal to one of the p i . The number of these hyperplanes that also pass through some point of B is at most ab n−b d−2 . Therefore, the number of ordinary hyperplanes of (H ⊕ x) \ A that miss B is at least Next, assuming that B = / 0, we find a lower bound to the number of ordinary hyperplanes through exactly one point of B and exactly d − 1 points of (H ⊕ x) \ A. The number of hyperplanes through at least one point of B and exactly d − 1 points of (H ⊕ x) \ A is at least bc ′ n−b d−1 − ab n−b d−2 by Lemmas 5.6 and 5.7 for some sufficiently small absolute constant c ′ > 0. The number of hyperplanes through at least two points of B and exactly d − 1 points of (H ⊕ x) \ A is at most b points, P lies in a hyperplane or is a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve.
In the first case, by Lemma 5.1, since n Cd 3 2 d , the minimum number of ordinary hyperplanes is attained when all but one point is contained in a hyperplane and we get exactly n−1 d−1 ordinary hyperplanes. In the second case, by Lemma 5.8, again since n Cd 3 2 d , the minimum number of ordinary hyperplanes is attained by a coset of an elliptic normal curve or the smooth points of a rational acnodal curve. Lemmas 5.2 and 5.5 then complete the proof. Note that the second term in the error term of Lemma 5.5 is dominated by the first term because of the lower bound on n, and that the error term here is negative by Lemma 5.2.
Note that if we want to find the exact minimum number of ordinary hyperplanes spanned by a set of n points in RP d , d 4, not contained in a hyperplane and where every d points span a hyperplane, we can continue with the calculation of [2, 1, . . . , 1; c] in the proof of Lemma 5.5. As seen in the proof of Lemma 5.2, this depends on gcd(d + 1, n). We also have to minimise over different values of c ∈ H, and if n ≡ 0 (mod 4), consider both cases H ∼ = Z n and H ∼ = Z n/2 × Z 2 .
For example, it can be shown that if d = 4, the minimum number is (d + 1)-point hyperplanes. Let δ * be an elliptic normal curve or the smooth points of a rational acnodal curve. By Propositions 3.1 and 3.9, the number of (d + 1)-point hyperplanes spanned by a coset H ⊕ x of δ * is