The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.RingTheory.Polynomial.Cyclotomic.Basic

58 declarations. Mathlib docs · Source

Cyclotomic polynomials.

For n : ℕ and an integral domain R, we define a modified version of the n-th cyclotomic polynomial with coefficients in R, denoted cyclotomic' n R, as ∏ (X - μ), where μ varies over the primitive nth roots of unity. If there is a primitive nth root of unity in R then this is the standard definition. We then define the standard cyclotomic polynomial cyclotomic n R with coefficients in any ring R.

Main definition

  • cyclotomic n R : the n-th cyclotomic polynomial with coefficients in R.

Main results

  • Polynomial.degree_cyclotomic : The degree of cyclotomic n is totient n.
  • Polynomial.prod_cyclotomic_eq_X_pow_sub_one : X ^ n - 1 = ∏ (cyclotomic i), where i divides n.
  • Polynomial.cyclotomic_eq_prod_X_pow_sub_one_pow_moebius : The Möbius inversion formula for cyclotomic n R over an abstract fraction field for R[X].

Implementation notes

Our definition of cyclotomic' n R makes sense in any integral domain R, but the interesting results hold if there is a primitive n-th root of unity in R. In particular, our definition is not the standard one unless there is a primitive nth root of unity in R. For example, cyclotomic' 3 ℤ = 1, since there are no primitive cube roots of unity in ℤ. The main example is R = ℂ, we decided to work in general since the difficulties are essentially the same. To get the standard cyclotomic polynomials, we use unique_int_coeff_of_cycl, with R = ℂ, to get a polynomial with integer coefficients and then we map it to R[X], for any ring R.

theorem Polynomial.cyclotomic'.congr_simp E1 #

∀ (n n_1 : ℕ),
  n = n_1 →
    ∀ (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R],
      Polynomial.cyclotomic' n R = Polynomial.cyclotomic' n_1 R

def Polynomial.cyclotomic' E1 #

ℕ → (R : Type u_2) → [inst : CommRing R] → [IsDomain R] → Polynomial R

The modified n-th cyclotomic polynomial with coefficients in R, it is the usual cyclotomic polynomial if there is a primitive n-th root of unity in R.

theorem Polynomial.cyclotomic'_zero E0 #

∀ (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R], Polynomial.cyclotomic' 0 R = 1

The zeroth modified cyclotomic polynomial is 1.

theorem Polynomial.cyclotomic'_one E0 #

∀ (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R], Polynomial.cyclotomic' 1 R = Polynomial.X - 1

The first modified cyclotomic polynomial is X - 1.

theorem Polynomial.cyclotomic'_two E1 #

∀ (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R] (p : ℕ) [CharP R p],
  p ≠ 2 → Polynomial.cyclotomic' 2 R = Polynomial.X + 1

The second modified cyclotomic polynomial is X + 1 if the characteristic of R is not 2.

theorem Polynomial.cyclotomic'.monic E1 #

