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

Commit b144460

Browse files
feat(number_theory/cyclotomic/primitive_roots): generalize norm_eq_one (#12359)
We generalize `norm_eq_one`, that now computes the norm of any primitive `n`-th root of unity if `n ≠ 2`. We modify the assumption, that is still verified in the main case of interest `K = ℚ`. From flt-regular
1 parent 53dc7ca commit b144460

File tree

2 files changed

+61
-34
lines changed

2 files changed

+61
-34
lines changed

src/number_theory/cyclotomic/discriminant.lean

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,23 @@ import ring_theory.discriminant
1212
We compute the discriminant of a `p`-th cyclotomic extension.
1313
1414
## Main results
15-
* `is_cyclotomic_extension.discr_odd_prime` : if `p` is an odd prime and
16-
`is_cyclotomic_extension {p} K L`, then
17-
`discr K (hζ.power_basis K).basis = (-1) ^ ((p - 1) / 2) * p ^ (p - 2)` for any primitive `n`-th
18-
root `ζ`.
19-
20-
## Implementation details
21-
We prove the result for any `K` such that `linear_ordered_field K` and
22-
`irreducible (cyclotomic p K)`. In practice these assumptions are satisfied for `K = ℚ`.
15+
* `is_cyclotomic_extension.discr_odd_prime` : if `p` is an odd prime such that
16+
`is_cyclotomic_extension {p} K L` and `irreducible (cyclotomic p K)`, then
17+
`discr K (hζ.power_basis K).basis = (-1) ^ ((p - 1) / 2) * p ^ (p - 2)` for any
18+
`hζ : is_primitive_root ζ p`.
2319
2420
-/
2521

2622
universes u v
27-
variables {p : ℕ+} (k : ℕ) {K : Type u} {L : Type v} {ζ : L} [linear_ordered_field K] [field L]
23+
variables {p : ℕ+} (k : ℕ) {K : Type u} {L : Type v} {ζ : L} [field K] [field L]
2824
variables [algebra K L] [ne_zero ((p : ℕ) : K)]
2925

3026
open algebra polynomial nat is_primitive_root
3127

3228
namespace is_cyclotomic_extension
3329

3430
local attribute [instance] is_cyclotomic_extension.finite_dimensional
31+
local attribute [instance] is_cyclotomic_extension.is_galois
3532

3633
/-- If `p` is an odd prime and `is_cyclotomic_extension {p} K L`, then
3734
`discr K (hζ.power_basis K).basis = (-1) ^ ((p - 1) / 2) * p ^ (p - 2)`. -/
@@ -58,13 +55,11 @@ begin
5855
simp only [hζ.minpoly_eq_cyclotomic_of_irreducible hirr, aeval_add, _root_.map_mul, aeval_one,
5956
_root_.map_sub, aeval_X, minpoly.aeval, add_zero, aeval_nat_cast, aeval_X_pow] at H,
6057
replace H := congr_arg (algebra.norm K) H,
61-
rw [monoid_hom.map_mul, hζ.sub_one_norm_prime hirr hodd, monoid_hom.map_mul,
62-
monoid_hom.map_pow, norm_eq_one K hζ (odd_iff.2 (or_iff_not_imp_left.1
63-
(nat.prime.eq_two_or_odd hp.out) hodd')), one_pow, mul_one, ← map_nat_cast
64-
(algebra_map K L), norm_algebra_map, finrank _ hirr, totient_prime hp.out,
65-
← succ_pred_eq_of_pos hpos, pow_succ, mul_comm _ (p : K), coe_coe,
66-
← hζ.minpoly_eq_cyclotomic_of_irreducible hirr] at H,
67-
simpa [(mul_right_inj' (cast_ne_zero.2 hp.out.ne_zero : (p : K) ≠ 0)).1 H],
58+
rw [monoid_hom.map_mul, hζ.sub_one_norm_prime hirr hodd, monoid_hom.map_mul, monoid_hom.map_pow,
59+
hζ.norm_eq_one hodd hirr, one_pow, mul_one, ← map_nat_cast (algebra_map K L),
60+
norm_algebra_map, finrank _ hirr, totient_prime hp.out, ← succ_pred_eq_of_pos hpos, pow_succ,
61+
mul_comm _ (p : K), coe_coe, ← hζ.minpoly_eq_cyclotomic_of_irreducible hirr] at H,
62+
simpa [(mul_right_inj' $ ne_zero.ne ↑↑p).1 H],
6863
apply_instance },
6964
{ apply_instance },
7065
end

src/number_theory/cyclotomic/primitive_roots.lean

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alex Best, Riccardo Brasca, Eric Rodriguez
55
-/
66

7+
import data.pnat.prime
78
import algebra.is_prime_pow
89
import number_theory.cyclotomic.basic
910
import ring_theory.adjoin.power_basis
@@ -31,15 +32,14 @@ in the implementation details section.
3132
`zeta n A B` is a primitive `n`-th root of unity.
3233
* `is_cyclotomic_extension.finrank`: if `irreducible (cyclotomic n K)` (in particular for
3334
`K = ℚ`), then the `finrank` of a cyclotomic extension is `n.totient`.
34-
* `is_primitive_root.norm_eq_one`: If `K` is linearly ordered (in particular for `K = ℚ`), the norm
35-
of a primitive root is `1` if `n` is odd.
35+
* `is_primitive_root.norm_eq_one`: if `irreducible (cyclotomic n K)` (in particular for `K = ℚ`),
36+
the norm of a primitive root is `1` if `n ≠ 2`.
3637
* `is_primitive_root.sub_one_norm_eq_eval_cyclotomic`: if `irreducible (cyclotomic n K)`
3738
(in particular for `K = ℚ`), then the norm of `ζ - 1` is `eval 1 (cyclotomic n ℤ)`, for a
3839
primitive root ζ. We also prove the analogous of this result for `zeta`.
39-
* `is_primitive_root.prime_ne_two_pow.sub_one_norm` : if `irreducible (cyclotomic (p ^ (k + 1)) K)`
40+
* `is_primitive_root.sub_one_norm_prime_ne_two` : if `irreducible (cyclotomic (p ^ (k + 1)) K)`
4041
(in particular for `K = ℚ`) and `p` is an odd prime, then the norm of `ζ - 1` is `p`. We also
4142
prove the analogous of this result for `zeta`.
42-
gives a K-power basis for L given a primitive root `ζ`.
4343
* `is_primitive_root.embeddings_equiv_primitive_roots`: the equivalence between `L →ₐ[K] A`
4444
and `primitive_roots n A` given by the choice of `ζ`.
4545
@@ -175,20 +175,52 @@ section norm
175175
namespace is_primitive_root
176176

177177
variables [field L] {ζ : L} (hζ : is_primitive_root ζ n)
178+
variables {K} [field K] [algebra K L] [ne_zero ((n : ℕ) : K)]
179+
180+
/-- This mathematically trivial result is complementary to `norm_eq_one` below. -/
181+
lemma norm_eq_neg_one_pow (hζ : is_primitive_root ζ 2) : norm K ζ = (-1) ^ finrank K L :=
182+
by rw [hζ.eq_neg_one_of_two_right , show -1 = algebra_map K L (-1), by simp, norm_algebra_map]
178183

179184
include
180185

181-
/-- If `K` is linearly ordered (in particular for `K = ℚ`), the norm of a primitive root is `1`
186+
/-- If `irreducible (cyclotomic n K)` (in particular for `K = ℚ`), the norm of a primitive root is
187+
`1` if `n ≠ 2`. -/
188+
lemma norm_eq_one [is_cyclotomic_extension {n} K L] (hn : n ≠ 2)
189+
(hirr : irreducible (cyclotomic n K)) : norm K ζ = 1 :=
190+
begin
191+
by_cases h1 : n = 1,
192+
{ rw [h1, one_coe, one_right_iff] at hζ,
193+
rw [hζ, show 1 = algebra_map K L 1, by simp, norm_algebra_map, one_pow] },
194+
{ replace h1 : 2 ≤ n,
195+
{ by_contra' h,
196+
exact h1 (pnat.eq_one_of_lt_two h) },
197+
rw [← hζ.power_basis_gen K, power_basis.norm_gen_eq_coeff_zero_minpoly, hζ.power_basis_gen K,
198+
← hζ.minpoly_eq_cyclotomic_of_irreducible hirr, cyclotomic_coeff_zero _ h1, mul_one,
199+
hζ.power_basis_dim K, ← hζ.minpoly_eq_cyclotomic_of_irreducible hirr, nat_degree_cyclotomic],
200+
exact neg_one_pow_of_even (totient_even (lt_of_le_of_ne h1 (λ h, hn (pnat.coe_inj.1 h.symm)))) }
201+
end
202+
203+
/-- If `K` is linearly ordered, the norm of a primitive root is `1`
182204
if `n` is odd. -/
183-
lemma norm_eq_one [linear_ordered_field K] [algebra K L] (hodd : odd (n : ℕ)) : norm K ζ = 1 :=
205+
lemma norm_eq_one_of_linearly_ordered {K : Type*} [linear_ordered_field K] [algebra K L]
206+
(hodd : odd (n : ℕ)) : norm K ζ = 1 :=
184207
begin
185208
haveI := ne_zero.of_no_zero_smul_divisors K L n,
186209
have hz := congr_arg (norm K) ((is_primitive_root.iff_def _ n).1 hζ).1,
187210
rw [←(algebra_map K L).map_one , norm_algebra_map, one_pow, map_pow, ←one_pow ↑n] at hz,
188211
exact strict_mono.injective hodd.strict_mono_pow hz
189212
end
190213

191-
variables {K} [field K] [algebra K L] [ne_zero ((n : ℕ) : K)]
214+
lemma norm_of_cyclotomic_irreducible [is_cyclotomic_extension {n} K L]
215+
(hirr : irreducible (cyclotomic n K)) : norm K ζ = ite (n = 2) (-1) 1 :=
216+
begin
217+
split_ifs with hn,
218+
{ unfreezingI {subst hn},
219+
convert norm_eq_neg_one_pow hζ,
220+
erw [is_cyclotomic_extension.finrank _ hirr, totient_two, pow_one],
221+
apply_instance },
222+
{ exact hζ.norm_eq_one hn hirr }
223+
end
192224

193225
/-- If `irreducible (cyclotomic n K)` (in particular for `K = ℚ`), then the norm of
194226
`ζ - 1` is `eval 1 (cyclotomic n ℤ)`. -/
@@ -238,7 +270,7 @@ omit hζ
238270

239271
/-- If `irreducible (cyclotomic (p ^ (k + 1)) K)` (in particular for `K = ℚ`) and `p` is an odd
240272
prime, then the norm of `ζ - 1` is `p`. -/
241-
lemma prime_ne_two_pow_sub_one_norm {p : ℕ+} [ne_zero ((p : ℕ) : K)] {k : ℕ}
273+
lemma sub_one_norm_prime_ne_two {p : ℕ+} [ne_zero ((p : ℕ) : K)] {k : ℕ}
242274
(hζ : is_primitive_root ζ ↑(p ^ (k + 1))) [hpri : fact (p : ℕ).prime]
243275
[is_cyclotomic_extension {p ^ (k + 1)} K L]
244276
(hirr : irreducible (cyclotomic (↑(p ^ (k + 1)) : ℕ) K)) (h : p ≠ 2) :
@@ -267,13 +299,13 @@ begin
267299
replace hζ : is_primitive_root ζ (↑(p ^ (0 + 1)) : ℕ) := by simp [hζ],
268300
haveI : ne_zero ((↑(p ^ (0 + 1)) : ℕ) : K) := ⟨by simp [ne_zero.ne ((p : ℕ) : K)]⟩,
269301
haveI : is_cyclotomic_extension {p ^ (0 + 1)} K L := by simp [hcyc],
270-
simpa using prime_ne_two_pow_sub_one_norm hζ hirr h
302+
simpa using sub_one_norm_prime_ne_two hζ hirr h
271303
end
272304

273305
/-- If `irreducible (cyclotomic (2 ^ k) K)` (in particular for `K = ℚ`) and `k` is at least `2`,
274306
then the norm of `ζ - 1` is `2`. -/
275-
lemma sub_one_norm_pow_two [ne_zero (2 : K)] {k : ℕ} (hζ : is_primitive_root ζ (2 ^ k)) (hk : 2 ≤ k)
276-
[is_cyclotomic_extension {2 ^ k} K L] (hirr : irreducible (cyclotomic (2 ^ k) K)) :
307+
lemma sub_one_norm_pow_two [ne_zero (2 : K)] {k : ℕ} (hζ : is_primitive_root ζ (2 ^ k))
308+
(hk : 2 ≤ k) [is_cyclotomic_extension {2 ^ k} K L] (hirr : irreducible (cyclotomic (2 ^ k) K)) :
277309
norm K (ζ - 1) = 2 :=
278310
begin
279311
haveI : ne_zero (((2 ^ k : ℕ+) : ℕ) : K),
@@ -298,17 +330,17 @@ namespace is_cyclotomic_extension
298330

299331
open is_primitive_root
300332

301-
/-- If `K` is linearly ordered (in particular for `K = ℚ`), the norm of `zeta n K L` is `1`
333+
variables {K} (L) [field K] [field L] [algebra K L] [ne_zero ((n : ℕ) : K)]
334+
335+
/-- If `irreducible (cyclotomic n K)` (in particular for `K = ℚ`), the norm of `zeta n K L` is `1`
302336
if `n` is odd. -/
303-
lemma norm_zeta_eq_one (K : Type u) [linear_ordered_field K] (L : Type v) [field L] [algebra K L]
304-
[is_cyclotomic_extension {n} K L] (hodd : odd (n : ℕ)) : norm K (zeta n K L) = 1 :=
337+
lemma norm_zeta_eq_one [is_cyclotomic_extension {n} K L] (hn : n ≠ 2)
338+
(hirr : irreducible (cyclotomic n K)) : norm K (zeta n K L) = 1 :=
305339
begin
306340
haveI := ne_zero.of_no_zero_smul_divisors K L n,
307-
exact norm_eq_one K (zeta_primitive_root n K L) hodd,
341+
exact norm_eq_one (zeta_primitive_root n K L) hn hirr,
308342
end
309343

310-
variables {K} (L) [field K] [field L] [algebra K L] [ne_zero ((n : ℕ) : K)]
311-
312344
/-- If `is_prime_pow (n : ℕ)`, `n ≠ 2` and `irreducible (cyclotomic n K)` (in particular for
313345
`K = ℚ`), then the norm of `zeta n K L - 1` is `(n : ℕ).min_fac`. -/
314346
lemma is_prime_pow_norm_zeta_sub_one (hn : is_prime_pow (n : ℕ))
@@ -333,7 +365,7 @@ begin
333365
{ refine ⟨λ hzero, _⟩,
334366
rw [pow_coe] at hzero,
335367
simpa [ne_zero.ne ((p : ℕ) : L)] using hzero },
336-
exact prime_ne_two_pow_sub_one_norm (zeta_primitive_root _ K L) hirr h,
368+
exact sub_one_norm_prime_ne_two (zeta_primitive_root _ K L) hirr h,
337369
end
338370

339371
/-- If `irreducible (cyclotomic p K)` (in particular for `K = ℚ`) and `p` is an odd prime,

0 commit comments

Comments
 (0)