Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4f5046d

Browse files
committed
feat(ring_theory/polynomial/cyclotomic): Möbius inversion formula for cyclotomic polynomials (#5192)
Proves Möbius inversion for functions to a `comm_group_with_zero` Proves the Möbius inversion formula for cyclotomic polynomials
1 parent 57dd302 commit 4f5046d

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

src/number_theory/arithmetic_function.lean

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ to form the Dirichlet ring.
3434
* `sum_eq_iff_sum_mul_moebius_eq` for functions to a `comm_ring`
3535
* `sum_eq_iff_sum_smul_moebius_eq` for functions to an `add_comm_group`
3636
* `prod_eq_iff_prod_pow_moebius_eq` for functions to a `comm_group`
37+
* `prod_eq_iff_prod_pow_moebius_eq_of_nonzero` for functions to a `comm_group_with_zero`
3738
3839
## Notation
3940
The arithmetic functions `ζ` and `σ` have Greek letter names, which are localized notation in
@@ -845,6 +846,29 @@ theorem prod_eq_iff_prod_pow_moebius_eq [comm_group R] {f g : ℕ → R} :
845846
∀ (n : ℕ), 0 < n → ∏ (x : ℕ × ℕ) in n.divisors_antidiagonal, g x.snd ^ (μ x.fst) = f n :=
846847
@sum_eq_iff_sum_smul_moebius_eq (additive R) _ _ _
847848

849+
/-- Möbius inversion for functions to a `comm_group_with_zero`. -/
850+
theorem prod_eq_iff_prod_pow_moebius_eq_of_nonzero [comm_group_with_zero R] {f g : ℕ → R}
851+
(hf : ∀ (n : ℕ), 0 < n → f n ≠ 0) (hg : ∀ (n : ℕ), 0 < n → g n ≠ 0) :
852+
(∀ (n : ℕ), 0 < n → ∏ i in (n.divisors), f i = g n) ↔
853+
∀ (n : ℕ), 0 < n → ∏ (x : ℕ × ℕ) in n.divisors_antidiagonal, g x.snd ^ (μ x.fst) = f n :=
854+
begin
855+
refine iff.trans (iff.trans (forall_congr (λ n, _)) (@prod_eq_iff_prod_pow_moebius_eq (units R) _
856+
(λ n, if h : 0 < n then units.mk0 (f n) (hf n h) else 1)
857+
(λ n, if h : 0 < n then units.mk0 (g n) (hg n h) else 1))) (forall_congr (λ n, _));
858+
refine imp_congr_right (λ hn, _),
859+
{ dsimp,
860+
rw [dif_pos hn, ← units.eq_iff, ← units.coe_hom_apply, monoid_hom.map_prod, units.coe_mk0,
861+
prod_congr rfl _],
862+
intros x hx,
863+
rw [dif_pos (nat.pos_of_mem_divisors hx), units.coe_hom_apply, units.coe_mk0] },
864+
{ dsimp,
865+
rw [dif_pos hn, ← units.eq_iff, ← units.coe_hom_apply, monoid_hom.map_prod, units.coe_mk0,
866+
prod_congr rfl _],
867+
intros x hx,
868+
rw [dif_pos (nat.pos_of_mem_divisors (nat.snd_mem_divisors_of_mem_antidiagonal hx)),
869+
units.coe_hom_apply, units.coe_gpow', units.coe_mk0] }
870+
end
871+
848872
end special_functions
849873
end arithmetic_function
850874
end nat

src/ring_theory/polynomial/cyclotomic.lean

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Author: Riccardo Brasca
77
import field_theory.splitting_field
88
import ring_theory.roots_of_unity
99
import algebra.polynomial.big_operators
10-
import number_theory.divisors
10+
import number_theory.arithmetic_function
1111
import data.polynomial.lifts
1212
import analysis.complex.roots_of_unity
1313

@@ -29,7 +29,9 @@ with coefficients in any ring `R`.
2929
* `int_coeff_of_cycl` : If there is a primitive `n`-th root of unity in `K`, then `cyclotomic' n K`
3030
comes from a polynomial with integer coefficients.
3131
* `deg_of_cyclotomic` : The degree of `cyclotomic n` is `totient n`.
32-
* `X_pow_sub_one_eq_prod_cycl` : `X ^ n - 1 = ∏ (cyclotomic i)`, where `i` divides `n`.
32+
* `prod_cyclotomic_eq_X_pow_sub_one` : `X ^ n - 1 = ∏ (cyclotomic i)`, where `i` divides `n`.
33+
* `cyclotomic_eq_prod_X_pow_sub_one_pow_moebius` : The Möbius inversion formula for
34+
`cyclotomic n R` over an abstract fraction field for `polynomial R`.
3335
3436
## Implementation details
3537
@@ -408,6 +410,30 @@ begin
408410
(λ i, cyclotomic i ℤ), integer]
409411
end
410412

413+
section arithmetic_function
414+
open nat.arithmetic_function
415+
open_locale arithmetic_function
416+
417+
/-- `cyclotomic n R` can be expressed as a product in a fraction field of `polynomial R`
418+
using Möbius inversion. -/
419+
lemma cyclotomic_eq_prod_X_pow_sub_one_pow_moebius {n : ℕ} (hpos : 0 < n) (R : Type*) [comm_ring R]
420+
[nontrivial R] {K : Type*} [field K] (f : fraction_map (polynomial R) K) :
421+
f.to_map (cyclotomic n R) =
422+
∏ i in n.divisors_antidiagonal, (f.to_map (X ^ i.snd - 1)) ^ μ i.fst :=
423+
begin
424+
have h : ∀ (n : ℕ), 0 < n →
425+
∏ i in nat.divisors n, f.to_map (cyclotomic i R) = f.to_map (X ^ n - 1),
426+
{ intros n hn,
427+
rw [← prod_cyclotomic_eq_X_pow_sub_one hn R, ring_hom.map_prod] },
428+
rw (prod_eq_iff_prod_pow_moebius_eq_of_nonzero (λ n hn, _) (λ n hn, _)).1 h n hpos;
429+
rw [ne.def, fraction_map.to_map_eq_zero_iff],
430+
{ apply cyclotomic_ne_zero },
431+
{ apply monic.ne_zero,
432+
apply monic_X_pow_sub_C _ (ne_of_gt hn) }
433+
end
434+
435+
end arithmetic_function
436+
411437
/-- We have
412438
`cyclotomic n R = (X ^ k - 1) /ₘ (∏ i in nat.proper_divisors k, cyclotomic i K)`. -/
413439
lemma cyclotomic_eq_X_pow_sub_one_div {R : Type*} [comm_ring R] [nontrivial R] {n : ℕ}

0 commit comments

Comments
 (0)