∀ (n : ℕ) (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R], (Polynomial.cyclotomic' n R).Monic

cyclotomic' n R is monic.

theorem Polynomial.cyclotomic'_ne_zero E1 #

∀ (n : ℕ) (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R], Polynomial.cyclotomic' n R ≠ 0

cyclotomic' n R is different from 0.

theorem Polynomial.natDegree_cyclotomic' E1 #

∀ {R : Type u_1} [inst : CommRing R] [inst_1 : IsDomain R] {ζ : R} {n : ℕ},
  IsPrimitiveRoot ζ n → (Polynomial.cyclotomic' n R).natDegree = n.totient

The natural degree of cyclotomic' n R is totient n if there is a primitive root of unity in R.

theorem Polynomial.degree_cyclotomic' E1 #

∀ {R : Type u_1} [inst : CommRing R] [inst_1 : IsDomain R] {ζ : R} {n : ℕ},
  IsPrimitiveRoot ζ n → (Polynomial.cyclotomic' n R).degree = ↑n.totient

The degree of cyclotomic' n R is totient n if there is a primitive root of unity in R.

theorem Polynomial.roots_of_cyclotomic E1 #

∀ (n : ℕ) (R : Type u_2) [inst : CommRing R] [inst_1 : IsDomain R],
  (Polynomial.cyclotomic' n R).roots = (primitiveRoots n R).val

The roots of cyclotomic' n R are the primitive n-th roots of unity.

theorem Polynomial.X_pow_sub_one_eq_prod E1 #

∀ {R : Type u_1} [inst : CommRing R] [inst_1 : IsDomain R] {ζ : R} {n : ℕ},
  0 < n →
    IsPrimitiveRoot ζ n → Polynomial.X ^ n - 1 = ∏ ζ ∈ Polynomial.nthRootsFinset n 1, (Polynomial.X - Polynomial.C ζ)

If there is a primitive nth root of unity in K, then X ^ n - 1 = ∏ (X - μ), where μ varies over the n-th roots of unity.

theorem Polynomial.cyclotomic'_splits E1 #

∀ {K : Type u_1} [inst : Field K] (n : ℕ), (Polynomial.cyclotomic' n K).Splits

cyclotomic' n K splits.

theorem Polynomial.X_pow_sub_one_splits E1 #

∀ {K : Type u_1} [inst : Field K] {ζ : K} {n : ℕ}, IsPrimitiveRoot ζ n → (Polynomial.X ^ n - Polynomial.C 1).Splits

If there is a primitive n-th root of unity in K, then X ^ n - 1 splits.

theorem Polynomial.prod_cyclotomic'_eq_X_pow_sub_one E1 #

∀ {K : Type u_2} [inst : CommRing K] [inst_1 : IsDomain K] {ζ : K} {n : ℕ},
  0 < n → IsPrimitiveRoot ζ n → ∏ i ∈ n.divisors, Polynomial.cyclotomic' i K = Polynomial.X ^ n - 1

If there is a primitive n-th root of unity in K, then ∏ i ∈ Nat.divisors n, cyclotomic' i K = X ^ n - 1.

theorem Polynomial.cyclotomic'_eq_X_pow_sub_one_div E1 #

∀ {K : Type u_2} [inst : CommRing K] [inst_1 : IsDomain K] {ζ : K} {n : ℕ},
  0 < n →
    IsPrimitiveRoot ζ n →
      Polynomial.cyclotomic' n K = (Polynomial.X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, Polynomial.cyclotomic' i K

If there is a primitive n-th root of unity in K, then cyclotomic' n K = (X ^ k - 1) /ₘ (∏ i ∈ Nat.properDivisors k, cyclotomic' i K).

theorem Polynomial.int_coeff_of_cyclotomic' E1 #

∀ {K : Type u_2} [inst : CommRing K] [inst_1 : IsDomain K] {ζ : K} {n : ℕ},
  IsPrimitiveRoot ζ n →
    ∃ P,
      Polynomial.map (Int.castRingHom K) P = Polynomial.cyclotomic' n K ∧
        P.degree = (Polynomial.cyclotomic' n K).degree ∧ P.Monic

If there is a primitive n-th root of unity in K, then cyclotomic' n K comes from a monic polynomial with integer coefficients.

theorem Polynomial.unique_int_coeff_of_cycl E1 #

∀ {K : Type u_2} [inst : CommRing K] [inst_1 : IsDomain K] [CharZero K] {ζ : K} {n : ℕ+},
  IsPrimitiveRoot ζ ↑n → ∃! P, Polynomial.map (Int.castRingHom K) P = Polynomial.cyclotomic' (↑n) K

If K is of characteristic 0 and there is a primitive n-th root of unity in K, then cyclotomic n K comes from a unique polynomial with integer coefficients.

def Polynomial.cyclotomic E3 #

ℕ → (R : Type u_1) → [inst : Ring R] → Polynomial R

The n-th cyclotomic polynomial with coefficients in R.

theorem Polynomial.int_cyclotomic_rw E1 #

∀ {n : ℕ} (h : n ≠ 0), Polynomial.cyclotomic n ℤ = ⋯.choose

theorem Polynomial.map_cyclotomic_int E0 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R],
  Polynomial.map (Int.castRingHom R) (Polynomial.cyclotomic n ℤ) = Polynomial.cyclotomic n R

cyclotomic n R comes from cyclotomic n ℤ.

theorem Polynomial.int_cyclotomic_spec E1 #

∀ (n : ℕ),
  Polynomial.map (Int.castRingHom ℂ) (Polynomial.cyclotomic n ℤ) = Polynomial.cyclotomic' n ℂ ∧
    (Polynomial.cyclotomic n ℤ).degree = (Polynomial.cyclotomic' n ℂ).degree ∧ (Polynomial.cyclotomic n ℤ).Monic

theorem Polynomial.int_cyclotomic_unique E1 #

∀ {n : ℕ} {P : Polynomial ℤ},
  Polynomial.map (Int.castRingHom ℂ) P = Polynomial.cyclotomic' n ℂ → P = Polynomial.cyclotomic n ℤ

theorem Polynomial.map_cyclotomic E0 #

∀ (n : ℕ) {R : Type u_1} {S : Type u_2} [inst : Ring R] [inst_1 : Ring S] (f : R →+* S),
  Polynomial.map f (Polynomial.cyclotomic n R) = Polynomial.cyclotomic n S

The definition of cyclotomic n R commutes with any ring homomorphism.

theorem Polynomial.cyclotomic.eval_apply E0 #

∀ {R : Type u_1} {S : Type u_2} (q : R) (n : ℕ) [inst : Ring R] [inst_1 : Ring S] (f : R →+* S),
  Polynomial.eval (f q) (Polynomial.cyclotomic n S) = f (Polynomial.eval q (Polynomial.cyclotomic n R))

theorem Polynomial.cyclotomic.eval_apply_ofReal E0 #

∀ (q : ℝ) (n : ℕ), Polynomial.eval (↑q) (Polynomial.cyclotomic n ℂ) = ↑(Polynomial.eval q (Polynomial.cyclotomic n ℝ))

theorem Polynomial.cyclotomic_zero E0 #

∀ (R : Type u_1) [inst : Ring R], Polynomial.cyclotomic 0 R = 1

The zeroth cyclotomic polynomial is 1.

theorem Polynomial.cyclotomic_one E0 #

∀ (R : Type u_1) [inst : Ring R], Polynomial.cyclotomic 1 R = Polynomial.X - 1

The first cyclotomic polynomial is X - 1.

theorem Polynomial.cyclotomic.monic E1 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R], (Polynomial.cyclotomic n R).Monic

cyclotomic n is monic.

theorem Polynomial.cyclotomic.isPrimitive E1 #

∀ (n : ℕ) (R : Type u_1) [inst : CommRing R], (Polynomial.cyclotomic n R).IsPrimitive

cyclotomic n is primitive.

theorem Polynomial.cyclotomic_ne_zero E1 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R] [Nontrivial R], Polynomial.cyclotomic n R ≠ 0

cyclotomic n R is different from 0.

theorem Polynomial.degree_cyclotomic E3 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R] [Nontrivial R], (Polynomial.cyclotomic n R).degree = ↑n.totient

The degree of cyclotomic n is totient n.

theorem Polynomial.natDegree_cyclotomic E1 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R] [Nontrivial R], (Polynomial.cyclotomic n R).natDegree = n.totient

The natural degree of cyclotomic n is totient n.

theorem Polynomial.natDegree_cyclotomic_le E1 #

∀ {R : Type u_1} [inst : Ring R] {n : ℕ}, (Polynomial.cyclotomic n R).natDegree ≤ n.totient

The natural degree of cyclotomic n is at most totient n.

If the base ring is nontrivial, then the degree is exactly φ n, otherwise it's zero.

theorem Polynomial.degree_cyclotomic_pos E1 #

∀ (n : ℕ) (R : Type u_1), 0 < n → ∀ [inst : Ring R] [Nontrivial R], 0 < (Polynomial.cyclotomic n R).degree

The degree of cyclotomic n R is positive.

theorem Polynomial.prod_cyclotomic_eq_X_pow_sub_one E3 #

∀ {n : ℕ},
  0 < n → ∀ (R : Type u_1) [inst : CommRing R], ∏ i ∈ n.divisors, Polynomial.cyclotomic i R = Polynomial.X ^ n - 1

∏ i ∈ Nat.divisors n, cyclotomic i R = X ^ n - 1.

theorem Polynomial.cyclotomic.dvd_X_pow_sub_one E1 #

∀ (n : ℕ) (R : Type u_1) [inst : Ring R], Polynomial.cyclotomic n R ∣ Polynomial.X ^ n - 1

theorem Polynomial.prod_cyclotomic_eq_geom_sum E1 #

∀ {n : ℕ},
  0 < n →
    ∀ (R : Type u_1) [inst : CommRing R],
      ∏ i ∈ n.divisors.erase 1, Polynomial.cyclotomic i R = ∑ i ∈ Finset.range n, Polynomial.X ^ i

theorem Polynomial.cyclotomic_prime E1 #

∀ (R : Type u_1) [inst : Ring R] (p : ℕ) [hp : Fact (Nat.Prime p)],
  Polynomial.cyclotomic p R = ∑ i ∈ Finset.range p, Polynomial.X ^ i

If p is prime, then cyclotomic p R = ∑ i ∈ range p, X ^ i.

theorem Polynomial.cyclotomic_prime_mul_X_sub_one E1 #

∀ (R : Type u_1) [inst : Ring R] (p : ℕ) [hn : Fact (Nat.Prime p)],
  Polynomial.cyclotomic p R * (Polynomial.X - 1) = Polynomial.X ^ p - 1

theorem Polynomial.cyclotomic_two E0 #

∀ (R : Type u_1) [inst : Ring R], Polynomial.cyclotomic 2 R = Polynomial.X + 1

theorem Polynomial.cyclotomic_three E0 #

∀ (R : Type u_1) [inst : Ring R], Polynomial.cyclotomic 3 R = Polynomial.X ^ 2 + Polynomial.X + 1

theorem Polynomial.cyclotomic_dvd_geom_sum_of_dvd E1 #

∀ (R : Type u_1) [inst : Ring R] {d n : ℕ},
  d ∣ n → d ≠ 1 → Polynomial.cyclotomic d R ∣ ∑ i ∈ Finset.range n, Polynomial.X ^ i

theorem Polynomial.X_pow_sub_one_mul_prod_cyclotomic_eq_X_pow_sub_one_of_dvd E1 #

∀ (R : Type u_1) [inst : CommRing R] {d n : ℕ},
  d ∣ n →
    n ≠ 0 → (Polynomial.X ^ d - 1) * ∏ x ∈ n.divisors \ d.divisors, Polynomial.cyclotomic x R = Polynomial.X ^ n - 1

theorem Polynomial.X_pow_sub_one_mul_cyclotomic_dvd_X_pow_sub_one_of_dvd E1 #

∀ (R : Type u_1) [inst : CommRing R] {d n : ℕ},
  d ∈ n.properDivisors → (Polynomial.X ^ d - 1) * Polynomial.cyclotomic n R ∣ Polynomial.X ^ n - 1

theorem Polynomial.cyclotomic_eq_prod_X_pow_sub_one_pow_moebius E3 #

∀ {n : ℕ} (R : Type u_1) [inst : CommRing R] [inst_1 : IsDomain R],
  (algebraMap (Polynomial R) (RatFunc R)) (Polynomial.cyclotomic n R) =
    ∏ i ∈ n.divisorsAntidiagonal,
      (algebraMap (Polynomial R) (RatFunc R)) (Polynomial.X ^ i.2 - 1) ^ ArithmeticFunction.moebius i.1

cyclotomic n R can be expressed as a product in a fraction field of R[X] using Möbius inversion.

theorem Polynomial.cyclotomic_eq_X_pow_sub_one_div E1 #

∀ {R : Type u_1} [inst : CommRing R] {n : ℕ},
  0 < n → Polynomial.cyclotomic n R = (Polynomial.X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, Polynomial.cyclotomic i R

We have cyclotomic n R = (X ^ k - 1) /ₘ (∏ i ∈ Nat.properDivisors k, cyclotomic i K).

theorem Polynomial.X_pow_sub_one_dvd_prod_cyclotomic E1 #

∀ (R : Type u_1) [inst : CommRing R] {n m : ℕ},
  0 < n → m ∣ n → m ≠ n → Polynomial.X ^ m - 1 ∣ ∏ i ∈ n.properDivisors, Polynomial.cyclotomic i R

If m is a proper divisor of n, then X ^ m - 1 divides ∏ i ∈ Nat.properDivisors n, cyclotomic i R.

theorem Polynomial.cyclotomic_eq_prod_X_sub_primitiveRoots E1 #

∀ {K : Type u_1} [inst : CommRing K] [inst_1 : IsDomain K] {ζ : K} {n : ℕ},
  IsPrimitiveRoot ζ n → Polynomial.cyclotomic n K = ∏ μ ∈ primitiveRoots n K, (Polynomial.X - Polynomial.C μ)

If there is a primitive n-th root of unity in K, then cyclotomic n K = ∏ μ ∈ primitiveRoots n K, (X - C μ). ∈ particular, cyclotomic n K = cyclotomic' n K

theorem Polynomial.cyclotomic_prime_pow_eq_geom_sum E1 #

∀ {R : Type u_1} [inst : CommRing R] {p n : ℕ},
  Nat.Prime p → Polynomial.cyclotomic (p ^ (n + 1)) R = ∑ i ∈ Finset.range p, (Polynomial.X ^ p ^ n) ^ i

If p ^ k is a prime power, then cyclotomic (p ^ (n + 1)) R = ∑ i ∈ range p, (X ^ (p ^ n)) ^ i.

theorem Polynomial.cyclotomic_prime_pow_mul_X_pow_sub_one E1 #

∀ (R : Type u_1) [inst : CommRing R] (p k : ℕ) [hn : Fact (Nat.Prime p)],
  Polynomial.cyclotomic (p ^ (k + 1)) R * (Polynomial.X ^ p ^ k - 1) = Polynomial.X ^ p ^ (k + 1) - 1

theorem Polynomial.cyclotomic_coeff_zero E1 #

∀ (R : Type u_1) [inst : CommRing R] {n : ℕ}, 1 < n → (Polynomial.cyclotomic n R).coeff 0 = 1

The constant term of cyclotomic n R is 1 if 2 ≤ n.

theorem Polynomial.coprime_of_root_cyclotomic E1 #

∀ {n p : ℕ} [hprime : Fact (Nat.Prime p)] {a : ℕ},
  (Polynomial.cyclotomic n (ZMod p)).IsRoot ((Nat.castRingHom (ZMod p)) a) → a.Coprime p

If (a : ℕ) is a root of cyclotomic n (ZMod p), where p is a prime, then a and p are coprime.

theorem Polynomial.orderOf_root_cyclotomic_dvd E1 #

∀ {n p : ℕ} [inst : Fact (Nat.Prime p)] {a : ℕ}
  (hroot : (Polynomial.cyclotomic n (ZMod p)).IsRoot ((Nat.castRingHom (ZMod p)) a)),
  orderOf (ZMod.unitOfCoprime a ⋯) ∣ n

If (a : ℕ) is a root of cyclotomic n (ZMod p), then the multiplicative order of a modulo p divides n.

theorem Polynomial.dvd_C_mul_X_sub_one_pow_add_one E1 #

∀ {R : Type u_1} [inst : CommRing R] {p : ℕ},
  Nat.Prime p →
    p ≠ 2 → ∀ (a r : R), r ∣ a ^ p → r ∣ ↑p * a → Polynomial.C r ∣ (Polynomial.C a * Polynomial.X - 1) ^ p + 1

theorem IsPrimitiveRoot.pow_sub_pow_eq_prod_sub_mul E1 #

∀ {R : Type u_1} [inst : CommRing R] {ζ : R} {n : ℕ} (x y : R) [inst_1 : IsDomain R],
  0 < n → IsPrimitiveRoot ζ n → x ^ n - y ^ n = ∏ ζ ∈ Polynomial.nthRootsFinset n 1, (x - ζ * y)

If there is a primitive nth root of unity in R, then X ^ n - Y ^ n = ∏ (X - μ Y), where μ varies over the n-th roots of unity.

theorem IsPrimitiveRoot.pow_add_pow_eq_prod_add_mul E1 #

∀ {R : Type u_1} [inst : CommRing R] {ζ : R} {n : ℕ} (x y : R) [inst_1 : IsDomain R],
  Odd n → IsPrimitiveRoot ζ n → x ^ n + y ^ n = ∏ ζ ∈ Polynomial.nthRootsFinset n 1, (x + ζ * y)

If there is a primitive nth root of unity in R and n is odd, then X ^ n + Y ^ n = ∏ (X + μ Y), where μ varies over the n-th roots of unity.

theorem Polynomial.separable_cyclotomic E1 #

∀ (n : ℕ) (K : Type u_2) [inst : Field K] [NeZero ↑n], (Polynomial.cyclotomic n K).Separable

theorem Polynomial.squarefree_cyclotomic E1 #

∀ (n : ℕ) (K : Type u_2) [inst : Field K] [NeZero ↑n], Squarefree (Polynomial.cyclotomic n K)