Skip to content

Commit f8e8a41

Browse files
committed
feat(RingTheory/Polynomial/Cyclotomic): vanishing sums of prime roots of unity (leanprover-community#34592)
This PR adds: - `IsPrimitiveRoot.sum_eq_zero_iff_eq_coeff`: for a prime `p` and a primitive `p`-th root of unity `ζ` in a characteristic zero field, a ℚ-linear combination `∑ αᵢ ζ^i` vanishes if and only if all coefficients `αᵢ` are equal. - a variant `sum_eq_zero_iff_eq_coeff'` with integer coefficients. This is a fundamental result in algebraic number theory, following from the irreducibility of the cyclotomic polynomial over ℚ. Reference: Washington, *Introduction to Cyclotomic Fields*, Lemma 2.8.5.
1 parent 51da7e3 commit f8e8a41

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

  • Mathlib/RingTheory/Polynomial/Cyclotomic

Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,37 @@ theorem cyclotomic.isCoprime_rat {n m : ℕ} (h : n ≠ m) :
208208
end minpoly
209209

210210
end Polynomial
211+
212+
namespace IsPrimitiveRoot
213+
214+
open Polynomial
215+
216+
variable {K : Type*} [Field K] [CharZero K]
217+
variable {p : ℕ} {ζ : K}
218+
219+
/-- For a prime `p`, a ℚ-linear combination `∑_{i < p} αᵢ ζⁱ` vanishes if and only if all
220+
coefficients `αᵢ` are equal. This follows from the irreducibility of the `p`-th cyclotomic
221+
polynomial. See Washington, *Introduction to Cyclotomic Fields*, Lemma 2.8.5. -/
222+
lemma sum_eq_zero_iff_forall_eq (hp : p.Prime) (hζ : IsPrimitiveRoot ζ p) (α : Fin p → ℚ) :
223+
∑ i, α i * ζ ^ i.val = 0 ↔ ∀ i j, α i = α j := by
224+
haveI : Fact p.Prime := ⟨hp⟩
225+
let P : ℚ[X] := ∑ i, C (α i) * X ^ i.1
226+
have hP (i : Fin p) : α i = P.coeff i := by simp [P, ← Fin.ext_iff]
227+
have hP' : P.degree ≤ ↑(p - 1) :=
228+
(degree_sum_le ..).trans (Finset.sup_le fun _ _ ↦ by grw [degree_C_mul_X_pow_le]; simp; grind)
229+
trans aeval ζ P = 0; · simp [P]
230+
rw [← minpoly.dvd_iff, ← cyclotomic_eq_minpoly_rat hζ hp.pos]
231+
refine ⟨fun ⟨c, hc⟩ ↦ ?_, fun H ↦ ⟨C (α 0), Polynomial.ext fun i ↦ if h : i < p then ?_ else ?_⟩⟩
232+
· rw [hc, degree_mul, degree_cyclotomic, Nat.totient_prime hp] at hP'
233+
have : c.degree ≤ 0 := (WithBot.add_le_add_iff_left (x := ↑(p - 1)) (by simp)).mp (by simpa)
234+
obtain ⟨c, rfl⟩ := natDegree_eq_zero.mp (natDegree_eq_zero_iff_degree_le_zero.mpr this)
235+
simp [hP, hc, cyclotomic_prime]
236+
· lift i to Fin p using h; simp [cyclotomic_prime, ← hP, H i 0]
237+
· simp [cyclotomic_prime, P, h, Fin.forall_iff, @forall_comm _ (_ = _), Finset.sum_eq_zero]
238+
239+
/-- Variant of `sum_eq_zero_iff_forall_eq` with integer coefficients. -/
240+
lemma sum_eq_zero_iff_forall_eq_int (hp : p.Prime) (hζ : IsPrimitiveRoot ζ p) (α : Fin p → ℤ) :
241+
∑ i, α i * ζ ^ i.val = 0 ↔ ∀ i j, α i = α j := by
242+
simpa using sum_eq_zero_iff_forall_eq hp hζ (Int.cast ∘ α)
243+
244+
end IsPrimitiveRoot

0 commit comments

Comments
 (0)