@@ -7,6 +7,7 @@ Authors: Riccardo Brasca, Pietro Monticone
7
7
import Mathlib.NumberTheory.Cyclotomic.Embeddings
8
8
import Mathlib.NumberTheory.Cyclotomic.Rat
9
9
import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem
10
+ import Mathlib.RingTheory.Fintype
10
11
11
12
/-!
12
13
# Third Cyclotomic Field
@@ -33,7 +34,9 @@ namespace IsCyclotomicExtension.Rat.Three
33
34
variable {K : Type *} [Field K] [NumberField K] [IsCyclotomicExtension {3 } ℚ K]
34
35
variable {ζ : K} (hζ : IsPrimitiveRoot ζ ↑(3 : ℕ+)) (u : (𝓞 K)ˣ)
35
36
local notation3 "η" => (IsPrimitiveRoot.isUnit (hζ.toInteger_isPrimitiveRoot) (by decide)).unit
36
- local notation3 "λ" => (η : 𝓞 K) - 1
37
+ local notation3 "λ" => hζ.toInteger - 1
38
+
39
+ lemma coe_eta : (η : 𝓞 K) = hζ.toInteger := rfl
37
40
38
41
/-- Let `u` be a unit in `(𝓞 K)ˣ`, then `u ∈ [1, -1, η, -η, η^2, -η^2]`. -/
39
42
-- Here `List` is more convenient than `Finset`, even if further from the informal statement.
@@ -62,15 +65,16 @@ theorem Units.mem : u ∈ [1, -1, η, -η, η ^ 2, -η ^ 2] := by
62
65
(isOfFinOrder_iff_pow_eq_one.2 ⟨n, hnpos, hn⟩)
63
66
replace hr : r ∈ Finset.Ico 0 3 := Finset.mem_Ico.2 ⟨by simp, hr3⟩
64
67
replace hru : ↑u = η ^ r ∨ ↑u = -η ^ r := by
65
- rcases hru with ( h | h)
68
+ rcases hru with h | h
66
69
· left; ext; exact h
67
70
· right; ext; exact h
68
- fin_cases hr <;> rcases hru with ( h | h) <;> simp [h]
71
+ fin_cases hr <;> rcases hru with h | h <;> simp [h]
69
72
70
73
/-- We have that `λ ^ 2 = -3 * η`. -/
71
74
private lemma lambda_sq : λ ^ 2 = -3 * η := by
72
75
ext
73
- calc (λ ^ 2 : K) = η ^ 2 + η + 1 - 3 * η := by ring
76
+ calc (λ ^ 2 : K) = η ^ 2 + η + 1 - 3 * η := by
77
+ simp only [RingOfIntegers.map_mk, IsUnit.unit_spec]; ring
74
78
_ = 0 - 3 * η := by simpa using hζ.isRoot_cyclotomic (by decide)
75
79
_ = -3 * η := by ring
76
80
@@ -109,3 +113,81 @@ theorem eq_one_or_neg_one_of_unit_of_congruent (hcong : ∃ n : ℤ, λ ^ 2 ∣
109
113
have : (hζ.pow_of_coprime 2 (by decide)).toInteger = hζ.toInteger ^ 2 := by ext; simp
110
114
simp only [this, PNat.val_ofNat, Nat.cast_ofNat, mul_neg, Int.cast_neg, ← neg_add, ←
111
115
sub_eq_iff_eq_add.1 hx, Units.val_neg, val_pow_eq_pow_val, IsUnit.unit_spec, neg_neg]
116
+
117
+ variable (x : 𝓞 K)
118
+
119
+ /-- Let `(x : 𝓞 K)`. Then we have that `λ` divides one amongst `x`, `x - 1` and `x + 1`. -/
120
+ lemma lambda_dvd_or_dvd_sub_one_or_dvd_add_one : λ ∣ x ∨ λ ∣ x - 1 ∨ λ ∣ x + 1 := by
121
+ classical
122
+ have := hζ.finite_quotient_toInteger_sub_one (by decide)
123
+ let _ := Fintype.ofFinite (𝓞 K ⧸ Ideal.span {λ})
124
+ let _ : Ring (𝓞 K ⧸ Ideal.span {λ}) := CommRing.toRing -- to speed up instance synthesis
125
+ let _ : AddGroup (𝓞 K ⧸ Ideal.span {λ}) := AddGroupWithOne.toAddGroup -- dito
126
+ have := Finset.mem_univ (Ideal.Quotient.mk (Ideal.span {λ}) x)
127
+ have h3 : Fintype.card (𝓞 K ⧸ Ideal.span {λ}) = 3 := by
128
+ rw [← Nat.card_eq_fintype_card, hζ.card_quotient_toInteger_sub_one (by decide),
129
+ hζ.norm_toInteger_sub_one_of_prime_ne_two' (by decide)]
130
+ simp only [PNat.val_ofNat, Nat.cast_ofNat, Int.reduceAbs]
131
+ rw [Finset.univ_of_card_le_three h3.le] at this
132
+ simp only [Finset.mem_insert, Finset.mem_singleton] at this
133
+ rcases this with h | h | h
134
+ · left
135
+ exact Ideal.mem_span_singleton.1 <| Ideal.Quotient.eq_zero_iff_mem.1 h
136
+ · right; left
137
+ refine Ideal.mem_span_singleton.1 <| Ideal.Quotient.eq_zero_iff_mem.1 ?_
138
+ rw [RingHom.map_sub, h, RingHom.map_one, sub_self]
139
+ · right; right
140
+ refine Ideal.mem_span_singleton.1 <| Ideal.Quotient.eq_zero_iff_mem.1 ?_
141
+ rw [RingHom.map_add, h, RingHom.map_one, add_left_neg]
142
+
143
+ /-- We have that `η ^ 2 + η + 1 = 0`. -/
144
+ lemma eta_sq_add_eta_add_one : (η : 𝓞 K) ^ 2 + η + 1 = 0 := by
145
+ rw [eta_sq]
146
+ ring
147
+
148
+ /-- We have that `x ^ 3 - 1 = (x - 1) * (x - η) * (x - η ^ 2)`. -/
149
+ lemma cube_sub_one_eq_mul : x ^ 3 - 1 = (x - 1 ) * (x - η) * (x - η ^ 2 ) := by
150
+ symm
151
+ calc _ = x ^ 3 - x ^ 2 * (η ^ 2 + η + 1 ) + x * (η ^ 2 + η + η ^ 3 ) - η ^ 3 := by ring
152
+ _ = x ^ 3 - x ^ 2 * (η ^ 2 + η + 1 ) + x * (η ^ 2 + η + 1 ) - 1 := by
153
+ simp [show hζ.toInteger ^ 3 = 1 from hζ.toInteger_isPrimitiveRoot.pow_eq_one]
154
+ _ = x ^ 3 - 1 := by rw [eta_sq_add_eta_add_one hζ]; ring
155
+
156
+ /-- We have that `λ` divides `x * (x - 1) * (x - (η + 1))`. -/
157
+ lemma lambda_dvd_mul_sub_one_mul_sub_eta_add_one : λ ∣ x * (x - 1 ) * (x - (η + 1 )) := by
158
+ rcases lambda_dvd_or_dvd_sub_one_or_dvd_add_one hζ x with h | h | h
159
+ · exact dvd_mul_of_dvd_left (dvd_mul_of_dvd_left h _) _
160
+ · exact dvd_mul_of_dvd_left (dvd_mul_of_dvd_right h _) _
161
+ · refine dvd_mul_of_dvd_right ?_ _
162
+ rw [show x - (η + 1 ) = x + 1 - (η - 1 + 3 ) by ring]
163
+ exact dvd_sub h <| dvd_add dvd_rfl hζ.toInteger_sub_one_dvd_prime'
164
+
165
+ /-- If `λ` divides `x - 1`, then `λ ^ 4` divides `x ^ 3 - 1`. -/
166
+ lemma lambda_pow_four_dvd_cube_sub_one_of_dvd_sub_one {x : 𝓞 K} (h : λ ∣ x - 1 ) :
167
+ λ ^ 4 ∣ x ^ 3 - 1 := by
168
+ obtain ⟨y, hy⟩ := h
169
+ have : x ^ 3 - 1 = λ ^ 3 * (y * (y - 1 ) * (y - (η + 1 ))) := by
170
+ calc _ = (x - 1 ) * (x - 1 - λ) * (x - 1 - λ * (η + 1 )) := by
171
+ simp only [coe_eta, cube_sub_one_eq_mul hζ x]; ring
172
+ _ = _ := by rw [hy]; ring
173
+ rw [this, pow_succ]
174
+ exact mul_dvd_mul_left _ (lambda_dvd_mul_sub_one_mul_sub_eta_add_one hζ y)
175
+
176
+ /-- If `λ` divides `x + 1`, then `λ ^ 4` divides `x ^ 3 + 1`. -/
177
+ lemma lambda_pow_four_dvd_cube_add_one_of_dvd_add_one {x : 𝓞 K} (h : λ ∣ x + 1 ) :
178
+ λ ^ 4 ∣ x ^ 3 + 1 := by
179
+ replace h : λ ∣ -x - 1 := by
180
+ convert h.neg_right using 1
181
+ exact (neg_add' x 1 ).symm
182
+ convert (lambda_pow_four_dvd_cube_sub_one_of_dvd_sub_one hζ h).neg_right using 1
183
+ ring
184
+
185
+ /-- If `λ` does not divide `x`, then `λ ^ 4` divides `x ^ 3 - 1` or `x ^ 3 + 1`. -/
186
+ lemma lambda_pow_four_dvd_cube_sub_one_or_add_one_of_lambda_not_dvd {x : 𝓞 K} (h : ¬ λ ∣ x) :
187
+ λ ^ 4 ∣ x ^ 3 - 1 ∨ λ ^ 4 ∣ x ^ 3 + 1 := by
188
+ rcases lambda_dvd_or_dvd_sub_one_or_dvd_add_one hζ x with H | H | H
189
+ · contradiction
190
+ · left
191
+ exact lambda_pow_four_dvd_cube_sub_one_of_dvd_sub_one hζ H
192
+ · right
193
+ exact lambda_pow_four_dvd_cube_add_one_of_dvd_add_one hζ H
0 commit comments