Import bannai-bannai-stanton: bound on distance sets#243
Conversation
Vendors AntoineduFresne/Bannai-Bannai-Stanton_Theorem (Apache-2.0): the
Bannai-Bannai-Stanton bound |S| <= choose(d+s,s) for a distance set S in R^d
with s distinct distances, via the Petrov-Pohoata polynomial-method proof and a
generalized Croot-Lev-Pach lemma. Wrapped in the BannaiBannaiStanton namespace;
sorry-free, axioms = {propext, Classical.choice, Quot.sound}.
Proof profile (new / modified Lean files)
This is the parallel build wall clock and is the compile-time answer for this PR. The serial per-file sums below are useful for ranking slow files, not as a build budget. Total heartbeats: 118 maxHeartbeats units across 2 files (1,055 added LOC). Sum of Count-heartbeats wall-clock total: 8.64 s. Repeated import cost inside Heartbeat values come from Mathlib's LOC counts added lines in the profiled Lean files from this PR diff.
Aggregate phase totals
Slowest changed modules (from
|
| Changed module | Lake time |
|---|---|
LeanPool.BannaiBannaiStanton.BoundOnDistanceSet |
9.70 s |
LeanPool.BannaiBannaiStanton |
1.60 s |
Per-file `lean --profile` output
LeanPool/BannaiBannaiStanton.lean
import took 1.43s
cumulative profiling times:
elaboration 0.18ms
import 1.43s
initialization 30.7ms
interpretation 171ms
linting 0.267ms
module linting 0.00105ms
overlappingInstancesLinter 0.193ms
parsing 0.0571ms
tacticAnalysis 1.45ms
real 2.36
user 1.30
sys 0.99
LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean
import took 1.45s
simp took 131ms
simp took 138ms
typeclass inference of Nonempty took 161ms
typeclass inference of Nonempty took 163ms
typeclass inference of Nonempty took 162ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Convert___elabRules_Mathlib_Tactic_convert_1._boxed took 109ms
simp took 201ms
typeclass inference of Nonempty took 161ms
simp took 133ms
cumulative profiling times:
attribute application 0.782ms
compilation (IR) 0.232ms
compilation (LCNF base) 2.56ms
compilation (LCNF impure) 1.19ms
compilation (LCNF mono) 2.11ms
congr simp thm 59.8ms
dsimp 11.2ms
elaboration 356ms
fix level params 19.3ms
import 1.45s
initialization 37.6ms
instantiate metavars 44.7ms
interpretation 1.57s
let-to-have transformation 56ms
linting 130ms
module linting 0.00108ms
norm_num 14.2ms
overlappingInstancesLinter 33.4ms
parsing 65.9ms
process pre-definitions 96.3ms
ring 110ms
share common exprs 85.7ms
simp 2.36s
tactic execution 2.48s
tacticAnalysis 183ms
type checking 675ms
typeclass inference 7.54s
real 6.52
user 16.74
sys 1.11
Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.
🤖 LLM review (
|
| Aspect | Value |
|---|---|
| Fit | ✅ good_fit |
| Level | research |
| Branch | discrete geometry |
| Mode | theory_building |
| Obscure problem | no |
| Code quality | 3 / 5 |
The contribution is a completed formalization of the Bannai-Bannai-Stanton polynomial-method bound on the size of Euclidean distance sets.
Findings (1)
- source-anchor —
LeanPool/BannaiBannaiStanton.lean:11
The project card lists the source as the formalization GitHub repository; add a mathematical citation for the Bannai-Bannai-Stanton theorem and/or the Petrov-Pohoata proof being followed, preferably with title, authors, and publication/arXiv data. The GitHub repo can remain as provenance, but it should not be the only source anchor.
Tokens: 19,979 in / 1,906 out · Tier: flex · Cost: $0.0785
Automated review against .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
Vendors AntoineduFresne/Bannai-Bannai-Stanton_Theorem (Apache-2.0).
What it proves
The Bannai-Bannai-Stanton theorem: a distance set
Sin Euclidean spaceℝ^dthat realizessdistinct distances has size at mostNat.choose (d + s) s(BannaiBannaiStanton.bannai_bannai_stanton_bound : S.encard ≤ Nat.choose (d + s) s). The proof follows the short polynomial-method argument of Petrov and Pohoata via a generalized Croot-Lev-Pach rank lemma, with auxiliary results on diagonal linear-independence of polynomials, monomial counting of bounded degree, and a rank bound for sums of matrices.Import notes
v4.32.0-rc1), builds warning-free against Mathlib with no API changes needed.BannaiBannaiStantonnamespace (upstream used root-levelsections — a whole-pool collision risk;dim,distancesetc. would clash). Renamed the oneSet.distancesextension todistanceSetand a handful of underscoreddefs to camelCase to satisfy the naming linter; theorem statements are preserved verbatim.#print axioms bannai_bannai_stanton_bound={propext, Classical.choice, Quot.sound}.All local gates pass: warning-free
lake build,mk_all --check,runLinter,lint-style, and the quality checker.