This notebook is a self-contained mathematical and computational companion to the Finite-field Kakeya section in the paper.
The task template, including the prompt given to the agents, is available here.
The outline is as follows:
- 1. Problem Definitions
- 2. S1. A new infinite family in for .
- 3. S2. Finite improvements and a 53-point Kakeya set in .
- 4. S3. Structural analysis of the new infinite family.
- 5. Higher-dimensional uniform families
- 6. Additional findings
- 7. Appendix verification
The required packages are:
NumPy
1. Problem Definitions
A finite-field Kakeya set contains a complete affine line in every direction. The problem is to construct such a set with as few points as possible; exact lower-order improvements remain meaningful even though the leading asymptotic density is known.
Let be a prime. An affine line in is
Two nonzero vectors determine the same projective direction if one is a nonzero scalar multiple of the other. We use the unique representative whose first nonzero coordinate equals . There are
such representatives. A set is Kakeya if it contains an affine line in every projective direction.
The next cell defines the shared routines used below for enumerating projective directions, constructing affine lines, and checking finite Kakeya certificates.
Show code
Code cell 3 · In [1]
from __future__ import annotations
from collections import Counter
from fractions import Fraction
from itertools import combinations, product
from math import comb, log
from pathlib import Path
import hashlib
import json
import numpy as np
ARTIFACT_DIR = Path.cwd()
def canonical_directions(p: int, d: int):
"""Unique projective representatives: first nonzero coordinate is 1."""
for pivot in range(d):
prefix = (0,) * pivot + (1,)
for tail in product(range(p), repeat=d - pivot - 1):
yield prefix + tail
def line_points(anchor, direction, p: int):
return {
tuple((int(a) + t * int(v)) % p for a, v in zip(anchor, direction))
for t in range(p)
}
def find_kakeya_witnesses(points, p: int, d: int):
point_set = {tuple(map(int, point)) for point in points}
witnesses = {}
for direction in canonical_directions(p, d):
# Every point on a contained line can serve as its anchor.
for anchor in point_set:
if line_points(anchor, direction, p) <= point_set:
witnesses[direction] = anchor
break
else:
raise AssertionError(f'No contained line in direction {direction}')
return witnesses
def assert_point_certificate(array: np.ndarray, p: int, d: int, size: int):
assert array.shape == (size, d)
assert np.issubdtype(array.dtype, np.integer)
assert np.all((0 <= array) & (array < p))
assert len({tuple(map(int, row)) for row in array}) == size
witnesses = find_kakeya_witnesses(array, p, d)
expected = (p**d - 1) // (p - 1)
assert len(witnesses) == expected
return witnesses
2. S1. A new infinite family in for .
2.1 Construction and exact size
Let , including zero, and put . Define
and, in the plane ,
Set .
Theorem 2.1 (coverage and exact size). For every odd prime , is Kakeya and
Proof of coverage. For each graph direction , the line
lies in , because , and similarly in the last coordinate. The displayed boundary lines cover every direction with , the diagonal covers , and the vertical line covers . These are all canonical directions.
Proof of the size formula. It remains to count in the plane . Write for the quadratic character, extended by , and .
Lemma 2.2 (finite-line selector). Put
The finite lines with , together with the vertical line, cover exactly the pairs for which .
Proof. Eliminating from gives
The value is never a root, since substitution gives . Thus for there is an allowed root exactly when the discriminant is a square. At , the finite intercept map covers every value except ; the vertical line restores and covers the whole row, while .
Lemma 2.3 (square-grid selector count).
Proof. The exact indicator of is . Hence
For ,
The change is bijective. The standard quadratic-character identity
therefore makes the double root-lift sum equal to . Correcting for the two axes gives
If , then
Each axis sum is , and .
For the zero count, the same root lift counts the union of and , which has ordered pairs. The two axis zero counts are each , and the origin is not a zero. The identical correction formula therefore gives exactly zeros in . Substitution yields the stated value of . The one-variable character identity itself follows by counting the solutions of and comparing them with .
Lemma 2.4 (diagonal correction). The diagonal adds
new square-grid points.
Proof. On the selector discriminant is . Moreover
obtained by lifting and using ; is the unique zero. Solving for the number of negative values gives .
By Lemmas 2.2–2.4,
Lemma 2.5 (total boundary-union count). Let be the union of the finite lines with , let , and let . Then
Proof. On the row with first coordinate , the finite lines cover the image of
For , this fractional-linear map is a bijection from onto itself, so the row has points. Assume . For distinct ,
Thus a collision occurs exactly when . Every fiber has size at most two, because is the quadratic from Lemma 2.2. Writing and , there are ordered solutions of . The diagonal solutions satisfy , so there are two when is a square and none when it is a nonsquare. Hence the number of unordered distinct collisions is or , respectively, and
Summing over and using gives off-axis points. This proves the formula for .
For , Lemma 2.2 says that exactly when is a square. On the diagonal , this becomes . As is a bijection, precisely diagonal points have nonsquare discriminant and are new; the point at already belongs to . Finally the row of contains every point except , so the vertical line adds exactly that one point.
By Lemma 2.5,
Consequently
Finally, every -slice of contains points, so , and . Adding the penalty gives Theorem 2.1.
The next cell constructs directly, checks the displayed size formula, and verifies an explicit line in every projective direction for every odd prime through . It also defines the finite-field helpers used in later sections.
Show code
Code cell 5 · In [2]
def is_prime(n: int) -> bool:
if n < 2:
return False
if n % 2 == 0:
return n == 2
return all(n % q for q in range(3, int(n**0.5) + 1, 2))
def quadratic_residues(p: int):
return {x * x % p for x in range(p)}
def legendre(a: int, p: int) -> int:
a %= p
if a == 0:
return 0
return 1 if pow(a, (p - 1) // 2, p) == 1 else -1
def one_pole_construction(p: int):
Q = quadratic_residues(p)
body = {
(x, y, z)
for x, y, z in product(range(p), repeat=3)
if (x * x + 4 * y) % p in Q and (x * x + 4 * z) % p in Q
}
boundary = set()
for c in range(p):
if c == 1:
continue
intercept = c * pow(c - 1, -1, p) % p
boundary.update((0, t, (c * t + intercept) % p) for t in range(p))
boundary.update((0, t, t) for t in range(p))
boundary.update((0, 0, t) for t in range(p))
return body | boundary
def one_pole_formula(p: int) -> int:
constant = -1 if p % 4 == 1 else 3
return (2 * p**3 + 7 * p**2 + constant) // 8
def explicit_one_pole_witnesses(p: int):
witnesses = {}
for a, b in product(range(p), repeat=2):
witnesses[(1, a, b)] = (0, a * a % p, b * b % p)
for c in range(p):
if c != 1:
witnesses[(0, 1, c)] = (0, 0, c * pow(c - 1, -1, p) % p)
witnesses[(0, 1, 1)] = (0, 0, 0)
witnesses[(0, 0, 1)] = (0, 0, 0)
return witnesses
one_pole_rows = []
for p in [q for q in range(3, 48, 2) if is_prime(q)]:
K = one_pole_construction(p)
W = explicit_one_pole_witnesses(p)
assert len(K) == one_pole_formula(p)
assert set(W) == set(canonical_directions(p, 3))
assert all(line_points(w, v, p) <= K for v, w in W.items())
Q = quadratic_residues(p)
delta_count = sum(
((1 - y - z) ** 2 - 4 * y * z) % p in Q for y in Q for z in Q
)
assert delta_count == (p * p + 8 * p - 1) // 8
one_pole_rows.append((p, len(K), '1 mod 4' if p % 4 == 1 else '3 mod 4'))
print('Verified exact construction rows (p, size, class):')
print(one_pole_rows)
Saved output 1
Verified exact construction rows (p, size, class): [(3, 15, '3 mod 4'), (5, 53, '1 mod 4'), (7, 129, '3 mod 4'), (11, 439, '3 mod 4'), (13, 697, '1 mod 4'), (17, 1481, '1 mod 4'), (19, 2031, '3 mod 4'), (23, 3505, '3 mod 4'), (29, 6833, '1 mod 4'), (31, 8289, '3 mod 4'), (37, 13861, '1 mod 4'), (41, 18701, '1 mod 4'), (43, 21495, '3 mod 4'), (47, 27889, '3 mod 4')]
2.2 Equivalence with the AlphaEvolve construction
We use the set defined in AlphaEvolve’s commit-pinned kakeya2.tex. Let in and define by
Theorem 2.6 (affine equivalence). If , then is affinely equivalent to the set of Theorem 2.1.
Proof. Choose with and define
Its linear part has determinant , so it is an invertible affine map. If a point lies in , then its image satisfies
Since is a nonzero square, this maps bijectively onto . On the plane , direct substitution, using and , gives
Therefore is exactly the selector set . Lemma 2.2 identifies this set with the finite one-pole lines together with the vertical line. Moreover , the diagonal line. Thus .
The next cell reconstructs both sets at , applies the affine map above, and checks exact equality of the resulting point sets.
Show code
Code cell 7 · In [3]
def alphaevolve_kakeya2(p):
assert p % 4 == 1
Q = quadratic_residues(p)
inv2 = pow(2, -1, p)
g = (p - 1) // 4
body = {
(x, ((q1 + q2) * inv2 - x * x - g) % p,
((q1 - q2) * inv2) % p)
for x, q1, q2 in product(range(p), Q, Q)
}
conic_boundary = {
(0, y, z) for y, z in product(range(p), repeat=2)
if (y + z * z) % p in Q
}
diagonal_source = {(0, y, 0) for y in range(p)}
return body | conic_boundary | diagonal_source
def alphaevolve_to_one_pole(point, p):
x, y, z = map(int, point)
g = (p - 1) // 4
u = next(a for a in range(1, p) if a * a % p == (-4) % p)
inv4 = pow(4, -1, p)
return (
u * x % p,
u * u * (y + z + g) * inv4 % p,
u * u * (y - z + g) * inv4 % p,
)
affine_equivalence_rows = []
for p in (5, 13, 17, 29):
alpha_set = alphaevolve_kakeya2(p)
mapped_set = {alphaevolve_to_one_pole(point, p) for point in alpha_set}
station_set = one_pole_construction(p)
assert mapped_set == station_set
u = next(a for a in range(1, p) if a * a % p == (-4) % p)
affine_equivalence_rows.append((p, u, len(mapped_set)))
print({
'affine_equivalence_checks_(p,u,size)': affine_equivalence_rows,
})
Saved output 1
{'affine_equivalence_checks_(p,u,size)': [(5, 1, 53), (13, 3, 697), (17, 8, 1481), (29, 5, 6833)]}
Station Reference. The exact one-pole formula, corrected selector, and affine-equivalence calculation are based on Archive #160, message archive_160-3, and Eval #2414, with supporting checks in Evals #2399, #2406, and #2410.
Related Work. Dvir (2009) proved the finite-field Kakeya conjecture, while Bukh and Chao (2021) determined the sharp leading density and developed a general framework for completing almost-Kakeya sets using lower-dimensional Kakeya sets. The infinite family above is related to that framework; its explicitly analyzed one-pole completion yields the displayed exact size formulas. Georgiev et al. (2025) reported the AlphaEvolve families used for comparison. The branch is an independent rediscovery up to affine equivalence, whereas the branch is new and saves points over AlphaEvolve’s applicable infinite family.
3. S2. Finite improvements and a 53-point Kakeya set in .
3.1 The 53-point construction
Theorem 3.1. If denotes the minimum cardinality of a Kakeya set in , then
Proof. The point array kakeya_F3_d5_53.npy contains distinct points. The exact verification below shows that it contains an affine line in each of the projective directions of , so it is the required Kakeya set.
The next cell authenticates the stored -point array and independently searches for a contained line in all directions. It also counts every contained affine line, providing a stronger check than replaying stored witnesses.
Show code
Code cell 10 · In [4]
DATA_HASHES = {'kakeya_F3_d3_13.npy': '8b1cac563e00cc53ecb5c0d38e23078fbbde36e6b6796f6c375769fbfa393737', 'kakeya_F3_d4_27.npy': 'dae8bf4b72750146aadad1de525be39fbfa49e78473202581363bacc82c14f2d', 'kakeya_F3_d5_53.npy': '4ddbba43b2cff772e4eb1ffe42064fb05e95a03972a2c448472acdcf803da812'}
path_53 = ARTIFACT_DIR / 'kakeya_F3_d5_53.npy'
if not path_53.is_file():
raise FileNotFoundError(f'Required certificate is missing: {path_53}')
assert hashlib.sha256(path_53.read_bytes()).hexdigest() == DATA_HASHES[path_53.name]
K_53 = np.load(path_53, allow_pickle=False)
witnesses_53 = assert_point_certificate(K_53, p=3, d=5, size=53)
contained_line_counts = {}
point_set_53 = {tuple(map(int, row)) for row in K_53}
for direction in canonical_directions(3, 5):
lines = {
frozenset(line_points(anchor, direction, 3))
for anchor in point_set_53
if line_points(anchor, direction, 3) <= point_set_53
}
contained_line_counts[direction] = len(lines)
assert sum(contained_line_counts.values()) == 131
print({
'points': len(point_set_53),
'canonical_directions': len(witnesses_53),
'contained_affine_lines': sum(contained_line_counts.values()),
'minimum_lines_per_direction': min(contained_line_counts.values()),
'maximum_lines_per_direction': max(contained_line_counts.values()),
'sha256': DATA_HASHES[path_53.name],
})
Saved output 1
{'points': 53, 'canonical_directions': 121, 'contained_affine_lines': 131, 'minimum_lines_per_direction': 1, 'maximum_lines_per_direction': 2, 'sha256': '4ddbba43b2cff772e4eb1ffe42064fb05e95a03972a2c448472acdcf803da812'}
Station Reference. The 53 points originated in Eval #2520. The verification reconstructs witnesses independently from the points.
3.2 The complete 25-pair Station result
Table 3.1 (verified Station constructions).
Theorem 3.2. For every triple listed in Table 3.1, there is a Kakeya set of points in .
Verification. For each row, the bundled certificate supplies a point set of cardinality and a witness line in every projective direction. The next cell checks the point count, distinctness, coordinate range, complete direction list, and containment of every witness line. A successful run verifies all existence claims.
The comparison with AlphaEvolve and the earlier literature is deferred to Section 7.
Show code
Code cell 12 · In [5]
STATION_MANIFEST_SHA256 = 'f19d7b03cfdd5956386f2ef4ef2aa41009783ba0b5137d8b54d0ec360b22afad'
STATION_BUNDLE_SHA256 = '105a642a701a4d26f1e360ac041504731c2d7d7bc13d1c185dc5b5013c21dfd5'
station_manifest_path = ARTIFACT_DIR / 'station_point_certificates.json'
assert hashlib.sha256(station_manifest_path.read_bytes()).hexdigest() == STATION_MANIFEST_SHA256
station_manifest = json.loads(station_manifest_path.read_text())
station_bundle_path = ARTIFACT_DIR / station_manifest['bundle']
assert hashlib.sha256(station_bundle_path.read_bytes()).hexdigest() == STATION_BUNDLE_SHA256
assert station_manifest['bundle_sha256'] == STATION_BUNDLE_SHA256
station_certificate_checks = []
with np.load(station_bundle_path, allow_pickle=False) as station_bundle:
for record in sorted(station_manifest['records'], key=lambda row: (row['d'], row['p'])):
d, p, size = record['d'], record['p'], record['size']
point_array = station_bundle[record['points_key']]
witness_array = station_bundle[record['witnesses_key']]
directions = list(canonical_directions(p, d))
assert point_array.shape == (size, d)
assert witness_array.shape == (len(directions), d)
assert np.all((0 <= point_array) & (point_array < p))
points = {tuple(map(int, point)) for point in point_array}
assert len(points) == size
for direction, anchor in zip(directions, witness_array):
assert line_points(anchor, direction, p) <= points
station_certificate_checks.append((d, p, size, len(directions)))
assert [(d, p, size) for d, p, size, _ in station_certificate_checks] == [
(3, 3, 13), (3, 5, 53), (3, 7, 128), (3, 11, 437),
(3, 13, 697), (3, 19, 2030), (3, 23, 3504), (3, 29, 6833),
(3, 31, 8288), (3, 37, 13861), (3, 41, 18701), (3, 43, 21495),
(3, 47, 27889), (3, 53, 39677), (4, 3, 27), (4, 5, 161),
(4, 7, 527), (4, 11, 2684), (4, 13, 4962), (4, 17, 13509),
(4, 19, 20579), (5, 3, 53), (5, 5, 490), (5, 7, 2135),
(5, 11, 16288),
]
print('Verified Station constructions:', len(station_certificate_checks))
print('Verified projective directions:', sum(row[3] for row in station_certificate_checks))
Saved output 1
Verified Station constructions: 25 Verified projective directions: 50066
Station Reference. The 25 Station point certificates are reconstructed from Evals #3, #12, #42, #52, #690, #730, #975, #2053, #2520, and #2529. The bundled point sets and witness lines are checked above.
Related Work. Lev (2009) recorded and and proposed the recurrence that predicts . The previous bound is attained by the missing-digit construction of Kopparty et al. (2011) and was also AlphaEvolve’s value. The 53-point construction improves that bound and matches Lev’s prediction.
4. S3. Structural analysis of the new infinite family.
Fix and put . Choose , set , and assume . For , define
Add and the vertical line . Let be the union of these lines and define the boundary penalty by .
Theorem 4.1 (uniform full-family penalty). Let be an odd prime. For every and every satisfying ,
Proof. Let . Eliminating gives
For , membership in is equivalent to . As a polynomial in , is monic with discriminant . Therefore and the number of its zeros is , so the number of covered is . Summation over gives points. At , the values run bijectively through . Hence
It remains to bound . Put
and write for the indicators of . The exact square-set indicator is . The selector agrees with off the row ; on that row it additionally selects the omitted point . Thus, if denotes the selector overlap,
The part without or is . We next bound the -block. The monic-quadratic identity used above gives
For , substitute . If , the inner sum over is a correlation of two linear characters. Their roots coincide precisely when
If this quadratic has roots, the correlation identity for distinct roots and for equal roots gives
Thus ; when the inner sum is zero. Multiplication by the harmless factor proves .
For , restrict to and set . The inner polynomial in is
whose discriminant is . If , the complete character sum is except that it is at and at ; subtracting the term and summing with weight gives
If , the same calculation gives . Hence . The remaining zero-coordinate -terms group as
with absolute values at most and . The entire -block therefore has absolute value at most .
Finally has affine solutions. The -block is exactly four times the number of these solutions in , hence is at most . From (2),
Removing the possible extra point changes the numerator by at most , so, for every odd ,
Let be the new contribution outside from the pole and vertical lines. Since each has points, . By (1) and (3),
and therefore .
The next cell exhausts all admissible parameters at and . For each choice it checks the exact finite-line union count and the bound proved above.
Show code
Code cell 15 · In [6]
def full_one_pole_boundary(p, lam, A, B, r, u, v):
Q = quadratic_residues(p)
D = (A * r + B) % p
assert lam % p != 0 and D != 0
finite = set()
for c in range(p):
if c == r:
continue
beta = (A * c + B) * pow(c - r, -1, p) % p
finite.update((y, (c * y + beta) % p) for y in range(p))
boundary = finite | {(y, (r * y + u) % p) for y in range(p)}
boundary |= {(v, z) for z in range(p)}
footprint = {(lam * q % p, lam * s % p) for q in Q for s in Q}
return finite, boundary, len(boundary - footprint)
full_family_checks = 0
for p in (3, 5):
for lam in range(1, p):
for A, B, r, u, v in product(range(p), repeat=5):
if (A * r + B) % p == 0:
continue
finite, boundary, penalty = full_one_pole_boundary(
p, lam, A, B, r, u, v
)
assert len(finite) == p * (p - 1) // 2 + (p - 1)
assert abs(penalty - Fraction(3 * p * p, 8)) < 5 * p
full_family_checks += 1
print({'full_one_pole_parameter_checks': full_family_checks})
Saved output 1
{'full_one_pole_parameter_checks': 10324}
Station Reference. The uniform full-family penalty theorem is based on Archive #160 and the supporting checks in Evals #2399, #2406, and #2410.
Related Work. Bukh and Chao (2021) established the sharp leading density and a construction framework that determines the first two asymptotic terms. AlphaEvolve, as reported by Georgiev et al. (2025), gives particular completion families rather than a uniform bound for the full one-pole class. The theorem above proves the class-wide boundary penalty for every nondegenerate one-pole completion.
5. Higher-dimensional uniform families
The infinite families for and described in the paper’s limitations are presented here.
5.1 The four-dimensional prefix-sum family
Let
For , let be the lower-triangular matrix
Thus . Define
Set . Recursively, for , define
Theorem 5.1. For every odd prime , the set defined in (4) is Kakeya in and has size
Proof. For each , the line
lies in and has direction . By induction, contains a line in every direction whose first coordinate is zero. Hence is Kakeya.
Fix . Applying to the transverse slice gives
Each coordinate ranges over a set of values, so the slice has points. The nonzero slices of therefore contain points.
At , the top slice is
and the zero slice of is . For , put
Partitioning by its first coordinate gives
Substituting the displayed formula for and summing the quadratic characters yields
Adding the nonzero slices gives the stated formula.
5.2 The five-dimensional nested tangent family
Write for the quadratic character and retain and . Choose with , and choose so that
Define the planar tangent completion
For , define
Set
Lemma 5.2 (planar base calculation). A permitted value of exists. The set is Kakeya and
while
Consequently,
Proof. Let be the union of the sloped lines in and put . Eliminating gives
whose discriminant is . Thus exactly when . Every -row of has points, so ; the horizontal line adds points. The sloped lines cover the directions and the horizontal line covers , so is Kakeya.
Write . If , choose a nonzero square ; such a choice exists for , and . If , multiplication by permutes the squares, and
This identity follows by expanding the square indicator and using the standard quadratic sum . Hence some nonzero square has ; taking gives .
For , expanding the same indicator gives
and
at the corresponding count is . The polynomial has exactly two zeros in . Summing over gives
The horizontal line adds respectively or new points of . Therefore in both cases, and the remaining formulas follow.
Put
For , inclusion–exclusion in (5) gives
Theorem 5.3. For every odd prime , the set defined by (5) is Kakeya in and has size
Proof. At each lift, the new body has points and supplies all graph directions; the embedded copy of supplies the directions in the coordinate hyperplane. Their intersection has size . Indeed, the overlap splits into points from the zero parameter and points from the nonzero square parameters, where the standard quadratic-character count gives
Inclusion–exclusion proves (6). Substituting the dimension-three size and expanding the cases and through dimensions four and five gives the displayed formulas.
The next cell reconstructs both higher-dimensional families at three primes, checks their exact sizes, expands the size laws, and checks the third-coefficient comparison with AlphaEvolve.
Show code
Code cell 19 · In [7]
def poly_add(*polynomials):
degree = max(map(len, polynomials))
return tuple(
sum((poly[i] if i < len(poly) else Fraction(0)) for poly in polynomials)
for i in range(degree)
)
def poly_scale(poly, scalar):
scalar = Fraction(scalar)
return tuple(scalar * coefficient for coefficient in poly)
def poly_mul(left, right):
result = [Fraction(0)] * (len(left) + len(right) - 1)
for i, a in enumerate(left):
for j, b in enumerate(right):
result[i + j] += a * b
return tuple(result)
def poly_pow(poly, exponent):
result = (Fraction(1),)
for _ in range(exponent):
result = poly_mul(result, poly)
return result
p_poly = (Fraction(0), Fraction(1))
one_poly = (Fraction(1),)
S_poly = poly_scale(poly_add(p_poly, one_poly), Fraction(1, 2))
prefix_expected = {
1: (Fraction(-13, 32), Fraction(-3, 32), Fraction(25, 32),
Fraction(19, 32), Fraction(1, 8)),
-1: (Fraction(-49, 32), Fraction(-7, 32), Fraction(25, 32),
Fraction(19, 32), Fraction(1, 8)),
}
prefix_zero_slice = {
1: (Fraction(-9, 32), Fraction(5, 32), Fraction(25, 32),
Fraction(11, 32)),
-1: (Fraction(-45, 32), Fraction(1, 32), Fraction(25, 32),
Fraction(11, 32)),
}
prefix_body = poly_mul((-1, 1), poly_pow(S_poly, 3))
for character in (1, -1):
assert poly_add(prefix_body, prefix_zero_slice[character]) == prefix_expected[character]
def prefix_sum_kakeya(p, dimension):
if dimension == 1:
return {(t,) for t in range(p)}
n = dimension - 1
top = set()
for slope in product(range(p), repeat=n):
cumulative = []
total = 0
for value in slope:
total = (total + value) % p
cumulative.append(total)
squared = [(-value * value) % p for value in cumulative]
anchor = tuple(
(squared[i] - (squared[i - 1] if i else 0)) % p
for i in range(n)
)
for t in range(p):
top.add((t,) + tuple(
(anchor[i] + t * slope[i]) % p for i in range(n)
))
boundary = {(0,) + point for point in prefix_sum_kakeya(p, n)}
return top | boundary
def poly_evaluate(poly, value):
return sum(coefficient * value**degree
for degree, coefficient in enumerate(poly))
prefix_construction_sizes = {}
for prime in (5, 7, 11):
character = 1 if prime % 4 == 1 else -1
points = prefix_sum_kakeya(prime, 4)
expected_size = poly_evaluate(prefix_expected[character], prime)
assert expected_size.denominator == 1
assert len(points) == expected_size
prefix_construction_sizes[prime] = len(points)
tangent_three = (
Fraction(-11, 8), Fraction(1, 4), Fraction(7, 8), Fraction(1, 4)
)
def tangent_lift(size_poly, dimension, character):
r_poly = poly_scale(poly_add(p_poly, (2 + character,)), Fraction(1, 4))
overlap = poly_add(
poly_pow(S_poly, dimension - 1),
poly_mul(poly_add(S_poly, (-1,)), poly_pow(r_poly, dimension - 1)),
)
body = poly_mul(p_poly, poly_pow(S_poly, dimension))
return poly_add(body, size_poly, poly_scale(overlap, -1))
tangent_five_expected = {
1: (Fraction(-161, 128), Fraction(-17, 32), Fraction(37, 64),
Fraction(25, 32), Fraction(47, 128), Fraction(1, 16)),
-1: (Fraction(-219, 128), Fraction(-25, 64), Fraction(27, 32),
Fraction(53, 64), Fraction(47, 128), Fraction(1, 16)),
}
tangent_five = {}
for character in (1, -1):
tangent_four = tangent_lift(tangent_three, 3, character)
tangent_five[character] = tangent_lift(tangent_four, 4, character)
assert tangent_five[character] == tangent_five_expected[character]
def quadratic_character(value, p):
value %= p
if value == 0:
return 0
return 1 if pow(value, (p - 1) // 2, p) == 1 else -1
def tangent_kakeya(p, dimension):
squares = quadratic_residues(p)
character = quadratic_character(-1, p)
alpha = next(a for a in range(1, p)
if quadratic_character(a, p) == character)
if character == 1:
e = next(x for x in sorted(squares)
if quadratic_character(alpha * x * x + x, p) == -1)
else:
e = next(x for x in sorted(squares)
if (alpha * x * x + x) % p != 0)
inverse = pow(4 * alpha, -1, p)
completion = {
((m * z - (m - 1) ** 2 * inverse) % p, z)
for m in range(p)
for z in range(p)
}
completion |= {(y, e) for y in range(p)}
def leading_block(dimension):
return {
(x0,) + tuple((q - x0 * x0) % p for q in tail)
for x0 in range(p)
for tail in product(squares, repeat=dimension - 1)
}
points = leading_block(3) | {(0,) + point for point in completion}
for current_dimension in range(4, dimension + 1):
points = leading_block(current_dimension) | {
(0,) + point for point in points
}
return points
tangent_construction_sizes = {}
for prime in (5, 7, 11):
character = 1 if prime % 4 == 1 else -1
points = tangent_kakeya(prime, 5)
expected_size = poly_evaluate(tangent_five_expected[character], prime)
assert expected_size.denominator == 1
assert len(points) == expected_size
tangent_construction_sizes[prime] = len(points)
d4_third_gap = prefix_expected[1][2] - Fraction(11, 16)
d5_third_gap = tangent_five[1][3] - Fraction(177, 256)
assert d4_third_gap == Fraction(3, 32) > 0
assert d5_third_gap == Fraction(23, 256) > 0
print('Exact coefficient gaps over AlphaEvolve:', {
'd=4, coefficient of p^2': d4_third_gap,
'd=5, coefficient of p^3': d5_third_gap,
})
Saved output 1
Exact coefficient gaps over AlphaEvolve: {'d=4, coefficient of p^2': Fraction(3, 32), 'd=5, coefficient of p^3': Fraction(23, 256)}
Station Reference. The nested tangent construction and its overlap identity are from Archive #50. The four-dimensional prefix-sum construction and its zero-slice decomposition are from Archive #71.
Related Work. On , the uniform constructions reported by Georgiev et al. (2025) have sizes
in dimension four and
in dimension five. The Station formulas have the same first two coefficients but exceed these third coefficients by in dimension four and in dimension five. Since smaller Kakeya sets are better, both Station families are asymptotically worse than the corresponding AlphaEvolve families.
6. Additional findings
These are additional results that may be interesting but are not included in the spotlight.
6.1 Exact polynomial evaluation-code distance
Dvir’s polynomial method detects a small Kakeya set through a nonzero polynomial of degree at most that vanishes on the entire set. We determine exactly how close the classical quadratic-residue construction comes to admitting such a certificate: every such polynomial that is not identically zero on remains nonzero on at least points when , and at least points when , with equality in both cases. Thus the theorem gives the exact obstruction to applying Dvir’s vanishing argument to this construction, while also determining the minimum distance of the associated punctured Reed–Muller code. We prove the upper bounds with an explicit product of hyperplanes and the lower bounds by a weighted footprint argument, supplemented in dimension three by a shadow code and body-kernel decomposition.
The set and its evaluation code
Let be an odd prime, let
where , and define the quadratic-residue cone
where
and
For a polynomial of total degree at most , its evaluation word is the function . Its Hamming weight is
The minimum distance is the least positive weight of such an evaluation word.
Theorem 6.1 (exact distance). For every odd prime ,
For ,
The restriction in dimension three is necessary: at the distance is , not .
An explicit polynomial certificate
Lemma 6.2 (explicit upper certificate). For every , a polynomial of degree has weight exactly on .
Proof. Take
It has linear factors. The first factor makes it zero on , and the second covers the part of with . At a remaining body point, one of the other factors vanishes precisely when
Its discriminant is , a square by the definition of . If the two roots are distinct, they cannot both be the excluded pair : their sum is , whereas the excluded pair has sum zero. The only possible failure is therefore a double root. This requires
and the root is . It is excluded exactly when . Hence the nonzero set of on is
which has points.
Two elementary polynomial bounds
We use the following finite-grid form of the footprint bound.
Lemma 6.3 (Cartesian-grid footprint). Let have elements. Suppose a nonzero polynomial , reduced so that , has lexicographic leading monomial . Then is nonzero at at least
points of .
Proof. Induct on . View as a polynomial in . Its leading coefficient, as a polynomial in the remaining variables, has leading exponents , so by induction it is nonzero at at least choices of those variables. At each such choice the resulting nonzero polynomial in has degree , hence at most roots in .
Lemma 6.4 (full-grid Reed–Muller bound). A nonzero polynomial in variables, of total degree at most , is nonzero at at least points of .
Proof. Apply Lemma 6.3 to the full grid. If the leading exponents sum to at most , then
The product inequality follows successively from .
The lower bound when divides the polynomial
Lemma 6.5 (body footprint). If , , and , then
Proof. We have , and vanishes on . On , introduce
This is a bijection from to
Give weight and every weight . After substituting , the transformed polynomial has weighted degree at most . Reduce it by
These reductions preserve its values on and do not increase weighted degree. The normal form is nonzero: vanishes on , so forces , and hence , to be nonzero somewhere on . Its leading monomial in the same lexicographic order as Lemma 6.3 is
with
Lemma 6.3 gives at least
nonzero body values. We now minimize this product under the displayed constraints. At fixed , moving two transverse exponents farther apart cannot increase . Thus at a minimum all but at most one transverse exponent lie in . The degree budget permits at most one exponent equal to .
If none equals and there is no interior exponent, the product is at least . If there is one interior exponent, maximizing it together with gives at least
If one exponent equals , write the possible other interior exponent as . The budget gives , and the product is at least
Therefore has at least nonzero values.
Proof of Theorem 6.1 for . For , the other case is immediate. If , then is a nonzero polynomial of degree at most . Lemma 6.4 gives at least nonzero values on , and
Indeed , and its -nd power is at least . Lemmas 6.2 and 6.5 now prove Theorem 6.1 for every .
Dimension three is the sole delicate case: Lemma 6.4 gives only plane points, one short of . The rest of this section closes that gap.
The one-coordinate shadow code
Assume henceforth that , so . Let , the multiplicative group of nonzero squares.
The elementary finite-field facts used below are as follows. The squaring map on has kernel , so and . If generates the cyclic group , then . Thus for , while for a nonsquare . It follows in particular that for every .
Give the weights
and set
Define the shadow code by
For any linear code , write for the least Hamming weight of a nonzero word of .
The next lemma determines its dimension without assuming any unproved interpolation statement.
Lemma 6.6 (triangle unisolvence). The monomials
form an interpolation basis on . Consequently, .
Proof. Both and have elements. Put , so . Values on the distinct points of and coefficients in the basis are related by an invertible Vandermonde matrix. We may therefore work with those coefficients.
We will also use the multiplicative Fourier transform on . For a function , set
It is invertible, with
Indeed, after writing as a cyclic group, the finite geometric sum equals when and otherwise. Substitution in the proposed inverse leaves only the term indexed by the same residue.
Here is the algebra producing the Fourier blocks. For a column ,
The frequency- Fourier component retains exactly the terms satisfying
Let be the residue of ; equivalently, a transformed entry can be nonzero only when
Write . The degree constraint forces . Since , the two inequalities and give
This derives the row set below. Since , each nonzero residue has at most the two exponents , and reduction by identifies with on . At residue zero, the exponents remain the distinct columns , because at . Multiply the monomial side by and the coefficient side by , then apply the determinant-one shear
The resulting uniform block indexed by has columns , rows
and entries
where in the column .
For every affected row , the finite binomial identity
follows by taking the coefficient of in
The convolution on the left gives the displayed sum, while the coefficient on the right is . The identity therefore allows the determinant-one row operation
to remove the second term. The required lower rows all belong to . Thus
The last equality is the Vandermonde determinant, since is a degree- polynomial with leading coefficient . Every nonzero difference between nodes of , and every denominator factor, has magnitude less than . Hence every block determinant is nonzero in , proving unisolvence.
The space of monomials of weighted degree at most has dimension , while . Since already evaluates bijectively, the kernel at weighted degree has dimension . The slice map is injective on that kernel: if the slice is zero as a function on , then its degree is at most , so one-variable root counting makes it the zero polynomial. Hence . Because on , also vanishes on , but its weighted degree is at most , contradicting unisolvence unless . Its image is , so .
An explicit description of
Define functions on
and let
The denominators are nonzero because . On , . If a linear combination of the displayed generators vanishes, evaluation at first kills its constant coefficient; evaluation on the cyclic group then kills the coefficients of the distinct characters , . Thus .
Lemma 6.7 (explicit lifts). Every generator of belongs to . Hence .
Proof. We give the lift, including the coefficient identity that makes it work. For , put
and
where and . All denominators are products of nonzero integers of magnitude below .
Write . We now perform the coefficient extraction explicitly. We first need the following terminating Pfaff identity: for an integer ,
This is a polynomial identity, so the apparent denominator on the right cancels. Indeed, the coefficient of on its right side is
after cancelling , the equality is the finite binomial identity proved in the next paragraph, with the parameters relabelled. Thus the coefficients agree term by term.
Apply this identity with , , , and . It gives
For , the polynomial has degree at most , so it contributes nothing to . Consequently,
where the second equality uses
The temporary denominator is legitimate: for , none of the factors in is zero modulo .
It remains to evaluate the finite sum. The required binomial identity is
It gives, for ,
For an integer ,
It follows by induction on : split , apply the induction hypothesis to the two resulting sums, and simplify
Taking , , and proves the displayed coefficient formula. For , its numerator contains a zero factor, so . At the endpoints, direct extraction gives
Let and . Before normalization, and . Since in ,
so . Here and below an empty product is . All displayed factors in are nonzero modulo , and
The endpoint ratio is therefore the one claimed. Rescale , and hence every , so that .
Now define
We have , because , and . Thus the two displayed intervals, together with the vanished gap , account for every coefficient of . The polynomial has weighted degree at most . On , put . Since , its two displayed diagonals combine to give
Moreover , so , and the right-hand side is zero. At , only its two endpoint terms remain, giving . Finally, lifts the constant function. Thus ; equal dimensions give .
The one-coordinate distance
Every word of is determined by a polynomial of degree at most : its values are on , and on the nonsquares . Indeed, on the two terms of combine with coefficient , whereas on they combine with coefficient ; multiplication of the square-side coefficient by gives the nonsquare-side coefficient.
For clarity, we also derive the matrix below. The interpolation nodes are the roots of , so
Apply and evaluate at . Using and , the first term becomes , while the -th interpolation term becomes . Therefore
where , , , and . Here denotes the all-ones vector indexed by .
Lemma 6.8 (distance of the shadow code). For every prime , .
Proof. The weight is
Only inputs of weight one or two require attention.
If and , the last block is a nonzero constant, giving weight . If and is supported at one square , its nonsquare values are multiples of
which vanishes only at . Thus the total weight is at least , sufficient for ; for , is a square and no nonsquare ratio is lost, giving weight . If and is one-sparse, the equation is a nonzero polynomial of degree at most two and has at most two solutions. The two input coordinates plus at least output coordinates give total weight at least , sufficient for .
Finally, if and is supported at distinct , clearing denominators shows that its zero nonsquare coordinates are roots of the nonzero cubic
It is nonzero because . It has at most three nonsquare roots, so the two input coordinates plus at least output coordinates give weight for . The two smaller primes are closed directly, without a search: with rows indexed by nonsquares and columns by nonzero squares,
and
For , each nonconstant column settles the , one-sparse- case, and settles the two-sparse case. For , each pair of columns is independent, settling the remaining two-sparse case. These observations close precisely the cases not covered by the general root counts. Thus every nonzero word has weight at least three.
From one coordinate to the whole plane
Let be the vector space of total-degree- polynomials in that vanish on the body , and let
Lemma 6.9 (body-kernel decomposition).
Proof. The lifts in Lemma 6.7, embedded separately in and , show . The two copies meet exactly in the constants, so this subspace has dimension . It remains to prove .
Write and decompose uniquely
where has weighted degree at most and at most , with weights . Every has the two square roots ; because is odd, vanishing at both signs separates the even and odd parts. We use the following rank claim.
Weighted-grid rank claim. Evaluation on
is injective through weighted degree , and its kernel through weighted degree has dimension at most .
To prove the claim, put and . Let be the coefficient vector of the remainder of modulo
Thus for , where is the -th standard coordinate vector. Evaluation on the distinct roots of and the coefficient vector of the remainder modulo are related by an invertible Vandermonde matrix. A monomial evaluates as . The invertible Fourier transform on splits the rows by the residue , and the row in that block is .
For fixed , put and write . Below weighted degree , the inequalities and give
No other is possible. Thus the totals arising below weight are exactly
At weighted degree exactly , the additional rows with have total for , and for . We add these mixed top-weight rows. Rows with are coordinate vectors and pivot on their matching columns; call them core rows. Every remaining row has exactly one exponent larger than . Call it horizontal when it is , grouping rows with the same low exponent into a horizontal fiber; call its transpose vertical.
We now enumerate every non-core row. When , only the added total can be non-core, so gives for . When , the upper bound gives . The ordinary high totals begin at , while the added mixed total is . The latter is unavailable when . Therefore the possible values of are exactly the sets displayed next.
For , a horizontal fiber has , , and we select the column . For , its possible ’s are
and, for ,
After using the core pivots, a column is still unused precisely when its total is not one of the core-row totals. For , this leaves totals ; for , the mixed top total is already used and this leaves . To keep horizontal selections disjoint from their vertical transposes, also require . Hence the eligible second-coordinate interval is
or
A direct comparison of endpoints gives . Explicitly, . For , write and . If , then and ; if , then and the same equality follows with . Thus contains at least elements. Choose to be the largest elements of , and select the columns with . It follows that for , while . Hence every active low coordinate satisfies , and also . Vertical rows use the transposed columns .
For each non-core row we selected exactly one column, and different same-orientation fibers have different fixed low coordinates. The selected horizontal and vertical sets are disjoint. When , every low coordinate and every is less than the selected terminal coordinate . When , every low coordinate of every active fiber is at most , whereas every selected terminal coordinate is at least . A horizontal row has first factor , so its entry on every selected vertical column is zero. The same global inequality, with the coordinates transposed, kills the other cross block after eliminating the core pivots. Together with the core pivot columns, these choices therefore form a square block-triangular minor; it remains only to prove that each diagonal arm block is nonsingular.
For each remaining arm block,
To obtain this identity, first divide by . Replacing that divisor by changes the remainder only in degrees at most , so coefficients with are unchanged. Taylor expansion at , followed by
gives the first expression; cancellation of factorials gives the second. The row scale and column scale are nonzero: , , and . After these nonzero scalings the block is the Cauchy matrix , . Its determinant is
Here is a proof of the determinant formula. After multiplication by , the determinant is a polynomial alternating separately in the ’s and in the ’s. It is therefore divisible by both Vandermonde products in the numerator. The degrees are equal, so the quotient is constant; comparing successive highest-degree coefficients in gives constant .
The determinant is nonzero: all labels are distinct and every denominator lies in , hence is nonzero modulo . The selected minor is therefore nonsingular. This proves independence of all rows through weight , even after adding the mixed top-weight rows.
The only top-weight monomials omitted from this independent augmented family have or . There are of them. Thus the odd part is injective and the even kernel has dimension at most , proving the weighted-grid rank claim and .
We already exhibited a -dimensional subspace of . (The intersection of the two copies of consists only of constants: a function of equal to a function of for all pairs must be constant.) Hence equality holds.
Lemma 6.10 (two-coordinate sum code). If and a linear code over a finite field contains the constant functions, then
Proof. Let be a nonzero sum-code word. If is nonconstant, every fiber has at most elements because is a nonzero word of . Hence the number of zeros of is
If is constant, then is a nonzero word of , repeated times, and obeys the same lower bound. A minimum word depending only on attains .
Lemmas 6.8–6.10 give
Completion of the dimension-three proof
Proof of Theorem 6.1 for . Let have degree at most , with . Its plane restriction is nonzero, so Lemma 6.4 gives . If , equality must hold and must vanish on all of . Thus , so ; but every nonzero word in has weight at least , a contradiction. Hence every such has weight at least . Together with Lemmas 6.2 and 6.5, this proves
At , Lemma 6.5 gives weight at least when , while Lemma 6.4 gives at least nonzero plane values when . The polynomial vanishes on the body because there , and on the plane it is nonzero exactly when , at the three choices of . Its weight is therefore , proving .
The next cell checks the finite-field linear algebra used in this proof. It verifies the shadow code, the body-kernel decomposition, the explicit support, and the exceptional case at the stated sample primes.
Show code
Code cell 23 · In [8]
def gf_rref(matrix, p):
A = np.array(matrix, dtype=np.int64) % p
rows, cols = A.shape
pivots = []
r = 0
for c in range(cols):
pivot = next((i for i in range(r, rows) if A[i, c] % p), None)
if pivot is None:
continue
if pivot != r:
A[[r, pivot]] = A[[pivot, r]]
A[r] = A[r] * pow(int(A[r, c]), -1, p) % p
for i in range(rows):
if i != r and A[i, c] % p:
A[i] = (A[i] - int(A[i, c]) * A[r]) % p
pivots.append(c)
r += 1
if r == rows:
break
return A, pivots
def gf_rank(matrix, p):
A = np.array(matrix, dtype=np.int64)
if A.size == 0:
return 0
return len(gf_rref(A, p)[1])
def gf_nullspace(matrix, p):
R, pivots = gf_rref(matrix, p)
cols = R.shape[1]
free = [c for c in range(cols) if c not in pivots]
basis = []
for c in free:
v = np.zeros(cols, dtype=np.int64)
v[c] = 1
for row, pivot in enumerate(pivots):
v[pivot] = -R[row, c] % p
basis.append(v)
return np.array(basis, dtype=np.int64).reshape(len(free), cols)
def row_spaces_equal(A, B, p):
A = np.array(A, dtype=np.int64) % p
B = np.array(B, dtype=np.int64) % p
return gf_rank(A, p) == gf_rank(B, p) == gf_rank(np.vstack([A, B]), p)
def total_degree_exponents(variables, degree):
return [
exponent
for exponent in product(range(degree + 1), repeat=variables)
if sum(exponent) <= degree
]
def evaluate_monomials(points, exponents, p):
return np.array([
[
np.prod([pow(int(x), int(a), p) for x, a in zip(point, exponent)],
dtype=np.int64) % p
for exponent in exponents
]
for point in points
], dtype=np.int64)
def pochhammer_mod(a, length, p):
out = 1
for j in range(length):
out = out * (a + j) % p
return out
def shadow_lift_coefficients(p, ell):
n = (p - 1) // 2
G = []
for j in range(ell):
numerator = ((-1) ** j
* pochhammer_mod(1 - ell, j, p)
* pochhammer_mod(n - ell + 1, j, p))
denominator = pochhammer_mod(1 - 2 * ell, j, p)
factorial = 1
for factor in range(1, j + 1):
factorial = factorial * factor % p
denominator = denominator * factorial % p
G.append(numerator * pow(int(denominator), -1, p) % p)
H = [comb(n + 1, a) % p for a in range(n + 2)]
H[0] = (H[0] - 1) % p
H[1] = (H[1] - 1) % p
raw = [0] * (len(H) + len(G) - 1)
for i, left in enumerate(H):
for j, right in enumerate(G):
raw[i + j] = (raw[i + j] + left * right) % p
scale = pow(int(raw[ell]), -1, p)
return [(value * scale) % p for value in raw]
def shadow_code_audit(p, exhaustive=True):
n = (p - 1) // 2
Q0 = sorted(quadratic_residues(p))
H = [q for q in Q0 if q]
N = [x for x in range(1, p) if x not in H]
D = [(tau, (q - tau) % p) for tau in H for q in Q0]
weighted = [
(j, a)
for j in range(n + 1)
for a in range(2 * n - 2 * j + 1)
]
D_eval = evaluate_monomials(D, weighted, p)
kernel = gf_nullspace(D_eval, p)
slice_eval = evaluate_monomials([(0, x) for x in range(p)], weighted, p)
U = kernel @ slice_eval.T % p
triangle_columns = [
index for index, (j, a) in enumerate(weighted) if 2 * j + a <= 2 * n - 1
]
assert len(triangle_columns) == n * (n + 1)
assert gf_rank(D_eval[:, triangle_columns], p) == n * (n + 1)
assert gf_rank(U, p) == n + 1
V = [np.ones(p, dtype=np.int64)]
for ell in range(1, n + 1):
coefficient = 2 * ell * pow(2 * ell - 1, -1, p) % p
V.append(np.array([
(pow(x, ell, p) - coefficient * pow(x, n + ell, p)) % p
for x in range(p)
], dtype=np.int64))
V = np.array(V, dtype=np.int64)
assert gf_rank(V, p) == n + 1
assert row_spaces_equal(U, V, p)
for ell in range(1, n + 1):
coeff = shadow_lift_coefficients(p, ell)
assert all(coeff[a] == 0 for a in range(ell + 1, 2 * ell))
assert coeff[n + ell] == (-2 * ell * pow(2 * ell - 1, -1, p)) % p
for tau, x in D:
value = 0
for a in range(1, ell + 1):
value += coeff[a] * pow(tau, ell - a, p) * pow(x, a, p)
for a in range(2 * ell, n + ell + 1):
value += coeff[a] * pow(tau, n + ell - a, p) * pow(x, a, p)
assert value % p == 0
minimum = None
if exhaustive:
minimum = p
for coefficients in product(range(p), repeat=n + 1):
if not any(coefficients):
continue
word = np.array(coefficients, dtype=np.int64) @ V % p
minimum = min(minimum, int(np.count_nonzero(word)))
assert minimum >= 3
T = np.array([
[8 * r * (r + s) * pow((r - s) % p, -2, p) % p for s in H]
for r in N
], dtype=np.int64)
if p == 5:
assert np.array_equal(T, np.array([[3, 4], [4, 3]]))
if p == 7:
assert np.array_equal(T, np.array([[3, 1, 0], [1, 0, 3], [0, 3, 1]]))
return U, minimum
def body_decomposition_audit(p, U):
n = (p - 1) // 2
Q0 = sorted(quadratic_residues(p))
body = [
(x0, (q1 - x0 * x0) % p, (q2 - x0 * x0) % p)
for x0 in range(1, p)
for q1, q2 in product(Q0, repeat=2)
]
exponents = total_degree_exponents(3, 2 * n)
body_eval = evaluate_monomials(body, exponents, p)
W = gf_nullspace(body_eval, p)
assert W.shape[0] == p
plane = list(product(range(p), repeat=2))
plane_eval = evaluate_monomials([(0, x1, x2) for x1, x2 in plane],
exponents, p)
rho = W @ plane_eval.T % p
sum_code = np.array(
[[word[x1] for x1, x2 in plane] for word in U]
+ [[word[x2] for x1, x2 in plane] for word in U],
dtype=np.int64,
)
assert gf_rank(rho, p) == p
assert gf_rank(sum_code, p) == p
assert row_spaces_equal(rho, sum_code, p)
return len(body), len(exponents), gf_rank(rho, p)
def certificate_support(p, d):
Q0 = sorted(quadratic_residues(p))
plane = [(0,) + tail for tail in product(range(p), repeat=d - 1)]
body = [
(x0,) + tuple((q - x0 * x0) % p for q in qs)
for x0 in range(1, p)
for qs in product(Q0, repeat=d - 1)
]
support = set()
excluded = {pow(2, -1, p), (-pow(2, -1, p)) % p}
for point in plane + body:
x0, last = point[0], point[-1]
value = x0 * last % p
for c in range(1, p):
if c in excluded:
continue
value = value * (
x0 + c * last - pow(4 * c % p, -1, p)
) % p
if value:
support.add(point)
return support
audit_rows = []
for p in [5, 7]:
U, dU = shadow_code_audit(p)
body_size, polynomial_dimension, rho_dimension = body_decomposition_audit(p, U)
support = certificate_support(p, 3)
assert len(support) == p + 1
audit_rows.append((p, dU, body_size, polynomial_dimension, rho_dimension,
len(support)))
for p in [11]:
U, dU = shadow_code_audit(p, exhaustive=False)
support = certificate_support(p, 3)
assert len(support) == p + 1
audit_rows.append((p, dU, 'not expanded', 'not expanded', 'not expanded',
len(support)))
for p in [3, 5, 7]:
for d in [3, 4, 5]:
S = (p + 1) // 2
candidates = []
for a0 in range(p - 1):
for transverse in product(range(S), repeat=d - 1):
if a0 + 2 * sum(transverse) <= 2 * (p - 2):
candidates.append(
(p - 1 - a0)
* np.prod([S - a for a in transverse], dtype=np.int64)
)
assert min(candidates) == 2 * S ** (d - 2)
p3_cone = (
[(0, x1, x2) for x1, x2 in product(range(3), repeat=2)]
+ [
(x0, (q1 - x0 * x0) % 3, (q2 - x0 * x0) % 3)
for x0 in [1, 2]
for q1, q2 in product(sorted(quadratic_residues(3)), repeat=2)
]
)
assert sum((x1 * (x1 + 1)) % 3 != 0 for _, x1, _ in p3_cone) == 3
print('Polynomial-distance audits (p, d(U), |B|, polynomial dimension, '
'dim rho(W), certificate weight):')
print(audit_rows)
Saved output 1
Polynomial-distance audits (p, d(U), |B|, polynomial dimension, dim rho(W), certificate weight): [(5, 3, 36, 35, 5, 6), (7, 3, 96, 84, 7, 8), (11, None, 'not expanded', 'not expanded', 'not expanded', 12)]
Station Reference. The explicit certificate and body-footprint proof originate in Archives #124 and #126. The dimension-three proof is reconstructed from Archives #127, #128, #130, #132, #142, #145, and #147. These identifiers record the provenance of the proof above.
Related Work. The Cartesian-grid footprint bound and the full-grid Schwartz–Zippel bound are classical; see Geil and Høholdt (2000) and Dvir (2009). Here these bounds are combined with an explicit upper certificate and a separate dimension-three analysis to obtain equality. The exact distance formula for this quadratic-residue support appears to be new.
6.2 Exact inversion-map shear profile
We determine the image size of every shear and use it to compute the normalized second moment exactly. For , all nonzero shears have the same image size; for , their image sizes differ by one according to the quadratic character of . The proof reduces the image count to a quadratic discriminant calculation, revealing the precise role of the secant geometry of the inversion conic in this one-pole completion.
Let and for . Put , , , , and, when ,
Theorem 6.11.
Proof. At , inversion is a bijection, so and . For and , a value is attained precisely when
has a solution. Its discriminant is . The identity
follows by counting the solutions of . Therefore the image from nonzero has size . The separately supplied value is already present exactly when is soluble.
If , square gives and nonsquare gives . Hence and
If , every nonzero has , so and . Substitution gives the two formulas.
The next cell evaluates the shear profile directly at every odd prime from through and checks the two exact formulas according to .
Show code
Code cell 26 · In [9]
def inversion_rho(p: int):
inv = [0] + [pow(x, -1, p) for x in range(1, p)]
S = (p + 1) // 2
deltas = []
for t in range(p):
P_t = len({(inv[x] + t * x) % p for x in range(p)})
deltas.append(P_t - S)
E = sum(deltas)
return Fraction(sum(delta * delta for delta in deltas), 2 * (S - 1) * E), deltas
inversion_rows = []
for p in [q for q in range(5, 54, 2) if is_prime(q)]:
rho, deltas = inversion_rho(p)
expected = Fraction(p + 3, 2 * (p - 1)) if p % 4 == 3 else Fraction(1, 2)
assert rho == expected
inversion_rows.append((p, str(rho), deltas[0], sorted(set(deltas[1:]))))
print('Inversion checks (p, rho, delta_0, nonzero-slope delta values):')
print(inversion_rows)
Saved output 1
Inversion checks (p, rho, delta_0, nonzero-slope delta values): [(5, '1/2', 2, [0]), (7, '5/6', 3, [-1, 1]), (11, '7/10', 5, [-1, 1]), (13, '1/2', 6, [0]), (17, '1/2', 8, [0]), (19, '11/18', 9, [-1, 1]), (23, '13/22', 11, [-1, 1]), (29, '1/2', 14, [0]), (31, '17/30', 15, [-1, 1]), (37, '1/2', 18, [0]), (41, '1/2', 20, [0]), (43, '23/42', 21, [-1, 1]), (47, '25/46', 23, [-1, 1]), (53, '1/2', 26, [0])]
Station Reference. The inversion-map theorem and its statistic are based on Archive #72 and Eval #967.
Related Work. The maps are scalar multiples of the classical maps associated with Dickson polynomials; see Chou, Gómez-Calderón, and Mullen (1988). We combine their classical value-set structure with the shear statistic to derive the displayed closed formula.
7. Appendix verification
This section reconstructs the 25-entry literature comparison from explicit constructions and witness lines.
Write and .
7.1 Saraf–Sudan quadratic-residue construction
This is the quadratic-residue construction of Mockenhaupt and Tao (2004), in the form recorded by Saraf and Sudan (2008).
Theorem 7.1. For odd prime , define
Then is Kakeya and
Proof. The hyperplane contains a line in every direction whose first coordinate is zero. For direction , put ; the line
lies in because . There are points in , in , and in their intersection. Inclusion–exclusion gives the formula. Thus the often-quoted sum is a valid upper bound but is not the exact size of the displayed union.
7.2 Bukh–Chao recursion with full translations
The recursion is due to Bukh and Chao (2021).
Let
Starting with , recursively set
Every translation is allowed. The certificate uses two explicitly recorded special cases: complete transverse histories with every , and slice-placement histories with every . Together they improve twelve cells of the earlier column.
Theorem 7.2. Let . For every sequence with and , the set defined by (7) is Kakeya.
Proof. A graph direction has the line with anchor in , since
By induction, a witness in becomes in the translated slice. These are all remaining directions. Translation changes only the overlap, not this proof.
The code reads the complete parameters for every changed cell from the local certificate. Unchanged cells are regenerated by the earlier deterministic transverse recursion. In every case it materializes the point set and checks the displayed witnesses directly.
7.3 The KLSS image-stratum construction
This construction is due to Kopparty et al. (2011).
For , put . Define
Theorem 7.3. The set is Kakeya.
Proof. Let be nonzero and let be the last index for which . Along the line with th coordinate , choose, for ,
All later coordinates are zero, so this line lies in the th stratum.
KLSS state the convenient upper bound . The displayed strata can overlap, so the code also reports the smaller cardinality of their actual union.
7.4 The KLSS missing-digit construction
This construction is also from Kopparty et al. (2011).
Theorem 7.4. For every prime power and ,
is Kakeya and has points.
Proof. For direction , take the anchor when and otherwise. At parameter zero, . At every nonzero parameter , every coordinate of is either or the nonzero value , so . Finally, the two parts intersect only at , proving the size formula.
7.5 Sharp planar sets, products, and characteristic three
Proposition 7.5. In dimension two, Theorem 7.1 has size , the sharp value proved by Blokhuis and Mazzocca (2008). If and are Kakeya, then is Kakeya of size .
Proof. Substitution of into Theorem 7.1 gives the planar size. For a direction , synchronize witness-line parameters in the two factors; if one component is zero, hold an arbitrary point of that factor constant. This gives a line in , whose size is exactly the product.
The supplied arrays of sizes , , and are independently checked below. Only is used as an exact minimum; and are upper bounds.
7.6 Complete 25-cell comparison
The next cell reconstructs every named literature family, uses the 25 Station certificate checks from S2, and checks every AlphaEvolve integer against the commit-pinned provenance map. It then performs the baseline comparison and computes the 14-improvement, 11-tie, 0-loss tally.
Show code
Code cell 29 · In [10]
def assert_explicit_witnesses(points, witnesses, p: int, d: int):
point_set = {tuple(map(int, point)) for point in points}
directions = set(canonical_directions(p, d))
assert set(witnesses) == directions
for direction, anchor in witnesses.items():
assert line_points(anchor, direction, p) <= point_set
return len(directions)
def classical_qr_cone_with_witnesses(p: int, d: int):
Q = quadratic_residues(p)
plane = {(0,) + tail for tail in product(range(p), repeat=d - 1)}
body = {
(t,) + tail
for t in range(p)
for tail in product(range(p), repeat=d - 1)
if all((y + t * t) % p in Q for y in tail)
}
points = plane | body
inv2 = pow(2, -1, p)
witnesses = {}
for direction in canonical_directions(p, d):
if direction[0] == 0:
witnesses[direction] = (0,) * d
else:
witnesses[direction] = (0,) + tuple(
(a * inv2) ** 2 % p for a in direction[1:]
)
return points, witnesses
def quadratic_graph_block(p: int, d: int):
slices = {
t: {(a * a + t * a) % p for a in range(p)}
for t in range(p)
}
points = {
(t,) + tail
for t in range(p)
for tail in product(slices[t], repeat=d - 1)
}
witnesses = {
(1,) + slopes: (0,) + tuple(a * a % p for a in slopes)
for slopes in product(range(p), repeat=d - 1)
}
return points, witnesses
def transverse_extension(p, child, child_witnesses, shift):
d = len(next(iter(child))) + 1
graph, witnesses = quadratic_graph_block(p, d)
embedded = {
(0,) + tuple((x + h) % p for x, h in zip(point, shift))
for point in child
}
witnesses.update({
(0,) + direction:
(0,) + tuple((x + h) % p for x, h in zip(anchor, shift))
for direction, anchor in child_witnesses.items()
})
return graph | embedded, witnesses
def transverse_history_set(p: int, d: int, history):
points = {(t,) for t in range(p)}
witnesses = {(1,): (0,)}
points, witnesses = transverse_extension(p, points, witnesses, (0,))
assert len(history) == d - 2
for n, shift in enumerate(history, start=3):
assert len(shift) == n - 1
points, witnesses = transverse_extension(
p, points, witnesses, tuple(shift)
)
return points, witnesses
def slice_placement_set(p: int, d: int, placements):
if d == 1:
assert len(placements) == 0
return {(t,) for t in range(p)}, {(1,): (0,)}
assert len(placements) == d - 1
c = int(placements[0])
child, child_witnesses = slice_placement_set(p, d - 1, placements[1:])
graph, witnesses = quadratic_graph_block(p, d)
embedded = {(c,) + point for point in child}
witnesses.update({
(0,) + direction: (c,) + anchor
for direction, anchor in child_witnesses.items()
})
return graph | embedded, witnesses
def greedy_transverse_set(p: int, d: int):
if d == 1:
return {(t,) for t in range(p)}, {(1,): (0,)}, []
child, child_witnesses, history = greedy_transverse_set(p, d - 1)
Q_grid = list(product(sorted(quadratic_residues(p)), repeat=d - 1))
overlap_counts = Counter(
tuple((s - x) % p for s, x in zip(square_point, child_point))
for child_point in child
for square_point in Q_grid
)
maximum = max(overlap_counts.values())
shift = min(h for h, value in overlap_counts.items() if value == maximum)
points, witnesses = transverse_extension(p, child, child_witnesses, shift)
return points, witnesses, history + [shift]
def klss_image_strata(p: int, d: int):
image = {
t: {(x * x + t * x) % p for x in range(p)}
for t in range(p)
}
points = set()
for j in range(d):
for t in range(p):
for prefix in product(image[t], repeat=j):
points.add(prefix + (t,) + (0,) * (d - j - 1))
witnesses = {}
for direction in canonical_directions(p, d):
j = max(i for i, value in enumerate(direction) if value)
inv_last = pow(int(direction[j]), -1, p)
anchor = tuple(
(int(direction[i]) * inv_last) ** 2 % p for i in range(j)
) + (0,) * (d - j)
witnesses[direction] = anchor
return points, witnesses
def missing_digit_set(p: int, d: int):
nonzero = set(product(range(1, p), repeat=d))
binary = set(product((0, 1), repeat=d))
points = nonzero | binary
witnesses = {
direction: tuple(1 if value == 0 else 0 for value in direction)
for direction in canonical_directions(p, d)
}
return points, witnesses
CERTIFICATE_HASHES = {
'benchmark_25_cells.json':
'286014dfc5d7899dd83b0d7ab102b0e5807236a72e34d1f4b7fe64bf049d78f6',
'literature_nested_shift_improvements.json':
'89311a8f76b855878a5a1f88a79c6ff34a1b4e87cb2636afadc5a70df09154c7',
'station_point_certificates.json':
'f19d7b03cfdd5956386f2ef4ef2aa41009783ba0b5137d8b54d0ec360b22afad',
'alphaevolve_provenance.json':
'eb140c6f3a164e2c3ac6489f8dd932d1757cd8f671f466dbbfef5122bf31dc0a',
}
certificate_data = {}
for filename, expected_hash in CERTIFICATE_HASHES.items():
path = ARTIFACT_DIR / filename
if not path.is_file():
raise FileNotFoundError(f'Required certificate is missing: {path}')
assert hashlib.sha256(path.read_bytes()).hexdigest() == expected_hash
certificate_data[filename] = json.loads(path.read_text())
assert station_manifest['benchmark_sha256'] == CERTIFICATE_HASHES['benchmark_25_cells.json']
benchmark_rows = certificate_data['benchmark_25_cells.json']['rows']
assert len(benchmark_rows) == 25
benchmark = {
(d, p): {'literature': literature, 'ae': ae, 'station': station}
for d, p, literature, ae, station in benchmark_rows
}
improvement_rows = certificate_data[
'literature_nested_shift_improvements.json'
]['improvements']
improvements = {(row['d'], row['p']): row for row in improvement_rows}
assert len(improvements) == 12
alphaevolve_provenance = certificate_data['alphaevolve_provenance.json']
alphaevolve_values = {(row['d'], row['p']): row['size']
for row in alphaevolve_provenance['records']}
assert len(alphaevolve_values) == 25
assert alphaevolve_values == {(d, p): ae for d, p, _, ae, _ in benchmark_rows}
assert alphaevolve_provenance['official_notebook'].startswith('https://github.com/google-deepmind/')
small_arrays = {}
for filename, p, d, size in [
('kakeya_F3_d3_13.npy', 3, 3, 13),
('kakeya_F3_d4_27.npy', 3, 4, 27),
('kakeya_F3_d5_53.npy', 3, 5, 53),
]:
path = ARTIFACT_DIR / filename
if not path.is_file():
raise FileNotFoundError(f'Required certificate is missing: {path}')
assert hashlib.sha256(path.read_bytes()).hexdigest() == DATA_HASHES[filename]
array = np.load(path, allow_pickle=False)
assert_point_certificate(array, p, d, size)
small_arrays[d] = {tuple(map(int, row)) for row in array}
def selected_literature_set(d: int, p: int):
if p == 3 and d in (3, 4):
points = small_arrays[d]
return points, find_kakeya_witnesses(points, p, d), 'finite p=3 certificate'
if p == 3 and d == 5:
points, witnesses = missing_digit_set(p, d)
return points, witnesses, 'missing-digit construction'
if (d, p) in improvements:
row = improvements[(d, p)]
if row['method'] == 'transverse_shift_history':
points, witnesses = transverse_history_set(p, d, row['parameters'])
elif row['method'] == 'slice_placement_history':
points, witnesses = slice_placement_set(p, d, row['parameters'])
else:
raise AssertionError(f"Unknown method: {row['method']}")
return points, witnesses, row['method']
points, witnesses, _ = greedy_transverse_set(p, d)
return points, witnesses, 'greedy transverse recursion (unchanged cell)'
literature_checks = []
for (d, p), reported in benchmark.items():
points, witnesses, method = selected_literature_set(d, p)
direction_count = assert_explicit_witnesses(points, witnesses, p, d)
assert len(points) == reported['literature'], (
d, p, len(points), reported['literature']
)
literature_checks.append((d, p, len(points), direction_count, method))
family_checks = []
for d, p, _, _, _ in benchmark_rows:
classical, classical_witnesses = classical_qr_cone_with_witnesses(p, d)
assert len(classical) == (p - 1) * ((p + 1) // 2) ** (d - 1) + p ** (d - 1)
assert_explicit_witnesses(classical, classical_witnesses, p, d)
strata, strata_witnesses = klss_image_strata(p, d)
assert len(strata) <= p * sum(((p + 1) // 2) ** j for j in range(d))
assert_explicit_witnesses(strata, strata_witnesses, p, d)
missing, missing_witnesses = missing_digit_set(p, d)
assert len(missing) == (p - 1) ** d + 2 ** d - 1
assert_explicit_witnesses(missing, missing_witnesses, p, d)
family_checks.append((d, p, len(classical), len(strata), len(missing)))
for p in sorted({p for _, p, _, _, _ in benchmark_rows}):
planar, planar_witnesses = classical_qr_cone_with_witnesses(p, 2)
assert len(planar) == p * (p + 1) // 2 + (p - 1) // 2
assert_explicit_witnesses(planar, planar_witnesses, p, 2)
product_3_5 = {a + b for a in small_arrays[3] for b in small_arrays[5]}
assert len(product_3_5) == 13 * 53
assert len(find_kakeya_witnesses(product_3_5, 3, 8)) == (3**8 - 1) // 2
before_after = [
(row['d'], row['p'], row['before'], row['after'])
for row in improvement_rows
]
assert all(benchmark[(d, p)]['literature'] == after for d, p, _, after in before_after)
verdicts = []
for row in benchmark.values():
prior = min(row['literature'], row['ae'])
verdicts.append(prior - row['station'])
assert (
sum(value > 0 for value in verdicts),
sum(value == 0 for value in verdicts),
sum(value < 0 for value in verdicts),
) == (14, 11, 0)
print('Verified selected literature sets (d, p, points, directions, method):')
for row in literature_checks:
print(row)
print('Before/after literature-reference corrections:')
for row in before_after:
print(row)
print('Verified all named uniform families at all 25 cells.')
print('Verified all 25 Station point sets and every supplied witness line.')
print('Matched all 25 AlphaEvolve integers to the commit-pinned official notebook map.')
print('Verified finite p=3 sizes:', {d: len(points) for d, points in small_arrays.items()})
print('Verified |K_3 x K_5| in dimension 8:', len(product_3_5))
print('Benchmark tally: 14 strictly better, 11 ties, 0 worse.')
Saved output 1
Verified selected literature sets (d, p, points, directions, method):
(3, 3, 13, 13, 'finite p=3 certificate')
(3, 5, 53, 31, 'greedy transverse recursion (unchanged cell)')
(3, 7, 129, 57, 'greedy transverse recursion (unchanged cell)')
(3, 11, 440, 133, 'greedy transverse recursion (unchanged cell)')
(3, 13, 698, 183, 'slice_placement_history')
(3, 19, 2034, 381, 'greedy transverse recursion (unchanged cell)')
(3, 23, 3509, 553, 'greedy transverse recursion (unchanged cell)')
(3, 29, 6837, 871, 'greedy transverse recursion (unchanged cell)')
(3, 31, 8295, 993, 'greedy transverse recursion (unchanged cell)')
(3, 37, 13866, 1407, 'slice_placement_history')
(3, 41, 18708, 1723, 'slice_placement_history')
(3, 43, 21504, 1893, 'greedy transverse recursion (unchanged cell)')
(3, 47, 27899, 2257, 'greedy transverse recursion (unchanged cell)')
(3, 53, 39686, 2863, 'slice_placement_history')
(4, 3, 27, 40, 'finite p=3 certificate')
(4, 5, 163, 156, 'transverse_shift_history')
(4, 7, 528, 400, 'transverse_shift_history')
(4, 11, 2689, 1464, 'greedy transverse recursion (unchanged cell)')
(4, 13, 4972, 2380, 'transverse_shift_history')
(4, 17, 13521, 5220, 'slice_placement_history')
(4, 19, 20586, 7240, 'transverse_shift_history')
(5, 3, 63, 121, 'missing-digit construction')
(5, 5, 497, 781, 'transverse_shift_history')
(5, 7, 2142, 2801, 'transverse_shift_history')
(5, 11, 16307, 16105, 'transverse_shift_history')
Before/after literature-reference corrections:
(3, 13, 699, 698)
(3, 37, 13867, 13866)
(3, 41, 18709, 18708)
(3, 53, 39687, 39686)
(4, 5, 164, 163)
(4, 7, 529, 528)
(4, 13, 4973, 4972)
(4, 17, 13524, 13521)
(4, 19, 20593, 20586)
(5, 5, 503, 497)
(5, 7, 2145, 2142)
(5, 11, 16348, 16307)
Verified all named uniform families at all 25 cells.
Verified all 25 Station point sets and every supplied witness line.
Matched all 25 AlphaEvolve integers to the commit-pinned official notebook map.
Verified finite p=3 sizes: {3: 13, 4: 27, 5: 53}
Verified |K_3 x K_5| in dimension 8: 689
Benchmark tally: 14 strictly better, 11 ties, 0 worse.
Result and table provenance
For the AlphaEvolve column, alphaevolve_provenance.json maps each integer to the displayed constructor in the official commit-pinned notebook. The integers are obtained by executing the indicated constructor, deduplicating its returned points, and counting them; the notebook’s sub-unit random score jitter is not part of the cardinality. All 25 integers were independently replayed from that source.