Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Formalized on 26 Nov 2026]

Title:Largest cap set in F37\mathbb{F}_3^7

Source:Record races · doi.org/10.1007/BF01388452
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Find a set A⊆F37A \subseteq \mathbb{F}_3^7 with no three distinct points on a line (equivalently, no distinct x,y,z∈Ax, y, z \in A with x+y+z=0x + y + z = 0) that is as large as possible. The best known cap has 236 points (Calderbank–Fishburn (1994)); upper bound 291 (computer-assisted, unrefereed). Stated with Mathlib's ThreeAPFree; the equivalence with "no three collinear points" is proved in the challenge's tests.

Subjects:Combinatorics (math.CO)
Tags:challenge, cap set, additive combinatorics
Cite as:NS.09242 [math.CO] · NS.09242v1 for this version
Declaration:CapSetF3Dim7.correct
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 100; accepted critique: up to 100
Statement hash:31aa8b5809f350c72a605c115e4c600d2335bd3b887730ebaf3e5396cfadd67a
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · nosorry record challenges (formalized with AI agents, refereed)

Formal statement

theorem correct : ThreeAPFree ((answerCap : Finset (Fin 7 → ZMod 3)) : Set (Fin 7 → ZMod 3))
Show the full Challenge.lean (47 lines) — definitions included
import Mathlib

/-!
# Large cap sets in `𝔽₃^7` (record challenge, maximize)

A *cap set* in the affine space `𝔽₃ⁿ` is a set of points no three of which are collinear.
In `𝔽₃ⁿ` a line has exactly three points `x, x + d, x + 2d` (`d ≠ 0`), and three distinct points
`x, y, z` are collinear iff `x + y + z = 0`. So a cap set is exactly a set with no non-trivial
3-term arithmetic progression, i.e. Mathlib's `ThreeAPFree` (`a + c = b + b → a = b`).
The equivalence of `ThreeAPFree` with "no three distinct collinear points" (Mathlib's
`Collinear` over the field `ZMod 3`), with "no pairwise distinct `x, y, z` with `x + y + z = 0`"
and with "contains no line `{x, x + d, x + 2 • d}`" is proved in `Tests.lean`
(`threeAPFree_iff_no_collinear`, `threeAPFree_iff_no_distinct_sum_zero`,
`threeAPFree_iff_no_line`).

Task: give a cap set in `𝔽₃^7` that is as large as possible. The score is its cardinality.

The space `𝔽₃^7` is modelled as `Fin 7 → ZMod 3` (the same type as `𝔽₃ 7` in
`FormalConjecturesForMathlib.Data.ZMod.Fp`).

*References:*
- Record (236 points): A. R. Calderbank and P. C. Fishburn, *Maximal three-independent subsets of
  {0,1,2}^n*, Des. Codes Cryptogr. 4 (1994), 203–211, doi:10.1007/BF01388452.
- Upper bound `291` (computer-assisted, unrefereed): N. D. Versluis, *On the cap set problem:
  upper bounds on maximal cardinalities of caps in dimensions seven to ten*, Bachelor thesis,
  TU Delft, 2017. The exact maximum is known only for `n ≤ 6` (`112` for `n = 6`:
  A. Potechin, *Maximal caps in AG(6,3)*, Des. Codes Cryptogr. 46 (2008), 243–259).
- Mathlib: `ThreeAPFree`, `Mathlib/Combinatorics/Additive/AP/Three/Defs.lean`.
-/

namespace CapSetF3Dim7

/-- The solver's construction: a finite set of points of `𝔽₃^7` (`Fin 7 → ZMod 3`).
This definition is the hole to fill. -/
def answerCap : Finset (Fin 7 → ZMod 3) := sorry

/-- `answerCap` is a cap set: no three distinct points of it lie on a line, stated with Mathlib's
`ThreeAPFree` (for all `a b c ∈ answerCap`, `a + c = b + b → a = b`). -/
theorem correct : ThreeAPFree ((answerCap : Finset (Fin 7 → ZMod 3)) : Set (Fin 7 → ZMod 3)) :=
  sorry

/-- The score: replace the hole by a natural-number literal `N` and prove `N ≤ |answerCap|`.
Higher is better (best known: 236). -/
theorem metric_bound : (sorry : ℕ) ≤ answerCap.card := sorry

end CapSetF3Dim7

To prove it: keep every definition of Challenge.lean unchanged and prove CapSetF3Dim7.correct with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_correct : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry desk capset-f3-7      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch capset-f3-7
nosorry submit capset-f3-7 nosorry/capset-f3-7/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.