Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Schur colourings of [1,N][1, N][1,N] and the colour neighbourhoods of their difference colouring: central and endpoint neighbourhoods

Definition
ClassicalSchurColoring

by mysticflounder · Oct 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

additive-combinatoricscombinatoricsramsey-theoryschur-frontier-s6schur-numberssum-free-sets

This bundle defines Schur colourings of an initial interval and three neighbourhood sets of the difference colouring that a Schur colouring induces. All frontier theorems of the mission are stated with them.

Throughout, N={0,1,2,… }\mathbb{N} = \{0, 1, 2, \dots\}N={0,1,2,…}, [a,b]={a,a+1,…,b}[a, b] = \{a, a+1, \dots, b\}[a,b]={a,a+1,…,b}, and for n∈Nn \in \mathbb{N}n∈N the nnn colours are the elements 0,1,…,n−10, 1, \dots, n-10,1,…,n−1 of Fin n\mathrm{Fin}\,nFinn. The difference colouring of a colouring c:N→Fin nc : \mathbb{N} \to \mathrm{Fin}\,nc:N→Finn gives a pair {x,y}\{x, y\}{x,y} of distinct naturals the colour c(∣x−y∣)c(|x - y|)c(∣x−y∣).

  1. Let N,n∈NN, n \in \mathbb{N}N,n∈N and c:N→Fin nc : \mathbb{N} \to \mathrm{Fin}\,nc:N→Finn. The colouring ccc is a Schur colouring of [1,N][1, N][1,N] (Lean SchurColoring N c) if there are no x,y≥1x, y \ge 1x,y≥1 with x+y≤Nx + y \le Nx+y≤N and c(x)=c(y)=c(x+y)c(x) = c(y) = c(x + y)c(x)=c(y)=c(x+y). The case x=yx = yx=y is included.
  2. For a finite set V⊆NV \subseteq \mathbb{N}V⊆N, a point v∈Nv \in \mathbb{N}v∈N and a colour iii, the colour-iii neighbourhood of vvv in VVV (Lean colorNbhd c V v i) is
Γi(V,v)={ w∈V:w≠v, c(∣v−w∣)=i }.\Gamma_i(V, v) = \{\, w \in V : w \ne v,\ c(|v - w|) = i \,\}.Γi​(V,v)={w∈V:w=v, c(∣v−w∣)=i}.
  1. For m∈Nm \in \mathbb{N}m∈N, the central neighbourhood (Lean centralNbhd c m) is the neighbourhood of the centre mmm of [0,2m+1][0, 2m+1][0,2m+1] in the colour c(m+1)c(m+1)c(m+1) of its pair with the endpoint 2m+12m + 12m+1:
Vm=Γc(m+1)([0,2m+1], m)={ x∈[0,2m+1]:x≠m, c(∣m−x∣)=c(m+1) }.V_m = \Gamma_{c(m+1)}\bigl([0, 2m+1],\, m\bigr) = \{\, x \in [0, 2m+1] : x \ne m,\ c(|m - x|) = c(m+1) \,\}.Vm​=Γc(m+1)​([0,2m+1],m)={x∈[0,2m+1]:x=m, c(∣m−x∣)=c(m+1)}.

The endpoint 2m+12m + 12m+1 is always in VmV_mVm​, because (2m+1)−m=m+1(2m+1) - m = m + 1(2m+1)−m=m+1. 4. For m∈Nm \in \mathbb{N}m∈N and a colour iii, the endpoint neighbourhood (Lean endpointNbhd c m i) is the colour-iii neighbourhood of the endpoint 2m+12m + 12m+1 inside VmV_mVm​:

Pi=Γi(Vm, 2m+1)={ x∈Vm:x≠2m+1, c(2m+1−x)=i }.P_i = \Gamma_i\bigl(V_m,\, 2m+1\bigr) = \{\, x \in V_m : x \ne 2m+1,\ c(2m + 1 - x) = i \,\}.Pi​=Γi​(Vm​,2m+1)={x∈Vm​:x=2m+1, c(2m+1−x)=i}.

For example, the three classes {1,4,7,10,13}\{1, 4, 7, 10, 13\}{1,4,7,10,13}, {2,3,11,12}\{2, 3, 11, 12\}{2,3,11,12} and {5,6,8,9}\{5, 6, 8, 9\}{5,6,8,9} form a Schur colouring of [1,13][1, 13][1,13] with three colours. For m=6m = 6m=6, the colour c(7)c(7)c(7) is the colour of {1,4,7,10,13}\{1, 4, 7, 10, 13\}{1,4,7,10,13}, so V6={2,5,7,10,13}V_6 = \{2, 5, 7, 10, 13\}V6​={2,5,7,10,13} (the points at distance 111, 444 or 777 from 666). The endpoint neighbourhood of the colour of {2,3,11,12}\{2, 3, 11, 12\}{2,3,11,12} is {2,10}\{2, 10\}{2,10} (distances 111111 and 333 from 131313), and that of the colour of {5,6,8,9}\{5, 6, 8, 9\}{5,6,8,9} is {5,7}\{5, 7\}{5,7} (distances 888 and 666).

