Skip to content

Commit 4a662f0

Browse files
more direct proof
1 parent 6919d8c commit 4a662f0

File tree

3 files changed

+47
-907
lines changed

3 files changed

+47
-907
lines changed

FltRegular/CaseII/InductionStep.lean

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ include hp hζ e hz in
7070
lemma x_plus_y_mul_ne_zero : x + y * η ≠ 0 := by
7171
intro hη
7272
have : x + y * η ∣ x ^ (p : ℕ) + y ^ (p : ℕ) := by
73-
rw [pow_add_pow_eq_prod_add_zeta_runity_mul
73+
rw [pow_add_pow_eq_prod_add_zeta_runity_mul _ _
7474
(hpri.out.eq_two_or_odd.resolve_left (PNat.coe_injective.ne hp)) hζ.unit'_coe]
7575
simp_rw [mul_comm _ y]
7676
exact Finset.dvd_prod_of_mem _ η.prop
@@ -90,7 +90,7 @@ lemma one_sub_zeta_dvd_zeta_pow_sub : π ∣ x + y * η := by
9090
letI := IsCyclotomicExtension.numberField {p} ℚ K
9191
have h := zeta_sub_one_dvd hζ e
9292
replace h : ∏ _η in nthRootsFinset p (𝓞 K), Ideal.Quotient.mk 𝔭 (x + y * η : 𝓞 K) = 0 := by
93-
rw [pow_add_pow_eq_prod_add_zeta_runity_mul (hpri.out.eq_two_or_odd.resolve_left
93+
rw [pow_add_pow_eq_prod_add_zeta_runity_mul _ _ (hpri.out.eq_two_or_odd.resolve_left
9494
(PNat.coe_injective.ne hp)) hζ.unit'_coe, ← Ideal.Quotient.eq_zero_iff_dvd, map_prod] at h
9595
convert h using 2 with η' hη'
9696
rw [map_add, map_add, map_mul, map_mul, IsPrimitiveRoot.eq_one_mod_one_sub' hζ.unit'_coe hη',
@@ -249,7 +249,7 @@ lemma exists_ideal_pow_eq_c_aux :
249249
/- The ∏_η, 𝔠 η = (𝔷' 𝔭^m)^p with 𝔷 = 𝔪 𝔷' -/
250250
lemma prod_c : ∏ η in Finset.attach (nthRootsFinset p (𝓞 K)), 𝔠 η = (𝔷' * 𝔭 ^ m) ^ (p : ℕ) := by
251251
have e' := span_pow_add_pow_eq hζ e
252-
rw [pow_add_pow_eq_prod_add_zeta_runity_mul
252+
rw [pow_add_pow_eq_prod_add_zeta_runity_mul _ _
253253
(hpri.out.eq_two_or_odd.resolve_left (PNat.coe_injective.ne hp)) hζ.unit'_coe] at e'
254254
rw [← Ideal.prod_span_singleton, ← Finset.prod_attach] at e'
255255
simp_rw [mul_comm _ y, ← m_mul_c_mul_p hp hζ e hy,

FltRegular/NumberTheory/Cyclotomic/Factoring.lean

+44-30
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,59 @@ Copyright (c) 2021 Alex J. Best. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alex J. Best
55
6-
! This file was ported from Lean 3 source module number_theory.cyclotomic.factoring
76
-/
87
import Mathlib.RingTheory.Polynomial.Cyclotomic.Basic
9-
import FltRegular.ReadyForMathlib.Homogenization
108

11-
open Polynomial Finset MvPolynomial
9+
open Polynomial Finset
10+
11+
variable {R : Type*} [CommRing R] [IsDomain R] {ζ : R} {n : ℕ} (x y : R)
1212

13-
-- TODO might be nice to have an explicit two variable version of this factorization
14-
-- in an mv_polynomial ring with two chosen variables
1513
/-- If there is a primitive `n`th root of unity in `K`, then `X ^ n - Y ^ n = ∏ (X - μ Y)`,
1614
where `μ` varies over the `n`-th roots of unity. -/
17-
theorem pow_sub_pow_eq_prod_sub_zeta_runity_mul {K : Type _} [CommRing K] [IsDomain K] {ζ : K}
18-
{n : ℕ} (hpos : 0 < n) (h : IsPrimitiveRoot ζ n) (x y : K) :
19-
x ^ (n : ℕ) - y ^ (n : ℕ) = ∏ ζ : K in nthRootsFinset n K, (x - ζ * y) := by
20-
-- suffices to show the identity in a multivariate polynomial ring with two generators over K
21-
suffices
22-
(X 0 : MvPolynomial (Fin 2) K) ^ (n : ℕ) - X 1 ^ (n : ℕ) =
23-
∏ ζ in nthRootsFinset n K, (X 0 - MvPolynomial.C ζ * X 1)
24-
by
25-
apply_fun MvPolynomial.eval fun i : Fin 2 => if i = 0 then x else y at this
26-
simpa [MvPolynomial.eval_prod] using this
27-
-- we know the univariate / one argument version of the identity
28-
have := X_pow_sub_one_eq_prod hpos h
29-
-- transfer this to a polynomial ring with two variables
30-
have := congr_arg (Polynomial.aeval (X 0 : MvPolynomial (Fin 2) K)) this
31-
simp only [map_prod, aeval_X_pow, Polynomial.aeval_X, aeval_one, Polynomial.aeval_C,
32-
map_sub] at this
33-
-- the homogenization of the identity is also true
34-
have := congr_arg (homogenization 1) this
35-
-- simplify to get the result we want
36-
simpa [homogenization_prod, Polynomial.algebraMap_eq, hpos]
15+
theorem pow_sub_pow_eq_prod_sub_zeta_runity_mul_field {K : Type*} [Field K] {ζ : K} (x y : K)
16+
(hpos : 0 < n) (h : IsPrimitiveRoot ζ n) :
17+
x ^ n - y ^ n = ∏ ζ ∈ nthRootsFinset n K, (x - ζ * y) := by
18+
by_cases hy : y = 0
19+
· simp only [hy, zero_pow (Nat.not_eq_zero_of_lt hpos), sub_zero, mul_zero, prod_const]
20+
congr
21+
rw [h.card_nthRootsFinset]
22+
have := congr_arg (eval (x/y)) <| X_pow_sub_one_eq_prod hpos h
23+
rw [eval_sub, eval_pow, eval_one, eval_X, eval_prod] at this
24+
simp_rw [eval_sub, eval_X, eval_C] at this
25+
apply_fun (· * y ^ n) at this
26+
rw [sub_mul, one_mul, div_pow, div_mul_cancel₀ _ (pow_ne_zero n hy)] at this
27+
nth_rw 4 [← h.card_nthRootsFinset] at this
28+
rw [mul_comm, pow_card_mul_prod] at this
29+
convert this using 2
30+
field_simp [hy]
31+
rw [mul_comm]
32+
33+
/-- If there is a primitive `n`th root of unity in `R`, then `X ^ n - Y ^ n = ∏ (X - μ Y)`,
34+
where `μ` varies over the `n`-th roots of unity. -/
35+
theorem pow_sub_pow_eq_prod_sub_zeta_runity_mul (hpos : 0 < n) (h : IsPrimitiveRoot ζ n) :
36+
x ^ n - y ^ n = ∏ ζ ∈ nthRootsFinset n R, (x - ζ * y) := by
37+
let K := FractionRing R
38+
apply NoZeroSMulDivisors.algebraMap_injective R K
39+
rw [map_sub, map_pow, map_pow, map_prod]
40+
simp_rw [map_sub, map_mul]
41+
have h' : IsPrimitiveRoot (algebraMap R K ζ) n :=
42+
h.map_of_injective <| NoZeroSMulDivisors.algebraMap_injective R K
43+
rw [pow_sub_pow_eq_prod_sub_zeta_runity_mul_field _ _ hpos h']
44+
symm
45+
refine prod_nbij (algebraMap R K) (fun a ha ↦ ?_) (fun a _ b _ H ↦
46+
NoZeroSMulDivisors.algebraMap_injective R K H) (fun a ha ↦ ?_) (fun _ _ ↦ rfl)
47+
· rw [mem_nthRootsFinset hpos, ← map_pow, (mem_nthRootsFinset hpos).1 ha, map_one]
48+
· rw [mem_coe, mem_nthRootsFinset hpos] at ha
49+
simp only [Set.mem_image, mem_coe]
50+
obtain ⟨i, -, hζ⟩ := h'.eq_pow_of_pow_eq_one ha hpos
51+
refine ⟨ζ ^ i, ?_, by rwa [map_pow]⟩
52+
rw [mem_nthRootsFinset hpos, ← pow_mul, mul_comm, pow_mul, h.pow_eq_one, one_pow]
3753

3854
/-- If there is a primitive `n`th root of unity in `K` and `n` is odd, then
3955
`X ^ n + Y ^ n = ∏ (X + μ Y)`, where `μ` varies over the `n`-th roots of unity. -/
40-
theorem pow_add_pow_eq_prod_add_zeta_runity_mul {K : Type _} [CommRing K] [IsDomain K] {ζ : K}
41-
{n : ℕ} (hodd : n % 2 = 1) (h : IsPrimitiveRoot ζ n) (x y : K) :
42-
x ^ (n : ℕ) + y ^ (n : ℕ) = ∏ ζ : K in nthRootsFinset n K, (x + ζ * y) :=
43-
by
44-
have := pow_sub_pow_eq_prod_sub_zeta_runity_mul (Nat.odd_iff.mpr hodd).pos h x (-y)
56+
theorem pow_add_pow_eq_prod_add_zeta_runity_mul (hodd : n % 2 = 1) (h : IsPrimitiveRoot ζ n) :
57+
x ^ n + y ^ n = ∏ ζ ∈ nthRootsFinset n R, (x + ζ * y) := by
58+
have := pow_sub_pow_eq_prod_sub_zeta_runity_mul x (-y) (Nat.odd_iff.mpr hodd).pos h
4559
simp only [mul_neg, sub_neg_eq_add] at this
4660
rw [neg_pow, neg_one_pow_eq_pow_mod_two] at this
4761
simpa [hodd] using this

0 commit comments

Comments
 (0)