Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Valid kkk-partitions and the residue-level Sm(k,ℓ)S_m(k,\ell)Sm​(k,ℓ)

Definition
ModularSchurPartition

by mysticflounder · Sep 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

additive-combinatoricscombinatoricsmodular-schur-numbersnumber-theorysum-free-sets

This bundle defines the colouring problem for modular Schur numbers at the level of residues, together with the number it computes.

Fix m≥2m \ge 2m≥2, ℓ≥2\ell \ge 2ℓ≥2 and k≥1k \ge 1k≥1. Given a target set T⊆Z/mT \subseteq \mathbb{Z}/mT⊆Z/m, a family P0,…,Pk−1P_0, \dots, P_{k-1}P0​,…,Pk−1​ of subsets of Z/m\mathbb{Z}/mZ/m is a valid kkk-partition of TTT when the PiP_iPi​ cover TTT, are pairwise disjoint, each lies inside TTT, and each is ℓ\ellℓ-sum-free modulo mmm. The residue set under consideration is

stableResidues(m,N)={ 1‾,2‾,…,N‾ }⊆Z/m,\mathrm{stableResidues}(m, N) = \{\, \overline{1}, \overline{2}, \dots, \overline{N} \,\} \subseteq \mathbb{Z}/m,stableResidues(m,N)={1,2,…,N}⊆Z/m,

the image of the integer interval [1,N][1, N][1,N] under reduction modulo mmm. The residue-level modular Schur number is the greatest N≤m−1N \le m-1N≤m−1 for which stableResidues(m,N)\mathrm{stableResidues}(m,N)stableResidues(m,N) admits a valid kkk-partition.

This is the object every bound in the mission is stated about. The cutoff at m−1m-1m−1 is not an approximation: the universal upper bound shows no larger NNN can ever succeed, so searching past m−1m-1m−1 is provably pointless.

Formalization Note The greatest such NNN is taken with Nat.findGreatest against the bound m−1m-1m−1, which makes the number total without a separate non-emptiness argument; the definition is noncomputable because the partition predicate is classical.

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

namespace ModularSchur

open Finset
variable {m : ℕ}

/-- A valid `k`-partition of a residue set `T ⊆ ZMod m` into `ℓ`-sum-free classes. -/
structure IsValidPartition (m ℓ k : ℕ) (T : Finset (ZMod m))
    (P : Fin k → Finset (ZMod m)) : Prop where
  covers     : ∀ x ∈ T, ∃ i, x ∈ P i
  disjoint   : ∀ i j, i ≠ j → Disjoint (P i) (P j)
  subset     : ∀ i, P i ⊆ T
  sumFree    : ∀ i, IsEllSumFree m ℓ (P i)

/-- The residue set of `{1,…,N}` in `ZMod m`. -/
def stableResidues (m N : ℕ) : Finset (ZMod m) :=
  (Finset.Ioc 0 N).image ((↑) : ℕ → ZMod m)

open Classical in
/-- `schurModResidue m k ℓ` = greatest `N` such that `stableResidues m N` admits
    a valid `k`-partition, bounded above by `m - 1` per Lemma 2.2. -/
noncomputable def schurModResidue (m k ℓ : ℕ) : ℕ :=
  Nat.findGreatest
    (fun N => ∃ P : Fin k → Finset (ZMod m),
      IsValidPartition m ℓ k (stableResidues m N) P) (m - 1)

end ModularSchur
Source
McKenna 2026, "Prime-power structure of the stable regime for modular Schur numbers", docs/paper/modular-schur.pdf in the same repository, Definition 1.1 with the residue counterpart of Lemma 2.1, and the N≤m−1N \le m-1N≤m−1 cap of Lemma 2.2. Lean source: https://github.com/mysticflounder/modular-schur/blob/eb6098890f05eff39190e6cd8e41fdea53fa81f9/lean/ModularSchur/Partition.lean#L38-L44

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, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me