A Schur colouring of [1,N][1, N][1,N] with nnn colours gives a cover of [1,N][1, N][1,N] by nnn sumfree sets, and for n≥1n \ge 1n≥1 such a cover gives a Schur colouring; the two bridge theorems of the mission state these two directions. The neighbourhoods VmV_mVm​ and PiP_iPi​ are the objects of the frontier analysis of the centred Schur bound: the mission determines ∣Vm∣|V_m|∣Vm​∣, the colour-iii degrees inside VmV_mVm​ for every colour i≠c(m+1)i \ne c(m+1)i=c(m+1), and the size and symmetry of PiP_iPi​ for every colour i≠c(m+1)i \ne c(m+1)i=c(m+1), for a Schur colouring of the largest interval that the centred bound does not exclude.

Formalization Note. (1) A colouring is a function on all of N\mathbb{N}N with values in Fin n; SchurColoring N c constrains only its values on [1,N][1, N][1,N]. For n=0n = 0n=0 there is no function N→Fin 0\mathbb{N} \to \mathrm{Fin}\,0N→Fin0. (2) The value c(0)c(0)c(0) never enters a neighbourhood, since w≠vw \ne vw=v gives ∣v−w∣≥1|v - w| \ge 1∣v−w∣≥1. (3) Distances are Mathlib's Nat.dist, which is ∣x−y∣|x - y|∣x−y∣ on N\mathbb{N}N. (4) Neighbourhoods are Finsets. The ambient set of VmV_mVm​ is range (2 * m + 2), that is [0,2m+1][0, 2m+1][0,2m+1], so the point 000 is a candidate member: for m≥1m \ge 1m≥1, 0∈Vm0 \in V_m0∈Vm​ if c(m)=c(m+1)c(m) = c(m+1)c(m)=c(m+1), and only then. For m=0m = 0m=0 the point 000 is the centre, and V0={1}V_0 = \{1\}V0​={1}.

Definition code
-- Generated from lean/ClassicalSchur/Midpoint.lean by skeleton
-- subtraction: every declaration except the def-material below is deleted,
-- and project imports are rewritten to their platform Definitions bundles.
import Mathlib

namespace ClassicalSchur

open Finset

/-- `c` colours `[1, N]` with no monochromatic Schur triple: there are no
`x, y ≥ 1` with `x + y ≤ N` and `c x = c y = c (x + y)`. The case `x = y` is
included. -/
def SchurColoring {n : ℕ} (N : ℕ) (c : ℕ → Fin n) : Prop :=
  ∀ x y, 0 < x → 0 < y → x + y ≤ N → c x = c y → c (x + y) ≠ c x

/-- The colour-`i` neighbourhood of `v` in `V` for the difference colouring of
`c`: the points `w ≠ v` of `V` with `c |v − w| = i`. -/
def colorNbhd {n : ℕ} (c : ℕ → Fin n) (V : Finset ℕ) (v : ℕ) (i : Fin n) : Finset ℕ :=
  (V.erase v).filter fun w => c (Nat.dist v w) = i

/-- The neighbourhood of the centre `m` of `[0, 2m + 1]` in the colour
`c (m + 1)` of its edge to the endpoint `2m + 1`. -/
def centralNbhd {n : ℕ} (c : ℕ → Fin n) (m : ℕ) : Finset ℕ :=
  colorNbhd c (range (2 * m + 2)) m (c (m + 1))

/-- The neighbourhood of the endpoint `2m + 1` of colour `i` inside the
central neighbourhood. -/
def endpointNbhd {n : ℕ} (c : ℕ → Fin n) (m : ℕ) (i : Fin n) : Finset ℕ :=
  colorNbhd c (centralNbhd c m) (2 * m + 1) i

end ClassicalSchur
Source
A. McKenna, "S(6) ≤ 1801 if R₄(3) ≤ 61: a centred Schur bound and the structure at the frontier", Zenodo (2026), https://doi.org/10.5281/zenodo.23156099, §2 (Schur colourings, with x = y allowed; the difference colouring; the colour neighbourhoods Γ_i(v; V)), §4.2 (the central neighbourhood V = Γ_q(m; [0, 2m + 1]) with q = c(m + 1)) and §4.5 (the endpoint neighbourhoods P_i = Γ_i(2m + 1; V)). Lean source: https://github.com/mysticflounder/schur-centred-bound/blob/v1.0.1/ClassicalSchur/Frontier.lean#L58-L62 and https://github.com/mysticflounder/schur-centred-bound/blob/v1.0.1/ClassicalSchur/Frontier.lean#L134-L137 and https://github.com/mysticflounder/schur-centred-bound/blob/v1.0.1/ClassicalSchur/Frontier.lean#L285-L288 and https://github.com/mysticflounder/schur-centred-bound/blob/v1.0.1/ClassicalSchur/Frontier.lean#L466-L469 (release v1.0.1, doi:10.5281/zenodo.23156444).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me