File: Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean

full_name: _private.Mathlib.Combinatorics.Additive.ErdosGinzburgZiv.0.f₁
code: /-- The first multivariate polynomial used in the proof of Erdős–Ginzburg–Ziv. -/
private noncomputable def f₁ (s : Finset ι) (a : ι → ZMod p) : MvPolynomial s (ZMod p) 
goal: MvPolynomial { x // x ∈ s } (ZMod p)

full_name: _private.Mathlib.Combinatorics.Additive.ErdosGinzburgZiv.0.f₂
code: /-- The second multivariate polynomial used in the proof of Erdős–Ginzburg–Ziv. -/
private noncomputable def f₂ (s : Finset ι) (a : ι → ZMod p) : MvPolynomial s (ZMod p) 
goal: MvPolynomial { x // x ∈ s } (ZMod p)

full_name: _private.Mathlib.Combinatorics.Additive.ErdosGinzburgZiv.0.totalDegree_f₁_add_totalDegree_f₂
code: private lemma totalDegree_f₁_add_totalDegree_f₂ {a : ι → ZMod p} :
    (f₁ s a).totalDegree + (f₂ s a).totalDegree < 2 * p - 1 
goal: (f₁ s a).totalDegree + (f₂ s a).totalDegree < 2 * p - 1

full_name: _private.Mathlib.Combinatorics.Additive.ErdosGinzburgZiv.0.ZMod.erdos_ginzburg_ziv_prime
code: /-- The prime case of the **Erdős–Ginzburg–Ziv theorem** for `ℤ/pℤ`.

Any sequence of `2 * p - 1` elements of `ZMod p` contains a subsequence of `p` elements whose sum is
zero. -/
private theorem ZMod.erdos_ginzburg_ziv_prime (a : ι → ZMod p) (hs : s.card = 2 * p - 1) :
    ∃ t ⊆ s, t.card = p ∧ ∑ i ∈ t, a i = 0 
goal: ∃ t ⊆ s, t.card = p ∧ ∑ i ∈ t, a i = 0

full_name: _private.Mathlib.Combinatorics.Additive.ErdosGinzburgZiv.0.Int.erdos_ginzburg_ziv_prime
code: /-- The prime case of the **Erdős–Ginzburg–Ziv theorem** for `ℤ`.

Any sequence of `2 * p - 1` elements of `ℤ` contains a subsequence of `p` elements whose sum is
divisible by `p`. -/
private theorem Int.erdos_ginzburg_ziv_prime (a : ι → ℤ) (hs : s.card = 2 * p - 1) :
    ∃ t ⊆ s, t.card = p ∧ ↑p ∣ ∑ i ∈ t, a i 
goal: ∃ t ⊆ s, t.card = p ∧ ↑p ∣ ∑ i ∈ t, a i

full_name: Int.erdos_ginzburg_ziv
code: /-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ`.

Any sequence of at least `2 * n - 1` elements of `ℤ` contains a subsequence of `n` elements whose
sum is divisible by `n`. -/
theorem Int.erdos_ginzburg_ziv (a : ι → ℤ) (hs : 2 * n - 1 ≤ s.card) :
    ∃ t ⊆ s, t.card = n ∧ ↑n ∣ ∑ i ∈ t, a i 
goal: ∃ t ⊆ s, t.card = n ∧ ↑n ∣ ∑ i ∈ t, a i

full_name: ZMod.erdos_ginzburg_ziv
code: /-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ/nℤ`.

Any sequence of at least `2 * n - 1` elements of `ZMod n` contains a subsequence of `n` elements
whose sum is zero. -/
theorem ZMod.erdos_ginzburg_ziv (a : ι → ZMod n) (hs : 2 * n - 1 ≤ s.card) :
    ∃ t ⊆ s, t.card = n ∧ ∑ i ∈ t, a i = 0 
goal: ∃ t ⊆ s, t.card = n ∧ ∑ i ∈ t, a i = 0

full_name: Int.erdos_ginzburg_ziv_multiset
code: /-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ` for multiset.

Any multiset of at least `2 * n - 1` elements of `ℤ` contains a submultiset of `n` elements whose
sum is divisible by `n`. -/
theorem Int.erdos_ginzburg_ziv_multiset (s : Multiset ℤ) (hs : 2 * n - 1 ≤ Multiset.card s) :
    ∃ t ≤ s, Multiset.card t = n ∧ ↑n ∣ t.sum 
goal: ∃ t ≤ s, Multiset.card t = n ∧ ↑n ∣ t.sum

full_name: ZMod.erdos_ginzburg_ziv_multiset
code: /-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ/nℤ` for multiset.

Any multiset of at least `2 * n - 1` elements of `ℤ` contains a submultiset of `n` elements whose
sum is divisible by `n`. -/
theorem ZMod.erdos_ginzburg_ziv_multiset (s : Multiset (ZMod n))
    (hs : 2 * n - 1 ≤ Multiset.card s) : ∃ t ≤ s, Multiset.card t = n ∧ t.sum = 0 
goal: ∃ t ≤ s, Multiset.card t = n ∧ t.sum = 0