Skip to content

Commit 88fac4f

Browse files
chore: refactor roots of unity to avoid PNat (#18516)
This is an attempt to refactor the definition of `rootsOfUnity` using a `Nat` instead of a `PNat`. * In the definition of `rootsOfUnity`, we replace `(n : ℕ+)` by `(n : ℕ)`. The definition does not require `n` to be nonzero; it gives that `rootsOfUnity 0 M` is the top subgroup of the unit group of `M`. * For results that need a positive `n`, we replace `(n : ℕ+)` with `(n : ℕ) [NeZero n]` in the parameters. In this way, they transparently apply when a `PNat` is used for `n` since `n` gets coerced to `Nat` and an `NeZero (n : ℕ)` instance is available. The main benefit is that one no longer needs constructions like `rootsOfUnity ⟨n, <proof that n is positive⟩) R` when `n` is a natural number; one can simply use `rootsOfUnity n R`. (One may need to turn the positivity proof into an `NeZero` instance, however, if that is not available automatically.) In addition, the code in `Mathlib.RingTheory.RootsOfUnity.Basic` can be simplified a bit in places, e.g., `x ^ (k : ℕ)` can be replaced by `x ^ k` and `∃ (i : ℕ), i < k ∧ P i` can be replaced by `∃ i < k, P i`. One result (`eq_pow_of_mem_rootsOfUnity'`; it was translating between `Nat`s and `PNat`s) can be removed altogether. Since I was going through this file anyway, I took the opportunity to replace `=>` by `↦` and to do some golfing as well. What this PR does *not* do is also refactoring cyclotomic extensions to not use (sets of) `PNat`s. This is a more complex matter and requires more thought and discussion.
1 parent cff2508 commit 88fac4f

File tree

11 files changed

+327
-352
lines changed

11 files changed

+327
-352
lines changed

Mathlib/FieldTheory/KummerExtension.lean

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ We first develop the theory for a specific `K[n√a] := AdjoinRoot (X ^ n - C a)
246246
The main result is the description of the galois group: `autAdjoinRootXPowSubCEquiv`.
247247
-/
248248

249-
variable {n : ℕ} (hζ : (primitiveRoots n K).Nonempty) (hn : 0 < n)
249+
variable {n : ℕ} (hζ : (primitiveRoots n K).Nonempty)
250250
variable (a : K) (H : Irreducible (X ^ n - C a))
251251

252252
set_option quotPrecheck false in
@@ -280,14 +280,15 @@ theorem Polynomial.separable_X_pow_sub_C_of_irreducible : (X ^ n - C a).Separabl
280280
exact (hζ.map_of_injective (algebraMap K K[n√a]).injective).injOn_pow_mul
281281
(root_X_pow_sub_C_ne_zero (lt_of_le_of_ne (show 1 ≤ n from hn) (Ne.symm hn')) _)
282282

283+
variable (n)
284+
283285
/-- The natural embedding of the roots of unity of `K` into `Gal(K[ⁿ√a]/K)`, by sending
284286
`η ↦ (ⁿ√a ↦ η • ⁿ√a)`. Also see `autAdjoinRootXPowSubC` for the `AlgEquiv` version. -/
285287
noncomputable
286288
def autAdjoinRootXPowSubCHom :
287-
rootsOfUnity ⟨n, hn⟩ K →* (K[n√a] →ₐ[K] K[n√a]) where
289+
rootsOfUnity n K →* (K[n√a] →ₐ[K] K[n√a]) where
288290
toFun := fun η ↦ liftHom (X ^ n - C a) (((η : Kˣ) : K) • (root _) : K[n√a]) <| by
289291
have := (mem_rootsOfUnity' _ _).mp η.prop
290-
dsimp at this
291292
rw [map_sub, map_pow, aeval_C, aeval_X, Algebra.smul_def, mul_pow, root_X_pow_sub_C_pow,
292293
AdjoinRoot.algebraMap_eq, ← map_pow, this, map_one, one_mul, sub_self]
293294
map_one' := algHom_ext <| by simp
@@ -298,11 +299,13 @@ def autAdjoinRootXPowSubCHom :
298299
See `autAdjoinRootXPowSubCEquiv`. -/
299300
noncomputable
300301
def autAdjoinRootXPowSubC :
301-
rootsOfUnity ⟨n, hn⟩ K →* (K[n√a] ≃ₐ[K] K[n√a]) :=
302-
(AlgEquiv.algHomUnitsEquiv _ _).toMonoidHom.comp (autAdjoinRootXPowSubCHom hn a).toHomUnits
302+
rootsOfUnity n K →* (K[n√a] ≃ₐ[K] K[n√a]) :=
303+
(AlgEquiv.algHomUnitsEquiv _ _).toMonoidHom.comp (autAdjoinRootXPowSubCHom n a).toHomUnits
304+
305+
variable {n}
303306

304307
lemma autAdjoinRootXPowSubC_root (η) :
305-
autAdjoinRootXPowSubC hn a η (root _) = ((η : Kˣ) : K) • root _ := by
308+
autAdjoinRootXPowSubC n a η (root _) = ((η : Kˣ) : K) • root _ := by
306309
dsimp [autAdjoinRootXPowSubC, autAdjoinRootXPowSubCHom, AlgEquiv.algHomUnitsEquiv]
307310
apply liftHom_root
308311

@@ -311,34 +314,33 @@ variable {a}
311314
/-- The inverse function of `autAdjoinRootXPowSubC` if `K` has all roots of unity.
312315
See `autAdjoinRootXPowSubCEquiv`. -/
313316
noncomputable
314-
def AdjoinRootXPowSubCEquivToRootsOfUnity (σ : K[n√a] ≃ₐ[K] K[n√a]) :
315-
rootsOfUnity ⟨n, hn⟩ K :=
317+
def AdjoinRootXPowSubCEquivToRootsOfUnity [NeZero n] (σ : K[n√a] ≃ₐ[K] K[n√a]) :
318+
rootsOfUnity n K :=
316319
letI := Fact.mk H
317320
letI : IsDomain K[n√a] := inferInstance
318321
letI := Classical.decEq K
319-
(rootsOfUnityEquivOfPrimitiveRoots (n := ⟨n, hn⟩) (algebraMap K K[n√a]).injective hζ).symm
322+
(rootsOfUnityEquivOfPrimitiveRoots (n := n) (algebraMap K K[n√a]).injective hζ).symm
320323
(rootsOfUnity.mkOfPowEq (if a = 0 then 1 else σ (root _) / root _) (by
321324
-- The if is needed in case `n = 1` and `a = 0` and `K[n√a] = K`.
322325
split
323326
· exact one_pow _
324327
rw [div_pow, ← map_pow]
325-
simp only [PNat.mk_coe, root_X_pow_sub_C_pow, ← AdjoinRoot.algebraMap_eq, AlgEquiv.commutes]
328+
simp only [root_X_pow_sub_C_pow, ← AdjoinRoot.algebraMap_eq, AlgEquiv.commutes]
326329
rw [div_self]
327330
rwa [Ne, map_eq_zero_iff _ (algebraMap K _).injective]))
328331

329332
/-- The equivalence between the roots of unity of `K` and `Gal(K[ⁿ√a]/K)`. -/
330333
noncomputable
331-
def autAdjoinRootXPowSubCEquiv :
332-
rootsOfUnity ⟨n, hn⟩ K ≃* (K[n√a] ≃ₐ[K] K[n√a]) where
333-
__ := autAdjoinRootXPowSubC hn a
334-
invFun := AdjoinRootXPowSubCEquivToRootsOfUnity hζ hn H
334+
def autAdjoinRootXPowSubCEquiv [NeZero n] :
335+
rootsOfUnity n K ≃* (K[n√a] ≃ₐ[K] K[n√a]) where
336+
__ := autAdjoinRootXPowSubC n a
337+
invFun := AdjoinRootXPowSubCEquivToRootsOfUnity hζ H
335338
left_inv := by
336339
intro η
337340
have := Fact.mk H
338341
have : IsDomain K[n√a] := inferInstance
339342
letI : Algebra K K[n√a] := inferInstance
340-
apply (rootsOfUnityEquivOfPrimitiveRoots
341-
(n := ⟨n, hn⟩) (algebraMap K K[n√a]).injective hζ).injective
343+
apply (rootsOfUnityEquivOfPrimitiveRoots (algebraMap K K[n√a]).injective hζ).injective
342344
ext
343345
simp only [AdjoinRoot.algebraMap_eq, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe,
344346
autAdjoinRootXPowSubC_root, Algebra.smul_def, ne_eq, MulEquiv.apply_symm_apply,
@@ -347,36 +349,34 @@ def autAdjoinRootXPowSubCEquiv :
347349
split_ifs with h
348350
· obtain rfl := not_imp_not.mp (fun hn ↦ ne_zero_of_irreducible_X_pow_sub_C' hn H) h
349351
have : (η : Kˣ) = 1 := (pow_one _).symm.trans η.prop
350-
simp only [PNat.mk_one, this, Units.val_one, map_one]
351-
· exact mul_div_cancel_right₀ _ (root_X_pow_sub_C_ne_zero' hn h)
352+
simp only [this, Units.val_one, map_one]
353+
· exact mul_div_cancel_right₀ _ (root_X_pow_sub_C_ne_zero' (NeZero.pos n) h)
352354
right_inv := by
353355
intro e
354356
have := Fact.mk H
355357
letI : Algebra K K[n√a] := inferInstance
356358
apply AlgEquiv.coe_algHom_injective
357359
apply AdjoinRoot.algHom_ext
358-
simp only [AdjoinRoot.algebraMap_eq, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe,
359-
AlgHom.coe_coe, autAdjoinRootXPowSubC_root, Algebra.smul_def, PNat.mk_coe,
360-
AdjoinRootXPowSubCEquivToRootsOfUnity]
360+
simp only [AdjoinRootXPowSubCEquivToRootsOfUnity, AdjoinRoot.algebraMap_eq, OneHom.toFun_eq_coe,
361+
MonoidHom.toOneHom_coe, AlgHom.coe_coe, autAdjoinRootXPowSubC_root, Algebra.smul_def]
361362
rw [rootsOfUnityEquivOfPrimitiveRoots_symm_apply, rootsOfUnity.val_mkOfPowEq_coe]
362363
split_ifs with h
363364
· obtain rfl := not_imp_not.mp (fun hn ↦ ne_zero_of_irreducible_X_pow_sub_C' hn H) h
364365
rw [(pow_one _).symm.trans (root_X_pow_sub_C_pow 1 a), one_mul,
365366
← AdjoinRoot.algebraMap_eq, AlgEquiv.commutes]
366-
· refine div_mul_cancel₀ _ (root_X_pow_sub_C_ne_zero' hn h)
367+
· refine div_mul_cancel₀ _ (root_X_pow_sub_C_ne_zero' (NeZero.pos n) h)
367368

368-
lemma autAdjoinRootXPowSubCEquiv_root (η) :
369-
autAdjoinRootXPowSubCEquiv hζ hn H η (root _) = ((η : Kˣ) : K) • root _ :=
370-
autAdjoinRootXPowSubC_root hn a η
369+
lemma autAdjoinRootXPowSubCEquiv_root [NeZero n] (η) :
370+
autAdjoinRootXPowSubCEquiv hζ H η (root _) = ((η : Kˣ) : K) • root _ :=
371+
autAdjoinRootXPowSubC_root a η
371372

372-
lemma autAdjoinRootXPowSubCEquiv_symm_smul (σ) :
373-
((autAdjoinRootXPowSubCEquiv hζ hn H).symm σ : Kˣ) • (root _ : K[n√a]) = σ (root _) := by
373+
lemma autAdjoinRootXPowSubCEquiv_symm_smul [NeZero n] (σ) :
374+
((autAdjoinRootXPowSubCEquiv hζ H).symm σ : Kˣ) • (root _ : K[n√a]) = σ (root _) := by
374375
have := Fact.mk H
375376
simp only [autAdjoinRootXPowSubCEquiv, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe,
376377
MulEquiv.symm_mk, MulEquiv.coe_mk, Equiv.coe_fn_symm_mk, AdjoinRootXPowSubCEquivToRootsOfUnity,
377-
AdjoinRoot.algebraMap_eq, Units.smul_def, Algebra.smul_def,
378-
rootsOfUnityEquivOfPrimitiveRoots_symm_apply, rootsOfUnity.mkOfPowEq, PNat.mk_coe,
379-
Units.val_ofPowEqOne, ite_mul, one_mul, ne_eq]
378+
AdjoinRoot.algebraMap_eq, rootsOfUnity.mkOfPowEq, Units.smul_def, Algebra.smul_def,
379+
rootsOfUnityEquivOfPrimitiveRoots_symm_apply, Units.val_ofPowEqOne, ite_mul, one_mul]
380380
simp_rw [← root_X_pow_sub_C_eq_zero_iff H]
381381
split_ifs with h
382382
· rw [h, map_zero]
@@ -459,8 +459,8 @@ abbrev rootOfSplitsXPowSubC (hn : 0 < n) (a : K)
459459
(rootOfSplits _ (IsSplittingField.splits L (X ^ n - C a))
460460
(by simpa [degree_X_pow_sub_C hn] using Nat.pos_iff_ne_zero.mp hn))
461461

462-
lemma rootOfSplitsXPowSubC_pow :
463-
(rootOfSplitsXPowSubC hn a L) ^ n = algebraMap K L a := by
462+
lemma rootOfSplitsXPowSubC_pow [NeZero n] :
463+
(rootOfSplitsXPowSubC (NeZero.pos n) a L) ^ n = algebraMap K L a := by
464464
have := map_rootOfSplits _ (IsSplittingField.splits L (X ^ n - C a))
465465
simp only [eval₂_sub, eval₂_X_pow, eval₂_C, sub_eq_zero] at this
466466
exact this _
@@ -471,15 +471,15 @@ variable {a}
471471
roots of unity in `K` if `K` contains all of them.
472472
Note that this does not depend on a choice of `ⁿ√a`. -/
473473
noncomputable
474-
def autEquivRootsOfUnity :
475-
(L ≃ₐ[K] L) ≃* (rootsOfUnity ⟨n, hn⟩ K) :=
476-
(AlgEquiv.autCongr (adjoinRootXPowSubCEquiv hζ H (rootOfSplitsXPowSubC_pow hn a L)).symm).trans
477-
(autAdjoinRootXPowSubCEquiv hζ hn H).symm
478-
479-
lemma autEquivRootsOfUnity_apply_rootOfSplit (σ : L ≃ₐ[K] L) :
480-
σ (rootOfSplitsXPowSubC hn a L) =
481-
autEquivRootsOfUnity hζ hn H L σ • (rootOfSplitsXPowSubC hn a L) := by
482-
obtain ⟨η, rfl⟩ := (autEquivRootsOfUnity hζ hn H L).symm.surjective σ
474+
def autEquivRootsOfUnity [NeZero n] :
475+
(L ≃ₐ[K] L) ≃* (rootsOfUnity n K) :=
476+
(AlgEquiv.autCongr (adjoinRootXPowSubCEquiv hζ H (rootOfSplitsXPowSubC_pow a L)).symm).trans
477+
(autAdjoinRootXPowSubCEquiv hζ H).symm
478+
479+
lemma autEquivRootsOfUnity_apply_rootOfSplit [NeZero n] (σ : L ≃ₐ[K] L) :
480+
σ (rootOfSplitsXPowSubC (NeZero.pos n) a L) =
481+
autEquivRootsOfUnity hζ H L σ • (rootOfSplitsXPowSubC (NeZero.pos n) a L) := by
482+
obtain ⟨η, rfl⟩ := (autEquivRootsOfUnity hζ H L).symm.surjective σ
483483
rw [MulEquiv.apply_symm_apply, autEquivRootsOfUnity]
484484
simp only [MulEquiv.symm_trans_apply, AlgEquiv.autCongr_symm, AlgEquiv.symm_symm,
485485
MulEquiv.symm_symm, AlgEquiv.autCongr_apply, AlgEquiv.trans_apply,
@@ -488,43 +488,44 @@ lemma autEquivRootsOfUnity_apply_rootOfSplit (σ : L ≃ₐ[K] L) :
488488
rfl
489489

490490
include hα in
491-
lemma autEquivRootsOfUnity_smul (σ : L ≃ₐ[K] L) :
492-
autEquivRootsOfUnity hζ hn H L σ • α = σ α := by
491+
lemma autEquivRootsOfUnity_smul [NeZero n] (σ : L ≃ₐ[K] L) :
492+
autEquivRootsOfUnity hζ H L σ • α = σ α := by
493493
have ⟨ζ, hζ'⟩ := hζ
494+
have hn := NeZero.pos n
494495
rw [mem_primitiveRoots hn] at hζ'
495496
rw [← mem_nthRoots hn, (hζ'.map_of_injective (algebraMap K L).injective).nthRoots_eq
496-
(rootOfSplitsXPowSubC_pow hn a L)] at hα
497+
(rootOfSplitsXPowSubC_pow a L)] at hα
497498
simp only [Finset.range_val, Multiset.mem_map, Multiset.mem_range] at hα
498499
obtain ⟨i, _, rfl⟩ := hα
499500
simp only [map_mul, ← map_pow, ← Algebra.smul_def, map_smul,
500-
autEquivRootsOfUnity_apply_rootOfSplit hζ hn H L]
501+
autEquivRootsOfUnity_apply_rootOfSplit hζ H L]
501502
exact smul_comm _ _ _
502503

503504
/-- Suppose `L/K` is the splitting field of `Xⁿ - a`, and `ζ` is a `n`-th primitive root of unity
504505
in `K`, then `Gal(L/K)` is isomorphic to `ZMod n`. -/
505506
noncomputable
506-
def autEquivZmod {ζ : K} (hζ : IsPrimitiveRoot ζ n) :
507+
def autEquivZmod [NeZero n] {ζ : K} (hζ : IsPrimitiveRoot ζ n) :
507508
(L ≃ₐ[K] L) ≃* Multiplicative (ZMod n) :=
508509
haveI hn := Nat.pos_iff_ne_zero.mpr (ne_zero_of_irreducible_X_pow_sub_C H)
509-
(autEquivRootsOfUnity ⟨ζ, (mem_primitiveRoots hn).mpr hζ⟩ hn H L).trans
510-
((MulEquiv.subgroupCongr (IsPrimitiveRoot.zpowers_eq (k := ⟨n, hn⟩)
510+
(autEquivRootsOfUnity ⟨ζ, (mem_primitiveRoots hn).mpr hζ⟩ H L).trans
511+
((MulEquiv.subgroupCongr (IsPrimitiveRoot.zpowers_eq
511512
(hζ.isUnit_unit' hn)).symm).trans (AddEquiv.toMultiplicative'
512513
(hζ.isUnit_unit' hn).zmodEquivZPowers.symm))
513514

514515
include hα in
515-
lemma autEquivZmod_symm_apply_intCast {ζ : K} (hζ : IsPrimitiveRoot ζ n) (m : ℤ) :
516+
lemma autEquivZmod_symm_apply_intCast [NeZero n] {ζ : K} (hζ : IsPrimitiveRoot ζ n) (m : ℤ) :
516517
(autEquivZmod H L hζ).symm (Multiplicative.ofAdd (m : ZMod n)) α = ζ ^ m • α := by
517518
have hn := Nat.pos_iff_ne_zero.mpr (ne_zero_of_irreducible_X_pow_sub_C H)
518-
rw [← autEquivRootsOfUnity_smul ⟨ζ, (mem_primitiveRoots hn).mpr hζ⟩ hn H L hα]
519+
rw [← autEquivRootsOfUnity_smul ⟨ζ, (mem_primitiveRoots hn).mpr hζ⟩ H L hα]
519520
simp [MulEquiv.subgroupCongr_symm_apply, Subgroup.smul_def, Units.smul_def, autEquivZmod]
520521

521522
include hα in
522-
lemma autEquivZmod_symm_apply_natCast {ζ : K} (hζ : IsPrimitiveRoot ζ n) (m : ℕ) :
523+
lemma autEquivZmod_symm_apply_natCast [NeZero n] {ζ : K} (hζ : IsPrimitiveRoot ζ n) (m : ℕ) :
523524
(autEquivZmod H L hζ).symm (Multiplicative.ofAdd (m : ZMod n)) α = ζ ^ m • α := by
524525
simpa only [Int.cast_natCast, zpow_natCast] using autEquivZmod_symm_apply_intCast H L hα hζ m
525526

526527
include hζ H in
527-
lemma isCyclic_of_isSplittingField_X_pow_sub_C : IsCyclic (L ≃ₐ[K] L) :=
528+
lemma isCyclic_of_isSplittingField_X_pow_sub_C [NeZero n] : IsCyclic (L ≃ₐ[K] L) :=
528529
have hn := Nat.pos_iff_ne_zero.mpr (ne_zero_of_irreducible_X_pow_sub_C H)
529530
isCyclic_of_surjective _
530531
(autEquivZmod H _ <| (mem_primitiveRoots hn).mp hζ.choose_spec).symm.surjective
@@ -641,6 +642,7 @@ lemma isCyclic_tfae (K L) [Field K] [Field L] [Algebra K L] [FiniteDimensional K
641642
∃ a : K, Irreducible (X ^ (finrank K L) - C a) ∧
642643
IsSplittingField K L (X ^ (finrank K L) - C a),
643644
∃ (α : L), α ^ (finrank K L) ∈ Set.range (algebraMap K L) ∧ K⟮α⟯ = ⊤] := by
645+
have : NeZero (Module.finrank K L) := NeZero.of_pos finrank_pos
644646
tfae_have 13
645647
| ⟨inst₁, inst₂⟩ => exists_root_adjoin_eq_top_of_isCyclic K L hK
646648
tfae_have 32

Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,16 @@ theorem mem_center_iff {A : SpecialLinearGroup n R} :
266266
simpa only [coe_mul, ← hr] using (scalar_commute (n := n) r (Commute.all r) B).symm
267267

268268
/-- An equivalence of groups, from the center of the special linear group to the roots of unity. -/
269+
-- replaced `(Fintype.card n).mkPNat'` by `Fintype.card n` (note `n` is nonempty here)
269270
@[simps]
270271
def center_equiv_rootsOfUnity' (i : n) :
271-
center (SpecialLinearGroup n R) ≃* rootsOfUnity (Fintype.card n).toPNat' R where
272-
toFun A := rootsOfUnity.mkOfPowEq (↑ₘA i i) <| by
273-
have : Nonempty n := ⟨i⟩
274-
obtain ⟨r, hr, hr'⟩ := mem_center_iff.mp A.property
275-
replace hr' : A.val i i = r := by simp [← hr']
276-
simp [hr, hr']
272+
center (SpecialLinearGroup n R) ≃* rootsOfUnity (Fintype.card n) R where
273+
toFun A :=
274+
haveI : Nonempty n := ⟨i⟩
275+
rootsOfUnity.mkOfPowEq (↑ₘA i i) <| by
276+
obtain ⟨r, hr, hr'⟩ := mem_center_iff.mp A.property
277+
replace hr' : A.val i i = r := by simp only [← hr', scalar_apply, diagonal_apply_eq]
278+
simp only [hr', hr]
277279
invFun a := ⟨⟨a • (1 : Matrix n n R), by aesop⟩,
278280
Subgroup.mem_center_iff.mpr fun B ↦ Subtype.val_injective <| by simp [coe_mul]⟩
279281
left_inv A := by
@@ -294,13 +296,17 @@ open scoped Classical in
294296
/-- An equivalence of groups, from the center of the special linear group to the roots of unity.
295297
296298
See also `center_equiv_rootsOfUnity'`. -/
299+
-- replaced `(Fintype.card n).mkPNat'` by what it means, avoiding `PNat`s.
297300
noncomputable def center_equiv_rootsOfUnity :
298-
center (SpecialLinearGroup n R) ≃* rootsOfUnity (Fintype.card n).toPNat' R :=
301+
center (SpecialLinearGroup n R) ≃* rootsOfUnity (max (Fintype.card n) 1) R :=
299302
(isEmpty_or_nonempty n).by_cases
300303
(fun hn ↦ by
301-
rw [center_eq_bot_of_subsingleton, Fintype.card_eq_zero, Nat.toPNat'_zero, rootsOfUnity_one]
304+
rw [center_eq_bot_of_subsingleton, Fintype.card_eq_zero, max_eq_right_of_lt zero_lt_one,
305+
rootsOfUnity_one]
302306
exact MulEquiv.mulEquivOfUnique)
303-
(fun _ ↦ center_equiv_rootsOfUnity' (Classical.arbitrary n))
307+
(fun _ ↦
308+
(max_eq_left (NeZero.one_le : 1 ≤ Fintype.card n)).symm ▸
309+
center_equiv_rootsOfUnity' (Classical.arbitrary n))
304310

305311
end center
306312

Mathlib/NumberTheory/Cyclotomic/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n :
353353
rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def]
354354
exact hx.2
355355
· simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx
356-
obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos
356+
obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx
357357
refine SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin ?_) _)
358358
rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot]
359359
exact ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩
@@ -362,7 +362,7 @@ theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B
362362
(hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by
363363
refine le_antisymm (adjoin_le fun x hx => ?_) (adjoin_mono fun x hx => ?_)
364364
· suffices hx : x ^ n.1 = 1 by
365-
obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos
365+
obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx
366366
exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _)
367367
refine (isRoot_of_unity_iff n.pos B).2 ?_
368368
refine ⟨n, Nat.mem_divisors_self n n.ne_zero, ?_⟩

0 commit comments

Comments
 (0)