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

Commit 4a5728f

Browse files
committed
chore(number_theory/cyclotomic/zeta): generalize to primitive roots (#11941)
This was done as `(zeta p ℤ ℤ[ζₚ] : ℚ(ζₚ)) = zeta p ℚ ℚ(ζₚ)` is independent of Lean's type theory. Allows far more flexibility with results. Co-authored-by: Eric Rodriguez <37984851+ericrbg@users.noreply.github.com>
1 parent d487230 commit 4a5728f

File tree

3 files changed

+245
-237
lines changed

3 files changed

+245
-237
lines changed

src/number_theory/cyclotomic/gal.lean

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Eric Rodriguez
55
-/
66

7-
import number_theory.cyclotomic.zeta
7+
import number_theory.cyclotomic.primitive_roots
88
import field_theory.polynomial_galois_group
99

1010
/-!
@@ -40,19 +40,16 @@ it is always a subgroup, and if the `n`th cyclotomic polynomial is irreducible,
4040

4141
local attribute [instance] pnat.fact_pos
4242

43-
variables (n : ℕ+) (K : Type*) [field K] (L : Type*) [field L] {μ : L} (hμ : is_primitive_root μ n)
43+
variables {n : ℕ+} (K : Type*) [field K] {L : Type*} [field L] {μ : L} (hμ : is_primitive_root μ n)
4444
[algebra K L] [is_cyclotomic_extension {n} K L]
4545

46-
local notation ` := is_cyclotomic_extension.zeta n K L
46+
open polynomial ne_zero is_cyclotomic_extension
4747

48-
open polynomial ne_zero
49-
50-
namespace is_cyclotomic_extension
48+
namespace is_primitive_root
5149

5250
/-- `is_primitive_root.aut_to_pow` is injective in the case that it's considered over a cyclotomic
5351
field extension, where `n` does not divide the characteristic of K. -/
54-
lemma aut_to_pow_injective [ne_zero ((n : ℕ) : K)] : function.injective $
55-
(@zeta_primitive_root n K L _ _ _ _ _ $ of_no_zero_smul_divisors K L n).aut_to_pow K :=
52+
lemma aut_to_pow_injective : function.injective $ hμ.aut_to_pow K :=
5653
begin
5754
intros f g hfg,
5855
apply_fun units.val at hfg,
@@ -61,67 +58,66 @@ begin
6158
have hf := hf'.some_spec,
6259
have hg := hg'.some_spec,
6360
generalize_proofs hζ at hf hg,
64-
suffices : f .to_roots_of_unity = g .to_roots_of_unity,
61+
suffices : f .to_roots_of_unity = g .to_roots_of_unity,
6562
{ apply alg_equiv.coe_alg_hom_injective,
66-
apply (zeta.power_basis n K L).alg_hom_ext,
63+
apply (.power_basis K).alg_hom_ext,
6764
exact this },
6865
rw zmod.eq_iff_modeq_nat at hfg,
6966
refine (hf.trans _).trans hg.symm,
7067
rw [←roots_of_unity.coe_pow _ hf'.some, ←roots_of_unity.coe_pow _ hg'.some],
7168
congr' 1,
7269
rw [pow_eq_pow_iff_modeq],
7370
convert hfg,
74-
rw [.eq_order_of],
75-
rw [←.coe_to_roots_of_unity_coe] {occs := occurrences.pos [2]},
71+
rw [.eq_order_of],
72+
rw [←.coe_to_roots_of_unity_coe] {occs := occurrences.pos [2]},
7673
rw [order_of_units, order_of_subgroup]
7774
end
7875

76+
end is_primitive_root
77+
78+
namespace is_cyclotomic_extension
79+
7980
/-- Cyclotomic extensions are abelian. -/
8081
noncomputable def aut.comm_group [ne_zero ((n : ℕ) : K)] : comm_group (L ≃ₐ[K] L) :=
81-
(aut_to_pow_injective n K L).comm_group _ (map_one _) (map_mul _) (map_inv _) (map_div _)
82-
83-
/-- The power basis given by `ζ ^ t`. -/
84-
@[simps] noncomputable def zeta_pow_power_basis [ne_zero ((n : ℕ) : K)] (t : (zmod n)ˣ) :
85-
power_basis K L :=
86-
begin
87-
haveI := of_no_zero_smul_divisors K L n,
88-
refine power_basis.map (algebra.adjoin.power_basis $ integral {n} K L $ ζ ^ (t : zmod n).val) _,
89-
refine (subalgebra.equiv_of_eq _ _ (adjoin_primitive_root_eq_top n _ _)).trans algebra.top_equiv,
90-
exact (zeta_primitive_root n K L).pow_of_coprime _ (zmod.val_coe_unit_coprime t),
91-
end
82+
let _ := of_no_zero_smul_divisors K L n in by exactI
83+
((zeta_primitive_root n K L).aut_to_pow_injective K).comm_group _
84+
(map_one _) (map_mul _) (map_inv _) (map_div _)
9285

93-
variables (h : irreducible (cyclotomic n K)) {K}
86+
variables (h : irreducible (cyclotomic n K)) {K} (L)
9487

9588
include h
9689

97-
/-- The `mul_equiv` that takes an automorphism to the power of μ that μ gets mapped to under it.
98-
A stronger version of `is_primitive_root.aut_to_pow`. -/
90+
/-- The `mul_equiv` that takes an automorphism `f` to the element `k : (zmod n)ˣ` such that
91+
`f μ = μ ^ k`. A stronger version of `is_primitive_root.aut_to_pow`. -/
9992
@[simps] noncomputable def aut_equiv_pow [ne_zero ((n : ℕ) : K)] : (L ≃ₐ[K] L) ≃* (zmod n)ˣ :=
100-
let hn := of_no_zero_smul_divisors K L n in by exactI
101-
{ inv_fun := λ t, (zeta.power_basis n K L).equiv_of_minpoly (zeta_pow_power_basis n K L t)
93+
let hn := of_no_zero_smul_divisors K L n in
94+
by exactI
95+
let hζ := zeta_primitive_root n K L,
96+
hμ := λ t, hζ.pow_of_coprime _ (zmod.val_coe_unit_coprime t) in
97+
{ inv_fun := λ t, (hζ.power_basis K).equiv_of_minpoly ((hμ t).power_basis K)
10298
begin
103-
simp only [zeta.power_basis_gen, zeta_pow_power_basis_gen],
99+
simp only [is_primitive_root.power_basis_gen],
104100
have hr := is_primitive_root.minpoly_eq_cyclotomic_of_irreducible
105101
((zeta_primitive_root n K L).pow_of_coprime _ (zmod.val_coe_unit_coprime t)) h,
106102
exact ((zeta_primitive_root n K L).minpoly_eq_cyclotomic_of_irreducible h).symm.trans hr
107103
end,
108104
left_inv := λ f, begin
109105
simp only [monoid_hom.to_fun_eq_coe],
110106
apply alg_equiv.coe_alg_hom_injective,
111-
apply (zeta.power_basis n K L).alg_hom_ext,
107+
apply (.power_basis K).alg_hom_ext,
112108
simp only [alg_equiv.coe_alg_hom, alg_equiv.map_pow],
113109
rw power_basis.equiv_of_minpoly_gen,
114-
simp only [zeta_pow_power_basis_gen, zeta.power_basis_gen, is_primitive_root.aut_to_pow_spec],
110+
simp only [is_primitive_root.power_basis_gen, is_primitive_root.aut_to_pow_spec],
115111
end,
116112
right_inv := λ x, begin
117113
simp only [monoid_hom.to_fun_eq_coe],
118-
generalize_proofs _ _ h,
119-
have key := hζ.aut_to_pow_spec K ((zeta.power_basis n K L).equiv_of_minpoly
120-
(zeta_pow_power_basis n K L x) h),
121-
have := (zeta.power_basis n K L).equiv_of_minpoly_gen,
122-
rw zeta.power_basis_gen at this {occs := occurrences.pos [2]},
123-
rw [this, zeta_pow_power_basis_gen] at key,
124-
rw ← hζ.coe_to_roots_of_unity_coe at key {occs := occurrences.pos [1, 3]},
114+
generalize_proofs _ _ _ h,
115+
have key := hζ.aut_to_pow_spec K ((.power_basis K).equiv_of_minpoly
116+
((hμ x).power_basis K) h),
117+
have := (.power_basis K).equiv_of_minpoly_gen ((hμ x).power_basis K) h,
118+
rw .power_basis_gen K at this,
119+
rw [this, is_primitive_root.power_basis_gen] at key,
120+
rw ← hζ.coe_to_roots_of_unity_coe at key {occs := occurrences.pos [1, 5]},
125121
simp only [←coe_coe, ←roots_of_unity.coe_pow] at key,
126122
replace key := roots_of_unity.coe_injective key,
127123
rw [pow_eq_pow_iff_modeq, ←order_of_subgroup, ←order_of_units, hζ.coe_to_roots_of_unity_coe,
@@ -131,33 +127,28 @@ let hn := of_no_zero_smul_divisors K L n in by exactI
131127
end,
132128
.. (zeta_primitive_root n K L).aut_to_pow K }
133129

134-
end is_cyclotomic_extension
130+
include
135131

136-
open is_cyclotomic_extension
137-
138-
namespace is_primitive_root
139-
140-
variables (h : irreducible (cyclotomic n K)) {K L}
141-
142-
include h hμ
132+
variables {L}
143133

144134
/-- Maps `μ` to the `alg_equiv` that sends `is_cyclotomic_extension.zeta` to `μ`. -/
145135
noncomputable def from_zeta_aut [ne_zero ((n : ℕ) : K)] : L ≃ₐ[K] L :=
146136
have _ := of_no_zero_smul_divisors K L n, by exactI
147137
let hζ := (zeta_primitive_root n K L).eq_pow_of_pow_eq_one hμ.pow_eq_one n.pos in
148-
(aut_equiv_pow n L h).symm $ zmod.unit_of_coprime hζ.some $
138+
(aut_equiv_pow L h).symm $ zmod.unit_of_coprime hζ.some $
149139
((zeta_primitive_root n K L).pow_iff_coprime n.pos hζ.some).mp $ hζ.some_spec.some_spec.symm ▸ hμ
150140

151-
lemma from_zeta_aut_spec [ne_zero ((n : ℕ) : K)] : from_zeta_aut n hμ h ζ = μ :=
141+
lemma from_zeta_aut_spec [ne_zero ((n : ℕ) : K)] : from_zeta_aut hμ h (zeta n K L) = μ :=
152142
begin
153-
simp only [from_zeta_aut, exists_prop, aut_equiv_pow_symm_apply, ←zeta.power_basis_gen,
154-
power_basis.equiv_of_minpoly_gen, zeta_pow_power_basis_gen, zmod.coe_unit_of_coprime],
155-
generalize_proofs hζ,
156-
convert hζ.some_spec.2,
157-
exact zmod.val_cast_of_lt hζ.some_spec.1
143+
simp_rw [from_zeta_aut, aut_equiv_pow_symm_apply],
144+
generalize_proofs _ hζ h _ hμ _,
145+
rw [←hζ.power_basis_gen K] {occs := occurrences.pos [4]},
146+
rw [power_basis.equiv_of_minpoly_gen, hμ.power_basis_gen K],
147+
convert h.some_spec.some_spec,
148+
exact zmod.val_cast_of_lt h.some_spec.some
158149
end
159150

160-
end is_primitive_root
151+
end is_cyclotomic_extension
161152

162153
section gal
163154

@@ -171,14 +162,14 @@ characteristic of `K`, and `cyclotomic n K` is irreducible in the base field. -/
171162
noncomputable def gal_cyclotomic_equiv_units_zmod [ne_zero ((n : ℕ) : K)] :
172163
(cyclotomic n K).gal ≃* (zmod n)ˣ :=
173164
(alg_equiv.aut_congr (is_splitting_field.alg_equiv _ _)).symm.trans
174-
(is_cyclotomic_extension.aut_equiv_pow n L h)
165+
(is_cyclotomic_extension.aut_equiv_pow L h)
175166

176167
/-- `is_cyclotomic_extension.aut_equiv_pow` repackaged in terms of `gal`. Asserts that the
177168
Galois group of `X ^ n - 1` is equivalent to `(zmod n)ˣ` if `n` does not divide the characteristic
178169
of `K`, and `cyclotomic n K` is irreducible in the base field. -/
179170
noncomputable def gal_X_pow_equiv_units_zmod [ne_zero ((n : ℕ) : K)] :
180171
(X ^ (n : ℕ) - 1).gal ≃* (zmod n)ˣ :=
181172
(alg_equiv.aut_congr (is_splitting_field.alg_equiv _ _)).symm.trans
182-
(is_cyclotomic_extension.aut_equiv_pow n L h)
173+
(is_cyclotomic_extension.aut_equiv_pow L h)
183174

184175
end gal
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
/-
2+
Copyright (c) 2022 Riccardo Brasca. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Alex Best, Riccardo Brasca, Eric Rodriguez
5+
-/
6+
7+
import number_theory.cyclotomic.basic
8+
import ring_theory.adjoin.power_basis
9+
import ring_theory.norm
10+
11+
/-!
12+
# Primitive roots in cyclotomic fields
13+
If `is_cyclotomic_extension {n} A B`, we define an element `zeta n A B : B` that is (under certain
14+
assumptions) a primitive `n`-root of unity in `B` and we study its properties. We also prove related
15+
theorems under the more general assumption of just being a primitive root, for reasons described
16+
in the implementation details section.
17+
18+
## Main definitions
19+
* `is_cyclotomic_extension.zeta n A B`: if `is_cyclotomic_extension {n} A B`, than `zeta n A B`
20+
is an element of `B` that plays the role of a primitive `n`-th root of unity.
21+
* `is_primitive_root.power_basis`: if `K` and `L` are fields such that
22+
`is_cyclotomic_extension {n} K L` and `ne_zero (↑n : K)`, then `is_primitive_root.power_basis`
23+
gives a K-power basis for L given a primitive root `ζ`.
24+
* `is_primitive_root.embeddings_equiv_primitive_roots`: the equivalence between `L →ₐ[K] A`
25+
and `primitive_roots n A` given by the choice of `ζ`.
26+
27+
## Main results
28+
* `is_cyclotomic_extension.zeta_primitive_root`: if `is_domain B` and `ne_zero (↑n : B)`, then
29+
`zeta n A B` is a primitive `n`-th root of unity.
30+
* `is_cyclotomic_extension.finrank`: if `irreducible (cyclotomic n K)` (in particular for
31+
`K = ℚ`), then the `finrank` of a cyclotomic extension is `n.totient`.
32+
* `is_primitive_root.norm_eq_one`: If `K` is linearly ordered (in particular for `K = ℚ`), the norm
33+
of a primitive root is `1` if `n` is odd.
34+
* `is_primitive_root.sub_one_norm_eq_eval_cyclotomic`: If `irreducible (cyclotomic n K)`, then
35+
the norm of `ζ - 1` is `eval 1 (cyclotomic n ℤ)`.
36+
37+
## Implementation details
38+
`zeta n A B` is defined as any root of `cyclotomic n A` in `B`, that exists because of
39+
`is_cyclotomic_extension {n} A B`. It is not true in general that it is a primitive `n`-th root of
40+
unity, but this holds if `is_domain B` and `ne_zero (↑n : B)`.
41+
42+
`zeta n A B` is defined using `exists.some`, which means we cannot control it.
43+
For example, in normal mathematics, we can demand that `(zeta p ℤ ℤ[ζₚ] : ℚ(ζₚ))` is equal to
44+
`zeta p ℚ ℚ(ζₚ)`, as we are just choosing "an arbitrary primitive root" and we can internally
45+
specify that our choices agree. This is not the case here, and it is indeed impossible to prove that
46+
these two are equal. Therefore, whenever possible, we prove our results for any primitive root,
47+
and only at the "final step", when we need to provide an "explicit" primitive root, we use `zeta`.
48+
49+
-/
50+
51+
open polynomial algebra finset finite_dimensional is_cyclotomic_extension
52+
53+
54+
universes u v w z
55+
56+
variables {n : ℕ+} (A : Type w) (B : Type z) (K : Type u) {L : Type v} (C : Type w)
57+
variables [comm_ring A] [comm_ring B] [algebra A B] [is_cyclotomic_extension {n} A B]
58+
59+
section zeta
60+
61+
namespace is_cyclotomic_extension
62+
63+
variables (n)
64+
65+
/-- If `B` is a `n`-th cyclotomic extension of `A`, then `zeta n A B` is any root of
66+
`cyclotomic n A` in L. -/
67+
noncomputable def zeta : B :=
68+
(exists_root $ set.mem_singleton n : ∃ r : B, aeval r (cyclotomic n A) = 0).some
69+
70+
@[simp] lemma zeta_spec : aeval (zeta n A B) (cyclotomic n A) = 0 :=
71+
classical.some_spec (exists_root (set.mem_singleton n) : ∃ r : B, aeval r (cyclotomic n A) = 0)
72+
73+
lemma zeta_spec' : is_root (cyclotomic n B) (zeta n A B) :=
74+
by { convert zeta_spec n A B, rw [is_root.def, aeval_def, eval₂_eq_eval_map, map_cyclotomic] }
75+
76+
lemma zeta_pow : (zeta n A B) ^ (n : ℕ) = 1 :=
77+
is_root_of_unity_of_root_cyclotomic (nat.mem_divisors_self _ n.pos.ne') (zeta_spec' _ _ _)
78+
79+
/-- If `is_domain B` and `ne_zero (↑n : B)` then `zeta n A B` is a primitive `n`-th root of
80+
unity. -/
81+
lemma zeta_primitive_root [is_domain B] [ne_zero ((n : ℕ) : B)] :
82+
is_primitive_root (zeta n A B) n :=
83+
by { rw ←is_root_cyclotomic_iff, exact zeta_spec' n A B }
84+
85+
end is_cyclotomic_extension
86+
87+
end zeta
88+
89+
section no_order
90+
91+
variables [field K] [field L] [comm_ring C] [algebra K L] [algebra K C]
92+
[is_cyclotomic_extension {n} K L]
93+
{ζ : L} (hζ : is_primitive_root ζ n)
94+
95+
namespace is_primitive_root
96+
97+
/-- The `power_basis` given by a primitive root `ζ`. -/
98+
@[simps] noncomputable def power_basis : power_basis K L :=
99+
power_basis.map (algebra.adjoin.power_basis $ integral {n} K L ζ) $
100+
(subalgebra.equiv_of_eq _ _ (is_cyclotomic_extension.adjoin_primitive_root_eq_top n _ hζ)).trans
101+
top_equiv
102+
103+
variables {K}
104+
105+
/-- The equivalence between `L →ₐ[K] A` and `primitive_roots n A` given by a primitive root `ζ`. -/
106+
@[simps] noncomputable def embeddings_equiv_primitive_roots [is_domain C] [ne_zero ((n : ℕ) : K)]
107+
(hirr : irreducible (cyclotomic n K)) : (L →ₐ[K] C) ≃ primitive_roots n C :=
108+
((hζ.power_basis K).lift_equiv).trans
109+
{ to_fun := λ x,
110+
begin
111+
haveI hn := ne_zero.of_no_zero_smul_divisors K C n,
112+
refine ⟨x.1, _⟩,
113+
cases x,
114+
rwa [mem_primitive_roots n.pos, ←is_root_cyclotomic_iff, is_root.def,
115+
←map_cyclotomic _ (algebra_map K C), hζ.minpoly_eq_cyclotomic_of_irreducible hirr,
116+
←eval₂_eq_eval_map, ←aeval_def]
117+
end,
118+
inv_fun := λ x,
119+
begin
120+
haveI hn := ne_zero.of_no_zero_smul_divisors K C n,
121+
refine ⟨x.1, _⟩,
122+
cases x,
123+
rwa [aeval_def, eval₂_eq_eval_map, hζ.power_basis_gen K,
124+
←hζ.minpoly_eq_cyclotomic_of_irreducible hirr, map_cyclotomic, ←is_root.def,
125+
is_root_cyclotomic_iff, ← mem_primitive_roots n.pos]
126+
end,
127+
left_inv := λ x, subtype.ext rfl,
128+
right_inv := λ x, subtype.ext rfl }
129+
130+
end is_primitive_root
131+
132+
namespace is_cyclotomic_extension
133+
134+
variables {K} (L)
135+
136+
/-- If `irreducible (cyclotomic n K)` (in particular for `K = ℚ`), then the `finrank` of a
137+
cyclotomic extension is `n.totient`. -/
138+
lemma finrank (hirr : irreducible (cyclotomic n K)) [ne_zero ((n : ℕ) : K)] :
139+
finrank K L = (n : ℕ).totient :=
140+
begin
141+
haveI := ne_zero.of_no_zero_smul_divisors K L n,
142+
rw [((zeta_primitive_root n K L).power_basis K).finrank, is_primitive_root.power_basis_dim,
143+
←(zeta_primitive_root n K L).minpoly_eq_cyclotomic_of_irreducible hirr, nat_degree_cyclotomic]
144+
end
145+
146+
end is_cyclotomic_extension
147+
148+
end no_order
149+
150+
namespace is_primitive_root
151+
152+
section norm
153+
154+
variables [field L] {ζ : L} (hζ : is_primitive_root ζ n)
155+
156+
include
157+
158+
/-- If `K` is linearly ordered (in particular for `K = ℚ`), the norm of a primitive root is `1`
159+
if `n` is odd. -/
160+
lemma norm_eq_one [linear_ordered_field K] [algebra K L] (hodd : odd (n : ℕ)) : norm K ζ = 1 :=
161+
begin
162+
haveI := ne_zero.of_no_zero_smul_divisors K L n,
163+
have hz := congr_arg (norm K) ((is_primitive_root.iff_def _ n).1 hζ).1,
164+
rw [←(algebra_map K L).map_one , norm_algebra_map, one_pow, map_pow, ←one_pow ↑n] at hz,
165+
exact strict_mono.injective hodd.strict_mono_pow hz
166+
end
167+
168+
variables {K}
169+
170+
/-- If `irreducible (cyclotomic n K)` (in particular for `K = ℚ`), then the norm of
171+
`ζ - 1` is `eval 1 (cyclotomic n ℤ)`. -/
172+
lemma sub_one_norm_eq_eval_cyclotomic [field K] [algebra K L] [is_cyclotomic_extension {n} K L]
173+
[ne_zero ((n : ℕ) : K)] (h : 2 < (n : ℕ)) (hirr : irreducible (cyclotomic n K)) :
174+
norm K (ζ - 1) = ↑(eval 1 (cyclotomic n ℤ)) :=
175+
begin
176+
let E := algebraic_closure L,
177+
obtain ⟨z, hz⟩ := is_alg_closed.exists_root _ (degree_cyclotomic_pos n E n.pos).ne.symm,
178+
apply (algebra_map K E).injective,
179+
letI := finite_dimensional {n} K L,
180+
letI := is_galois n K L,
181+
rw [norm_eq_prod_embeddings],
182+
conv_lhs { congr, skip, funext,
183+
rw [← neg_sub, alg_hom.map_neg, alg_hom.map_sub, alg_hom.map_one, neg_eq_neg_one_mul] },
184+
rw [prod_mul_distrib, prod_const, card_univ, alg_hom.card, is_cyclotomic_extension.finrank L hirr,
185+
nat.neg_one_pow_of_even (nat.totient_even h), one_mul],
186+
have : univ.prod (λ (σ : L →ₐ[K] E), 1 - σ ζ) = eval 1 (cyclotomic' n E),
187+
{ rw [cyclotomic', eval_prod, ← @finset.prod_attach E E, ← univ_eq_attach],
188+
refine fintype.prod_equiv (hζ.embeddings_equiv_primitive_roots E hirr) _ _ (λ σ, _),
189+
simp },
190+
haveI : ne_zero ((n : ℕ) : E) := (ne_zero.of_no_zero_smul_divisors K _ (n : ℕ)),
191+
rw [this, cyclotomic', ← cyclotomic_eq_prod_X_sub_primitive_roots (is_root_cyclotomic_iff.1 hz),
192+
← map_cyclotomic_int, (algebra_map K E).map_int_cast, ←int.cast_one, eval_int_cast_map,
193+
ring_hom.eq_int_cast, int.cast_id]
194+
end
195+
196+
end norm
197+
198+
end is_primitive_root

0 commit comments

Comments
 (0)