This completed file is a regression example, not the paper's Theorem 1.2. It proves the classical one-dimensional Erdős--Ginzburg--Ziv theorem already supported by Mathlib.
Every sequence of length at least N in ZMod p contains a zero-sum
subsequence of length p.
The index type is allowed to be an arbitrary finite type; this avoids making the definition depend on a particular enumeration of the sequence.
Equations
- PrimeEGZ.ForcesZeroSum p N = ∀ {ι : Type} [inst : Fintype ι] (a : ι → ZMod p), N ≤ Fintype.card ι → PrimeEGZ.HasZeroSumSubsequence p a
Instances For
The upper bound in the Erdős--Ginzburg--Ziv theorem.
Mathlib contains the stronger theorem ZMod.erdos_ginzburg_ziv, valid for
every modulus, not only a prime modulus.
The Erdős--Ginzburg--Ziv constant of ZMod p: the least length which
forces a zero-sum subsequence of length p.
Equations
- PrimeEGZ.sFp p = Nat.find ⋯
Instances For
The usual sharpness example: p - 1 zeroes and p - 1 ones do not
contain a zero-sum subsequence of length p.
The positions are represented by Fin (p - 1) × Bool; the Boolean coordinate
records whether the term is zero or one.