{
  "artifactId": "artifact.library.mathlib.erdos-ginzburg-ziv-theorem.v001",
  "candidateOnly": false,
  "category": "Combinatorics and number theory",
  "claimBoundary": "This page indexes Mathlib’s finite indexed-family theorem in ZMod n. The hypothesis is 2*n−1 ≤ |s|, and the conclusion selects a subset t of exactly n distinct indices whose indexed values sum to zero. Values at different indices may repeat. The statement includes n=0 through the empty selection; it does not require exactly 2n−1 input indices, assert uniqueness, count witnesses, or provide an extraction algorithm.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem ZMod.erdos_ginzburg_ziv {ι : Type*} {n : ℕ} {s : Finset ι} (a : ι → ZMod n) (hs : 2 * n - 1 ≤ #s) : ∃ t ⊆ s, #t = n ∧ ∑ i ∈ t, a i = 0",
  "family": "Additive combinatorics and zero-sum theory",
  "id": "library.mathlib.erdos-ginzburg-ziv-theorem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/erdos-ginzburg-ziv-theorem/",
    "entryData": "/data/library-theorems/erdos-ginzburg-ziv-theorem.json",
    "evidence": "/proofs/artifact.library.mathlib.erdos-ginzburg-ziv-theorem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.erdos-ginzburg-ziv-theorem.v001.evidence.json",
    "source": "/sources/upstream/erdos-ginzburg-ziv-theorem/"
  },
  "landmark": {
    "completeFormalType": "theorem ZMod.erdos_ginzburg_ziv {ι : Type*} {n : ℕ} {s : Finset ι} (a : ι → ZMod n) (hs : 2 * n - 1 ≤ #s) : ∃ t ⊆ s, #t = n ∧ ∑ i ∈ t, a i = 0",
    "concepts": [
      "zero-sum subsequences",
      "cyclic groups",
      "indexed finite families",
      "Chevalley–Warning",
      "prime-composite induction"
    ],
    "plainLanguage": "Assign a residue modulo n to every index in a finite set. If there are at least 2n−1 indices, then some n distinct indices carry values whose sum is zero modulo n. Different indices may carry the same residue.",
    "poster": {
      "alt": "An ivory theorem poster states the at-least 2n−1 indexed-residue hypothesis, exactly-n selection, zero-sum conclusion, repeated-value boundary, n equals four example, and prime/composite proof route.",
      "byteSize": 2533826,
      "caption": "At least 2n−1 indexed residues modulo n guarantee exactly n distinct indices whose values sum to zero.",
      "description": "The poster places the exact lower-bound hypothesis, indexed selection, and ZMod n conclusion above a count-exact seven-ticket example. A source-anchored route ribbon names Chevalley–Warning for the prime case and disjoint-block factor induction for the composite case; the footer retains the at-least, n=0, uniqueness, and algorithm boundaries.",
      "derivatives": [
        {
          "byteSize": 100232,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-poster-v1-640.webp",
          "sha256": "sha256:15594c9719efb29ca6e76b1cb5c5a0fe3cff9f3f1a0be714078a6d67591942ff",
          "width": 640
        },
        {
          "byteSize": 217176,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-poster-v1-1024.webp",
          "sha256": "sha256:d0b67c56b2afd411496910fe7f630563dc2e141d8c083847b83b610d98e6aeaa",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-25T16:28:27.717136680-04:00",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-poster-v1.png",
      "sha256": "sha256:45fbf88ad325a7539c007aef3fd88150cb4a6fa800140ba043ed38031b4f4930",
      "title": "Erdős–Ginzburg–Ziv Theorem at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "ADDITIVE COMBINATORICS · ZERO-SUM SELECTION\nERDŐS–GINZBURG–ZIV THEOREM\nAT LEAST 2n−1 INDEXED RESIDUES IN ZMod n\nSELECT EXACTLY n DISTINCT INDICES\nTHEIR VALUES SUM TO 0 IN ZMod n\nREPEATED VALUES ARE ALLOWED\nn = 4 EXAMPLE\n1 · 1 · 2 · 3 · 3 · 0 · 2\n1 + 1 + 3 + 3 = 0 in ZMod 4\nTHE CHECKED ROUTE\nPRIME · CHEVALLEY–WARNING\nCOMPOSITE · DISJOINT BLOCKS + FACTOR INDUCTION\nEXACT SCOPE\nAt least 2n−1 indices, not exactly.\nIncludes n=0 via the empty selection.\nNo uniqueness or algorithm is asserted."
    },
    "visual": {
      "alt": "Seven indexed residue tickets form an n equals four example; exactly four tickets with values one, one, three, and three are selected and collected to zero modulo four, above prime and composite proof-route motifs.",
      "byteSize": 2854593,
      "caption": "From 2n−1 indexed residues, the theorem selects exactly n indices whose values sum to zero; repeated values at different indices are allowed.",
      "description": "A count-exact n=4 example shows seven indexed tickets with values 1, 1, 2, 3, 3, 0, 2. Gold double frames and check notches select exactly indices 1, 2, 4, and 5, and a brace verifies 1+1+3+3 is congruent to zero modulo 4. A lower band distinguishes the prime Chevalley–Warning route from the composite disjoint-block induction.",
      "derivatives": [
        {
          "byteSize": 44336,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-schematic-v1-640.webp",
          "sha256": "sha256:9c08de16dd3e51ca6808af8e1ec87564bdfefef182f17a144778d73580d34d8f",
          "width": 640
        },
        {
          "byteSize": 138616,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:0fbd63e2cbb0caf60190583497bc26f1785fb07d4ed8cd0d9ab2814c9b409509",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-25T16:28:27.717136680-04:00",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/erdos-ginzburg-ziv-theorem/theorem-schematic-v1.png",
      "sha256": "sha256:ba1357a644a8c3a9b78e1ad858b10798d2a6c18f81f1bb7afec804b94a594005",
      "title": "Exactly n indexed residues make a zero sum",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "The Erdős–Ginzburg–Ziv theorem is a foundational zero-sum selection principle. Mathlib’s route also exposes a striking proof architecture: Chevalley–Warning supplies the prime case, while induction over prime and composite factors assembles disjoint zero-sum blocks for general n."
  },
  "nonClaims": [
    "Proof Atlas did not originate the Erdős–Ginzburg–Ziv theorem or Mathlib’s declaration.",
    "The selected declaration is an indexed-family statement; it does not require the residue values themselves to be distinct.",
    "The hypothesis is a lower bound on the number of indices, not an exact-length requirement.",
    "The declaration does not assert uniqueness, count valid selections, or supply an extraction algorithm.",
    "The generated explanation and visuals are not proof evidence."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.erdos-ginzburg-ziv-theorem.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "Current public presentation reviewed",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "Among at least 2n−1 indexed residues modulo n, exactly n indices can be selected whose values sum to zero.",
  "targetId": "target.library.mathlib.erdos-ginzburg-ziv-theorem.v001",
  "title": "Erdős–Ginzburg–Ziv Theorem",
  "upstreamOrigin": {
    "declarationName": "ZMod.erdos_ginzburg_ziv",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean#L184",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:13f8adfc07c9cffd89a0c2a2d3c265348b698fbf724d8b74e6de39434bbc79f7",
    "sourceByteLength": 10923,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean",
    "sourceLine": 184,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
